@maplat/tin 0.8.2 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/es5/index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  /*! For license information please see index.js.LICENSE.txt */
2
- !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var r in n)("object"==typeof exports?exports:t)[r]=n[r]}}(this,(function(){return(()=>{var t={2273:(t,e,n)=>{"use strict";var r=n(2349),i=n(4529),o=n(3842),s=n(6960),a=n(146)[3];function u(t,e,n){e=Math.max(0,void 0===e?2:e),n=n||0;for(var o,a=function(t){for(var e=t[0],n=t[0],r=t[0],o=t[0],a=0;a<t.length;a++){var u=t[a];u[0]<e[0]&&(e=u),u[0]>r[0]&&(r=u),u[1]<n[1]&&(n=u),u[1]>o[1]&&(o=u)}var c=[e,n,r,o],l=c.slice();for(a=0;a<t.length;a++)s(t[a],c)||l.push(t[a]);var h=i(l),p=[];for(a=0;a<h.length;a++)p.push(l[h[a]]);return p}(t),u=r(16,["[0]","[1]","[0]","[1]"]).load(t),l=[],h=0;h<a.length;h++){var p=a[h];u.remove(p),o=d(p,o),l.push(o)}var f=r(16);for(h=0;h<l.length;h++)f.insert(g(l[h]));for(var _=e*e,v=n*n;l.length;){var m=l.shift(),x=m.p,E=m.next.p,I=y(x,E);if(!(I<v)){var b=I/_;(p=c(u,m.prev.p,x,E,m.next.next.p,b,f))&&Math.min(y(p,x),y(p,E))<=b&&(l.push(m),l.push(d(p,m)),u.remove(p),f.remove(m),f.insert(g(m)),f.insert(g(m.next)))}}m=o;var w=[];do{w.push(m.p),m=m.next}while(m!==o);return w.push(m.p),w}function c(t,e,n,r,i,s,a){for(var u=new o(null,l),c=t.data;c;){for(var p=0;p<c.children.length;p++){var g=c.children[p],d=c.leaf?_(g,n,r):h(n,r,g);d>s||u.push({node:g,dist:d})}for(;u.length&&!u.peek().node.children;){var y=u.pop(),v=y.node,m=_(v,e,n),x=_(v,r,i);if(y.dist<m&&y.dist<x&&f(n,v,a)&&f(r,v,a))return v}(c=u.pop())&&(c=c.node)}return null}function l(t,e){return t.dist-e.dist}function h(t,e,n){if(p(t,n)||p(e,n))return 0;var r=v(t[0],t[1],e[0],e[1],n.minX,n.minY,n.maxX,n.minY);if(0===r)return 0;var i=v(t[0],t[1],e[0],e[1],n.minX,n.minY,n.minX,n.maxY);if(0===i)return 0;var o=v(t[0],t[1],e[0],e[1],n.maxX,n.minY,n.maxX,n.maxY);if(0===o)return 0;var s=v(t[0],t[1],e[0],e[1],n.minX,n.maxY,n.maxX,n.maxY);return 0===s?0:Math.min(r,i,o,s)}function p(t,e){return t[0]>=e.minX&&t[0]<=e.maxX&&t[1]>=e.minY&&t[1]<=e.maxY}function f(t,e,n){for(var r,i,o,s,u=Math.min(t[0],e[0]),c=Math.min(t[1],e[1]),l=Math.max(t[0],e[0]),h=Math.max(t[1],e[1]),p=n.search({minX:u,minY:c,maxX:l,maxY:h}),f=0;f<p.length;f++)if(r=p[f].p,i=p[f].next.p,o=t,r!==(s=e)&&i!==o&&a(r,i,o)>0!=a(r,i,s)>0&&a(o,s,r)>0!=a(o,s,i)>0)return!1;return!0}function g(t){var e=t.p,n=t.next.p;return t.minX=Math.min(e[0],n[0]),t.minY=Math.min(e[1],n[1]),t.maxX=Math.max(e[0],n[0]),t.maxY=Math.max(e[1],n[1]),t}function d(t,e){var n={p:t,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return e?(n.next=e.next,n.prev=e,e.next.prev=n,e.next=n):(n.prev=n,n.next=n),n}function y(t,e){var n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}function _(t,e,n){var r=e[0],i=e[1],o=n[0]-r,s=n[1]-i;if(0!==o||0!==s){var a=((t[0]-r)*o+(t[1]-i)*s)/(o*o+s*s);a>1?(r=n[0],i=n[1]):a>0&&(r+=o*a,i+=s*a)}return(o=t[0]-r)*o+(s=t[1]-i)*s}function v(t,e,n,r,i,o,s,a){var u,c,l,h,p=n-t,f=r-e,g=s-i,d=a-o,y=t-i,_=e-o,v=p*p+f*f,m=p*g+f*d,x=g*g+d*d,E=p*y+f*_,I=g*y+d*_,b=v*x-m*m,w=b,N=b;0===b?(c=0,w=1,h=I,N=x):(h=v*I-m*E,(c=m*I-x*E)<0?(c=0,h=I,N=x):c>w&&(c=w,h=I+m,N=x)),h<0?(h=0,-E<0?c=0:-E>v?c=w:(c=-E,w=v)):h>N&&(h=N,-E+m<0?c=0:-E+m>v?c=w:(c=-E+m,w=v));var S=(1-(l=0===h?0:h/N))*i+l*s-((1-(u=0===c?0:c/w))*t+u*n),C=(1-l)*o+l*a-((1-u)*e+u*r);return S*S+C*C}t.exports=u,t.exports.default=u},6327:function(t){t.exports=function(){"use strict";function t(n,r,i,o,s){for(;o>i;){if(o-i>600){var a=o-i+1,u=r-i+1,c=Math.log(a),l=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*l*(a-l)/a)*(u-a/2<0?-1:1);t(n,r,Math.max(i,Math.floor(r-u*l/a+h)),Math.min(o,Math.floor(r+(a-u)*l/a+h)),s)}var p=n[r],f=i,g=o;for(e(n,i,r),s(n[o],p)>0&&e(n,i,o);f<g;){for(e(n,f,g),f++,g--;s(n[f],p)<0;)f++;for(;s(n[g],p)>0;)g--}0===s(n[i],p)?e(n,i,g):e(n,++g,o),g<=r&&(i=g+1),r<=g&&(o=g-1)}}function e(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function n(t,e){return t<e?-1:t>e?1:0}return function(e,r,i,o,s){t(e,r,i||0,o||e.length-1,s||n)}}()},2349:(t,e,n)=>{"use strict";t.exports=i,t.exports.default=i;var r=n(6327);function i(t,e){if(!(this instanceof i))return new i(t,e);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&this._initFormat(e),this.clear()}function o(t,e,n){if(!n)return e.indexOf(t);for(var r=0;r<e.length;r++)if(n(t,e[r]))return r;return-1}function s(t,e){a(t,0,t.children.length,e,t)}function a(t,e,n,r,i){i||(i=d(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o,s=e;s<n;s++)o=t.children[s],u(i,t.leaf?r(o):o);return i}function u(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function c(t,e){return t.minX-e.minX}function l(t,e){return t.minY-e.minY}function h(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function p(t){return t.maxX-t.minX+(t.maxY-t.minY)}function f(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function g(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function d(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(t,e,n,i,o){for(var s,a=[e,n];a.length;)(n=a.pop())-(e=a.pop())<=i||(s=e+Math.ceil((n-e)/i/2)*i,r(t,s,e,n,o),a.push(e,s,s,n))}i.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,n=[],r=this.toBBox;if(!g(t,e))return n;for(var i,o,s,a,u=[];e;){for(i=0,o=e.children.length;i<o;i++)s=e.children[i],g(t,a=e.leaf?r(s):s)&&(e.leaf?n.push(s):f(t,a)?this._all(s,n):u.push(s));e=u.pop()}return n},collides:function(t){var e=this.data,n=this.toBBox;if(!g(t,e))return!1;for(var r,i,o,s,a=[];e;){for(r=0,i=e.children.length;r<i;r++)if(o=e.children[r],g(t,s=e.leaf?n(o):o)){if(e.leaf||f(t,s))return!0;a.push(o)}e=a.pop()}return!1},load:function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0,n=t.length;e<n;e++)this.insert(t[e]);return this}var r=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===r.height)this._splitRoot(this.data,r);else{if(this.data.height<r.height){var i=this.data;this.data=r,r=i}this._insert(r,this.data.height-r.height-1,!0)}else this.data=r;return this},insert:function(t){return t&&this._insert(t,this.data.height-1),this},clear:function(){return this.data=d([]),this},remove:function(t,e){if(!t)return this;for(var n,r,i,s,a=this.data,u=this.toBBox(t),c=[],l=[];a||c.length;){if(a||(a=c.pop(),r=c[c.length-1],n=l.pop(),s=!0),a.leaf&&-1!==(i=o(t,a.children,e)))return a.children.splice(i,1),c.push(a),this._condense(c),this;s||a.leaf||!f(a,u)?r?(n++,a=r.children[n],s=!1):a=null:(c.push(a),l.push(n),n=0,r=a,a=a.children[0])}return this},toBBox:function(t){return t},compareMinX:c,compareMinY:l,toJSON:function(){return this.data},fromJSON:function(t){return this.data=t,this},_all:function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},_build:function(t,e,n,r){var i,o=n-e+1,a=this._maxEntries;if(o<=a)return s(i=d(t.slice(e,n+1)),this.toBBox),i;r||(r=Math.ceil(Math.log(o)/Math.log(a)),a=Math.ceil(o/Math.pow(a,r-1))),(i=d([])).leaf=!1,i.height=r;var u,c,l,h,p=Math.ceil(o/a),f=p*Math.ceil(Math.sqrt(a));for(y(t,e,n,f,this.compareMinX),u=e;u<=n;u+=f)for(y(t,u,l=Math.min(u+f-1,n),p,this.compareMinY),c=u;c<=l;c+=p)h=Math.min(c+p-1,l),i.children.push(this._build(t,c,h,r-1));return s(i,this.toBBox),i},_chooseSubtree:function(t,e,n,r){for(var i,o,s,a,u,c,l,p,f,g;r.push(e),!e.leaf&&r.length-1!==n;){for(l=p=1/0,i=0,o=e.children.length;i<o;i++)u=h(s=e.children[i]),f=t,g=s,(c=(Math.max(g.maxX,f.maxX)-Math.min(g.minX,f.minX))*(Math.max(g.maxY,f.maxY)-Math.min(g.minY,f.minY))-u)<p?(p=c,l=u<l?u:l,a=s):c===p&&u<l&&(l=u,a=s);e=a||e.children[0]}return e},_insert:function(t,e,n){var r=this.toBBox,i=n?t:r(t),o=[],s=this._chooseSubtree(i,this.data,e,o);for(s.children.push(t),u(s,i);e>=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(i,o,e)},_split:function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var o=this._chooseSplitIndex(n,i,r),a=d(n.children.splice(o,n.children.length-o));a.height=n.height,a.leaf=n.leaf,s(n,this.toBBox),s(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(n,a)},_splitRoot:function(t,e){this.data=d([t,e]),this.data.height=t.height+1,this.data.leaf=!1,s(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,n){var r,i,o,s,u,c,l,p,f,g,d,y,_,v;for(c=l=1/0,r=e;r<=n-e;r++)f=i=a(t,0,r,this.toBBox),g=o=a(t,r,n,this.toBBox),void 0,void 0,void 0,void 0,d=Math.max(f.minX,g.minX),y=Math.max(f.minY,g.minY),_=Math.min(f.maxX,g.maxX),v=Math.min(f.maxY,g.maxY),s=Math.max(0,_-d)*Math.max(0,v-y),u=h(i)+h(o),s<c?(c=s,p=r,l=u<l?u:l):s===c&&u<l&&(l=u,p=r);return p},_chooseSplitAxis:function(t,e,n){var r=t.leaf?this.compareMinX:c,i=t.leaf?this.compareMinY:l;this._allDistMargin(t,e,n,r)<this._allDistMargin(t,e,n,i)&&t.children.sort(r)},_allDistMargin:function(t,e,n,r){t.children.sort(r);var i,o,s=this.toBBox,c=a(t,0,e,s),l=a(t,n-e,n,s),h=p(c)+p(l);for(i=e;i<n-e;i++)o=t.children[i],u(c,t.leaf?s(o):o),h+=p(c);for(i=n-e-1;i>=e;i--)o=t.children[i],u(l,t.leaf?s(o):o),h+=p(l);return h},_adjustParentBBoxes:function(t,e,n){for(var r=n;r>=0;r--)u(e[r],t)},_condense:function(t){for(var e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children).splice(e.indexOf(t[n]),1):this.clear():s(t[n],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}}},3099:t=>{t.exports=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t}},6077:(t,e,n)=>{var r=n(111);t.exports=function(t){if(!r(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype");return t}},1223:(t,e,n)=>{var r=n(5112),i=n(30),o=n(3070),s=r("unscopables"),a=Array.prototype;null==a[s]&&o.f(a,s,{configurable:!0,value:i(null)}),t.exports=function(t){a[s][t]=!0}},1530:(t,e,n)=>{"use strict";var r=n(8710).charAt;t.exports=function(t,e,n){return e+(n?r(t,e).length:1)}},5787:t=>{t.exports=function(t,e,n){if(!(t instanceof e))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return t}},9670:(t,e,n)=>{var r=n(111);t.exports=function(t){if(!r(t))throw TypeError(String(t)+" is not an object");return t}},4019:t=>{t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},260:(t,e,n)=>{"use strict";var r,i=n(4019),o=n(9781),s=n(7854),a=n(111),u=n(6656),c=n(648),l=n(8880),h=n(1320),p=n(3070).f,f=n(9518),g=n(7674),d=n(5112),y=n(9711),_=s.Int8Array,v=_&&_.prototype,m=s.Uint8ClampedArray,x=m&&m.prototype,E=_&&f(_),I=v&&f(v),b=Object.prototype,w=b.isPrototypeOf,N=d("toStringTag"),S=y("TYPED_ARRAY_TAG"),C=i&&!!g&&"Opera"!==c(s.opera),O=!1,L={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},T={BigInt64Array:8,BigUint64Array:8},M=function(t){if(!a(t))return!1;var e=c(t);return u(L,e)||u(T,e)};for(r in L)s[r]||(C=!1);if((!C||"function"!=typeof E||E===Function.prototype)&&(E=function(){throw TypeError("Incorrect invocation")},C))for(r in L)s[r]&&g(s[r],E);if((!C||!I||I===b)&&(I=E.prototype,C))for(r in L)s[r]&&g(s[r].prototype,I);if(C&&f(x)!==I&&g(x,I),o&&!u(I,N))for(r in O=!0,p(I,N,{get:function(){return a(this)?this[S]:void 0}}),L)s[r]&&l(s[r],S,r);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:C,TYPED_ARRAY_TAG:O&&S,aTypedArray:function(t){if(M(t))return t;throw TypeError("Target is not a typed array")},aTypedArrayConstructor:function(t){if(g){if(w.call(E,t))return t}else for(var e in L)if(u(L,r)){var n=s[e];if(n&&(t===n||w.call(n,t)))return t}throw TypeError("Target is not a typed array constructor")},exportTypedArrayMethod:function(t,e,n){if(o){if(n)for(var r in L){var i=s[r];if(i&&u(i.prototype,t))try{delete i.prototype[t]}catch(t){}}I[t]&&!n||h(I,t,n?e:C&&v[t]||e)}},exportTypedArrayStaticMethod:function(t,e,n){var r,i;if(o){if(g){if(n)for(r in L)if((i=s[r])&&u(i,t))try{delete i[t]}catch(t){}if(E[t]&&!n)return;try{return h(E,t,n?e:C&&E[t]||e)}catch(t){}}for(r in L)!(i=s[r])||i[t]&&!n||h(i,t,e)}},isView:function(t){if(!a(t))return!1;var e=c(t);return"DataView"===e||u(L,e)||u(T,e)},isTypedArray:M,TypedArray:E,TypedArrayPrototype:I}},3331:(t,e,n)=>{"use strict";var r=n(7854),i=n(9781),o=n(4019),s=n(8880),a=n(2248),u=n(7293),c=n(5787),l=n(9958),h=n(7466),p=n(7067),f=n(1179),g=n(9518),d=n(7674),y=n(8006).f,_=n(3070).f,v=n(1285),m=n(8003),x=n(9909),E=x.get,I=x.set,b="ArrayBuffer",w="DataView",N="Wrong index",S=r.ArrayBuffer,C=S,O=r.DataView,L=O&&O.prototype,T=Object.prototype,M=r.RangeError,P=f.pack,R=f.unpack,A=function(t){return[255&t]},D=function(t){return[255&t,t>>8&255]},F=function(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]},k=function(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]},B=function(t){return P(t,23,4)},G=function(t){return P(t,52,8)},U=function(t,e){_(t.prototype,e,{get:function(){return E(this)[e]}})},q=function(t,e,n,r){var i=p(n),o=E(t);if(i+e>o.byteLength)throw M(N);var s=E(o.buffer).bytes,a=i+o.byteOffset,u=s.slice(a,a+e);return r?u:u.reverse()},j=function(t,e,n,r,i,o){var s=p(n),a=E(t);if(s+e>a.byteLength)throw M(N);for(var u=E(a.buffer).bytes,c=s+a.byteOffset,l=r(+i),h=0;h<e;h++)u[c+h]=l[o?h:e-h-1]};if(o){if(!u((function(){S(1)}))||!u((function(){new S(-1)}))||u((function(){return new S,new S(1.5),new S(NaN),S.name!=b}))){for(var V,Y=(C=function(t){return c(this,C),new S(p(t))}).prototype=S.prototype,X=y(S),z=0;X.length>z;)(V=X[z++])in C||s(C,V,S[V]);Y.constructor=C}d&&g(L)!==T&&d(L,T);var W=new O(new C(2)),H=L.setInt8;W.setInt8(0,2147483648),W.setInt8(1,2147483649),!W.getInt8(0)&&W.getInt8(1)||a(L,{setInt8:function(t,e){H.call(this,t,e<<24>>24)},setUint8:function(t,e){H.call(this,t,e<<24>>24)}},{unsafe:!0})}else C=function(t){c(this,C,b);var e=p(t);I(this,{bytes:v.call(new Array(e),0),byteLength:e}),i||(this.byteLength=e)},O=function(t,e,n){c(this,O,w),c(t,C,w);var r=E(t).byteLength,o=l(e);if(o<0||o>r)throw M("Wrong offset");if(o+(n=void 0===n?r-o:h(n))>r)throw M("Wrong length");I(this,{buffer:t,byteLength:n,byteOffset:o}),i||(this.buffer=t,this.byteLength=n,this.byteOffset=o)},i&&(U(C,"byteLength"),U(O,"buffer"),U(O,"byteLength"),U(O,"byteOffset")),a(O.prototype,{getInt8:function(t){return q(this,1,t)[0]<<24>>24},getUint8:function(t){return q(this,1,t)[0]},getInt16:function(t){var e=q(this,2,t,arguments.length>1?arguments[1]:void 0);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=q(this,2,t,arguments.length>1?arguments[1]:void 0);return e[1]<<8|e[0]},getInt32:function(t){return k(q(this,4,t,arguments.length>1?arguments[1]:void 0))},getUint32:function(t){return k(q(this,4,t,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(t){return R(q(this,4,t,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(t){return R(q(this,8,t,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(t,e){j(this,1,t,A,e)},setUint8:function(t,e){j(this,1,t,A,e)},setInt16:function(t,e){j(this,2,t,D,e,arguments.length>2?arguments[2]:void 0)},setUint16:function(t,e){j(this,2,t,D,e,arguments.length>2?arguments[2]:void 0)},setInt32:function(t,e){j(this,4,t,F,e,arguments.length>2?arguments[2]:void 0)},setUint32:function(t,e){j(this,4,t,F,e,arguments.length>2?arguments[2]:void 0)},setFloat32:function(t,e){j(this,4,t,B,e,arguments.length>2?arguments[2]:void 0)},setFloat64:function(t,e){j(this,8,t,G,e,arguments.length>2?arguments[2]:void 0)}});m(C,b),m(O,w),t.exports={ArrayBuffer:C,DataView:O}},1048:(t,e,n)=>{"use strict";var r=n(7908),i=n(1400),o=n(7466),s=Math.min;t.exports=[].copyWithin||function(t,e){var n=r(this),a=o(n.length),u=i(t,a),c=i(e,a),l=arguments.length>2?arguments[2]:void 0,h=s((void 0===l?a:i(l,a))-c,a-u),p=1;for(c<u&&u<c+h&&(p=-1,c+=h-1,u+=h-1);h-- >0;)c in n?n[u]=n[c]:delete n[u],u+=p,c+=p;return n}},1285:(t,e,n)=>{"use strict";var r=n(7908),i=n(1400),o=n(7466);t.exports=function(t){for(var e=r(this),n=o(e.length),s=arguments.length,a=i(s>1?arguments[1]:void 0,n),u=s>2?arguments[2]:void 0,c=void 0===u?n:i(u,n);c>a;)e[a++]=t;return e}},8457:(t,e,n)=>{"use strict";var r=n(9974),i=n(7908),o=n(3411),s=n(7659),a=n(7466),u=n(6135),c=n(1246);t.exports=function(t){var e,n,l,h,p,f,g=i(t),d="function"==typeof this?this:Array,y=arguments.length,_=y>1?arguments[1]:void 0,v=void 0!==_,m=c(g),x=0;if(v&&(_=r(_,y>2?arguments[2]:void 0,2)),null==m||d==Array&&s(m))for(n=new d(e=a(g.length));e>x;x++)f=v?_(g[x],x):g[x],u(n,x,f);else for(p=(h=m.call(g)).next,n=new d;!(l=p.call(h)).done;x++)f=v?o(h,_,[l.value,x],!0):l.value,u(n,x,f);return n.length=x,n}},1318:(t,e,n)=>{var r=n(5656),i=n(7466),o=n(1400),s=function(t){return function(e,n,s){var a,u=r(e),c=i(u.length),l=o(s,c);if(t&&n!=n){for(;c>l;)if((a=u[l++])!=a)return!0}else for(;c>l;l++)if((t||l in u)&&u[l]===n)return t||l||0;return!t&&-1}};t.exports={includes:s(!0),indexOf:s(!1)}},2092:(t,e,n)=>{var r=n(9974),i=n(8361),o=n(7908),s=n(7466),a=n(5417),u=[].push,c=function(t){var e=1==t,n=2==t,c=3==t,l=4==t,h=6==t,p=7==t,f=5==t||h;return function(g,d,y,_){for(var v,m,x=o(g),E=i(x),I=r(d,y,3),b=s(E.length),w=0,N=_||a,S=e?N(g,b):n||p?N(g,0):void 0;b>w;w++)if((f||w in E)&&(m=I(v=E[w],w,x),t))if(e)S[w]=m;else if(m)switch(t){case 3:return!0;case 5:return v;case 6:return w;case 2:u.call(S,v)}else switch(t){case 4:return!1;case 7:u.call(S,v)}return h?-1:c||l?l:S}};t.exports={forEach:c(0),map:c(1),filter:c(2),some:c(3),every:c(4),find:c(5),findIndex:c(6),filterOut:c(7)}},6583:(t,e,n)=>{"use strict";var r=n(5656),i=n(9958),o=n(7466),s=n(9341),a=Math.min,u=[].lastIndexOf,c=!!u&&1/[1].lastIndexOf(1,-0)<0,l=s("lastIndexOf"),h=c||!l;t.exports=h?function(t){if(c)return u.apply(this,arguments)||0;var e=r(this),n=o(e.length),s=n-1;for(arguments.length>1&&(s=a(s,i(arguments[1]))),s<0&&(s=n+s);s>=0;s--)if(s in e&&e[s]===t)return s||0;return-1}:u},1194:(t,e,n)=>{var r=n(7293),i=n(5112),o=n(7392),s=i("species");t.exports=function(t){return o>=51||!r((function(){var e=[];return(e.constructor={})[s]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}},9341:(t,e,n)=>{"use strict";var r=n(7293);t.exports=function(t,e){var n=[][t];return!!n&&r((function(){n.call(null,e||function(){throw 1},1)}))}},3671:(t,e,n)=>{var r=n(3099),i=n(7908),o=n(8361),s=n(7466),a=function(t){return function(e,n,a,u){r(n);var c=i(e),l=o(c),h=s(c.length),p=t?h-1:0,f=t?-1:1;if(a<2)for(;;){if(p in l){u=l[p],p+=f;break}if(p+=f,t?p<0:h<=p)throw TypeError("Reduce of empty array with no initial value")}for(;t?p>=0:h>p;p+=f)p in l&&(u=n(u,l[p],p,c));return u}};t.exports={left:a(!1),right:a(!0)}},4362:t=>{var e=Math.floor,n=function(t,o){var s=t.length,a=e(s/2);return s<8?r(t,o):i(n(t.slice(0,a),o),n(t.slice(a),o),o)},r=function(t,e){for(var n,r,i=t.length,o=1;o<i;){for(r=o,n=t[o];r&&e(t[r-1],n)>0;)t[r]=t[--r];r!==o++&&(t[r]=n)}return t},i=function(t,e,n){for(var r=t.length,i=e.length,o=0,s=0,a=[];o<r||s<i;)o<r&&s<i?a.push(n(t[o],e[s])<=0?t[o++]:e[s++]):a.push(o<r?t[o++]:e[s++]);return a};t.exports=n},5417:(t,e,n)=>{var r=n(111),i=n(3157),o=n(5112)("species");t.exports=function(t,e){var n;return i(t)&&("function"!=typeof(n=t.constructor)||n!==Array&&!i(n.prototype)?r(n)&&null===(n=n[o])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===e?0:e)}},3411:(t,e,n)=>{var r=n(9670),i=n(9212);t.exports=function(t,e,n,o){try{return o?e(r(n)[0],n[1]):e(n)}catch(e){throw i(t),e}}},7072:(t,e,n)=>{var r=n(5112)("iterator"),i=!1;try{var o=0,s={next:function(){return{done:!!o++}},return:function(){i=!0}};s[r]=function(){return this},Array.from(s,(function(){throw 2}))}catch(t){}t.exports=function(t,e){if(!e&&!i)return!1;var n=!1;try{var o={};o[r]=function(){return{next:function(){return{done:n=!0}}}},t(o)}catch(t){}return n}},4326:t=>{var e={}.toString;t.exports=function(t){return e.call(t).slice(8,-1)}},648:(t,e,n)=>{var r=n(1694),i=n(4326),o=n(5112)("toStringTag"),s="Arguments"==i(function(){return arguments}());t.exports=r?i:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),o))?n:s?i(e):"Object"==(r=i(e))&&"function"==typeof e.callee?"Arguments":r}},9920:(t,e,n)=>{var r=n(6656),i=n(3887),o=n(1236),s=n(3070);t.exports=function(t,e){for(var n=i(e),a=s.f,u=o.f,c=0;c<n.length;c++){var l=n[c];r(t,l)||a(t,l,u(e,l))}}},8544:(t,e,n)=>{var r=n(7293);t.exports=!r((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},4230:(t,e,n)=>{var r=n(4488),i=/"/g;t.exports=function(t,e,n,o){var s=String(r(t)),a="<"+e;return""!==n&&(a+=" "+n+'="'+String(o).replace(i,"&quot;")+'"'),a+">"+s+"</"+e+">"}},4994:(t,e,n)=>{"use strict";var r=n(3383).IteratorPrototype,i=n(30),o=n(9114),s=n(8003),a=n(7497),u=function(){return this};t.exports=function(t,e,n){var c=e+" Iterator";return t.prototype=i(r,{next:o(1,n)}),s(t,c,!1,!0),a[c]=u,t}},8880:(t,e,n)=>{var r=n(9781),i=n(3070),o=n(9114);t.exports=r?function(t,e,n){return i.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},9114:t=>{t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},6135:(t,e,n)=>{"use strict";var r=n(7593),i=n(3070),o=n(9114);t.exports=function(t,e,n){var s=r(e);s in t?i.f(t,s,o(0,n)):t[s]=n}},654:(t,e,n)=>{"use strict";var r=n(2109),i=n(4994),o=n(9518),s=n(7674),a=n(8003),u=n(8880),c=n(1320),l=n(5112),h=n(1913),p=n(7497),f=n(3383),g=f.IteratorPrototype,d=f.BUGGY_SAFARI_ITERATORS,y=l("iterator"),_="keys",v="values",m="entries",x=function(){return this};t.exports=function(t,e,n,l,f,E,I){i(n,e,l);var b,w,N,S=function(t){if(t===f&&M)return M;if(!d&&t in L)return L[t];switch(t){case _:case v:case m:return function(){return new n(this,t)}}return function(){return new n(this)}},C=e+" Iterator",O=!1,L=t.prototype,T=L[y]||L["@@iterator"]||f&&L[f],M=!d&&T||S(f),P="Array"==e&&L.entries||T;if(P&&(b=o(P.call(new t)),g!==Object.prototype&&b.next&&(h||o(b)===g||(s?s(b,g):"function"!=typeof b[y]&&u(b,y,x)),a(b,C,!0,!0),h&&(p[C]=x))),f==v&&T&&T.name!==v&&(O=!0,M=function(){return T.call(this)}),h&&!I||L[y]===M||u(L,y,M),p[e]=M,f)if(w={values:S(v),keys:E?M:S(_),entries:S(m)},I)for(N in w)(d||O||!(N in L))&&c(L,N,w[N]);else r({target:e,proto:!0,forced:d||O},w);return w}},7235:(t,e,n)=>{var r=n(857),i=n(6656),o=n(6061),s=n(3070).f;t.exports=function(t){var e=r.Symbol||(r.Symbol={});i(e,t)||s(e,t,{value:o.f(t)})}},9781:(t,e,n)=>{var r=n(7293);t.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},317:(t,e,n)=>{var r=n(7854),i=n(111),o=r.document,s=i(o)&&i(o.createElement);t.exports=function(t){return s?o.createElement(t):{}}},8324:t=>{t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},8886:(t,e,n)=>{var r=n(8113).match(/firefox\/(\d+)/i);t.exports=!!r&&+r[1]},7871:t=>{t.exports="object"==typeof window},256:(t,e,n)=>{var r=n(8113);t.exports=/MSIE|Trident/.test(r)},6833:(t,e,n)=>{var r=n(8113);t.exports=/(?:iphone|ipod|ipad).*applewebkit/i.test(r)},5268:(t,e,n)=>{var r=n(4326),i=n(7854);t.exports="process"==r(i.process)},1036:(t,e,n)=>{var r=n(8113);t.exports=/web0s(?!.*chrome)/i.test(r)},8113:(t,e,n)=>{var r=n(5005);t.exports=r("navigator","userAgent")||""},7392:(t,e,n)=>{var r,i,o=n(7854),s=n(8113),a=o.process,u=a&&a.versions,c=u&&u.v8;c?i=(r=c.split("."))[0]<4?1:r[0]+r[1]:s&&(!(r=s.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=s.match(/Chrome\/(\d+)/))&&(i=r[1]),t.exports=i&&+i},8008:(t,e,n)=>{var r=n(8113).match(/AppleWebKit\/(\d+)\./);t.exports=!!r&&+r[1]},748:t=>{t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},2109:(t,e,n)=>{var r=n(7854),i=n(1236).f,o=n(8880),s=n(1320),a=n(3505),u=n(9920),c=n(4705);t.exports=function(t,e){var n,l,h,p,f,g=t.target,d=t.global,y=t.stat;if(n=d?r:y?r[g]||a(g,{}):(r[g]||{}).prototype)for(l in e){if(p=e[l],h=t.noTargetGet?(f=i(n,l))&&f.value:n[l],!c(d?l:g+(y?".":"#")+l,t.forced)&&void 0!==h){if(typeof p==typeof h)continue;u(p,h)}(t.sham||h&&h.sham)&&o(p,"sham",!0),s(n,l,p,t)}}},7293:t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},7007:(t,e,n)=>{"use strict";n(4916);var r=n(1320),i=n(2261),o=n(7293),s=n(5112),a=n(8880),u=s("species"),c=RegExp.prototype;t.exports=function(t,e,n,l){var h=s(t),p=!o((function(){var e={};return e[h]=function(){return 7},7!=""[t](e)})),f=p&&!o((function(){var e=!1,n=/a/;return"split"===t&&((n={}).constructor={},n.constructor[u]=function(){return n},n.flags="",n[h]=/./[h]),n.exec=function(){return e=!0,null},n[h](""),!e}));if(!p||!f||n){var g=/./[h],d=e(h,""[t],(function(t,e,n,r,o){var s=e.exec;return s===i||s===c.exec?p&&!o?{done:!0,value:g.call(e,n,r)}:{done:!0,value:t.call(n,e,r)}:{done:!1}}));r(String.prototype,t,d[0]),r(c,h,d[1])}l&&a(c[h],"sham",!0)}},9974:(t,e,n)=>{var r=n(3099);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 0:return function(){return t.call(e)};case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},5005:(t,e,n)=>{var r=n(857),i=n(7854),o=function(t){return"function"==typeof t?t:void 0};t.exports=function(t,e){return arguments.length<2?o(r[t])||o(i[t]):r[t]&&r[t][e]||i[t]&&i[t][e]}},1246:(t,e,n)=>{var r=n(648),i=n(7497),o=n(5112)("iterator");t.exports=function(t){if(null!=t)return t[o]||t["@@iterator"]||i[r(t)]}},647:(t,e,n)=>{var r=n(7908),i=Math.floor,o="".replace,s=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,a=/\$([$&'`]|\d{1,2})/g;t.exports=function(t,e,n,u,c,l){var h=n+t.length,p=u.length,f=a;return void 0!==c&&(c=r(c),f=s),o.call(l,f,(function(r,o){var s;switch(o.charAt(0)){case"$":return"$";case"&":return t;case"`":return e.slice(0,n);case"'":return e.slice(h);case"<":s=c[o.slice(1,-1)];break;default:var a=+o;if(0===a)return r;if(a>p){var l=i(a/10);return 0===l?r:l<=p?void 0===u[l-1]?o.charAt(1):u[l-1]+o.charAt(1):r}s=u[a-1]}return void 0===s?"":s}))}},7854:(t,e,n)=>{var r=function(t){return t&&t.Math==Math&&t};t.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n.g&&n.g)||function(){return this}()||Function("return this")()},6656:(t,e,n)=>{var r=n(7908),i={}.hasOwnProperty;t.exports=Object.hasOwn||function(t,e){return i.call(r(t),e)}},3501:t=>{t.exports={}},842:(t,e,n)=>{var r=n(7854);t.exports=function(t,e){var n=r.console;n&&n.error&&(1===arguments.length?n.error(t):n.error(t,e))}},490:(t,e,n)=>{var r=n(5005);t.exports=r("document","documentElement")},4664:(t,e,n)=>{var r=n(9781),i=n(7293),o=n(317);t.exports=!r&&!i((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},1179:t=>{var e=Math.abs,n=Math.pow,r=Math.floor,i=Math.log,o=Math.LN2;t.exports={pack:function(t,s,a){var u,c,l,h=new Array(a),p=8*a-s-1,f=(1<<p)-1,g=f>>1,d=23===s?n(2,-24)-n(2,-77):0,y=t<0||0===t&&1/t<0?1:0,_=0;for((t=e(t))!=t||t===1/0?(c=t!=t?1:0,u=f):(u=r(i(t)/o),t*(l=n(2,-u))<1&&(u--,l*=2),(t+=u+g>=1?d/l:d*n(2,1-g))*l>=2&&(u++,l/=2),u+g>=f?(c=0,u=f):u+g>=1?(c=(t*l-1)*n(2,s),u+=g):(c=t*n(2,g-1)*n(2,s),u=0));s>=8;h[_++]=255&c,c/=256,s-=8);for(u=u<<s|c,p+=s;p>0;h[_++]=255&u,u/=256,p-=8);return h[--_]|=128*y,h},unpack:function(t,e){var r,i=t.length,o=8*i-e-1,s=(1<<o)-1,a=s>>1,u=o-7,c=i-1,l=t[c--],h=127&l;for(l>>=7;u>0;h=256*h+t[c],c--,u-=8);for(r=h&(1<<-u)-1,h>>=-u,u+=e;u>0;r=256*r+t[c],c--,u-=8);if(0===h)h=1-a;else{if(h===s)return r?NaN:l?-1/0:1/0;r+=n(2,e),h-=a}return(l?-1:1)*r*n(2,h-e)}}},8361:(t,e,n)=>{var r=n(7293),i=n(4326),o="".split;t.exports=r((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==i(t)?o.call(t,""):Object(t)}:Object},9587:(t,e,n)=>{var r=n(111),i=n(7674);t.exports=function(t,e,n){var o,s;return i&&"function"==typeof(o=e.constructor)&&o!==n&&r(s=o.prototype)&&s!==n.prototype&&i(t,s),t}},2788:(t,e,n)=>{var r=n(5465),i=Function.toString;"function"!=typeof r.inspectSource&&(r.inspectSource=function(t){return i.call(t)}),t.exports=r.inspectSource},9909:(t,e,n)=>{var r,i,o,s=n(8536),a=n(7854),u=n(111),c=n(8880),l=n(6656),h=n(5465),p=n(6200),f=n(3501),g="Object already initialized",d=a.WeakMap;if(s||h.state){var y=h.state||(h.state=new d),_=y.get,v=y.has,m=y.set;r=function(t,e){if(v.call(y,t))throw new TypeError(g);return e.facade=t,m.call(y,t,e),e},i=function(t){return _.call(y,t)||{}},o=function(t){return v.call(y,t)}}else{var x=p("state");f[x]=!0,r=function(t,e){if(l(t,x))throw new TypeError(g);return e.facade=t,c(t,x,e),e},i=function(t){return l(t,x)?t[x]:{}},o=function(t){return l(t,x)}}t.exports={set:r,get:i,has:o,enforce:function(t){return o(t)?i(t):r(t,{})},getterFor:function(t){return function(e){var n;if(!u(e)||(n=i(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}}},7659:(t,e,n)=>{var r=n(5112),i=n(7497),o=r("iterator"),s=Array.prototype;t.exports=function(t){return void 0!==t&&(i.Array===t||s[o]===t)}},3157:(t,e,n)=>{var r=n(4326);t.exports=Array.isArray||function(t){return"Array"==r(t)}},4705:(t,e,n)=>{var r=n(7293),i=/#|\.prototype\./,o=function(t,e){var n=a[s(t)];return n==c||n!=u&&("function"==typeof e?r(e):!!e)},s=o.normalize=function(t){return String(t).replace(i,".").toLowerCase()},a=o.data={},u=o.NATIVE="N",c=o.POLYFILL="P";t.exports=o},111:t=>{t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},1913:t=>{t.exports=!1},7850:(t,e,n)=>{var r=n(111),i=n(4326),o=n(5112)("match");t.exports=function(t){var e;return r(t)&&(void 0!==(e=t[o])?!!e:"RegExp"==i(t))}},408:(t,e,n)=>{var r=n(9670),i=n(7659),o=n(7466),s=n(9974),a=n(1246),u=n(9212),c=function(t,e){this.stopped=t,this.result=e};t.exports=function(t,e,n){var l,h,p,f,g,d,y,_=n&&n.that,v=!(!n||!n.AS_ENTRIES),m=!(!n||!n.IS_ITERATOR),x=!(!n||!n.INTERRUPTED),E=s(e,_,1+v+x),I=function(t){return l&&u(l),new c(!0,t)},b=function(t){return v?(r(t),x?E(t[0],t[1],I):E(t[0],t[1])):x?E(t,I):E(t)};if(m)l=t;else{if("function"!=typeof(h=a(t)))throw TypeError("Target is not iterable");if(i(h)){for(p=0,f=o(t.length);f>p;p++)if((g=b(t[p]))&&g instanceof c)return g;return new c(!1)}l=h.call(t)}for(d=l.next;!(y=d.call(l)).done;){try{g=b(y.value)}catch(t){throw u(l),t}if("object"==typeof g&&g&&g instanceof c)return g}return new c(!1)}},9212:(t,e,n)=>{var r=n(9670);t.exports=function(t){var e=t.return;if(void 0!==e)return r(e.call(t)).value}},3383:(t,e,n)=>{"use strict";var r,i,o,s=n(7293),a=n(9518),u=n(8880),c=n(6656),l=n(5112),h=n(1913),p=l("iterator"),f=!1;[].keys&&("next"in(o=[].keys())?(i=a(a(o)))!==Object.prototype&&(r=i):f=!0);var g=null==r||s((function(){var t={};return r[p].call(t)!==t}));g&&(r={}),h&&!g||c(r,p)||u(r,p,(function(){return this})),t.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:f}},7497:t=>{t.exports={}},5948:(t,e,n)=>{var r,i,o,s,a,u,c,l,h=n(7854),p=n(1236).f,f=n(261).set,g=n(6833),d=n(1036),y=n(5268),_=h.MutationObserver||h.WebKitMutationObserver,v=h.document,m=h.process,x=h.Promise,E=p(h,"queueMicrotask"),I=E&&E.value;I||(r=function(){var t,e;for(y&&(t=m.domain)&&t.exit();i;){e=i.fn,i=i.next;try{e()}catch(t){throw i?s():o=void 0,t}}o=void 0,t&&t.enter()},g||y||d||!_||!v?x&&x.resolve?((c=x.resolve(void 0)).constructor=x,l=c.then,s=function(){l.call(c,r)}):s=y?function(){m.nextTick(r)}:function(){f.call(h,r)}:(a=!0,u=v.createTextNode(""),new _(r).observe(u,{characterData:!0}),s=function(){u.data=a=!a})),t.exports=I||function(t){var e={fn:t,next:void 0};o&&(o.next=e),i||(i=e,s()),o=e}},3366:(t,e,n)=>{var r=n(7854);t.exports=r.Promise},133:(t,e,n)=>{var r=n(7392),i=n(7293);t.exports=!!Object.getOwnPropertySymbols&&!i((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},8536:(t,e,n)=>{var r=n(7854),i=n(2788),o=r.WeakMap;t.exports="function"==typeof o&&/native code/.test(i(o))},8523:(t,e,n)=>{"use strict";var r=n(3099),i=function(t){var e,n;this.promise=new t((function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r})),this.resolve=r(e),this.reject=r(n)};t.exports.f=function(t){return new i(t)}},1574:(t,e,n)=>{"use strict";var r=n(9781),i=n(7293),o=n(1956),s=n(5181),a=n(5296),u=n(7908),c=n(8361),l=Object.assign,h=Object.defineProperty;t.exports=!l||i((function(){if(r&&1!==l({b:1},l(h({},"a",{enumerable:!0,get:function(){h(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},n=Symbol(),i="abcdefghijklmnopqrst";return t[n]=7,i.split("").forEach((function(t){e[t]=t})),7!=l({},t)[n]||o(l({},e)).join("")!=i}))?function(t,e){for(var n=u(t),i=arguments.length,l=1,h=s.f,p=a.f;i>l;)for(var f,g=c(arguments[l++]),d=h?o(g).concat(h(g)):o(g),y=d.length,_=0;y>_;)f=d[_++],r&&!p.call(g,f)||(n[f]=g[f]);return n}:l},30:(t,e,n)=>{var r,i=n(9670),o=n(6048),s=n(748),a=n(3501),u=n(490),c=n(317),l=n(6200)("IE_PROTO"),h=function(){},p=function(t){return"<script>"+t+"<\/script>"},f=function(){try{r=document.domain&&new ActiveXObject("htmlfile")}catch(t){}var t,e;f=r?function(t){t.write(p("")),t.close();var e=t.parentWindow.Object;return t=null,e}(r):((e=c("iframe")).style.display="none",u.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(p("document.F=Object")),t.close(),t.F);for(var n=s.length;n--;)delete f.prototype[s[n]];return f()};a[l]=!0,t.exports=Object.create||function(t,e){var n;return null!==t?(h.prototype=i(t),n=new h,h.prototype=null,n[l]=t):n=f(),void 0===e?n:o(n,e)}},6048:(t,e,n)=>{var r=n(9781),i=n(3070),o=n(9670),s=n(1956);t.exports=r?Object.defineProperties:function(t,e){o(t);for(var n,r=s(e),a=r.length,u=0;a>u;)i.f(t,n=r[u++],e[n]);return t}},3070:(t,e,n)=>{var r=n(9781),i=n(4664),o=n(9670),s=n(7593),a=Object.defineProperty;e.f=r?a:function(t,e,n){if(o(t),e=s(e,!0),o(n),i)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},1236:(t,e,n)=>{var r=n(9781),i=n(5296),o=n(9114),s=n(5656),a=n(7593),u=n(6656),c=n(4664),l=Object.getOwnPropertyDescriptor;e.f=r?l:function(t,e){if(t=s(t),e=a(e,!0),c)try{return l(t,e)}catch(t){}if(u(t,e))return o(!i.f.call(t,e),t[e])}},1156:(t,e,n)=>{var r=n(5656),i=n(8006).f,o={}.toString,s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return s&&"[object Window]"==o.call(t)?function(t){try{return i(t)}catch(t){return s.slice()}}(t):i(r(t))}},8006:(t,e,n)=>{var r=n(6324),i=n(748).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},5181:(t,e)=>{e.f=Object.getOwnPropertySymbols},9518:(t,e,n)=>{var r=n(6656),i=n(7908),o=n(6200),s=n(8544),a=o("IE_PROTO"),u=Object.prototype;t.exports=s?Object.getPrototypeOf:function(t){return t=i(t),r(t,a)?t[a]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?u:null}},6324:(t,e,n)=>{var r=n(6656),i=n(5656),o=n(1318).indexOf,s=n(3501);t.exports=function(t,e){var n,a=i(t),u=0,c=[];for(n in a)!r(s,n)&&r(a,n)&&c.push(n);for(;e.length>u;)r(a,n=e[u++])&&(~o(c,n)||c.push(n));return c}},1956:(t,e,n)=>{var r=n(6324),i=n(748);t.exports=Object.keys||function(t){return r(t,i)}},5296:(t,e)=>{"use strict";var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,i=r&&!n.call({1:2},1);e.f=i?function(t){var e=r(this,t);return!!e&&e.enumerable}:n},7674:(t,e,n)=>{var r=n(9670),i=n(6077);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),e=n instanceof Array}catch(t){}return function(n,o){return r(n),i(o),e?t.call(n,o):n.__proto__=o,n}}():void 0)},288:(t,e,n)=>{"use strict";var r=n(1694),i=n(648);t.exports=r?{}.toString:function(){return"[object "+i(this)+"]"}},3887:(t,e,n)=>{var r=n(5005),i=n(8006),o=n(5181),s=n(9670);t.exports=r("Reflect","ownKeys")||function(t){var e=i.f(s(t)),n=o.f;return n?e.concat(n(t)):e}},857:(t,e,n)=>{var r=n(7854);t.exports=r},2534:t=>{t.exports=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}}},9478:(t,e,n)=>{var r=n(9670),i=n(111),o=n(8523);t.exports=function(t,e){if(r(t),i(e)&&e.constructor===t)return e;var n=o.f(t);return(0,n.resolve)(e),n.promise}},2248:(t,e,n)=>{var r=n(1320);t.exports=function(t,e,n){for(var i in e)r(t,i,e[i],n);return t}},1320:(t,e,n)=>{var r=n(7854),i=n(8880),o=n(6656),s=n(3505),a=n(2788),u=n(9909),c=u.get,l=u.enforce,h=String(String).split("String");(t.exports=function(t,e,n,a){var u,c=!!a&&!!a.unsafe,p=!!a&&!!a.enumerable,f=!!a&&!!a.noTargetGet;"function"==typeof n&&("string"!=typeof e||o(n,"name")||i(n,"name",e),(u=l(n)).source||(u.source=h.join("string"==typeof e?e:""))),t!==r?(c?!f&&t[e]&&(p=!0):delete t[e],p?t[e]=n:i(t,e,n)):p?t[e]=n:s(e,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&c(this).source||a(this)}))},7651:(t,e,n)=>{var r=n(4326),i=n(2261);t.exports=function(t,e){var n=t.exec;if("function"==typeof n){var o=n.call(t,e);if("object"!=typeof o)throw TypeError("RegExp exec method returned something other than an Object or null");return o}if("RegExp"!==r(t))throw TypeError("RegExp#exec called on incompatible receiver");return i.call(t,e)}},2261:(t,e,n)=>{"use strict";var r,i,o=n(7066),s=n(2999),a=n(2309),u=n(30),c=n(9909).get,l=n(9441),h=n(8173),p=RegExp.prototype.exec,f=a("native-string-replace",String.prototype.replace),g=p,d=(r=/a/,i=/b*/g,p.call(r,"a"),p.call(i,"a"),0!==r.lastIndex||0!==i.lastIndex),y=s.UNSUPPORTED_Y||s.BROKEN_CARET,_=void 0!==/()??/.exec("")[1];(d||_||y||l||h)&&(g=function(t){var e,n,r,i,s,a,l,h=this,v=c(h),m=v.raw;if(m)return m.lastIndex=h.lastIndex,e=g.call(m,t),h.lastIndex=m.lastIndex,e;var x=v.groups,E=y&&h.sticky,I=o.call(h),b=h.source,w=0,N=t;if(E&&(-1===(I=I.replace("y","")).indexOf("g")&&(I+="g"),N=String(t).slice(h.lastIndex),h.lastIndex>0&&(!h.multiline||h.multiline&&"\n"!==t[h.lastIndex-1])&&(b="(?: "+b+")",N=" "+N,w++),n=new RegExp("^(?:"+b+")",I)),_&&(n=new RegExp("^"+b+"$(?!\\s)",I)),d&&(r=h.lastIndex),i=p.call(E?n:h,N),E?i?(i.input=i.input.slice(w),i[0]=i[0].slice(w),i.index=h.lastIndex,h.lastIndex+=i[0].length):h.lastIndex=0:d&&i&&(h.lastIndex=h.global?i.index+i[0].length:r),_&&i&&i.length>1&&f.call(i[0],n,(function(){for(s=1;s<arguments.length-2;s++)void 0===arguments[s]&&(i[s]=void 0)})),i&&x)for(i.groups=a=u(null),s=0;s<x.length;s++)a[(l=x[s])[0]]=i[l[1]];return i}),t.exports=g},7066:(t,e,n)=>{"use strict";var r=n(9670);t.exports=function(){var t=r(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},2999:(t,e,n)=>{var r=n(7293),i=function(t,e){return RegExp(t,e)};e.UNSUPPORTED_Y=r((function(){var t=i("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),e.BROKEN_CARET=r((function(){var t=i("^r","gy");return t.lastIndex=2,null!=t.exec("str")}))},9441:(t,e,n)=>{var r=n(7293);t.exports=r((function(){var t=RegExp(".","string".charAt(0));return!(t.dotAll&&t.exec("\n")&&"s"===t.flags)}))},8173:(t,e,n)=>{var r=n(7293);t.exports=r((function(){var t=RegExp("(?<a>b)","string".charAt(5));return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")}))},4488:t=>{t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},3505:(t,e,n)=>{var r=n(7854),i=n(8880);t.exports=function(t,e){try{i(r,t,e)}catch(n){r[t]=e}return e}},6340:(t,e,n)=>{"use strict";var r=n(5005),i=n(3070),o=n(5112),s=n(9781),a=o("species");t.exports=function(t){var e=r(t),n=i.f;s&&e&&!e[a]&&n(e,a,{configurable:!0,get:function(){return this}})}},8003:(t,e,n)=>{var r=n(3070).f,i=n(6656),o=n(5112)("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,o)&&r(t,o,{configurable:!0,value:e})}},6200:(t,e,n)=>{var r=n(2309),i=n(9711),o=r("keys");t.exports=function(t){return o[t]||(o[t]=i(t))}},5465:(t,e,n)=>{var r=n(7854),i=n(3505),o="__core-js_shared__",s=r[o]||i(o,{});t.exports=s},2309:(t,e,n)=>{var r=n(1913),i=n(5465);(t.exports=function(t,e){return i[t]||(i[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.15.1",mode:r?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})},6707:(t,e,n)=>{var r=n(9670),i=n(3099),o=n(5112)("species");t.exports=function(t,e){var n,s=r(t).constructor;return void 0===s||null==(n=r(s)[o])?e:i(n)}},3429:(t,e,n)=>{var r=n(7293);t.exports=function(t){return r((function(){var e=""[t]('"');return e!==e.toLowerCase()||e.split('"').length>3}))}},8710:(t,e,n)=>{var r=n(9958),i=n(4488),o=function(t){return function(e,n){var o,s,a=String(i(e)),u=r(n),c=a.length;return u<0||u>=c?t?"":void 0:(o=a.charCodeAt(u))<55296||o>56319||u+1===c||(s=a.charCodeAt(u+1))<56320||s>57343?t?a.charAt(u):o:t?a.slice(u,u+2):s-56320+(o-55296<<10)+65536}};t.exports={codeAt:o(!1),charAt:o(!0)}},8415:(t,e,n)=>{"use strict";var r=n(9958),i=n(4488);t.exports=function(t){var e=String(i(this)),n="",o=r(t);if(o<0||o==1/0)throw RangeError("Wrong number of repetitions");for(;o>0;(o>>>=1)&&(e+=e))1&o&&(n+=e);return n}},261:(t,e,n)=>{var r,i,o,s=n(7854),a=n(7293),u=n(9974),c=n(490),l=n(317),h=n(6833),p=n(5268),f=s.location,g=s.setImmediate,d=s.clearImmediate,y=s.process,_=s.MessageChannel,v=s.Dispatch,m=0,x={},E=function(t){if(x.hasOwnProperty(t)){var e=x[t];delete x[t],e()}},I=function(t){return function(){E(t)}},b=function(t){E(t.data)},w=function(t){s.postMessage(t+"",f.protocol+"//"+f.host)};g&&d||(g=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return x[++m]=function(){("function"==typeof t?t:Function(t)).apply(void 0,e)},r(m),m},d=function(t){delete x[t]},p?r=function(t){y.nextTick(I(t))}:v&&v.now?r=function(t){v.now(I(t))}:_&&!h?(o=(i=new _).port2,i.port1.onmessage=b,r=u(o.postMessage,o,1)):s.addEventListener&&"function"==typeof postMessage&&!s.importScripts&&f&&"file:"!==f.protocol&&!a(w)?(r=w,s.addEventListener("message",b,!1)):r="onreadystatechange"in l("script")?function(t){c.appendChild(l("script")).onreadystatechange=function(){c.removeChild(this),E(t)}}:function(t){setTimeout(I(t),0)}),t.exports={set:g,clear:d}},863:(t,e,n)=>{var r=n(4326);t.exports=function(t){if("number"!=typeof t&&"Number"!=r(t))throw TypeError("Incorrect invocation");return+t}},1400:(t,e,n)=>{var r=n(9958),i=Math.max,o=Math.min;t.exports=function(t,e){var n=r(t);return n<0?i(n+e,0):o(n,e)}},7067:(t,e,n)=>{var r=n(9958),i=n(7466);t.exports=function(t){if(void 0===t)return 0;var e=r(t),n=i(e);if(e!==n)throw RangeError("Wrong length or index");return n}},5656:(t,e,n)=>{var r=n(8361),i=n(4488);t.exports=function(t){return r(i(t))}},9958:t=>{var e=Math.ceil,n=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?n:e)(t)}},7466:(t,e,n)=>{var r=n(9958),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},7908:(t,e,n)=>{var r=n(4488);t.exports=function(t){return Object(r(t))}},4590:(t,e,n)=>{var r=n(3002);t.exports=function(t,e){var n=r(t);if(n%e)throw RangeError("Wrong offset");return n}},3002:(t,e,n)=>{var r=n(9958);t.exports=function(t){var e=r(t);if(e<0)throw RangeError("The argument can't be less than 0");return e}},7593:(t,e,n)=>{var r=n(111);t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},1694:(t,e,n)=>{var r={};r[n(5112)("toStringTag")]="z",t.exports="[object z]"===String(r)},9843:(t,e,n)=>{"use strict";var r=n(2109),i=n(7854),o=n(9781),s=n(3832),a=n(260),u=n(3331),c=n(5787),l=n(9114),h=n(8880),p=n(7466),f=n(7067),g=n(4590),d=n(7593),y=n(6656),_=n(648),v=n(111),m=n(30),x=n(7674),E=n(8006).f,I=n(7321),b=n(2092).forEach,w=n(6340),N=n(3070),S=n(1236),C=n(9909),O=n(9587),L=C.get,T=C.set,M=N.f,P=S.f,R=Math.round,A=i.RangeError,D=u.ArrayBuffer,F=u.DataView,k=a.NATIVE_ARRAY_BUFFER_VIEWS,B=a.TYPED_ARRAY_TAG,G=a.TypedArray,U=a.TypedArrayPrototype,q=a.aTypedArrayConstructor,j=a.isTypedArray,V="BYTES_PER_ELEMENT",Y="Wrong length",X=function(t,e){for(var n=0,r=e.length,i=new(q(t))(r);r>n;)i[n]=e[n++];return i},z=function(t,e){M(t,e,{get:function(){return L(this)[e]}})},W=function(t){var e;return t instanceof D||"ArrayBuffer"==(e=_(t))||"SharedArrayBuffer"==e},H=function(t,e){return j(t)&&"symbol"!=typeof e&&e in t&&String(+e)==String(e)},J=function(t,e){return H(t,e=d(e,!0))?l(2,t[e]):P(t,e)},K=function(t,e,n){return!(H(t,e=d(e,!0))&&v(n)&&y(n,"value"))||y(n,"get")||y(n,"set")||n.configurable||y(n,"writable")&&!n.writable||y(n,"enumerable")&&!n.enumerable?M(t,e,n):(t[e]=n.value,t)};o?(k||(S.f=J,N.f=K,z(U,"buffer"),z(U,"byteOffset"),z(U,"byteLength"),z(U,"length")),r({target:"Object",stat:!0,forced:!k},{getOwnPropertyDescriptor:J,defineProperty:K}),t.exports=function(t,e,n){var o=t.match(/\d+$/)[0]/8,a=t+(n?"Clamped":"")+"Array",u="get"+t,l="set"+t,d=i[a],y=d,_=y&&y.prototype,N={},S=function(t,e){M(t,e,{get:function(){return function(t,e){var n=L(t);return n.view[u](e*o+n.byteOffset,!0)}(this,e)},set:function(t){return function(t,e,r){var i=L(t);n&&(r=(r=R(r))<0?0:r>255?255:255&r),i.view[l](e*o+i.byteOffset,r,!0)}(this,e,t)},enumerable:!0})};k?s&&(y=e((function(t,e,n,r){return c(t,y,a),O(v(e)?W(e)?void 0!==r?new d(e,g(n,o),r):void 0!==n?new d(e,g(n,o)):new d(e):j(e)?X(y,e):I.call(y,e):new d(f(e)),t,y)})),x&&x(y,G),b(E(d),(function(t){t in y||h(y,t,d[t])})),y.prototype=_):(y=e((function(t,e,n,r){c(t,y,a);var i,s,u,l=0,h=0;if(v(e)){if(!W(e))return j(e)?X(y,e):I.call(y,e);i=e,h=g(n,o);var d=e.byteLength;if(void 0===r){if(d%o)throw A(Y);if((s=d-h)<0)throw A(Y)}else if((s=p(r)*o)+h>d)throw A(Y);u=s/o}else u=f(e),i=new D(s=u*o);for(T(t,{buffer:i,byteOffset:h,byteLength:s,length:u,view:new F(i)});l<u;)S(t,l++)})),x&&x(y,G),_=y.prototype=m(U)),_.constructor!==y&&h(_,"constructor",y),B&&h(_,B,a),N[a]=y,r({global:!0,forced:y!=d,sham:!k},N),V in y||h(y,V,o),V in _||h(_,V,o),w(a)}):t.exports=function(){}},3832:(t,e,n)=>{var r=n(7854),i=n(7293),o=n(7072),s=n(260).NATIVE_ARRAY_BUFFER_VIEWS,a=r.ArrayBuffer,u=r.Int8Array;t.exports=!s||!i((function(){u(1)}))||!i((function(){new u(-1)}))||!o((function(t){new u,new u(null),new u(1.5),new u(t)}),!0)||i((function(){return 1!==new u(new a(2),1,void 0).length}))},3074:(t,e,n)=>{var r=n(260).aTypedArrayConstructor,i=n(6707);t.exports=function(t,e){for(var n=i(t,t.constructor),o=0,s=e.length,a=new(r(n))(s);s>o;)a[o]=e[o++];return a}},7321:(t,e,n)=>{var r=n(7908),i=n(7466),o=n(1246),s=n(7659),a=n(9974),u=n(260).aTypedArrayConstructor;t.exports=function(t){var e,n,c,l,h,p,f=r(t),g=arguments.length,d=g>1?arguments[1]:void 0,y=void 0!==d,_=o(f);if(null!=_&&!s(_))for(p=(h=_.call(f)).next,f=[];!(l=p.call(h)).done;)f.push(l.value);for(y&&g>2&&(d=a(d,arguments[2],2)),n=i(f.length),c=new(u(this))(n),e=0;n>e;e++)c[e]=y?d(f[e],e):f[e];return c}},9711:t=>{var e=0,n=Math.random();t.exports=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++e+n).toString(36)}},3307:(t,e,n)=>{var r=n(133);t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},6061:(t,e,n)=>{var r=n(5112);e.f=r},5112:(t,e,n)=>{var r=n(7854),i=n(2309),o=n(6656),s=n(9711),a=n(133),u=n(3307),c=i("wks"),l=r.Symbol,h=u?l:l&&l.withoutSetter||s;t.exports=function(t){return o(c,t)&&(a||"string"==typeof c[t])||(a&&o(l,t)?c[t]=l[t]:c[t]=h("Symbol."+t)),c[t]}},8264:(t,e,n)=>{"use strict";var r=n(2109),i=n(7854),o=n(3331),s=n(6340),a=o.ArrayBuffer;r({global:!0,forced:i.ArrayBuffer!==a},{ArrayBuffer:a}),s("ArrayBuffer")},2222:(t,e,n)=>{"use strict";var r=n(2109),i=n(7293),o=n(3157),s=n(111),a=n(7908),u=n(7466),c=n(6135),l=n(5417),h=n(1194),p=n(5112),f=n(7392),g=p("isConcatSpreadable"),d=9007199254740991,y="Maximum allowed index exceeded",_=f>=51||!i((function(){var t=[];return t[g]=!1,t.concat()[0]!==t})),v=h("concat"),m=function(t){if(!s(t))return!1;var e=t[g];return void 0!==e?!!e:o(t)};r({target:"Array",proto:!0,forced:!_||!v},{concat:function(t){var e,n,r,i,o,s=a(this),h=l(s,0),p=0;for(e=-1,r=arguments.length;e<r;e++)if(m(o=-1===e?s:arguments[e])){if(p+(i=u(o.length))>d)throw TypeError(y);for(n=0;n<i;n++,p++)n in o&&c(h,p,o[n])}else{if(p>=d)throw TypeError(y);c(h,p++,o)}return h.length=p,h}})},7327:(t,e,n)=>{"use strict";var r=n(2109),i=n(2092).filter;r({target:"Array",proto:!0,forced:!n(1194)("filter")},{filter:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}})},1038:(t,e,n)=>{var r=n(2109),i=n(8457);r({target:"Array",stat:!0,forced:!n(7072)((function(t){Array.from(t)}))},{from:i})},6992:(t,e,n)=>{"use strict";var r=n(5656),i=n(1223),o=n(7497),s=n(9909),a=n(654),u="Array Iterator",c=s.set,l=s.getterFor(u);t.exports=a(Array,"Array",(function(t,e){c(this,{type:u,target:r(t),index:0,kind:e})}),(function(){var t=l(this),e=t.target,n=t.kind,r=t.index++;return!e||r>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:e[r],done:!1}:{value:[r,e[r]],done:!1}}),"values"),o.Arguments=o.Array,i("keys"),i("values"),i("entries")},9600:(t,e,n)=>{"use strict";var r=n(2109),i=n(8361),o=n(5656),s=n(9341),a=[].join,u=i!=Object,c=s("join",",");r({target:"Array",proto:!0,forced:u||!c},{join:function(t){return a.call(o(this),void 0===t?",":t)}})},1249:(t,e,n)=>{"use strict";var r=n(2109),i=n(2092).map;r({target:"Array",proto:!0,forced:!n(1194)("map")},{map:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}})},7042:(t,e,n)=>{"use strict";var r=n(2109),i=n(111),o=n(3157),s=n(1400),a=n(7466),u=n(5656),c=n(6135),l=n(5112),h=n(1194)("slice"),p=l("species"),f=[].slice,g=Math.max;r({target:"Array",proto:!0,forced:!h},{slice:function(t,e){var n,r,l,h=u(this),d=a(h.length),y=s(t,d),_=s(void 0===e?d:e,d);if(o(h)&&("function"!=typeof(n=h.constructor)||n!==Array&&!o(n.prototype)?i(n)&&null===(n=n[p])&&(n=void 0):n=void 0,n===Array||void 0===n))return f.call(h,y,_);for(r=new(void 0===n?Array:n)(g(_-y,0)),l=0;y<_;y++,l++)y in h&&c(r,l,h[y]);return r.length=l,r}})},2707:(t,e,n)=>{"use strict";var r=n(2109),i=n(3099),o=n(7908),s=n(7466),a=n(7293),u=n(4362),c=n(9341),l=n(8886),h=n(256),p=n(7392),f=n(8008),g=[],d=g.sort,y=a((function(){g.sort(void 0)})),_=a((function(){g.sort(null)})),v=c("sort"),m=!a((function(){if(p)return p<70;if(!(l&&l>3)){if(h)return!0;if(f)return f<603;var t,e,n,r,i="";for(t=65;t<76;t++){switch(e=String.fromCharCode(t),t){case 66:case 69:case 70:case 72:n=3;break;case 68:case 71:n=4;break;default:n=2}for(r=0;r<47;r++)g.push({k:e+r,v:n})}for(g.sort((function(t,e){return e.v-t.v})),r=0;r<g.length;r++)e=g[r].k.charAt(0),i.charAt(i.length-1)!==e&&(i+=e);return"DGBEFHACIJK"!==i}}));r({target:"Array",proto:!0,forced:y||!_||!v||!m},{sort:function(t){void 0!==t&&i(t);var e=o(this);if(m)return void 0===t?d.call(e):d.call(e,t);var n,r,a=[],c=s(e.length);for(r=0;r<c;r++)r in e&&a.push(e[r]);for(n=(a=u(a,function(t){return function(e,n){return void 0===n?-1:void 0===e?1:void 0!==t?+t(e,n)||0:String(e)>String(n)?1:-1}}(t))).length,r=0;r<n;)e[r]=a[r++];for(;r<c;)delete e[r++];return e}})},561:(t,e,n)=>{"use strict";var r=n(2109),i=n(1400),o=n(9958),s=n(7466),a=n(7908),u=n(5417),c=n(6135),l=n(1194)("splice"),h=Math.max,p=Math.min,f=9007199254740991,g="Maximum allowed length exceeded";r({target:"Array",proto:!0,forced:!l},{splice:function(t,e){var n,r,l,d,y,_,v=a(this),m=s(v.length),x=i(t,m),E=arguments.length;if(0===E?n=r=0:1===E?(n=0,r=m-x):(n=E-2,r=p(h(o(e),0),m-x)),m+n-r>f)throw TypeError(g);for(l=u(v,r),d=0;d<r;d++)(y=x+d)in v&&c(l,d,v[y]);if(l.length=r,n<r){for(d=x;d<m-r;d++)_=d+n,(y=d+r)in v?v[_]=v[y]:delete v[_];for(d=m;d>m-r+n;d--)delete v[d-1]}else if(n>r)for(d=m-r;d>x;d--)_=d+n-1,(y=d+r-1)in v?v[_]=v[y]:delete v[_];for(d=0;d<n;d++)v[d+x]=arguments[d+2];return v.length=m-r+n,l}})},6977:(t,e,n)=>{"use strict";var r=n(2109),i=n(9958),o=n(863),s=n(8415),a=n(7293),u=1..toFixed,c=Math.floor,l=function(t,e,n){return 0===e?n:e%2==1?l(t,e-1,n*t):l(t*t,e/2,n)},h=function(t,e,n){for(var r=-1,i=n;++r<6;)i+=e*t[r],t[r]=i%1e7,i=c(i/1e7)},p=function(t,e){for(var n=6,r=0;--n>=0;)r+=t[n],t[n]=c(r/e),r=r%e*1e7},f=function(t){for(var e=6,n="";--e>=0;)if(""!==n||0===e||0!==t[e]){var r=String(t[e]);n=""===n?r:n+s.call("0",7-r.length)+r}return n};r({target:"Number",proto:!0,forced:u&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!a((function(){u.call({})}))},{toFixed:function(t){var e,n,r,a,u=o(this),c=i(t),g=[0,0,0,0,0,0],d="",y="0";if(c<0||c>20)throw RangeError("Incorrect fraction digits");if(u!=u)return"NaN";if(u<=-1e21||u>=1e21)return String(u);if(u<0&&(d="-",u=-u),u>1e-21)if(n=(e=function(t){for(var e=0,n=t;n>=4096;)e+=12,n/=4096;for(;n>=2;)e+=1,n/=2;return e}(u*l(2,69,1))-69)<0?u*l(2,-e,1):u/l(2,e,1),n*=4503599627370496,(e=52-e)>0){for(h(g,0,n),r=c;r>=7;)h(g,1e7,0),r-=7;for(h(g,l(10,r,1),0),r=e-1;r>=23;)p(g,1<<23),r-=23;p(g,1<<r),h(g,1,1),p(g,2),y=f(g)}else h(g,0,n),h(g,1<<-e,0),y=f(g)+s.call("0",c);return c>0?d+((a=y.length)<=c?"0."+s.call("0",c-a)+y:y.slice(0,a-c)+"."+y.slice(a-c)):d+y}})},9601:(t,e,n)=>{var r=n(2109),i=n(1574);r({target:"Object",stat:!0,forced:Object.assign!==i},{assign:i})},7941:(t,e,n)=>{var r=n(2109),i=n(7908),o=n(1956);r({target:"Object",stat:!0,forced:n(7293)((function(){o(1)}))},{keys:function(t){return o(i(t))}})},1539:(t,e,n)=>{var r=n(1694),i=n(1320),o=n(288);r||i(Object.prototype,"toString",o,{unsafe:!0})},8674:(t,e,n)=>{"use strict";var r,i,o,s,a=n(2109),u=n(1913),c=n(7854),l=n(5005),h=n(3366),p=n(1320),f=n(2248),g=n(7674),d=n(8003),y=n(6340),_=n(111),v=n(3099),m=n(5787),x=n(2788),E=n(408),I=n(7072),b=n(6707),w=n(261).set,N=n(5948),S=n(9478),C=n(842),O=n(8523),L=n(2534),T=n(9909),M=n(4705),P=n(5112),R=n(7871),A=n(5268),D=n(7392),F=P("species"),k="Promise",B=T.get,G=T.set,U=T.getterFor(k),q=h&&h.prototype,j=h,V=q,Y=c.TypeError,X=c.document,z=c.process,W=O.f,H=W,J=!!(X&&X.createEvent&&c.dispatchEvent),K="function"==typeof PromiseRejectionEvent,Q="unhandledrejection",$=!1,Z=M(k,(function(){var t=x(j)!==String(j);if(!t&&66===D)return!0;if(u&&!V.finally)return!0;if(D>=51&&/native code/.test(j))return!1;var e=new j((function(t){t(1)})),n=function(t){t((function(){}),(function(){}))};return(e.constructor={})[F]=n,!($=e.then((function(){}))instanceof n)||!t&&R&&!K})),tt=Z||!I((function(t){j.all(t).catch((function(){}))})),et=function(t){var e;return!(!_(t)||"function"!=typeof(e=t.then))&&e},nt=function(t,e){if(!t.notified){t.notified=!0;var n=t.reactions;N((function(){for(var r=t.value,i=1==t.state,o=0;n.length>o;){var s,a,u,c=n[o++],l=i?c.ok:c.fail,h=c.resolve,p=c.reject,f=c.domain;try{l?(i||(2===t.rejection&&st(t),t.rejection=1),!0===l?s=r:(f&&f.enter(),s=l(r),f&&(f.exit(),u=!0)),s===c.promise?p(Y("Promise-chain cycle")):(a=et(s))?a.call(s,h,p):h(s)):p(r)}catch(t){f&&!u&&f.exit(),p(t)}}t.reactions=[],t.notified=!1,e&&!t.rejection&&it(t)}))}},rt=function(t,e,n){var r,i;J?((r=X.createEvent("Event")).promise=e,r.reason=n,r.initEvent(t,!1,!0),c.dispatchEvent(r)):r={promise:e,reason:n},!K&&(i=c["on"+t])?i(r):t===Q&&C("Unhandled promise rejection",n)},it=function(t){w.call(c,(function(){var e,n=t.facade,r=t.value;if(ot(t)&&(e=L((function(){A?z.emit("unhandledRejection",r,n):rt(Q,n,r)})),t.rejection=A||ot(t)?2:1,e.error))throw e.value}))},ot=function(t){return 1!==t.rejection&&!t.parent},st=function(t){w.call(c,(function(){var e=t.facade;A?z.emit("rejectionHandled",e):rt("rejectionhandled",e,t.value)}))},at=function(t,e,n){return function(r){t(e,r,n)}},ut=function(t,e,n){t.done||(t.done=!0,n&&(t=n),t.value=e,t.state=2,nt(t,!0))},ct=function(t,e,n){if(!t.done){t.done=!0,n&&(t=n);try{if(t.facade===e)throw Y("Promise can't be resolved itself");var r=et(e);r?N((function(){var n={done:!1};try{r.call(e,at(ct,n,t),at(ut,n,t))}catch(e){ut(n,e,t)}})):(t.value=e,t.state=1,nt(t,!1))}catch(e){ut({done:!1},e,t)}}};if(Z&&(V=(j=function(t){m(this,j,k),v(t),r.call(this);var e=B(this);try{t(at(ct,e),at(ut,e))}catch(t){ut(e,t)}}).prototype,(r=function(t){G(this,{type:k,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=f(V,{then:function(t,e){var n=U(this),r=W(b(this,j));return r.ok="function"!=typeof t||t,r.fail="function"==typeof e&&e,r.domain=A?z.domain:void 0,n.parent=!0,n.reactions.push(r),0!=n.state&&nt(n,!1),r.promise},catch:function(t){return this.then(void 0,t)}}),i=function(){var t=new r,e=B(t);this.promise=t,this.resolve=at(ct,e),this.reject=at(ut,e)},O.f=W=function(t){return t===j||t===o?new i(t):H(t)},!u&&"function"==typeof h&&q!==Object.prototype)){s=q.then,$||(p(q,"then",(function(t,e){var n=this;return new j((function(t,e){s.call(n,t,e)})).then(t,e)}),{unsafe:!0}),p(q,"catch",V.catch,{unsafe:!0}));try{delete q.constructor}catch(t){}g&&g(q,V)}a({global:!0,wrap:!0,forced:Z},{Promise:j}),d(j,k,!1,!0),y(k),o=l(k),a({target:k,stat:!0,forced:Z},{reject:function(t){var e=W(this);return e.reject.call(void 0,t),e.promise}}),a({target:k,stat:!0,forced:u||Z},{resolve:function(t){return S(u&&this===o?j:this,t)}}),a({target:k,stat:!0,forced:tt},{all:function(t){var e=this,n=W(e),r=n.resolve,i=n.reject,o=L((function(){var n=v(e.resolve),o=[],s=0,a=1;E(t,(function(t){var u=s++,c=!1;o.push(void 0),a++,n.call(e,t).then((function(t){c||(c=!0,o[u]=t,--a||r(o))}),i)})),--a||r(o)}));return o.error&&i(o.value),n.promise},race:function(t){var e=this,n=W(e),r=n.reject,i=L((function(){var i=v(e.resolve);E(t,(function(t){i.call(e,t).then(n.resolve,r)}))}));return i.error&&r(i.value),n.promise}})},4916:(t,e,n)=>{"use strict";var r=n(2109),i=n(2261);r({target:"RegExp",proto:!0,forced:/./.exec!==i},{exec:i})},9714:(t,e,n)=>{"use strict";var r=n(1320),i=n(9670),o=n(7293),s=n(7066),a="toString",u=RegExp.prototype,c=u.toString,l=o((function(){return"/a/b"!=c.call({source:"a",flags:"b"})})),h=c.name!=a;(l||h)&&r(RegExp.prototype,a,(function(){var t=i(this),e=String(t.source),n=t.flags;return"/"+e+"/"+String(void 0===n&&t instanceof RegExp&&!("flags"in u)?s.call(t):n)}),{unsafe:!0})},8783:(t,e,n)=>{"use strict";var r=n(8710).charAt,i=n(9909),o=n(654),s="String Iterator",a=i.set,u=i.getterFor(s);o(String,"String",(function(t){a(this,{type:s,string:String(t),index:0})}),(function(){var t,e=u(this),n=e.string,i=e.index;return i>=n.length?{value:void 0,done:!0}:(t=r(n,i),e.index+=t.length,{value:t,done:!1})}))},4723:(t,e,n)=>{"use strict";var r=n(7007),i=n(9670),o=n(7466),s=n(4488),a=n(1530),u=n(7651);r("match",(function(t,e,n){return[function(e){var n=s(this),r=null==e?void 0:e[t];return void 0!==r?r.call(e,n):new RegExp(e)[t](String(n))},function(t){var r=n(e,this,t);if(r.done)return r.value;var s=i(this),c=String(t);if(!s.global)return u(s,c);var l=s.unicode;s.lastIndex=0;for(var h,p=[],f=0;null!==(h=u(s,c));){var g=String(h[0]);p[f]=g,""===g&&(s.lastIndex=a(c,o(s.lastIndex),l)),f++}return 0===f?null:p}]}))},5306:(t,e,n)=>{"use strict";var r=n(7007),i=n(7293),o=n(9670),s=n(7466),a=n(9958),u=n(4488),c=n(1530),l=n(647),h=n(7651),p=n(5112)("replace"),f=Math.max,g=Math.min,d="$0"==="a".replace(/./,"$0"),y=!!/./[p]&&""===/./[p]("a","$0");r("replace",(function(t,e,n){var r=y?"$":"$0";return[function(t,n){var r=u(this),i=null==t?void 0:t[p];return void 0!==i?i.call(t,r,n):e.call(String(r),t,n)},function(t,i){if("string"==typeof i&&-1===i.indexOf(r)&&-1===i.indexOf("$<")){var u=n(e,this,t,i);if(u.done)return u.value}var p=o(this),d=String(t),y="function"==typeof i;y||(i=String(i));var _=p.global;if(_){var v=p.unicode;p.lastIndex=0}for(var m=[];;){var x=h(p,d);if(null===x)break;if(m.push(x),!_)break;""===String(x[0])&&(p.lastIndex=c(d,s(p.lastIndex),v))}for(var E,I="",b=0,w=0;w<m.length;w++){x=m[w];for(var N=String(x[0]),S=f(g(a(x.index),d.length),0),C=[],O=1;O<x.length;O++)C.push(void 0===(E=x[O])?E:String(E));var L=x.groups;if(y){var T=[N].concat(C,S,d);void 0!==L&&T.push(L);var M=String(i.apply(void 0,T))}else M=l(N,d,S,C,L,i);S>=b&&(I+=d.slice(b,S)+M,b=S+N.length)}return I+d.slice(b)}]}),!!i((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")}))||!d||y)},3123:(t,e,n)=>{"use strict";var r=n(7007),i=n(7850),o=n(9670),s=n(4488),a=n(6707),u=n(1530),c=n(7466),l=n(7651),h=n(2261),p=n(2999),f=n(7293),g=p.UNSUPPORTED_Y,d=[].push,y=Math.min,_=4294967295;r("split",(function(t,e,n){var r;return r="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,n){var r=String(s(this)),o=void 0===n?_:n>>>0;if(0===o)return[];if(void 0===t)return[r];if(!i(t))return e.call(r,t,o);for(var a,u,c,l=[],p=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),f=0,g=new RegExp(t.source,p+"g");(a=h.call(g,r))&&!((u=g.lastIndex)>f&&(l.push(r.slice(f,a.index)),a.length>1&&a.index<r.length&&d.apply(l,a.slice(1)),c=a[0].length,f=u,l.length>=o));)g.lastIndex===a.index&&g.lastIndex++;return f===r.length?!c&&g.test("")||l.push(""):l.push(r.slice(f)),l.length>o?l.slice(0,o):l}:"0".split(void 0,0).length?function(t,n){return void 0===t&&0===n?[]:e.call(this,t,n)}:e,[function(e,n){var i=s(this),o=null==e?void 0:e[t];return void 0!==o?o.call(e,i,n):r.call(String(i),e,n)},function(t,i){var s=n(r,this,t,i,r!==e);if(s.done)return s.value;var h=o(this),p=String(t),f=a(h,RegExp),d=h.unicode,v=(h.ignoreCase?"i":"")+(h.multiline?"m":"")+(h.unicode?"u":"")+(g?"g":"y"),m=new f(g?"^(?:"+h.source+")":h,v),x=void 0===i?_:i>>>0;if(0===x)return[];if(0===p.length)return null===l(m,p)?[p]:[];for(var E=0,I=0,b=[];I<p.length;){m.lastIndex=g?0:I;var w,N=l(m,g?p.slice(I):p);if(null===N||(w=y(c(m.lastIndex+(g?I:0)),p.length))===E)I=u(p,I,d);else{if(b.push(p.slice(E,I)),b.length===x)return b;for(var S=1;S<=N.length-1;S++)if(b.push(N[S]),b.length===x)return b;I=E=w}}return b.push(p.slice(E)),b}]}),!!f((function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var n="ab".split(t);return 2!==n.length||"a"!==n[0]||"b"!==n[1]})),g)},86:(t,e,n)=>{"use strict";var r=n(2109),i=n(4230);r({target:"String",proto:!0,forced:n(3429)("sub")},{sub:function(){return i(this,"sub","","")}})},1817:(t,e,n)=>{"use strict";var r=n(2109),i=n(9781),o=n(7854),s=n(6656),a=n(111),u=n(3070).f,c=n(9920),l=o.Symbol;if(i&&"function"==typeof l&&(!("description"in l.prototype)||void 0!==l().description)){var h={},p=function(){var t=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),e=this instanceof p?new l(t):void 0===t?l():l(t);return""===t&&(h[e]=!0),e};c(p,l);var f=p.prototype=l.prototype;f.constructor=p;var g=f.toString,d="Symbol(test)"==String(l("test")),y=/^Symbol\((.*)\)[^)]+$/;u(f,"description",{configurable:!0,get:function(){var t=a(this)?this.valueOf():this,e=g.call(t);if(s(h,t))return"";var n=d?e.slice(7,-1):e.replace(y,"$1");return""===n?void 0:n}}),r({global:!0,forced:!0},{Symbol:p})}},2165:(t,e,n)=>{n(7235)("iterator")},2526:(t,e,n)=>{"use strict";var r=n(2109),i=n(7854),o=n(5005),s=n(1913),a=n(9781),u=n(133),c=n(3307),l=n(7293),h=n(6656),p=n(3157),f=n(111),g=n(9670),d=n(7908),y=n(5656),_=n(7593),v=n(9114),m=n(30),x=n(1956),E=n(8006),I=n(1156),b=n(5181),w=n(1236),N=n(3070),S=n(5296),C=n(8880),O=n(1320),L=n(2309),T=n(6200),M=n(3501),P=n(9711),R=n(5112),A=n(6061),D=n(7235),F=n(8003),k=n(9909),B=n(2092).forEach,G=T("hidden"),U="Symbol",q=R("toPrimitive"),j=k.set,V=k.getterFor(U),Y=Object.prototype,X=i.Symbol,z=o("JSON","stringify"),W=w.f,H=N.f,J=I.f,K=S.f,Q=L("symbols"),$=L("op-symbols"),Z=L("string-to-symbol-registry"),tt=L("symbol-to-string-registry"),et=L("wks"),nt=i.QObject,rt=!nt||!nt.prototype||!nt.prototype.findChild,it=a&&l((function(){return 7!=m(H({},"a",{get:function(){return H(this,"a",{value:7}).a}})).a}))?function(t,e,n){var r=W(Y,e);r&&delete Y[e],H(t,e,n),r&&t!==Y&&H(Y,e,r)}:H,ot=function(t,e){var n=Q[t]=m(X.prototype);return j(n,{type:U,tag:t,description:e}),a||(n.description=e),n},st=c?function(t){return"symbol"==typeof t}:function(t){return Object(t)instanceof X},at=function(t,e,n){t===Y&&at($,e,n),g(t);var r=_(e,!0);return g(n),h(Q,r)?(n.enumerable?(h(t,G)&&t[G][r]&&(t[G][r]=!1),n=m(n,{enumerable:v(0,!1)})):(h(t,G)||H(t,G,v(1,{})),t[G][r]=!0),it(t,r,n)):H(t,r,n)},ut=function(t,e){g(t);var n=y(e),r=x(n).concat(pt(n));return B(r,(function(e){a&&!ct.call(n,e)||at(t,e,n[e])})),t},ct=function(t){var e=_(t,!0),n=K.call(this,e);return!(this===Y&&h(Q,e)&&!h($,e))&&(!(n||!h(this,e)||!h(Q,e)||h(this,G)&&this[G][e])||n)},lt=function(t,e){var n=y(t),r=_(e,!0);if(n!==Y||!h(Q,r)||h($,r)){var i=W(n,r);return!i||!h(Q,r)||h(n,G)&&n[G][r]||(i.enumerable=!0),i}},ht=function(t){var e=J(y(t)),n=[];return B(e,(function(t){h(Q,t)||h(M,t)||n.push(t)})),n},pt=function(t){var e=t===Y,n=J(e?$:y(t)),r=[];return B(n,(function(t){!h(Q,t)||e&&!h(Y,t)||r.push(Q[t])})),r};u||(O((X=function(){if(this instanceof X)throw TypeError("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,e=P(t),n=function(t){this===Y&&n.call($,t),h(this,G)&&h(this[G],e)&&(this[G][e]=!1),it(this,e,v(1,t))};return a&&rt&&it(Y,e,{configurable:!0,set:n}),ot(e,t)}).prototype,"toString",(function(){return V(this).tag})),O(X,"withoutSetter",(function(t){return ot(P(t),t)})),S.f=ct,N.f=at,w.f=lt,E.f=I.f=ht,b.f=pt,A.f=function(t){return ot(R(t),t)},a&&(H(X.prototype,"description",{configurable:!0,get:function(){return V(this).description}}),s||O(Y,"propertyIsEnumerable",ct,{unsafe:!0}))),r({global:!0,wrap:!0,forced:!u,sham:!u},{Symbol:X}),B(x(et),(function(t){D(t)})),r({target:U,stat:!0,forced:!u},{for:function(t){var e=String(t);if(h(Z,e))return Z[e];var n=X(e);return Z[e]=n,tt[n]=e,n},keyFor:function(t){if(!st(t))throw TypeError(t+" is not a symbol");if(h(tt,t))return tt[t]},useSetter:function(){rt=!0},useSimple:function(){rt=!1}}),r({target:"Object",stat:!0,forced:!u,sham:!a},{create:function(t,e){return void 0===e?m(t):ut(m(t),e)},defineProperty:at,defineProperties:ut,getOwnPropertyDescriptor:lt}),r({target:"Object",stat:!0,forced:!u},{getOwnPropertyNames:ht,getOwnPropertySymbols:pt}),r({target:"Object",stat:!0,forced:l((function(){b.f(1)}))},{getOwnPropertySymbols:function(t){return b.f(d(t))}}),z&&r({target:"JSON",stat:!0,forced:!u||l((function(){var t=X();return"[null]"!=z([t])||"{}"!=z({a:t})||"{}"!=z(Object(t))}))},{stringify:function(t,e,n){for(var r,i=[t],o=1;arguments.length>o;)i.push(arguments[o++]);if(r=e,(f(e)||void 0!==t)&&!st(t))return p(e)||(e=function(t,e){if("function"==typeof r&&(e=r.call(this,t,e)),!st(e))return e}),i[1]=e,z.apply(null,i)}}),X.prototype[q]||C(X.prototype,q,X.prototype.valueOf),F(X,U),M[G]=!0},2990:(t,e,n)=>{"use strict";var r=n(260),i=n(1048),o=r.aTypedArray;(0,r.exportTypedArrayMethod)("copyWithin",(function(t,e){return i.call(o(this),t,e,arguments.length>2?arguments[2]:void 0)}))},8927:(t,e,n)=>{"use strict";var r=n(260),i=n(2092).every,o=r.aTypedArray;(0,r.exportTypedArrayMethod)("every",(function(t){return i(o(this),t,arguments.length>1?arguments[1]:void 0)}))},3105:(t,e,n)=>{"use strict";var r=n(260),i=n(1285),o=r.aTypedArray;(0,r.exportTypedArrayMethod)("fill",(function(t){return i.apply(o(this),arguments)}))},5035:(t,e,n)=>{"use strict";var r=n(260),i=n(2092).filter,o=n(3074),s=r.aTypedArray;(0,r.exportTypedArrayMethod)("filter",(function(t){var e=i(s(this),t,arguments.length>1?arguments[1]:void 0);return o(this,e)}))},7174:(t,e,n)=>{"use strict";var r=n(260),i=n(2092).findIndex,o=r.aTypedArray;(0,r.exportTypedArrayMethod)("findIndex",(function(t){return i(o(this),t,arguments.length>1?arguments[1]:void 0)}))},4345:(t,e,n)=>{"use strict";var r=n(260),i=n(2092).find,o=r.aTypedArray;(0,r.exportTypedArrayMethod)("find",(function(t){return i(o(this),t,arguments.length>1?arguments[1]:void 0)}))},6495:(t,e,n)=>{n(9843)("Float64",(function(t){return function(e,n,r){return t(this,e,n,r)}}))},2846:(t,e,n)=>{"use strict";var r=n(260),i=n(2092).forEach,o=r.aTypedArray;(0,r.exportTypedArrayMethod)("forEach",(function(t){i(o(this),t,arguments.length>1?arguments[1]:void 0)}))},4731:(t,e,n)=>{"use strict";var r=n(260),i=n(1318).includes,o=r.aTypedArray;(0,r.exportTypedArrayMethod)("includes",(function(t){return i(o(this),t,arguments.length>1?arguments[1]:void 0)}))},7209:(t,e,n)=>{"use strict";var r=n(260),i=n(1318).indexOf,o=r.aTypedArray;(0,r.exportTypedArrayMethod)("indexOf",(function(t){return i(o(this),t,arguments.length>1?arguments[1]:void 0)}))},6319:(t,e,n)=>{"use strict";var r=n(7854),i=n(260),o=n(6992),s=n(5112)("iterator"),a=r.Uint8Array,u=o.values,c=o.keys,l=o.entries,h=i.aTypedArray,p=i.exportTypedArrayMethod,f=a&&a.prototype[s],g=!!f&&("values"==f.name||null==f.name),d=function(){return u.call(h(this))};p("entries",(function(){return l.call(h(this))})),p("keys",(function(){return c.call(h(this))})),p("values",d,!g),p(s,d,!g)},8867:(t,e,n)=>{"use strict";var r=n(260),i=r.aTypedArray,o=r.exportTypedArrayMethod,s=[].join;o("join",(function(t){return s.apply(i(this),arguments)}))},7789:(t,e,n)=>{"use strict";var r=n(260),i=n(6583),o=r.aTypedArray;(0,r.exportTypedArrayMethod)("lastIndexOf",(function(t){return i.apply(o(this),arguments)}))},3739:(t,e,n)=>{"use strict";var r=n(260),i=n(2092).map,o=n(6707),s=r.aTypedArray,a=r.aTypedArrayConstructor;(0,r.exportTypedArrayMethod)("map",(function(t){return i(s(this),t,arguments.length>1?arguments[1]:void 0,(function(t,e){return new(a(o(t,t.constructor)))(e)}))}))},4483:(t,e,n)=>{"use strict";var r=n(260),i=n(3671).right,o=r.aTypedArray;(0,r.exportTypedArrayMethod)("reduceRight",(function(t){return i(o(this),t,arguments.length,arguments.length>1?arguments[1]:void 0)}))},9368:(t,e,n)=>{"use strict";var r=n(260),i=n(3671).left,o=r.aTypedArray;(0,r.exportTypedArrayMethod)("reduce",(function(t){return i(o(this),t,arguments.length,arguments.length>1?arguments[1]:void 0)}))},2056:(t,e,n)=>{"use strict";var r=n(260),i=r.aTypedArray,o=r.exportTypedArrayMethod,s=Math.floor;o("reverse",(function(){for(var t,e=this,n=i(e).length,r=s(n/2),o=0;o<r;)t=e[o],e[o++]=e[--n],e[n]=t;return e}))},3462:(t,e,n)=>{"use strict";var r=n(260),i=n(7466),o=n(4590),s=n(7908),a=n(7293),u=r.aTypedArray;(0,r.exportTypedArrayMethod)("set",(function(t){u(this);var e=o(arguments.length>1?arguments[1]:void 0,1),n=this.length,r=s(t),a=i(r.length),c=0;if(a+e>n)throw RangeError("Wrong length");for(;c<a;)this[e+c]=r[c++]}),a((function(){new Int8Array(1).set({})})))},678:(t,e,n)=>{"use strict";var r=n(260),i=n(6707),o=n(7293),s=r.aTypedArray,a=r.aTypedArrayConstructor,u=r.exportTypedArrayMethod,c=[].slice;u("slice",(function(t,e){for(var n=c.call(s(this),t,e),r=i(this,this.constructor),o=0,u=n.length,l=new(a(r))(u);u>o;)l[o]=n[o++];return l}),o((function(){new Int8Array(1).slice()})))},7462:(t,e,n)=>{"use strict";var r=n(260),i=n(2092).some,o=r.aTypedArray;(0,r.exportTypedArrayMethod)("some",(function(t){return i(o(this),t,arguments.length>1?arguments[1]:void 0)}))},3824:(t,e,n)=>{"use strict";var r=n(260),i=n(7854),o=n(7293),s=n(3099),a=n(7466),u=n(4362),c=n(8886),l=n(256),h=n(7392),p=n(8008),f=r.aTypedArray,g=r.exportTypedArrayMethod,d=i.Uint16Array,y=d&&d.prototype.sort,_=!!y&&!o((function(){var t=new d(2);t.sort(null),t.sort({})})),v=!!y&&!o((function(){if(h)return h<74;if(c)return c<67;if(l)return!0;if(p)return p<602;var t,e,n=new d(516),r=Array(516);for(t=0;t<516;t++)e=t%4,n[t]=515-t,r[t]=t-2*e+3;for(n.sort((function(t,e){return(t/4|0)-(e/4|0)})),t=0;t<516;t++)if(n[t]!==r[t])return!0}));g("sort",(function(t){var e=this;if(void 0!==t&&s(t),v)return y.call(e,t);f(e);var n,r=a(e.length),i=Array(r);for(n=0;n<r;n++)i[n]=e[n];for(i=u(e,function(t){return function(e,n){return void 0!==t?+t(e,n)||0:n!=n?-1:e!=e?1:0===e&&0===n?1/e>0&&1/n<0?1:-1:e>n}}(t)),n=0;n<r;n++)e[n]=i[n];return e}),!v||_)},5021:(t,e,n)=>{"use strict";var r=n(260),i=n(7466),o=n(1400),s=n(6707),a=r.aTypedArray;(0,r.exportTypedArrayMethod)("subarray",(function(t,e){var n=a(this),r=n.length,u=o(t,r);return new(s(n,n.constructor))(n.buffer,n.byteOffset+u*n.BYTES_PER_ELEMENT,i((void 0===e?r:o(e,r))-u))}))},2974:(t,e,n)=>{"use strict";var r=n(7854),i=n(260),o=n(7293),s=r.Int8Array,a=i.aTypedArray,u=i.exportTypedArrayMethod,c=[].toLocaleString,l=[].slice,h=!!s&&o((function(){c.call(new s(1))}));u("toLocaleString",(function(){return c.apply(h?l.call(a(this)):a(this),arguments)}),o((function(){return[1,2].toLocaleString()!=new s([1,2]).toLocaleString()}))||!o((function(){s.prototype.toLocaleString.call([1,2])})))},5016:(t,e,n)=>{"use strict";var r=n(260).exportTypedArrayMethod,i=n(7293),o=n(7854).Uint8Array,s=o&&o.prototype||{},a=[].toString,u=[].join;i((function(){a.call({})}))&&(a=function(){return u.call(this)});var c=s.toString!=a;r("toString",a,c)},9135:(t,e,n)=>{n(9843)("Uint32",(function(t){return function(e,n,r){return t(this,e,n,r)}}))},3948:(t,e,n)=>{var r=n(7854),i=n(8324),o=n(6992),s=n(8880),a=n(5112),u=a("iterator"),c=a("toStringTag"),l=o.values;for(var h in i){var p=r[h],f=p&&p.prototype;if(f){if(f[u]!==l)try{s(f,u,l)}catch(t){f[u]=l}if(f[c]||s(f,c,h),i[h])for(var g in o)if(f[g]!==o[g])try{s(f,g,o[g])}catch(t){f[g]=o[g]}}}},4529:(t,e,n)=>{"use strict";t.exports=function(t){var e=t.length;if(e<3){for(var n=new Array(e),i=0;i<e;++i)n[i]=i;return 2===e&&t[0][0]===t[1][0]&&t[0][1]===t[1][1]?[0]:n}var o=new Array(e);for(i=0;i<e;++i)o[i]=i;o.sort((function(e,n){return t[e][0]-t[n][0]||t[e][1]-t[n][1]}));var s=[o[0],o[1]],a=[o[0],o[1]];for(i=2;i<e;++i){for(var u=o[i],c=t[u],l=s.length;l>1&&r(t[s[l-2]],t[s[l-1]],c)<=0;)l-=1,s.pop();for(s.push(u),l=a.length;l>1&&r(t[a[l-2]],t[a[l-1]],c)>=0;)l-=1,a.pop();a.push(u)}n=new Array(a.length+s.length-2);for(var h=0,p=(i=0,s.length);i<p;++i)n[h++]=s[i];for(var f=a.length-2;f>0;--f)n[h++]=a[f];return n};var r=n(146)[3]},6960:t=>{t.exports=function(t,e){for(var n=t[0],r=t[1],i=!1,o=0,s=e.length-1;o<e.length;s=o++){var a=e[o][0],u=e[o][1],c=e[s][0],l=e[s][1];u>r!=l>r&&n<(c-a)*(r-u)/(l-u)+a&&(i=!i)}return i}},146:(t,e,n)=>{"use strict";var r=n(8005),i=n(6740),o=n(5442),s=n(7972);function a(t,e){for(var n=new Array(t.length-1),r=1;r<t.length;++r)for(var i=n[r-1]=new Array(t.length-1),o=0,s=0;o<t.length;++o)o!==e&&(i[s++]=t[r][o]);return n}function u(t){if(1===t.length)return t[0];if(2===t.length)return["sum(",t[0],",",t[1],")"].join("");var e=t.length>>1;return["sum(",u(t.slice(0,e)),",",u(t.slice(e)),")"].join("")}function c(t){if(2===t.length)return[["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("")];for(var e=[],n=0;n<t.length;++n)e.push(["scale(",u(c(a(t,n))),",",(r=n,1&r?"-":""),t[0][n],")"].join(""));return e;var r}function l(t){for(var e=[],n=[],l=function(t){for(var e=new Array(t),n=0;n<t;++n){e[n]=new Array(t);for(var r=0;r<t;++r)e[n][r]=["m",r,"[",t-n-1,"]"].join("")}return e}(t),h=[],p=0;p<t;++p)0==(1&p)?e.push.apply(e,c(a(l,p))):n.push.apply(n,c(a(l,p))),h.push("m"+p);var f=u(e),g=u(n),d="orientation"+t+"Exact",y=["function ",d,"(",h.join(),"){var p=",f,",n=",g,",d=sub(p,n);return d[d.length-1];};return ",d].join("");return new Function("sum","prod","scale","sub",y)(i,r,o,s)}var h=l(3),p=l(4),f=[function(){return 0},function(){return 0},function(t,e){return e[0]-t[0]},function(t,e,n){var r,i=(t[1]-n[1])*(e[0]-n[0]),o=(t[0]-n[0])*(e[1]-n[1]),s=i-o;if(i>0){if(o<=0)return s;r=i+o}else{if(!(i<0))return s;if(o>=0)return s;r=-(i+o)}var a=33306690738754716e-32*r;return s>=a||s<=-a?s:h(t,e,n)},function(t,e,n,r){var i=t[0]-r[0],o=e[0]-r[0],s=n[0]-r[0],a=t[1]-r[1],u=e[1]-r[1],c=n[1]-r[1],l=t[2]-r[2],h=e[2]-r[2],f=n[2]-r[2],g=o*c,d=s*u,y=s*a,_=i*c,v=i*u,m=o*a,x=l*(g-d)+h*(y-_)+f*(v-m),E=7771561172376103e-31*((Math.abs(g)+Math.abs(d))*Math.abs(l)+(Math.abs(y)+Math.abs(_))*Math.abs(h)+(Math.abs(v)+Math.abs(m))*Math.abs(f));return x>E||-x>E?x:p(t,e,n,r)}];function g(t){var e=f[t.length];return e||(e=f[t.length]=l(t.length)),e.apply(void 0,t)}!function(){for(;f.length<=5;)f.push(l(f.length));for(var e=[],n=["slow"],r=0;r<=5;++r)e.push("a"+r),n.push("o"+r);var i=["function getOrientation(",e.join(),"){switch(arguments.length){case 0:case 1:return 0;"];for(r=2;r<=5;++r)i.push("case ",r,":return o",r,"(",e.slice(0,r).join(),");");i.push("}var s=new Array(arguments.length);for(var i=0;i<arguments.length;++i){s[i]=arguments[i]};return slow(s);}return getOrientation"),n.push(i.join(""));var o=Function.apply(void 0,n);for(t.exports=o.apply(void 0,[g].concat(f)),r=0;r<=5;++r)t.exports[r]=f[r]}()},5442:(t,e,n)=>{"use strict";var r=n(8005),i=n(6359);t.exports=function(t,e){var n=t.length;if(1===n){var o=r(t[0],e);return o[0]?o:[o[1]]}var s=new Array(2*n),a=[.1,.1],u=[.1,.1],c=0;r(t[0],e,a),a[0]&&(s[c++]=a[0]);for(var l=1;l<n;++l){r(t[l],e,u);var h=a[1];i(h,u[0],a),a[0]&&(s[c++]=a[0]);var p=u[1],f=a[1],g=p+f,d=f-(g-p);a[1]=g,d&&(s[c++]=d)}return a[1]&&(s[c++]=a[1]),0===c&&(s[c++]=0),s.length=c,s}},7972:t=>{"use strict";t.exports=function(t,e){var n=0|t.length,r=0|e.length;if(1===n&&1===r)return function(t,e){var n=t+e,r=n-t,i=t-(n-r)+(e-r);return i?[i,n]:[n]}(t[0],-e[0]);var i,o,s=new Array(n+r),a=0,u=0,c=0,l=Math.abs,h=t[u],p=l(h),f=-e[c],g=l(f);p<g?(o=h,(u+=1)<n&&(p=l(h=t[u]))):(o=f,(c+=1)<r&&(g=l(f=-e[c]))),u<n&&p<g||c>=r?(i=h,(u+=1)<n&&(p=l(h=t[u]))):(i=f,(c+=1)<r&&(g=l(f=-e[c])));for(var d,y,_=i+o,v=_-i,m=o-v,x=m,E=_;u<n&&c<r;)p<g?(i=h,(u+=1)<n&&(p=l(h=t[u]))):(i=f,(c+=1)<r&&(g=l(f=-e[c]))),(m=(o=x)-(v=(_=i+o)-i))&&(s[a++]=m),x=E-((d=E+_)-(y=d-E))+(_-y),E=d;for(;u<n;)(m=(o=x)-(v=(_=(i=h)+o)-i))&&(s[a++]=m),x=E-((d=E+_)-(y=d-E))+(_-y),E=d,(u+=1)<n&&(h=t[u]);for(;c<r;)(m=(o=x)-(v=(_=(i=f)+o)-i))&&(s[a++]=m),x=E-((d=E+_)-(y=d-E))+(_-y),E=d,(c+=1)<r&&(f=-e[c]);return x&&(s[a++]=x),E&&(s[a++]=E),a||(s[a++]=0),s.length=a,s}},6740:t=>{"use strict";t.exports=function(t,e){var n=0|t.length,r=0|e.length;if(1===n&&1===r)return function(t,e){var n=t+e,r=n-t,i=t-(n-r)+(e-r);return i?[i,n]:[n]}(t[0],e[0]);var i,o,s=new Array(n+r),a=0,u=0,c=0,l=Math.abs,h=t[u],p=l(h),f=e[c],g=l(f);p<g?(o=h,(u+=1)<n&&(p=l(h=t[u]))):(o=f,(c+=1)<r&&(g=l(f=e[c]))),u<n&&p<g||c>=r?(i=h,(u+=1)<n&&(p=l(h=t[u]))):(i=f,(c+=1)<r&&(g=l(f=e[c])));for(var d,y,_=i+o,v=_-i,m=o-v,x=m,E=_;u<n&&c<r;)p<g?(i=h,(u+=1)<n&&(p=l(h=t[u]))):(i=f,(c+=1)<r&&(g=l(f=e[c]))),(m=(o=x)-(v=(_=i+o)-i))&&(s[a++]=m),x=E-((d=E+_)-(y=d-E))+(_-y),E=d;for(;u<n;)(m=(o=x)-(v=(_=(i=h)+o)-i))&&(s[a++]=m),x=E-((d=E+_)-(y=d-E))+(_-y),E=d,(u+=1)<n&&(h=t[u]);for(;c<r;)(m=(o=x)-(v=(_=(i=f)+o)-i))&&(s[a++]=m),x=E-((d=E+_)-(y=d-E))+(_-y),E=d,(c+=1)<r&&(f=e[c]);return x&&(s[a++]=x),E&&(s[a++]=E),a||(s[a++]=0),s.length=a,s}},3842:t=>{"use strict";function e(t,r){if(!(this instanceof e))return new e(t,r);if(this.data=t||[],this.length=this.data.length,this.compare=r||n,this.length>0)for(var i=(this.length>>1)-1;i>=0;i--)this._down(i)}function n(t,e){return t<e?-1:t>e?1:0}t.exports=e,t.exports.default=e,e.prototype={push:function(t){this.data.push(t),this.length++,this._up(this.length-1)},pop:function(){if(0!==this.length){var t=this.data[0];return this.length--,this.length>0&&(this.data[0]=this.data[this.length],this._down(0)),this.data.pop(),t}},peek:function(){return this.data[0]},_up:function(t){for(var e=this.data,n=this.compare,r=e[t];t>0;){var i=t-1>>1,o=e[i];if(n(r,o)>=0)break;e[t]=o,t=i}e[t]=r},_down:function(t){for(var e=this.data,n=this.compare,r=this.length>>1,i=e[t];t<r;){var o=1+(t<<1),s=o+1,a=e[o];if(s<this.length&&n(e[s],a)<0&&(o=s,a=e[s]),n(a,i)>=0)break;e[t]=a,t=o}e[t]=i}}},675:function(t,e){!function(t){"use strict";function e(){}function n(t){this.message=t||""}function r(t){this.message=t||""}function i(t){this.message=t||""}function o(){}function s(t){return null===t?At:t.color}function a(t){return null===t?null:t.parent}function u(t,e){null!==t&&(t.color=e)}function c(t){return null===t?null:t.left}function l(t){return null===t?null:t.right}function h(){this.root_=null,this.size_=0}function p(){}function f(){this.array_=[],arguments[0]instanceof xt&&this.addAll(arguments[0])}function g(){}function d(t){this.message=t||""}function y(){this.array_=[]}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(t){if(null==this)throw new TypeError(this+" is not an object");var e=Object(this),n=Math.max(Math.min(e.length,9007199254740991),0)||0,r=1 in arguments&&parseInt(Number(arguments[1]),10)||0;r=r<0?Math.max(n+r,0):Math.min(r,n);var i=2 in arguments&&void 0!==arguments[2]?parseInt(Number(arguments[2]),10)||0:n;for(i=i<0?Math.max(n+arguments[2],0):Math.min(i,n);r<i;)e[r]=t,++r;return e},writable:!0}),Number.isFinite=Number.isFinite||function(t){return"number"==typeof t&&isFinite(t)},Number.isInteger=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},Number.parseFloat=Number.parseFloat||parseFloat,Number.isNaN=Number.isNaN||function(t){return t!=t},Math.trunc=Math.trunc||function(t){return t<0?Math.ceil(t):Math.floor(t)};var _=function(){};_.prototype.interfaces_=function(){return[]},_.prototype.getClass=function(){return _},_.prototype.equalsWithTolerance=function(t,e,n){return Math.abs(t-e)<=n};var v=function(t){function e(e){t.call(this,e),this.name="IllegalArgumentException",this.message=e,this.stack=(new t).stack}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),m=function(){},x={MAX_VALUE:{configurable:!0}};m.isNaN=function(t){return Number.isNaN(t)},m.doubleToLongBits=function(t){return t},m.longBitsToDouble=function(t){return t},m.isInfinite=function(t){return!Number.isFinite(t)},x.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(m,x);var E=function(){},I=function(){},b=function(){},w=function t(){if(this.x=null,this.y=null,this.z=null,0===arguments.length)this.x=0,this.y=0,this.z=t.NULL_ORDINATE;else if(1===arguments.length){var e=arguments[0];this.x=e.x,this.y=e.y,this.z=e.z}else 2===arguments.length?(this.x=arguments[0],this.y=arguments[1],this.z=t.NULL_ORDINATE):3===arguments.length&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},N={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};w.prototype.setOrdinate=function(t,e){switch(t){case w.X:this.x=e;break;case w.Y:this.y=e;break;case w.Z:this.z=e;break;default:throw new v("Invalid ordinate index: "+t)}},w.prototype.equals2D=function(){if(1===arguments.length){var t=arguments[0];return this.x===t.x&&this.y===t.y}if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!_.equalsWithTolerance(this.x,e.x,n)&&!!_.equalsWithTolerance(this.y,e.y,n)}},w.prototype.getOrdinate=function(t){switch(t){case w.X:return this.x;case w.Y:return this.y;case w.Z:return this.z}throw new v("Invalid ordinate index: "+t)},w.prototype.equals3D=function(t){return this.x===t.x&&this.y===t.y&&(this.z===t.z||m.isNaN(this.z))&&m.isNaN(t.z)},w.prototype.equals=function(t){return t instanceof w&&this.equals2D(t)},w.prototype.equalInZ=function(t,e){return _.equalsWithTolerance(this.z,t.z,e)},w.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},w.prototype.clone=function(){},w.prototype.copy=function(){return new w(this)},w.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},w.prototype.distance3D=function(t){var e=this.x-t.x,n=this.y-t.y,r=this.z-t.z;return Math.sqrt(e*e+n*n+r*r)},w.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},w.prototype.hashCode=function(){var t=17;return 37*(t=37*t+w.hashCode(this.x))+w.hashCode(this.y)},w.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},w.prototype.interfaces_=function(){return[E,I,e]},w.prototype.getClass=function(){return w},w.hashCode=function(){if(1===arguments.length){var t=arguments[0],e=m.doubleToLongBits(t);return Math.trunc((e^e)>>>32)}},N.DimensionalComparator.get=function(){return S},N.serialVersionUID.get=function(){return 0x5cbf2c235c7e5800},N.NULL_ORDINATE.get=function(){return m.NaN},N.X.get=function(){return 0},N.Y.get=function(){return 1},N.Z.get=function(){return 2},Object.defineProperties(w,N);var S=function(t){if(this._dimensionsToTest=2,0===arguments.length);else if(1===arguments.length){var e=arguments[0];if(2!==e&&3!==e)throw new v("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}};S.prototype.compare=function(t,e){var n=t,r=e,i=S.compare(n.x,r.x);if(0!==i)return i;var o=S.compare(n.y,r.y);return 0!==o?o:this._dimensionsToTest<=2?0:S.compare(n.z,r.z)},S.prototype.interfaces_=function(){return[b]},S.prototype.getClass=function(){return S},S.compare=function(t,e){return t<e?-1:t>e?1:m.isNaN(t)?m.isNaN(e)?0:-1:m.isNaN(e)?1:0};var C=function(){};C.prototype.create=function(){},C.prototype.interfaces_=function(){return[]},C.prototype.getClass=function(){return C};var O=function(){},L={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};O.prototype.interfaces_=function(){return[]},O.prototype.getClass=function(){return O},O.toLocationSymbol=function(t){switch(t){case O.EXTERIOR:return"e";case O.BOUNDARY:return"b";case O.INTERIOR:return"i";case O.NONE:return"-"}throw new v("Unknown location value: "+t)},L.INTERIOR.get=function(){return 0},L.BOUNDARY.get=function(){return 1},L.EXTERIOR.get=function(){return 2},L.NONE.get=function(){return-1},Object.defineProperties(O,L);var T=function(t,e){return t.interfaces_&&t.interfaces_().indexOf(e)>-1},M=function(){},P={LOG_10:{configurable:!0}};M.prototype.interfaces_=function(){return[]},M.prototype.getClass=function(){return M},M.log10=function(t){var e=Math.log(t);return m.isInfinite(e)||m.isNaN(e)?e:e/M.LOG_10},M.min=function(t,e,n,r){var i=t;return e<i&&(i=e),n<i&&(i=n),r<i&&(i=r),i},M.clamp=function(){if("number"==typeof arguments[2]&&"number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1],n=arguments[2];return t<e?e:t>n?n:t}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var r=arguments[0],i=arguments[1],o=arguments[2];return r<i?i:r>o?o:r}},M.wrap=function(t,e){return t<0?e- -t%e:t%e},M.max=function(){if(3===arguments.length){var t=arguments[1],e=arguments[2],n=arguments[0];return t>n&&(n=t),e>n&&(n=e),n}if(4===arguments.length){var r=arguments[1],i=arguments[2],o=arguments[3],s=arguments[0];return r>s&&(s=r),i>s&&(s=i),o>s&&(s=o),s}},M.average=function(t,e){return(t+e)/2},P.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(M,P);var R=function(t){this.str=t};R.prototype.append=function(t){this.str+=t},R.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},R.prototype.toString=function(t){return this.str};var A=function(t){this.value=t};A.prototype.intValue=function(){return this.value},A.prototype.compareTo=function(t){return this.value<t?-1:this.value>t?1:0},A.isNaN=function(t){return Number.isNaN(t)};var D=function(){};D.isWhitespace=function(t){return t<=32&&t>=0||127===t},D.toUpperCase=function(t){return t.toUpperCase()};var F=function t(){if(this._hi=0,this._lo=0,0===arguments.length)this.init(0);else if(1===arguments.length)if("number"==typeof arguments[0]){var e=arguments[0];this.init(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.init(n)}else"string"==typeof arguments[0]&&t.call(this,t.parse(arguments[0]));else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.init(r,i)}},k={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}};F.prototype.le=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<=t._lo},F.prototype.extractSignificantDigits=function(t,e){var n=this.abs(),r=F.magnitude(n._hi),i=F.TEN.pow(r);(n=n.divide(i)).gt(F.TEN)?(n=n.divide(F.TEN),r+=1):n.lt(F.ONE)&&(n=n.multiply(F.TEN),r-=1);for(var o=r+1,s=new R,a=F.MAX_PRINT_DIGITS-1,u=0;u<=a;u++){t&&u===o&&s.append(".");var c=Math.trunc(n._hi);if(c<0)break;var l=!1,h=0;c>9?(l=!0,h="9"):h="0"+c,s.append(h),n=n.subtract(F.valueOf(c)).multiply(F.TEN),l&&n.selfAdd(F.TEN);var p=!0,f=F.magnitude(n._hi);if(f<0&&Math.abs(f)>=a-u&&(p=!1),!p)break}return e[0]=r,s.toString()},F.prototype.sqr=function(){return this.multiply(this)},F.prototype.doubleValue=function(){return this._hi+this._lo},F.prototype.subtract=function(){if(arguments[0]instanceof F){var t=arguments[0];return this.add(t.negate())}if("number"==typeof arguments[0]){var e=arguments[0];return this.add(-e)}},F.prototype.equals=function(){if(1===arguments.length){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},F.prototype.isZero=function(){return 0===this._hi&&0===this._lo},F.prototype.selfSubtract=function(){if(arguments[0]instanceof F){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e,0)}},F.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},F.prototype.min=function(t){return this.le(t)?this:t},F.prototype.selfDivide=function(){if(1===arguments.length){if(arguments[0]instanceof F){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfDivide(e,0)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1],i=null,o=null,s=null,a=null,u=null,c=null,l=null,h=null;return u=this._hi/n,h=(i=(c=F.SPLIT*u)-(i=c-u))*(s=(h=F.SPLIT*n)-(s=h-n))-(l=u*n)+i*(a=n-s)+(o=u-i)*s+o*a,h=u+(c=(this._hi-l-h+this._lo-u*r)/n),this._hi=h,this._lo=u-h+c,this}},F.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},F.prototype.divide=function(){if(arguments[0]instanceof F){var t=arguments[0],e=null,n=null,r=null,i=null,o=null,s=null,a=null,u=null;return n=(o=this._hi/t._hi)-(e=(s=F.SPLIT*o)-(e=s-o)),u=e*(r=(u=F.SPLIT*t._hi)-(r=u-t._hi))-(a=o*t._hi)+e*(i=t._hi-r)+n*r+n*i,s=(this._hi-a-u+this._lo-o*t._lo)/t._hi,new F(u=o+s,o-u+s)}if("number"==typeof arguments[0]){var c=arguments[0];return m.isNaN(c)?F.createNaN():F.copy(this).selfDivide(c,0)}},F.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},F.prototype.pow=function(t){if(0===t)return F.valueOf(1);var e=new F(this),n=F.valueOf(1),r=Math.abs(t);if(r>1)for(;r>0;)r%2==1&&n.selfMultiply(e),(r/=2)>0&&(e=e.sqr());else n=e;return t<0?n.reciprocal():n},F.prototype.ceil=function(){if(this.isNaN())return F.NaN;var t=Math.ceil(this._hi),e=0;return t===this._hi&&(e=Math.ceil(this._lo)),new F(t,e)},F.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},F.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},F.prototype.setValue=function(){if(arguments[0]instanceof F){var t=arguments[0];return this.init(t),this}if("number"==typeof arguments[0]){var e=arguments[0];return this.init(e),this}},F.prototype.max=function(t){return this.ge(t)?this:t},F.prototype.sqrt=function(){if(this.isZero())return F.valueOf(0);if(this.isNegative())return F.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,n=F.valueOf(e),r=this.subtract(n.sqr())._hi*(.5*t);return n.add(r)},F.prototype.selfAdd=function(){if(1===arguments.length){if(arguments[0]instanceof F){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0],n=null,r=null,i=null,o=null,s=null,a=null;return o=(i=this._hi+e)-(s=i-this._hi),r=(a=(o=e-s+(this._hi-o))+this._lo)+(i-(n=i+a)),this._hi=n+r,this._lo=r+(n-this._hi),this}}else if(2===arguments.length){var u=arguments[0],c=arguments[1],l=null,h=null,p=null,f=null,g=null,d=null,y=null;f=this._hi+u,h=this._lo+c,g=f-(d=f-this._hi),p=h-(y=h-this._lo);var _=(l=f+(d=(g=u-d+(this._hi-g))+h))+(d=(p=c-y+(this._lo-p))+(d+(f-l))),v=d+(l-_);return this._hi=_,this._lo=v,this}},F.prototype.selfMultiply=function(){if(1===arguments.length){if(arguments[0]instanceof F){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfMultiply(e,0)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1],i=null,o=null,s=null,a=null,u=null,c=null;i=(u=F.SPLIT*this._hi)-this._hi,c=F.SPLIT*n,i=u-i,o=this._hi-i,s=c-n;var l=(u=this._hi*n)+(c=i*(s=c-s)-u+i*(a=n-s)+o*s+o*a+(this._hi*r+this._lo*n)),h=c+(i=u-l);return this._hi=l,this._lo=h,this}},F.prototype.selfSqr=function(){return this.selfMultiply(this)},F.prototype.floor=function(){if(this.isNaN())return F.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new F(t,e)},F.prototype.negate=function(){return this.isNaN()?this:new F(-this._hi,-this._lo)},F.prototype.clone=function(){},F.prototype.multiply=function(){if(arguments[0]instanceof F){var t=arguments[0];return t.isNaN()?F.createNaN():F.copy(this).selfMultiply(t)}if("number"==typeof arguments[0]){var e=arguments[0];return m.isNaN(e)?F.createNaN():F.copy(this).selfMultiply(e,0)}},F.prototype.isNaN=function(){return m.isNaN(this._hi)},F.prototype.intValue=function(){return Math.trunc(this._hi)},F.prototype.toString=function(){var t=F.magnitude(this._hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},F.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!0,e),r=e[0]+1,i=n;if("."===n.charAt(0))i="0"+n;else if(r<0)i="0."+F.stringOfChar("0",-r)+n;else if(-1===n.indexOf(".")){var o=r-n.length;i=n+F.stringOfChar("0",o)+".0"}return this.isNegative()?"-"+i:i},F.prototype.reciprocal=function(){var t,e,n,r,i=null,o=null,s=null,a=null;t=(n=1/this._hi)-(i=(s=F.SPLIT*n)-(i=s-n)),o=(a=F.SPLIT*this._hi)-this._hi;var u=n+(s=(1-(r=n*this._hi)-(a=i*(o=a-o)-r+i*(e=this._hi-o)+t*o+t*e)-n*this._lo)/this._hi);return new F(u,n-u+s)},F.prototype.toSciNotation=function(){if(this.isZero())return F.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!1,e),r=F.SCI_NOT_EXPONENT_CHAR+e[0];if("0"===n.charAt(0))throw new Error("Found leading zero: "+n);var i="";n.length>1&&(i=n.substring(1));var o=n.charAt(0)+"."+i;return this.isNegative()?"-"+o+r:o+r},F.prototype.abs=function(){return this.isNaN()?F.NaN:this.isNegative()?this.negate():new F(this)},F.prototype.isPositive=function(){return(this._hi>0||0===this._hi)&&this._lo>0},F.prototype.lt=function(t){return(this._hi<t._hi||this._hi===t._hi)&&this._lo<t._lo},F.prototype.add=function(){if(arguments[0]instanceof F){var t=arguments[0];return F.copy(this).selfAdd(t)}if("number"==typeof arguments[0]){var e=arguments[0];return F.copy(this).selfAdd(e)}},F.prototype.init=function(){if(1===arguments.length){if("number"==typeof arguments[0]){var t=arguments[0];this._hi=t,this._lo=0}else if(arguments[0]instanceof F){var e=arguments[0];this._hi=e._hi,this._lo=e._lo}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this._hi=n,this._lo=r}},F.prototype.gt=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>t._lo},F.prototype.isNegative=function(){return(this._hi<0||0===this._hi)&&this._lo<0},F.prototype.trunc=function(){return this.isNaN()?F.NaN:this.isPositive()?this.floor():this.ceil()},F.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},F.prototype.interfaces_=function(){return[e,E,I]},F.prototype.getClass=function(){return F},F.sqr=function(t){return F.valueOf(t).selfMultiply(t)},F.valueOf=function(){if("string"==typeof arguments[0]){var t=arguments[0];return F.parse(t)}if("number"==typeof arguments[0])return new F(arguments[0])},F.sqrt=function(t){return F.valueOf(t).sqrt()},F.parse=function(t){for(var e=0,n=t.length;D.isWhitespace(t.charAt(e));)e++;var r=!1;if(e<n){var i=t.charAt(e);"-"!==i&&"+"!==i||(e++,"-"===i&&(r=!0))}for(var o=new F,s=0,a=0,u=0;!(e>=n);){var c=t.charAt(e);if(e++,D.isDigit(c)){var l=c-"0";o.selfMultiply(F.TEN),o.selfAdd(l),s++}else{if("."!==c){if("e"===c||"E"===c){var h=t.substring(e);try{u=A.parseInt(h)}catch(e){throw e instanceof Error?new Error("Invalid exponent "+h+" in string "+t):e}break}throw new Error("Unexpected character '"+c+"' at position "+e+" in string "+t)}a=s}}var p=o,f=s-a-u;if(0===f)p=o;else if(f>0){var g=F.TEN.pow(f);p=o.divide(g)}else if(f<0){var d=F.TEN.pow(-f);p=o.multiply(d)}return r?p.negate():p},F.createNaN=function(){return new F(m.NaN,m.NaN)},F.copy=function(t){return new F(t)},F.magnitude=function(t){var e=Math.abs(t),n=Math.log(e)/Math.log(10),r=Math.trunc(Math.floor(n));return 10*Math.pow(10,r)<=e&&(r+=1),r},F.stringOfChar=function(t,e){for(var n=new R,r=0;r<e;r++)n.append(t);return n.toString()},k.PI.get=function(){return new F(3.141592653589793,12246467991473532e-32)},k.TWO_PI.get=function(){return new F(6.283185307179586,24492935982947064e-32)},k.PI_2.get=function(){return new F(1.5707963267948966,6123233995736766e-32)},k.E.get=function(){return new F(2.718281828459045,14456468917292502e-32)},k.NaN.get=function(){return new F(m.NaN,m.NaN)},k.EPS.get=function(){return 123259516440783e-46},k.SPLIT.get=function(){return 134217729},k.MAX_PRINT_DIGITS.get=function(){return 32},k.TEN.get=function(){return F.valueOf(10)},k.ONE.get=function(){return F.valueOf(1)},k.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"},k.SCI_NOT_ZERO.get=function(){return"0.0E0"},Object.defineProperties(F,k);var B=function(){},G={DP_SAFE_EPSILON:{configurable:!0}};B.prototype.interfaces_=function(){return[]},B.prototype.getClass=function(){return B},B.orientationIndex=function(t,e,n){var r=B.orientationIndexFilter(t,e,n);if(r<=1)return r;var i=F.valueOf(e.x).selfAdd(-t.x),o=F.valueOf(e.y).selfAdd(-t.y),s=F.valueOf(n.x).selfAdd(-e.x),a=F.valueOf(n.y).selfAdd(-e.y);return i.selfMultiply(a).selfSubtract(o.selfMultiply(s)).signum()},B.signOfDet2x2=function(t,e,n,r){return t.multiply(r).selfSubtract(e.multiply(n)).signum()},B.intersection=function(t,e,n,r){var i=F.valueOf(r.y).selfSubtract(n.y).selfMultiply(F.valueOf(e.x).selfSubtract(t.x)),o=F.valueOf(r.x).selfSubtract(n.x).selfMultiply(F.valueOf(e.y).selfSubtract(t.y)),s=i.subtract(o),a=F.valueOf(r.x).selfSubtract(n.x).selfMultiply(F.valueOf(t.y).selfSubtract(n.y)),u=F.valueOf(r.y).selfSubtract(n.y).selfMultiply(F.valueOf(t.x).selfSubtract(n.x)),c=a.subtract(u).selfDivide(s).doubleValue(),l=F.valueOf(t.x).selfAdd(F.valueOf(e.x).selfSubtract(t.x).selfMultiply(c)).doubleValue(),h=F.valueOf(e.x).selfSubtract(t.x).selfMultiply(F.valueOf(t.y).selfSubtract(n.y)),p=F.valueOf(e.y).selfSubtract(t.y).selfMultiply(F.valueOf(t.x).selfSubtract(n.x)),f=h.subtract(p).selfDivide(s).doubleValue(),g=F.valueOf(n.y).selfAdd(F.valueOf(r.y).selfSubtract(n.y).selfMultiply(f)).doubleValue();return new w(l,g)},B.orientationIndexFilter=function(t,e,n){var r=null,i=(t.x-n.x)*(e.y-n.y),o=(t.y-n.y)*(e.x-n.x),s=i-o;if(i>0){if(o<=0)return B.signum(s);r=i+o}else{if(!(i<0))return B.signum(s);if(o>=0)return B.signum(s);r=-i-o}var a=B.DP_SAFE_EPSILON*r;return s>=a||-s>=a?B.signum(s):2},B.signum=function(t){return t>0?1:t<0?-1:0},G.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(B,G);var U=function(){},q={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};q.X.get=function(){return 0},q.Y.get=function(){return 1},q.Z.get=function(){return 2},q.M.get=function(){return 3},U.prototype.setOrdinate=function(t,e,n){},U.prototype.size=function(){},U.prototype.getOrdinate=function(t,e){},U.prototype.getCoordinate=function(){},U.prototype.getCoordinateCopy=function(t){},U.prototype.getDimension=function(){},U.prototype.getX=function(t){},U.prototype.clone=function(){},U.prototype.expandEnvelope=function(t){},U.prototype.copy=function(){},U.prototype.getY=function(t){},U.prototype.toCoordinateArray=function(){},U.prototype.interfaces_=function(){return[I]},U.prototype.getClass=function(){return U},Object.defineProperties(U,q);var j=function(){},V=function(t){function e(){t.call(this,"Projective point not representable on the Cartesian plane.")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(j),Y=function(){};Y.arraycopy=function(t,e,n,r,i){for(var o=0,s=e;s<e+i;s++)n[r+o]=t[s],o++},Y.getProperty=function(t){return{"line.separator":"\n"}[t]};var X=function t(){if(this.x=null,this.y=null,this.w=null,0===arguments.length)this.x=0,this.y=0,this.w=1;else if(1===arguments.length){var e=arguments[0];this.x=e.x,this.y=e.y,this.w=1}else if(2===arguments.length){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var n=arguments[0],r=arguments[1];this.x=n,this.y=r,this.w=1}else if(arguments[0]instanceof t&&arguments[1]instanceof t){var i=arguments[0],o=arguments[1];this.x=i.y*o.w-o.y*i.w,this.y=o.x*i.w-i.x*o.w,this.w=i.x*o.y-o.x*i.y}else if(arguments[0]instanceof w&&arguments[1]instanceof w){var s=arguments[0],a=arguments[1];this.x=s.y-a.y,this.y=a.x-s.x,this.w=s.x*a.y-a.x*s.y}}else if(3===arguments.length){var u=arguments[0],c=arguments[1],l=arguments[2];this.x=u,this.y=c,this.w=l}else if(4===arguments.length){var h=arguments[0],p=arguments[1],f=arguments[2],g=arguments[3],d=h.y-p.y,y=p.x-h.x,_=h.x*p.y-p.x*h.y,v=f.y-g.y,m=g.x-f.x,x=f.x*g.y-g.x*f.y;this.x=y*x-m*_,this.y=v*_-d*x,this.w=d*m-v*y}};X.prototype.getY=function(){var t=this.y/this.w;if(m.isNaN(t)||m.isInfinite(t))throw new V;return t},X.prototype.getX=function(){var t=this.x/this.w;if(m.isNaN(t)||m.isInfinite(t))throw new V;return t},X.prototype.getCoordinate=function(){var t=new w;return t.x=this.getX(),t.y=this.getY(),t},X.prototype.interfaces_=function(){return[]},X.prototype.getClass=function(){return X},X.intersection=function(t,e,n,r){var i=t.y-e.y,o=e.x-t.x,s=t.x*e.y-e.x*t.y,a=n.y-r.y,u=r.x-n.x,c=n.x*r.y-r.x*n.y,l=i*u-a*o,h=(o*c-u*s)/l,p=(a*s-i*c)/l;if(m.isNaN(h)||m.isInfinite(h)||m.isNaN(p)||m.isInfinite(p))throw new V;return new w(h,p)};var z=function t(){if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,0===arguments.length)this.init();else if(1===arguments.length){if(arguments[0]instanceof w){var e=arguments[0];this.init(e.x,e.x,e.y,e.y)}else if(arguments[0]instanceof t){var n=arguments[0];this.init(n)}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.init(r.x,i.x,r.y,i.y)}else if(4===arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2],u=arguments[3];this.init(o,s,a,u)}},W={serialVersionUID:{configurable:!0}};z.prototype.getArea=function(){return this.getWidth()*this.getHeight()},z.prototype.equals=function(t){if(!(t instanceof z))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()},z.prototype.intersection=function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new z;var e=this._minx>t._minx?this._minx:t._minx,n=this._miny>t._miny?this._miny:t._miny,r=this._maxx<t._maxx?this._maxx:t._maxx,i=this._maxy<t._maxy?this._maxy:t._maxy;return new z(e,r,n,i)},z.prototype.isNull=function(){return this._maxx<this._minx},z.prototype.getMaxX=function(){return this._maxx},z.prototype.covers=function(){if(1===arguments.length){if(arguments[0]instanceof w){var t=arguments[0];return this.covers(t.x,t.y)}if(arguments[0]instanceof z){var e=arguments[0];return!this.isNull()&&!e.isNull()&&e.getMinX()>=this._minx&&e.getMaxX()<=this._maxx&&e.getMinY()>=this._miny&&e.getMaxY()<=this._maxy}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return!this.isNull()&&n>=this._minx&&n<=this._maxx&&r>=this._miny&&r<=this._maxy}},z.prototype.intersects=function(){if(1===arguments.length){if(arguments[0]instanceof z){var t=arguments[0];return!this.isNull()&&!t.isNull()&&!(t._minx>this._maxx||t._maxx<this._minx||t._miny>this._maxy||t._maxy<this._miny)}if(arguments[0]instanceof w){var e=arguments[0];return this.intersects(e.x,e.y)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return!this.isNull()&&!(n>this._maxx||n<this._minx||r>this._maxy||r<this._miny)}},z.prototype.getMinY=function(){return this._miny},z.prototype.getMinX=function(){return this._minx},z.prototype.expandToInclude=function(){if(1===arguments.length){if(arguments[0]instanceof w){var t=arguments[0];this.expandToInclude(t.x,t.y)}else if(arguments[0]instanceof z){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(2===arguments.length){var n=arguments[0],r=arguments[1];this.isNull()?(this._minx=n,this._maxx=n,this._miny=r,this._maxy=r):(n<this._minx&&(this._minx=n),n>this._maxx&&(this._maxx=n),r<this._miny&&(this._miny=r),r>this._maxy&&(this._maxy=r))}},z.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t<e?t:e},z.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},z.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},z.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},z.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},z.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},z.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},z.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},z.prototype.expandBy=function(){if(1===arguments.length){var t=arguments[0];this.expandBy(t,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this.isNull())return null;this._minx-=e,this._maxx+=e,this._miny-=n,this._maxy+=n,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},z.prototype.contains=function(){if(1===arguments.length){if(arguments[0]instanceof z){var t=arguments[0];return this.covers(t)}if(arguments[0]instanceof w){var e=arguments[0];return this.covers(e)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return this.covers(n,r)}},z.prototype.centre=function(){return this.isNull()?null:new w((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},z.prototype.init=function(){if(0===arguments.length)this.setToNull();else if(1===arguments.length){if(arguments[0]instanceof w){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof z){var e=arguments[0];this._minx=e._minx,this._maxx=e._maxx,this._miny=e._miny,this._maxy=e._maxy}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.init(n.x,r.x,n.y,r.y)}else if(4===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];i<o?(this._minx=i,this._maxx=o):(this._minx=o,this._maxx=i),s<a?(this._miny=s,this._maxy=a):(this._miny=a,this._maxy=s)}},z.prototype.getMaxY=function(){return this._maxy},z.prototype.distance=function(t){if(this.intersects(t))return 0;var e=0;this._maxx<t._minx?e=t._minx-this._maxx:this._minx>t._maxx&&(e=this._minx-t._maxx);var n=0;return this._maxy<t._miny?n=t._miny-this._maxy:this._miny>t._maxy&&(n=this._miny-t._maxy),0===e?n:0===n?e:Math.sqrt(e*e+n*n)},z.prototype.hashCode=function(){var t=17;return 37*(t=37*(t=37*(t=37*t+w.hashCode(this._minx))+w.hashCode(this._maxx))+w.hashCode(this._miny))+w.hashCode(this._maxy)},z.prototype.interfaces_=function(){return[E,e]},z.prototype.getClass=function(){return z},z.intersects=function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2];return n.x>=(t.x<e.x?t.x:e.x)&&n.x<=(t.x>e.x?t.x:e.x)&&n.y>=(t.y<e.y?t.y:e.y)&&n.y<=(t.y>e.y?t.y:e.y)}if(4===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3],a=Math.min(o.x,s.x),u=Math.max(o.x,s.x),c=Math.min(r.x,i.x),l=Math.max(r.x,i.x);return!(c>u||l<a||(a=Math.min(o.y,s.y),u=Math.max(o.y,s.y),c=Math.min(r.y,i.y),l=Math.max(r.y,i.y),c>u||l<a))}},W.serialVersionUID.get=function(){return 0x51845cd552189800},Object.defineProperties(z,W);var H={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*$/},J=function(t){this.geometryFactory=t||new _e};J.prototype.read=function(t){var e,n,r;t=t.replace(/[\n\r]/g," ");var i=H.typeStr.exec(t);if(-1!==t.search("EMPTY")&&((i=H.emptyTypeStr.exec(t))[2]=void 0),i&&(n=i[1].toLowerCase(),r=i[2],Q[n]&&(e=Q[n].apply(this,[r]))),void 0===e)throw new Error("Could not parse WKT "+t);return e},J.prototype.write=function(t){return this.extractGeometry(t)},J.prototype.extractGeometry=function(t){var e=t.getGeometryType().toLowerCase();if(!K[e])return null;var n=e.toUpperCase();return t.isEmpty()?n+" EMPTY":n+"("+K[e].apply(this,[t])+")"};var K={coordinate:function(t){return t.x+" "+t.y},point:function(t){return K.coordinate.call(this,t._coordinates._coordinates[0])},multipoint:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push("("+K.point.apply(this,[t._geometries[n]])+")");return e.join(",")},linestring:function(t){for(var e=[],n=0,r=t._points._coordinates.length;n<r;++n)e.push(K.coordinate.apply(this,[t._points._coordinates[n]]));return e.join(",")},linearring:function(t){for(var e=[],n=0,r=t._points._coordinates.length;n<r;++n)e.push(K.coordinate.apply(this,[t._points._coordinates[n]]));return e.join(",")},multilinestring:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push("("+K.linestring.apply(this,[t._geometries[n]])+")");return e.join(",")},polygon:function(t){var e=[];e.push("("+K.linestring.apply(this,[t._shell])+")");for(var n=0,r=t._holes.length;n<r;++n)e.push("("+K.linestring.apply(this,[t._holes[n]])+")");return e.join(",")},multipolygon:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push("("+K.polygon.apply(this,[t._geometries[n]])+")");return e.join(",")},geometrycollection:function(t){for(var e=[],n=0,r=t._geometries.length;n<r;++n)e.push(this.extractGeometry(t._geometries[n]));return e.join(",")}},Q={point:function(t){if(void 0===t)return this.geometryFactory.createPoint();var e=t.trim().split(H.spaces);return this.geometryFactory.createPoint(new w(Number.parseFloat(e[0]),Number.parseFloat(e[1])))},multipoint:function(t){if(void 0===t)return this.geometryFactory.createMultiPoint();for(var e,n=t.trim().split(","),r=[],i=0,o=n.length;i<o;++i)e=n[i].replace(H.trimParens,"$1"),r.push(Q.point.apply(this,[e]));return this.geometryFactory.createMultiPoint(r)},linestring:function(t){if(void 0===t)return this.geometryFactory.createLineString();for(var e,n=t.trim().split(","),r=[],i=0,o=n.length;i<o;++i)e=n[i].trim().split(H.spaces),r.push(new w(Number.parseFloat(e[0]),Number.parseFloat(e[1])));return this.geometryFactory.createLineString(r)},linearring:function(t){if(void 0===t)return this.geometryFactory.createLinearRing();for(var e,n=t.trim().split(","),r=[],i=0,o=n.length;i<o;++i)e=n[i].trim().split(H.spaces),r.push(new w(Number.parseFloat(e[0]),Number.parseFloat(e[1])));return this.geometryFactory.createLinearRing(r)},multilinestring:function(t){if(void 0===t)return this.geometryFactory.createMultiLineString();for(var e,n=t.trim().split(H.parenComma),r=[],i=0,o=n.length;i<o;++i)e=n[i].replace(H.trimParens,"$1"),r.push(Q.linestring.apply(this,[e]));return this.geometryFactory.createMultiLineString(r)},polygon:function(t){if(void 0===t)return this.geometryFactory.createPolygon();for(var e,n,r,i,o=t.trim().split(H.parenComma),s=[],a=0,u=o.length;a<u;++a)e=o[a].replace(H.trimParens,"$1"),n=Q.linestring.apply(this,[e]),r=this.geometryFactory.createLinearRing(n._points),0===a?i=r:s.push(r);return this.geometryFactory.createPolygon(i,s)},multipolygon:function(t){if(void 0===t)return this.geometryFactory.createMultiPolygon();for(var e,n=t.trim().split(H.doubleParenComma),r=[],i=0,o=n.length;i<o;++i)e=n[i].replace(H.trimParens,"$1"),r.push(Q.polygon.apply(this,[e]));return this.geometryFactory.createMultiPolygon(r)},geometrycollection:function(t){if(void 0===t)return this.geometryFactory.createGeometryCollection();for(var e=(t=t.replace(/,\s*([A-Za-z])/g,"|$1")).trim().split("|"),n=[],r=0,i=e.length;r<i;++r)n.push(this.read(e[r]));return this.geometryFactory.createGeometryCollection(n)}},$=function(t){this.parser=new J(t)};$.prototype.write=function(t){return this.parser.write(t)},$.toLineString=function(t,e){if(2!==arguments.length)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"};var Z=function(t){function e(e){t.call(this,e),this.name="RuntimeException",this.message=e,this.stack=(new t).stack}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),tt=function(t){function e(){if(t.call(this),0===arguments.length)t.call(this);else if(1===arguments.length){var e=arguments[0];t.call(this,e)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Z),et=function(){};et.prototype.interfaces_=function(){return[]},et.prototype.getClass=function(){return et},et.shouldNeverReachHere=function(){if(0===arguments.length)et.shouldNeverReachHere(null);else if(1===arguments.length){var t=arguments[0];throw new tt("Should never reach here"+(null!==t?": "+t:""))}},et.isTrue=function(){var t;if(1===arguments.length)et.isTrue(arguments[0],null);else if(2===arguments.length&&(t=arguments[1],!arguments[0]))throw null===t?new tt:new tt(t)},et.equals=function(){var t,e,n;if(2===arguments.length)et.equals(t=arguments[0],e=arguments[1],null);else if(3===arguments.length&&(t=arguments[0],n=arguments[2],!(e=arguments[1]).equals(t)))throw new tt("Expected "+t+" but encountered "+e+(null!==n?": "+n:""))};var nt=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 w,this._intPt[1]=new w,this._pa=this._intPt[0],this._pb=this._intPt[1],this._result=0},rt={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};nt.prototype.getIndexAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]},nt.prototype.getTopologySummary=function(){var t=new R;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()},nt.prototype.computeIntersection=function(t,e,n,r){this._inputLines[0][0]=t,this._inputLines[0][1]=e,this._inputLines[1][0]=n,this._inputLines[1][1]=r,this._result=this.computeIntersect(t,e,n,r)},nt.prototype.getIntersectionNum=function(){return this._result},nt.prototype.computeIntLineIndex=function(){if(0===arguments.length)null===this._intLineIndex&&(this._intLineIndex=Array(2).fill().map((function(){return Array(2)})),this.computeIntLineIndex(0),this.computeIntLineIndex(1));else if(1===arguments.length){var t=arguments[0];this.getEdgeDistance(t,0)>this.getEdgeDistance(t,1)?(this._intLineIndex[t][0]=0,this._intLineIndex[t][1]=1):(this._intLineIndex[t][0]=1,this._intLineIndex[t][1]=0)}},nt.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},nt.prototype.setPrecisionModel=function(t){this._precisionModel=t},nt.prototype.isInteriorIntersection=function(){if(0===arguments.length)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(1===arguments.length){for(var t=arguments[0],e=0;e<this._result;e++)if(!this._intPt[e].equals2D(this._inputLines[t][0])&&!this._intPt[e].equals2D(this._inputLines[t][1]))return!0;return!1}},nt.prototype.getIntersection=function(t){return this._intPt[t]},nt.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper},nt.prototype.hasIntersection=function(){return this._result!==nt.NO_INTERSECTION},nt.prototype.getEdgeDistance=function(t,e){return nt.computeEdgeDistance(this._intPt[e],this._inputLines[t][0],this._inputLines[t][1])},nt.prototype.isCollinear=function(){return this._result===nt.COLLINEAR_INTERSECTION},nt.prototype.toString=function(){return $.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+$.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()},nt.prototype.getEndpoint=function(t,e){return this._inputLines[t][e]},nt.prototype.isIntersection=function(t){for(var e=0;e<this._result;e++)if(this._intPt[e].equals2D(t))return!0;return!1},nt.prototype.getIntersectionAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[t][e]]},nt.prototype.interfaces_=function(){return[]},nt.prototype.getClass=function(){return nt},nt.computeEdgeDistance=function(t,e,n){var r=Math.abs(n.x-e.x),i=Math.abs(n.y-e.y),o=-1;if(t.equals(e))o=0;else if(t.equals(n))o=r>i?r:i;else{var s=Math.abs(t.x-e.x),a=Math.abs(t.y-e.y);0!==(o=r>i?s:a)||t.equals(e)||(o=Math.max(s,a))}return et.isTrue(!(0===o&&!t.equals(e)),"Bad distance calculation"),o},nt.nonRobustComputeEdgeDistance=function(t,e,n){var r=t.x-e.x,i=t.y-e.y,o=Math.sqrt(r*r+i*i);return et.isTrue(!(0===o&&!t.equals(e)),"Invalid distance calculation"),o},rt.DONT_INTERSECT.get=function(){return 0},rt.DO_INTERSECT.get=function(){return 1},rt.COLLINEAR.get=function(){return 2},rt.NO_INTERSECTION.get=function(){return 0},rt.POINT_INTERSECTION.get=function(){return 1},rt.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(nt,rt);var it=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isInSegmentEnvelopes=function(t){var e=new z(this._inputLines[0][0],this._inputLines[0][1]),n=new z(this._inputLines[1][0],this._inputLines[1][1]);return e.contains(t)&&n.contains(t)},e.prototype.computeIntersection=function(){if(3!==arguments.length)return t.prototype.computeIntersection.apply(this,arguments);var e=arguments[0],n=arguments[1],r=arguments[2];if(this._isProper=!1,z.intersects(n,r,e)&&0===at.orientationIndex(n,r,e)&&0===at.orientationIndex(r,n,e))return this._isProper=!0,(e.equals(n)||e.equals(r))&&(this._isProper=!1),this._result=t.POINT_INTERSECTION,null;this._result=t.NO_INTERSECTION},e.prototype.normalizeToMinimum=function(t,e,n,r,i){i.x=this.smallestInAbsValue(t.x,e.x,n.x,r.x),i.y=this.smallestInAbsValue(t.y,e.y,n.y,r.y),t.x-=i.x,t.y-=i.y,e.x-=i.x,e.y-=i.y,n.x-=i.x,n.y-=i.y,r.x-=i.x,r.y-=i.y},e.prototype.safeHCoordinateIntersection=function(t,n,r,i){var o=null;try{o=X.intersection(t,n,r,i)}catch(s){if(!(s instanceof V))throw s;o=e.nearestEndpoint(t,n,r,i)}return o},e.prototype.intersection=function(t,n,r,i){var o=this.intersectionWithNormalization(t,n,r,i);return this.isInSegmentEnvelopes(o)||(o=new w(e.nearestEndpoint(t,n,r,i))),null!==this._precisionModel&&this._precisionModel.makePrecise(o),o},e.prototype.smallestInAbsValue=function(t,e,n,r){var i=t,o=Math.abs(i);return Math.abs(e)<o&&(i=e,o=Math.abs(e)),Math.abs(n)<o&&(i=n,o=Math.abs(n)),Math.abs(r)<o&&(i=r),i},e.prototype.checkDD=function(t,e,n,r,i){var o=B.intersection(t,e,n,r),s=this.isInSegmentEnvelopes(o);Y.out.println("DD in env = "+s+" --------------------- "+o),i.distance(o)>1e-4&&Y.out.println("Distance = "+i.distance(o))},e.prototype.intersectionWithNormalization=function(t,e,n,r){var i=new w(t),o=new w(e),s=new w(n),a=new w(r),u=new w;this.normalizeToEnvCentre(i,o,s,a,u);var c=this.safeHCoordinateIntersection(i,o,s,a);return c.x+=u.x,c.y+=u.y,c},e.prototype.computeCollinearIntersection=function(e,n,r,i){var o=z.intersects(e,n,r),s=z.intersects(e,n,i),a=z.intersects(r,i,e),u=z.intersects(r,i,n);return o&&s?(this._intPt[0]=r,this._intPt[1]=i,t.COLLINEAR_INTERSECTION):a&&u?(this._intPt[0]=e,this._intPt[1]=n,t.COLLINEAR_INTERSECTION):o&&a?(this._intPt[0]=r,this._intPt[1]=e,!r.equals(e)||s||u?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):o&&u?(this._intPt[0]=r,this._intPt[1]=n,!r.equals(n)||s||a?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):s&&a?(this._intPt[0]=i,this._intPt[1]=e,!i.equals(e)||o||u?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):s&&u?(this._intPt[0]=i,this._intPt[1]=n,!i.equals(n)||o||a?t.COLLINEAR_INTERSECTION:t.POINT_INTERSECTION):t.NO_INTERSECTION},e.prototype.normalizeToEnvCentre=function(t,e,n,r,i){var o=t.x<e.x?t.x:e.x,s=t.y<e.y?t.y:e.y,a=t.x>e.x?t.x:e.x,u=t.y>e.y?t.y:e.y,c=n.x<r.x?n.x:r.x,l=n.y<r.y?n.y:r.y,h=n.x>r.x?n.x:r.x,p=n.y>r.y?n.y:r.y,f=((o>c?o:c)+(a<h?a:h))/2,g=((s>l?s:l)+(u<p?u:p))/2;i.x=f,i.y=g,t.x-=i.x,t.y-=i.y,e.x-=i.x,e.y-=i.y,n.x-=i.x,n.y-=i.y,r.x-=i.x,r.y-=i.y},e.prototype.computeIntersect=function(e,n,r,i){if(this._isProper=!1,!z.intersects(e,n,r,i))return t.NO_INTERSECTION;var o=at.orientationIndex(e,n,r),s=at.orientationIndex(e,n,i);if(o>0&&s>0||o<0&&s<0)return t.NO_INTERSECTION;var a=at.orientationIndex(r,i,e),u=at.orientationIndex(r,i,n);return a>0&&u>0||a<0&&u<0?t.NO_INTERSECTION:0===o&&0===s&&0===a&&0===u?this.computeCollinearIntersection(e,n,r,i):(0===o||0===s||0===a||0===u?(this._isProper=!1,e.equals2D(r)||e.equals2D(i)?this._intPt[0]=e:n.equals2D(r)||n.equals2D(i)?this._intPt[0]=n:0===o?this._intPt[0]=new w(r):0===s?this._intPt[0]=new w(i):0===a?this._intPt[0]=new w(e):0===u&&(this._intPt[0]=new w(n))):(this._isProper=!0,this._intPt[0]=this.intersection(e,n,r,i)),t.POINT_INTERSECTION)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.nearestEndpoint=function(t,e,n,r){var i=t,o=at.distancePointLine(t,n,r),s=at.distancePointLine(e,n,r);return s<o&&(o=s,i=e),(s=at.distancePointLine(n,t,e))<o&&(o=s,i=n),(s=at.distancePointLine(r,t,e))<o&&(o=s,i=r),i},e}(nt),ot=function(){};ot.prototype.interfaces_=function(){return[]},ot.prototype.getClass=function(){return ot},ot.orientationIndex=function(t,e,n){var r=e.x-t.x,i=e.y-t.y,o=n.x-e.x,s=n.y-e.y;return ot.signOfDet2x2(r,i,o,s)},ot.signOfDet2x2=function(t,e,n,r){var i=null,o=null,s=null;if(i=1,0===t||0===r)return 0===e||0===n?0:e>0?n>0?-i:i:n>0?i:-i;if(0===e||0===n)return r>0?t>0?i:-i:t>0?-i:i;if(e>0?r>0?e<=r||(i=-i,o=t,t=n,n=o,o=e,e=r,r=o):e<=-r?(i=-i,n=-n,r=-r):(o=t,t=-n,n=o,o=e,e=-r,r=o):r>0?-e<=r?(i=-i,t=-t,e=-e):(o=-t,t=n,n=o,o=-e,e=r,r=o):e>=r?(t=-t,e=-e,n=-n,r=-r):(i=-i,o=-t,t=-n,n=o,o=-e,e=-r,r=o),t>0){if(!(n>0))return i;if(!(t<=n))return i}else{if(n>0)return-i;if(!(t>=n))return-i;i=-i,t=-t,n=-n}for(;;){if((r-=(s=Math.floor(n/t))*e)<0)return-i;if(r>e)return i;if(t>(n-=s*t)+n){if(e<r+r)return i}else{if(e>r+r)return-i;n=t-n,r=e-r,i=-i}if(0===r)return 0===n?0:-i;if(0===n)return i;if((e-=(s=Math.floor(t/n))*r)<0)return i;if(e>r)return-i;if(n>(t-=s*n)+t){if(r<e+e)return-i}else{if(r>e+e)return i;t=n-t,e=r-e,i=-i}if(0===e)return 0===t?0:i;if(0===t)return-i}};var st=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t};st.prototype.countSegment=function(t,e){if(t.x<this._p.x&&e.x<this._p.x)return null;if(this._p.x===e.x&&this._p.y===e.y)return this._isPointOnSegment=!0,null;if(t.y===this._p.y&&e.y===this._p.y){var n=t.x,r=e.x;return n>r&&(n=e.x,r=t.x),this._p.x>=n&&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 i=t.x-this._p.x,o=t.y-this._p.y,s=e.x-this._p.x,a=e.y-this._p.y,u=ot.signOfDet2x2(i,o,s,a);if(0===u)return this._isPointOnSegment=!0,null;a<o&&(u=-u),u>0&&this._crossingCount++}},st.prototype.isPointInPolygon=function(){return this.getLocation()!==O.EXTERIOR},st.prototype.getLocation=function(){return this._isPointOnSegment?O.BOUNDARY:this._crossingCount%2==1?O.INTERIOR:O.EXTERIOR},st.prototype.isOnSegment=function(){return this._isPointOnSegment},st.prototype.interfaces_=function(){return[]},st.prototype.getClass=function(){return st},st.locatePointInRing=function(){if(arguments[0]instanceof w&&T(arguments[1],U)){for(var t=arguments[1],e=new st(arguments[0]),n=new w,r=new w,i=1;i<t.size();i++)if(t.getCoordinate(i,n),t.getCoordinate(i-1,r),e.countSegment(n,r),e.isOnSegment())return e.getLocation();return e.getLocation()}if(arguments[0]instanceof w&&arguments[1]instanceof Array){for(var o=arguments[1],s=new st(arguments[0]),a=1;a<o.length;a++){var u=o[a],c=o[a-1];if(s.countSegment(u,c),s.isOnSegment())return s.getLocation()}return s.getLocation()}};var at=function(){},ut={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};at.prototype.interfaces_=function(){return[]},at.prototype.getClass=function(){return at},at.orientationIndex=function(t,e,n){return B.orientationIndex(t,e,n)},at.signedArea=function(){if(arguments[0]instanceof Array){var t=arguments[0];if(t.length<3)return 0;for(var e=0,n=t[0].x,r=1;r<t.length-1;r++){var i=t[r].x-n,o=t[r+1].y;e+=i*(t[r-1].y-o)}return e/2}if(T(arguments[0],U)){var s=arguments[0],a=s.size();if(a<3)return 0;var u=new w,c=new w,l=new w;s.getCoordinate(0,c),s.getCoordinate(1,l);var h=c.x;l.x-=h;for(var p=0,f=1;f<a-1;f++)u.y=c.y,c.x=l.x,c.y=l.y,s.getCoordinate(f+1,l),l.x-=h,p+=c.x*(u.y-l.y);return p/2}},at.distanceLineLine=function(t,e,n,r){if(t.equals(e))return at.distancePointLine(t,n,r);if(n.equals(r))return at.distancePointLine(r,t,e);var i=!1;if(z.intersects(t,e,n,r)){var o=(e.x-t.x)*(r.y-n.y)-(e.y-t.y)*(r.x-n.x);if(0===o)i=!0;else{var s=(t.y-n.y)*(r.x-n.x)-(t.x-n.x)*(r.y-n.y),a=((t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y))/o,u=s/o;(u<0||u>1||a<0||a>1)&&(i=!0)}}else i=!0;return i?M.min(at.distancePointLine(t,n,r),at.distancePointLine(e,n,r),at.distancePointLine(n,t,e),at.distancePointLine(r,t,e)):0},at.isPointInRing=function(t,e){return at.locatePointInRing(t,e)!==O.EXTERIOR},at.computeLength=function(t){var e=t.size();if(e<=1)return 0;var n=0,r=new w;t.getCoordinate(0,r);for(var i=r.x,o=r.y,s=1;s<e;s++){t.getCoordinate(s,r);var a=r.x,u=r.y,c=a-i,l=u-o;n+=Math.sqrt(c*c+l*l),i=a,o=u}return n},at.isCCW=function(t){var e=t.length-1;if(e<3)throw new v("Ring has fewer than 4 points, so orientation cannot be determined");for(var n=t[0],r=0,i=1;i<=e;i++){var o=t[i];o.y>n.y&&(n=o,r=i)}var s=r;do{(s-=1)<0&&(s=e)}while(t[s].equals2D(n)&&s!==r);var a=r;do{a=(a+1)%e}while(t[a].equals2D(n)&&a!==r);var u=t[s],c=t[a];if(u.equals2D(n)||c.equals2D(n)||u.equals2D(c))return!1;var l=at.computeOrientation(u,n,c);return 0===l?u.x>c.x:l>0},at.locatePointInRing=function(t,e){return st.locatePointInRing(t,e)},at.distancePointLinePerpendicular=function(t,e,n){var r=(n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y),i=((e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y))/r;return Math.abs(i)*Math.sqrt(r)},at.computeOrientation=function(t,e,n){return at.orientationIndex(t,e,n)},at.distancePointLine=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(0===e.length)throw new v("Line array must contain at least one vertex");for(var n=t.distance(e[0]),r=0;r<e.length-1;r++){var i=at.distancePointLine(t,e[r],e[r+1]);i<n&&(n=i)}return n}if(3===arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2];if(s.x===a.x&&s.y===a.y)return o.distance(s);var u=(a.x-s.x)*(a.x-s.x)+(a.y-s.y)*(a.y-s.y),c=((o.x-s.x)*(a.x-s.x)+(o.y-s.y)*(a.y-s.y))/u;if(c<=0)return o.distance(s);if(c>=1)return o.distance(a);var l=((s.y-o.y)*(a.x-s.x)-(s.x-o.x)*(a.y-s.y))/u;return Math.abs(l)*Math.sqrt(u)}},at.isOnLine=function(t,e){for(var n=new it,r=1;r<e.length;r++){var i=e[r-1],o=e[r];if(n.computeIntersection(t,i,o),n.hasIntersection())return!0}return!1},ut.CLOCKWISE.get=function(){return-1},ut.RIGHT.get=function(){return at.CLOCKWISE},ut.COUNTERCLOCKWISE.get=function(){return 1},ut.LEFT.get=function(){return at.COUNTERCLOCKWISE},ut.COLLINEAR.get=function(){return 0},ut.STRAIGHT.get=function(){return at.COLLINEAR},Object.defineProperties(at,ut);var ct=function(){};ct.prototype.filter=function(t){},ct.prototype.interfaces_=function(){return[]},ct.prototype.getClass=function(){return ct};var lt=function(){var t=arguments[0];this._envelope=null,this._factory=null,this._SRID=null,this._userData=null,this._factory=t,this._SRID=t.getSRID()},ht={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}};lt.prototype.isGeometryCollection=function(){return this.getSortIndex()===lt.SORTINDEX_GEOMETRYCOLLECTION},lt.prototype.getFactory=function(){return this._factory},lt.prototype.getGeometryN=function(t){return this},lt.prototype.getArea=function(){return 0},lt.prototype.isRectangle=function(){return!1},lt.prototype.equals=function(){if(arguments[0]instanceof lt){var t=arguments[0];return null!==t&&this.equalsTopo(t)}if(arguments[0]instanceof Object){var e=arguments[0];if(!(e instanceof lt))return!1;var n=e;return this.equalsExact(n)}},lt.prototype.equalsExact=function(t){return this===t||this.equalsExact(t,0)},lt.prototype.geometryChanged=function(){this.apply(lt.geometryChangedFilter)},lt.prototype.geometryChangedAction=function(){this._envelope=null},lt.prototype.equalsNorm=function(t){return null!==t&&this.norm().equalsExact(t.norm())},lt.prototype.getLength=function(){return 0},lt.prototype.getNumGeometries=function(){return 1},lt.prototype.compareTo=function(){if(1===arguments.length){var t=arguments[0],e=t;return this.getSortIndex()!==e.getSortIndex()?this.getSortIndex()-e.getSortIndex():this.isEmpty()&&e.isEmpty()?0:this.isEmpty()?-1:e.isEmpty()?1:this.compareToSameClass(t)}if(2===arguments.length){var n=arguments[0],r=arguments[1];return this.getSortIndex()!==n.getSortIndex()?this.getSortIndex()-n.getSortIndex():this.isEmpty()&&n.isEmpty()?0:this.isEmpty()?-1:n.isEmpty()?1:this.compareToSameClass(n,r)}},lt.prototype.getUserData=function(){return this._userData},lt.prototype.getSRID=function(){return this._SRID},lt.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},lt.prototype.checkNotGeometryCollection=function(t){if(t.getSortIndex()===lt.SORTINDEX_GEOMETRYCOLLECTION)throw new v("This method does not support GeometryCollection arguments")},lt.prototype.equal=function(t,e,n){return 0===n?t.equals(e):t.distance(e)<=n},lt.prototype.norm=function(){var t=this.copy();return t.normalize(),t},lt.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},lt.prototype.getEnvelopeInternal=function(){return null===this._envelope&&(this._envelope=this.computeEnvelopeInternal()),new z(this._envelope)},lt.prototype.setSRID=function(t){this._SRID=t},lt.prototype.setUserData=function(t){this._userData=t},lt.prototype.compare=function(t,e){for(var n=t.iterator(),r=e.iterator();n.hasNext()&&r.hasNext();){var i=n.next(),o=r.next(),s=i.compareTo(o);if(0!==s)return s}return n.hasNext()?1:r.hasNext()?-1:0},lt.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},lt.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===lt.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===lt.SORTINDEX_MULTIPOINT||this.getSortIndex()===lt.SORTINDEX_MULTILINESTRING||this.getSortIndex()===lt.SORTINDEX_MULTIPOLYGON},lt.prototype.interfaces_=function(){return[I,E,e]},lt.prototype.getClass=function(){return lt},lt.hasNonEmptyElements=function(t){for(var e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1},lt.hasNullElements=function(t){for(var e=0;e<t.length;e++)if(null===t[e])return!0;return!1},ht.serialVersionUID.get=function(){return 0x799ea46522854c00},ht.SORTINDEX_POINT.get=function(){return 0},ht.SORTINDEX_MULTIPOINT.get=function(){return 1},ht.SORTINDEX_LINESTRING.get=function(){return 2},ht.SORTINDEX_LINEARRING.get=function(){return 3},ht.SORTINDEX_MULTILINESTRING.get=function(){return 4},ht.SORTINDEX_POLYGON.get=function(){return 5},ht.SORTINDEX_MULTIPOLYGON.get=function(){return 6},ht.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7},ht.geometryChangedFilter.get=function(){return pt},Object.defineProperties(lt,ht);var pt=function(){};pt.interfaces_=function(){return[ct]},pt.filter=function(t){t.geometryChangedAction()};var ft=function(){};ft.prototype.filter=function(t){},ft.prototype.interfaces_=function(){return[]},ft.prototype.getClass=function(){return ft};var gt=function(){},dt={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}};gt.prototype.isInBoundary=function(t){},gt.prototype.interfaces_=function(){return[]},gt.prototype.getClass=function(){return gt},dt.Mod2BoundaryNodeRule.get=function(){return yt},dt.EndPointBoundaryNodeRule.get=function(){return _t},dt.MultiValentEndPointBoundaryNodeRule.get=function(){return vt},dt.MonoValentEndPointBoundaryNodeRule.get=function(){return mt},dt.MOD2_BOUNDARY_RULE.get=function(){return new yt},dt.ENDPOINT_BOUNDARY_RULE.get=function(){return new _t},dt.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new vt},dt.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new mt},dt.OGC_SFS_BOUNDARY_RULE.get=function(){return gt.MOD2_BOUNDARY_RULE},Object.defineProperties(gt,dt);var yt=function(){};yt.prototype.isInBoundary=function(t){return t%2==1},yt.prototype.interfaces_=function(){return[gt]},yt.prototype.getClass=function(){return yt};var _t=function(){};_t.prototype.isInBoundary=function(t){return t>0},_t.prototype.interfaces_=function(){return[gt]},_t.prototype.getClass=function(){return _t};var vt=function(){};vt.prototype.isInBoundary=function(t){return t>1},vt.prototype.interfaces_=function(){return[gt]},vt.prototype.getClass=function(){return vt};var mt=function(){};mt.prototype.isInBoundary=function(t){return 1===t},mt.prototype.interfaces_=function(){return[gt]},mt.prototype.getClass=function(){return mt};var xt=function(){};xt.prototype.add=function(){},xt.prototype.addAll=function(){},xt.prototype.isEmpty=function(){},xt.prototype.iterator=function(){},xt.prototype.size=function(){},xt.prototype.toArray=function(){},xt.prototype.remove=function(){},(n.prototype=new Error).name="IndexOutOfBoundsException";var Et=function(){};Et.prototype.hasNext=function(){},Et.prototype.next=function(){},Et.prototype.remove=function(){};var It=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(){},e.prototype.set=function(){},e.prototype.isEmpty=function(){},e}(xt);(r.prototype=new Error).name="NoSuchElementException";var bt=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof xt&&this.addAll(arguments[0])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.ensureCapacity=function(){},e.prototype.interfaces_=function(){return[t,xt]},e.prototype.add=function(t){return 1===arguments.length?this.array_.push(t):this.array_.splice(arguments[0],arguments[1]),!0},e.prototype.clear=function(){this.array_=[]},e.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},e.prototype.set=function(t,e){var n=this.array_[t];return this.array_[t]=e,n},e.prototype.iterator=function(){return new wt(this)},e.prototype.get=function(t){if(t<0||t>=this.size())throw new n;return this.array_[t]},e.prototype.isEmpty=function(){return 0===this.array_.length},e.prototype.size=function(){return this.array_.length},e.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},e.prototype.remove=function(t){for(var e=!1,n=0,r=this.array_.length;n<r;n++)if(this.array_[n]===t){this.array_.splice(n,1),e=!0;break}return e},e}(It),wt=function(t){function e(e){t.call(this),this.arrayList_=e,this.position_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new r;return this.arrayList_.get(this.position_++)},e.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},e.prototype.set=function(t){return this.arrayList_.set(this.position_-1,t)},e.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},e}(Et),Nt=function(t){function e(){if(t.call(this),0===arguments.length);else if(1===arguments.length){var e=arguments[0];this.ensureCapacity(e.length),this.add(e,!0)}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.ensureCapacity(n.length),this.add(n,r)}}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={coordArrayType:{configurable:!0}};return n.coordArrayType.get=function(){return new Array(0).fill(null)},e.prototype.getCoordinate=function(t){return this.get(t)},e.prototype.addAll=function(){if(2===arguments.length){for(var e=arguments[1],n=!1,r=arguments[0].iterator();r.hasNext();)this.add(r.next(),e),n=!0;return n}return t.prototype.addAll.apply(this,arguments)},e.prototype.clone=function(){for(var e=t.prototype.clone.call(this),n=0;n<this.size();n++)e.add(n,this.get(n).copy());return e},e.prototype.toCoordinateArray=function(){return this.toArray(e.coordArrayType)},e.prototype.add=function(){if(1===arguments.length){var e=arguments[0];t.prototype.add.call(this,e)}else if(2===arguments.length){if(arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var n=arguments[0],r=arguments[1];return this.add(n,r,!0),!0}if(arguments[0]instanceof w&&"boolean"==typeof arguments[1]){var i=arguments[0];if(!arguments[1]&&this.size()>=1&&this.get(this.size()-1).equals2D(i))return null;t.prototype.add.call(this,i)}else if(arguments[0]instanceof Object&&"boolean"==typeof arguments[1]){var o=arguments[0],s=arguments[1];return this.add(o,s),!0}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var a=arguments[0],u=arguments[1];if(arguments[2])for(var c=0;c<a.length;c++)this.add(a[c],u);else for(var l=a.length-1;l>=0;l--)this.add(a[l],u);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof w){var h=arguments[0],p=arguments[1];if(!arguments[2]){var f=this.size();if(f>0){if(h>0&&this.get(h-1).equals2D(p))return null;if(h<f&&this.get(h).equals2D(p))return null}}t.prototype.add.call(this,h,p)}}else if(4===arguments.length){var g=arguments[0],d=arguments[1],y=arguments[2],_=arguments[3],v=1;y>_&&(v=-1);for(var m=y;m!==_;m+=v)this.add(g[m],d);return!0}},e.prototype.closeRing=function(){this.size()>0&&this.add(new w(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,n),e}(bt),St=function(){},Ct={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};Ct.ForwardComparator.get=function(){return Ot},Ct.BidirectionalComparator.get=function(){return Lt},Ct.coordArrayType.get=function(){return new Array(0).fill(null)},St.prototype.interfaces_=function(){return[]},St.prototype.getClass=function(){return St},St.isRing=function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))},St.ptNotInList=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(St.indexOf(r,e)<0)return r}return null},St.scroll=function(t,e){var n=St.indexOf(e,t);if(n<0)return null;var r=new Array(t.length).fill(null);Y.arraycopy(t,n,r,0,t.length-n),Y.arraycopy(t,0,r,t.length-n,n),Y.arraycopy(r,0,t,0,t.length)},St.equals=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(t===e)return!0;if(null===t||null===e)return!1;if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].equals(e[n]))return!1;return!0}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];if(r===i)return!0;if(null===r||null===i)return!1;if(r.length!==i.length)return!1;for(var s=0;s<r.length;s++)if(0!==o.compare(r[s],i[s]))return!1;return!0}},St.intersection=function(t,e){for(var n=new Nt,r=0;r<t.length;r++)e.intersects(t[r])&&n.add(t[r],!0);return n.toCoordinateArray()},St.hasRepeatedPoints=function(t){for(var e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1},St.removeRepeatedPoints=function(t){return St.hasRepeatedPoints(t)?new Nt(t,!1).toCoordinateArray():t},St.reverse=function(t){for(var e=t.length-1,n=Math.trunc(e/2),r=0;r<=n;r++){var i=t[r];t[r]=t[e-r],t[e-r]=i}},St.removeNull=function(t){for(var e=0,n=0;n<t.length;n++)null!==t[n]&&e++;var r=new Array(e).fill(null);if(0===e)return r;for(var i=0,o=0;o<t.length;o++)null!==t[o]&&(r[i++]=t[o]);return r},St.copyDeep=function(){if(1===arguments.length){for(var t=arguments[0],e=new Array(t.length).fill(null),n=0;n<t.length;n++)e[n]=new w(t[n]);return e}if(5===arguments.length)for(var r=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3],a=arguments[4],u=0;u<a;u++)o[s+u]=new w(r[i+u])},St.isEqualReversed=function(t,e){for(var n=0;n<t.length;n++){var r=t[n],i=e[t.length-n-1];if(0!==r.compareTo(i))return!1}return!0},St.envelope=function(t){for(var e=new z,n=0;n<t.length;n++)e.expandToInclude(t[n]);return e},St.toCoordinateArray=function(t){return t.toArray(St.coordArrayType)},St.atLeastNCoordinatesOrNothing=function(t,e){return e.length>=t?e:[]},St.indexOf=function(t,e){for(var n=0;n<e.length;n++)if(t.equals(e[n]))return n;return-1},St.increasingDirection=function(t){for(var e=0;e<Math.trunc(t.length/2);e++){var n=t.length-1-e,r=t[e].compareTo(t[n]);if(0!==r)return r}return 1},St.compare=function(t,e){for(var n=0;n<t.length&&n<e.length;){var r=t[n].compareTo(e[n]);if(0!==r)return r;n++}return n<e.length?-1:n<t.length?1:0},St.minCoordinate=function(t){for(var e=null,n=0;n<t.length;n++)(null===e||e.compareTo(t[n])>0)&&(e=t[n]);return e},St.extract=function(t,e,n){e=M.clamp(e,0,t.length);var r=(n=M.clamp(n,-1,t.length))-e+1;n<0&&(r=0),e>=t.length&&(r=0),n<e&&(r=0);var i=new Array(r).fill(null);if(0===r)return i;for(var o=0,s=e;s<=n;s++)i[o++]=t[s];return i},Object.defineProperties(St,Ct);var Ot=function(){};Ot.prototype.compare=function(t,e){return St.compare(t,e)},Ot.prototype.interfaces_=function(){return[b]},Ot.prototype.getClass=function(){return Ot};var Lt=function(){};Lt.prototype.compare=function(t,e){var n=t,r=e;if(n.length<r.length)return-1;if(n.length>r.length)return 1;if(0===n.length)return 0;var i=St.compare(n,r);return St.isEqualReversed(n,r)?0:i},Lt.prototype.OLDcompare=function(t,e){var n=t,r=e;if(n.length<r.length)return-1;if(n.length>r.length)return 1;if(0===n.length)return 0;for(var i=St.increasingDirection(n),o=St.increasingDirection(r),s=i>0?0:n.length-1,a=o>0?0:n.length-1,u=0;u<n.length;u++){var c=n[s].compareTo(r[a]);if(0!==c)return c;s+=i,a+=o}return 0},Lt.prototype.interfaces_=function(){return[b]},Lt.prototype.getClass=function(){return Lt};var Tt=function(){};Tt.prototype.get=function(){},Tt.prototype.put=function(){},Tt.prototype.size=function(){},Tt.prototype.values=function(){},Tt.prototype.entrySet=function(){};var Mt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Tt);(i.prototype=new Error).name="OperationNotSupported",(o.prototype=new xt).contains=function(){};var Pt=function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof xt&&this.addAll(arguments[0])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.contains=function(t){for(var e=0,n=this.array_.length;e<n;e++)if(this.array_[e]===t)return!0;return!1},e.prototype.add=function(t){return!this.contains(t)&&(this.array_.push(t),!0)},e.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},e.prototype.remove=function(t){throw new Error},e.prototype.size=function(){return this.array_.length},e.prototype.isEmpty=function(){return 0===this.array_.length},e.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},e.prototype.iterator=function(){return new Rt(this)},e}(o),Rt=function(t){function e(e){t.call(this),this.hashSet_=e,this.position_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new r;return this.hashSet_.array_[this.position_++]},e.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},e.prototype.remove=function(){throw new i},e}(Et),At=0;(h.prototype=new Mt).get=function(t){for(var e=this.root_;null!==e;){var n=t.compareTo(e.key);if(n<0)e=e.left;else{if(!(n>0))return e.value;e=e.right}}return null},h.prototype.put=function(t,e){if(null===this.root_)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:At,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var n,r,i=this.root_;do{if(n=i,(r=t.compareTo(i.key))<0)i=i.left;else{if(!(r>0)){var o=i.value;return i.value=e,o}i=i.right}}while(null!==i);var s={key:t,left:null,right:null,value:e,parent:n,color:At,getValue:function(){return this.value},getKey:function(){return this.key}};return r<0?n.left=s:n.right=s,this.fixAfterInsertion(s),this.size_++,null},h.prototype.fixAfterInsertion=function(t){for(t.color=1;null!=t&&t!==this.root_&&1===t.parent.color;)if(a(t)===c(a(a(t)))){var e=l(a(a(t)));1===s(e)?(u(a(t),At),u(e,At),u(a(a(t)),1),t=a(a(t))):(t===l(a(t))&&(t=a(t),this.rotateLeft(t)),u(a(t),At),u(a(a(t)),1),this.rotateRight(a(a(t))))}else{var n=c(a(a(t)));1===s(n)?(u(a(t),At),u(n,At),u(a(a(t)),1),t=a(a(t))):(t===c(a(t))&&(t=a(t),this.rotateRight(t)),u(a(t),At),u(a(a(t)),1),this.rotateLeft(a(a(t))))}this.root_.color=At},h.prototype.values=function(){var t=new bt,e=this.getFirstEntry();if(null!==e)for(t.add(e.value);null!==(e=h.successor(e));)t.add(e.value);return t},h.prototype.entrySet=function(){var t=new Pt,e=this.getFirstEntry();if(null!==e)for(t.add(e);null!==(e=h.successor(e));)t.add(e);return t},h.prototype.rotateLeft=function(t){if(null!=t){var e=t.right;t.right=e.left,null!=e.left&&(e.left.parent=t),e.parent=t.parent,null===t.parent?this.root_=e:t.parent.left===t?t.parent.left=e:t.parent.right=e,e.left=t,t.parent=e}},h.prototype.rotateRight=function(t){if(null!=t){var e=t.left;t.left=e.right,null!=e.right&&(e.right.parent=t),e.parent=t.parent,null===t.parent?this.root_=e:t.parent.right===t?t.parent.right=e:t.parent.left=e,e.right=t,t.parent=e}},h.prototype.getFirstEntry=function(){var t=this.root_;if(null!=t)for(;null!=t.left;)t=t.left;return t},h.successor=function(t){if(null===t)return null;if(null!==t.right){for(var e=t.right;null!==e.left;)e=e.left;return e}for(var n=t.parent,r=t;null!==n&&r===n.right;)r=n,n=n.parent;return n},h.prototype.size=function(){return this.size_};var Dt=function(){};Dt.prototype.interfaces_=function(){return[]},Dt.prototype.getClass=function(){return Dt},p.prototype=new o,(f.prototype=new p).contains=function(t){for(var e=0,n=this.array_.length;e<n;e++)if(0===this.array_[e].compareTo(t))return!0;return!1},f.prototype.add=function(t){if(this.contains(t))return!1;for(var e=0,n=this.array_.length;e<n;e++)if(1===this.array_[e].compareTo(t))return this.array_.splice(e,0,t),!0;return this.array_.push(t),!0},f.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},f.prototype.remove=function(t){throw new i},f.prototype.size=function(){return this.array_.length},f.prototype.isEmpty=function(){return 0===this.array_.length},f.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t},f.prototype.iterator=function(){return new Ft(this)};var Ft=function(t){this.treeSet_=t,this.position_=0};Ft.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new r;return this.treeSet_.array_[this.position_++]},Ft.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},Ft.prototype.remove=function(){throw new i};var kt=function(){};kt.sort=function(){var t,e,n,r,i=arguments[0];if(1===arguments.length)r=function(t,e){return t.compareTo(e)},i.sort(r);else if(2===arguments.length)n=arguments[1],r=function(t,e){return n.compare(t,e)},i.sort(r);else if(3===arguments.length){(e=i.slice(arguments[1],arguments[2])).sort();var o=i.slice(0,arguments[1]).concat(e,i.slice(arguments[2],i.length));for(i.splice(0,i.length),t=0;t<o.length;t++)i.push(o[t])}else if(4===arguments.length)for(e=i.slice(arguments[1],arguments[2]),n=arguments[3],r=function(t,e){return n.compare(t,e)},e.sort(r),o=i.slice(0,arguments[1]).concat(e,i.slice(arguments[2],i.length)),i.splice(0,i.length),t=0;t<o.length;t++)i.push(o[t])},kt.asList=function(t){for(var e=new bt,n=0,r=t.length;n<r;n++)e.add(t[n]);return e};var Bt=function(){},Gt={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}};Gt.P.get=function(){return 0},Gt.L.get=function(){return 1},Gt.A.get=function(){return 2},Gt.FALSE.get=function(){return-1},Gt.TRUE.get=function(){return-2},Gt.DONTCARE.get=function(){return-3},Gt.SYM_FALSE.get=function(){return"F"},Gt.SYM_TRUE.get=function(){return"T"},Gt.SYM_DONTCARE.get=function(){return"*"},Gt.SYM_P.get=function(){return"0"},Gt.SYM_L.get=function(){return"1"},Gt.SYM_A.get=function(){return"2"},Bt.prototype.interfaces_=function(){return[]},Bt.prototype.getClass=function(){return Bt},Bt.toDimensionSymbol=function(t){switch(t){case Bt.FALSE:return Bt.SYM_FALSE;case Bt.TRUE:return Bt.SYM_TRUE;case Bt.DONTCARE:return Bt.SYM_DONTCARE;case Bt.P:return Bt.SYM_P;case Bt.L:return Bt.SYM_L;case Bt.A:return Bt.SYM_A}throw new v("Unknown dimension value: "+t)},Bt.toDimensionValue=function(t){switch(D.toUpperCase(t)){case Bt.SYM_FALSE:return Bt.FALSE;case Bt.SYM_TRUE:return Bt.TRUE;case Bt.SYM_DONTCARE:return Bt.DONTCARE;case Bt.SYM_P:return Bt.P;case Bt.SYM_L:return Bt.L;case Bt.SYM_A:return Bt.A}throw new v("Unknown dimension symbol: "+t)},Object.defineProperties(Bt,Gt);var Ut=function(){};Ut.prototype.filter=function(t){},Ut.prototype.interfaces_=function(){return[]},Ut.prototype.getClass=function(){return Ut};var qt=function(){};qt.prototype.filter=function(t,e){},qt.prototype.isDone=function(){},qt.prototype.isGeometryChanged=function(){},qt.prototype.interfaces_=function(){return[]},qt.prototype.getClass=function(){return qt};var jt=function(t){function e(e,n){if(t.call(this,n),this._geometries=e||[],t.hasNullElements(this._geometries))throw new v("geometries must not contain null elements")}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){for(var t=new z,e=0;e<this._geometries.length;e++)t.expandToInclude(this._geometries[e].getEnvelopeInternal());return t},e.prototype.getGeometryN=function(t){return this._geometries[t]},e.prototype.getSortIndex=function(){return t.SORTINDEX_GEOMETRYCOLLECTION},e.prototype.getCoordinates=function(){for(var t=new Array(this.getNumPoints()).fill(null),e=-1,n=0;n<this._geometries.length;n++)for(var r=this._geometries[n].getCoordinates(),i=0;i<r.length;i++)t[++e]=r[i];return t},e.prototype.getArea=function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getArea();return t},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];if(!this.isEquivalentClass(e))return!1;var r=e;if(this._geometries.length!==r._geometries.length)return!1;for(var i=0;i<this._geometries.length;i++)if(!this._geometries[i].equalsExact(r._geometries[i],n))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){for(var t=0;t<this._geometries.length;t++)this._geometries[t].normalize();kt.sort(this._geometries)},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},e.prototype.getBoundaryDimension=function(){for(var t=Bt.FALSE,e=0;e<this._geometries.length;e++)t=Math.max(t,this._geometries[e].getBoundaryDimension());return t},e.prototype.getDimension=function(){for(var t=Bt.FALSE,e=0;e<this._geometries.length;e++)t=Math.max(t,this._geometries[e].getDimension());return t},e.prototype.getLength=function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getLength();return t},e.prototype.getNumPoints=function(){for(var t=0,e=0;e<this._geometries.length;e++)t+=this._geometries[e].getNumPoints();return t},e.prototype.getNumGeometries=function(){return this._geometries.length},e.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),n=0;n<this._geometries.length;n++)e[n]=this._geometries[n].reverse();return this.getFactory().createGeometryCollection(e)},e.prototype.compareToSameClass=function(){if(1===arguments.length){var t=arguments[0],e=new f(kt.asList(this._geometries)),n=new f(kt.asList(t._geometries));return this.compare(e,n)}if(2===arguments.length){for(var r=arguments[1],i=arguments[0],o=this.getNumGeometries(),s=i.getNumGeometries(),a=0;a<o&&a<s;){var u=this.getGeometryN(a),c=i.getGeometryN(a),l=u.compareToSameClass(c,r);if(0!==l)return l;a++}return a<o?1:a<s?-1:0}},e.prototype.apply=function(){if(T(arguments[0],ft))for(var t=arguments[0],e=0;e<this._geometries.length;e++)this._geometries[e].apply(t);else if(T(arguments[0],qt)){var n=arguments[0];if(0===this._geometries.length)return null;for(var r=0;r<this._geometries.length&&(this._geometries[r].apply(n),!n.isDone());r++);n.isGeometryChanged()&&this.geometryChanged()}else if(T(arguments[0],Ut)){var i=arguments[0];i.filter(this);for(var o=0;o<this._geometries.length;o++)this._geometries[o].apply(i)}else if(T(arguments[0],ct)){var s=arguments[0];s.filter(this);for(var a=0;a<this._geometries.length;a++)this._geometries[a].apply(s)}},e.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),et.shouldNeverReachHere(),null},e.prototype.clone=function(){var e=t.prototype.clone.call(this);e._geometries=new Array(this._geometries.length).fill(null);for(var n=0;n<this._geometries.length;n++)e._geometries[n]=this._geometries[n].clone();return e},e.prototype.getGeometryType=function(){return"GeometryCollection"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.isEmpty=function(){for(var t=0;t<this._geometries.length;t++)if(!this._geometries[t].isEmpty())return!1;return!0},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x4f07bcb1f857d800},Object.defineProperties(e,n),e}(lt),Vt=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return lt.SORTINDEX_MULTILINESTRING},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,n)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?Bt.FALSE:0},e.prototype.isClosed=function(){if(this.isEmpty())return!1;for(var t=0;t<this._geometries.length;t++)if(!this._geometries[t].isClosed())return!1;return!0},e.prototype.getDimension=function(){return 1},e.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),n=0;n<this._geometries.length;n++)e[t-1-n]=this._geometries[n].reverse();return this.getFactory().createMultiLineString(e)},e.prototype.getBoundary=function(){return new Yt(this).getBoundary()},e.prototype.getGeometryType=function(){return"MultiLineString"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.interfaces_=function(){return[Dt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x7155d2ab4afa8000},Object.defineProperties(e,n),e}(jt),Yt=function(){if(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,1===arguments.length){var t=arguments[0],e=gt.MOD2_BOUNDARY_RULE;this._geom=t,this._geomFact=t.getFactory(),this._bnRule=e}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this._geom=n,this._geomFact=n.getFactory(),this._bnRule=r}};Yt.prototype.boundaryMultiLineString=function(t){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var e=this.computeBoundaryCoordinates(t);return 1===e.length?this._geomFact.createPoint(e[0]):this._geomFact.createMultiPointFromCoords(e)},Yt.prototype.getBoundary=function(){return this._geom instanceof Jt?this.boundaryLineString(this._geom):this._geom instanceof Vt?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},Yt.prototype.boundaryLineString=function(t){return this._geom.isEmpty()?this.getEmptyMultiPoint():t.isClosed()?this._bnRule.isInBoundary(2)?t.getStartPoint():this._geomFact.createMultiPoint():this._geomFact.createMultiPoint([t.getStartPoint(),t.getEndPoint()])},Yt.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},Yt.prototype.computeBoundaryCoordinates=function(t){var e=new bt;this._endpointMap=new h;for(var n=0;n<t.getNumGeometries();n++){var r=t.getGeometryN(n);0!==r.getNumPoints()&&(this.addEndpoint(r.getCoordinateN(0)),this.addEndpoint(r.getCoordinateN(r.getNumPoints()-1)))}for(var i=this._endpointMap.entrySet().iterator();i.hasNext();){var o=i.next(),s=o.getValue().count;this._bnRule.isInBoundary(s)&&e.add(o.getKey())}return St.toCoordinateArray(e)},Yt.prototype.addEndpoint=function(t){var e=this._endpointMap.get(t);null===e&&(e=new Xt,this._endpointMap.put(t,e)),e.count++},Yt.prototype.interfaces_=function(){return[]},Yt.prototype.getClass=function(){return Yt},Yt.getBoundary=function(){return 1===arguments.length?new Yt(arguments[0]).getBoundary():2===arguments.length?new Yt(arguments[0],arguments[1]).getBoundary():void 0};var Xt=function(){this.count=null};Xt.prototype.interfaces_=function(){return[]},Xt.prototype.getClass=function(){return Xt};var zt=function(){},Wt={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};zt.prototype.interfaces_=function(){return[]},zt.prototype.getClass=function(){return zt},zt.chars=function(t,e){for(var n=new Array(e).fill(null),r=0;r<e;r++)n[r]=t;return String(n)},zt.getStackTrace=function(){if(1===arguments.length){var t=arguments[0],e=new function(){},n=new function(){}(e);return t.printStackTrace(n),e.toString()}if(2===arguments.length){for(var r=arguments[0],i=arguments[1],o="",s=new function(){}(new function(){}(zt.getStackTrace(r))),a=0;a<i;a++)try{o+=s.readLine()+zt.NEWLINE}catch(t){if(!(t instanceof g))throw t;et.shouldNeverReachHere()}return o}},zt.split=function(t,e){for(var n=e.length,r=new bt,i=""+t,o=i.indexOf(e);o>=0;){var s=i.substring(0,o);r.add(s),o=(i=i.substring(o+n)).indexOf(e)}i.length>0&&r.add(i);for(var a=new Array(r.size()).fill(null),u=0;u<a.length;u++)a[u]=r.get(u);return a},zt.toString=function(){if(1===arguments.length){var t=arguments[0];return zt.SIMPLE_ORDINATE_FORMAT.format(t)}},zt.spaces=function(t){return zt.chars(" ",t)},Wt.NEWLINE.get=function(){return Y.getProperty("line.separator")},Wt.SIMPLE_ORDINATE_FORMAT.get=function(){return new function(){}("0.#")},Object.defineProperties(zt,Wt);var Ht=function(){};Ht.prototype.interfaces_=function(){return[]},Ht.prototype.getClass=function(){return Ht},Ht.copyCoord=function(t,e,n,r){for(var i=Math.min(t.getDimension(),n.getDimension()),o=0;o<i;o++)n.setOrdinate(r,o,t.getOrdinate(e,o))},Ht.isRing=function(t){var e=t.size();return 0===e||!(e<=3)&&t.getOrdinate(0,U.X)===t.getOrdinate(e-1,U.X)&&t.getOrdinate(0,U.Y)===t.getOrdinate(e-1,U.Y)},Ht.isEqual=function(t,e){var n=t.size();if(n!==e.size())return!1;for(var r=Math.min(t.getDimension(),e.getDimension()),i=0;i<n;i++)for(var o=0;o<r;o++){var s=t.getOrdinate(i,o),a=e.getOrdinate(i,o);if(!(t.getOrdinate(i,o)===e.getOrdinate(i,o)||m.isNaN(s)&&m.isNaN(a)))return!1}return!0},Ht.extend=function(t,e,n){var r=t.create(n,e.getDimension()),i=e.size();if(Ht.copy(e,0,r,0,i),i>0)for(var o=i;o<n;o++)Ht.copy(e,i-1,r,o,1);return r},Ht.reverse=function(t){for(var e=t.size()-1,n=Math.trunc(e/2),r=0;r<=n;r++)Ht.swap(t,r,e-r)},Ht.swap=function(t,e,n){if(e===n)return null;for(var r=0;r<t.getDimension();r++){var i=t.getOrdinate(e,r);t.setOrdinate(e,r,t.getOrdinate(n,r)),t.setOrdinate(n,r,i)}},Ht.copy=function(t,e,n,r,i){for(var o=0;o<i;o++)Ht.copyCoord(t,e+o,n,r+o)},Ht.toString=function(){if(1===arguments.length){var t=arguments[0],e=t.size();if(0===e)return"()";var n=t.getDimension(),r=new R;r.append("(");for(var i=0;i<e;i++){i>0&&r.append(" ");for(var o=0;o<n;o++)o>0&&r.append(","),r.append(zt.toString(t.getOrdinate(i,o)))}return r.append(")"),r.toString()}},Ht.ensureValidRing=function(t,e){var n=e.size();return 0===n?e:n<=3?Ht.createClosedRing(t,e,4):e.getOrdinate(0,U.X)===e.getOrdinate(n-1,U.X)&&e.getOrdinate(0,U.Y)===e.getOrdinate(n-1,U.Y)?e:Ht.createClosedRing(t,e,n+1)},Ht.createClosedRing=function(t,e,n){var r=t.create(n,e.getDimension()),i=e.size();Ht.copy(e,0,r,0,i);for(var o=i;o<n;o++)Ht.copy(e,0,r,o,1);return r};var Jt=function(t){function e(e,n){t.call(this,n),this._points=null,this.init(e)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new z:this._points.expandEnvelope(new z)},e.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},e.prototype.getSortIndex=function(){return t.SORTINDEX_LINESTRING},e.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];if(!this.isEquivalentClass(e))return!1;var r=e;if(this._points.size()!==r._points.size())return!1;for(var i=0;i<this._points.size();i++)if(!this.equal(this._points.getCoordinate(i),r._points.getCoordinate(i),n))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){for(var t=0;t<Math.trunc(this._points.size()/2);t++){var e=this._points.size()-1-t;if(!this._points.getCoordinate(t).equals(this._points.getCoordinate(e)))return this._points.getCoordinate(t).compareTo(this._points.getCoordinate(e))>0&&Ht.reverse(this._points),null}},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?Bt.FALSE:0},e.prototype.isClosed=function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},e.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},e.prototype.getDimension=function(){return 1},e.prototype.getLength=function(){return at.computeLength(this._points)},e.prototype.getNumPoints=function(){return this._points.size()},e.prototype.reverse=function(){var t=this._points.copy();return Ht.reverse(t),this.getFactory().createLineString(t)},e.prototype.compareToSameClass=function(){if(1===arguments.length){for(var t=arguments[0],e=0,n=0;e<this._points.size()&&n<t._points.size();){var r=this._points.getCoordinate(e).compareTo(t._points.getCoordinate(n));if(0!==r)return r;e++,n++}return e<this._points.size()?1:n<t._points.size()?-1:0}if(2===arguments.length){var i=arguments[0];return arguments[1].compare(this._points,i._points)}},e.prototype.apply=function(){if(T(arguments[0],ft))for(var t=arguments[0],e=0;e<this._points.size();e++)t.filter(this._points.getCoordinate(e));else if(T(arguments[0],qt)){var n=arguments[0];if(0===this._points.size())return null;for(var r=0;r<this._points.size()&&(n.filter(this._points,r),!n.isDone());r++);n.isGeometryChanged()&&this.geometryChanged()}else(T(arguments[0],Ut)||T(arguments[0],ct))&&arguments[0].filter(this)},e.prototype.getBoundary=function(){return new Yt(this).getBoundary()},e.prototype.isEquivalentClass=function(t){return t instanceof e},e.prototype.clone=function(){var e=t.prototype.clone.call(this);return e._points=this._points.clone(),e},e.prototype.getCoordinateN=function(t){return this._points.getCoordinate(t)},e.prototype.getGeometryType=function(){return"LineString"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.getCoordinateSequence=function(){return this._points},e.prototype.isEmpty=function(){return 0===this._points.size()},e.prototype.init=function(t){if(null===t&&(t=this.getFactory().getCoordinateSequenceFactory().create([])),1===t.size())throw new v("Invalid number of points in LineString (found "+t.size()+" - must be 0 or >= 2)");this._points=t},e.prototype.isCoordinate=function(t){for(var e=0;e<this._points.size();e++)if(this._points.getCoordinate(e).equals(t))return!0;return!1},e.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},e.prototype.getPointN=function(t){return this.getFactory().createPoint(this._points.getCoordinate(t))},e.prototype.interfaces_=function(){return[Dt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(e,n),e}(lt),Kt=function(){};Kt.prototype.interfaces_=function(){return[]},Kt.prototype.getClass=function(){return Kt};var Qt=function(t){function e(e,n){t.call(this,n),this._coordinates=e||null,this.init(this._coordinates)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new z;var t=new z;return t.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),t},e.prototype.getSortIndex=function(){return t.SORTINDEX_POINT},e.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&(!(!this.isEmpty()||!e.isEmpty())||this.isEmpty()===e.isEmpty()&&this.equal(e.getCoordinate(),this.getCoordinate(),n))}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){},e.prototype.getCoordinate=function(){return 0!==this._coordinates.size()?this._coordinates.getCoordinate(0):null},e.prototype.getBoundaryDimension=function(){return Bt.FALSE},e.prototype.getDimension=function(){return 0},e.prototype.getNumPoints=function(){return this.isEmpty()?0:1},e.prototype.reverse=function(){return this.copy()},e.prototype.getX=function(){if(null===this.getCoordinate())throw new Error("getX called on empty Point");return this.getCoordinate().x},e.prototype.compareToSameClass=function(){if(1===arguments.length){var t=arguments[0];return this.getCoordinate().compareTo(t.getCoordinate())}if(2===arguments.length){var e=arguments[0];return arguments[1].compare(this._coordinates,e._coordinates)}},e.prototype.apply=function(){if(T(arguments[0],ft)){var t=arguments[0];if(this.isEmpty())return null;t.filter(this.getCoordinate())}else if(T(arguments[0],qt)){var e=arguments[0];if(this.isEmpty())return null;e.filter(this._coordinates,0),e.isGeometryChanged()&&this.geometryChanged()}else(T(arguments[0],Ut)||T(arguments[0],ct))&&arguments[0].filter(this)},e.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},e.prototype.clone=function(){var e=t.prototype.clone.call(this);return e._coordinates=this._coordinates.clone(),e},e.prototype.getGeometryType=function(){return"Point"},e.prototype.copy=function(){return new e(this._coordinates.copy(),this._factory)},e.prototype.getCoordinateSequence=function(){return this._coordinates},e.prototype.getY=function(){if(null===this.getCoordinate())throw new Error("getY called on empty Point");return this.getCoordinate().y},e.prototype.isEmpty=function(){return 0===this._coordinates.size()},e.prototype.init=function(t){null===t&&(t=this.getFactory().getCoordinateSequenceFactory().create([])),et.isTrue(t.size()<=1),this._coordinates=t},e.prototype.isSimple=function(){return!0},e.prototype.interfaces_=function(){return[Kt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return 0x44077bad161cbc00},Object.defineProperties(e,n),e}(lt),$t=function(){};$t.prototype.interfaces_=function(){return[]},$t.prototype.getClass=function(){return $t};var Zt=function(t){function e(e,n,r){if(t.call(this,r),this._shell=null,this._holes=null,null===e&&(e=this.getFactory().createLinearRing()),null===n&&(n=[]),t.hasNullElements(n))throw new v("holes must not contain null elements");if(e.isEmpty()&&t.hasNonEmptyElements(n))throw new v("shell is empty but holes are not");this._shell=e,this._holes=n}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},e.prototype.getSortIndex=function(){return t.SORTINDEX_POLYGON},e.prototype.getCoordinates=function(){if(this.isEmpty())return[];for(var t=new Array(this.getNumPoints()).fill(null),e=-1,n=this._shell.getCoordinates(),r=0;r<n.length;r++)t[++e]=n[r];for(var i=0;i<this._holes.length;i++)for(var o=this._holes[i].getCoordinates(),s=0;s<o.length;s++)t[++e]=o[s];return t},e.prototype.getArea=function(){var t=0;t+=Math.abs(at.signedArea(this._shell.getCoordinateSequence()));for(var e=0;e<this._holes.length;e++)t-=Math.abs(at.signedArea(this._holes[e].getCoordinateSequence()));return t},e.prototype.isRectangle=function(){if(0!==this.getNumInteriorRing())return!1;if(null===this._shell)return!1;if(5!==this._shell.getNumPoints())return!1;for(var t=this._shell.getCoordinateSequence(),e=this.getEnvelopeInternal(),n=0;n<5;n++){var r=t.getX(n);if(r!==e.getMinX()&&r!==e.getMaxX())return!1;var i=t.getY(n);if(i!==e.getMinY()&&i!==e.getMaxY())return!1}for(var o=t.getX(0),s=t.getY(0),a=1;a<=4;a++){var u=t.getX(a),c=t.getY(a);if(u!==o==(c!==s))return!1;o=u,s=c}return!0},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];if(!this.isEquivalentClass(e))return!1;var r=e,i=this._shell,o=r._shell;if(!i.equalsExact(o,n))return!1;if(this._holes.length!==r._holes.length)return!1;for(var s=0;s<this._holes.length;s++)if(!this._holes[s].equalsExact(r._holes[s],n))return!1;return!0}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.normalize=function(){if(0===arguments.length){this.normalize(this._shell,!0);for(var t=0;t<this._holes.length;t++)this.normalize(this._holes[t],!1);kt.sort(this._holes)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(e.isEmpty())return null;var r=new Array(e.getCoordinates().length-1).fill(null);Y.arraycopy(e.getCoordinates(),0,r,0,r.length);var i=St.minCoordinate(e.getCoordinates());St.scroll(r,i),Y.arraycopy(r,0,e.getCoordinates(),0,r.length),e.getCoordinates()[r.length]=r[0],at.isCCW(e.getCoordinates())===n&&St.reverse(e.getCoordinates())}},e.prototype.getCoordinate=function(){return this._shell.getCoordinate()},e.prototype.getNumInteriorRing=function(){return this._holes.length},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.getLength=function(){var t=0;t+=this._shell.getLength();for(var e=0;e<this._holes.length;e++)t+=this._holes[e].getLength();return t},e.prototype.getNumPoints=function(){for(var t=this._shell.getNumPoints(),e=0;e<this._holes.length;e++)t+=this._holes[e].getNumPoints();return t},e.prototype.reverse=function(){var t=this.copy();t._shell=this._shell.copy().reverse(),t._holes=new Array(this._holes.length).fill(null);for(var e=0;e<this._holes.length;e++)t._holes[e]=this._holes[e].copy().reverse();return t},e.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},e.prototype.compareToSameClass=function(){if(1===arguments.length){var t=arguments[0],e=this._shell,n=t._shell;return e.compareToSameClass(n)}if(2===arguments.length){var r=arguments[1],i=arguments[0],o=this._shell,s=i._shell,a=o.compareToSameClass(s,r);if(0!==a)return a;for(var u=this.getNumInteriorRing(),c=i.getNumInteriorRing(),l=0;l<u&&l<c;){var h=this.getInteriorRingN(l),p=i.getInteriorRingN(l),f=h.compareToSameClass(p,r);if(0!==f)return f;l++}return l<u?1:l<c?-1:0}},e.prototype.apply=function(t){if(T(t,ft)){this._shell.apply(t);for(var e=0;e<this._holes.length;e++)this._holes[e].apply(t)}else if(T(t,qt)){if(this._shell.apply(t),!t.isDone())for(var n=0;n<this._holes.length&&(this._holes[n].apply(t),!t.isDone());n++);t.isGeometryChanged()&&this.geometryChanged()}else if(T(t,Ut))t.filter(this);else if(T(t,ct)){t.filter(this),this._shell.apply(t);for(var r=0;r<this._holes.length;r++)this._holes[r].apply(t)}},e.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();var t=new Array(this._holes.length+1).fill(null);t[0]=this._shell;for(var e=0;e<this._holes.length;e++)t[e+1]=this._holes[e];return t.length<=1?this.getFactory().createLinearRing(t[0].getCoordinateSequence()):this.getFactory().createMultiLineString(t)},e.prototype.clone=function(){var e=t.prototype.clone.call(this);e._shell=this._shell.clone(),e._holes=new Array(this._holes.length).fill(null);for(var n=0;n<this._holes.length;n++)e._holes[n]=this._holes[n].clone();return e},e.prototype.getGeometryType=function(){return"Polygon"},e.prototype.copy=function(){for(var t=this._shell.copy(),n=new Array(this._holes.length).fill(null),r=0;r<n.length;r++)n[r]=this._holes[r].copy();return new e(t,n,this._factory)},e.prototype.getExteriorRing=function(){return this._shell},e.prototype.isEmpty=function(){return this._shell.isEmpty()},e.prototype.getInteriorRingN=function(t){return this._holes[t]},e.prototype.interfaces_=function(){return[$t]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(e,n),e}(lt),te=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return lt.SORTINDEX_MULTIPOINT},e.prototype.isValid=function(){return!0},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,n)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getCoordinate=function(){if(1===arguments.length){var e=arguments[0];return this._geometries[e].getCoordinate()}return t.prototype.getCoordinate.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return Bt.FALSE},e.prototype.getDimension=function(){return 0},e.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},e.prototype.getGeometryType=function(){return"MultiPoint"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.interfaces_=function(){return[Kt]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x6fb1ed4162e0fc00},Object.defineProperties(e,n),e}(jt),ee=function(t){function e(e,n){e instanceof w&&n instanceof _e&&(e=n.getCoordinateSequenceFactory().create(e)),t.call(this,e,n),this.validateConstruction()}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return lt.SORTINDEX_LINEARRING},e.prototype.getBoundaryDimension=function(){return Bt.FALSE},e.prototype.isClosed=function(){return!!this.isEmpty()||t.prototype.isClosed.call(this)},e.prototype.reverse=function(){var t=this._points.copy();return Ht.reverse(t),this.getFactory().createLinearRing(t)},e.prototype.validateConstruction=function(){if(!this.isEmpty()&&!t.prototype.isClosed.call(this))throw new v("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<e.MINIMUM_VALID_SIZE)throw new v("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},e.prototype.getGeometryType=function(){return"LinearRing"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.MINIMUM_VALID_SIZE.get=function(){return 4},n.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(e,n),e}(Jt),ne=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return lt.SORTINDEX_MULTIPOLYGON},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return!!this.isEquivalentClass(e)&&t.prototype.equalsExact.call(this,e,n)}return t.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),n=0;n<this._geometries.length;n++)e[n]=this._geometries[n].reverse();return this.getFactory().createMultiPolygon(e)},e.prototype.getBoundary=function(){if(this.isEmpty())return this.getFactory().createMultiLineString();for(var t=new bt,e=0;e<this._geometries.length;e++)for(var n=this._geometries[e].getBoundary(),r=0;r<n.getNumGeometries();r++)t.add(n.getGeometryN(r));var i=new Array(t.size()).fill(null);return this.getFactory().createMultiLineString(t.toArray(i))},e.prototype.getGeometryType=function(){return"MultiPolygon"},e.prototype.copy=function(){for(var t=new Array(this._geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this._geometries[n].copy();return new e(t,this._factory)},e.prototype.interfaces_=function(){return[$t]},e.prototype.getClass=function(){return e},n.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(e,n),e}(jt),re=function(t){this._factory=t||null,this._isUserDataCopied=!1},ie={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};re.prototype.setCopyUserData=function(t){this._isUserDataCopied=t},re.prototype.edit=function(t,e){if(null===t)return null;var n=this.editInternal(t,e);return this._isUserDataCopied&&n.setUserData(t.getUserData()),n},re.prototype.editInternal=function(t,e){return null===this._factory&&(this._factory=t.getFactory()),t instanceof jt?this.editGeometryCollection(t,e):t instanceof Zt?this.editPolygon(t,e):t instanceof Qt||t instanceof Jt?e.edit(t,this._factory):(et.shouldNeverReachHere("Unsupported Geometry class: "+t.getClass().getName()),null)},re.prototype.editGeometryCollection=function(t,e){for(var n=e.edit(t,this._factory),r=new bt,i=0;i<n.getNumGeometries();i++){var o=this.edit(n.getGeometryN(i),e);null===o||o.isEmpty()||r.add(o)}return n.getClass()===te?this._factory.createMultiPoint(r.toArray([])):n.getClass()===Vt?this._factory.createMultiLineString(r.toArray([])):n.getClass()===ne?this._factory.createMultiPolygon(r.toArray([])):this._factory.createGeometryCollection(r.toArray([]))},re.prototype.editPolygon=function(t,e){var n=e.edit(t,this._factory);if(null===n&&(n=this._factory.createPolygon(null)),n.isEmpty())return n;var r=this.edit(n.getExteriorRing(),e);if(null===r||r.isEmpty())return this._factory.createPolygon();for(var i=new bt,o=0;o<n.getNumInteriorRing();o++){var s=this.edit(n.getInteriorRingN(o),e);null===s||s.isEmpty()||i.add(s)}return this._factory.createPolygon(r,i.toArray([]))},re.prototype.interfaces_=function(){return[]},re.prototype.getClass=function(){return re},re.GeometryEditorOperation=function(){},ie.NoOpGeometryOperation.get=function(){return oe},ie.CoordinateOperation.get=function(){return se},ie.CoordinateSequenceOperation.get=function(){return ae},Object.defineProperties(re,ie);var oe=function(){};oe.prototype.edit=function(t,e){return t},oe.prototype.interfaces_=function(){return[re.GeometryEditorOperation]},oe.prototype.getClass=function(){return oe};var se=function(){};se.prototype.edit=function(t,e){var n=this.editCoordinates(t.getCoordinates(),t);return null===n?t:t instanceof ee?e.createLinearRing(n):t instanceof Jt?e.createLineString(n):t instanceof Qt?n.length>0?e.createPoint(n[0]):e.createPoint():t},se.prototype.interfaces_=function(){return[re.GeometryEditorOperation]},se.prototype.getClass=function(){return se};var ae=function(){};ae.prototype.edit=function(t,e){return t instanceof ee?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof Jt?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof Qt?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},ae.prototype.interfaces_=function(){return[re.GeometryEditorOperation]},ae.prototype.getClass=function(){return ae};var ue=function(){if(this._dimension=3,this._coordinates=null,1===arguments.length){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var t=arguments[0];this._coordinates=new Array(t).fill(null);for(var e=0;e<t;e++)this._coordinates[e]=new w}else if(T(arguments[0],U)){var n=arguments[0];if(null===n)return this._coordinates=new Array(0).fill(null),null;this._dimension=n.getDimension(),this._coordinates=new Array(n.size()).fill(null);for(var r=0;r<this._coordinates.length;r++)this._coordinates[r]=n.getCoordinateCopy(r)}}else if(2===arguments.length)if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var i=arguments[0],o=arguments[1];this._coordinates=i,this._dimension=o,null===i&&(this._coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var s=arguments[0],a=arguments[1];this._coordinates=new Array(s).fill(null),this._dimension=a;for(var u=0;u<s;u++)this._coordinates[u]=new w}},ce={serialVersionUID:{configurable:!0}};ue.prototype.setOrdinate=function(t,e,n){switch(e){case U.X:this._coordinates[t].x=n;break;case U.Y:this._coordinates[t].y=n;break;case U.Z:this._coordinates[t].z=n;break;default:throw new v("invalid ordinateIndex")}},ue.prototype.size=function(){return this._coordinates.length},ue.prototype.getOrdinate=function(t,e){switch(e){case U.X:return this._coordinates[t].x;case U.Y:return this._coordinates[t].y;case U.Z:return this._coordinates[t].z}return m.NaN},ue.prototype.getCoordinate=function(){if(1===arguments.length){var t=arguments[0];return this._coordinates[t]}if(2===arguments.length){var e=arguments[0],n=arguments[1];n.x=this._coordinates[e].x,n.y=this._coordinates[e].y,n.z=this._coordinates[e].z}},ue.prototype.getCoordinateCopy=function(t){return new w(this._coordinates[t])},ue.prototype.getDimension=function(){return this._dimension},ue.prototype.getX=function(t){return this._coordinates[t].x},ue.prototype.clone=function(){for(var t=new Array(this.size()).fill(null),e=0;e<this._coordinates.length;e++)t[e]=this._coordinates[e].clone();return new ue(t,this._dimension)},ue.prototype.expandEnvelope=function(t){for(var e=0;e<this._coordinates.length;e++)t.expandToInclude(this._coordinates[e]);return t},ue.prototype.copy=function(){for(var t=new Array(this.size()).fill(null),e=0;e<this._coordinates.length;e++)t[e]=this._coordinates[e].copy();return new ue(t,this._dimension)},ue.prototype.toString=function(){if(this._coordinates.length>0){var t=new R(17*this._coordinates.length);t.append("("),t.append(this._coordinates[0]);for(var e=1;e<this._coordinates.length;e++)t.append(", "),t.append(this._coordinates[e]);return t.append(")"),t.toString()}return"()"},ue.prototype.getY=function(t){return this._coordinates[t].y},ue.prototype.toCoordinateArray=function(){return this._coordinates},ue.prototype.interfaces_=function(){return[U,e]},ue.prototype.getClass=function(){return ue},ce.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(ue,ce);var le=function(){},he={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};le.prototype.readResolve=function(){return le.instance()},le.prototype.create=function(){if(1===arguments.length){if(arguments[0]instanceof Array)return new ue(arguments[0]);if(T(arguments[0],U))return new ue(arguments[0])}else if(2===arguments.length){var t=arguments[0],e=arguments[1];return e>3&&(e=3),e<2?new ue(t):new ue(t,e)}},le.prototype.interfaces_=function(){return[C,e]},le.prototype.getClass=function(){return le},le.instance=function(){return le.instanceObject},he.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},he.instanceObject.get=function(){return new le},Object.defineProperties(le,he);var pe=function(t){function e(){t.call(this),this.map_=new Map}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return this.map_.get(t)||null},e.prototype.put=function(t,e){return this.map_.set(t,e),e},e.prototype.values=function(){for(var t=new bt,e=this.map_.values(),n=e.next();!n.done;)t.add(n.value),n=e.next();return t},e.prototype.entrySet=function(){var t=new Pt;return this.map_.entries().forEach((function(e){return t.add(e)})),t},e.prototype.size=function(){return this.map_.size()},e}(Tt),fe=function t(){if(this._modelType=null,this._scale=null,0===arguments.length)this._modelType=t.FLOATING;else if(1===arguments.length)if(arguments[0]instanceof de){var e=arguments[0];this._modelType=e,e===t.FIXED&&this.setScale(1)}else if("number"==typeof arguments[0]){var n=arguments[0];this._modelType=t.FIXED,this.setScale(n)}else if(arguments[0]instanceof t){var r=arguments[0];this._modelType=r._modelType,this._scale=r._scale}},ge={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};fe.prototype.equals=function(t){if(!(t instanceof fe))return!1;var e=t;return this._modelType===e._modelType&&this._scale===e._scale},fe.prototype.compareTo=function(t){var e=t,n=this.getMaximumSignificantDigits(),r=e.getMaximumSignificantDigits();return new A(n).compareTo(new A(r))},fe.prototype.getScale=function(){return this._scale},fe.prototype.isFloating=function(){return this._modelType===fe.FLOATING||this._modelType===fe.FLOATING_SINGLE},fe.prototype.getType=function(){return this._modelType},fe.prototype.toString=function(){var t="UNKNOWN";return this._modelType===fe.FLOATING?t="Floating":this._modelType===fe.FLOATING_SINGLE?t="Floating-Single":this._modelType===fe.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},fe.prototype.makePrecise=function(){if("number"==typeof arguments[0]){var t=arguments[0];return m.isNaN(t)||this._modelType===fe.FLOATING_SINGLE?t:this._modelType===fe.FIXED?Math.round(t*this._scale)/this._scale:t}if(arguments[0]instanceof w){var e=arguments[0];if(this._modelType===fe.FLOATING)return null;e.x=this.makePrecise(e.x),e.y=this.makePrecise(e.y)}},fe.prototype.getMaximumSignificantDigits=function(){var t=16;return this._modelType===fe.FLOATING?t=16:this._modelType===fe.FLOATING_SINGLE?t=6:this._modelType===fe.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},fe.prototype.setScale=function(t){this._scale=Math.abs(t)},fe.prototype.interfaces_=function(){return[e,E]},fe.prototype.getClass=function(){return fe},fe.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},ge.serialVersionUID.get=function(){return 0x6bee6404e9a25c00},ge.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(fe,ge);var de=function t(e){this._name=e||null,t.nameToTypeMap.put(e,this)},ye={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};de.prototype.readResolve=function(){return de.nameToTypeMap.get(this._name)},de.prototype.toString=function(){return this._name},de.prototype.interfaces_=function(){return[e]},de.prototype.getClass=function(){return de},ye.serialVersionUID.get=function(){return-552860263173159e4},ye.nameToTypeMap.get=function(){return new pe},Object.defineProperties(de,ye),fe.Type=de,fe.FIXED=new de("FIXED"),fe.FLOATING=new de("FLOATING"),fe.FLOATING_SINGLE=new de("FLOATING SINGLE");var _e=function t(){this._precisionModel=new fe,this._SRID=0,this._coordinateSequenceFactory=t.getDefaultCoordinateSequenceFactory(),0===arguments.length||(1===arguments.length?T(arguments[0],C)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof fe&&(this._precisionModel=arguments[0]):2===arguments.length?(this._precisionModel=arguments[0],this._SRID=arguments[1]):3===arguments.length&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},ve={serialVersionUID:{configurable:!0}};_e.prototype.toGeometry=function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new w(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new w(t.getMinX(),t.getMinY()),new w(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new w(t.getMinX(),t.getMinY()),new w(t.getMinX(),t.getMaxY()),new w(t.getMaxX(),t.getMaxY()),new w(t.getMaxX(),t.getMinY()),new w(t.getMinX(),t.getMinY())]),null)},_e.prototype.createLineString=function(t){return t?t instanceof Array?new Jt(this.getCoordinateSequenceFactory().create(t),this):T(t,U)?new Jt(t,this):void 0:new Jt(this.getCoordinateSequenceFactory().create([]),this)},_e.prototype.createMultiLineString=function(){return 0===arguments.length?new Vt(null,this):1===arguments.length?new Vt(arguments[0],this):void 0},_e.prototype.buildGeometry=function(t){for(var e=null,n=!1,r=!1,i=t.iterator();i.hasNext();){var o=i.next(),s=o.getClass();null===e&&(e=s),s!==e&&(n=!0),o.isGeometryCollectionOrDerived()&&(r=!0)}if(null===e)return this.createGeometryCollection();if(n||r)return this.createGeometryCollection(_e.toGeometryArray(t));var a=t.iterator().next();if(t.size()>1){if(a instanceof Zt)return this.createMultiPolygon(_e.toPolygonArray(t));if(a instanceof Jt)return this.createMultiLineString(_e.toLineStringArray(t));if(a instanceof Qt)return this.createMultiPoint(_e.toPointArray(t));et.shouldNeverReachHere("Unhandled class: "+a.getClass().getName())}return a},_e.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)},_e.prototype.createPoint=function(){if(0===arguments.length)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof w){var t=arguments[0];return this.createPoint(null!==t?this.getCoordinateSequenceFactory().create([t]):null)}if(T(arguments[0],U))return new Qt(arguments[0],this)}},_e.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},_e.prototype.createPolygon=function(){if(0===arguments.length)return new Zt(null,null,this);if(1===arguments.length){if(T(arguments[0],U)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}if(arguments[0]instanceof Array){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}if(arguments[0]instanceof ee){var n=arguments[0];return this.createPolygon(n,null)}}else if(2===arguments.length)return new Zt(arguments[0],arguments[1],this)},_e.prototype.getSRID=function(){return this._SRID},_e.prototype.createGeometryCollection=function(){return 0===arguments.length?new jt(null,this):1===arguments.length?new jt(arguments[0],this):void 0},_e.prototype.createGeometry=function(t){return new re(this).edit(t,{edit:function(){if(2===arguments.length){var t=arguments[0];return this._coordinateSequenceFactory.create(t)}}})},_e.prototype.getPrecisionModel=function(){return this._precisionModel},_e.prototype.createLinearRing=function(){if(0===arguments.length)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLinearRing(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(T(arguments[0],U))return new ee(arguments[0],this)}},_e.prototype.createMultiPolygon=function(){return 0===arguments.length?new ne(null,this):1===arguments.length?new ne(arguments[0],this):void 0},_e.prototype.createMultiPoint=function(){if(0===arguments.length)return new te(null,this);if(1===arguments.length){if(arguments[0]instanceof Array)return new te(arguments[0],this);if(arguments[0]instanceof Array){var t=arguments[0];return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(T(arguments[0],U)){var e=arguments[0];if(null===e)return this.createMultiPoint(new Array(0).fill(null));for(var n=new Array(e.size()).fill(null),r=0;r<e.size();r++){var i=this.getCoordinateSequenceFactory().create(1,e.getDimension());Ht.copy(e,r,i,0,1),n[r]=this.createPoint(i)}return this.createMultiPoint(n)}}},_e.prototype.interfaces_=function(){return[e]},_e.prototype.getClass=function(){return _e},_e.toMultiPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},_e.toGeometryArray=function(t){if(null===t)return null;var e=new Array(t.size()).fill(null);return t.toArray(e)},_e.getDefaultCoordinateSequenceFactory=function(){return le.instance()},_e.toMultiLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},_e.toLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},_e.toMultiPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},_e.toLinearRingArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},_e.toPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},_e.toPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},_e.createPointFromInternalCoord=function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)},ve.serialVersionUID.get=function(){return-0x5ea75f2051eeb400},Object.defineProperties(_e,ve);var me=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],xe=function(t){this.geometryFactory=t||new _e};xe.prototype.read=function(t){var e,n=(e="string"==typeof t?JSON.parse(t):t).type;if(!Ee[n])throw new Error("Unknown GeoJSON type: "+e.type);return-1!==me.indexOf(n)?Ee[n].apply(this,[e.coordinates]):"GeometryCollection"===n?Ee[n].apply(this,[e.geometries]):Ee[n].apply(this,[e])},xe.prototype.write=function(t){var e=t.getGeometryType();if(!Ie[e])throw new Error("Geometry is not supported");return Ie[e].apply(this,[t])};var Ee={Feature:function(t){var e={};for(var n in t)e[n]=t[n];if(t.geometry){var r=t.geometry.type;if(!Ee[r])throw new Error("Unknown GeoJSON type: "+t.type);e.geometry=this.read(t.geometry)}return t.bbox&&(e.bbox=Ee.bbox.apply(this,[t.bbox])),e},FeatureCollection:function(t){var e={};if(t.features){e.features=[];for(var n=0;n<t.features.length;++n)e.features.push(this.read(t.features[n]))}return t.bbox&&(e.bbox=this.parse.bbox.apply(this,[t.bbox])),e},coordinates:function(t){for(var e=[],n=0;n<t.length;++n){var r=t[n];e.push(new w(r[0],r[1]))}return e},bbox:function(t){return this.geometryFactory.createLinearRing([new w(t[0],t[1]),new w(t[2],t[1]),new w(t[2],t[3]),new w(t[0],t[3]),new w(t[0],t[1])])},Point:function(t){var e=new w(t[0],t[1]);return this.geometryFactory.createPoint(e)},MultiPoint:function(t){for(var e=[],n=0;n<t.length;++n)e.push(Ee.Point.apply(this,[t[n]]));return this.geometryFactory.createMultiPoint(e)},LineString:function(t){var e=Ee.coordinates.apply(this,[t]);return this.geometryFactory.createLineString(e)},MultiLineString:function(t){for(var e=[],n=0;n<t.length;++n)e.push(Ee.LineString.apply(this,[t[n]]));return this.geometryFactory.createMultiLineString(e)},Polygon:function(t){for(var e=Ee.coordinates.apply(this,[t[0]]),n=this.geometryFactory.createLinearRing(e),r=[],i=1;i<t.length;++i){var o=t[i],s=Ee.coordinates.apply(this,[o]),a=this.geometryFactory.createLinearRing(s);r.push(a)}return this.geometryFactory.createPolygon(n,r)},MultiPolygon:function(t){for(var e=[],n=0;n<t.length;++n){var r=t[n];e.push(Ee.Polygon.apply(this,[r]))}return this.geometryFactory.createMultiPolygon(e)},GeometryCollection:function(t){for(var e=[],n=0;n<t.length;++n){var r=t[n];e.push(this.read(r))}return this.geometryFactory.createGeometryCollection(e)}},Ie={coordinate:function(t){return[t.x,t.y]},Point:function(t){return{type:"Point",coordinates:Ie.coordinate.apply(this,[t.getCoordinate()])}},MultiPoint:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=Ie.Point.apply(this,[r]);e.push(i.coordinates)}return{type:"MultiPoint",coordinates:e}},LineString:function(t){for(var e=[],n=t.getCoordinates(),r=0;r<n.length;++r){var i=n[r];e.push(Ie.coordinate.apply(this,[i]))}return{type:"LineString",coordinates:e}},MultiLineString:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=Ie.LineString.apply(this,[r]);e.push(i.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(t){var e=[],n=Ie.LineString.apply(this,[t._shell]);e.push(n.coordinates);for(var r=0;r<t._holes.length;++r){var i=t._holes[r],o=Ie.LineString.apply(this,[i]);e.push(o.coordinates)}return{type:"Polygon",coordinates:e}},MultiPolygon:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=Ie.Polygon.apply(this,[r]);e.push(i.coordinates)}return{type:"MultiPolygon",coordinates:e}},GeometryCollection:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=r.getGeometryType();e.push(Ie[i].apply(this,[r]))}return{type:"GeometryCollection",geometries:e}}},be=function(t){this.geometryFactory=t||new _e,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new xe(this.geometryFactory)};be.prototype.read=function(t){var e=this.parser.read(t);return this.precisionModel.getType()===fe.FIXED&&this.reducePrecision(e),e},be.prototype.reducePrecision=function(t){var e,n;if(t.coordinate)this.precisionModel.makePrecise(t.coordinate);else if(t.points)for(e=0,n=t.points.length;e<n;e++)this.precisionModel.makePrecise(t.points[e]);else if(t.geometries)for(e=0,n=t.geometries.length;e<n;e++)this.reducePrecision(t.geometries[e])};var we=function(){this.parser=new xe(this.geometryFactory)};we.prototype.write=function(t){return this.parser.write(t)};var Ne=function(){},Se={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};Ne.prototype.interfaces_=function(){return[]},Ne.prototype.getClass=function(){return Ne},Ne.opposite=function(t){return t===Ne.LEFT?Ne.RIGHT:t===Ne.RIGHT?Ne.LEFT:t},Se.ON.get=function(){return 0},Se.LEFT.get=function(){return 1},Se.RIGHT.get=function(){return 2},Object.defineProperties(Ne,Se),(d.prototype=new Error).name="EmptyStackException",(y.prototype=new It).add=function(t){return this.array_.push(t),!0},y.prototype.get=function(t){if(t<0||t>=this.size())throw new Error;return this.array_[t]},y.prototype.push=function(t){return this.array_.push(t),t},y.prototype.pop=function(t){if(0===this.array_.length)throw new d;return this.array_.pop()},y.prototype.peek=function(){if(0===this.array_.length)throw new d;return this.array_[this.array_.length-1]},y.prototype.empty=function(){return 0===this.array_.length},y.prototype.isEmpty=function(){return this.empty()},y.prototype.search=function(t){return this.array_.indexOf(t)},y.prototype.size=function(){return this.array_.length},y.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e<n;e++)t.push(this.array_[e]);return t};var Ce=function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null};Ce.prototype.getCoordinate=function(){return this._minCoord},Ce.prototype.getRightmostSide=function(t,e){var n=this.getRightmostSideOfSegment(t,e);return n<0&&(n=this.getRightmostSideOfSegment(t,e-1)),n<0&&(this._minCoord=null,this.checkForRightmostCoordinate(t)),n},Ce.prototype.findRightmostEdgeAtVertex=function(){var t=this._minDe.getEdge().getCoordinates();et.isTrue(this._minIndex>0&&this._minIndex<t.length,"rightmost point expected to be interior vertex of edge");var e=t[this._minIndex-1],n=t[this._minIndex+1],r=at.computeOrientation(this._minCoord,n,e),i=!1;(e.y<this._minCoord.y&&n.y<this._minCoord.y&&r===at.COUNTERCLOCKWISE||e.y>this._minCoord.y&&n.y>this._minCoord.y&&r===at.CLOCKWISE)&&(i=!0),i&&(this._minIndex=this._minIndex-1)},Ce.prototype.getRightmostSideOfSegment=function(t,e){var n=t.getEdge().getCoordinates();if(e<0||e+1>=n.length)return-1;if(n[e].y===n[e+1].y)return-1;var r=Ne.LEFT;return n[e].y<n[e+1].y&&(r=Ne.RIGHT),r},Ce.prototype.getEdge=function(){return this._orientedDe},Ce.prototype.checkForRightmostCoordinate=function(t){for(var e=t.getEdge().getCoordinates(),n=0;n<e.length-1;n++)(null===this._minCoord||e[n].x>this._minCoord.x)&&(this._minDe=t,this._minIndex=n,this._minCoord=e[n])},Ce.prototype.findRightmostEdgeAtNode=function(){var t=this._minDe.getNode().getEdges();this._minDe=t.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},Ce.prototype.findEdge=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.isForward()&&this.checkForRightmostCoordinate(n)}et.isTrue(0!==this._minIndex||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),0===this._minIndex?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe,this.getRightmostSide(this._minDe,this._minIndex)===Ne.LEFT&&(this._orientedDe=this._minDe.getSym())},Ce.prototype.interfaces_=function(){return[]},Ce.prototype.getClass=function(){return Ce};var Oe=function(t){function e(n,r){t.call(this,e.msgWithCoord(n,r)),this.pt=r?new w(r):null,this.name="TopologyException"}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCoordinate=function(){return this.pt},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.msgWithCoord=function(t,e){return e?t:t+" [ "+e+" ]"},e}(Z),Le=function(){this.array_=[]};Le.prototype.addLast=function(t){this.array_.push(t)},Le.prototype.removeFirst=function(){return this.array_.shift()},Le.prototype.isEmpty=function(){return 0===this.array_.length};var Te=function(){this._finder=null,this._dirEdgeList=new bt,this._nodes=new bt,this._rightMostCoord=null,this._env=null,this._finder=new Ce};Te.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();)t.next().setVisited(!1)},Te.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},Te.prototype.computeNodeDepth=function(t){for(var e=null,n=t.getEdges().iterator();n.hasNext();){var r=n.next();if(r.isVisited()||r.getSym().isVisited()){e=r;break}}if(null===e)throw new Oe("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(e);for(var i=t.getEdges().iterator();i.hasNext();){var o=i.next();o.setVisited(!0),this.copySymDepths(o)}},Te.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(Ne.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},Te.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},Te.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(Ne.RIGHT)>=1&&e.getDepth(Ne.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},Te.prototype.computeDepths=function(t){var e=new Pt,n=new Le,r=t.getNode();for(n.addLast(r),e.add(r),t.setVisited(!0);!n.isEmpty();){var i=n.removeFirst();e.add(i),this.computeNodeDepth(i);for(var o=i.getEdges().iterator();o.hasNext();){var s=o.next().getSym();if(!s.isVisited()){var a=s.getNode();e.contains(a)||(n.addLast(a),e.add(a))}}}},Te.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.x<e._rightMostCoord.x?-1:this._rightMostCoord.x>e._rightMostCoord.x?1:0},Te.prototype.getEnvelope=function(){if(null===this._env){for(var t=new z,e=this._dirEdgeList.iterator();e.hasNext();)for(var n=e.next().getEdge().getCoordinates(),r=0;r<n.length-1;r++)t.expandToInclude(n[r]);this._env=t}return this._env},Te.prototype.addReachable=function(t){var e=new y;for(e.add(t);!e.empty();){var n=e.pop();this.add(n,e)}},Te.prototype.copySymDepths=function(t){var e=t.getSym();e.setDepth(Ne.LEFT,t.getDepth(Ne.RIGHT)),e.setDepth(Ne.RIGHT,t.getDepth(Ne.LEFT))},Te.prototype.add=function(t,e){t.setVisited(!0),this._nodes.add(t);for(var n=t.getEdges().iterator();n.hasNext();){var r=n.next();this._dirEdgeList.add(r);var i=r.getSym().getNode();i.isVisited()||e.push(i)}},Te.prototype.getNodes=function(){return this._nodes},Te.prototype.getDirectedEdges=function(){return this._dirEdgeList},Te.prototype.interfaces_=function(){return[E]},Te.prototype.getClass=function(){return Te};var Me=function t(){if(this.location=null,1===arguments.length){if(arguments[0]instanceof Array){var e=arguments[0];this.init(e.length)}else if(Number.isInteger(arguments[0])){var n=arguments[0];this.init(1),this.location[Ne.ON]=n}else if(arguments[0]instanceof t){var r=arguments[0];if(this.init(r.location.length),null!==r)for(var i=0;i<this.location.length;i++)this.location[i]=r.location[i]}}else if(3===arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2];this.init(3),this.location[Ne.ON]=o,this.location[Ne.LEFT]=s,this.location[Ne.RIGHT]=a}};Me.prototype.setAllLocations=function(t){for(var e=0;e<this.location.length;e++)this.location[e]=t},Me.prototype.isNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]!==O.NONE)return!1;return!0},Me.prototype.setAllLocationsIfNull=function(t){for(var e=0;e<this.location.length;e++)this.location[e]===O.NONE&&(this.location[e]=t)},Me.prototype.isLine=function(){return 1===this.location.length},Me.prototype.merge=function(t){if(t.location.length>this.location.length){var e=new Array(3).fill(null);e[Ne.ON]=this.location[Ne.ON],e[Ne.LEFT]=O.NONE,e[Ne.RIGHT]=O.NONE,this.location=e}for(var n=0;n<this.location.length;n++)this.location[n]===O.NONE&&n<t.location.length&&(this.location[n]=t.location[n])},Me.prototype.getLocations=function(){return this.location},Me.prototype.flip=function(){if(this.location.length<=1)return null;var t=this.location[Ne.LEFT];this.location[Ne.LEFT]=this.location[Ne.RIGHT],this.location[Ne.RIGHT]=t},Me.prototype.toString=function(){var t=new R;return this.location.length>1&&t.append(O.toLocationSymbol(this.location[Ne.LEFT])),t.append(O.toLocationSymbol(this.location[Ne.ON])),this.location.length>1&&t.append(O.toLocationSymbol(this.location[Ne.RIGHT])),t.toString()},Me.prototype.setLocations=function(t,e,n){this.location[Ne.ON]=t,this.location[Ne.LEFT]=e,this.location[Ne.RIGHT]=n},Me.prototype.get=function(t){return t<this.location.length?this.location[t]:O.NONE},Me.prototype.isArea=function(){return this.location.length>1},Me.prototype.isAnyNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]===O.NONE)return!0;return!1},Me.prototype.setLocation=function(){if(1===arguments.length){var t=arguments[0];this.setLocation(Ne.ON,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.location[e]=n}},Me.prototype.init=function(t){this.location=new Array(t).fill(null),this.setAllLocations(O.NONE)},Me.prototype.isEqualOnSide=function(t,e){return this.location[e]===t.location[e]},Me.prototype.allPositionsEqual=function(t){for(var e=0;e<this.location.length;e++)if(this.location[e]!==t)return!1;return!0},Me.prototype.interfaces_=function(){return[]},Me.prototype.getClass=function(){return Me};var Pe=function t(){if(this.elt=new Array(2).fill(null),1===arguments.length){if(Number.isInteger(arguments[0])){var e=arguments[0];this.elt[0]=new Me(e),this.elt[1]=new Me(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.elt[0]=new Me(n.elt[0]),this.elt[1]=new Me(n.elt[1])}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.elt[0]=new Me(O.NONE),this.elt[1]=new Me(O.NONE),this.elt[r].setLocation(i)}else if(3===arguments.length){var o=arguments[0],s=arguments[1],a=arguments[2];this.elt[0]=new Me(o,s,a),this.elt[1]=new Me(o,s,a)}else if(4===arguments.length){var u=arguments[0],c=arguments[1],l=arguments[2],h=arguments[3];this.elt[0]=new Me(O.NONE,O.NONE,O.NONE),this.elt[1]=new Me(O.NONE,O.NONE,O.NONE),this.elt[u].setLocations(c,l,h)}};Pe.prototype.getGeometryCount=function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t},Pe.prototype.setAllLocations=function(t,e){this.elt[t].setAllLocations(e)},Pe.prototype.isNull=function(t){return this.elt[t].isNull()},Pe.prototype.setAllLocationsIfNull=function(){if(1===arguments.length){var t=arguments[0];this.setAllLocationsIfNull(0,t),this.setAllLocationsIfNull(1,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.elt[e].setAllLocationsIfNull(n)}},Pe.prototype.isLine=function(t){return this.elt[t].isLine()},Pe.prototype.merge=function(t){for(var e=0;e<2;e++)null===this.elt[e]&&null!==t.elt[e]?this.elt[e]=new Me(t.elt[e]):this.elt[e].merge(t.elt[e])},Pe.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},Pe.prototype.getLocation=function(){if(1===arguments.length){var t=arguments[0];return this.elt[t].get(Ne.ON)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return this.elt[e].get(n)}},Pe.prototype.toString=function(){var t=new R;return null!==this.elt[0]&&(t.append("A:"),t.append(this.elt[0].toString())),null!==this.elt[1]&&(t.append(" B:"),t.append(this.elt[1].toString())),t.toString()},Pe.prototype.isArea=function(){if(0===arguments.length)return this.elt[0].isArea()||this.elt[1].isArea();if(1===arguments.length){var t=arguments[0];return this.elt[t].isArea()}},Pe.prototype.isAnyNull=function(t){return this.elt[t].isAnyNull()},Pe.prototype.setLocation=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.elt[t].setLocation(Ne.ON,e)}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this.elt[n].setLocation(r,i)}},Pe.prototype.isEqualOnSide=function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)},Pe.prototype.allPositionsEqual=function(t,e){return this.elt[t].allPositionsEqual(e)},Pe.prototype.toLine=function(t){this.elt[t].isArea()&&(this.elt[t]=new Me(this.elt[t].location[0]))},Pe.prototype.interfaces_=function(){return[]},Pe.prototype.getClass=function(){return Pe},Pe.toLineLabel=function(t){for(var e=new Pe(O.NONE),n=0;n<2;n++)e.setLocation(n,t.getLocation(n));return e};var Re=function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new bt,this._pts=new bt,this._label=new Pe(O.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new bt,this._geometryFactory=null;var t=arguments[0],e=arguments[1];this._geometryFactory=e,this.computePoints(t),this.computeRing()};Re.prototype.computeRing=function(){if(null!==this._ring)return null;for(var t=new Array(this._pts.size()).fill(null),e=0;e<this._pts.size();e++)t[e]=this._pts.get(e);this._ring=this._geometryFactory.createLinearRing(t),this._isHole=at.isCCW(this._ring.getCoordinates())},Re.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},Re.prototype.computePoints=function(t){this._startDe=t;var e=t,n=!0;do{if(null===e)throw new Oe("Found null DirectedEdge");if(e.getEdgeRing()===this)throw new Oe("Directed Edge visited twice during ring-building at "+e.getCoordinate());this._edges.add(e);var r=e.getLabel();et.isTrue(r.isArea()),this.mergeLabel(r),this.addPoints(e.getEdge(),e.isForward(),n),n=!1,this.setEdgeRing(e,this),e=this.getNext(e)}while(e!==this._startDe)},Re.prototype.getLinearRing=function(){return this._ring},Re.prototype.getCoordinate=function(t){return this._pts.get(t)},Re.prototype.computeMaxNodeDegree=function(){this._maxNodeDegree=0;var t=this._startDe;do{var e=t.getNode().getEdges().getOutgoingDegree(this);e>this._maxNodeDegree&&(this._maxNodeDegree=e),t=this.getNext(t)}while(t!==this._startDe);this._maxNodeDegree*=2},Re.prototype.addPoints=function(t,e,n){var r=t.getCoordinates();if(e){var i=1;n&&(i=0);for(var o=i;o<r.length;o++)this._pts.add(r[o])}else{var s=r.length-2;n&&(s=r.length-1);for(var a=s;a>=0;a--)this._pts.add(r[a])}},Re.prototype.isHole=function(){return this._isHole},Re.prototype.setInResult=function(){var t=this._startDe;do{t.getEdge().setInResult(!0),t=t.getNext()}while(t!==this._startDe)},Re.prototype.containsPoint=function(t){var e=this.getLinearRing();if(!e.getEnvelopeInternal().contains(t))return!1;if(!at.isPointInRing(t,e.getCoordinates()))return!1;for(var n=this._holes.iterator();n.hasNext();)if(n.next().containsPoint(t))return!1;return!0},Re.prototype.addHole=function(t){this._holes.add(t)},Re.prototype.isShell=function(){return null===this._shell},Re.prototype.getLabel=function(){return this._label},Re.prototype.getEdges=function(){return this._edges},Re.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},Re.prototype.getShell=function(){return this._shell},Re.prototype.mergeLabel=function(){if(1===arguments.length){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(2===arguments.length){var e=arguments[1],n=arguments[0].getLocation(e,Ne.RIGHT);if(n===O.NONE)return null;if(this._label.getLocation(e)===O.NONE)return this._label.setLocation(e,n),null}},Re.prototype.setShell=function(t){this._shell=t,null!==t&&t.addHole(this)},Re.prototype.toPolygon=function(t){for(var e=new Array(this._holes.size()).fill(null),n=0;n<this._holes.size();n++)e[n]=this._holes.get(n).getLinearRing();return t.createPolygon(this.getLinearRing(),e)},Re.prototype.interfaces_=function(){return[]},Re.prototype.getClass=function(){return Re};var Ae=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setEdgeRing=function(t,e){t.setMinEdgeRing(e)},e.prototype.getNext=function(t){return t.getNextMin()},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Re),De=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildMinimalRings=function(){var t=new bt,e=this._startDe;do{if(null===e.getMinEdgeRing()){var n=new Ae(e,this._geometryFactory);t.add(n)}e=e.getNext()}while(e!==this._startDe);return t},e.prototype.setEdgeRing=function(t,e){t.setEdgeRing(e)},e.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var t=this._startDe;do{t.getNode().getEdges().linkMinimalDirectedEdges(this),t=t.getNext()}while(t!==this._startDe)},e.prototype.getNext=function(t){return t.getNext()},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Re),Fe=function(){if(this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._label=t}};Fe.prototype.setVisited=function(t){this._isVisited=t},Fe.prototype.setInResult=function(t){this._isInResult=t},Fe.prototype.isCovered=function(){return this._isCovered},Fe.prototype.isCoveredSet=function(){return this._isCoveredSet},Fe.prototype.setLabel=function(t){this._label=t},Fe.prototype.getLabel=function(){return this._label},Fe.prototype.setCovered=function(t){this._isCovered=t,this._isCoveredSet=!0},Fe.prototype.updateIM=function(t){et.isTrue(this._label.getGeometryCount()>=2,"found partial label"),this.computeIM(t)},Fe.prototype.isInResult=function(){return this._isInResult},Fe.prototype.isVisited=function(){return this._isVisited},Fe.prototype.interfaces_=function(){return[]},Fe.prototype.getClass=function(){return Fe};var ke=function(t){function e(){t.call(this),this._coord=null,this._edges=null;var e=arguments[0],n=arguments[1];this._coord=e,this._edges=n,this._label=new Pe(0,O.NONE)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isIncidentEdgeInResult=function(){for(var t=this.getEdges().getEdges().iterator();t.hasNext();)if(t.next().getEdge().isInResult())return!0;return!1},e.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},e.prototype.getCoordinate=function(){return this._coord},e.prototype.print=function(t){t.println("node "+this._coord+" lbl: "+this._label)},e.prototype.computeIM=function(t){},e.prototype.computeMergedLocation=function(t,e){var n=O.NONE;if(n=this._label.getLocation(e),!t.isNull(e)){var r=t.getLocation(e);n!==O.BOUNDARY&&(n=r)}return n},e.prototype.setLabel=function(){if(2!==arguments.length)return t.prototype.setLabel.apply(this,arguments);var e=arguments[0],n=arguments[1];null===this._label?this._label=new Pe(e,n):this._label.setLocation(e,n)},e.prototype.getEdges=function(){return this._edges},e.prototype.mergeLabel=function(){if(arguments[0]instanceof e){var t=arguments[0];this.mergeLabel(t._label)}else if(arguments[0]instanceof Pe)for(var n=arguments[0],r=0;r<2;r++){var i=this.computeMergedLocation(n,r);this._label.getLocation(r)===O.NONE&&this._label.setLocation(r,i)}},e.prototype.add=function(t){this._edges.insert(t),t.setNode(this)},e.prototype.setLabelBoundary=function(t){if(null===this._label)return null;var e=O.NONE;null!==this._label&&(e=this._label.getLocation(t));var n=null;switch(e){case O.BOUNDARY:n=O.INTERIOR;break;case O.INTERIOR:default:n=O.BOUNDARY}this._label.setLocation(t,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Fe),Be=function(){this.nodeMap=new h,this.nodeFact=null;var t=arguments[0];this.nodeFact=t};Be.prototype.find=function(t){return this.nodeMap.get(t)},Be.prototype.addNode=function(){if(arguments[0]instanceof w){var t=arguments[0],e=this.nodeMap.get(t);return null===e&&(e=this.nodeFact.createNode(t),this.nodeMap.put(t,e)),e}if(arguments[0]instanceof ke){var n=arguments[0],r=this.nodeMap.get(n.getCoordinate());return null===r?(this.nodeMap.put(n.getCoordinate(),n),n):(r.mergeLabel(n),r)}},Be.prototype.print=function(t){for(var e=this.iterator();e.hasNext();)e.next().print(t)},Be.prototype.iterator=function(){return this.nodeMap.values().iterator()},Be.prototype.values=function(){return this.nodeMap.values()},Be.prototype.getBoundaryNodes=function(t){for(var e=new bt,n=this.iterator();n.hasNext();){var r=n.next();r.getLabel().getLocation(t)===O.BOUNDARY&&e.add(r)}return e},Be.prototype.add=function(t){var e=t.getCoordinate();this.addNode(e).add(t)},Be.prototype.interfaces_=function(){return[]},Be.prototype.getClass=function(){return Be};var Ge=function(){},Ue={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};Ge.prototype.interfaces_=function(){return[]},Ge.prototype.getClass=function(){return Ge},Ge.isNorthern=function(t){return t===Ge.NE||t===Ge.NW},Ge.isOpposite=function(t,e){return t!==e&&2==(t-e+4)%4},Ge.commonHalfPlane=function(t,e){if(t===e)return t;if(2==(t-e+4)%4)return-1;var n=t<e?t:e;return 0===n&&3===(t>e?t:e)?3:n},Ge.isInHalfPlane=function(t,e){return e===Ge.SE?t===Ge.SE||t===Ge.SW:t===e||t===e+1},Ge.quadrant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new v("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?Ge.NE:Ge.SE:e>=0?Ge.NW:Ge.SW}if(arguments[0]instanceof w&&arguments[1]instanceof w){var n=arguments[0],r=arguments[1];if(r.x===n.x&&r.y===n.y)throw new v("Cannot compute the quadrant for two identical points "+n);return r.x>=n.x?r.y>=n.y?Ge.NE:Ge.SE:r.y>=n.y?Ge.NW:Ge.SW}},Ue.NE.get=function(){return 0},Ue.NW.get=function(){return 1},Ue.SW.get=function(){return 2},Ue.SE.get=function(){return 3},Object.defineProperties(Ge,Ue);var qe=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,1===arguments.length){var t=arguments[0];this._edge=t}else if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2];this._edge=e,this.init(n,r),this._label=null}else if(4===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this._edge=i,this.init(o,s),this._label=a}};qe.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrant<t._quadrant?-1:at.computeOrientation(t._p0,t._p1,this._p1)},qe.prototype.getDy=function(){return this._dy},qe.prototype.getCoordinate=function(){return this._p0},qe.prototype.setNode=function(t){this._node=t},qe.prototype.print=function(t){var e=Math.atan2(this._dy,this._dx),n=this.getClass().getName(),r=n.lastIndexOf("."),i=n.substring(r+1);t.print(" "+i+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+e+" "+this._label)},qe.prototype.compareTo=function(t){var e=t;return this.compareDirection(e)},qe.prototype.getDirectedCoordinate=function(){return this._p1},qe.prototype.getDx=function(){return this._dx},qe.prototype.getLabel=function(){return this._label},qe.prototype.getEdge=function(){return this._edge},qe.prototype.getQuadrant=function(){return this._quadrant},qe.prototype.getNode=function(){return this._node},qe.prototype.toString=function(){var t=Math.atan2(this._dy,this._dx),e=this.getClass().getName(),n=e.lastIndexOf(".");return" "+e.substring(n+1)+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+t+" "+this._label},qe.prototype.computeLabel=function(t){},qe.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=Ge.quadrant(this._dx,this._dy),et.isTrue(!(0===this._dx&&0===this._dy),"EdgeEnd with identical endpoints found")},qe.prototype.interfaces_=function(){return[E]},qe.prototype.getClass=function(){return qe};var je=function(t){function e(){var e=arguments[0],n=arguments[1];if(t.call(this,e),this._isForward=null,this._isInResult=!1,this._isVisited=!1,this._sym=null,this._next=null,this._nextMin=null,this._edgeRing=null,this._minEdgeRing=null,this._depth=[0,-999,-999],this._isForward=n,n)this.init(e.getCoordinate(0),e.getCoordinate(1));else{var r=e.getNumPoints()-1;this.init(e.getCoordinate(r),e.getCoordinate(r-1))}this.computeDirectedLabel()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getNextMin=function(){return this._nextMin},e.prototype.getDepth=function(t){return this._depth[t]},e.prototype.setVisited=function(t){this._isVisited=t},e.prototype.computeDirectedLabel=function(){this._label=new Pe(this._edge.getLabel()),this._isForward||this._label.flip()},e.prototype.getNext=function(){return this._next},e.prototype.setDepth=function(t,e){if(-999!==this._depth[t]&&this._depth[t]!==e)throw new Oe("assigned depths do not match",this.getCoordinate());this._depth[t]=e},e.prototype.isInteriorAreaEdge=function(){for(var t=!0,e=0;e<2;e++)this._label.isArea(e)&&this._label.getLocation(e,Ne.LEFT)===O.INTERIOR&&this._label.getLocation(e,Ne.RIGHT)===O.INTERIOR||(t=!1);return t},e.prototype.setNextMin=function(t){this._nextMin=t},e.prototype.print=function(e){t.prototype.print.call(this,e),e.print(" "+this._depth[Ne.LEFT]+"/"+this._depth[Ne.RIGHT]),e.print(" ("+this.getDepthDelta()+")"),this._isInResult&&e.print(" inResult")},e.prototype.setMinEdgeRing=function(t){this._minEdgeRing=t},e.prototype.isLineEdge=function(){var t=this._label.isLine(0)||this._label.isLine(1),e=!this._label.isArea(0)||this._label.allPositionsEqual(0,O.EXTERIOR),n=!this._label.isArea(1)||this._label.allPositionsEqual(1,O.EXTERIOR);return t&&e&&n},e.prototype.setEdgeRing=function(t){this._edgeRing=t},e.prototype.getMinEdgeRing=function(){return this._minEdgeRing},e.prototype.getDepthDelta=function(){var t=this._edge.getDepthDelta();return this._isForward||(t=-t),t},e.prototype.setInResult=function(t){this._isInResult=t},e.prototype.getSym=function(){return this._sym},e.prototype.isForward=function(){return this._isForward},e.prototype.getEdge=function(){return this._edge},e.prototype.printEdge=function(t){this.print(t),t.print(" "),this._isForward?this._edge.print(t):this._edge.printReverse(t)},e.prototype.setSym=function(t){this._sym=t},e.prototype.setVisitedEdge=function(t){this.setVisited(t),this._sym.setVisited(t)},e.prototype.setEdgeDepths=function(t,e){var n=this.getEdge().getDepthDelta();this._isForward||(n=-n);var r=1;t===Ne.LEFT&&(r=-1);var i=Ne.opposite(t),o=e+n*r;this.setDepth(t,e),this.setDepth(i,o)},e.prototype.getEdgeRing=function(){return this._edgeRing},e.prototype.isInResult=function(){return this._isInResult},e.prototype.setNext=function(t){this._next=t},e.prototype.isVisited=function(){return this._isVisited},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.depthFactor=function(t,e){return t===O.EXTERIOR&&e===O.INTERIOR?1:t===O.INTERIOR&&e===O.EXTERIOR?-1:0},e}(qe),Ve=function(){};Ve.prototype.createNode=function(t){return new ke(t,null)},Ve.prototype.interfaces_=function(){return[]},Ve.prototype.getClass=function(){return Ve};var Ye=function(){if(this._edges=new bt,this._nodes=null,this._edgeEndList=new bt,0===arguments.length)this._nodes=new Be(new Ve);else if(1===arguments.length){var t=arguments[0];this._nodes=new Be(t)}};Ye.prototype.printEdges=function(t){t.println("Edges:");for(var e=0;e<this._edges.size();e++){t.println("edge "+e+":");var n=this._edges.get(e);n.print(t),n.eiList.print(t)}},Ye.prototype.find=function(t){return this._nodes.find(t)},Ye.prototype.addNode=function(){if(arguments[0]instanceof ke){var t=arguments[0];return this._nodes.addNode(t)}if(arguments[0]instanceof w){var e=arguments[0];return this._nodes.addNode(e)}},Ye.prototype.getNodeIterator=function(){return this._nodes.iterator()},Ye.prototype.linkResultDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkResultDirectedEdges()},Ye.prototype.debugPrintln=function(t){Y.out.println(t)},Ye.prototype.isBoundaryNode=function(t,e){var n=this._nodes.find(e);if(null===n)return!1;var r=n.getLabel();return null!==r&&r.getLocation(t)===O.BOUNDARY},Ye.prototype.linkAllDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkAllDirectedEdges()},Ye.prototype.matchInSameDirection=function(t,e,n,r){return!!t.equals(n)&&at.computeOrientation(t,e,r)===at.COLLINEAR&&Ge.quadrant(t,e)===Ge.quadrant(n,r)},Ye.prototype.getEdgeEnds=function(){return this._edgeEndList},Ye.prototype.debugPrint=function(t){Y.out.print(t)},Ye.prototype.getEdgeIterator=function(){return this._edges.iterator()},Ye.prototype.findEdgeInSameDirection=function(t,e){for(var n=0;n<this._edges.size();n++){var r=this._edges.get(n),i=r.getCoordinates();if(this.matchInSameDirection(t,e,i[0],i[1]))return r;if(this.matchInSameDirection(t,e,i[i.length-1],i[i.length-2]))return r}return null},Ye.prototype.insertEdge=function(t){this._edges.add(t)},Ye.prototype.findEdgeEnd=function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var n=e.next();if(n.getEdge()===t)return n}return null},Ye.prototype.addEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this._edges.add(n);var r=new je(n,!0),i=new je(n,!1);r.setSym(i),i.setSym(r),this.add(r),this.add(i)}},Ye.prototype.add=function(t){this._nodes.add(t),this._edgeEndList.add(t)},Ye.prototype.getNodes=function(){return this._nodes.values()},Ye.prototype.findEdge=function(t,e){for(var n=0;n<this._edges.size();n++){var r=this._edges.get(n),i=r.getCoordinates();if(t.equals(i[0])&&e.equals(i[1]))return r}return null},Ye.prototype.interfaces_=function(){return[]},Ye.prototype.getClass=function(){return Ye},Ye.linkResultDirectedEdges=function(t){for(var e=t.iterator();e.hasNext();)e.next().getEdges().linkResultDirectedEdges()};var Xe=function(){this._geometryFactory=null,this._shellList=new bt;var t=arguments[0];this._geometryFactory=t};Xe.prototype.sortShellsAndHoles=function(t,e,n){for(var r=t.iterator();r.hasNext();){var i=r.next();i.isHole()?n.add(i):e.add(i)}},Xe.prototype.computePolygons=function(t){for(var e=new bt,n=t.iterator();n.hasNext();){var r=n.next().toPolygon(this._geometryFactory);e.add(r)}return e},Xe.prototype.placeFreeHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();if(null===r.getShell()){var i=this.findEdgeRingContaining(r,t);if(null===i)throw new Oe("unable to assign hole to a shell",r.getCoordinate(0));r.setShell(i)}}},Xe.prototype.buildMinimalEdgeRings=function(t,e,n){for(var r=new bt,i=t.iterator();i.hasNext();){var o=i.next();if(o.getMaxNodeDegree()>2){o.linkDirectedEdgesForMinimalEdgeRings();var s=o.buildMinimalRings(),a=this.findShell(s);null!==a?(this.placePolygonHoles(a,s),e.add(a)):n.addAll(s)}else r.add(o)}return r},Xe.prototype.containsPoint=function(t){for(var e=this._shellList.iterator();e.hasNext();)if(e.next().containsPoint(t))return!0;return!1},Xe.prototype.buildMaximalEdgeRings=function(t){for(var e=new bt,n=t.iterator();n.hasNext();){var r=n.next();if(r.isInResult()&&r.getLabel().isArea()&&null===r.getEdgeRing()){var i=new De(r,this._geometryFactory);e.add(i),i.setInResult()}}return e},Xe.prototype.placePolygonHoles=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();r.isHole()&&r.setShell(t)}},Xe.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},Xe.prototype.findEdgeRingContaining=function(t,e){for(var n=t.getLinearRing(),r=n.getEnvelopeInternal(),i=n.getCoordinateN(0),o=null,s=null,a=e.iterator();a.hasNext();){var u=a.next(),c=u.getLinearRing(),l=c.getEnvelopeInternal();null!==o&&(s=o.getLinearRing().getEnvelopeInternal());var h=!1;l.contains(r)&&at.isPointInRing(i,c.getCoordinates())&&(h=!0),h&&(null===o||s.contains(l))&&(o=u)}return o},Xe.prototype.findShell=function(t){for(var e=0,n=null,r=t.iterator();r.hasNext();){var i=r.next();i.isHole()||(n=i,e++)}return et.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),n},Xe.prototype.add=function(){if(1===arguments.length){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(2===arguments.length){var e=arguments[0],n=arguments[1];Ye.linkResultDirectedEdges(n);var r=this.buildMaximalEdgeRings(e),i=new bt,o=this.buildMinimalEdgeRings(r,this._shellList,i);this.sortShellsAndHoles(o,this._shellList,i),this.placeFreeHoles(this._shellList,i)}},Xe.prototype.interfaces_=function(){return[]},Xe.prototype.getClass=function(){return Xe};var ze=function(){};ze.prototype.getBounds=function(){},ze.prototype.interfaces_=function(){return[]},ze.prototype.getClass=function(){return ze};var We=function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e};We.prototype.getItem=function(){return this._item},We.prototype.getBounds=function(){return this._bounds},We.prototype.interfaces_=function(){return[ze,e]},We.prototype.getClass=function(){return We};var He=function(){this._size=null,this._items=null,this._size=0,this._items=new bt,this._items.add(null)};He.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},He.prototype.size=function(){return this._size},He.prototype.reorder=function(t){for(var e=null,n=this._items.get(t);2*t<=this._size&&((e=2*t)!==this._size&&this._items.get(e+1).compareTo(this._items.get(e))<0&&e++,this._items.get(e).compareTo(n)<0);t=e)this._items.set(t,this._items.get(e));this._items.set(t,n)},He.prototype.clear=function(){this._size=0,this._items.clear()},He.prototype.isEmpty=function(){return 0===this._size},He.prototype.add=function(t){this._items.add(null),this._size+=1;var e=this._size;for(this._items.set(0,t);t.compareTo(this._items.get(Math.trunc(e/2)))<0;e/=2)this._items.set(e,this._items.get(Math.trunc(e/2)));this._items.set(e,t)},He.prototype.interfaces_=function(){return[]},He.prototype.getClass=function(){return He};var Je=function(){};Je.prototype.visitItem=function(t){},Je.prototype.interfaces_=function(){return[]},Je.prototype.getClass=function(){return Je};var Ke=function(){};Ke.prototype.insert=function(t,e){},Ke.prototype.remove=function(t,e){},Ke.prototype.query=function(){},Ke.prototype.interfaces_=function(){return[]},Ke.prototype.getClass=function(){return Ke};var Qe=function(){if(this._childBoundables=new bt,this._bounds=null,this._level=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this._level=t}},$e={serialVersionUID:{configurable:!0}};Qe.prototype.getLevel=function(){return this._level},Qe.prototype.size=function(){return this._childBoundables.size()},Qe.prototype.getChildBoundables=function(){return this._childBoundables},Qe.prototype.addChildBoundable=function(t){et.isTrue(null===this._bounds),this._childBoundables.add(t)},Qe.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Qe.prototype.getBounds=function(){return null===this._bounds&&(this._bounds=this.computeBounds()),this._bounds},Qe.prototype.interfaces_=function(){return[ze,e]},Qe.prototype.getClass=function(){return Qe},$e.serialVersionUID.get=function(){return 0x5a1e55ec41369800},Object.defineProperties(Qe,$e);var Ze=function(){};Ze.reverseOrder=function(){return{compare:function(t,e){return e.compareTo(t)}}},Ze.min=function(t){return Ze.sort(t),t.get(0)},Ze.sort=function(t,e){var n=t.toArray();e?kt.sort(n,e):kt.sort(n);for(var r=t.iterator(),i=0,o=n.length;i<o;i++)r.next(),r.set(n[i])},Ze.singletonList=function(t){var e=new bt;return e.add(t),e};var tn=function(){this._boundable1=null,this._boundable2=null,this._distance=null,this._itemDistance=null;var t=arguments[0],e=arguments[1],n=arguments[2];this._boundable1=t,this._boundable2=e,this._itemDistance=n,this._distance=this.distance()};tn.prototype.expandToQueue=function(t,e){var n=tn.isComposite(this._boundable1),r=tn.isComposite(this._boundable2);if(n&&r)return tn.area(this._boundable1)>tn.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,t,e),null):(this.expand(this._boundable2,this._boundable1,t,e),null);if(n)return this.expand(this._boundable1,this._boundable2,t,e),null;if(r)return this.expand(this._boundable2,this._boundable1,t,e),null;throw new v("neither boundable is composite")},tn.prototype.isLeaves=function(){return!(tn.isComposite(this._boundable1)||tn.isComposite(this._boundable2))},tn.prototype.compareTo=function(t){var e=t;return this._distance<e._distance?-1:this._distance>e._distance?1:0},tn.prototype.expand=function(t,e,n,r){for(var i=t.getChildBoundables().iterator();i.hasNext();){var o=i.next(),s=new tn(o,e,this._itemDistance);s.getDistance()<r&&n.add(s)}},tn.prototype.getBoundable=function(t){return 0===t?this._boundable1:this._boundable2},tn.prototype.getDistance=function(){return this._distance},tn.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())},tn.prototype.interfaces_=function(){return[E]},tn.prototype.getClass=function(){return tn},tn.area=function(t){return t.getBounds().getArea()},tn.isComposite=function(t){return t instanceof Qe};var en=function t(){if(this._root=null,this._built=!1,this._itemBoundables=new bt,this._nodeCapacity=null,0===arguments.length){var e=t.DEFAULT_NODE_CAPACITY;this._nodeCapacity=e}else if(1===arguments.length){var n=arguments[0];et.isTrue(n>1,"Node capacity must be greater than 1"),this._nodeCapacity=n}},nn={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};en.prototype.getNodeCapacity=function(){return this._nodeCapacity},en.prototype.lastNode=function(t){return t.get(t.size()-1)},en.prototype.size=function(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.size(this._root));if(1===arguments.length){for(var t=0,e=arguments[0].getChildBoundables().iterator();e.hasNext();){var n=e.next();n instanceof Qe?t+=this.size(n):n instanceof We&&(t+=1)}return t}},en.prototype.removeItem=function(t,e){for(var n=null,r=t.getChildBoundables().iterator();r.hasNext();){var i=r.next();i instanceof We&&i.getItem()===e&&(n=i)}return null!==n&&(t.getChildBoundables().remove(n),!0)},en.prototype.itemsTree=function(){if(0===arguments.length){this.build();var t=this.itemsTree(this._root);return null===t?new bt:t}if(1===arguments.length){for(var e=arguments[0],n=new bt,r=e.getChildBoundables().iterator();r.hasNext();){var i=r.next();if(i instanceof Qe){var o=this.itemsTree(i);null!==o&&n.add(o)}else i instanceof We?n.add(i.getItem()):et.shouldNeverReachHere()}return n.size()<=0?null:n}},en.prototype.insert=function(t,e){et.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new We(t,e))},en.prototype.boundablesAtLevel=function(){if(1===arguments.length){var t=arguments[0],e=new bt;return this.boundablesAtLevel(t,this._root,e),e}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];if(et.isTrue(n>-2),r.getLevel()===n)return i.add(r),null;for(var o=r.getChildBoundables().iterator();o.hasNext();){var s=o.next();s instanceof Qe?this.boundablesAtLevel(n,s,i):(et.isTrue(s instanceof We),-1===n&&i.add(s))}return null}},en.prototype.query=function(){if(1===arguments.length){var t=arguments[0];this.build();var e=new bt;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.query(t,this._root,e),e}if(2===arguments.length){var n=arguments[0],r=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),n)&&this.query(n,this._root,r)}else if(3===arguments.length)if(T(arguments[2],Je)&&arguments[0]instanceof Object&&arguments[1]instanceof Qe)for(var i=arguments[0],o=arguments[2],s=arguments[1].getChildBoundables(),a=0;a<s.size();a++){var u=s.get(a);this.getIntersectsOp().intersects(u.getBounds(),i)&&(u instanceof Qe?this.query(i,u,o):u instanceof We?o.visitItem(u.getItem()):et.shouldNeverReachHere())}else if(T(arguments[2],It)&&arguments[0]instanceof Object&&arguments[1]instanceof Qe)for(var c=arguments[0],l=arguments[2],h=arguments[1].getChildBoundables(),p=0;p<h.size();p++){var f=h.get(p);this.getIntersectsOp().intersects(f.getBounds(),c)&&(f instanceof Qe?this.query(c,f,l):f instanceof We?l.add(f.getItem()):et.shouldNeverReachHere())}},en.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},en.prototype.getRoot=function(){return this.build(),this._root},en.prototype.remove=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return this.build(),!!this.getIntersectsOp().intersects(this._root.getBounds(),t)&&this.remove(t,this._root,e)}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2],o=this.removeItem(r,i);if(o)return!0;for(var s=null,a=r.getChildBoundables().iterator();a.hasNext();){var u=a.next();if(this.getIntersectsOp().intersects(u.getBounds(),n)&&u instanceof Qe&&(o=this.remove(n,u,i))){s=u;break}}return null!==s&&s.getChildBoundables().isEmpty()&&r.getChildBoundables().remove(s),o}},en.prototype.createHigherLevels=function(t,e){et.isTrue(!t.isEmpty());var n=this.createParentBoundables(t,e+1);return 1===n.size()?n.get(0):this.createHigherLevels(n,e+1)},en.prototype.depth=function(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(1===arguments.length){for(var t=0,e=arguments[0].getChildBoundables().iterator();e.hasNext();){var n=e.next();if(n instanceof Qe){var r=this.depth(n);r>t&&(t=r)}}return t+1}},en.prototype.createParentBoundables=function(t,e){et.isTrue(!t.isEmpty());var n=new bt;n.add(this.createNode(e));var r=new bt(t);Ze.sort(r,this.getComparator());for(var i=r.iterator();i.hasNext();){var o=i.next();this.lastNode(n).getChildBoundables().size()===this.getNodeCapacity()&&n.add(this.createNode(e)),this.lastNode(n).addChildBoundable(o)}return n},en.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},en.prototype.interfaces_=function(){return[e]},en.prototype.getClass=function(){return en},en.compareDoubles=function(t,e){return t>e?1:t<e?-1:0},nn.IntersectsOp.get=function(){return rn},nn.serialVersionUID.get=function(){return-0x35ef64c82d4c5400},nn.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(en,nn);var rn=function(){},on=function(){};on.prototype.distance=function(t,e){},on.prototype.interfaces_=function(){return[]},on.prototype.getClass=function(){return on};var sn=function(t){function n(e){e=e||n.DEFAULT_NODE_CAPACITY,t.call(this,e)}t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n;var r={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return n.prototype.createParentBoundablesFromVerticalSlices=function(t,e){et.isTrue(t.length>0);for(var n=new bt,r=0;r<t.length;r++)n.addAll(this.createParentBoundablesFromVerticalSlice(t[r],e));return n},n.prototype.createNode=function(t){return new an(t)},n.prototype.size=function(){return 0===arguments.length?t.prototype.size.call(this):t.prototype.size.apply(this,arguments)},n.prototype.insert=function(){if(2!==arguments.length)return t.prototype.insert.apply(this,arguments);var e=arguments[0],n=arguments[1];if(e.isNull())return null;t.prototype.insert.call(this,e,n)},n.prototype.getIntersectsOp=function(){return n.intersectsOp},n.prototype.verticalSlices=function(t,e){for(var n=Math.trunc(Math.ceil(t.size()/e)),r=new Array(e).fill(null),i=t.iterator(),o=0;o<e;o++){r[o]=new bt;for(var s=0;i.hasNext()&&s<n;){var a=i.next();r[o].add(a),s++}}return r},n.prototype.query=function(){if(1===arguments.length){var e=arguments[0];return t.prototype.query.call(this,e)}if(2===arguments.length){var n=arguments[0],r=arguments[1];t.prototype.query.call(this,n,r)}else if(3===arguments.length)if(T(arguments[2],Je)&&arguments[0]instanceof Object&&arguments[1]instanceof Qe){var i=arguments[0],o=arguments[1],s=arguments[2];t.prototype.query.call(this,i,o,s)}else if(T(arguments[2],It)&&arguments[0]instanceof Object&&arguments[1]instanceof Qe){var a=arguments[0],u=arguments[1],c=arguments[2];t.prototype.query.call(this,a,u,c)}},n.prototype.getComparator=function(){return n.yComparator},n.prototype.createParentBoundablesFromVerticalSlice=function(e,n){return t.prototype.createParentBoundables.call(this,e,n)},n.prototype.remove=function(){if(2===arguments.length){var e=arguments[0],n=arguments[1];return t.prototype.remove.call(this,e,n)}return t.prototype.remove.apply(this,arguments)},n.prototype.depth=function(){return 0===arguments.length?t.prototype.depth.call(this):t.prototype.depth.apply(this,arguments)},n.prototype.createParentBoundables=function(t,e){et.isTrue(!t.isEmpty());var r=Math.trunc(Math.ceil(t.size()/this.getNodeCapacity())),i=new bt(t);Ze.sort(i,n.xComparator);var o=this.verticalSlices(i,Math.trunc(Math.ceil(Math.sqrt(r))));return this.createParentBoundablesFromVerticalSlices(o,e)},n.prototype.nearestNeighbour=function(){if(1===arguments.length){if(T(arguments[0],on)){var t=arguments[0],e=new tn(this.getRoot(),this.getRoot(),t);return this.nearestNeighbour(e)}if(arguments[0]instanceof tn){var r=arguments[0];return this.nearestNeighbour(r,m.POSITIVE_INFINITY)}}else if(2===arguments.length){if(arguments[0]instanceof n&&T(arguments[1],on)){var i=arguments[0],o=arguments[1],s=new tn(this.getRoot(),i.getRoot(),o);return this.nearestNeighbour(s)}if(arguments[0]instanceof tn&&"number"==typeof arguments[1]){var a=arguments[0],u=arguments[1],c=null,l=new He;for(l.add(a);!l.isEmpty()&&u>0;){var h=l.poll(),p=h.getDistance();if(p>=u)break;h.isLeaves()?(u=p,c=h):h.expandToQueue(l,u)}return[c.getBoundable(0).getItem(),c.getBoundable(1).getItem()]}}else if(3===arguments.length){var f=arguments[2],g=new We(arguments[0],arguments[1]),d=new tn(this.getRoot(),g,f);return this.nearestNeighbour(d)[0]}},n.prototype.interfaces_=function(){return[Ke,e]},n.prototype.getClass=function(){return n},n.centreX=function(t){return n.avg(t.getMinX(),t.getMaxX())},n.avg=function(t,e){return(t+e)/2},n.centreY=function(t){return n.avg(t.getMinY(),t.getMaxY())},r.STRtreeNode.get=function(){return an},r.serialVersionUID.get=function(){return 0x39920f7d5f261e0},r.xComparator.get=function(){return{interfaces_:function(){return[b]},compare:function(e,r){return t.compareDoubles(n.centreX(e.getBounds()),n.centreX(r.getBounds()))}}},r.yComparator.get=function(){return{interfaces_:function(){return[b]},compare:function(e,r){return t.compareDoubles(n.centreY(e.getBounds()),n.centreY(r.getBounds()))}}},r.intersectsOp.get=function(){return{interfaces_:function(){return[t.IntersectsOp]},intersects:function(t,e){return t.intersects(e)}}},r.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(n,r),n}(en),an=function(t){function e(){var e=arguments[0];t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.computeBounds=function(){for(var t=null,e=this.getChildBoundables().iterator();e.hasNext();){var n=e.next();null===t?t=new z(n.getBounds()):t.expandToInclude(n.getBounds())}return t},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Qe),un=function(){};un.prototype.interfaces_=function(){return[]},un.prototype.getClass=function(){return un},un.relativeSign=function(t,e){return t<e?-1:t>e?1:0},un.compare=function(t,e,n){if(e.equals2D(n))return 0;var r=un.relativeSign(e.x,n.x),i=un.relativeSign(e.y,n.y);switch(t){case 0:return un.compareValue(r,i);case 1:return un.compareValue(i,r);case 2:return un.compareValue(i,-r);case 3:return un.compareValue(-r,i);case 4:return un.compareValue(-r,-i);case 5:return un.compareValue(-i,-r);case 6:return un.compareValue(-i,r);case 7:return un.compareValue(r,-i)}return et.shouldNeverReachHere("invalid octant value"),0},un.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0};var cn=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this._segString=t,this.coord=new w(e),this.segmentIndex=n,this._segmentOctant=r,this._isInterior=!e.equals2D(t.getCoordinate(n))};cn.prototype.getCoordinate=function(){return this.coord},cn.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},cn.prototype.compareTo=function(t){var e=t;return this.segmentIndex<e.segmentIndex?-1:this.segmentIndex>e.segmentIndex?1:this.coord.equals2D(e.coord)?0:un.compare(this._segmentOctant,this.coord,e.coord)},cn.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===t},cn.prototype.isInterior=function(){return this._isInterior},cn.prototype.interfaces_=function(){return[E]},cn.prototype.getClass=function(){return cn};var ln=function(){this._nodeMap=new h,this._edge=null;var t=arguments[0];this._edge=t};ln.prototype.getSplitCoordinates=function(){var t=new Nt;this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next();this.addEdgeCoordinates(n,r,t),n=r}return t.toCoordinateArray()},ln.prototype.addCollapsedNodes=function(){var t=new bt;this.findCollapsesFromInsertedNodes(t),this.findCollapsesFromExistingVertices(t);for(var e=t.iterator();e.hasNext();){var n=e.next().intValue();this.add(this._edge.getCoordinate(n),n)}},ln.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},ln.prototype.findCollapsesFromExistingVertices=function(t){for(var e=0;e<this._edge.size()-2;e++){var n=this._edge.getCoordinate(e),r=this._edge.getCoordinate(e+2);n.equals2D(r)&&t.add(new A(e+1))}},ln.prototype.addEdgeCoordinates=function(t,e,n){var r=this._edge.getCoordinate(e.segmentIndex),i=e.isInterior()||!e.coord.equals2D(r);n.add(new w(t.coord),!1);for(var o=t.segmentIndex+1;o<=e.segmentIndex;o++)n.add(this._edge.getCoordinate(o));i&&n.add(new w(e.coord))},ln.prototype.iterator=function(){return this._nodeMap.values().iterator()},ln.prototype.addSplitEdges=function(t){this.addEndpoints(),this.addCollapsedNodes();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next(),i=this.createSplitEdge(n,r);t.add(i),n=r}},ln.prototype.findCollapseIndex=function(t,e,n){if(!t.coord.equals2D(e.coord))return!1;var r=e.segmentIndex-t.segmentIndex;return e.isInterior()||r--,1===r&&(n[0]=t.segmentIndex+1,!0)},ln.prototype.findCollapsesFromInsertedNodes=function(t){for(var e=new Array(1).fill(null),n=this.iterator(),r=n.next();n.hasNext();){var i=n.next();this.findCollapseIndex(r,i,e)&&t.add(new A(e[0])),r=i}},ln.prototype.getEdge=function(){return this._edge},ln.prototype.addEndpoints=function(){var t=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(t),t)},ln.prototype.createSplitEdge=function(t,e){var n=e.segmentIndex-t.segmentIndex+2,r=this._edge.getCoordinate(e.segmentIndex),i=e.isInterior()||!e.coord.equals2D(r);i||n--;var o=new Array(n).fill(null),s=0;o[s++]=new w(t.coord);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)o[s++]=this._edge.getCoordinate(a);return i&&(o[s]=new w(e.coord)),new gn(o,this._edge.getData())},ln.prototype.add=function(t,e){var n=new cn(this._edge,t,e,this._edge.getSegmentOctant(e)),r=this._nodeMap.get(n);return null!==r?(et.isTrue(r.coord.equals2D(t),"Found equal nodes with different coordinates"),r):(this._nodeMap.put(n,n),n)},ln.prototype.checkSplitEdgesCorrectness=function(t){var e=this._edge.getCoordinates(),n=t.get(0).getCoordinate(0);if(!n.equals2D(e[0]))throw new Z("bad split edge start point at "+n);var r=t.get(t.size()-1).getCoordinates(),i=r[r.length-1];if(!i.equals2D(e[e.length-1]))throw new Z("bad split edge end point at "+i)},ln.prototype.interfaces_=function(){return[]},ln.prototype.getClass=function(){return ln};var hn=function(){};hn.prototype.interfaces_=function(){return[]},hn.prototype.getClass=function(){return hn},hn.octant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new v("Cannot compute the octant for point ( "+t+", "+e+" )");var n=Math.abs(t),r=Math.abs(e);return t>=0?e>=0?n>=r?0:1:n>=r?7:6:e>=0?n>=r?3:2:n>=r?4:5}if(arguments[0]instanceof w&&arguments[1]instanceof w){var i=arguments[0],o=arguments[1],s=o.x-i.x,a=o.y-i.y;if(0===s&&0===a)throw new v("Cannot compute the octant for two identical points "+i);return hn.octant(s,a)}};var pn=function(){};pn.prototype.getCoordinates=function(){},pn.prototype.size=function(){},pn.prototype.getCoordinate=function(t){},pn.prototype.isClosed=function(){},pn.prototype.setData=function(t){},pn.prototype.getData=function(){},pn.prototype.interfaces_=function(){return[]},pn.prototype.getClass=function(){return pn};var fn=function(){};fn.prototype.addIntersection=function(t,e){},fn.prototype.interfaces_=function(){return[pn]},fn.prototype.getClass=function(){return fn};var gn=function(){this._nodeList=new ln(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};gn.prototype.getCoordinates=function(){return this._pts},gn.prototype.size=function(){return this._pts.length},gn.prototype.getCoordinate=function(t){return this._pts[t]},gn.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},gn.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},gn.prototype.setData=function(t){this._data=t},gn.prototype.safeOctant=function(t,e){return t.equals2D(e)?0:hn.octant(t,e)},gn.prototype.getData=function(){return this._data},gn.prototype.addIntersection=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(4===arguments.length){var n=arguments[1],r=arguments[3],i=new w(arguments[0].getIntersection(r));this.addIntersection(i,n)}},gn.prototype.toString=function(){return $.toLineString(new ue(this._pts))},gn.prototype.getNodeList=function(){return this._nodeList},gn.prototype.addIntersectionNode=function(t,e){var n=e,r=n+1;if(r<this._pts.length){var i=this._pts[r];t.equals2D(i)&&(n=r)}return this._nodeList.add(t,n)},gn.prototype.addIntersections=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++)this.addIntersection(t,e,n,r)},gn.prototype.interfaces_=function(){return[fn]},gn.prototype.getClass=function(){return gn},gn.getNodedSubstrings=function(){if(1===arguments.length){var t=arguments[0],e=new bt;return gn.getNodedSubstrings(t,e),e}if(2===arguments.length)for(var n=arguments[1],r=arguments[0].iterator();r.hasNext();)r.next().getNodeList().addSplitEdges(n)};var dn=function(){if(this.p0=null,this.p1=null,0===arguments.length)this.p0=new w,this.p1=new w;else if(1===arguments.length){var t=arguments[0];this.p0=new w(t.p0),this.p1=new w(t.p1)}else if(2===arguments.length)this.p0=arguments[0],this.p1=arguments[1];else if(4===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2],i=arguments[3];this.p0=new w(e,n),this.p1=new w(r,i)}},yn={serialVersionUID:{configurable:!0}};dn.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)},dn.prototype.orientationIndex=function(){if(arguments[0]instanceof dn){var t=arguments[0],e=at.orientationIndex(this.p0,this.p1,t.p0),n=at.orientationIndex(this.p0,this.p1,t.p1);return e>=0&&n>=0||e<=0&&n<=0?Math.max(e,n):0}if(arguments[0]instanceof w){var r=arguments[0];return at.orientationIndex(this.p0,this.p1,r)}},dn.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},dn.prototype.isVertical=function(){return this.p0.x===this.p1.x},dn.prototype.equals=function(t){if(!(t instanceof dn))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},dn.prototype.intersection=function(t){var e=new it;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},dn.prototype.project=function(){if(arguments[0]instanceof w){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new w(t);var e=this.projectionFactor(t),n=new w;return n.x=this.p0.x+e*(this.p1.x-this.p0.x),n.y=this.p0.y+e*(this.p1.y-this.p0.y),n}if(arguments[0]instanceof dn){var r=arguments[0],i=this.projectionFactor(r.p0),o=this.projectionFactor(r.p1);if(i>=1&&o>=1)return null;if(i<=0&&o<=0)return null;var s=this.project(r.p0);i<0&&(s=this.p0),i>1&&(s=this.p1);var a=this.project(r.p1);return o<0&&(a=this.p0),o>1&&(a=this.p1),new dn(s,a)}},dn.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},dn.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},dn.prototype.getCoordinate=function(t){return 0===t?this.p0:this.p1},dn.prototype.distancePerpendicular=function(t){return at.distancePointLinePerpendicular(t,this.p0,this.p1)},dn.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},dn.prototype.midPoint=function(){return dn.midPoint(this.p0,this.p1)},dn.prototype.projectionFactor=function(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var e=this.p1.x-this.p0.x,n=this.p1.y-this.p0.y,r=e*e+n*n;return r<=0?m.NaN:((t.x-this.p0.x)*e+(t.y-this.p0.y)*n)/r},dn.prototype.closestPoints=function(t){var e=this.intersection(t);if(null!==e)return[e,e];var n=new Array(2).fill(null),r=m.MAX_VALUE,i=null,o=this.closestPoint(t.p0);r=o.distance(t.p0),n[0]=o,n[1]=t.p0;var s=this.closestPoint(t.p1);(i=s.distance(t.p1))<r&&(r=i,n[0]=s,n[1]=t.p1);var a=t.closestPoint(this.p0);(i=a.distance(this.p0))<r&&(r=i,n[0]=this.p0,n[1]=a);var u=t.closestPoint(this.p1);return(i=u.distance(this.p1))<r&&(r=i,n[0]=this.p1,n[1]=u),n},dn.prototype.closestPoint=function(t){var e=this.projectionFactor(t);return e>0&&e<1?this.project(t):this.p0.distance(t)<this.p1.distance(t)?this.p0:this.p1},dn.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)},dn.prototype.getLength=function(){return this.p0.distance(this.p1)},dn.prototype.compareTo=function(t){var e=t,n=this.p0.compareTo(e.p0);return 0!==n?n:this.p1.compareTo(e.p1)},dn.prototype.reverse=function(){var t=this.p0;this.p0=this.p1,this.p1=t},dn.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)},dn.prototype.lineIntersection=function(t){try{return X.intersection(this.p0,this.p1,t.p0,t.p1)}catch(t){if(!(t instanceof V))throw t}return null},dn.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)},dn.prototype.pointAlongOffset=function(t,e){var n=this.p0.x+t*(this.p1.x-this.p0.x),r=this.p0.y+t*(this.p1.y-this.p0.y),i=this.p1.x-this.p0.x,o=this.p1.y-this.p0.y,s=Math.sqrt(i*i+o*o),a=0,u=0;if(0!==e){if(s<=0)throw new Error("Cannot compute offset from zero-length line segment");a=e*i/s,u=e*o/s}return new w(n-u,r+a)},dn.prototype.setCoordinates=function(){if(1===arguments.length){var t=arguments[0];this.setCoordinates(t.p0,t.p1)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.p0.x=e.x,this.p0.y=e.y,this.p1.x=n.x,this.p1.y=n.y}},dn.prototype.segmentFraction=function(t){var e=this.projectionFactor(t);return e<0?e=0:(e>1||m.isNaN(e))&&(e=1),e},dn.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},dn.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},dn.prototype.distance=function(){if(arguments[0]instanceof dn){var t=arguments[0];return at.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}if(arguments[0]instanceof w){var e=arguments[0];return at.distancePointLine(e,this.p0,this.p1)}},dn.prototype.pointAlong=function(t){var e=new w;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},dn.prototype.hashCode=function(){var t=m.doubleToLongBits(this.p0.x);t^=31*m.doubleToLongBits(this.p0.y);var e=Math.trunc(t)^Math.trunc(t>>32),n=m.doubleToLongBits(this.p1.x);return n^=31*m.doubleToLongBits(this.p1.y),e^Math.trunc(n)^Math.trunc(n>>32)},dn.prototype.interfaces_=function(){return[E,e]},dn.prototype.getClass=function(){return dn},dn.midPoint=function(t,e){return new w((t.x+e.x)/2,(t.y+e.y)/2)},yn.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(dn,yn);var _n=function(){this.tempEnv1=new z,this.tempEnv2=new z,this._overlapSeg1=new dn,this._overlapSeg2=new dn};_n.prototype.overlap=function(){if(2===arguments.length);else if(4===arguments.length){var t=arguments[1],e=arguments[2],n=arguments[3];arguments[0].getLineSegment(t,this._overlapSeg1),e.getLineSegment(n,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}},_n.prototype.interfaces_=function(){return[]},_n.prototype.getClass=function(){return _n};var vn=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this._pts=t,this._start=e,this._end=n,this._context=r};vn.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},vn.prototype.computeSelect=function(t,e,n,r){var i=this._pts[e],o=this._pts[n];if(r.tempEnv1.init(i,o),n-e==1)return r.select(this,e),null;if(!t.intersects(r.tempEnv1))return null;var s=Math.trunc((e+n)/2);e<s&&this.computeSelect(t,e,s,r),s<n&&this.computeSelect(t,s,n,r)},vn.prototype.getCoordinates=function(){for(var t=new Array(this._end-this._start+1).fill(null),e=0,n=this._start;n<=this._end;n++)t[e++]=this._pts[n];return t},vn.prototype.computeOverlaps=function(t,e){this.computeOverlapsInternal(this._start,this._end,t,t._start,t._end,e)},vn.prototype.setId=function(t){this._id=t},vn.prototype.select=function(t,e){this.computeSelect(t,this._start,this._end,e)},vn.prototype.getEnvelope=function(){if(null===this._env){var t=this._pts[this._start],e=this._pts[this._end];this._env=new z(t,e)}return this._env},vn.prototype.getEndIndex=function(){return this._end},vn.prototype.getStartIndex=function(){return this._start},vn.prototype.getContext=function(){return this._context},vn.prototype.getId=function(){return this._id},vn.prototype.computeOverlapsInternal=function(t,e,n,r,i,o){var s=this._pts[t],a=this._pts[e],u=n._pts[r],c=n._pts[i];if(e-t==1&&i-r==1)return o.overlap(this,t,n,r),null;if(o.tempEnv1.init(s,a),o.tempEnv2.init(u,c),!o.tempEnv1.intersects(o.tempEnv2))return null;var l=Math.trunc((t+e)/2),h=Math.trunc((r+i)/2);t<l&&(r<h&&this.computeOverlapsInternal(t,l,n,r,h,o),h<i&&this.computeOverlapsInternal(t,l,n,h,i,o)),l<e&&(r<h&&this.computeOverlapsInternal(l,e,n,r,h,o),h<i&&this.computeOverlapsInternal(l,e,n,h,i,o))},vn.prototype.interfaces_=function(){return[]},vn.prototype.getClass=function(){return vn};var mn=function(){};mn.prototype.interfaces_=function(){return[]},mn.prototype.getClass=function(){return mn},mn.getChainStartIndices=function(t){var e=0,n=new bt;n.add(new A(e));do{var r=mn.findChainEnd(t,e);n.add(new A(r)),e=r}while(e<t.length-1);return mn.toIntArray(n)},mn.findChainEnd=function(t,e){for(var n=e;n<t.length-1&&t[n].equals2D(t[n+1]);)n++;if(n>=t.length-1)return t.length-1;for(var r=Ge.quadrant(t[n],t[n+1]),i=e+1;i<t.length&&(t[i-1].equals2D(t[i])||Ge.quadrant(t[i-1],t[i])===r);)i++;return i-1},mn.getChains=function(){if(1===arguments.length){var t=arguments[0];return mn.getChains(t,null)}if(2===arguments.length){for(var e=arguments[0],n=arguments[1],r=new bt,i=mn.getChainStartIndices(e),o=0;o<i.length-1;o++){var s=new vn(e,i[o],i[o+1],n);r.add(s)}return r}},mn.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e};var xn=function(){};xn.prototype.computeNodes=function(t){},xn.prototype.getNodedSubstrings=function(){},xn.prototype.interfaces_=function(){return[]},xn.prototype.getClass=function(){return xn};var En=function(){if(this._segInt=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.setSegmentIntersector(t)}};En.prototype.setSegmentIntersector=function(t){this._segInt=t},En.prototype.interfaces_=function(){return[xn]},En.prototype.getClass=function(){return En};var In=function(t){function e(e){e?t.call(this,e):t.call(this),this._monoChains=new bt,this._index=new sn,this._idCounter=0,this._nodedSegStrings=null,this._nOverlaps=0}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={SegmentOverlapAction:{configurable:!0}};return e.prototype.getMonotoneChains=function(){return this._monoChains},e.prototype.getNodedSubstrings=function(){return gn.getNodedSubstrings(this._nodedSegStrings)},e.prototype.getIndex=function(){return this._index},e.prototype.add=function(t){for(var e=mn.getChains(t.getCoordinates(),t).iterator();e.hasNext();){var n=e.next();n.setId(this._idCounter++),this._index.insert(n.getEnvelope(),n),this._monoChains.add(n)}},e.prototype.computeNodes=function(t){this._nodedSegStrings=t;for(var e=t.iterator();e.hasNext();)this.add(e.next());this.intersectChains()},e.prototype.intersectChains=function(){for(var t=new bn(this._segInt),e=this._monoChains.iterator();e.hasNext();)for(var n=e.next(),r=this._index.query(n.getEnvelope()).iterator();r.hasNext();){var i=r.next();if(i.getId()>n.getId()&&(n.computeOverlaps(i,t),this._nOverlaps++),this._segInt.isDone())return null}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.SegmentOverlapAction.get=function(){return bn},Object.defineProperties(e,n),e}(En),bn=function(t){function e(){t.call(this),this._si=null;var e=arguments[0];this._si=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.overlap=function(){if(4!==arguments.length)return t.prototype.overlap.apply(this,arguments);var e=arguments[1],n=arguments[2],r=arguments[3],i=arguments[0].getContext(),o=n.getContext();this._si.processIntersections(i,e,o,r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(_n),wn=function t(){if(this._quadrantSegments=t.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=t.CAP_ROUND,this._joinStyle=t.JOIN_ROUND,this._mitreLimit=t.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=t.DEFAULT_SIMPLIFY_FACTOR,0===arguments.length);else if(1===arguments.length){var e=arguments[0];this.setQuadrantSegments(e)}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.setQuadrantSegments(n),this.setEndCapStyle(r)}else if(4===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(o),this.setJoinStyle(s),this.setMitreLimit(a)}},Nn={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}};wn.prototype.getEndCapStyle=function(){return this._endCapStyle},wn.prototype.isSingleSided=function(){return this._isSingleSided},wn.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,0===this._quadrantSegments&&(this._joinStyle=wn.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=wn.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==wn.JOIN_ROUND&&(this._quadrantSegments=wn.DEFAULT_QUADRANT_SEGMENTS)},wn.prototype.getJoinStyle=function(){return this._joinStyle},wn.prototype.setJoinStyle=function(t){this._joinStyle=t},wn.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},wn.prototype.getSimplifyFactor=function(){return this._simplifyFactor},wn.prototype.getQuadrantSegments=function(){return this._quadrantSegments},wn.prototype.setEndCapStyle=function(t){this._endCapStyle=t},wn.prototype.getMitreLimit=function(){return this._mitreLimit},wn.prototype.setMitreLimit=function(t){this._mitreLimit=t},wn.prototype.setSingleSided=function(t){this._isSingleSided=t},wn.prototype.interfaces_=function(){return[]},wn.prototype.getClass=function(){return wn},wn.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},Nn.CAP_ROUND.get=function(){return 1},Nn.CAP_FLAT.get=function(){return 2},Nn.CAP_SQUARE.get=function(){return 3},Nn.JOIN_ROUND.get=function(){return 1},Nn.JOIN_MITRE.get=function(){return 2},Nn.JOIN_BEVEL.get=function(){return 3},Nn.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},Nn.DEFAULT_MITRE_LIMIT.get=function(){return 5},Nn.DEFAULT_SIMPLIFY_FACTOR.get=function(){return.01},Object.defineProperties(wn,Nn);var Sn=function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=at.COUNTERCLOCKWISE,this._inputLine=t||null},Cn={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};Sn.prototype.isDeletable=function(t,e,n,r){var i=this._inputLine[t],o=this._inputLine[e],s=this._inputLine[n];return!!this.isConcave(i,o,s)&&!!this.isShallow(i,o,s,r)&&this.isShallowSampled(i,o,t,n,r)},Sn.prototype.deleteShallowConcavities=function(){for(var t=1,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e),r=!1;n<this._inputLine.length;){var i=!1;this.isDeletable(t,e,n,this._distanceTol)&&(this._isDeleted[e]=Sn.DELETE,i=!0,r=!0),t=i?n:e,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e)}return r},Sn.prototype.isShallowConcavity=function(t,e,n,r){return at.computeOrientation(t,e,n)===this._angleOrientation&&at.distancePointLine(e,t,n)<r},Sn.prototype.isShallowSampled=function(t,e,n,r,i){var o=Math.trunc((r-n)/Sn.NUM_PTS_TO_CHECK);o<=0&&(o=1);for(var s=n;s<r;s+=o)if(!this.isShallow(t,e,this._inputLine[s],i))return!1;return!0},Sn.prototype.isConcave=function(t,e,n){return at.computeOrientation(t,e,n)===this._angleOrientation},Sn.prototype.simplify=function(t){this._distanceTol=Math.abs(t),t<0&&(this._angleOrientation=at.CLOCKWISE),this._isDeleted=new Array(this._inputLine.length).fill(null);var e=!1;do{e=this.deleteShallowConcavities()}while(e);return this.collapseLine()},Sn.prototype.findNextNonDeletedIndex=function(t){for(var e=t+1;e<this._inputLine.length&&this._isDeleted[e]===Sn.DELETE;)e++;return e},Sn.prototype.isShallow=function(t,e,n,r){return at.distancePointLine(e,t,n)<r},Sn.prototype.collapseLine=function(){for(var t=new Nt,e=0;e<this._inputLine.length;e++)this._isDeleted[e]!==Sn.DELETE&&t.add(this._inputLine[e]);return t.toCoordinateArray()},Sn.prototype.interfaces_=function(){return[]},Sn.prototype.getClass=function(){return Sn},Sn.simplify=function(t,e){return new Sn(t).simplify(e)},Cn.INIT.get=function(){return 0},Cn.DELETE.get=function(){return 1},Cn.KEEP.get=function(){return 1},Cn.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(Sn,Cn);var On=function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new bt},Ln={COORDINATE_ARRAY_TYPE:{configurable:!0}};On.prototype.getCoordinates=function(){return this._ptList.toArray(On.COORDINATE_ARRAY_TYPE)},On.prototype.setPrecisionModel=function(t){this._precisionModel=t},On.prototype.addPt=function(t){var e=new w(t);if(this._precisionModel.makePrecise(e),this.isRedundant(e))return null;this._ptList.add(e)},On.prototype.revere=function(){},On.prototype.addPts=function(t,e){if(e)for(var n=0;n<t.length;n++)this.addPt(t[n]);else for(var r=t.length-1;r>=0;r--)this.addPt(t[r])},On.prototype.isRedundant=function(t){if(this._ptList.size()<1)return!1;var e=this._ptList.get(this._ptList.size()-1);return t.distance(e)<this._minimimVertexDistance},On.prototype.toString=function(){return(new _e).createLineString(this.getCoordinates()).toString()},On.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var t=new w(this._ptList.get(0)),e=this._ptList.get(this._ptList.size()-1);if(t.equals(e))return null;this._ptList.add(t)},On.prototype.setMinimumVertexDistance=function(t){this._minimimVertexDistance=t},On.prototype.interfaces_=function(){return[]},On.prototype.getClass=function(){return On},Ln.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(On,Ln);var Tn=function(){},Mn={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};Tn.prototype.interfaces_=function(){return[]},Tn.prototype.getClass=function(){return Tn},Tn.toDegrees=function(t){return 180*t/Math.PI},Tn.normalize=function(t){for(;t>Math.PI;)t-=Tn.PI_TIMES_2;for(;t<=-Math.PI;)t+=Tn.PI_TIMES_2;return t},Tn.angle=function(){if(1===arguments.length){var t=arguments[0];return Math.atan2(t.y,t.x)}if(2===arguments.length){var e=arguments[0],n=arguments[1],r=n.x-e.x,i=n.y-e.y;return Math.atan2(i,r)}},Tn.isAcute=function(t,e,n){var r=t.x-e.x,i=t.y-e.y;return r*(n.x-e.x)+i*(n.y-e.y)>0},Tn.isObtuse=function(t,e,n){var r=t.x-e.x,i=t.y-e.y;return r*(n.x-e.x)+i*(n.y-e.y)<0},Tn.interiorAngle=function(t,e,n){var r=Tn.angle(e,t),i=Tn.angle(e,n);return Math.abs(i-r)},Tn.normalizePositive=function(t){if(t<0){for(;t<0;)t+=Tn.PI_TIMES_2;t>=Tn.PI_TIMES_2&&(t=0)}else{for(;t>=Tn.PI_TIMES_2;)t-=Tn.PI_TIMES_2;t<0&&(t=0)}return t},Tn.angleBetween=function(t,e,n){var r=Tn.angle(e,t),i=Tn.angle(e,n);return Tn.diff(r,i)},Tn.diff=function(t,e){var n=null;return(n=t<e?e-t:t-e)>Math.PI&&(n=2*Math.PI-n),n},Tn.toRadians=function(t){return t*Math.PI/180},Tn.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?Tn.COUNTERCLOCKWISE:n<0?Tn.CLOCKWISE:Tn.NONE},Tn.angleBetweenOriented=function(t,e,n){var r=Tn.angle(e,t),i=Tn.angle(e,n)-r;return i<=-Math.PI?i+Tn.PI_TIMES_2:i>Math.PI?i-Tn.PI_TIMES_2:i},Mn.PI_TIMES_2.get=function(){return 2*Math.PI},Mn.PI_OVER_2.get=function(){return Math.PI/2},Mn.PI_OVER_4.get=function(){return Math.PI/4},Mn.COUNTERCLOCKWISE.get=function(){return at.COUNTERCLOCKWISE},Mn.CLOCKWISE.get=function(){return at.CLOCKWISE},Mn.NONE.get=function(){return at.COLLINEAR},Object.defineProperties(Tn,Mn);var Pn=function t(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new dn,this._seg1=new dn,this._offset0=new dn,this._offset1=new dn,this._side=0,this._hasNarrowConcaveAngle=!1;var e=arguments[0],n=arguments[1],r=arguments[2];this._precisionModel=e,this._bufParams=n,this._li=new it,this._filletAngleQuantum=Math.PI/2/n.getQuadrantSegments(),n.getQuadrantSegments()>=8&&n.getJoinStyle()===wn.JOIN_ROUND&&(this._closingSegLengthFactor=t.MAX_CLOSING_SEG_LEN_FACTOR),this.init(r)},Rn={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}};Pn.prototype.addNextSegment=function(t,e){if(this._s0=this._s1,this._s1=this._s2,this._s2=t,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var n=at.computeOrientation(this._s0,this._s1,this._s2),r=n===at.CLOCKWISE&&this._side===Ne.LEFT||n===at.COUNTERCLOCKWISE&&this._side===Ne.RIGHT;0===n?this.addCollinear(e):r?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)},Pn.prototype.addLineEndCap=function(t,e){var n=new dn(t,e),r=new dn;this.computeOffsetSegment(n,Ne.LEFT,this._distance,r);var i=new dn;this.computeOffsetSegment(n,Ne.RIGHT,this._distance,i);var o=e.x-t.x,s=e.y-t.y,a=Math.atan2(s,o);switch(this._bufParams.getEndCapStyle()){case wn.CAP_ROUND:this._segList.addPt(r.p1),this.addFilletArc(e,a+Math.PI/2,a-Math.PI/2,at.CLOCKWISE,this._distance),this._segList.addPt(i.p1);break;case wn.CAP_FLAT:this._segList.addPt(r.p1),this._segList.addPt(i.p1);break;case wn.CAP_SQUARE:var u=new w;u.x=Math.abs(this._distance)*Math.cos(a),u.y=Math.abs(this._distance)*Math.sin(a);var c=new w(r.p1.x+u.x,r.p1.y+u.y),l=new w(i.p1.x+u.x,i.p1.y+u.y);this._segList.addPt(c),this._segList.addPt(l)}},Pn.prototype.getCoordinates=function(){return this._segList.getCoordinates()},Pn.prototype.addMitreJoin=function(t,e,n,r){var i=!0,o=null;try{o=X.intersection(e.p0,e.p1,n.p0,n.p1),(r<=0?1:o.distance(t)/Math.abs(r))>this._bufParams.getMitreLimit()&&(i=!1)}catch(t){if(!(t instanceof V))throw t;o=new w(0,0),i=!1}i?this._segList.addPt(o):this.addLimitedMitreJoin(e,n,r,this._bufParams.getMitreLimit())},Pn.prototype.addFilletCorner=function(t,e,n,r,i){var o=e.x-t.x,s=e.y-t.y,a=Math.atan2(s,o),u=n.x-t.x,c=n.y-t.y,l=Math.atan2(c,u);r===at.CLOCKWISE?a<=l&&(a+=2*Math.PI):a>=l&&(a-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,a,l,r,i),this._segList.addPt(n)},Pn.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*Pn.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===wn.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===wn.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))},Pn.prototype.createSquare=function(t){this._segList.addPt(new w(t.x+this._distance,t.y+this._distance)),this._segList.addPt(new w(t.x+this._distance,t.y-this._distance)),this._segList.addPt(new w(t.x-this._distance,t.y-this._distance)),this._segList.addPt(new w(t.x-this._distance,t.y+this._distance)),this._segList.closeRing()},Pn.prototype.addSegments=function(t,e){this._segList.addPts(t,e)},Pn.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},Pn.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},Pn.prototype.initSideSegments=function(t,e,n){this._s1=t,this._s2=e,this._side=n,this._seg1.setCoordinates(t,e),this.computeOffsetSegment(this._seg1,n,this._distance,this._offset1)},Pn.prototype.addLimitedMitreJoin=function(t,e,n,r){var i=this._seg0.p1,o=Tn.angle(i,this._seg0.p0),s=Tn.angleBetweenOriented(this._seg0.p0,i,this._seg1.p1)/2,a=Tn.normalize(o+s),u=Tn.normalize(a+Math.PI),c=r*n,l=n-c*Math.abs(Math.sin(s)),h=i.x+c*Math.cos(u),p=i.y+c*Math.sin(u),f=new w(h,p),g=new dn(i,f),d=g.pointAlongOffset(1,l),y=g.pointAlongOffset(1,-l);this._side===Ne.LEFT?(this._segList.addPt(d),this._segList.addPt(y)):(this._segList.addPt(y),this._segList.addPt(d))},Pn.prototype.computeOffsetSegment=function(t,e,n,r){var i=e===Ne.LEFT?1:-1,o=t.p1.x-t.p0.x,s=t.p1.y-t.p0.y,a=Math.sqrt(o*o+s*s),u=i*n*o/a,c=i*n*s/a;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},Pn.prototype.addFilletArc=function(t,e,n,r,i){var o=r===at.CLOCKWISE?-1:1,s=Math.abs(e-n),a=Math.trunc(s/this._filletAngleQuantum+.5);if(a<1)return null;for(var u=s/a,c=0,l=new w;c<s;){var h=e+o*c;l.x=t.x+i*Math.cos(h),l.y=t.y+i*Math.sin(h),this._segList.addPt(l),c+=u}},Pn.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*Pn.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this._segList.addPt(this._offset0.p1);else{if(this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0){var n=new w((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(n);var r=new w((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)}},Pn.prototype.createCircle=function(t){var e=new w(t.x+this._distance,t.y);this._segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},Pn.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},Pn.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new On,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*Pn.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},Pn.prototype.addCollinear=function(t){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===wn.JOIN_BEVEL||this._bufParams.getJoinStyle()===wn.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,at.CLOCKWISE,this._distance))},Pn.prototype.closeRing=function(){this._segList.closeRing()},Pn.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},Pn.prototype.interfaces_=function(){return[]},Pn.prototype.getClass=function(){return Pn},Rn.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return.001},Rn.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return.001},Rn.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},Rn.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(Pn,Rn);var An=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e};An.prototype.getOffsetCurve=function(t,e){if(this._distance=e,0===e)return null;var n=e<0,r=Math.abs(e),i=this.getSegGen(r);t.length<=1?this.computePointCurve(t[0],i):this.computeOffsetCurve(t,n,i);var o=i.getCoordinates();return n&&St.reverse(o),o},An.prototype.computeSingleSidedBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){n.addSegments(t,!0);var i=Sn.simplify(t,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],Ne.LEFT),n.addFirstSegment();for(var s=o-2;s>=0;s--)n.addNextSegment(i[s],!0)}else{n.addSegments(t,!1);var a=Sn.simplify(t,r),u=a.length-1;n.initSideSegments(a[0],a[1],Ne.LEFT),n.addFirstSegment();for(var c=2;c<=u;c++)n.addNextSegment(a[c],!0)}n.addLastSegment(),n.closeRing()},An.prototype.computeRingBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);e===Ne.RIGHT&&(r=-r);var i=Sn.simplify(t,r),o=i.length-1;n.initSideSegments(i[o-1],i[0],e);for(var s=1;s<=o;s++){var a=1!==s;n.addNextSegment(i[s],a)}n.closeRing()},An.prototype.computeLineBufferCurve=function(t,e){var n=this.simplifyTolerance(this._distance),r=Sn.simplify(t,n),i=r.length-1;e.initSideSegments(r[0],r[1],Ne.LEFT);for(var o=2;o<=i;o++)e.addNextSegment(r[o],!0);e.addLastSegment(),e.addLineEndCap(r[i-1],r[i]);var s=Sn.simplify(t,-n),a=s.length-1;e.initSideSegments(s[a],s[a-1],Ne.LEFT);for(var u=a-2;u>=0;u--)e.addNextSegment(s[u],!0);e.addLastSegment(),e.addLineEndCap(s[1],s[0]),e.closeRing()},An.prototype.computePointCurve=function(t,e){switch(this._bufParams.getEndCapStyle()){case wn.CAP_ROUND:e.createCircle(t);break;case wn.CAP_SQUARE:e.createSquare(t)}},An.prototype.getLineCurve=function(t,e){if(this._distance=e,e<0&&!this._bufParams.isSingleSided())return null;if(0===e)return null;var n=Math.abs(e),r=this.getSegGen(n);if(t.length<=1)this.computePointCurve(t[0],r);else if(this._bufParams.isSingleSided()){var i=e<0;this.computeSingleSidedBufferCurve(t,i,r)}else this.computeLineBufferCurve(t,r);return r.getCoordinates()},An.prototype.getBufferParameters=function(){return this._bufParams},An.prototype.simplifyTolerance=function(t){return t*this._bufParams.getSimplifyFactor()},An.prototype.getRingCurve=function(t,e,n){if(this._distance=n,t.length<=2)return this.getLineCurve(t,n);if(0===n)return An.copyCoordinates(t);var r=this.getSegGen(n);return this.computeRingBufferCurve(t,e,r),r.getCoordinates()},An.prototype.computeOffsetCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){var i=Sn.simplify(t,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],Ne.LEFT),n.addFirstSegment();for(var s=o-2;s>=0;s--)n.addNextSegment(i[s],!0)}else{var a=Sn.simplify(t,r),u=a.length-1;n.initSideSegments(a[0],a[1],Ne.LEFT),n.addFirstSegment();for(var c=2;c<=u;c++)n.addNextSegment(a[c],!0)}n.addLastSegment()},An.prototype.getSegGen=function(t){return new Pn(this._precisionModel,this._bufParams,t)},An.prototype.interfaces_=function(){return[]},An.prototype.getClass=function(){return An},An.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),n=0;n<e.length;n++)e[n]=new w(t[n]);return e};var Dn=function(){this._subgraphs=null,this._seg=new dn,this._cga=new at;var t=arguments[0];this._subgraphs=t},Fn={DepthSegment:{configurable:!0}};Dn.prototype.findStabbedSegments=function(){if(1===arguments.length){for(var t=arguments[0],e=new bt,n=this._subgraphs.iterator();n.hasNext();){var r=n.next(),i=r.getEnvelope();t.y<i.getMinY()||t.y>i.getMaxY()||this.findStabbedSegments(t,r.getDirectedEdges(),e)}return e}if(3===arguments.length)if(T(arguments[2],It)&&arguments[0]instanceof w&&arguments[1]instanceof je){for(var o=arguments[0],s=arguments[1],a=arguments[2],u=s.getEdge().getCoordinates(),c=0;c<u.length-1;c++)if(this._seg.p0=u[c],this._seg.p1=u[c+1],this._seg.p0.y>this._seg.p1.y&&this._seg.reverse(),!(Math.max(this._seg.p0.x,this._seg.p1.x)<o.x||this._seg.isHorizontal()||o.y<this._seg.p0.y||o.y>this._seg.p1.y||at.computeOrientation(this._seg.p0,this._seg.p1,o)===at.RIGHT)){var l=s.getDepth(Ne.LEFT);this._seg.p0.equals(u[c])||(l=s.getDepth(Ne.RIGHT));var h=new kn(this._seg,l);a.add(h)}}else if(T(arguments[2],It)&&arguments[0]instanceof w&&T(arguments[1],It))for(var p=arguments[0],f=arguments[2],g=arguments[1].iterator();g.hasNext();){var d=g.next();d.isForward()&&this.findStabbedSegments(p,d,f)}},Dn.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);return 0===e.size()?0:Ze.min(e)._leftDepth},Dn.prototype.interfaces_=function(){return[]},Dn.prototype.getClass=function(){return Dn},Fn.DepthSegment.get=function(){return kn},Object.defineProperties(Dn,Fn);var kn=function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new dn(t),this._leftDepth=e};kn.prototype.compareTo=function(t){var e=t;if(this._upwardSeg.minX()>=e._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=e._upwardSeg.minX())return-1;var n=this._upwardSeg.orientationIndex(e._upwardSeg);return 0!==n||0!=(n=-1*e._upwardSeg.orientationIndex(this._upwardSeg))?n:this._upwardSeg.compareTo(e._upwardSeg)},kn.prototype.compareX=function(t,e){var n=t.p0.compareTo(e.p0);return 0!==n?n:t.p1.compareTo(e.p1)},kn.prototype.toString=function(){return this._upwardSeg.toString()},kn.prototype.interfaces_=function(){return[E]},kn.prototype.getClass=function(){return kn};var Bn=function(t,e,n){this.p0=t||null,this.p1=e||null,this.p2=n||null};Bn.prototype.area=function(){return Bn.area(this.p0,this.p1,this.p2)},Bn.prototype.signedArea=function(){return Bn.signedArea(this.p0,this.p1,this.p2)},Bn.prototype.interpolateZ=function(t){if(null===t)throw new v("Supplied point is null.");return Bn.interpolateZ(t,this.p0,this.p1,this.p2)},Bn.prototype.longestSideLength=function(){return Bn.longestSideLength(this.p0,this.p1,this.p2)},Bn.prototype.isAcute=function(){return Bn.isAcute(this.p0,this.p1,this.p2)},Bn.prototype.circumcentre=function(){return Bn.circumcentre(this.p0,this.p1,this.p2)},Bn.prototype.area3D=function(){return Bn.area3D(this.p0,this.p1,this.p2)},Bn.prototype.centroid=function(){return Bn.centroid(this.p0,this.p1,this.p2)},Bn.prototype.inCentre=function(){return Bn.inCentre(this.p0,this.p1,this.p2)},Bn.prototype.interfaces_=function(){return[]},Bn.prototype.getClass=function(){return Bn},Bn.area=function(t,e,n){return Math.abs(((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2)},Bn.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2},Bn.det=function(t,e,n,r){return t*r-e*n},Bn.interpolateZ=function(t,e,n,r){var i=e.x,o=e.y,s=n.x-i,a=r.x-i,u=n.y-o,c=r.y-o,l=s*c-a*u,h=t.x-i,p=t.y-o,f=(c*h-a*p)/l,g=(-u*h+s*p)/l;return e.z+f*(n.z-e.z)+g*(r.z-e.z)},Bn.longestSideLength=function(t,e,n){var r=t.distance(e),i=e.distance(n),o=n.distance(t),s=r;return i>s&&(s=i),o>s&&(s=o),s},Bn.isAcute=function(t,e,n){return!!Tn.isAcute(t,e,n)&&!!Tn.isAcute(e,n,t)&&!!Tn.isAcute(n,t,e)},Bn.circumcentre=function(t,e,n){var r=n.x,i=n.y,o=t.x-r,s=t.y-i,a=e.x-r,u=e.y-i,c=2*Bn.det(o,s,a,u),l=Bn.det(s,o*o+s*s,u,a*a+u*u),h=Bn.det(o,o*o+s*s,a,a*a+u*u);return new w(r-l/c,i+h/c)},Bn.perpendicularBisector=function(t,e){var n=e.x-t.x,r=e.y-t.y,i=new X(t.x+n/2,t.y+r/2,1),o=new X(t.x-r+n/2,t.y+n+r/2,1);return new X(i,o)},Bn.angleBisector=function(t,e,n){var r=e.distance(t),i=r/(r+e.distance(n)),o=n.x-t.x,s=n.y-t.y;return new w(t.x+i*o,t.y+i*s)},Bn.area3D=function(t,e,n){var r=e.x-t.x,i=e.y-t.y,o=e.z-t.z,s=n.x-t.x,a=n.y-t.y,u=n.z-t.z,c=i*u-o*a,l=o*s-r*u,h=r*a-i*s,p=c*c+l*l+h*h;return Math.sqrt(p)/2},Bn.centroid=function(t,e,n){var r=(t.x+e.x+n.x)/3,i=(t.y+e.y+n.y)/3;return new w(r,i)},Bn.inCentre=function(t,e,n){var r=e.distance(n),i=t.distance(n),o=t.distance(e),s=r+i+o,a=(r*t.x+i*e.x+o*n.x)/s,u=(r*t.y+i*e.y+o*n.y)/s;return new w(a,u)};var Gn=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new bt;var t=arguments[0],e=arguments[1],n=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=n};Gn.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,O.EXTERIOR,O.INTERIOR)},Gn.prototype.addPolygon=function(t){var e=this._distance,n=Ne.LEFT;this._distance<0&&(e=-this._distance,n=Ne.RIGHT);var r=t.getExteriorRing(),i=St.removeRepeatedPoints(r.getCoordinates());if(this._distance<0&&this.isErodedCompletely(r,this._distance))return null;if(this._distance<=0&&i.length<3)return null;this.addPolygonRing(i,e,n,O.EXTERIOR,O.INTERIOR);for(var o=0;o<t.getNumInteriorRing();o++){var s=t.getInteriorRingN(o),a=St.removeRepeatedPoints(s.getCoordinates());this._distance>0&&this.isErodedCompletely(s,-this._distance)||this.addPolygonRing(a,e,Ne.opposite(n),O.INTERIOR,O.EXTERIOR)}},Gn.prototype.isTriangleErodedCompletely=function(t,e){var n=new Bn(t[0],t[1],t[2]),r=n.inCentre();return at.distancePointLine(r,n.p0,n.p1)<Math.abs(e)},Gn.prototype.addLineString=function(t){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var e=St.removeRepeatedPoints(t.getCoordinates()),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,O.EXTERIOR,O.INTERIOR)},Gn.prototype.addCurve=function(t,e,n){if(null===t||t.length<2)return null;var r=new gn(t,new Pe(0,O.BOUNDARY,e,n));this._curveList.add(r)},Gn.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},Gn.prototype.addPolygonRing=function(t,e,n,r,i){if(0===e&&t.length<ee.MINIMUM_VALID_SIZE)return null;var o=r,s=i;t.length>=ee.MINIMUM_VALID_SIZE&&at.isCCW(t)&&(o=i,s=r,n=Ne.opposite(n));var a=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(a,o,s)},Gn.prototype.add=function(t){if(t.isEmpty())return null;t instanceof Zt?this.addPolygon(t):t instanceof Jt?this.addLineString(t):t instanceof Qt?this.addPoint(t):(t instanceof te||t instanceof Vt||t instanceof ne||t instanceof jt)&&this.addCollection(t)},Gn.prototype.isErodedCompletely=function(t,e){var n=t.getCoordinates();if(n.length<4)return e<0;if(4===n.length)return this.isTriangleErodedCompletely(n,e);var r=t.getEnvelopeInternal(),i=Math.min(r.getHeight(),r.getWidth());return e<0&&2*Math.abs(e)>i},Gn.prototype.addCollection=function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);this.add(n)}},Gn.prototype.interfaces_=function(){return[]},Gn.prototype.getClass=function(){return Gn};var Un=function(){};Un.prototype.locate=function(t){},Un.prototype.interfaces_=function(){return[]},Un.prototype.getClass=function(){return Un};var qn=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()};qn.prototype.next=function(){if(this._atStart)return this._atStart=!1,qn.isAtomic(this._parent)&&this._index++,this._parent;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return this._subcollectionIterator.next();this._subcollectionIterator=null}if(this._index>=this._max)throw new r;var t=this._parent.getGeometryN(this._index++);return t instanceof jt?(this._subcollectionIterator=new qn(t),this._subcollectionIterator.next()):t},qn.prototype.remove=function(){throw new Error(this.getClass().getName())},qn.prototype.hasNext=function(){if(this._atStart)return!0;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},qn.prototype.interfaces_=function(){return[Et]},qn.prototype.getClass=function(){return qn},qn.isAtomic=function(t){return!(t instanceof jt)};var jn=function(){this._geom=null;var t=arguments[0];this._geom=t};jn.prototype.locate=function(t){return jn.locate(t,this._geom)},jn.prototype.interfaces_=function(){return[Un]},jn.prototype.getClass=function(){return jn},jn.isPointInRing=function(t,e){return!!e.getEnvelopeInternal().intersects(t)&&at.isPointInRing(t,e.getCoordinates())},jn.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!jn.isPointInRing(t,n))return!1;for(var r=0;r<e.getNumInteriorRing();r++){var i=e.getInteriorRingN(r);if(jn.isPointInRing(t,i))return!1}return!0},jn.containsPoint=function(t,e){if(e instanceof Zt)return jn.containsPointInPolygon(t,e);if(e instanceof jt)for(var n=new qn(e);n.hasNext();){var r=n.next();if(r!==e&&jn.containsPoint(t,r))return!0}return!1},jn.locate=function(t,e){return e.isEmpty()?O.EXTERIOR:jn.containsPoint(t,e)?O.INTERIOR:O.EXTERIOR};var Vn=function(){this._edgeMap=new h,this._edgeList=null,this._ptInAreaLocation=[O.NONE,O.NONE]};Vn.prototype.getNextCW=function(t){this.getEdges();var e=this._edgeList.indexOf(t),n=e-1;return 0===e&&(n=this._edgeList.size()-1),this._edgeList.get(n)},Vn.prototype.propagateSideLabels=function(t){for(var e=O.NONE,n=this.iterator();n.hasNext();){var r=n.next().getLabel();r.isArea(t)&&r.getLocation(t,Ne.LEFT)!==O.NONE&&(e=r.getLocation(t,Ne.LEFT))}if(e===O.NONE)return null;for(var i=e,o=this.iterator();o.hasNext();){var s=o.next(),a=s.getLabel();if(a.getLocation(t,Ne.ON)===O.NONE&&a.setLocation(t,Ne.ON,i),a.isArea(t)){var u=a.getLocation(t,Ne.LEFT),c=a.getLocation(t,Ne.RIGHT);if(c!==O.NONE){if(c!==i)throw new Oe("side location conflict",s.getCoordinate());u===O.NONE&&et.shouldNeverReachHere("found single null side (at "+s.getCoordinate()+")"),i=u}else et.isTrue(a.getLocation(t,Ne.LEFT)===O.NONE,"found single null side"),a.setLocation(t,Ne.RIGHT,i),a.setLocation(t,Ne.LEFT,i)}}},Vn.prototype.getCoordinate=function(){var t=this.iterator();return t.hasNext()?t.next().getCoordinate():null},Vn.prototype.print=function(t){Y.out.println("EdgeEndStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();)e.next().print(t)},Vn.prototype.isAreaLabelsConsistent=function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},Vn.prototype.checkAreaLabelsConsistent=function(t){var e=this.getEdges();if(e.size()<=0)return!0;var n=e.size()-1,r=e.get(n).getLabel().getLocation(t,Ne.LEFT);et.isTrue(r!==O.NONE,"Found unlabelled area edge");for(var i=r,o=this.iterator();o.hasNext();){var s=o.next().getLabel();et.isTrue(s.isArea(t),"Found non-area edge");var a=s.getLocation(t,Ne.LEFT),u=s.getLocation(t,Ne.RIGHT);if(a===u)return!1;if(u!==i)return!1;i=a}return!0},Vn.prototype.findIndex=function(t){this.iterator();for(var e=0;e<this._edgeList.size();e++)if(this._edgeList.get(e)===t)return e;return-1},Vn.prototype.iterator=function(){return this.getEdges().iterator()},Vn.prototype.getEdges=function(){return null===this._edgeList&&(this._edgeList=new bt(this._edgeMap.values())),this._edgeList},Vn.prototype.getLocation=function(t,e,n){return this._ptInAreaLocation[t]===O.NONE&&(this._ptInAreaLocation[t]=jn.locate(e,n[t].getGeometry())),this._ptInAreaLocation[t]},Vn.prototype.toString=function(){var t=new R;t.append("EdgeEndStar: "+this.getCoordinate()),t.append("\n");for(var e=this.iterator();e.hasNext();){var n=e.next();t.append(n),t.append("\n")}return t.toString()},Vn.prototype.computeEdgeEndLabels=function(t){for(var e=this.iterator();e.hasNext();)e.next().computeLabel(t)},Vn.prototype.computeLabelling=function(t){this.computeEdgeEndLabels(t[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var e=[!1,!1],n=this.iterator();n.hasNext();)for(var r=n.next().getLabel(),i=0;i<2;i++)r.isLine(i)&&r.getLocation(i)===O.BOUNDARY&&(e[i]=!0);for(var o=this.iterator();o.hasNext();)for(var s=o.next(),a=s.getLabel(),u=0;u<2;u++)if(a.isAnyNull(u)){var c=O.NONE;if(e[u])c=O.EXTERIOR;else{var l=s.getCoordinate();c=this.getLocation(u,l,t)}a.setAllLocationsIfNull(u,c)}},Vn.prototype.getDegree=function(){return this._edgeMap.size()},Vn.prototype.insertEdgeEnd=function(t,e){this._edgeMap.put(t,e),this._edgeList=null},Vn.prototype.interfaces_=function(){return[]},Vn.prototype.getClass=function(){return Vn};var Yn=function(t){function e(){t.call(this),this._resultAreaEdgeList=null,this._label=null,this._SCANNING_FOR_INCOMING=1,this._LINKING_TO_OUTGOING=2}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.linkResultDirectedEdges=function(){this.getResultAreaEdges();for(var t=null,e=null,n=this._SCANNING_FOR_INCOMING,r=0;r<this._resultAreaEdgeList.size();r++){var i=this._resultAreaEdgeList.get(r),o=i.getSym();if(i.getLabel().isArea())switch(null===t&&i.isInResult()&&(t=i),n){case this._SCANNING_FOR_INCOMING:if(!o.isInResult())continue;e=o,n=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(!i.isInResult())continue;e.setNext(i),n=this._SCANNING_FOR_INCOMING}}if(n===this._LINKING_TO_OUTGOING){if(null===t)throw new Oe("no outgoing dirEdge found",this.getCoordinate());et.isTrue(t.isInResult(),"unable to link last incoming dirEdge"),e.setNext(t)}},e.prototype.insert=function(t){var e=t;this.insertEdgeEnd(e,e)},e.prototype.getRightmostEdge=function(){var t=this.getEdges(),e=t.size();if(e<1)return null;var n=t.get(0);if(1===e)return n;var r=t.get(e-1),i=n.getQuadrant(),o=r.getQuadrant();return Ge.isNorthern(i)&&Ge.isNorthern(o)?n:Ge.isNorthern(i)||Ge.isNorthern(o)?0!==n.getDy()?n:0!==r.getDy()?r:(et.shouldNeverReachHere("found two horizontal edges incident on node"),null):r},e.prototype.print=function(t){Y.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();){var n=e.next();t.print("out "),n.print(t),t.println(),t.print("in "),n.getSym().print(t),t.println()}},e.prototype.getResultAreaEdges=function(){if(null!==this._resultAreaEdgeList)return this._resultAreaEdgeList;this._resultAreaEdgeList=new bt;for(var t=this.iterator();t.hasNext();){var e=t.next();(e.isInResult()||e.getSym().isInResult())&&this._resultAreaEdgeList.add(e)}return this._resultAreaEdgeList},e.prototype.updateLabelling=function(t){for(var e=this.iterator();e.hasNext();){var n=e.next().getLabel();n.setAllLocationsIfNull(0,t.getLocation(0)),n.setAllLocationsIfNull(1,t.getLocation(1))}},e.prototype.linkAllDirectedEdges=function(){this.getEdges();for(var t=null,e=null,n=this._edgeList.size()-1;n>=0;n--){var r=this._edgeList.get(n),i=r.getSym();null===e&&(e=i),null!==t&&i.setNext(t),t=r}e.setNext(t)},e.prototype.computeDepths=function(){if(1===arguments.length){var t=arguments[0],e=this.findIndex(t),n=t.getDepth(Ne.LEFT),r=t.getDepth(Ne.RIGHT),i=this.computeDepths(e+1,this._edgeList.size(),n);if(this.computeDepths(0,e,i)!==r)throw new Oe("depth mismatch at "+t.getCoordinate())}else if(3===arguments.length){for(var o=arguments[1],s=arguments[2],a=arguments[0];a<o;a++){var u=this._edgeList.get(a);u.setEdgeDepths(Ne.RIGHT,s),s=u.getDepth(Ne.LEFT)}return s}},e.prototype.mergeSymLabels=function(){for(var t=this.iterator();t.hasNext();){var e=t.next();e.getLabel().merge(e.getSym().getLabel())}},e.prototype.linkMinimalDirectedEdges=function(t){for(var e=null,n=null,r=this._SCANNING_FOR_INCOMING,i=this._resultAreaEdgeList.size()-1;i>=0;i--){var o=this._resultAreaEdgeList.get(i),s=o.getSym();switch(null===e&&o.getEdgeRing()===t&&(e=o),r){case this._SCANNING_FOR_INCOMING:if(s.getEdgeRing()!==t)continue;n=s,r=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(o.getEdgeRing()!==t)continue;n.setNextMin(o),r=this._SCANNING_FOR_INCOMING}}r===this._LINKING_TO_OUTGOING&&(et.isTrue(null!==e,"found null for first outgoing dirEdge"),et.isTrue(e.getEdgeRing()===t,"unable to link last incoming dirEdge"),n.setNextMin(e))},e.prototype.getOutgoingDegree=function(){if(0===arguments.length){for(var t=0,e=this.iterator();e.hasNext();)e.next().isInResult()&&t++;return t}if(1===arguments.length){for(var n=arguments[0],r=0,i=this.iterator();i.hasNext();)i.next().getEdgeRing()===n&&r++;return r}},e.prototype.getLabel=function(){return this._label},e.prototype.findCoveredLineEdges=function(){for(var t=O.NONE,e=this.iterator();e.hasNext();){var n=e.next(),r=n.getSym();if(!n.isLineEdge()){if(n.isInResult()){t=O.INTERIOR;break}if(r.isInResult()){t=O.EXTERIOR;break}}}if(t===O.NONE)return null;for(var i=t,o=this.iterator();o.hasNext();){var s=o.next(),a=s.getSym();s.isLineEdge()?s.getEdge().setCovered(i===O.INTERIOR):(s.isInResult()&&(i=O.EXTERIOR),a.isInResult()&&(i=O.INTERIOR))}},e.prototype.computeLabelling=function(e){t.prototype.computeLabelling.call(this,e),this._label=new Pe(O.NONE);for(var n=this.iterator();n.hasNext();)for(var r=n.next().getEdge().getLabel(),i=0;i<2;i++){var o=r.getLocation(i);o!==O.INTERIOR&&o!==O.BOUNDARY||this._label.setLocation(i,O.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Vn),Xn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createNode=function(t){return new ke(t,new Yn)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ve),zn=function t(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=t.orientation(e)};zn.prototype.compareTo=function(t){var e=t;return zn.compareOriented(this._pts,this._orientation,e._pts,e._orientation)},zn.prototype.interfaces_=function(){return[E]},zn.prototype.getClass=function(){return zn},zn.orientation=function(t){return 1===St.increasingDirection(t)},zn.compareOriented=function(t,e,n,r){for(var i=e?1:-1,o=r?1:-1,s=e?t.length:-1,a=r?n.length:-1,u=e?0:t.length-1,c=r?0:n.length-1;;){var l=t[u].compareTo(n[c]);if(0!==l)return l;var h=(u+=i)===s,p=(c+=o)===a;if(h&&!p)return-1;if(!h&&p)return 1;if(h&&p)return 0}};var Wn=function(){this._edges=new bt,this._ocaMap=new h};Wn.prototype.print=function(t){t.print("MULTILINESTRING ( ");for(var e=0;e<this._edges.size();e++){var n=this._edges.get(e);e>0&&t.print(","),t.print("(");for(var r=n.getCoordinates(),i=0;i<r.length;i++)i>0&&t.print(","),t.print(r[i].x+" "+r[i].y);t.println(")")}t.print(") ")},Wn.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())},Wn.prototype.findEdgeIndex=function(t){for(var e=0;e<this._edges.size();e++)if(this._edges.get(e).equals(t))return e;return-1},Wn.prototype.iterator=function(){return this._edges.iterator()},Wn.prototype.getEdges=function(){return this._edges},Wn.prototype.get=function(t){return this._edges.get(t)},Wn.prototype.findEqualEdge=function(t){var e=new zn(t.getCoordinates());return this._ocaMap.get(e)},Wn.prototype.add=function(t){this._edges.add(t);var e=new zn(t.getCoordinates());this._ocaMap.put(e,t)},Wn.prototype.interfaces_=function(){return[]},Wn.prototype.getClass=function(){return Wn};var Hn=function(){};Hn.prototype.processIntersections=function(t,e,n,r){},Hn.prototype.isDone=function(){},Hn.prototype.interfaces_=function(){return[]},Hn.prototype.getClass=function(){return Hn};var Jn=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};Jn.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&1===this._li.getIntersectionNum()){if(Jn.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var i=t.size()-1;if(0===e&&r===i||0===r&&e===i)return!0}}return!1},Jn.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Jn.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Jn.prototype.getLineIntersector=function(){return this._li},Jn.prototype.hasProperIntersection=function(){return this._hasProper},Jn.prototype.processIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(t,e,n,r)||(this._hasIntersection=!0,t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))},Jn.prototype.hasIntersection=function(){return this._hasIntersection},Jn.prototype.isDone=function(){return!1},Jn.prototype.hasInteriorIntersection=function(){return this._hasInterior},Jn.prototype.interfaces_=function(){return[Hn]},Jn.prototype.getClass=function(){return Jn},Jn.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var Kn=function(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.coord=new w(t),this.segmentIndex=e,this.dist=n};Kn.prototype.getSegmentIndex=function(){return this.segmentIndex},Kn.prototype.getCoordinate=function(){return this.coord},Kn.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)},Kn.prototype.compareTo=function(t){var e=t;return this.compare(e.segmentIndex,e.dist)},Kn.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&0===this.dist||this.segmentIndex===t},Kn.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},Kn.prototype.getDistance=function(){return this.dist},Kn.prototype.compare=function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0},Kn.prototype.interfaces_=function(){return[E]},Kn.prototype.getClass=function(){return Kn};var Qn=function(){this._nodeMap=new h,this.edge=null;var t=arguments[0];this.edge=t};Qn.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},Qn.prototype.iterator=function(){return this._nodeMap.values().iterator()},Qn.prototype.addSplitEdges=function(t){this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var r=e.next(),i=this.createSplitEdge(n,r);t.add(i),n=r}},Qn.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)},Qn.prototype.createSplitEdge=function(t,e){var n=e.segmentIndex-t.segmentIndex+2,r=this.edge.pts[e.segmentIndex],i=e.dist>0||!e.coord.equals2D(r);i||n--;var o=new Array(n).fill(null),s=0;o[s++]=new w(t.coord);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)o[s++]=this.edge.pts[a];return i&&(o[s]=e.coord),new nr(o,new Pe(this.edge._label))},Qn.prototype.add=function(t,e,n){var r=new Kn(t,e,n),i=this._nodeMap.get(r);return null!==i?i:(this._nodeMap.put(r,r),r)},Qn.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();)if(e.next().coord.equals(t))return!0;return!1},Qn.prototype.interfaces_=function(){return[]},Qn.prototype.getClass=function(){return Qn};var $n=function(){};$n.prototype.getChainStartIndices=function(t){var e=0,n=new bt;n.add(new A(e));do{var r=this.findChainEnd(t,e);n.add(new A(r)),e=r}while(e<t.length-1);return $n.toIntArray(n)},$n.prototype.findChainEnd=function(t,e){for(var n=Ge.quadrant(t[e],t[e+1]),r=e+1;r<t.length&&Ge.quadrant(t[r-1],t[r])===n;)r++;return r-1},$n.prototype.interfaces_=function(){return[]},$n.prototype.getClass=function(){return $n},$n.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e};var Zn=function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new z,this.env2=new z;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new $n;this.startIndex=e.getChainStartIndices(this.pts)};Zn.prototype.getCoordinates=function(){return this.pts},Zn.prototype.getMaxX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e>n?e:n},Zn.prototype.getMinX=function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e<n?e:n},Zn.prototype.computeIntersectsForChain=function(){if(4===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this.computeIntersectsForChain(this.startIndex[t],this.startIndex[t+1],e,e.startIndex[n],e.startIndex[n+1],r)}else if(6===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3],u=arguments[4],c=arguments[5],l=this.pts[i],h=this.pts[o],p=s.pts[a],f=s.pts[u];if(o-i==1&&u-a==1)return c.addIntersections(this.e,i,s.e,a),null;if(this.env1.init(l,h),this.env2.init(p,f),!this.env1.intersects(this.env2))return null;var g=Math.trunc((i+o)/2),d=Math.trunc((a+u)/2);i<g&&(a<d&&this.computeIntersectsForChain(i,g,s,a,d,c),d<u&&this.computeIntersectsForChain(i,g,s,d,u,c)),g<o&&(a<d&&this.computeIntersectsForChain(g,o,s,a,d,c),d<u&&this.computeIntersectsForChain(g,o,s,d,u,c))}},Zn.prototype.getStartIndexes=function(){return this.startIndex},Zn.prototype.computeIntersects=function(t,e){for(var n=0;n<this.startIndex.length-1;n++)for(var r=0;r<t.startIndex.length-1;r++)this.computeIntersectsForChain(n,t,r,e)},Zn.prototype.interfaces_=function(){return[]},Zn.prototype.getClass=function(){return Zn};var tr=function t(){this._depth=Array(2).fill().map((function(){return Array(3)}));for(var e=0;e<2;e++)for(var n=0;n<3;n++)this._depth[e][n]=t.NULL_VALUE},er={NULL_VALUE:{configurable:!0}};tr.prototype.getDepth=function(t,e){return this._depth[t][e]},tr.prototype.setDepth=function(t,e,n){this._depth[t][e]=n},tr.prototype.isNull=function(){if(0===arguments.length){for(var t=0;t<2;t++)for(var e=0;e<3;e++)if(this._depth[t][e]!==tr.NULL_VALUE)return!1;return!0}if(1===arguments.length){var n=arguments[0];return this._depth[n][1]===tr.NULL_VALUE}if(2===arguments.length){var r=arguments[0],i=arguments[1];return this._depth[r][i]===tr.NULL_VALUE}},tr.prototype.normalize=function(){for(var t=0;t<2;t++)if(!this.isNull(t)){var e=this._depth[t][1];this._depth[t][2]<e&&(e=this._depth[t][2]),e<0&&(e=0);for(var n=1;n<3;n++){var r=0;this._depth[t][n]>e&&(r=1),this._depth[t][n]=r}}},tr.prototype.getDelta=function(t){return this._depth[t][Ne.RIGHT]-this._depth[t][Ne.LEFT]},tr.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?O.EXTERIOR:O.INTERIOR},tr.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},tr.prototype.add=function(){if(1===arguments.length)for(var t=arguments[0],e=0;e<2;e++)for(var n=1;n<3;n++){var r=t.getLocation(e,n);r!==O.EXTERIOR&&r!==O.INTERIOR||(this.isNull(e,n)?this._depth[e][n]=tr.depthAtLocation(r):this._depth[e][n]+=tr.depthAtLocation(r))}else if(3===arguments.length){var i=arguments[0],o=arguments[1];arguments[2]===O.INTERIOR&&this._depth[i][o]++}},tr.prototype.interfaces_=function(){return[]},tr.prototype.getClass=function(){return tr},tr.depthAtLocation=function(t){return t===O.EXTERIOR?0:t===O.INTERIOR?1:tr.NULL_VALUE},er.NULL_VALUE.get=function(){return-1},Object.defineProperties(tr,er);var nr=function(t){function e(){if(t.call(this),this.pts=null,this._env=null,this.eiList=new Qn(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new tr,this._depthDelta=0,1===arguments.length){var n=arguments[0];e.call(this,n,null)}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.pts=r,this._label=i}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDepth=function(){return this._depth},e.prototype.getCollapsedEdge=function(){var t=new Array(2).fill(null);return t[0]=this.pts[0],t[1]=this.pts[1],new e(t,Pe.toLineLabel(this._label))},e.prototype.isIsolated=function(){return this._isIsolated},e.prototype.getCoordinates=function(){return this.pts},e.prototype.setIsolated=function(t){this._isIsolated=t},e.prototype.setName=function(t){this._name=t},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;if(this.pts.length!==n.pts.length)return!1;for(var r=!0,i=!0,o=this.pts.length,s=0;s<this.pts.length;s++)if(this.pts[s].equals2D(n.pts[s])||(r=!1),this.pts[s].equals2D(n.pts[--o])||(i=!1),!r&&!i)return!1;return!0},e.prototype.getCoordinate=function(){if(0===arguments.length)return this.pts.length>0?this.pts[0]:null;if(1===arguments.length){var t=arguments[0];return this.pts[t]}},e.prototype.print=function(t){t.print("edge "+this._name+": "),t.print("LINESTRING (");for(var e=0;e<this.pts.length;e++)e>0&&t.print(","),t.print(this.pts[e].x+" "+this.pts[e].y);t.print(") "+this._label+" "+this._depthDelta)},e.prototype.computeIM=function(t){e.updateIM(this._label,t)},e.prototype.isCollapsed=function(){return!!this._label.isArea()&&3===this.pts.length&&!!this.pts[0].equals(this.pts[2])},e.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},e.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},e.prototype.getDepthDelta=function(){return this._depthDelta},e.prototype.getNumPoints=function(){return this.pts.length},e.prototype.printReverse=function(t){t.print("edge "+this._name+": ");for(var e=this.pts.length-1;e>=0;e--)t.print(this.pts[e]+" ");t.println("")},e.prototype.getMonotoneChainEdge=function(){return null===this._mce&&(this._mce=new Zn(this)),this._mce},e.prototype.getEnvelope=function(){if(null===this._env){this._env=new z;for(var t=0;t<this.pts.length;t++)this._env.expandToInclude(this.pts[t])}return this._env},e.prototype.addIntersection=function(t,e,n,r){var i=new w(t.getIntersection(r)),o=e,s=t.getEdgeDistance(n,r),a=o+1;if(a<this.pts.length){var u=this.pts[a];i.equals2D(u)&&(o=a,s=0)}this.eiList.add(i,o,s)},e.prototype.toString=function(){var t=new R;t.append("edge "+this._name+": "),t.append("LINESTRING (");for(var e=0;e<this.pts.length;e++)e>0&&t.append(","),t.append(this.pts[e].x+" "+this.pts[e].y);return t.append(") "+this._label+" "+this._depthDelta),t.toString()},e.prototype.isPointwiseEqual=function(t){if(this.pts.length!==t.pts.length)return!1;for(var e=0;e<this.pts.length;e++)if(!this.pts[e].equals2D(t.pts[e]))return!1;return!0},e.prototype.setDepthDelta=function(t){this._depthDelta=t},e.prototype.getEdgeIntersectionList=function(){return this.eiList},e.prototype.addIntersections=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++)this.addIntersection(t,e,n,r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.updateIM=function(){if(2!==arguments.length)return t.prototype.updateIM.apply(this,arguments);var e=arguments[0],n=arguments[1];n.setAtLeastIfValid(e.getLocation(0,Ne.ON),e.getLocation(1,Ne.ON),1),e.isArea()&&(n.setAtLeastIfValid(e.getLocation(0,Ne.LEFT),e.getLocation(1,Ne.LEFT),2),n.setAtLeastIfValid(e.getLocation(0,Ne.RIGHT),e.getLocation(1,Ne.RIGHT),2))},e}(Fe),rr=function(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new Wn,this._bufParams=t||null};rr.prototype.setWorkingPrecisionModel=function(t){this._workingPrecisionModel=t},rr.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(null!==e){var n=e.getLabel(),r=t.getLabel();e.isPointwiseEqual(t)||(r=new Pe(t.getLabel())).flip(),n.merge(r);var i=rr.depthDelta(r),o=e.getDepthDelta()+i;e.setDepthDelta(o)}else this._edgeList.add(t),t.setDepthDelta(rr.depthDelta(t.getLabel()))},rr.prototype.buildSubgraphs=function(t,e){for(var n=new bt,r=t.iterator();r.hasNext();){var i=r.next(),o=i.getRightmostCoordinate(),s=new Dn(n).getDepth(o);i.computeDepth(s),i.findResultEdges(),n.add(i),e.add(i.getDirectedEdges(),i.getNodes())}},rr.prototype.createSubgraphs=function(t){for(var e=new bt,n=t.getNodes().iterator();n.hasNext();){var r=n.next();if(!r.isVisited()){var i=new Te;i.create(r),e.add(i)}}return Ze.sort(e,Ze.reverseOrder()),e},rr.prototype.createEmptyResultGeometry=function(){return this._geomFact.createPolygon()},rr.prototype.getNoder=function(t){if(null!==this._workingNoder)return this._workingNoder;var e=new In,n=new it;return n.setPrecisionModel(t),e.setSegmentIntersector(new Jn(n)),e},rr.prototype.buffer=function(t,e){var n=this._workingPrecisionModel;null===n&&(n=t.getPrecisionModel()),this._geomFact=t.getFactory();var r=new An(n,this._bufParams),i=new Gn(t,e,r).getCurves();if(i.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(i,n),this._graph=new Ye(new Xn),this._graph.addEdges(this._edgeList.getEdges());var o=this.createSubgraphs(this._graph),s=new Xe(this._geomFact);this.buildSubgraphs(o,s);var a=s.getPolygons();return a.size()<=0?this.createEmptyResultGeometry():this._geomFact.buildGeometry(a)},rr.prototype.computeNodedEdges=function(t,e){var n=this.getNoder(e);n.computeNodes(t);for(var r=n.getNodedSubstrings().iterator();r.hasNext();){var i=r.next(),o=i.getCoordinates();if(2!==o.length||!o[0].equals2D(o[1])){var s=i.getData(),a=new nr(i.getCoordinates(),new Pe(s));this.insertUniqueEdge(a)}}},rr.prototype.setNoder=function(t){this._workingNoder=t},rr.prototype.interfaces_=function(){return[]},rr.prototype.getClass=function(){return rr},rr.depthDelta=function(t){var e=t.getLocation(0,Ne.LEFT),n=t.getLocation(0,Ne.RIGHT);return e===O.INTERIOR&&n===O.EXTERIOR?1:e===O.EXTERIOR&&n===O.INTERIOR?-1:0},rr.convertSegStrings=function(t){for(var e=new _e,n=new bt;t.hasNext();){var r=t.next(),i=e.createLineString(r.getCoordinates());n.add(i)}return e.buildGeometry(n)};var ir=function(){if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,2===arguments.length){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(4===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2],o=arguments[3];this._noder=n,this._scaleFactor=r,this._offsetX=i,this._offsetY=o,this._isScaled=!this.isIntegerPrecision()}};ir.prototype.rescale=function(){if(T(arguments[0],xt))for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.rescale(e.getCoordinates())}else if(arguments[0]instanceof Array){for(var n=arguments[0],r=0;r<n.length;r++)n[r].x=n[r].x/this._scaleFactor+this._offsetX,n[r].y=n[r].y/this._scaleFactor+this._offsetY;2===n.length&&n[0].equals2D(n[1])&&Y.out.println(n)}},ir.prototype.scale=function(){if(T(arguments[0],xt)){for(var t=arguments[0],e=new bt,n=t.iterator();n.hasNext();){var r=n.next();e.add(new gn(this.scale(r.getCoordinates()),r.getData()))}return e}if(arguments[0]instanceof Array){for(var i=arguments[0],o=new Array(i.length).fill(null),s=0;s<i.length;s++)o[s]=new w(Math.round((i[s].x-this._offsetX)*this._scaleFactor),Math.round((i[s].y-this._offsetY)*this._scaleFactor),i[s].z);return St.removeRepeatedPoints(o)}},ir.prototype.isIntegerPrecision=function(){return 1===this._scaleFactor},ir.prototype.getNodedSubstrings=function(){var t=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(t),t},ir.prototype.computeNodes=function(t){var e=t;this._isScaled&&(e=this.scale(t)),this._noder.computeNodes(e)},ir.prototype.interfaces_=function(){return[xn]},ir.prototype.getClass=function(){return ir};var or=function(){this._li=new it,this._segStrings=null;var t=arguments[0];this._segStrings=t},sr={fact:{configurable:!0}};or.prototype.checkEndPtVertexIntersections=function(){if(0===arguments.length)for(var t=this._segStrings.iterator();t.hasNext();){var e=t.next().getCoordinates();this.checkEndPtVertexIntersections(e[0],this._segStrings),this.checkEndPtVertexIntersections(e[e.length-1],this._segStrings)}else if(2===arguments.length)for(var n=arguments[0],r=arguments[1].iterator();r.hasNext();)for(var i=r.next().getCoordinates(),o=1;o<i.length-1;o++)if(i[o].equals(n))throw new Z("found endpt/interior pt intersection at index "+o+" :pt "+n)},or.prototype.checkInteriorIntersections=function(){if(0===arguments.length)for(var t=this._segStrings.iterator();t.hasNext();)for(var e=t.next(),n=this._segStrings.iterator();n.hasNext();){var r=n.next();this.checkInteriorIntersections(e,r)}else if(2===arguments.length)for(var i=arguments[0],o=arguments[1],s=i.getCoordinates(),a=o.getCoordinates(),u=0;u<s.length-1;u++)for(var c=0;c<a.length-1;c++)this.checkInteriorIntersections(i,u,o,c);else if(4===arguments.length){var l=arguments[0],h=arguments[1],p=arguments[2],f=arguments[3];if(l===p&&h===f)return null;var g=l.getCoordinates()[h],d=l.getCoordinates()[h+1],y=p.getCoordinates()[f],_=p.getCoordinates()[f+1];if(this._li.computeIntersection(g,d,y,_),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,g,d)||this.hasInteriorIntersection(this._li,y,_)))throw new Z("found non-noded intersection at "+g+"-"+d+" and "+y+"-"+_)}},or.prototype.checkValid=function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},or.prototype.checkCollapses=function(){if(0===arguments.length)for(var t=this._segStrings.iterator();t.hasNext();){var e=t.next();this.checkCollapses(e)}else if(1===arguments.length)for(var n=arguments[0].getCoordinates(),r=0;r<n.length-2;r++)this.checkCollapse(n[r],n[r+1],n[r+2])},or.prototype.hasInteriorIntersection=function(t,e,n){for(var r=0;r<t.getIntersectionNum();r++){var i=t.getIntersection(r);if(!i.equals(e)&&!i.equals(n))return!0}return!1},or.prototype.checkCollapse=function(t,e,n){if(t.equals(n))throw new Z("found non-noded collapse at "+or.fact.createLineString([t,e,n]))},or.prototype.interfaces_=function(){return[]},or.prototype.getClass=function(){return or},sr.fact.get=function(){return new _e},Object.defineProperties(or,sr);var ar=function(){this._li=null,this._pt=null,this._originalPt=null,this._ptScaled=null,this._p0Scaled=null,this._p1Scaled=null,this._scaleFactor=null,this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,this._corner=new Array(4).fill(null),this._safeEnv=null;var t=arguments[0],e=arguments[1],n=arguments[2];if(this._originalPt=t,this._pt=t,this._scaleFactor=e,this._li=n,e<=0)throw new v("Scale factor must be non-zero");1!==e&&(this._pt=new w(this.scale(t.x),this.scale(t.y)),this._p0Scaled=new w,this._p1Scaled=new w),this.initCorners(this._pt)},ur={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};ar.prototype.intersectsScaled=function(t,e){var n=Math.min(t.x,e.x),r=Math.max(t.x,e.x),i=Math.min(t.y,e.y),o=Math.max(t.y,e.y),s=this._maxx<n||this._minx>r||this._maxy<i||this._miny>o;if(s)return!1;var a=this.intersectsToleranceSquare(t,e);return et.isTrue(!(s&&a),"Found bad envelope test"),a},ar.prototype.initCorners=function(t){this._minx=t.x-.5,this._maxx=t.x+.5,this._miny=t.y-.5,this._maxy=t.y+.5,this._corner[0]=new w(this._maxx,this._maxy),this._corner[1]=new w(this._minx,this._maxy),this._corner[2]=new w(this._minx,this._miny),this._corner[3]=new w(this._maxx,this._miny)},ar.prototype.intersects=function(t,e){return 1===this._scaleFactor?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},ar.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},ar.prototype.getCoordinate=function(){return this._originalPt},ar.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},ar.prototype.getSafeEnvelope=function(){if(null===this._safeEnv){var t=ar.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new z(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},ar.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()))))},ar.prototype.intersectsToleranceSquare=function(t,e){var n=!1,r=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.isProper()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.isProper()||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.isProper()||(this._li.hasIntersection()&&(r=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.isProper()||n&&r||t.equals(this._pt)||e.equals(this._pt)))))},ar.prototype.addSnappedNode=function(t,e){var n=t.getCoordinate(e),r=t.getCoordinate(e+1);return!!this.intersects(n,r)&&(t.addIntersection(this.getCoordinate(),e),!0)},ar.prototype.interfaces_=function(){return[]},ar.prototype.getClass=function(){return ar},ur.SAFE_ENV_EXPANSION_FACTOR.get=function(){return.75},Object.defineProperties(ar,ur);var cr=function(){this.tempEnv1=new z,this.selectedSegment=new dn};cr.prototype.select=function(){if(1===arguments.length);else if(2===arguments.length){var t=arguments[1];arguments[0].getLineSegment(t,this.selectedSegment),this.select(this.selectedSegment)}},cr.prototype.interfaces_=function(){return[]},cr.prototype.getClass=function(){return cr};var lr=function(){this._index=null;var t=arguments[0];this._index=t},hr={HotPixelSnapAction:{configurable:!0}};lr.prototype.snap=function(){if(1===arguments.length){var t=arguments[0];return this.snap(t,null,-1)}if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2],i=e.getSafeEnvelope(),o=new pr(e,n,r);return this._index.query(i,{interfaces_:function(){return[Je]},visitItem:function(t){t.select(i,o)}}),o.isNodeAdded()}},lr.prototype.interfaces_=function(){return[]},lr.prototype.getClass=function(){return lr},hr.HotPixelSnapAction.get=function(){return pr},Object.defineProperties(lr,hr);var pr=function(t){function e(){t.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var e=arguments[0],n=arguments[1],r=arguments[2];this._hotPixel=e,this._parentEdge=n,this._hotPixelVertexIndex=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isNodeAdded=function(){return this._isNodeAdded},e.prototype.select=function(){if(2!==arguments.length)return t.prototype.select.apply(this,arguments);var e=arguments[1],n=arguments[0].getContext();if(null!==this._parentEdge&&n===this._parentEdge&&e===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(n,e)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(cr),fr=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new bt};fr.prototype.processIntersections=function(t,e,n,r){if(t===n&&e===r)return null;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];if(this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var u=0;u<this._li.getIntersectionNum();u++)this._interiorIntersections.add(this._li.getIntersection(u));t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1)}},fr.prototype.isDone=function(){return!1},fr.prototype.getInteriorIntersections=function(){return this._interiorIntersections},fr.prototype.interfaces_=function(){return[Hn]},fr.prototype.getClass=function(){return fr};var gr=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 it,this._li.setPrecisionModel(t),this._scaleFactor=t.getScale()};gr.prototype.checkCorrectness=function(t){var e=gn.getNodedSubstrings(t),n=new or(e);try{n.checkValid()}catch(t){if(!(t instanceof j))throw t;t.printStackTrace()}},gr.prototype.getNodedSubstrings=function(){return gn.getNodedSubstrings(this._nodedSegStrings)},gr.prototype.snapRound=function(t,e){var n=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(n),this.computeVertexSnaps(t)},gr.prototype.findInteriorIntersections=function(t,e){var n=new fr(e);return this._noder.setSegmentIntersector(n),this._noder.computeNodes(t),n.getInteriorIntersections()},gr.prototype.computeVertexSnaps=function(){if(T(arguments[0],xt))for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.computeVertexSnaps(e)}else if(arguments[0]instanceof gn)for(var n=arguments[0],r=n.getCoordinates(),i=0;i<r.length;i++){var o=new ar(r[i],this._scaleFactor,this._li);this._pointSnapper.snap(o,n,i)&&n.addIntersection(r[i],i)}},gr.prototype.computeNodes=function(t){this._nodedSegStrings=t,this._noder=new In,this._pointSnapper=new lr(this._noder.getIndex()),this.snapRound(t,this._li)},gr.prototype.computeIntersectionSnaps=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),r=new ar(n,this._scaleFactor,this._li);this._pointSnapper.snap(r)}},gr.prototype.interfaces_=function(){return[xn]},gr.prototype.getClass=function(){return gr};var dr=function(){if(this._argGeom=null,this._distance=null,this._bufParams=new wn,this._resultGeometry=null,this._saveException=null,1===arguments.length){var t=arguments[0];this._argGeom=t}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this._argGeom=e,this._bufParams=n}},yr={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};dr.prototype.bufferFixedPrecision=function(t){var e=new ir(new gr(new fe(1)),t.getScale()),n=new rr(this._bufParams);n.setWorkingPrecisionModel(t),n.setNoder(e),this._resultGeometry=n.buffer(this._argGeom,this._distance)},dr.prototype.bufferReducedPrecision=function(){var t=this;if(0===arguments.length){for(var e=dr.MAX_PRECISION_DIGITS;e>=0;e--){try{t.bufferReducedPrecision(e)}catch(e){if(!(e instanceof Oe))throw e;t._saveException=e}if(null!==t._resultGeometry)return null}throw this._saveException}if(1===arguments.length){var n=arguments[0],r=dr.precisionScaleFactor(this._argGeom,this._distance,n),i=new fe(r);this.bufferFixedPrecision(i)}},dr.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),null!==this._resultGeometry)return null;var t=this._argGeom.getFactory().getPrecisionModel();t.getType()===fe.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},dr.prototype.setQuadrantSegments=function(t){this._bufParams.setQuadrantSegments(t)},dr.prototype.bufferOriginalPrecision=function(){try{var t=new rr(this._bufParams);this._resultGeometry=t.buffer(this._argGeom,this._distance)}catch(t){if(!(t instanceof Z))throw t;this._saveException=t}},dr.prototype.getResultGeometry=function(t){return this._distance=t,this.computeGeometry(),this._resultGeometry},dr.prototype.setEndCapStyle=function(t){this._bufParams.setEndCapStyle(t)},dr.prototype.interfaces_=function(){return[]},dr.prototype.getClass=function(){return dr},dr.bufferOp=function(){if(2===arguments.length){var t=arguments[1];return new dr(arguments[0]).getResultGeometry(t)}if(3===arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof lt&&"number"==typeof arguments[1]){var e=arguments[1],n=arguments[2],r=new dr(arguments[0]);return r.setQuadrantSegments(n),r.getResultGeometry(e)}if(arguments[2]instanceof wn&&arguments[0]instanceof lt&&"number"==typeof arguments[1]){var i=arguments[1];return new dr(arguments[0],arguments[2]).getResultGeometry(i)}}else if(4===arguments.length){var o=arguments[1],s=arguments[2],a=arguments[3],u=new dr(arguments[0]);return u.setQuadrantSegments(s),u.setEndCapStyle(a),u.getResultGeometry(o)}},dr.precisionScaleFactor=function(t,e,n){var r=t.getEnvelopeInternal(),i=M.max(Math.abs(r.getMaxX()),Math.abs(r.getMaxY()),Math.abs(r.getMinX()),Math.abs(r.getMinY()))+2*(e>0?e:0),o=n-Math.trunc(Math.log(i)/Math.log(10)+1);return Math.pow(10,o)},yr.CAP_ROUND.get=function(){return wn.CAP_ROUND},yr.CAP_BUTT.get=function(){return wn.CAP_FLAT},yr.CAP_FLAT.get=function(){return wn.CAP_FLAT},yr.CAP_SQUARE.get=function(){return wn.CAP_SQUARE},yr.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(dr,yr);var _r=function(){this._pt=[new w,new w],this._distance=m.NaN,this._isNull=!0};_r.prototype.getCoordinates=function(){return this._pt},_r.prototype.getCoordinate=function(t){return this._pt[t]},_r.prototype.setMinimum=function(){if(1===arguments.length){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r<this._distance&&this.initialize(e,n,r)}},_r.prototype.initialize=function(){if(0===arguments.length)this._isNull=!0;else if(2===arguments.length){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(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(r),this._distance=i,this._isNull=!1}},_r.prototype.getDistance=function(){return this._distance},_r.prototype.setMaximum=function(){if(1===arguments.length){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r>this._distance&&this.initialize(e,n,r)}},_r.prototype.interfaces_=function(){return[]},_r.prototype.getClass=function(){return _r};var vr=function(){};vr.prototype.interfaces_=function(){return[]},vr.prototype.getClass=function(){return vr},vr.computeDistance=function(){if(arguments[2]instanceof _r&&arguments[0]instanceof Jt&&arguments[1]instanceof w)for(var t=arguments[1],e=arguments[2],n=arguments[0].getCoordinates(),r=new dn,i=0;i<n.length-1;i++){r.setCoordinates(n[i],n[i+1]);var o=r.closestPoint(t);e.setMinimum(o,t)}else if(arguments[2]instanceof _r&&arguments[0]instanceof Zt&&arguments[1]instanceof w){var s=arguments[0],a=arguments[1],u=arguments[2];vr.computeDistance(s.getExteriorRing(),a,u);for(var c=0;c<s.getNumInteriorRing();c++)vr.computeDistance(s.getInteriorRingN(c),a,u)}else if(arguments[2]instanceof _r&&arguments[0]instanceof lt&&arguments[1]instanceof w){var l=arguments[0],h=arguments[1],p=arguments[2];if(l instanceof Jt)vr.computeDistance(l,h,p);else if(l instanceof Zt)vr.computeDistance(l,h,p);else if(l instanceof jt)for(var f=l,g=0;g<f.getNumGeometries();g++){var d=f.getGeometryN(g);vr.computeDistance(d,h,p)}else p.setMinimum(l.getCoordinate(),h)}else if(arguments[2]instanceof _r&&arguments[0]instanceof dn&&arguments[1]instanceof w){var y=arguments[1],_=arguments[2],v=arguments[0].closestPoint(y);_.setMinimum(v,y)}};var mr=function(t){this._maxPtDist=new _r,this._inputGeom=t||null},xr={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};mr.prototype.computeMaxMidpointDistance=function(t){var e=new Ir(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},mr.prototype.computeMaxVertexDistance=function(t){var e=new Er(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},mr.prototype.findDistance=function(t){return this.computeMaxVertexDistance(t),this.computeMaxMidpointDistance(t),this._maxPtDist.getDistance()},mr.prototype.getDistancePoints=function(){return this._maxPtDist},mr.prototype.interfaces_=function(){return[]},mr.prototype.getClass=function(){return mr},xr.MaxPointDistanceFilter.get=function(){return Er},xr.MaxMidpointDistanceFilter.get=function(){return Ir},Object.defineProperties(mr,xr);var Er=function(t){this._maxPtDist=new _r,this._minPtDist=new _r,this._geom=t||null};Er.prototype.filter=function(t){this._minPtDist.initialize(),vr.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Er.prototype.getMaxPointDistance=function(){return this._maxPtDist},Er.prototype.interfaces_=function(){return[ft]},Er.prototype.getClass=function(){return Er};var Ir=function(t){this._maxPtDist=new _r,this._minPtDist=new _r,this._geom=t||null};Ir.prototype.filter=function(t,e){if(0===e)return null;var n=t.getCoordinate(e-1),r=t.getCoordinate(e),i=new w((n.x+r.x)/2,(n.y+r.y)/2);this._minPtDist.initialize(),vr.computeDistance(this._geom,i,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Ir.prototype.isDone=function(){return!1},Ir.prototype.isGeometryChanged=function(){return!1},Ir.prototype.getMaxPointDistance=function(){return this._maxPtDist},Ir.prototype.interfaces_=function(){return[qt]},Ir.prototype.getClass=function(){return Ir};var br=function(t){this._comps=t||null};br.prototype.filter=function(t){t instanceof Zt&&this._comps.add(t)},br.prototype.interfaces_=function(){return[Ut]},br.prototype.getClass=function(){return br},br.getPolygons=function(){if(1===arguments.length){var t=arguments[0];return br.getPolygons(t,new bt)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof Zt?n.add(e):e instanceof jt&&e.apply(new br(n)),n}};var wr=function(){if(this._lines=null,this._isForcedToLineString=!1,1===arguments.length){var t=arguments[0];this._lines=t}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this._lines=e,this._isForcedToLineString=n}};wr.prototype.filter=function(t){if(this._isForcedToLineString&&t instanceof ee){var e=t.getFactory().createLineString(t.getCoordinateSequence());return this._lines.add(e),null}t instanceof Jt&&this._lines.add(t)},wr.prototype.setForceToLineString=function(t){this._isForcedToLineString=t},wr.prototype.interfaces_=function(){return[ct]},wr.prototype.getClass=function(){return wr},wr.getGeometry=function(){if(1===arguments.length){var t=arguments[0];return t.getFactory().buildGeometry(wr.getLines(t))}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e.getFactory().buildGeometry(wr.getLines(e,n))}},wr.getLines=function(){if(1===arguments.length){var t=arguments[0];return wr.getLines(t,!1)}if(2===arguments.length){if(T(arguments[0],xt)&&T(arguments[1],xt)){for(var e=arguments[1],n=arguments[0].iterator();n.hasNext();){var r=n.next();wr.getLines(r,e)}return e}if(arguments[0]instanceof lt&&"boolean"==typeof arguments[1]){var i=arguments[0],o=arguments[1],s=new bt;return i.apply(new wr(s,o)),s}if(arguments[0]instanceof lt&&T(arguments[1],xt)){var a=arguments[0],u=arguments[1];return a instanceof Jt?u.add(a):a.apply(new wr(u)),u}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&T(arguments[0],xt)&&T(arguments[1],xt)){for(var c=arguments[1],l=arguments[2],h=arguments[0].iterator();h.hasNext();){var p=h.next();wr.getLines(p,c,l)}return c}if("boolean"==typeof arguments[2]&&arguments[0]instanceof lt&&T(arguments[1],xt)){var f=arguments[1],g=arguments[2];return arguments[0].apply(new wr(f,g)),f}}};var Nr=function(){if(this._boundaryRule=gt.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];if(null===t)throw new v("Rule must be non-null");this._boundaryRule=t}};Nr.prototype.locateInternal=function(){if(arguments[0]instanceof w&&arguments[1]instanceof Zt){var t=arguments[0],e=arguments[1];if(e.isEmpty())return O.EXTERIOR;var n=e.getExteriorRing(),r=this.locateInPolygonRing(t,n);if(r===O.EXTERIOR)return O.EXTERIOR;if(r===O.BOUNDARY)return O.BOUNDARY;for(var i=0;i<e.getNumInteriorRing();i++){var o=e.getInteriorRingN(i),s=this.locateInPolygonRing(t,o);if(s===O.INTERIOR)return O.EXTERIOR;if(s===O.BOUNDARY)return O.BOUNDARY}return O.INTERIOR}if(arguments[0]instanceof w&&arguments[1]instanceof Jt){var a=arguments[0],u=arguments[1];if(!u.getEnvelopeInternal().intersects(a))return O.EXTERIOR;var c=u.getCoordinates();return u.isClosed()||!a.equals(c[0])&&!a.equals(c[c.length-1])?at.isOnLine(a,c)?O.INTERIOR:O.EXTERIOR:O.BOUNDARY}if(arguments[0]instanceof w&&arguments[1]instanceof Qt){var l=arguments[0];return arguments[1].getCoordinate().equals2D(l)?O.INTERIOR:O.EXTERIOR}},Nr.prototype.locateInPolygonRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?at.locatePointInRing(t,e.getCoordinates()):O.EXTERIOR},Nr.prototype.intersects=function(t,e){return this.locate(t,e)!==O.EXTERIOR},Nr.prototype.updateLocationInfo=function(t){t===O.INTERIOR&&(this._isIn=!0),t===O.BOUNDARY&&this._numBoundaries++},Nr.prototype.computeLocation=function(t,e){if(e instanceof Qt&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof Jt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Zt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Vt)for(var n=e,r=0;r<n.getNumGeometries();r++){var i=n.getGeometryN(r);this.updateLocationInfo(this.locateInternal(t,i))}else if(e instanceof ne)for(var o=e,s=0;s<o.getNumGeometries();s++){var a=o.getGeometryN(s);this.updateLocationInfo(this.locateInternal(t,a))}else if(e instanceof jt)for(var u=new qn(e);u.hasNext();){var c=u.next();c!==e&&this.computeLocation(t,c)}},Nr.prototype.locate=function(t,e){return e.isEmpty()?O.EXTERIOR:e instanceof Jt||e instanceof Zt?this.locateInternal(t,e):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(t,e),this._boundaryRule.isInBoundary(this._numBoundaries)?O.BOUNDARY:this._numBoundaries>0||this._isIn?O.INTERIOR:O.EXTERIOR)},Nr.prototype.interfaces_=function(){return[]},Nr.prototype.getClass=function(){return Nr};var Sr=function t(){if(this._component=null,this._segIndex=null,this._pt=null,2===arguments.length)t.call(this,arguments[0],t.INSIDE_AREA,arguments[1]);else if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2];this._component=e,this._segIndex=n,this._pt=r}},Cr={INSIDE_AREA:{configurable:!0}};Sr.prototype.isInsideArea=function(){return this._segIndex===Sr.INSIDE_AREA},Sr.prototype.getCoordinate=function(){return this._pt},Sr.prototype.getGeometryComponent=function(){return this._component},Sr.prototype.getSegmentIndex=function(){return this._segIndex},Sr.prototype.interfaces_=function(){return[]},Sr.prototype.getClass=function(){return Sr},Cr.INSIDE_AREA.get=function(){return-1},Object.defineProperties(Sr,Cr);var Or=function(t){this._pts=t||null};Or.prototype.filter=function(t){t instanceof Qt&&this._pts.add(t)},Or.prototype.interfaces_=function(){return[Ut]},Or.prototype.getClass=function(){return Or},Or.getPoints=function(){if(1===arguments.length){var t=arguments[0];return t instanceof Qt?Ze.singletonList(t):Or.getPoints(t,new bt)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof Qt?n.add(e):e instanceof jt&&e.apply(new Or(n)),n}};var Lr=function(){this._locations=null;var t=arguments[0];this._locations=t};Lr.prototype.filter=function(t){(t instanceof Qt||t instanceof Jt||t instanceof Zt)&&this._locations.add(new Sr(t,0,t.getCoordinate()))},Lr.prototype.interfaces_=function(){return[Ut]},Lr.prototype.getClass=function(){return Lr},Lr.getLocations=function(t){var e=new bt;return t.apply(new Lr(e)),e};var Tr=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new Nr,this._minDistanceLocation=null,this._minDistance=m.MAX_VALUE,2===arguments.length){var t=arguments[0],e=arguments[1];this._geom=[t,e],this._terminateDistance=0}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=n,this._geom[1]=r,this._terminateDistance=i}};Tr.prototype.computeContainmentDistance=function(){if(0===arguments.length){var t=new Array(2).fill(null);if(this.computeContainmentDistance(0,t),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],r=1-e,i=br.getPolygons(this._geom[e]);if(i.size()>0){var o=Lr.getLocations(this._geom[r]);if(this.computeContainmentDistance(o,i,n),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[r]=n[0],this._minDistanceLocation[e]=n[1],null}}else if(3===arguments.length)if(arguments[2]instanceof Array&&T(arguments[0],It)&&T(arguments[1],It)){for(var s=arguments[0],a=arguments[1],u=arguments[2],c=0;c<s.size();c++)for(var l=s.get(c),h=0;h<a.size();h++)if(this.computeContainmentDistance(l,a.get(h),u),this._minDistance<=this._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof Sr&&arguments[1]instanceof Zt){var p=arguments[0],f=arguments[1],g=arguments[2],d=p.getCoordinate();if(O.EXTERIOR!==this._ptLocator.locate(d,f))return this._minDistance=0,g[0]=p,g[1]=new Sr(f,d),null}},Tr.prototype.computeMinDistanceLinesPoints=function(t,e,n){for(var r=0;r<t.size();r++)for(var i=t.get(r),o=0;o<e.size();o++){var s=e.get(o);if(this.computeMinDistance(i,s,n),this._minDistance<=this._terminateDistance)return null}},Tr.prototype.computeFacetDistance=function(){var t=new Array(2).fill(null),e=wr.getLines(this._geom[0]),n=wr.getLines(this._geom[1]),r=Or.getPoints(this._geom[0]),i=Or.getPoints(this._geom[1]);return this.computeMinDistanceLines(e,n,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(e,i,t),this.updateMinDistance(t,!1),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(n,r,t),this.updateMinDistance(t,!0),this._minDistance<=this._terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistancePoints(r,i,t),void this.updateMinDistance(t,!1))))},Tr.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},Tr.prototype.updateMinDistance=function(t,e){if(null===t[0])return null;e?(this._minDistanceLocation[0]=t[1],this._minDistanceLocation[1]=t[0]):(this._minDistanceLocation[0]=t[0],this._minDistanceLocation[1]=t[1])},Tr.prototype.nearestPoints=function(){return this.computeMinDistance(),[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()]},Tr.prototype.computeMinDistance=function(){if(0===arguments.length){if(null!==this._minDistanceLocation)return null;if(this._minDistanceLocation=new Array(2).fill(null),this.computeContainmentDistance(),this._minDistance<=this._terminateDistance)return null;this.computeFacetDistance()}else if(3===arguments.length)if(arguments[2]instanceof Array&&arguments[0]instanceof Jt&&arguments[1]instanceof Qt){var t=arguments[0],e=arguments[1],n=arguments[2];if(t.getEnvelopeInternal().distance(e.getEnvelopeInternal())>this._minDistance)return null;for(var r=t.getCoordinates(),i=e.getCoordinate(),o=0;o<r.length-1;o++){var s=at.distancePointLine(i,r[o],r[o+1]);if(s<this._minDistance){this._minDistance=s;var a=new dn(r[o],r[o+1]).closestPoint(i);n[0]=new Sr(t,o,a),n[1]=new Sr(e,0,i)}if(this._minDistance<=this._terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof Jt&&arguments[1]instanceof Jt){var u=arguments[0],c=arguments[1],l=arguments[2];if(u.getEnvelopeInternal().distance(c.getEnvelopeInternal())>this._minDistance)return null;for(var h=u.getCoordinates(),p=c.getCoordinates(),f=0;f<h.length-1;f++)for(var g=0;g<p.length-1;g++){var d=at.distanceLineLine(h[f],h[f+1],p[g],p[g+1]);if(d<this._minDistance){this._minDistance=d;var y=new dn(h[f],h[f+1]),_=new dn(p[g],p[g+1]),v=y.closestPoints(_);l[0]=new Sr(u,f,v[0]),l[1]=new Sr(c,g,v[1])}if(this._minDistance<=this._terminateDistance)return null}}},Tr.prototype.computeMinDistancePoints=function(t,e,n){for(var r=0;r<t.size();r++)for(var i=t.get(r),o=0;o<e.size();o++){var s=e.get(o),a=i.getCoordinate().distance(s.getCoordinate());if(a<this._minDistance&&(this._minDistance=a,n[0]=new Sr(i,0,i.getCoordinate()),n[1]=new Sr(s,0,s.getCoordinate())),this._minDistance<=this._terminateDistance)return null}},Tr.prototype.distance=function(){if(null===this._geom[0]||null===this._geom[1])throw new v("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},Tr.prototype.computeMinDistanceLines=function(t,e,n){for(var r=0;r<t.size();r++)for(var i=t.get(r),o=0;o<e.size();o++){var s=e.get(o);if(this.computeMinDistance(i,s,n),this._minDistance<=this._terminateDistance)return null}},Tr.prototype.interfaces_=function(){return[]},Tr.prototype.getClass=function(){return Tr},Tr.distance=function(t,e){return new Tr(t,e).distance()},Tr.isWithinDistance=function(t,e,n){return new Tr(t,e,n).distance()<=n},Tr.nearestPoints=function(t,e){return new Tr(t,e).nearestPoints()};var Mr=function(){this._pt=[new w,new w],this._distance=m.NaN,this._isNull=!0};Mr.prototype.getCoordinates=function(){return this._pt},Mr.prototype.getCoordinate=function(t){return this._pt[t]},Mr.prototype.setMinimum=function(){if(1===arguments.length){var t=arguments[0];this.setMinimum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r<this._distance&&this.initialize(e,n,r)}},Mr.prototype.initialize=function(){if(0===arguments.length)this._isNull=!0;else if(2===arguments.length){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(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(r),this._distance=i,this._isNull=!1}},Mr.prototype.toString=function(){return $.toLineString(this._pt[0],this._pt[1])},Mr.prototype.getDistance=function(){return this._distance},Mr.prototype.setMaximum=function(){if(1===arguments.length){var t=arguments[0];this.setMaximum(t._pt[0],t._pt[1])}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(e,n),null;var r=e.distance(n);r>this._distance&&this.initialize(e,n,r)}},Mr.prototype.interfaces_=function(){return[]},Mr.prototype.getClass=function(){return Mr};var Pr=function(){};Pr.prototype.interfaces_=function(){return[]},Pr.prototype.getClass=function(){return Pr},Pr.computeDistance=function(){if(arguments[2]instanceof Mr&&arguments[0]instanceof Jt&&arguments[1]instanceof w)for(var t=arguments[0],e=arguments[1],n=arguments[2],r=new dn,i=t.getCoordinates(),o=0;o<i.length-1;o++){r.setCoordinates(i[o],i[o+1]);var s=r.closestPoint(e);n.setMinimum(s,e)}else if(arguments[2]instanceof Mr&&arguments[0]instanceof Zt&&arguments[1]instanceof w){var a=arguments[0],u=arguments[1],c=arguments[2];Pr.computeDistance(a.getExteriorRing(),u,c);for(var l=0;l<a.getNumInteriorRing();l++)Pr.computeDistance(a.getInteriorRingN(l),u,c)}else if(arguments[2]instanceof Mr&&arguments[0]instanceof lt&&arguments[1]instanceof w){var h=arguments[0],p=arguments[1],f=arguments[2];if(h instanceof Jt)Pr.computeDistance(h,p,f);else if(h instanceof Zt)Pr.computeDistance(h,p,f);else if(h instanceof jt)for(var g=h,d=0;d<g.getNumGeometries();d++){var y=g.getGeometryN(d);Pr.computeDistance(y,p,f)}else f.setMinimum(h.getCoordinate(),p)}else if(arguments[2]instanceof Mr&&arguments[0]instanceof dn&&arguments[1]instanceof w){var _=arguments[1],v=arguments[2],m=arguments[0].closestPoint(_);v.setMinimum(m,_)}};var Rr=function(){this._g0=null,this._g1=null,this._ptDist=new Mr,this._densifyFrac=0;var t=arguments[0],e=arguments[1];this._g0=t,this._g1=e},Ar={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};Rr.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},Rr.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new v("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},Rr.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},Rr.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Rr.prototype.computeOrientedDistance=function(t,e,n){var r=new Dr(e);if(t.apply(r),n.setMaximum(r.getMaxPointDistance()),this._densifyFrac>0){var i=new Fr(e,this._densifyFrac);t.apply(i),n.setMaximum(i.getMaxPointDistance())}},Rr.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Rr.prototype.interfaces_=function(){return[]},Rr.prototype.getClass=function(){return Rr},Rr.distance=function(){if(2===arguments.length)return new Rr(arguments[0],arguments[1]).distance();if(3===arguments.length){var t=arguments[2],e=new Rr(arguments[0],arguments[1]);return e.setDensifyFraction(t),e.distance()}},Ar.MaxPointDistanceFilter.get=function(){return Dr},Ar.MaxDensifiedByFractionDistanceFilter.get=function(){return Fr},Object.defineProperties(Rr,Ar);var Dr=function(){this._maxPtDist=new Mr,this._minPtDist=new Mr,this._euclideanDist=new Pr,this._geom=null;var t=arguments[0];this._geom=t};Dr.prototype.filter=function(t){this._minPtDist.initialize(),Pr.computeDistance(this._geom,t,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Dr.prototype.getMaxPointDistance=function(){return this._maxPtDist},Dr.prototype.interfaces_=function(){return[ft]},Dr.prototype.getClass=function(){return Dr};var Fr=function(){this._maxPtDist=new Mr,this._minPtDist=new Mr,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))};Fr.prototype.filter=function(t,e){if(0===e)return null;for(var n=t.getCoordinate(e-1),r=t.getCoordinate(e),i=(r.x-n.x)/this._numSubSegs,o=(r.y-n.y)/this._numSubSegs,s=0;s<this._numSubSegs;s++){var a=n.x+s*i,u=n.y+s*o,c=new w(a,u);this._minPtDist.initialize(),Pr.computeDistance(this._geom,c,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)}},Fr.prototype.isDone=function(){return!1},Fr.prototype.isGeometryChanged=function(){return!1},Fr.prototype.getMaxPointDistance=function(){return this._maxPtDist},Fr.prototype.interfaces_=function(){return[qt]},Fr.prototype.getClass=function(){return Fr};var kr=function(t,e,n){this._minValidDistance=null,this._maxValidDistance=null,this._minDistanceFound=null,this._maxDistanceFound=null,this._isValid=!0,this._errMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._bufDistance=e||null,this._result=n||null},Br={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};kr.prototype.checkMaximumDistance=function(t,e,n){var r=new Rr(e,t);if(r.setDensifyFraction(.25),this._maxDistanceFound=r.orientedDistance(),this._maxDistanceFound>n){this._isValid=!1;var i=r.getCoordinates();this._errorLocation=i[1],this._errorIndicator=t.getFactory().createLineString(i),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+$.toLineString(i[0],i[1])+")"}},kr.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=kr.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,!(!this._input.isEmpty()&&!this._result.isEmpty())||(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),kr.VERBOSE&&Y.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},kr.prototype.checkNegativeValid=function(){if(!(this._input instanceof Zt||this._input instanceof ne||this._input instanceof jt))return null;var t=this.getPolygonLines(this._input);if(this.checkMinimumDistance(t,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(t,this._result,this._maxValidDistance)},kr.prototype.getErrorIndicator=function(){return this._errorIndicator},kr.prototype.checkMinimumDistance=function(t,e,n){var r=new Tr(t,e,n);if(this._minDistanceFound=r.distance(),this._minDistanceFound<n){this._isValid=!1;var i=r.nearestPoints();this._errorLocation=r.nearestPoints()[1],this._errorIndicator=t.getFactory().createLineString(i),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+$.toLineString(i[0],i[1])+" )"}},kr.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)},kr.prototype.getErrorLocation=function(){return this._errorLocation},kr.prototype.getPolygonLines=function(t){for(var e=new bt,n=new wr(e),r=br.getPolygons(t).iterator();r.hasNext();)r.next().apply(n);return t.getFactory().buildGeometry(e)},kr.prototype.getErrorMessage=function(){return this._errMsg},kr.prototype.interfaces_=function(){return[]},kr.prototype.getClass=function(){return kr},Br.VERBOSE.get=function(){return!1},Br.MAX_DISTANCE_DIFF_FRAC.get=function(){return.012},Object.defineProperties(kr,Br);var Gr=function(t,e,n){this._isValid=!0,this._errorMsg=null,this._errorLocation=null,this._errorIndicator=null,this._input=t||null,this._distance=e||null,this._result=n||null},Ur={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};Gr.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},Gr.prototype.checkEnvelope=function(){if(this._distance<0)return null;var t=this._distance*Gr.MAX_ENV_DIFF_FRAC;0===t&&(t=.001);var e=new z(this._input.getEnvelopeInternal());e.expandBy(this._distance);var n=new z(this._result.getEnvelopeInternal());n.expandBy(t),n.contains(e)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(n)),this.report("Envelope")},Gr.prototype.checkDistance=function(){var t=new kr(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")},Gr.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")},Gr.prototype.checkPolygonal=function(){this._result instanceof Zt||this._result instanceof ne||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},Gr.prototype.getErrorIndicator=function(){return this._errorIndicator},Gr.prototype.getErrorLocation=function(){return this._errorLocation},Gr.prototype.checkExpectedEmpty=function(){return this._input.getDimension()>=2||this._distance>0?null:(this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),void this.report("ExpectedEmpty"))},Gr.prototype.report=function(t){if(!Gr.VERBOSE)return null;Y.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},Gr.prototype.getErrorMessage=function(){return this._errorMsg},Gr.prototype.interfaces_=function(){return[]},Gr.prototype.getClass=function(){return Gr},Gr.isValidMsg=function(t,e,n){var r=new Gr(t,e,n);return r.isValid()?null:r.getErrorMessage()},Gr.isValid=function(t,e,n){return!!new Gr(t,e,n).isValid()},Ur.VERBOSE.get=function(){return!1},Ur.MAX_ENV_DIFF_FRAC.get=function(){return.012},Object.defineProperties(Gr,Ur);var qr=function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e};qr.prototype.getCoordinates=function(){return this._pts},qr.prototype.size=function(){return this._pts.length},qr.prototype.getCoordinate=function(t){return this._pts[t]},qr.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},qr.prototype.getSegmentOctant=function(t){return t===this._pts.length-1?-1:hn.octant(this.getCoordinate(t),this.getCoordinate(t+1))},qr.prototype.setData=function(t){this._data=t},qr.prototype.getData=function(){return this._data},qr.prototype.toString=function(){return $.toLineString(new ue(this._pts))},qr.prototype.interfaces_=function(){return[pn]},qr.prototype.getClass=function(){return qr};var jr=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new bt,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null};jr.prototype.getInteriorIntersection=function(){return this._interiorIntersection},jr.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},jr.prototype.getIntersectionSegments=function(){return this._intSegments},jr.prototype.count=function(){return this._intersectionCount},jr.prototype.getIntersections=function(){return this._intersections},jr.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},jr.prototype.setKeepIntersections=function(t){this._keepIntersections=t},jr.prototype.processIntersections=function(t,e,n,r){if(!this._findAllIntersections&&this.hasIntersection())return null;if(t===n&&e===r)return null;if(this._isCheckEndSegmentsOnly&&!this.isEndSegment(t,e)&&!this.isEndSegment(n,r))return null;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=i,this._intSegments[1]=o,this._intSegments[2]=s,this._intSegments[3]=a,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},jr.prototype.isEndSegment=function(t,e){return 0===e||e>=t.size()-2},jr.prototype.hasIntersection=function(){return null!==this._interiorIntersection},jr.prototype.isDone=function(){return!this._findAllIntersections&&null!==this._interiorIntersection},jr.prototype.interfaces_=function(){return[Hn]},jr.prototype.getClass=function(){return jr},jr.createAllIntersectionsFinder=function(t){var e=new jr(t);return e.setFindAllIntersections(!0),e},jr.createAnyIntersectionFinder=function(t){return new jr(t)},jr.createIntersectionCounter=function(t){var e=new jr(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};var Vr=function(){this._li=new it,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var t=arguments[0];this._segStrings=t};Vr.prototype.execute=function(){if(null!==this._segInt)return null;this.checkInteriorIntersections()},Vr.prototype.getIntersections=function(){return this._segInt.getIntersections()},Vr.prototype.isValid=function(){return this.execute(),this._isValid},Vr.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},Vr.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new jr(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new In;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},Vr.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Oe(this.getErrorMessage(),this._segInt.getInteriorIntersection())},Vr.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+$.toLineString(t[0],t[1])+" and "+$.toLineString(t[2],t[3])},Vr.prototype.interfaces_=function(){return[]},Vr.prototype.getClass=function(){return Vr},Vr.computeIntersections=function(t){var e=new Vr(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};var Yr=function t(){this._nv=null;var e=arguments[0];this._nv=new Vr(t.toSegmentStrings(e))};Yr.prototype.checkValid=function(){this._nv.checkValid()},Yr.prototype.interfaces_=function(){return[]},Yr.prototype.getClass=function(){return Yr},Yr.toSegmentStrings=function(t){for(var e=new bt,n=t.iterator();n.hasNext();){var r=n.next();e.add(new qr(r.getCoordinates(),r))}return e},Yr.checkValid=function(t){new Yr(t).checkValid()};var Xr=function(t){this._mapOp=t};Xr.prototype.map=function(t){for(var e=new bt,n=0;n<t.getNumGeometries();n++){var r=this._mapOp.map(t.getGeometryN(n));r.isEmpty()||e.add(r)}return t.getFactory().createGeometryCollection(_e.toGeometryArray(e))},Xr.prototype.interfaces_=function(){return[]},Xr.prototype.getClass=function(){return Xr},Xr.map=function(t,e){return new Xr(e).map(t)};var zr=function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new bt,this._resultLineList=new bt;var t=arguments[0],e=arguments[1],n=arguments[2];this._op=t,this._geometryFactory=e,this._ptLocator=n};zr.prototype.collectLines=function(t){for(var e=this._op.getGraph().getEdgeEnds().iterator();e.hasNext();){var n=e.next();this.collectLineEdge(n,t,this._lineEdgesList),this.collectBoundaryTouchEdge(n,t,this._lineEdgesList)}},zr.prototype.labelIsolatedLine=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(e));t.getLabel().setLocation(e,n)},zr.prototype.build=function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList},zr.prototype.collectLineEdge=function(t,e,n){var r=t.getLabel(),i=t.getEdge();t.isLineEdge()&&(t.isVisited()||!Si.isResultOfOp(r,e)||i.isCovered()||(n.add(i),t.setVisitedEdge(!0)))},zr.prototype.findCoveredLineEdges=function(){for(var t=this._op.getGraph().getNodes().iterator();t.hasNext();)t.next().getEdges().findCoveredLineEdges();for(var e=this._op.getGraph().getEdgeEnds().iterator();e.hasNext();){var n=e.next(),r=n.getEdge();if(n.isLineEdge()&&!r.isCoveredSet()){var i=this._op.isCoveredByA(n.getCoordinate());r.setCovered(i)}}},zr.prototype.labelIsolatedLines=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),r=n.getLabel();n.isIsolated()&&(r.isNull(0)?this.labelIsolatedLine(n,0):this.labelIsolatedLine(n,1))}},zr.prototype.buildLines=function(t){for(var e=this._lineEdgesList.iterator();e.hasNext();){var n=e.next(),r=this._geometryFactory.createLineString(n.getCoordinates());this._resultLineList.add(r),n.setInResult(!0)}},zr.prototype.collectBoundaryTouchEdge=function(t,e,n){var r=t.getLabel();return t.isLineEdge()||t.isVisited()||t.isInteriorAreaEdge()||t.getEdge().isInResult()?null:(et.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),void(Si.isResultOfOp(r,e)&&e===Si.INTERSECTION&&(n.add(t.getEdge()),t.setVisitedEdge(!0))))},zr.prototype.interfaces_=function(){return[]},zr.prototype.getClass=function(){return zr};var Wr=function(){this._op=null,this._geometryFactory=null,this._resultPointList=new bt;var t=arguments[0],e=arguments[1];this._op=t,this._geometryFactory=e};Wr.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var n=this._geometryFactory.createPoint(e);this._resultPointList.add(n)}},Wr.prototype.extractNonCoveredResultNodes=function(t){for(var e=this._op.getGraph().getNodes().iterator();e.hasNext();){var n=e.next();if(!(n.isInResult()||n.isIncidentEdgeInResult()||0!==n.getEdges().getDegree()&&t!==Si.INTERSECTION)){var r=n.getLabel();Si.isResultOfOp(r,t)&&this.filterCoveredNodeToPoint(n)}}},Wr.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList},Wr.prototype.interfaces_=function(){return[]},Wr.prototype.getClass=function(){return Wr};var Hr=function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1};Hr.prototype.transformPoint=function(t,e){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},Hr.prototype.transformPolygon=function(t,e){var n=!0,r=this.transformLinearRing(t.getExteriorRing(),t);null!==r&&r instanceof ee&&!r.isEmpty()||(n=!1);for(var i=new bt,o=0;o<t.getNumInteriorRing();o++){var s=this.transformLinearRing(t.getInteriorRingN(o),t);null===s||s.isEmpty()||(s instanceof ee||(n=!1),i.add(s))}if(n)return this._factory.createPolygon(r,i.toArray([]));var a=new bt;return null!==r&&a.add(r),a.addAll(i),this._factory.buildGeometry(a)},Hr.prototype.createCoordinateSequence=function(t){return this._factory.getCoordinateSequenceFactory().create(t)},Hr.prototype.getInputGeometry=function(){return this._inputGeom},Hr.prototype.transformMultiLineString=function(t,e){for(var n=new bt,r=0;r<t.getNumGeometries();r++){var i=this.transformLineString(t.getGeometryN(r),t);null!==i&&(i.isEmpty()||n.add(i))}return this._factory.buildGeometry(n)},Hr.prototype.transformCoordinates=function(t,e){return this.copy(t)},Hr.prototype.transformLineString=function(t,e){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))},Hr.prototype.transformMultiPoint=function(t,e){for(var n=new bt,r=0;r<t.getNumGeometries();r++){var i=this.transformPoint(t.getGeometryN(r),t);null!==i&&(i.isEmpty()||n.add(i))}return this._factory.buildGeometry(n)},Hr.prototype.transformMultiPolygon=function(t,e){for(var n=new bt,r=0;r<t.getNumGeometries();r++){var i=this.transformPolygon(t.getGeometryN(r),t);null!==i&&(i.isEmpty()||n.add(i))}return this._factory.buildGeometry(n)},Hr.prototype.copy=function(t){return t.copy()},Hr.prototype.transformGeometryCollection=function(t,e){for(var n=new bt,r=0;r<t.getNumGeometries();r++){var i=this.transform(t.getGeometryN(r));null!==i&&(this._pruneEmptyGeometry&&i.isEmpty()||n.add(i))}return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(_e.toGeometryArray(n)):this._factory.buildGeometry(n)},Hr.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof Qt)return this.transformPoint(t,null);if(t instanceof te)return this.transformMultiPoint(t,null);if(t instanceof ee)return this.transformLinearRing(t,null);if(t instanceof Jt)return this.transformLineString(t,null);if(t instanceof Vt)return this.transformMultiLineString(t,null);if(t instanceof Zt)return this.transformPolygon(t,null);if(t instanceof ne)return this.transformMultiPolygon(t,null);if(t instanceof jt)return this.transformGeometryCollection(t,null);throw new v("Unknown Geometry subtype: "+t.getClass().getName())},Hr.prototype.transformLinearRing=function(t,e){var n=this.transformCoordinates(t.getCoordinateSequence(),t);if(null===n)return this._factory.createLinearRing(null);var r=n.size();return r>0&&r<4&&!this._preserveType?this._factory.createLineString(n):this._factory.createLinearRing(n)},Hr.prototype.interfaces_=function(){return[]},Hr.prototype.getClass=function(){return Hr};var Jr=function t(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new dn,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof Jt&&"number"==typeof arguments[1]){var e=arguments[1];t.call(this,arguments[0].getCoordinates(),e)}else if(arguments[0]instanceof Array&&"number"==typeof arguments[1]){var n=arguments[0],r=arguments[1];this._srcPts=n,this._isClosed=t.isClosed(n),this._snapTolerance=r}};Jr.prototype.snapVertices=function(t,e){for(var n=this._isClosed?t.size()-1:t.size(),r=0;r<n;r++){var i=t.get(r),o=this.findSnapForVertex(i,e);null!==o&&(t.set(r,new w(o)),0===r&&this._isClosed&&t.set(t.size()-1,new w(o)))}},Jr.prototype.findSnapForVertex=function(t,e){for(var n=0;n<e.length;n++){if(t.equals2D(e[n]))return null;if(t.distance(e[n])<this._snapTolerance)return e[n]}return null},Jr.prototype.snapTo=function(t){var e=new Nt(this._srcPts);return this.snapVertices(e,t),this.snapSegments(e,t),e.toCoordinateArray()},Jr.prototype.snapSegments=function(t,e){if(0===e.length)return null;var n=e.length;e[0].equals2D(e[e.length-1])&&(n=e.length-1);for(var r=0;r<n;r++){var i=e[r],o=this.findSegmentIndexToSnap(i,t);o>=0&&t.add(o+1,new w(i),!1)}},Jr.prototype.findSegmentIndexToSnap=function(t,e){for(var n=m.MAX_VALUE,r=-1,i=0;i<e.size()-1;i++){if(this._seg.p0=e.get(i),this._seg.p1=e.get(i+1),this._seg.p0.equals2D(t)||this._seg.p1.equals2D(t)){if(this._allowSnappingToSourceVertices)continue;return-1}var o=this._seg.distance(t);o<this._snapTolerance&&o<n&&(n=o,r=i)}return r},Jr.prototype.setAllowSnappingToSourceVertices=function(t){this._allowSnappingToSourceVertices=t},Jr.prototype.interfaces_=function(){return[]},Jr.prototype.getClass=function(){return Jr},Jr.isClosed=function(t){return!(t.length<=1)&&t[0].equals2D(t[t.length-1])};var Kr=function(t){this._srcGeom=t||null},Qr={SNAP_PRECISION_FACTOR:{configurable:!0}};Kr.prototype.snapTo=function(t,e){var n=this.extractTargetCoordinates(t);return new $r(e,n).transform(this._srcGeom)},Kr.prototype.snapToSelf=function(t,e){var n=this.extractTargetCoordinates(this._srcGeom),r=new $r(t,n,!0).transform(this._srcGeom),i=r;return e&&T(i,$t)&&(i=r.buffer(0)),i},Kr.prototype.computeSnapTolerance=function(t){return this.computeMinimumSegmentLength(t)/10},Kr.prototype.extractTargetCoordinates=function(t){for(var e=new f,n=t.getCoordinates(),r=0;r<n.length;r++)e.add(n[r]);return e.toArray(new Array(0).fill(null))},Kr.prototype.computeMinimumSegmentLength=function(t){for(var e=m.MAX_VALUE,n=0;n<t.length-1;n++){var r=t[n].distance(t[n+1]);r<e&&(e=r)}return e},Kr.prototype.interfaces_=function(){return[]},Kr.prototype.getClass=function(){return Kr},Kr.snap=function(t,e,n){var r=new Array(2).fill(null),i=new Kr(t);r[0]=i.snapTo(e,n);var o=new Kr(e);return r[1]=o.snapTo(r[0],n),r},Kr.computeOverlaySnapTolerance=function(){if(1===arguments.length){var t=arguments[0],e=Kr.computeSizeBasedSnapTolerance(t),n=t.getPrecisionModel();if(n.getType()===fe.FIXED){var r=1/n.getScale()*2/1.415;r>e&&(e=r)}return e}if(2===arguments.length){var i=arguments[0],o=arguments[1];return Math.min(Kr.computeOverlaySnapTolerance(i),Kr.computeOverlaySnapTolerance(o))}},Kr.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal();return Math.min(e.getHeight(),e.getWidth())*Kr.SNAP_PRECISION_FACTOR},Kr.snapToSelf=function(t,e,n){return new Kr(t).snapToSelf(e,n)},Qr.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(Kr,Qr);var $r=function(t){function e(e,n,r){t.call(this),this._snapTolerance=e||null,this._snapPts=n||null,this._isSelfSnap=void 0!==r&&r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.snapLine=function(t,e){var n=new Jr(t,this._snapTolerance);return n.setAllowSnappingToSourceVertices(this._isSelfSnap),n.snapTo(e)},e.prototype.transformCoordinates=function(t,e){var n=t.toCoordinateArray(),r=this.snapLine(n,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Hr),Zr=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};Zr.prototype.getCommon=function(){return m.longBitsToDouble(this._commonBits)},Zr.prototype.add=function(t){var e=m.doubleToLongBits(t);return this._isFirst?(this._commonBits=e,this._commonSignExp=Zr.signExpBits(this._commonBits),this._isFirst=!1,null):Zr.signExpBits(e)!==this._commonSignExp?(this._commonBits=0,null):(this._commonMantissaBitsCount=Zr.numCommonMostSigMantissaBits(this._commonBits,e),void(this._commonBits=Zr.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))))},Zr.prototype.toString=function(){if(1===arguments.length){var t=arguments[0],e=m.longBitsToDouble(t),n="0000000000000000000000000000000000000000000000000000000000000000"+m.toBinaryString(t),r=n.substring(n.length-64);return r.substring(0,1)+" "+r.substring(1,12)+"(exp) "+r.substring(12)+" [ "+e+" ]"}},Zr.prototype.interfaces_=function(){return[]},Zr.prototype.getClass=function(){return Zr},Zr.getBit=function(t,e){return 0!=(t&1<<e)?1:0},Zr.signExpBits=function(t){return t>>52},Zr.zeroLowerBits=function(t,e){return t&~((1<<e)-1)},Zr.numCommonMostSigMantissaBits=function(t,e){for(var n=0,r=52;r>=0;r--){if(Zr.getBit(t,r)!==Zr.getBit(e,r))return n;n++}return 52};var ti=function(){this._commonCoord=null,this._ccFilter=new ni},ei={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};ti.prototype.addCommonBits=function(t){var e=new ri(this._commonCoord);t.apply(e),t.geometryChanged()},ti.prototype.removeCommonBits=function(t){if(0===this._commonCoord.x&&0===this._commonCoord.y)return t;var e=new w(this._commonCoord);e.x=-e.x,e.y=-e.y;var n=new ri(e);return t.apply(n),t.geometryChanged(),t},ti.prototype.getCommonCoordinate=function(){return this._commonCoord},ti.prototype.add=function(t){t.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},ti.prototype.interfaces_=function(){return[]},ti.prototype.getClass=function(){return ti},ei.CommonCoordinateFilter.get=function(){return ni},ei.Translater.get=function(){return ri},Object.defineProperties(ti,ei);var ni=function(){this._commonBitsX=new Zr,this._commonBitsY=new Zr};ni.prototype.filter=function(t){this._commonBitsX.add(t.x),this._commonBitsY.add(t.y)},ni.prototype.getCommonCoordinate=function(){return new w(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},ni.prototype.interfaces_=function(){return[ft]},ni.prototype.getClass=function(){return ni};var ri=function(){this.trans=null;var t=arguments[0];this.trans=t};ri.prototype.filter=function(t,e){var n=t.getOrdinate(e,0)+this.trans.x,r=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,n),t.setOrdinate(e,1,r)},ri.prototype.isDone=function(){return!1},ri.prototype.isGeometryChanged=function(){return!0},ri.prototype.interfaces_=function(){return[qt]},ri.prototype.getClass=function(){return ri};var ii=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()};ii.prototype.selfSnap=function(t){return new Kr(t).snapTo(t,this._snapTolerance)},ii.prototype.removeCommonBits=function(t){this._cbr=new ti,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},ii.prototype.prepareResult=function(t){return this._cbr.addCommonBits(t),t},ii.prototype.getResultGeometry=function(t){var e=this.snap(this._geom),n=Si.overlayOp(e[0],e[1],t);return this.prepareResult(n)},ii.prototype.checkValid=function(t){t.isValid()||Y.out.println("Snapped geometry is invalid")},ii.prototype.computeSnapTolerance=function(){this._snapTolerance=Kr.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},ii.prototype.snap=function(t){var e=this.removeCommonBits(t);return Kr.snap(e[0],e[1],this._snapTolerance)},ii.prototype.interfaces_=function(){return[]},ii.prototype.getClass=function(){return ii},ii.overlayOp=function(t,e,n){return new ii(t,e).getResultGeometry(n)},ii.union=function(t,e){return ii.overlayOp(t,e,Si.UNION)},ii.intersection=function(t,e){return ii.overlayOp(t,e,Si.INTERSECTION)},ii.symDifference=function(t,e){return ii.overlayOp(t,e,Si.SYMDIFFERENCE)},ii.difference=function(t,e){return ii.overlayOp(t,e,Si.DIFFERENCE)};var oi=function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e};oi.prototype.getResultGeometry=function(t){var e=null,n=!1,r=null;try{e=Si.overlayOp(this._geom[0],this._geom[1],t),n=!0}catch(t){if(!(t instanceof Z))throw t;r=t}if(!n)try{e=ii.overlayOp(this._geom[0],this._geom[1],t)}catch(t){throw t instanceof Z?r:t}return e},oi.prototype.interfaces_=function(){return[]},oi.prototype.getClass=function(){return oi},oi.overlayOp=function(t,e,n){return new oi(t,e).getResultGeometry(n)},oi.union=function(t,e){return oi.overlayOp(t,e,Si.UNION)},oi.intersection=function(t,e){return oi.overlayOp(t,e,Si.INTERSECTION)},oi.symDifference=function(t,e){return oi.overlayOp(t,e,Si.SYMDIFFERENCE)},oi.difference=function(t,e){return oi.overlayOp(t,e,Si.DIFFERENCE)};var si=function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e};si.prototype.computeIntersections=function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},si.prototype.interfaces_=function(){return[]},si.prototype.getClass=function(){return si};var ai=function t(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,2===arguments.length){var e=arguments[0],n=arguments[1];this._eventType=t.DELETE,this._xValue=e,this._insertEvent=n}else if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];this._eventType=t.INSERT,this._label=r,this._xValue=i,this._obj=o}},ui={INSERT:{configurable:!0},DELETE:{configurable:!0}};ai.prototype.isDelete=function(){return this._eventType===ai.DELETE},ai.prototype.setDeleteEventIndex=function(t){this._deleteEventIndex=t},ai.prototype.getObject=function(){return this._obj},ai.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},ai.prototype.getInsertEvent=function(){return this._insertEvent},ai.prototype.isInsert=function(){return this._eventType===ai.INSERT},ai.prototype.isSameLabel=function(t){return null!==this._label&&this._label===t._label},ai.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},ai.prototype.interfaces_=function(){return[E]},ai.prototype.getClass=function(){return ai},ui.INSERT.get=function(){return 1},ui.DELETE.get=function(){return 2},Object.defineProperties(ai,ui);var ci=function(){};ci.prototype.interfaces_=function(){return[]},ci.prototype.getClass=function(){return ci};var li=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this._li=t,this._includeProper=e,this._recordIsolated=n};li.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&1===this._li.getIntersectionNum()){if(li.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var i=t.getNumPoints()-1;if(0===e&&r===i||0===r&&e===i)return!0}}return!1},li.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},li.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},li.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},li.prototype.isBoundaryPointInternal=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next().getCoordinate();if(t.isIntersection(r))return!0}return!1},li.prototype.hasProperIntersection=function(){return this._hasProper},li.prototype.hasIntersection=function(){return this._hasIntersection},li.prototype.isDone=function(){return this._isDone},li.prototype.isBoundaryPoint=function(t,e){return!(null===e||!this.isBoundaryPointInternal(t,e[0])&&!this.isBoundaryPointInternal(t,e[1]))},li.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},li.prototype.addIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),n.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,n,r)||(this._hasIntersection=!0,!this._includeProper&&this._li.isProper()||(t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},li.prototype.interfaces_=function(){return[]},li.prototype.getClass=function(){return li},li.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};var hi=function(t){function e(){t.call(this),this.events=new bt,this.nOverlaps=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.prepareEvents=function(){Ze.sort(this.events);for(var t=0;t<this.events.size();t++){var e=this.events.get(t);e.isDelete()&&e.getInsertEvent().setDeleteEventIndex(t)}},e.prototype.computeIntersections=function(){if(1===arguments.length){var t=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var e=0;e<this.events.size();e++){var n=this.events.get(e);if(n.isInsert()&&this.processOverlaps(e,n.getDeleteEventIndex(),n,t),t.isDone())break}}else if(3===arguments.length)if(arguments[2]instanceof li&&T(arguments[0],It)&&T(arguments[1],It)){var r=arguments[0],i=arguments[1],o=arguments[2];this.addEdges(r,r),this.addEdges(i,i),this.computeIntersections(o)}else if("boolean"==typeof arguments[2]&&T(arguments[0],It)&&arguments[1]instanceof li){var s=arguments[0],a=arguments[1];arguments[2]?this.addEdges(s,null):this.addEdges(s),this.computeIntersections(a)}},e.prototype.addEdge=function(t,e){for(var n=t.getMonotoneChainEdge(),r=n.getStartIndexes(),i=0;i<r.length-1;i++){var o=new si(n,i),s=new ai(e,n.getMinX(i),o);this.events.add(s),this.events.add(new ai(n.getMaxX(i),s))}},e.prototype.processOverlaps=function(t,e,n,r){for(var i=n.getObject(),o=t;o<e;o++){var s=this.events.get(o);if(s.isInsert()){var a=s.getObject();n.isSameLabel(s)||(i.computeIntersections(a,r),this.nOverlaps++)}}},e.prototype.addEdges=function(){if(1===arguments.length)for(var t=arguments[0].iterator();t.hasNext();){var e=t.next();this.addEdge(e,e)}else if(2===arguments.length)for(var n=arguments[1],r=arguments[0].iterator();r.hasNext();){var i=r.next();this.addEdge(i,n)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ci),pi=function(){this._min=m.POSITIVE_INFINITY,this._max=m.NEGATIVE_INFINITY},fi={NodeComparator:{configurable:!0}};pi.prototype.getMin=function(){return this._min},pi.prototype.intersects=function(t,e){return!(this._min>e||this._max<t)},pi.prototype.getMax=function(){return this._max},pi.prototype.toString=function(){return $.toLineString(new w(this._min,0),new w(this._max,0))},pi.prototype.interfaces_=function(){return[]},pi.prototype.getClass=function(){return pi},fi.NodeComparator.get=function(){return gi},Object.defineProperties(pi,fi);var gi=function(){};gi.prototype.compare=function(t,e){var n=t,r=e,i=(n._min+n._max)/2,o=(r._min+r._max)/2;return i<o?-1:i>o?1:0},gi.prototype.interfaces_=function(){return[b]},gi.prototype.getClass=function(){return gi};var di=function(t){function e(){t.call(this),this._item=null;var e=arguments[0],n=arguments[1],r=arguments[2];this._min=e,this._max=n,this._item=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.query=function(t,e,n){if(!this.intersects(t,e))return null;n.visitItem(this._item)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(pi),yi=function(t){function e(){t.call(this),this._node1=null,this._node2=null;var e=arguments[0],n=arguments[1];this._node1=e,this._node2=n,this.buildExtent(this._node1,this._node2)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.buildExtent=function(t,e){this._min=Math.min(t._min,e._min),this._max=Math.max(t._max,e._max)},e.prototype.query=function(t,e,n){if(!this.intersects(t,e))return null;null!==this._node1&&this._node1.query(t,e,n),null!==this._node2&&this._node2.query(t,e,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(pi),_i=function(){this._leaves=new bt,this._root=null,this._level=0};_i.prototype.buildTree=function(){Ze.sort(this._leaves,new pi.NodeComparator);for(var t=this._leaves,e=null,n=new bt;;){if(this.buildLevel(t,n),1===n.size())return n.get(0);e=t,t=n,n=e}},_i.prototype.insert=function(t,e,n){if(null!==this._root)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new di(t,e,n))},_i.prototype.query=function(t,e,n){this.init(),this._root.query(t,e,n)},_i.prototype.buildRoot=function(){if(null!==this._root)return null;this._root=this.buildTree()},_i.prototype.printNode=function(t){Y.out.println($.toLineString(new w(t._min,this._level),new w(t._max,this._level)))},_i.prototype.init=function(){if(null!==this._root)return null;this.buildRoot()},_i.prototype.buildLevel=function(t,e){this._level++,e.clear();for(var n=0;n<t.size();n+=2){var r=t.get(n);if(null===(n+1<t.size()?t.get(n):null))e.add(r);else{var i=new yi(t.get(n),t.get(n+1));e.add(i)}}},_i.prototype.interfaces_=function(){return[]},_i.prototype.getClass=function(){return _i};var vi=function(){this._items=new bt};vi.prototype.visitItem=function(t){this._items.add(t)},vi.prototype.getItems=function(){return this._items},vi.prototype.interfaces_=function(){return[Je]},vi.prototype.getClass=function(){return vi};var mi=function(){this._index=null;var t=arguments[0];if(!T(t,$t))throw new v("Argument must be Polygonal");this._index=new Ii(t)},xi={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};mi.prototype.locate=function(t){var e=new st(t),n=new Ei(e);return this._index.query(t.y,t.y,n),e.getLocation()},mi.prototype.interfaces_=function(){return[Un]},mi.prototype.getClass=function(){return mi},xi.SegmentVisitor.get=function(){return Ei},xi.IntervalIndexedGeometry.get=function(){return Ii},Object.defineProperties(mi,xi);var Ei=function(){this._counter=null;var t=arguments[0];this._counter=t};Ei.prototype.visitItem=function(t){var e=t;this._counter.countSegment(e.getCoordinate(0),e.getCoordinate(1))},Ei.prototype.interfaces_=function(){return[Je]},Ei.prototype.getClass=function(){return Ei};var Ii=function(){this._index=new _i;var t=arguments[0];this.init(t)};Ii.prototype.init=function(t){for(var e=wr.getLines(t).iterator();e.hasNext();){var n=e.next().getCoordinates();this.addLine(n)}},Ii.prototype.addLine=function(t){for(var e=1;e<t.length;e++){var n=new dn(t[e-1],t[e]),r=Math.min(n.p0.y,n.p1.y),i=Math.max(n.p0.y,n.p1.y);this._index.insert(r,i,n)}},Ii.prototype.query=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new vi;return this._index.query(t,e,n),n.getItems()}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];this._index.query(r,i,o)}},Ii.prototype.interfaces_=function(){return[]},Ii.prototype.getClass=function(){return Ii};var bi=function(t){function e(){if(t.call(this),this._parentGeom=null,this._lineEdgeMap=new pe,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new Nr,2===arguments.length){var e=arguments[0],n=arguments[1],r=gt.OGC_SFS_BOUNDARY_RULE;this._argIndex=e,this._parentGeom=n,this._boundaryNodeRule=r,null!==n&&this.add(n)}else if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];this._argIndex=i,this._parentGeom=o,this._boundaryNodeRule=s,null!==o&&this.add(o)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.insertBoundaryPoint=function(t,n){var r=this._nodes.addNode(n).getLabel(),i=1;r.getLocation(t,Ne.ON)===O.BOUNDARY&&i++;var o=e.determineBoundary(this._boundaryNodeRule,i);r.setLocation(t,o)},e.prototype.computeSelfNodes=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return this.computeSelfNodes(t,e,!1)}if(3===arguments.length){var n=arguments[1],r=arguments[2],i=new li(arguments[0],!0,!1);i.setIsDoneIfProperInt(r);var o=this.createEdgeSetIntersector(),s=this._parentGeom instanceof ee||this._parentGeom instanceof Zt||this._parentGeom instanceof ne,a=n||!s;return o.computeIntersections(this._edges,i,a),this.addSelfIntersectionNodes(this._argIndex),i}},e.prototype.computeSplitEdges=function(t){for(var e=this._edges.iterator();e.hasNext();)e.next().eiList.addSplitEdges(t)},e.prototype.computeEdgeIntersections=function(t,e,n){var r=new li(e,n,!0);return r.setBoundaryNodes(this.getBoundaryNodes(),t.getBoundaryNodes()),this.createEdgeSetIntersector().computeIntersections(this._edges,t._edges,r),r},e.prototype.getGeometry=function(){return this._parentGeom},e.prototype.getBoundaryNodeRule=function(){return this._boundaryNodeRule},e.prototype.hasTooFewPoints=function(){return this._hasTooFewPoints},e.prototype.addPoint=function(){if(arguments[0]instanceof Qt){var t=arguments[0].getCoordinate();this.insertPoint(this._argIndex,t,O.INTERIOR)}else if(arguments[0]instanceof w){var e=arguments[0];this.insertPoint(this._argIndex,e,O.INTERIOR)}},e.prototype.addPolygon=function(t){this.addPolygonRing(t.getExteriorRing(),O.EXTERIOR,O.INTERIOR);for(var e=0;e<t.getNumInteriorRing();e++){var n=t.getInteriorRingN(e);this.addPolygonRing(n,O.INTERIOR,O.EXTERIOR)}},e.prototype.addEdge=function(t){this.insertEdge(t);var e=t.getCoordinates();this.insertPoint(this._argIndex,e[0],O.BOUNDARY),this.insertPoint(this._argIndex,e[e.length-1],O.BOUNDARY)},e.prototype.addLineString=function(t){var e=St.removeRepeatedPoints(t.getCoordinates());if(e.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=e[0],null;var n=new nr(e,new Pe(this._argIndex,O.INTERIOR));this._lineEdgeMap.put(t,n),this.insertEdge(n),et.isTrue(e.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,e[0]),this.insertBoundaryPoint(this._argIndex,e[e.length-1])},e.prototype.getInvalidPoint=function(){return this._invalidPoint},e.prototype.getBoundaryPoints=function(){for(var t=this.getBoundaryNodes(),e=new Array(t.size()).fill(null),n=0,r=t.iterator();r.hasNext();){var i=r.next();e[n++]=i.getCoordinate().copy()}return e},e.prototype.getBoundaryNodes=function(){return null===this._boundaryNodes&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},e.prototype.addSelfIntersectionNode=function(t,e,n){if(this.isBoundaryNode(t,e))return null;n===O.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(t,e):this.insertPoint(t,e,n)},e.prototype.addPolygonRing=function(t,e,n){if(t.isEmpty())return null;var r=St.removeRepeatedPoints(t.getCoordinates());if(r.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=r[0],null;var i=e,o=n;at.isCCW(r)&&(i=n,o=e);var s=new nr(r,new Pe(this._argIndex,O.BOUNDARY,i,o));this._lineEdgeMap.put(t,s),this.insertEdge(s),this.insertPoint(this._argIndex,r[0],O.BOUNDARY)},e.prototype.insertPoint=function(t,e,n){var r=this._nodes.addNode(e),i=r.getLabel();null===i?r._label=new Pe(t,n):i.setLocation(t,n)},e.prototype.createEdgeSetIntersector=function(){return new hi},e.prototype.addSelfIntersectionNodes=function(t){for(var e=this._edges.iterator();e.hasNext();)for(var n=e.next(),r=n.getLabel().getLocation(t),i=n.eiList.iterator();i.hasNext();){var o=i.next();this.addSelfIntersectionNode(t,o.coord,r)}},e.prototype.add=function(){if(1!==arguments.length)return t.prototype.add.apply(this,arguments);var e=arguments[0];if(e.isEmpty())return null;if(e instanceof ne&&(this._useBoundaryDeterminationRule=!1),e instanceof Zt)this.addPolygon(e);else if(e instanceof Jt)this.addLineString(e);else if(e instanceof Qt)this.addPoint(e);else if(e instanceof te)this.addCollection(e);else if(e instanceof Vt)this.addCollection(e);else if(e instanceof ne)this.addCollection(e);else{if(!(e instanceof jt))throw new Error(e.getClass().getName());this.addCollection(e)}},e.prototype.addCollection=function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);this.add(n)}},e.prototype.locate=function(t){return T(this._parentGeom,$t)&&this._parentGeom.getNumGeometries()>50?(null===this._areaPtLocator&&(this._areaPtLocator=new mi(this._parentGeom)),this._areaPtLocator.locate(t)):this._ptLocator.locate(t,this._parentGeom)},e.prototype.findEdge=function(){if(1===arguments.length){var e=arguments[0];return this._lineEdgeMap.get(e)}return t.prototype.findEdge.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.determineBoundary=function(t,e){return t.isInBoundary(e)?O.BOUNDARY:O.INTERIOR},e}(Ye),wi=function(){if(this._li=new it,this._resultPrecisionModel=null,this._arg=null,1===arguments.length){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new bi(0,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],r=gt.OGC_SFS_BOUNDARY_RULE;e.getPrecisionModel().compareTo(n.getPrecisionModel())>=0?this.setComputationPrecision(e.getPrecisionModel()):this.setComputationPrecision(n.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new bi(0,e,r),this._arg[1]=new bi(1,n,r)}else if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];i.getPrecisionModel().compareTo(o.getPrecisionModel())>=0?this.setComputationPrecision(i.getPrecisionModel()):this.setComputationPrecision(o.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new bi(0,i,s),this._arg[1]=new bi(1,o,s)}};wi.prototype.getArgGeometry=function(t){return this._arg[t].getGeometry()},wi.prototype.setComputationPrecision=function(t){this._resultPrecisionModel=t,this._li.setPrecisionModel(this._resultPrecisionModel)},wi.prototype.interfaces_=function(){return[]},wi.prototype.getClass=function(){return wi};var Ni=function(){};Ni.prototype.interfaces_=function(){return[]},Ni.prototype.getClass=function(){return Ni},Ni.map=function(){if(arguments[0]instanceof lt&&T(arguments[1],Ni.MapOp)){for(var t=arguments[0],e=arguments[1],n=new bt,r=0;r<t.getNumGeometries();r++){var i=e.map(t.getGeometryN(r));null!==i&&n.add(i)}return t.getFactory().buildGeometry(n)}if(T(arguments[0],xt)&&T(arguments[1],Ni.MapOp)){for(var o=arguments[0],s=arguments[1],a=new bt,u=o.iterator();u.hasNext();){var c=u.next(),l=s.map(c);null!==l&&a.add(l)}return a}},Ni.MapOp=function(){};var Si=function(t){function e(){var e=arguments[0],n=arguments[1];t.call(this,e,n),this._ptLocator=new Nr,this._geomFact=null,this._resultGeom=null,this._graph=null,this._edgeList=new Wn,this._resultPolyList=new bt,this._resultLineList=new bt,this._resultPointList=new bt,this._graph=new Ye(new Xn),this._geomFact=e.getFactory()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.insertUniqueEdge=function(t){var e=this._edgeList.findEqualEdge(t);if(null!==e){var n=e.getLabel(),r=t.getLabel();e.isPointwiseEqual(t)||(r=new Pe(t.getLabel())).flip();var i=e.getDepth();i.isNull()&&i.add(n),i.add(r),n.merge(r)}else this._edgeList.add(t)},e.prototype.getGraph=function(){return this._graph},e.prototype.cancelDuplicateResultEdges=function(){for(var t=this._graph.getEdgeEnds().iterator();t.hasNext();){var e=t.next(),n=e.getSym();e.isInResult()&&n.isInResult()&&(e.setInResult(!1),n.setInResult(!1))}},e.prototype.isCoveredByLA=function(t){return!!this.isCovered(t,this._resultLineList)||!!this.isCovered(t,this._resultPolyList)},e.prototype.computeGeometry=function(t,n,r,i){var o=new bt;return o.addAll(t),o.addAll(n),o.addAll(r),o.isEmpty()?e.createEmptyResult(i,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(o)},e.prototype.mergeSymLabels=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();)t.next().getEdges().mergeSymLabels()},e.prototype.isCovered=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next();if(this._ptLocator.locate(t,r)!==O.EXTERIOR)return!0}return!1},e.prototype.replaceCollapsedEdges=function(){for(var t=new bt,e=this._edgeList.iterator();e.hasNext();){var n=e.next();n.isCollapsed()&&(e.remove(),t.add(n.getCollapsedEdge()))}this._edgeList.addAll(t)},e.prototype.updateNodeLabelling=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();){var e=t.next(),n=e.getEdges().getLabel();e.getLabel().merge(n)}},e.prototype.getResultGeometry=function(t){return this.computeOverlay(t),this._resultGeom},e.prototype.insertUniqueEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this.insertUniqueEdge(n)}},e.prototype.computeOverlay=function(t){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 e=new bt;this._arg[0].computeSplitEdges(e),this._arg[1].computeSplitEdges(e),this.insertUniqueEdges(e),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),Yr.checkValid(this._edgeList.getEdges()),this._graph.addEdges(this._edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(t),this.cancelDuplicateResultEdges();var n=new Xe(this._geomFact);n.add(this._graph),this._resultPolyList=n.getPolygons();var r=new zr(this,this._geomFact,this._ptLocator);this._resultLineList=r.build(t);var i=new Wr(this,this._geomFact,this._ptLocator);this._resultPointList=i.build(t),this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,t)},e.prototype.labelIncompleteNode=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._arg[e].getGeometry());t.getLabel().setLocation(e,n)},e.prototype.copyPoints=function(t){for(var e=this._arg[t].getNodeIterator();e.hasNext();){var n=e.next();this._graph.addNode(n.getCoordinate()).setLabel(t,n.getLabel().getLocation(t))}},e.prototype.findResultAreaEdges=function(t){for(var n=this._graph.getEdgeEnds().iterator();n.hasNext();){var r=n.next(),i=r.getLabel();i.isArea()&&!r.isInteriorAreaEdge()&&e.isResultOfOp(i.getLocation(0,Ne.RIGHT),i.getLocation(1,Ne.RIGHT),t)&&r.setInResult(!0)}},e.prototype.computeLabelsFromDepths=function(){for(var t=this._edgeList.iterator();t.hasNext();){var e=t.next(),n=e.getLabel(),r=e.getDepth();if(!r.isNull()){r.normalize();for(var i=0;i<2;i++)n.isNull(i)||!n.isArea()||r.isNull(i)||(0===r.getDelta(i)?n.toLine(i):(et.isTrue(!r.isNull(i,Ne.LEFT),"depth of LEFT side has not been initialized"),n.setLocation(i,Ne.LEFT,r.getLocation(i,Ne.LEFT)),et.isTrue(!r.isNull(i,Ne.RIGHT),"depth of RIGHT side has not been initialized"),n.setLocation(i,Ne.RIGHT,r.getLocation(i,Ne.RIGHT))))}}},e.prototype.computeLabelling=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();)t.next().getEdges().computeLabelling(this._arg);this.mergeSymLabels(),this.updateNodeLabelling()},e.prototype.labelIncompleteNodes=function(){for(var t=this._graph.getNodes().iterator();t.hasNext();){var e=t.next(),n=e.getLabel();e.isIsolated()&&(n.isNull(0)?this.labelIncompleteNode(e,0):this.labelIncompleteNode(e,1)),e.getEdges().updateLabelling(n)}},e.prototype.isCoveredByA=function(t){return!!this.isCovered(t,this._resultPolyList)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(wi);Si.overlayOp=function(t,e,n){return new Si(t,e).getResultGeometry(n)},Si.intersection=function(t,e){if(t.isEmpty()||e.isEmpty())return Si.createEmptyResult(Si.INTERSECTION,t,e,t.getFactory());if(t.isGeometryCollection()){var n=e;return Xr.map(t,{interfaces_:function(){return[Ni.MapOp]},map:function(t){return t.intersection(n)}})}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),oi.overlayOp(t,e,Si.INTERSECTION)},Si.symDifference=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return Si.createEmptyResult(Si.SYMDIFFERENCE,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),oi.overlayOp(t,e,Si.SYMDIFFERENCE)},Si.resultDimension=function(t,e,n){var r=e.getDimension(),i=n.getDimension(),o=-1;switch(t){case Si.INTERSECTION:o=Math.min(r,i);break;case Si.UNION:o=Math.max(r,i);break;case Si.DIFFERENCE:o=r;break;case Si.SYMDIFFERENCE:o=Math.max(r,i)}return o},Si.createEmptyResult=function(t,e,n,r){var i=null;switch(Si.resultDimension(t,e,n)){case-1:i=r.createGeometryCollection(new Array(0).fill(null));break;case 0:i=r.createPoint();break;case 1:i=r.createLineString();break;case 2:i=r.createPolygon()}return i},Si.difference=function(t,e){return t.isEmpty()?Si.createEmptyResult(Si.DIFFERENCE,t,e,t.getFactory()):e.isEmpty()?t.copy():(t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),oi.overlayOp(t,e,Si.DIFFERENCE))},Si.isResultOfOp=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=t.getLocation(0),r=t.getLocation(1);return Si.isResultOfOp(n,r,e)}if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];switch(i===O.BOUNDARY&&(i=O.INTERIOR),o===O.BOUNDARY&&(o=O.INTERIOR),s){case Si.INTERSECTION:return i===O.INTERIOR&&o===O.INTERIOR;case Si.UNION:return i===O.INTERIOR||o===O.INTERIOR;case Si.DIFFERENCE:return i===O.INTERIOR&&o!==O.INTERIOR;case Si.SYMDIFFERENCE:return i===O.INTERIOR&&o!==O.INTERIOR||i!==O.INTERIOR&&o===O.INTERIOR}return!1}},Si.INTERSECTION=1,Si.UNION=2,Si.DIFFERENCE=3,Si.SYMDIFFERENCE=4;var Ci=function(){this._g=null,this._boundaryDistanceTolerance=null,this._linework=null,this._ptLocator=new Nr,this._seg=new dn;var t=arguments[0],e=arguments[1];this._g=t,this._boundaryDistanceTolerance=e,this._linework=this.extractLinework(t)};Ci.prototype.isWithinToleranceOfBoundary=function(t){for(var e=0;e<this._linework.getNumGeometries();e++)for(var n=this._linework.getGeometryN(e).getCoordinateSequence(),r=0;r<n.size()-1;r++)if(n.getCoordinate(r,this._seg.p0),n.getCoordinate(r+1,this._seg.p1),this._seg.distance(t)<=this._boundaryDistanceTolerance)return!0;return!1},Ci.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?O.BOUNDARY:this._ptLocator.locate(t,this._g)},Ci.prototype.extractLinework=function(t){var e=new Oi;t.apply(e);var n=e.getLinework(),r=_e.toLineStringArray(n);return t.getFactory().createMultiLineString(r)},Ci.prototype.interfaces_=function(){return[]},Ci.prototype.getClass=function(){return Ci};var Oi=function(){this._linework=null,this._linework=new bt};Oi.prototype.getLinework=function(){return this._linework},Oi.prototype.filter=function(t){if(t instanceof Zt){var e=t;this._linework.add(e.getExteriorRing());for(var n=0;n<e.getNumInteriorRing();n++)this._linework.add(e.getInteriorRingN(n))}},Oi.prototype.interfaces_=function(){return[Ut]},Oi.prototype.getClass=function(){return Oi};var Li=function(){this._g=null,this._doLeft=!0,this._doRight=!0;var t=arguments[0];this._g=t};Li.prototype.extractPoints=function(t,e,n){for(var r=t.getCoordinates(),i=0;i<r.length-1;i++)this.computeOffsetPoints(r[i],r[i+1],e,n)},Li.prototype.setSidesToGenerate=function(t,e){this._doLeft=t,this._doRight=e},Li.prototype.getPoints=function(t){for(var e=new bt,n=wr.getLines(this._g).iterator();n.hasNext();){var r=n.next();this.extractPoints(r,t,e)}return e},Li.prototype.computeOffsetPoints=function(t,e,n,r){var i=e.x-t.x,o=e.y-t.y,s=Math.sqrt(i*i+o*o),a=n*i/s,u=n*o/s,c=(e.x+t.x)/2,l=(e.y+t.y)/2;if(this._doLeft){var h=new w(c-u,l+a);r.add(h)}if(this._doRight){var p=new w(c+u,l-a);r.add(p)}},Li.prototype.interfaces_=function(){return[]},Li.prototype.getClass=function(){return Li};var Ti=function t(){this._geom=null,this._locFinder=null,this._location=new Array(3).fill(null),this._invalidLocation=null,this._boundaryDistanceTolerance=t.TOLERANCE,this._testCoords=new bt;var e=arguments[0],n=arguments[1],r=arguments[2];this._boundaryDistanceTolerance=t.computeBoundaryDistanceTolerance(e,n),this._geom=[e,n,r],this._locFinder=[new Ci(this._geom[0],this._boundaryDistanceTolerance),new Ci(this._geom[1],this._boundaryDistanceTolerance),new Ci(this._geom[2],this._boundaryDistanceTolerance)]},Mi={TOLERANCE:{configurable:!0}};Ti.prototype.reportResult=function(t,e,n){Y.out.println("Overlay result invalid - A:"+O.toLocationSymbol(e[0])+" B:"+O.toLocationSymbol(e[1])+" expected:"+(n?"i":"e")+" actual:"+O.toLocationSymbol(e[2]))},Ti.prototype.isValid=function(t){return this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]),this.checkValid(t)},Ti.prototype.checkValid=function(){if(1===arguments.length){for(var t=arguments[0],e=0;e<this._testCoords.size();e++){var n=this._testCoords.get(e);if(!this.checkValid(t,n))return this._invalidLocation=n,!1}return!0}if(2===arguments.length){var r=arguments[0],i=arguments[1];return this._location[0]=this._locFinder[0].getLocation(i),this._location[1]=this._locFinder[1].getLocation(i),this._location[2]=this._locFinder[2].getLocation(i),!!Ti.hasLocation(this._location,O.BOUNDARY)||this.isValidResult(r,this._location)}},Ti.prototype.addTestPts=function(t){var e=new Li(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))},Ti.prototype.isValidResult=function(t,e){var n=Si.isResultOfOp(e[0],e[1],t),r=!(n^e[2]===O.INTERIOR);return r||this.reportResult(t,e,n),r},Ti.prototype.getInvalidLocation=function(){return this._invalidLocation},Ti.prototype.interfaces_=function(){return[]},Ti.prototype.getClass=function(){return Ti},Ti.hasLocation=function(t,e){for(var n=0;n<3;n++)if(t[n]===e)return!0;return!1},Ti.computeBoundaryDistanceTolerance=function(t,e){return Math.min(Kr.computeSizeBasedSnapTolerance(t),Kr.computeSizeBasedSnapTolerance(e))},Ti.isValid=function(t,e,n,r){return new Ti(t,e,r).isValid(n)},Mi.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(Ti,Mi);var Pi=function t(e){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=t.extractFactory(e),this._inputGeoms=e};Pi.prototype.extractElements=function(t,e){if(null===t)return null;for(var n=0;n<t.getNumGeometries();n++){var r=t.getGeometryN(n);this._skipEmpty&&r.isEmpty()||e.add(r)}},Pi.prototype.combine=function(){for(var t=new bt,e=this._inputGeoms.iterator();e.hasNext();){var n=e.next();this.extractElements(n,t)}return 0===t.size()?null!==this._geomFactory?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(t)},Pi.prototype.interfaces_=function(){return[]},Pi.prototype.getClass=function(){return Pi},Pi.combine=function(){if(1===arguments.length)return new Pi(arguments[0]).combine();if(2===arguments.length){var t=arguments[0],e=arguments[1];return new Pi(Pi.createList(t,e)).combine()}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];return new Pi(Pi.createList(n,r,i)).combine()}},Pi.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},Pi.createList=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new bt;return n.add(t),n.add(e),n}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2],s=new bt;return s.add(r),s.add(i),s.add(o),s}};var Ri=function(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,null===this._inputPolys&&(this._inputPolys=new bt)},Ai={STRTREE_NODE_CAPACITY:{configurable:!0}};Ri.prototype.reduceToGeometries=function(t){for(var e=new bt,n=t.iterator();n.hasNext();){var r=n.next(),i=null;T(r,It)?i=this.unionTree(r):r instanceof lt&&(i=r),e.add(i)}return e},Ri.prototype.extractByEnvelope=function(t,e,n){for(var r=new bt,i=0;i<e.getNumGeometries();i++){var o=e.getGeometryN(i);o.getEnvelopeInternal().intersects(t)?r.add(o):n.add(o)}return this._geomFactory.buildGeometry(r)},Ri.prototype.unionOptimized=function(t,e){var n=t.getEnvelopeInternal(),r=e.getEnvelopeInternal();if(!n.intersects(r))return Pi.combine(t,e);if(t.getNumGeometries()<=1&&e.getNumGeometries()<=1)return this.unionActual(t,e);var i=n.intersection(r);return this.unionUsingEnvelopeIntersection(t,e,i)},Ri.prototype.union=function(){if(null===this._inputPolys)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 sn(Ri.STRTREE_NODE_CAPACITY),e=this._inputPolys.iterator();e.hasNext();){var n=e.next();t.insert(n.getEnvelopeInternal(),n)}this._inputPolys=null;var r=t.itemsTree();return this.unionTree(r)},Ri.prototype.binaryUnion=function(){if(1===arguments.length){var t=arguments[0];return this.binaryUnion(t,0,t.size())}if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2];if(r-n<=1){var i=Ri.getGeometry(e,n);return this.unionSafe(i,null)}if(r-n==2)return this.unionSafe(Ri.getGeometry(e,n),Ri.getGeometry(e,n+1));var o=Math.trunc((r+n)/2),s=this.binaryUnion(e,n,o),a=this.binaryUnion(e,o,r);return this.unionSafe(s,a)}},Ri.prototype.repeatedUnion=function(t){for(var e=null,n=t.iterator();n.hasNext();){var r=n.next();e=null===e?r.copy():e.union(r)}return e},Ri.prototype.unionSafe=function(t,e){return null===t&&null===e?null:null===t?e.copy():null===e?t.copy():this.unionOptimized(t,e)},Ri.prototype.unionActual=function(t,e){return Ri.restrictToPolygons(t.union(e))},Ri.prototype.unionTree=function(t){var e=this.reduceToGeometries(t);return this.binaryUnion(e)},Ri.prototype.unionUsingEnvelopeIntersection=function(t,e,n){var r=new bt,i=this.extractByEnvelope(n,t,r),o=this.extractByEnvelope(n,e,r),s=this.unionActual(i,o);return r.add(s),Pi.combine(r)},Ri.prototype.bufferUnion=function(){if(1===arguments.length){var t=arguments[0];return t.get(0).getFactory().buildGeometry(t).buffer(0)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e.getFactory().createGeometryCollection([e,n]).buffer(0)}},Ri.prototype.interfaces_=function(){return[]},Ri.prototype.getClass=function(){return Ri},Ri.restrictToPolygons=function(t){if(T(t,$t))return t;var e=br.getPolygons(t);return 1===e.size()?e.get(0):t.getFactory().createMultiPolygon(_e.toPolygonArray(e))},Ri.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)},Ri.union=function(t){return new Ri(t).union()},Ai.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(Ri,Ai);var Di=function(){};Di.prototype.interfaces_=function(){return[]},Di.prototype.getClass=function(){return Di},Di.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return Si.createEmptyResult(Si.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),oi.overlayOp(t,e,Si.UNION)},t.GeoJSONReader=be,t.GeoJSONWriter=we,t.OverlayOp=Si,t.UnionOp=Di,t.BufferOp=dr,Object.defineProperty(t,"__esModule",{value:!0})}(e)},8005:t=>{"use strict";t.exports=function(t,n,r){var i=t*n,o=e*t,s=o-(o-t),a=t-s,u=e*n,c=u-(u-n),l=n-c,h=a*l-(i-s*c-a*c-s*l);return r?(r[0]=h,r[1]=i,r):[h,i]};var e=+(Math.pow(2,27)+1)},6359:t=>{"use strict";t.exports=function(t,e,n){var r=t+e,i=r-t,o=e-i,s=t-(r-i);return n?(n[0]=s+o,n[1]=r,n):[s+o,r]}}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={exports:{}};return t[r].call(o.exports,o,o.exports,n),o.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";function t(t,e,n){if(!u(n=n||{}))throw new Error("options is invalid");var r=n.bbox,i=n.id;if(void 0===t)throw new Error("geometry is required");if(e&&e.constructor!==Object)throw new Error("properties must be an Object");r&&c(r),i&&l(i);var o={type:"Feature"};return i&&(o.id=i),r&&(o.bbox=r),o.properties=e||{},o.geometry=t,o}function e(e,n,r){if(!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!a(e[0])||!a(e[1]))throw new Error("coordinates must contain numbers");return t({type:"Point",coordinates:e},n,r)}function i(e,n,r){if(!e)throw new Error("coordinates is required");for(var i=0;i<e.length;i++){var o=e[i];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<o[o.length-1].length;s++){if(0===i&&0===s&&!a(o[0][0])||!a(o[0][1]))throw new Error("coordinates must contain numbers");if(o[o.length-1][s]!==o[0][s])throw new Error("First and last Position are not equivalent.")}}return t({type:"Polygon",coordinates:e},n,r)}function o(e,n,r){if(!e)throw new Error("coordinates is required");if(e.length<2)throw new Error("coordinates must be an array of two or more positions");if(!a(e[0][1])||!a(e[0][1]))throw new Error("coordinates must contain numbers");return t({type:"LineString",coordinates:e},n,r)}function s(t,e){if(!u(e=e||{}))throw new Error("options is invalid");var n=e.bbox,r=e.id;if(!t)throw new Error("No features passed");if(!Array.isArray(t))throw new Error("features must be an Array");n&&c(n),r&&l(r);var i={type:"FeatureCollection"};return r&&(i.id=r),n&&(i.bbox=n),i.features=t,i}function a(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function u(t){return!!t&&t.constructor===Object}function c(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!a(t))throw new Error("bbox must only contain numbers")}))}function l(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}function h(t){if(!t)throw new Error("obj is required");var e=p(t);if(e.length>1&&a(e[0])&&a(e[1]))return e;throw new Error("Coordinate is not a valid Point")}function p(t){if(!t)throw new Error("obj is required");var e;if(t.length?e=t:t.coordinates?e=t.coordinates:t.geometry&&t.geometry.coordinates&&(e=t.geometry.coordinates),e)return f(e),e;throw new Error("No valid coordinates")}function f(t){if(t.length>1&&a(t[0])&&a(t[1]))return!0;if(Array.isArray(t[0])&&t[0].length)return f(t[0]);throw new Error("coordinates must only contain numbers")}function g(t){if(!t)throw new Error("geojson is required");if(void 0!==t.geometry)return t.geometry;if(t.coordinates||t.geometries)return t;throw new Error("geojson must be a valid Feature or Geometry Object")}function d(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var r=h(t),i=g(e),o=i.type,s=e.bbox,a=i.coordinates;if(s&&!y(r,s))return!1;"Polygon"===o&&(a=[a]);for(var u=!1,c=0;c<a.length&&!u;c++){var l=_(r,a[c]);(0===l&&!n.ignoreBoundary||l)&&(u=!0)}return u}function y(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}function _(t,e){for(var n=0,r=0,i=0,o=0,s=0,a=0,u=0,c=0,l=null,h=null,p=t[0],f=t[1],g=e.length;n<g;n++){r=0;var d=e[n].length-1,y=e[n];for(s=(l=y[0])[0]-p,a=l[1]-f;r<d;r++)if(c=(h=y[r+1])[1]-f,a<0&&c<0||a>0&&c>0)a=c,s=(l=h)[0]-p;else{if(u=h[0]-t[0],c>0&&a<=0){if((o=s*c-u*a)>0)i+=1;else if(0===o)return 0}else if(a>0&&c<=0){if((o=s*c-u*a)<0)i+=1;else if(0===o)return 0}else if(0===c&&a<0){if(0==(o=s*c-u*a))return 0}else if(0===a&&c<0){if(0==(o=s*c-u*a))return 0}else if(0===a&&0===c){if(u<=0&&s>=0)return 0;if(s<=0&&u>=0)return 0}l=h,a=c,s=u}}return i%2!=0}function v(t,e,n){if(null!==t)for(var r,i,o,s,a,u,c,l,h=0,p=0,f=t.type,g="FeatureCollection"===f,d="Feature"===f,y=g?t.features.length:1,_=0;_<y;_++){a=(l=!!(c=g?t.features[_].geometry:d?t.geometry:t)&&"GeometryCollection"===c.type)?c.geometries.length:1;for(var m=0;m<a;m++){var x=0,E=0;if(null!==(s=l?c.geometries[m]:c)){u=s.coordinates;var I=s.type;switch(h=!n||"Polygon"!==I&&"MultiPolygon"!==I?0:1,I){case null:break;case"Point":e(u,p,_,x,E),p++,x++;break;case"LineString":case"MultiPoint":for(r=0;r<u.length;r++)e(u[r],p,_,x,E),p++,"MultiPoint"===I&&x++;"LineString"===I&&x++;break;case"Polygon":case"MultiLineString":for(r=0;r<u.length;r++){for(i=0;i<u[r].length-h;i++)e(u[r][i],p,_,x,E),p++;"MultiLineString"===I&&x++,"Polygon"===I&&E++}"Polygon"===I&&x++;break;case"MultiPolygon":for(r=0;r<u.length;r++){for("MultiPolygon"===I&&(E=0),i=0;i<u[r].length;i++){for(o=0;o<u[r][i].length-h;o++)e(u[r][i][o],p,_,x,E),p++;E++}x++}break;case"GeometryCollection":for(r=0;r<s.geometries.length;r++)v(s.geometries[r],e,n);break;default:throw new Error("Unknown Geometry Type")}}}}}function m(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var n=0;n<t.features.length;n++)e(t.features[n],n)}function x(t,e){var n,r,i,o,s,a,u,c,l,h,p=0,f="FeatureCollection"===t.type,g="Feature"===t.type,d=f?t.features.length:1;for(n=0;n<d;n++){for(a=f?t.features[n].geometry:g?t.geometry:t,c=f?t.features[n].properties:g?t.properties:{},l=f?t.features[n].bbox:g?t.bbox:void 0,h=f?t.features[n].id:g?t.id:void 0,s=(u=!!a&&"GeometryCollection"===a.type)?a.geometries.length:1,i=0;i<s;i++)if(null!==(o=u?a.geometries[i]:a))switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":e(o,p,c,l,h);break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)e(o.geometries[r],p,c,l,h);break;default:throw new Error("Unknown Geometry Type")}else e(null,p,c,l,h);p++}}function E(e,n){x(e,(function(e,r,i,o,s){var a,u=null===e?null:e.type;switch(u){case null:case"Point":case"LineString":case"Polygon":return void n(t(e,i,{bbox:o,id:s}),r,0)}switch(u){case"MultiPoint":a="Point";break;case"MultiLineString":a="LineString";break;case"MultiPolygon":a="Polygon"}e.coordinates.forEach((function(e,o){n(t({type:a,coordinates:e},i),r,o)}))}))}n.r(r),n.d(r,{default:()=>Kt}),n(1249),n(7941),n(4916),n(5306),n(1038),n(8783),n(6992),n(1539),n(8674),n(3948),n(3123),n(4723),n(2707),n(7327),n(9601),n(2222),n(9600);var I=n(2273),b=n.n(I);const w=function(t,e){if(!u(e=e||{}))throw new Error("options is invalid");var n=e.concavity||1/0,r=[];if(v(t,(function(t){r.push([t[0],t[1]])})),!r.length)return null;var o=b()(r,n);return o.length>3?i([o]):null};var N=n(675),S=6378137;function C(t){var e,n=0;switch(t.type){case"Polygon":return O(t.coordinates);case"MultiPolygon":for(e=0;e<t.coordinates.length;e++)n+=O(t.coordinates[e]);return n;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0;case"GeometryCollection":for(e=0;e<t.geometries.length;e++)n+=C(t.geometries[e]);return n}}function O(t){var e=0;if(t&&t.length>0){e+=Math.abs(L(t[0]));for(var n=1;n<t.length;n++)e-=Math.abs(L(t[n]))}return e}function L(t){var e,n,r,i,o,s,a=0,u=t.length;if(u>2){for(s=0;s<u;s++)s===u-2?(r=u-2,i=u-1,o=0):s===u-1?(r=u-1,i=0,o=1):(r=s,i=s+1,o=s+2),e=t[r],n=t[i],a+=(T(t[o][0])-T(e[0]))*Math.sin(T(n[1]));a=a*S*S/2}return a}function T(t){return t*Math.PI/180}const M=function(t){return function(t,e,n){var r=0;return x(t,(function(t,e,n,i,o){r=r+C(t)})),r}(t)};function P(t){switch(t.type){case"Polygon":return M(t)>1?t:null;case"MultiPolygon":var e=[];if(E(t,(function(t){M(t)>1&&e.push(t.geometry.coordinates)})),e.length)return{type:"MultiPolygon",coordinates:e}}}const R=function(t,e){if(!u(e=e||{}))throw new Error("options is invalid");var n=e.precision,r=e.coordinates,i=e.mutate;if(n=null==n||isNaN(n)?6:n,r=null==r||isNaN(r)?3:r,!t)throw new Error("<geojson> is required");if("number"!=typeof n)throw new Error("<precision> must be a number");if("number"!=typeof r)throw new Error("<coordinates> must be a number");!1!==i&&void 0!==i||(t=JSON.parse(JSON.stringify(t)));var o=Math.pow(10,n);return v(t,(function(t){!function(t,e,n){t.length>n&&t.splice(n,t.length);for(var r=0;r<t.length;r++)t[r]=Math.round(t[r]*e)/e}(t,o,r)})),t};function A(t){var e,n,r,i,o,s=p(t);if(2===s.length&&(e=s[0],n=s[1],e[0]!==n[0]||e[1]!==n[1]))return s;var a=[],u=s.length-1;a.push(s[0]);for(var c=1;c<u;c++)r=s[c-1],i=s[c],D(r,o=s[c+1],i)||a.push(i);return a.push(o),a}function D(t,e,n){var r=n[0],i=n[1],o=t[0],s=t[1],a=e[0],u=e[1],c=a-o,l=u-s;return 0==(r-o)*l-(i-s)*c&&(Math.abs(c)>=Math.abs(l)?c>0?o<=r&&r<=a:a<=r&&r<=o:l>0?s<=i&&i<=u:u<=i&&i<=s)}const F=function(e,n){var r="object"==typeof n?n.mutate:n;if(!e)throw new Error("geojson is required");var i=function(t,e){if(!t)throw new Error("geojson is required");if(t.geometry&&t.geometry.type)return t.geometry.type;if(t.type)return t.type;throw new Error("geojson is invalid")}(e),o=[];switch(i){case"LineString":o=A(e);break;case"MultiLineString":case"Polygon":p(e).forEach((function(t){o.push(A(t))}));break;case"MultiPolygon":p(e).forEach((function(t){var e=[];t.forEach((function(t){e.push(A(t))})),o.push(e)}));break;case"Point":return e;case"MultiPoint":var s={};p(e).forEach((function(t){var e=t.join("-");s.hasOwnProperty(e)||(o.push(t),s[e]=!0)}));break;default:throw new Error(i+" geometry not supported")}return e.coordinates?!0===r?(e.coordinates=o,e):{type:i,coordinates:o}:!0===r?(e.geometry.coordinates=o,e):t({type:i,coordinates:o},e.properties,e.bbox,e.id)};function k(t,e,n,r,i){for(;r>n;){if(r-n>600){var o=r-n+1,s=e-n+1,a=Math.log(o),u=.5*Math.exp(2*a/3),c=.5*Math.sqrt(a*u*(o-u)/o)*(s-o/2<0?-1:1);k(t,e,Math.max(n,Math.floor(e-s*u/o+c)),Math.min(r,Math.floor(e+(o-s)*u/o+c)),i)}var l=t[e],h=n,p=r;for(B(t,n,e),i(t[r],l)>0&&B(t,n,r);h<p;){for(B(t,h,p),h++,p--;i(t[h],l)<0;)h++;for(;i(t[p],l)>0;)p--}0===i(t[n],l)?B(t,n,p):B(t,++p,r),p<=e&&(n=p+1),e<=p&&(r=p-1)}}function B(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function G(t,e){return t<e?-1:t>e?1:0}const U=function(t,e,n,r,i){k(t,e,n||0,r||t.length-1,i||G)};function q(t,e){if(!(this instanceof q))return new q(t,e);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&this._initFormat(e),this.clear()}function j(t,e,n){if(!n)return e.indexOf(t);for(var r=0;r<e.length;r++)if(n(t,e[r]))return r;return-1}function V(t,e){Y(t,0,t.children.length,e,t)}function Y(t,e,n,r,i){i||(i=$(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o,s=e;s<n;s++)o=t.children[s],X(i,t.leaf?r(o):o);return i}function X(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function z(t,e){return t.minX-e.minX}function W(t,e){return t.minY-e.minY}function H(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function J(t){return t.maxX-t.minX+(t.maxY-t.minY)}function K(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function Q(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function $(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Z(t,e,n,r,i){for(var o,s=[e,n];s.length;)(n=s.pop())-(e=s.pop())<=r||(o=e+Math.ceil((n-e)/r/2)*r,U(t,o,e,n,i),s.push(e,o,o,n))}q.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,n=[],r=this.toBBox;if(!Q(t,e))return n;for(var i,o,s,a,u=[];e;){for(i=0,o=e.children.length;i<o;i++)s=e.children[i],Q(t,a=e.leaf?r(s):s)&&(e.leaf?n.push(s):K(t,a)?this._all(s,n):u.push(s));e=u.pop()}return n},collides:function(t){var e=this.data,n=this.toBBox;if(!Q(t,e))return!1;for(var r,i,o,s,a=[];e;){for(r=0,i=e.children.length;r<i;r++)if(o=e.children[r],Q(t,s=e.leaf?n(o):o)){if(e.leaf||K(t,s))return!0;a.push(o)}e=a.pop()}return!1},load:function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0,n=t.length;e<n;e++)this.insert(t[e]);return this}var r=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===r.height)this._splitRoot(this.data,r);else{if(this.data.height<r.height){var i=this.data;this.data=r,r=i}this._insert(r,this.data.height-r.height-1,!0)}else this.data=r;return this},insert:function(t){return t&&this._insert(t,this.data.height-1),this},clear:function(){return this.data=$([]),this},remove:function(t,e){if(!t)return this;for(var n,r,i,o,s=this.data,a=this.toBBox(t),u=[],c=[];s||u.length;){if(s||(s=u.pop(),r=u[u.length-1],n=c.pop(),o=!0),s.leaf&&-1!==(i=j(t,s.children,e)))return s.children.splice(i,1),u.push(s),this._condense(u),this;o||s.leaf||!K(s,a)?r?(n++,s=r.children[n],o=!1):s=null:(u.push(s),c.push(n),n=0,r=s,s=s.children[0])}return this},toBBox:function(t){return t},compareMinX:z,compareMinY:W,toJSON:function(){return this.data},fromJSON:function(t){return this.data=t,this},_all:function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},_build:function(t,e,n,r){var i,o=n-e+1,s=this._maxEntries;if(o<=s)return V(i=$(t.slice(e,n+1)),this.toBBox),i;r||(r=Math.ceil(Math.log(o)/Math.log(s)),s=Math.ceil(o/Math.pow(s,r-1))),(i=$([])).leaf=!1,i.height=r;var a,u,c,l,h=Math.ceil(o/s),p=h*Math.ceil(Math.sqrt(s));for(Z(t,e,n,p,this.compareMinX),a=e;a<=n;a+=p)for(Z(t,a,c=Math.min(a+p-1,n),h,this.compareMinY),u=a;u<=c;u+=h)l=Math.min(u+h-1,c),i.children.push(this._build(t,u,l,r-1));return V(i,this.toBBox),i},_chooseSubtree:function(t,e,n,r){for(var i,o,s,a,u,c,l,h,p,f;r.push(e),!e.leaf&&r.length-1!==n;){for(l=h=1/0,i=0,o=e.children.length;i<o;i++)u=H(s=e.children[i]),p=t,f=s,(c=(Math.max(f.maxX,p.maxX)-Math.min(f.minX,p.minX))*(Math.max(f.maxY,p.maxY)-Math.min(f.minY,p.minY))-u)<h?(h=c,l=u<l?u:l,a=s):c===h&&u<l&&(l=u,a=s);e=a||e.children[0]}return e},_insert:function(t,e,n){var r=this.toBBox,i=n?t:r(t),o=[],s=this._chooseSubtree(i,this.data,e,o);for(s.children.push(t),X(s,i);e>=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(i,o,e)},_split:function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var o=this._chooseSplitIndex(n,i,r),s=$(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,V(n,this.toBBox),V(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},_splitRoot:function(t,e){this.data=$([t,e]),this.data.height=t.height+1,this.data.leaf=!1,V(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,n){var r,i,o,s,a,u,c,l,h,p,f,g,d,y;for(u=c=1/0,r=e;r<=n-e;r++)h=i=Y(t,0,r,this.toBBox),p=o=Y(t,r,n,this.toBBox),void 0,void 0,void 0,void 0,f=Math.max(h.minX,p.minX),g=Math.max(h.minY,p.minY),d=Math.min(h.maxX,p.maxX),y=Math.min(h.maxY,p.maxY),s=Math.max(0,d-f)*Math.max(0,y-g),a=H(i)+H(o),s<u?(u=s,l=r,c=a<c?a:c):s===u&&a<c&&(c=a,l=r);return l},_chooseSplitAxis:function(t,e,n){var r=t.leaf?this.compareMinX:z,i=t.leaf?this.compareMinY:W;this._allDistMargin(t,e,n,r)<this._allDistMargin(t,e,n,i)&&t.children.sort(r)},_allDistMargin:function(t,e,n,r){t.children.sort(r);var i,o,s=this.toBBox,a=Y(t,0,e,s),u=Y(t,n-e,n,s),c=J(a)+J(u);for(i=e;i<n-e;i++)o=t.children[i],X(a,t.leaf?s(o):o),c+=J(a);for(i=n-e-1;i>=e;i--)o=t.children[i],X(u,t.leaf?s(o):o),c+=J(u);return c},_adjustParentBBoxes:function(t,e,n){for(var r=n;r>=0;r--)X(e[r],t)},_condense:function(t){for(var e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children).splice(e.indexOf(t[n]),1):this.clear():V(t[n],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}};const tt=q;function et(t){var e=[t[0],t[1]],n=[t[0],t[3]],r=[t[2],t[3]];return{type:"Feature",bbox:t,properties:{},geometry:{type:"Polygon",coordinates:[[e,[t[2],t[1]],r,n,e]]}}}function nt(t){var e=[1/0,1/0,-1/0,-1/0];return v(t,(function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])})),e}const rt=function(t){if(!t)throw new Error("geojson is required");var e=[];return E(t,(function(t){!function(t,e){var n=[],r=t.geometry;switch(r.type){case"Polygon":n=p(r);break;case"LineString":n=[p(r)]}n.forEach((function(n){(function(t,e){var n=[];return t.reduce((function(t,r){var i,s,a,u,c,l,h=o([t,r],e);return h.bbox=(s=r,a=(i=t)[0],u=i[1],[a<(c=s[0])?a:c,u<(l=s[1])?u:l,a>c?a:c,u>l?u:l]),n.push(h),r})),n})(n,t.properties).forEach((function(t){t.id=e.length,e.push(t)}))}))}(t,e)})),s(e)};function it(t,n){var r=p(t),i=p(n);if(2!==r.length)throw new Error("<intersects> line1 must only contain 2 coordinates");if(2!==i.length)throw new Error("<intersects> line2 must only contain 2 coordinates");var o=r[0][0],s=r[0][1],a=r[1][0],u=r[1][1],c=i[0][0],l=i[0][1],h=i[1][0],f=i[1][1],g=(f-l)*(a-o)-(h-c)*(u-s);if(0===g)return null;var d=((h-c)*(s-l)-(f-l)*(o-c))/g,y=((a-o)*(s-l)-(u-s)*(o-c))/g;return d>=0&&d<=1&&y>=0&&y<=1?e([o+d*(a-o),s+d*(u-s)]):null}const ot=function(e,n){var r={},i=[];if("LineString"===e.type&&(e=t(e)),"LineString"===n.type&&(n=t(n)),"Feature"===e.type&&"Feature"===n.type&&"LineString"===e.geometry.type&&"LineString"===n.geometry.type&&2===e.geometry.coordinates.length&&2===n.geometry.coordinates.length){var o=it(e,n);return o&&i.push(o),s(i)}var a=function(t){var e=tt(t);return e.insert=function(t){if(Array.isArray(t)){var e=t;(t=et(e)).bbox=e}else t.bbox=t.bbox?t.bbox:nt(t);return tt.prototype.insert.call(this,t)},e.load=function(t){var e=[];return Array.isArray(t)?t.forEach((function(t){var n=et(t);n.bbox=t,e.push(n)})):m(t,(function(t){t.bbox=t.bbox?t.bbox:nt(t),e.push(t)})),tt.prototype.load.call(this,e)},e.remove=function(t){if(Array.isArray(t)){var e=t;(t=et(e)).bbox=e}return tt.prototype.remove.call(this,t)},e.clear=function(){return tt.prototype.clear.call(this)},e.search=function(t){return{type:"FeatureCollection",features:tt.prototype.search.call(this,this.toBBox(t))}},e.collides=function(t){return tt.prototype.collides.call(this,this.toBBox(t))},e.all=function(){return{type:"FeatureCollection",features:tt.prototype.all.call(this)}},e.toJSON=function(){return tt.prototype.toJSON.call(this)},e.fromJSON=function(t){return tt.prototype.fromJSON.call(this,t)},e.toBBox=function(t){var e;return{minX:(e=t.bbox?t.bbox:Array.isArray(t)&&4===t.length?t:nt(t))[0],minY:e[1],maxX:e[2],maxY:e[3]}},e}();return a.load(rt(n)),m(rt(e),(function(t){m(a.search(t),(function(e){var n=it(t,e);if(n){var o=p(n).join(",");r[o]||(r[o]=!0,i.push(n))}}))})),s(i)};function st(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function at(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ut(t,e,n){return e&&at(t.prototype,e),n&&at(t,n),t}function ct(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n(6495),n(2990),n(8927),n(3105),n(5035),n(4345),n(7174),n(2846),n(4731),n(7209),n(6319),n(8867),n(7789),n(3739),n(9368),n(4483),n(2056),n(3462),n(678),n(7462),n(3824),n(5021),n(2974),n(5016),n(9135),n(8264),n(9714),n(7042);var lt=function(){function t(e){st(this,t),ct(this,"_xx",void 0),ct(this,"_yy",void 0),ct(this,"_ii",void 0),ct(this,"_nn",void 0),ct(this,"_zz",void 0),ct(this,"_zlimit",0),ct(this,"_bb",void 0),ct(this,"_allBounds",void 0),ct(this,"_arcIter",void 0),ct(this,"_filteredArcIter",void 0),ct(this,"buf",void 0),this.initArcs(e)}return ut(t,[{key:"initArcs",value:function(t){var e=[],n=[],r=t.map((function(t){for(var r=t?t.length:0,i=0;i<r;i++)e.push(t[i][0]),n.push(t[i][1]);return r}));this.initXYData(r,e,n)}},{key:"initXYData",value:function(t,e,n){var r=t.length;this._xx=new Float64Array(e),this._yy=new Float64Array(n),this._nn=new Uint32Array(t),this._zz=null,this._zlimit=0,this._filteredArcIter=null,this._ii=new Uint32Array(r);for(var i=0,o=0;o<r;o++)this._ii[o]=i,i+=t[o];i==this._xx.length&&this._xx.length==this._yy.length||ht("ArcCollection#initXYData() Counting error"),this.initBounds(),this._arcIter=new Ct(this._xx,this._yy)}},{key:"initBounds",value:function(){var t=this.calcArcBounds_(this._xx,this._yy,this._nn);this._bb=t.bb,this._allBounds=t.bounds}},{key:"calcArcBounds_",value:function(t,e,n){for(var r,i,o,s=n.length,a=new Float64Array(4*s),u=new Lt,c=0,l=0;l<s;l++)(r=n[l])>0&&(i=4*l,o=Ot(t,e,c,r),a[i++]=o[0],a[i++]=o[1],a[i++]=o[2],a[i]=o[3],c+=r,u.mergeBounds(o));return{bb:a,bounds:u}}},{key:"getBounds",value:function(){return this._allBounds.clone()}},{key:"forEachSegment",value:function(t){for(var e=0,n=0,r=this.size();n<r;n++)e+=this.forEachArcSegment(n,t);return e}},{key:"size",value:function(){return this._ii&&this._ii.length||0}},{key:"forEachArcSegment",value:function(t,e){for(var n=t>=0,r=n?t:~t,i=this.getRetainedInterval(),o=this._nn[r],s=n?1:-1,a=n?this._ii[r]:this._ii[r]+o-1,u=a,c=0,l=1;l<o;l++)u+=s,(0===i||this._zz[u]>=i)&&(e(a,u,this._xx,this._yy),a=u,c++);return c}},{key:"getRetainedInterval",value:function(){return this._zlimit}},{key:"getVertexData",value:function(){return{xx:this._xx,yy:this._yy,zz:this._zz,bb:this._bb,nn:this._nn,ii:this._ii}}},{key:"getUint32Array",value:function(t){var e=4*t;return(!this.buf||this.buf.byteLength<e)&&(this.buf=new ArrayBuffer(e)),new Uint32Array(this.buf,0,t)}},{key:"getAvgSegment2",value:function(){var t=0,e=0,n=this.forEachSegment((function(n,r,i,o){t+=Math.abs(i[n]-i[r]),e+=Math.abs(o[n]-o[r])}));return[t/n||0,e/n||0]}},{key:"calcSegmentIntersectionStripeCount",value:function(){var t=this.getBounds().height(),e=this.getAvgSegment2()[1],n=1;return e>0&&t>0&&(n=Math.ceil(t/e/20)),n||1}},{key:"findSegmentIntersections",value:function(){var t,e,n=this.getBounds(),r=n.ymin,i=n.ymax-r,o=this.calcSegmentIntersectionStripeCount(),s=new Uint32Array(o),a=o>1?function(t){return Math.floor((o-1)*(t-r)/i)}:function(){return 0};this.forEachSegment((function(t,e,n,r){for(var i=a(r[t]),o=a(r[e]);s[i]=s[i]+2,i!=o;)i+=o>i?1:-1}));var u=this.getUint32Array(function(t,e){pt(t)||ht("utils.sum() expects an array, received:",t);for(var n,r=0,i=0,o=t.length;i<o;i++)(n=t[i])?r+=n:isNaN(n)&&0;return r}(s)),c=0,l=[];!function(t,e,n){if(!pt(t))throw new Error("#forEach() takes an array-like argument. ".concat(t));for(var r=0,i=t.length;r<i;r++)e.call(undefined,t[r],r)}(s,(function(t){var e=c;c+=t,l.push(u.subarray(e,c))})),function(t,e){for(var n=0,r=t.length;n<r;n++)t[n]=0}(s),this.forEachSegment((function(t,e,n,r){for(var i,o,u=a(r[t]),c=a(r[e]);i=s[u],s[u]=i+2,(o=l[u])[i]=t,o[i+1]=e,u!=c;)u+=c>u?1:-1}));var h,p=this.getVertexData(),f=[];for(t=0;t<o;t++)for(h=ft(l[t],p.xx,p.yy),e=0;e<h.length;e++)f.push(h[e]);return St(f)}}]),t}();function ht(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=e.join(" ");throw new Error(r)}function pt(t){return!!t&&(!!function(t){return Array.isArray(t)}(t)||!function(t){return null!=t&&t.toString===String.prototype.toString}(t)&&(0===t.length||t.length>0))}function ft(t,e,n){var r,i,o,s,a,u,c,l,h,p,f,g,d,y,_,v,m,x,E,I,b,w,N,S,C,O,L=t.length-2,T=[];for(function(t,e){(function(t,e){for(var n=0,r=e.length;n<r;n+=2)t[e[n]]>t[e[n+1]]&&Et(e,n,n+1)})(t,e),It(t,e,0,e.length-2)}(e,t),v=0;v<L;){for(r=t[v],i=t[v+1],a=e[r],u=e[i],h=n[r],p=n[i],m=v;m<L&&!(u<(c=e[o=t[m+=2]]));){if(f=n[o],l=e[s=t[m+1]],g=n[s],h>=f){if(h>g&&p>f&&p>g)continue}else if(h<g&&p<f&&p<g)continue;r!=o&&r!=s&&i!=o&&i!=s&&(O=void 0,O=null,function(t,e,n,r,i,o,s,a){return gt(t,e,n,r,i,o)*gt(t,e,n,r,s,a)<=0&&gt(i,o,s,a,t,e)*gt(i,o,s,a,n,r)<=0}(x=a,E=h,I=u,b=p,w=c,N=f,S=l,C=g)&&((O=function(t,e,n,r,i,o,s,a){var u,c=yt(t,e,n,r,i,o,s,a);return c&&(1==(u=function(t,e){for(var n,r=-1,i=1/0,o=0,s=0,a=arguments.length<=2?0:arguments.length-2;s<a;o++,s+=2)(n=vt(t,e,s+2<2||arguments.length<=s+2?void 0:arguments[s+2],s+1+2<2||arguments.length<=s+1+2?void 0:arguments[s+1+2]))<i&&(i=n,r=o);return r}(c[0],c[1],t,e,n,r,i,o,s,a))?c=yt(n,r,t,e,i,o,s,a):2==u?c=yt(i,o,s,a,t,e,n,r):3==u&&(c=yt(s,a,i,o,t,e,n,r))),c&&function(t,e,n,r,i,o,s,a,u){var c=t[0],l=t[1];c=mt(c,e,r),c=mt(c,o,a),l=mt(l,n,i),l=mt(l,s,u),t[0]=c,t[1]=l}(c,t,e,n,r,i,o,s,a),c}(x,E,I,b,w,N,S,C))?function(t,e,n,r,i,o,s,a){return t==i&&e==o||t==s&&e==a||n==i&&r==o||n==s&&r==a}(x,E,I,b,w,N,S,C)&&(O=null):O=function(t,e,n,r,i,o,s,a){var u=Math.min(t,n,i,s),c=Math.max(t,n,i,s),l=Math.min(e,r,o,a),h=Math.max(e,r,o,a),p=h-l>c-u,f=[];return(p?xt(e,l,h):xt(t,u,c))&&f.push(t,e),(p?xt(r,l,h):xt(n,u,c))&&f.push(n,r),(p?xt(o,l,h):xt(i,u,c))&&f.push(i,o),(p?xt(a,l,h):xt(s,u,c))&&f.push(s,a),(2!=f.length&&4!=f.length||4==f.length&&f[0]==f[2]&&f[1]==f[3])&&(f=null),f}(x,E,I,b,w,N,S,C)),d=O)&&(y=[r,i],_=[o,s],T.push(wt(d,y,_,e,n)),4==d.length&&T.push(wt(d.slice(2),y,_,e,n)))}v+=2}return T}function gt(t,e,n,r,i,o){return dt(t-i,e-o,n-i,r-o)}function dt(t,e,n,r){return t*r-e*n}function yt(t,e,n,r,i,o,s,a){var u=dt(n-t,r-e,s-i,a-o);if(0===u)return null;var c=gt(i,o,s,a,t,e)/u;return u<=1e-18&&u>=-1e-18?function(t,e,n,r,i,o,s,a){var u=null;return _t(t,i,s)||_t(e,o,a)?_t(n,i,s)||_t(r,o,a)?_t(i,t,n)||_t(o,e,r)?_t(s,t,n)||_t(a,e,r)||(u=[s,a]):u=[i,o]:u=[n,r]:u=[t,e],u}(t,e,n,r,i,o,s,a):[t+c*(n-t),e+c*(r-e)]}function _t(t,e,n){return e<n?t<e||t>n:e>n?t>e||t<n:t!=e}function vt(t,e,n,r){var i=t-n,o=e-r;return i*i+o*o}function mt(t,e,n){var r;return _t(t,e,n)&&(r=Math.abs(t-e)<Math.abs(t-n)?e:n,Math.abs(t-r),t=r),t}function xt(t,e,n){return t>e&&t<n}function Et(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function It(t,e,n,r){for(var i,o,s=n,a=r;s<r;){for(i=t[e[n+r>>2<<1]];s<=a;){for(;t[e[s]]<i;)s+=2;for(;t[e[a]]>i;)a-=2;s<=a&&(o=e[s],e[s]=e[a],e[a]=o,o=e[s+1],e[s+1]=e[a+1],e[a+1]=o,s+=2,a-=2)}if(a-n<40?bt(t,e,n,a):It(t,e,n,a),r-s<40)return void bt(t,e,s,r);n=s,a=r}}function bt(t,e,n,r){for(var i,o,s=n+2;s<=r;s+=2){i=e[s],o=e[s+1];var a=void 0;for(a=s-2;a>=n&&t[i]<t[e[a]];a-=2)e[a+2]=e[a],e[a+3]=e[a+1];e[a+2]=i,e[a+3]=o}}function wt(t,e,n,r,i){var o=t[0],s=t[1];e=Nt(o,s,e[0],e[1],r,i),n=Nt(o,s,n[0],n[1],r,i);var a=e[0]<n[0]?e:n;return{x:o,y:s,a,b:a==e?n:e}}function Nt(t,e,n,r,i,o){var s=n<r?n:r,a=s===n?r:n;return i[s]==t&&o[s]==e?a=s:i[a]==t&&o[a]==e&&(s=a),[s,a]}function St(t){var e={};return t.filter((function(t){var n=function(t){return"".concat(t.a.join(","),";").concat(t.b.join(","))}(t);return!(n in e)&&(e[n]=!0,!0)}))}var Ct=function t(e,n){st(this,t),ct(this,"_i",0),ct(this,"_n",0),ct(this,"_inc",1),ct(this,"_xx",void 0),ct(this,"_yy",void 0),ct(this,"i",0),ct(this,"x",0),ct(this,"y",0),this._xx=e,this._yy=n};function Ot(t,e,n,r){var i,o,s,a,u,c,l=0|n,h=isNaN(r)?t.length-l:r+l;if(!(h>0))return[void 0,void 0,void 0,void 0];for(s=u=t[l],a=c=e[l],l++;l<h;l++)(i=t[l])<s&&(s=i),i>u&&(u=i),(o=e[l])<a&&(a=o),o>c&&(c=o);return[s,a,u,c]}var Lt=function(){function t(){st(this,t),ct(this,"xmin",void 0),ct(this,"ymin",void 0),ct(this,"xmax",void 0),ct(this,"ymax",void 0);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];n.length>0&&this.setBounds(n)}return ut(t,[{key:"cloneBounds",value:function(){return this.clone()}},{key:"clone",value:function(){return new t(this.xmin,this.ymin,this.xmax,this.ymax)}},{key:"width",value:function(){return this.xmax-this.xmin||0}},{key:"height",value:function(){return this.ymax-this.ymin||0}},{key:"setBounds",value:function(t,e,n,r){return 1==arguments.length&&(pt(t)?(e=t[1],n=t[2],r=t[3],t=t[0]):(e=t.ymin,n=t.xmax,r=t.ymax,t=t.xmin)),this.xmin=t,this.ymin=e,this.xmax=n,this.ymax=r,(t>n||e>r)&&this.update(),this}},{key:"update",value:function(){var t;this.xmin>this.xmax&&(t=this.xmin,this.xmin=this.xmax,this.xmax=t),this.ymin>this.ymax&&(t=this.ymin,this.ymin=this.ymax,this.ymax=t)}},{key:"mergeBounds",value:function(e){var n,r,i,o;return e instanceof t?(n=e.xmin,r=e.ymin,i=e.xmax,o=e.ymax):3==(arguments.length<=1?0:arguments.length-1)?(n=e,r=arguments.length<=1?void 0:arguments[1],i=arguments.length<=2?void 0:arguments[2],o=arguments.length<=3?void 0:arguments[3]):4==e.length?(n=e[0],r=e[1],i=e[2],o=e[3]):ht("Bounds#mergeBounds() invalid argument:",e),void 0===this.xmin?this.setBounds(n,r,i,o):(n<this.xmin&&(this.xmin=n),r<this.ymin&&(this.ymin=r),i>this.xmax&&(this.xmax=i),o>this.ymax&&(this.ymax=o)),this}}]),t}();function Tt(t){return(Tt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Mt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}n(6977),n(86),n(561),n(2526),n(1817),n(2165);var Pt=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.x=e,this.y=n}var e,n;return e=t,(n=[{key:"dot",value:function(t){return this.x*t.x+this.y*t.y}},{key:"add",value:function(e){return new t(this.x+e.x,this.y+e.y)}},{key:"sub",value:function(e){return new t(this.x-e.x,this.y-e.y)}},{key:"scale",value:function(e){return new t(this.x*e,this.y*e)}},{key:"sqDistanceTo",value:function(t){return(this.x-t.x)*(this.x-t.x)+(this.y-t.y)*(this.y-t.y)}},{key:"toStr",value:function(){return"(".concat(this.x.toFixed(3),", ").concat(this.y.toFixed(3),")")}},{key:"copyFrom",value:function(t){this.x=t.x,this.y=t.y}}])&&Mt(e.prototype,n),t}();function Rt(t,e){return t.x*e.y-t.y*e.x}function At(t,e){return Rt(t[1].sub(t[0]),e.sub(t[0]))}var Dt=new Pt(0,0);function Ft(t,e){return t.bin==e.bin?0:t.bin<e.bin?-1:1}function kt(t,e){var n=t[1].sub(t[0]),r=e[0].sub(t[0]),i=e[1].sub(t[0]),o=Rt(n,r),s=Rt(n,i);if(o>0&&s>0||o<0&&s<0)return!1;var a=e[1].sub(e[0]),u=t[0].sub(e[0]),c=t[1].sub(e[0]),l=Rt(a,u),h=Rt(a,c);if(l>0&&h>0||l<0&&h<0)return!1;if(Math.abs(o)<1e-14&&Math.abs(s)<1e-14){if(Math.max(e[0].x,e[1].x)<Math.min(t[0].x,t[1].x)||Math.min(e[0].x,e[1].x)>Math.max(t[0].x,t[1].x))return!1;if(Math.max(e[0].y,e[1].y)<Math.min(t[0].y,t[1].y)||Math.min(e[0].y,e[1].y)>Math.max(t[0].y,t[1].y))return!1}return!0}function Bt(t,e,n){for(var r=e.scaled_vert,i=e.tri,o=e.adj,s=Math.max(10,o.length),a=0,u=[];a<s;){if(-1===n)return[n,a];var c=i[n],l=[At([r[c[1]],r[c[2]]],t),At([r[c[2]],r[c[0]]],t),At([r[c[0]],r[c[1]]],t)];if(l[0]>=0&&l[1]>=0&&l[2]>=0)return[n,a];for(var h=-1,p=0;p<3;p++)if(l[p]>=0){h=p;break}var f=(h+1)%3,g=(h+2)%3;if(l[f]>=0&&l[g]<0)n=o[n][g],u[a]=r[c[h]].add(r[c[f]]).scale(.5);else if(l[f]<0&&l[g]>=0)n=o[n][f],u[a]=r[c[g]].add(r[c[h]]).scale(.5);else{var d=r[c[f]].sub(r[c[h]]),y=t.sub(r[c[h]]);d.dot(y)>0?(n=o[n][g],u[a]=r[c[h]].add(r[c[f]]).scale(.5)):(n=o[n][f],u[a]=r[c[g]].add(r[c[h]]).scale(.5))}a++}throw"Could not locate the triangle that encloses (".concat(t.x,", ").concat(t.y,")!")}function Gt(t,e,n){for(var r=e.scaled_vert,i=e.tri,o=e.adj,s=r[t];n.length>0;){for(var a=n.pop(),u=a[0],c=i[u],l=[],h=0;h<3;h++)l[h]=r[c[h]];if(!qt(l,s)){var p=a[1],f=o[u][p];if(f<0)throw"negative index";Ut(e,u,f);var g=i[u].indexOf(t),d=o[u][g];if(d>=0){var y=o[d].indexOf(u);n.push([d,y])}var _=i[f].indexOf(t),v=o[f][_];if(v>=0){var m=o[v].indexOf(f);n.push([v,m])}}}}function Ut(t,e,n){var r=t.tri,i=t.adj,o=t.vert_to_tri,s=i[e].indexOf(n),a=i[n].indexOf(e),u=(s+1)%3,c=(s+2)%3,l=(a+1)%3,h=(a+2)%3;r[e][c]=r[n][a],r[n][h]=r[e][s],i[e][s]=i[n][l],i[n][a]=i[e][u];var p=i[e][u];if(p>=0){var f=i[p].indexOf(e);i[p][f]=n}var g=i[n][l];if(g>=0){var d=i[g].indexOf(n);i[g][d]=e}if(i[e][u]=n,i[n][l]=e,o.length>0){o[r[e][s]].push(n),o[r[n][a]].push(e);var y=o[r[e][u]].indexOf(n);o[r[e][u]].splice(y,1),y=o[r[n][l]].indexOf(e),o[r[n][l]].splice(y,1)}}function qt(t,e){var n=t[0].sub(e),r=t[1].sub(e),i=t[2].sub(e),o=n.x*n.x+n.y*n.y,s=r.x*r.x+r.y*r.y,a=i.x*i.x+i.y*i.y;return n.x*(r.y*a-s*i.y)-n.y*(r.x*a-s*i.x)+o*(r.x*i.y-r.y*i.x)<=0}function jt(t,e){for(var n=t.tri,r=t.scaled_vert,i=t.adj,o=t.con_edge,s=t.vert_to_tri,a=o[e][0],u=o[e][1],c=[r[a],r[u]],l=s[a],h=!1,p=[],f=0;f<l.length;f++){var g=n[l[f]],d=g.indexOf(a),y=(d+1)%3,_=(d+2)%3;if(u==g[y]){h=!0;break}if(u==g[_]){h=!0;break}if(kt(c,[r[g[y]],r[g[_]]])){p.push([l[f],d]);break}}if(!h){if(0==p.length)throw"Cannot have no intersections!";for(;;){var v=p[p.length-1],m=i[v[0]][v[1]];if(n[m][0]==u||n[m][1]==u||n[m][2]==u)break;var x=i[m].indexOf(v[0]);if(-1==x)throw"Could not find edge!";for(var E=n[m],I=1;I<3;I++){var b=(x+I+2)%3;if(kt(c,[r[E[(x+I+1)%3]],r[E[b]]])){p.push([m,(x+I)%3]);break}}}}return p}function Vt(t,e,n,r){for(var i=t.tri,o=t.scaled_vert,s=t.adj,a=t.con_edge[n],u=[o[a[0]],o[a[1]]],c=e.length,l=0;l<c;l++){var h=e[c-1-l][0],p=e[c-1-l][1],f=s[h][p],g=s[f].indexOf(h),d=o[i[h][p]],y=o[i[h][(p+1)%3]],_=o[i[f][g]];if(kt([d,_],[y,o[i[h][(p+2)%3]]])){Ut(t,h,f);var v=[i[h][p],i[f][g]],m=[d,_];v[0]!=a[0]&&v[0]!=a[1]&&v[1]!=a[0]&&v[1]!=a[1]&&kt(u,m)||r.push([v[0],v[1]])}}}function Yt(t,e,n){for(var r=[n[t[0]],n[t[1]]],i=0;i<e.length;i++){if(e[i][0]==t[0]&&e[i][1]==t[1]||e[i][0]==t[1]&&e[i][1]==t[0])return!1;var o=e[i][0]==t[0]||e[i][0]==t[1]||e[i][1]==t[0]||e[i][1]==t[1],s=[n[e[i][0]],n[e[i][1]]];if(!o&&kt(s,r))return!1}return!0}function Xt(t,e,n){if(e||(e=[]),"object"!==Tt(t)||"FeatureCollection"!==t.type)throw"Argument points must be FeatureCollection";if(!Array.isArray(e))throw"Argument points must be Array of Array";var r=!1,o=t.features.reduce((function(t,e){var i=e.geometry.coordinates;return t[0].push(i[0]),t[1].push(i[1]),n?t[2].push(e.properties[n]):3===i.length&&(r=!0,t[2].push(e.geometry.coordinates[2])),t}),[[],[],[]]),a=Math.max.apply(null,o[0]),u=Math.min.apply(null,o[0]),c=Math.max.apply(null,o[1]),l=Math.min.apply(null,o[1]),h=a-u,p=(a+u)/2,f=c-l,g=(c+l)/2,d=1.1*Math.max(h,f),y={vert:t.features.map((function(t){var e=t.geometry.coordinates,n=[(e[0]-p)/d+.5,(e[1]-g)/d+.5];return new Pt(n[0],n[1])}))};!function(t,e){var n=t.vert.length;t.con_edge=[];for(var r=0;r<e.length;r++){var i=e[r];if(i[0]<0||i[0]>=n||i[1]<0||i[1]>=n)throw"Vertex indices of edge ".concat(r," need to be non-negative and less than the number of input vertices.");if(i[0]===i[1])throw"Edge ".concat(r," is degenerate!");if(!Yt(i,t.con_edge,t.vert))throw"Edge ".concat(r," already exists or intersects with an existing edge!");t.con_edge.push([i[0],i[1]])}}(y,e),function(t){!function(t){for(var e=t.vert.length,n=Math.round(Math.pow(e,.25)),r=[],i=[],o=0;o<e;o++){var s=(t.vert[o].x-Dt.x)/1,a=(t.vert[o].y-Dt.y)/1;r.push(new Pt(s,a));var u,c=Math.round((n-1)*s),l=Math.round((n-1)*a);u=l%2==0?l*n+c:(l+1)*n-c-1,i.push({ind:o,bin:u})}var h=1e3;r.push(new Pt(.5-h,-h/Math.sqrt(3)+.5)),r.push(new Pt(h+.5,-h/Math.sqrt(3)+.5)),r.push(new Pt(.5,2*h/Math.sqrt(3)+.5));for(var p=e;p<e+3;p++)t.vert.push(new Pt(1*r[p].x+Dt.x,1*r[p].y+Dt.y));i.sort(Ft),t.scaled_vert=r,t.bin=i,t.tri=[[e,e+1,e+2]],t.adj=[[-1,-1,-1]],t.vert_to_tri=[]}(t);for(var e=t.scaled_vert,n=t.bin,r=t.tri,i=t.adj,o=e.length-3,s=0,a=0;a<o;a++){var u=n[a].ind;if(-1===(s=Bt(e[u],t,s)[0]))throw"Could not find a triangle containing the new vertex!";var c=r[s],l=[c[0],c[1],u],h=[u,c[1],c[2]],p=[c[0],u,c[2]];r[s]=l;var f=r.length,g=i[s];i[s]=[f,f+1,g[2]],r.push(h),r.push(p),i.push([g[0],f+1,s]),i.push([f,g[1],s]);var d=[];if(g[2]>=0){var y=i[g[2]].indexOf(s);d.push([g[2],y])}if(g[0]>=0){var _=i[g[0]].indexOf(s);i[g[0]][_]=f,d.push([g[0],_])}if(g[1]>=0){var v=i[g[1]].indexOf(s);i[g[1]][v]=f+1,d.push([g[1],v])}Gt(u,t,d)}!function(t){for(var e=t.scaled_vert,n=t.tri,r=t.adj,i=e.length-3,o=0,s=[],a=0;a<n.length;a++){for(var u=o,c=a;c<n.length;c++){if(n[c][0]<i&&n[c][1]<i&&n[c][2]<i){s[a+o]=a;break}s[a+o]=-1,o++}var l=o-u;l>0&&(n.splice(a,l),r.splice(a,l))}for(var h=0;h<r.length;h++)for(var p=0;p<3;p++)r[h][p]=s[r[h][p]];t.scaled_vert.splice(-3,3),t.vert.splice(-3,3)}(t)}(y),function(t){if(0!=t.con_edge.length){!function(t){var e=t.tri;t.vert_to_tri=[];for(var n=t.vert_to_tri,r=0;r<e.length;r++)for(var i=0;i<3;i++)null==n[e[r][i]]?n[e[r][i]]=[r]:n[e[r][i]].push(r)}(t);for(var e,n,r=t.con_edge,i=t.tri,o=t.scaled_vert,s=t.adj,a=t.vert_to_tri,u=[],c=0;c<r.length;c++){for(var l=jt(t,c),h=0,p=Math.max(l.length,1);l.length>0&&h<p;)Vt(t,l,c,u),l=jt(t,c),h++;if(l.length>0)throw"Could not add edge ".concat(c," to triangulation after ").concat(p," iterations!")}for(;;){for(var f=0,g=0;g<u.length;g++){for(var d=u[g],y=!1,_=0;_<r.length;_++)if(e=d,n=r[_],e[0]==n[0]&&e[1]==n[1]||e[1]==n[0]&&e[0]==n[1]){y=!0;break}if(!y){for(var v=a[d[0]],m=0,x=[-1,-1],E=0;E<v.length;E++){var I=i[v[E]];if((I[0]==d[1]||I[1]==d[1]||I[2]==d[1])&&(x[m]=v[E],2==++m))break}if(-1!=x[0]){var b=[o[i[x[0]][0]],o[i[x[0]][1]],o[i[x[0]][2]]],w=s[x[1]].indexOf(x[0]);if(!qt(b,o[i[x[1]][w]])){var N=s[x[0]].indexOf(x[1]);Ut(t,x[0],x[1]),f++,u[g]=[i[x[0]][N],i[x[1]][w]]}}}}if(0==f)break}}}(y);var _=["a","b","c"];return s(y.tri.map((function(t){var e={},n=t.map((function(t,n){var i=[o[0][t],o[1][t]];return void 0!==o[2][t]&&(r?i[2]=o[2][t]:e[_[n]]=o[2][t]),i}));return n[3]=n[0],i([n],e)})))}function zt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Wt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Ht(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Jt=2.00703,Kt=function(){function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};zt(this,n),Ht(this,"bounds",void 0),Ht(this,"boundsPolygon",void 0),Ht(this,"centroid",void 0),Ht(this,"edgeNodes",void 0),Ht(this,"edges",void 0),Ht(this,"importance",void 0),Ht(this,"indexedTins",void 0),Ht(this,"kinks",void 0),Ht(this,"points",[]),Ht(this,"pointsWeightBuffer",void 0),Ht(this,"priority",void 0),Ht(this,"stateBackward",void 0),Ht(this,"stateFull",void 0),Ht(this,"stateTriangle",void 0),Ht(this,"strictMode",void 0),Ht(this,"strict_status",void 0),Ht(this,"tins",void 0),Ht(this,"vertexMode",void 0),Ht(this,"vertices_params",void 0),Ht(this,"wh",void 0),Ht(this,"xy",void 0),Ht(this,"yaxisMode",void 0),Ht(this,"pointsSet",void 0),t.bounds?this.setBounds(t.bounds):(this.setWh(t.wh),this.vertexMode=t.vertexMode||n.VERTEX_PLAIN),this.strictMode=t.strictMode||n.MODE_AUTO,this.yaxisMode=t.yaxisMode||n.YAXIS_INVERT,this.importance=t.importance||0,this.priority=t.priority||0,this.stateFull=t.stateFull||!1,t.points&&this.setPoints(t.points),t.edges&&this.setEdges(t.edges)}var r,a;return r=n,(a=[{key:"getFormatVersion",value:function(){return Jt}},{key:"setPoints",value:function(t){this.yaxisMode==n.YAXIS_FOLLOW&&(t=t.map((function(t){return[t[0],[t[1][0],-1*t[1][1]]]}))),this.points=t,this.tins=void 0,this.indexedTins=void 0}},{key:"setEdges",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.edges=le(t),this.edgeNodes=void 0,this.tins=void 0,this.indexedTins=void 0}},{key:"setBounds",value:function(t){this.bounds=t;for(var e=t[0][0],r=e,o=t[0][1],s=o,a=[t[0]],u=1;u<t.length;u++){var c=t[u];c[0]<e&&(e=c[0]),c[0]>r&&(r=c[0]),c[1]<o&&(o=c[1]),c[1]>s&&(s=c[1]),a.push(c)}a.push(t[0]),this.boundsPolygon=i([a]),this.xy=[e,o],this.wh=[r-e,s-o],this.vertexMode=n.VERTEX_PLAIN,this.tins=void 0,this.indexedTins=void 0}},{key:"setCompiled",value:function(t){var r=this;if(t.version||!t.tins&&t.points&&t.tins_points){this.points=t.points,this.pointsWeightBuffer=!t.version||t.version<2.00703?["forw","bakw"].reduce((function(e,n){var r=t.weight_buffer[n];return r&&(e[n]=Object.keys(r).reduce((function(t,e){return t[ce(e)]=r[e],t}),{})),e}),{}):t.weight_buffer,t.strict_status?this.strict_status=t.strict_status:t.kinks_points?this.strict_status=n.STATUS_ERROR:2==t.tins_points.length?this.strict_status=n.STATUS_LOOSE:this.strict_status=n.STATUS_STRICT,this.vertices_params={forw:[t.vertices_params[0]],bakw:[t.vertices_params[1]]},this.vertices_params.forw[1]=[0,1,2,3].map((function(e){var n=(e+1)%4;return s([ue(["c","b".concat(e),"b".concat(n)],t.points,t.edgeNodes||[],t.centroid_point,t.vertices_points,!1,Jt)])})),this.vertices_params.bakw[1]=[0,1,2,3].map((function(e){var n=(e+1)%4;return s([ue(["c","b".concat(e),"b".concat(n)],t.points,t.edgeNodes||[],t.centroid_point,t.vertices_points,!0,Jt)])})),this.centroid={forw:e(t.centroid_point[0],{target:{geom:t.centroid_point[1],index:"c"}}),bakw:e(t.centroid_point[1],{target:{geom:t.centroid_point[0],index:"c"}})},this.edges=le(t.edges||[]),this.edgeNodes=t.edgeNodes||[];var i=1==t.tins_points.length?0:1;this.tins={forw:s(t.tins_points[0].map((function(e){return ue(e,t.points,t.edgeNodes||[],t.centroid_point,t.vertices_points,!1,t.version)}))),bakw:s(t.tins_points[i].map((function(e){return ue(e,t.points,t.edgeNodes||[],t.centroid_point,t.vertices_points,!0,t.version)})))},this.addIndexedTin(),t.kinks_points&&(this.kinks={bakw:s(t.kinks_points.map((function(t){return e(t)})))}),t.yaxisMode?this.yaxisMode=t.yaxisMode:this.yaxisMode=n.YAXIS_INVERT,t.vertexMode&&(this.vertexMode=t.vertexMode),t.strictMode&&(this.strictMode=t.strictMode),t.bounds?(this.bounds=t.bounds,this.boundsPolygon=t.boundsPolygon,this.xy=t.xy,this.wh=t.wh):(this.xy=[0,0],t.wh&&(this.wh=t.wh),this.bounds=void 0,this.boundsPolygon=void 0)}else!function(){t=JSON.parse(JSON.stringify(t).replace('"cent"','"c"').replace(/"bbox(\d+)"/g,'"b$1"')),r.tins=t.tins,r.addIndexedTin(),r.strict_status=t.strict_status,r.pointsWeightBuffer=t.weight_buffer,r.vertices_params=t.vertices_params,r.centroid=t.centroid,r.kinks=t.kinks;for(var e=[],n=function(t){var n=r.tins.forw.features[t];["a","b","c"].map((function(t,r){var i=n.geometry.coordinates[0][r],o=n.properties[t].geom,s=n.properties[t].index;e[s]=[i,o]}))},i=0;i<r.tins.forw.features.length;i++)n(i);r.points=e}();return{tins:this.tins,strict_status:this.strict_status,weight_buffer:this.pointsWeightBuffer,vertices_params:this.vertices_params,centroid:this.centroid,kinks:this.kinks}}},{key:"getCompiled",value:function(){var t={};t.version=Jt,t.points=this.points,t.weight_buffer=this.pointsWeightBuffer,t.centroid_point=[this.centroid.forw.geometry.coordinates,this.centroid.forw.properties.target.geom],t.vertices_params=[this.vertices_params.forw[0],this.vertices_params.bakw[0]],t.vertices_points=[];var e=this.vertices_params.forw[1];return[0,1,2,3].map((function(n){var r=e[n].features[0],i=r.geometry.coordinates[0][1],o=r.properties.b.geom;t.vertices_points[n]=[i,o]})),t.strict_status=this.strict_status,t.tins_points=[[]],this.tins.forw.features.map((function(e){t.tins_points[0].push(["a","b","c"].map((function(t){return e.properties[t].index})))})),this.strict_status==n.STATUS_LOOSE?(t.tins_points[1]=[],this.tins.bakw.features.map((function(e){t.tins_points[1].push(["a","b","c"].map((function(t){return e.properties[t].index})))}))):this.strict_status==n.STATUS_ERROR&&(t.kinks_points=this.kinks.bakw.features.map((function(t){return t.geometry.coordinates}))),t.yaxisMode=this.yaxisMode,t.vertexMode=this.vertexMode,t.strictMode=this.strictMode,this.bounds?(t.bounds=this.bounds,t.boundsPolygon=this.boundsPolygon,t.xy=this.xy,t.wh=this.wh):t.wh=this.wh,t.edges=this.edges,t.edgeNodes=this.edgeNodes,t}},{key:"addIndexedTin",value:function(){var t=this.tins,e=t.forw,n=t.bakw,r=Math.ceil(Math.sqrt(e.features.length));if(r<3)this.indexedTins=void 0;else{var i=[],o=[],s=e.features.map((function(t){var e=[];return p(t)[0].map((function(t){0===i.length?i=[Array.from(t),Array.from(t)]:(t[0]<i[0][0]&&(i[0][0]=t[0]),t[0]>i[1][0]&&(i[1][0]=t[0]),t[1]<i[0][1]&&(i[0][1]=t[1]),t[1]>i[1][1]&&(i[1][1]=t[1])),0===e.length?e=[Array.from(t),Array.from(t)]:(t[0]<e[0][0]&&(e[0][0]=t[0]),t[0]>e[1][0]&&(e[1][0]=t[0]),t[1]<e[0][1]&&(e[0][1]=t[1]),t[1]>e[1][1]&&(e[1][1]=t[1]))})),e})),a=(i[1][0]-i[0][0])/r,u=(i[1][1]-i[0][1])/r,c=s.reduce((function(t,e,n){for(var o=ie(e[0][0],i[0][0],a,r),s=ie(e[1][0],i[0][0],a,r),c=ie(e[0][1],i[0][1],u,r),l=ie(e[1][1],i[0][1],u,r),h=o;h<=s;h++){t[h]||(t[h]=[]);for(var p=c;p<=l;p++)t[h][p]||(t[h][p]=[]),t[h][p].push(n)}return t}),[]),l=n.features.map((function(t){var e=[];return p(t)[0].map((function(t){0===o.length?o=[Array.from(t),Array.from(t)]:(t[0]<o[0][0]&&(o[0][0]=t[0]),t[0]>o[1][0]&&(o[1][0]=t[0]),t[1]<o[0][1]&&(o[0][1]=t[1]),t[1]>o[1][1]&&(o[1][1]=t[1])),0===e.length?e=[Array.from(t),Array.from(t)]:(t[0]<e[0][0]&&(e[0][0]=t[0]),t[0]>e[1][0]&&(e[1][0]=t[0]),t[1]<e[0][1]&&(e[0][1]=t[1]),t[1]>e[1][1]&&(e[1][1]=t[1]))})),e})),h=(o[1][0]-o[0][0])/r,f=(o[1][1]-o[0][1])/r,g=l.reduce((function(t,e,n){for(var i=ie(e[0][0],o[0][0],h,r),s=ie(e[1][0],o[0][0],h,r),a=ie(e[0][1],o[0][1],f,r),u=ie(e[1][1],o[0][1],f,r),c=i;c<=s;c++){t[c]||(t[c]=[]);for(var l=a;l<=u;l++)t[c][l]||(t[c][l]=[]),t[c][l].push(n)}return t}),[]);this.indexedTins={forw:{gridNum:r,xOrigin:i[0][0],yOrigin:i[0][1],xUnit:a,yUnit:u,gridCache:c},bakw:{gridNum:r,xOrigin:o[0][0],yOrigin:o[0][1],xUnit:h,yUnit:f,gridCache:g}}}}},{key:"setWh",value:function(t){this.wh=t,this.xy=[0,0],this.bounds=void 0,this.boundsPolygon=void 0,this.tins=void 0,this.indexedTins=void 0}},{key:"setVertexMode",value:function(t){this.vertexMode=t,this.tins=void 0,this.indexedTins=void 0}},{key:"setStrictMode",value:function(t){this.strictMode=t,this.tins=void 0,this.indexedTins=void 0}},{key:"calcurateStrictTinAsync",value:function(){var r=this,o=this.pointsSet.edges;return Promise.all(this.tins.forw.features.map((function(t){return Promise.resolve(se(t))}))).then((function(t){r.tins.bakw=s(t)})).then((function(){var t={};return Promise.all(r.tins.forw.features.map((function(e,n){var i=r.tins.bakw.features[n];return Promise.resolve(pe(t,{forw:e,bakw:i}))}))).then((function(){return Promise.all([he(t),Promise.resolve(t)])})).catch((function(t){throw t}))})).then((function(a){var u=a[0],c=a[1];return u.bakw&&Object.keys(u.bakw).map((function(e){if("Not include case"!=u.bakw[e]){var n=c[e],a=function(){for(var t=new N.GeoJSONReader,e=t.read(JSON.stringify(arguments[0].geometry)),n=1;n<arguments.length;n++)e=N.UnionOp.union(e,t.read(JSON.stringify(arguments[n].geometry)));var r=new N.GeoJSONWriter;return{type:"Feature",geometry:e=r.write(e),properties:arguments[0].properties}}(n[0].forw,n[1].forw);if(!function(e,n){var r=g(e),i=g(n),o=e.properties||{};if(r=P(r),i=P(i),!r)return null;if(!i)return t(r,o);var s=new N.GeoJSONReader,a=s.read(r),u=s.read(i),c=N.OverlayOp.difference(a,u);return c.isEmpty()?null:t((new N.GeoJSONWriter).write(c),o)}(w(s([n[0].forw,n[1].forw])),a)){var l=e.split("-");if(l[0].match(/^[0-9]+$/)&&l[1].match(/^[0-9]+$/))for(var h=l.map((function(t){return parseInt(t)})).sort((function(t,e){return t<e?-1:1})),p=0;p<o.length-1;p++)if(h[0]==o[p][0]&&h[1]==o[p][1])return;var f=l.map((function(t){return["a","b","c"].map((function(t,e){var r=n[0].bakw.properties[t];return{geom:n[0].bakw.geometry.coordinates[0][e],prop:r}})).filter((function(e){return e.prop.index==t}))[0]})),d=n.map((function(t){return["a","b","c"].map((function(e,n){var r=t.bakw.properties[e];return{geom:t.bakw.geometry.coordinates[0][n],prop:r}})).filter((function(t){return t.prop.index!=f[0].prop.index&&t.prop.index!=f[1].prop.index}))[0]}));fe(c,n[0],r.tins),fe(c,n[1],r.tins),f.map((function(t){var e=i([[t.geom,d[0].geom,d[1].geom,t.geom]],{a:t.prop,b:d[0].prop,c:d[1].prop}),n=se(e);pe(c,{forw:n,bakw:e},r.tins)}))}}})),Promise.all(["forw","bakw"].map((function(t){return new Promise((function(n){var i;n((i=r.tins[t].features.map((function(t){return t.geometry.coordinates[0]})),St(new lt(i).findSegmentIntersections()).reduce((function(t,n,r,i){return t||(t={}),t["".concat(n.x,":").concat(n.y)]=n,r!=i.length-1?t:Object.keys(t).map((function(n){return e([t[n].x,t[n].y])}))}),[])))})).catch((function(t){throw t}))}))).then((function(t){0==t[0].length&&0==t[1].length?(r.strict_status=n.STATUS_STRICT,delete r.kinks):(r.strict_status=n.STATUS_ERROR,r.kinks={},t[0].length>0&&(r.kinks.forw=s(t[0])),t[1].length>0&&(r.kinks.bakw=s(t[1])))})).catch((function(t){throw t}))})).catch((function(t){throw t}))}},{key:"generatePointsSet",value:function(){for(var t=this,e={forw:[],bakw:[]},n=0;n<this.points.length;n++){var r=te(this.points[n][0],this.points[n][1],n);e.forw.push(r),e.bakw.push(ee(r))}var i=[],o=0;this.edgeNodes=[],this.edges||(this.edges=[]);for(var a=function(n){var r=t.edges[n][2],s=Object.assign([],t.edges[n][0]),a=Object.assign([],t.edges[n][1]);if(0===s.length&&0===a.length)return i.push(r),"continue";s.unshift(t.points[r[0]][0]),s.push(t.points[r[1]][0]),a.unshift(t.points[r[0]][1]),a.push(t.points[r[1]][1]);var u=[s,a].map((function(t){var e=t.map((function(t,e,n){if(0===e)return 0;var r=n[e-1];return Math.sqrt(Math.pow(t[0]-r[0],2)+Math.pow(t[1]-r[1],2))})),n=e.reduce((function(t,e,n){return 0===n?[0]:(t.push(t[n-1]+e),t)}),[]);return n.map((function(r,i,o){var s=r/o[o.length-1];return[t[i],e[i],n[i],s]}))}));u.map((function(t,e){var n=u[e?0:1];return t.filter((function(e,n){return!(0===n||n===t.length-1||"handled"===e[4])})).map((function(t){var r=t[0],i=t[3],o=n.reduce((function(t,e,n,r){if(t)return t;var o=r[n+1];return e[3]===i?(e[4]="handled",[e]):e[3]<i&&o[3]>i?[e,o]:void 0}),void 0);if(1===o.length)return 0===e?[r,o[0][0],i]:[o[0][0],r,i];var s=o[0],a=o[1],u=(i-s[3])/(a[3]-s[3]),c=[(a[0][0]-s[0][0])*u+s[0][0],(a[0][1]-s[0][1])*u+s[0][1]];return 0===e?[r,c,i]:[c,r,i]}))})).reduce((function(t,e){return t.concat(e)}),[]).sort((function(t,e){return t[2]<e[2]?-1:1})).map((function(n,s,a){t.edgeNodes[o]=[n[0],n[1]];var u=te(n[0],n[1],"e".concat(o));o++,e.forw.push(u),e.bakw.push(ee(u)),0===s?i.push([r[0],e.forw.length-1]):i.push([e.forw.length-2,e.forw.length-1]),s===a.length-1&&i.push([e.forw.length-1,r[1]])}))},u=0;u<this.edges.length;u++)a(u);return{forw:s(e.forw),bakw:s(e.bakw),edges:i}}},{key:"updateTinAsync",value:function(){var t=this,r=this.strictMode,i=this.xy[0]-.05*this.wh[0],s=this.xy[0]+1.05*this.wh[0],a=this.xy[1]-.05*this.wh[1],u=this.xy[1]+1.05*this.wh[1],c=this.bounds?function(e){return d(e,t.boundsPolygon)}:function(e){return e[0]>=t.xy[0]&&e[0]<=t.xy[0]+t.wh[0]&&e[1]>=t.xy[1]&&e[1]<=t.xy[1]+t.wh[1]};return this.points.reduce((function(t,e){return t&&c(e[0])}),!0)?new Promise((function(e){r!=n.MODE_STRICT&&r!=n.MODE_LOOSE&&(r=n.MODE_AUTO);var o=[];t.wh&&(o=[[i,a],[s,a],[i,u],[s,u]]),e([t.generatePointsSet(),o])})).then((function(t){var n=t[0];return Promise.all([new Promise((function(t){t(Xt(n.forw,n.edges,"target"))})),new Promise((function(t){t(Xt(n.bakw,n.edges,"target"))})),new Promise((function(t){var r,i,o,s,a;t((r=n.forw,o=0,s=0,a=0,v(r,(function(t){o+=t[0],s+=t[1],a++}),!0),e([o/a,s/a],i)))})),Promise.resolve(t)]).catch((function(t){throw t}))})).then((function(n){var r=n[0],i=n[1],o=n[2],s=n[3],a=s[0];if(0==r.features.length||0==i.features.length)throw"TOO LINEAR1";var u={forw:o.geometry.coordinates,bakw:oe(o,r)},c=te(u.forw,u.bakw,"c");t.centroid={forw:c,bakw:ee(c)};var l={};return Promise.all([new Promise((function(t){var n,i=w(a.forw).geometry.coordinates[0];try{n=i.map((function(t){return{forw:t,bakw:oe(e(t),r)}}))}catch(t){throw"TOO LINEAR2"}n.map((function(t){l["".concat(t.forw[0],":").concat(t.forw[1])]=t})),t(void 0)})),new Promise((function(t){var n,r=w(a.bakw).geometry.coordinates[0];try{n=r.map((function(t){return{bakw:t,forw:oe(e(t),i)}}))}catch(t){throw"TOO LINEAR2"}n.map((function(t){l["".concat(t.forw[0],":").concat(t.forw[1])]=t})),t(void 0)}))]).then((function(){return[u,l,s]})).catch((function(t){throw t}))})).then((function(e){var r=e[0],o=e[1],c=e[2],l=Object.keys(o).reduce((function(t,e,n,c){var l=o[e].forw,h=o[e].bakw,p={forw:[l[0]-r.forw[0],l[1]-r.forw[1]]};p.bakw=[h[0]-r.bakw[0],h[1]-r.bakw[1]];var f=0==p.forw[0]?1/0:((p.forw[0]<0?i:s)-r.forw[0])/p.forw[0],g=0==p.forw[1]?1/0:((p.forw[1]<0?a:u)-r.forw[1])/p.forw[1];if(Math.abs(f)/Math.abs(g)<1.1){var d={forw:[p.forw[0]*f+r.forw[0],p.forw[1]*f+r.forw[1]],bakw:[p.bakw[0]*f+r.bakw[0],p.bakw[1]*f+r.bakw[1]]};p.forw[0]<0?t[3].push(d):t[1].push(d)}if(Math.abs(g)/Math.abs(f)<1.1){var y={forw:[p.forw[0]*g+r.forw[0],p.forw[1]*g+r.forw[1]],bakw:[p.bakw[0]*g+r.bakw[0],p.bakw[1]*g+r.bakw[1]]};p.forw[1]<0?t[0].push(y):t[2].push(y)}return t}),[[],[],[],[]]),h=Object.keys(o).reduce((function(e,i,s,a){var u=o[i].forw,c=o[i].bakw,l={forw:[u[0]-r.forw[0],u[1]-r.forw[1]]};if(l.bakw=[c[0]-r.bakw[0],r.bakw[1]-c[1]],0==l.forw[0]||0==l.forw[1])return e;var h=0;return l.forw[0]>0&&(h+=1),l.forw[1]>0&&(h+=2),e[h].push([l.forw,l.bakw]),s==a.length-1?e.length==e.filter((function(t){return t.length>0})).length&&t.vertexMode==n.VERTEX_BIRDEYE?e:e.reduce((function(t,e){return[t[0].concat(e)]}),[[]]):e}),[[],[],[],[]]).map((function(t){return t.reduce((function(t,e,n,r){t||(t=[1/0,0,0]);var i=Math.sqrt(Math.pow(e[0][0],2)+Math.pow(e[0][1],2))/Math.sqrt(Math.pow(e[1][0],2)+Math.pow(e[1][1],2));i=i<t[0]?i:t[0];var o=Math.atan2(e[0][0],e[0][1])-Math.atan2(e[1][0],e[1][1]),s=t[1]+Math.cos(o),a=t[2]+Math.sin(o);return n==r.length-1?[i,Math.atan2(a,s)]:[i,s,a]}),null)}));return 1==h.length&&(h=[h[0],h[0],h[0],h[0]]),[h,r,l,c]})).then((function(t){var e=t[0],n=t[1],r=t[2],i=t[3][0],s=t[3][1],a=e.map((function(t,e){var r=s[e],i=[r[0]-n.forw[0],r[1]-n.forw[1]],o=Math.sqrt(Math.pow(i[0],2)+Math.pow(i[1],2))/t[0],a=Math.atan2(i[0],i[1])-t[1];return{forw:r,bakw:[n.bakw[0]+o*Math.sin(a),n.bakw[1]-o*Math.cos(a)]}})),u=a[2];a[2]=a[3],a[3]=u;for(var c=[1,1,1,1],l=function(t){var e=(t+1)%4,i=o([a[t].bakw,a[e].bakw]);r[t].map((function(r){var s=o([n.bakw,r.bakw]),a=ot(i,s);if(a.features.length>0&&a.features[0].geometry){var u=a.features[0],l=Math.sqrt(Math.pow(r.bakw[0]-n.bakw[0],2)+Math.pow(r.bakw[1]-n.bakw[1],2))/Math.sqrt(Math.pow(u.geometry.coordinates[0]-n.bakw[0],2)+Math.pow(u.geometry.coordinates[1]-n.bakw[1],2));l>c[t]&&(c[t]=l),l>c[e]&&(c[e]=l)}}))},h=0;h<4;h++)l(h);return[a=a.map((function(t,e){var r=c[e],i=[(t.bakw[0]-n.bakw[0])*r+n.bakw[0],(t.bakw[1]-n.bakw[1])*r+n.bakw[1]];return{forw:t.forw,bakw:i}})),i]})).then((function(e){for(var i=e[0],o=e[1],s={forw:[],bakw:[]},a=0;a<i.length;a++){var u=te(i[a].forw,i[a].bakw,"b".concat(a)),c=ee(u);o.forw.features.push(u),o.bakw.features.push(c),s.forw.push(u),s.bakw.push(c)}return t.pointsSet=o,t.tins={forw:Qt(Xt(o.forw,o.edges,"target"))},(r==n.MODE_STRICT||r==n.MODE_AUTO?t.calcurateStrictTinAsync():Promise.resolve()).then((function(){return(r==n.MODE_LOOSE||r==n.MODE_AUTO&&t.strict_status==n.STATUS_ERROR)&&(t.tins.bakw=Qt(Xt(o.bakw,o.edges,"target")),delete t.kinks,t.strict_status=n.STATUS_LOOSE),t.vertices_params={forw:$t(s.forw,t.centroid.forw),bakw:$t(s.bakw,t.centroid.bakw)},t.addIndexedTin(),t.calculatePointsWeightAsync()})).catch((function(t){throw t}))})).catch((function(t){throw t})):new Promise((function(t,e){e("SOME POINTS OUTSIDE")}))}},{key:"transform",value:function(t,r,i){var o=this;if(r&&this.strict_status==n.STATUS_ERROR)throw'Backward transform is not allowed if strict_status == "strict_error"';this.yaxisMode==n.YAXIS_FOLLOW&&r&&(t=[t[0],-1*t[1]]);var s=e(t);if(this.bounds&&!r&&!i&&!d(s,this.boundsPolygon))return!1;var a=r?this.tins.bakw:this.tins.forw,u=r?this.indexedTins.bakw:this.indexedTins.forw,c=r?this.vertices_params.bakw:this.vertices_params.forw,l=r?this.centroid.bakw:this.centroid.forw,h=r?this.pointsWeightBuffer.bakw:this.pointsWeightBuffer.forw,p=void 0,f=void 0;this.stateFull&&(this.stateBackward==r?p=this.stateTriangle:(this.stateBackward=r,this.stateTriangle=void 0),f=function(t){o.stateTriangle=t});var g=oe(s,a,u,c,l,h,p,f);if(this.bounds&&r&&!i){if(!d(e(g),this.boundsPolygon))return!1}else this.yaxisMode!=n.YAXIS_FOLLOW||r||(g=[g[0],-1*g[1]]);return g}},{key:"calculatePointsWeightAsync",value:function(){var t=this,e=["forw"];this.strict_status==n.STATUS_LOOSE&&e.push("bakw");var r={};return Promise.all(e.map((function(e){r[e]={};var n={},i=t.tins[e];return Promise.all(i.features.map((function(t){var i=["a","b","c"];return new Promise((function(o){for(var s=0;s<3;s++){var a=(s+1)%3,u=i[s],c=i[a],l=t.properties[u].index,h=t.properties[c].index,p=[l,h].sort().join("-");if(!n[p]){var f=t.geometry.coordinates[0][s],g=t.geometry.coordinates[0][a],d=t.properties[u].geom,y=t.properties[c].geom;n[p]=1;var _=Math.sqrt(Math.pow(d[0]-y[0],2)+Math.pow(d[1]-y[1],2))/Math.sqrt(Math.pow(f[0]-g[0],2)+Math.pow(f[1]-g[1],2));r[e][l]||(r[e][l]={}),r[e][h]||(r[e][h]={}),r[e][l][p]=_,r[e][h][p]=_}}o(void 0)}))}))).catch((function(t){throw t}))}))).then((function(){var i={};e.map((function(e){i[e]={},t.strict_status==n.STATUS_STRICT&&(i.bakw={}),Object.keys(r[e]).map((function(o){i[e][o]=Object.keys(r[e][o]).reduce((function(t,n,i,s){return t+=r[e][o][n],i==s.length-1?t/s.length:t}),0),t.strict_status==n.STATUS_STRICT&&(i.bakw[o]=1/i[e][o])})),i[e].c=[0,1,2,3].reduce((function(t,n){var r="b".concat(n);return t+=i[e][r],3==n?t/4:t}),0),t.strict_status==n.STATUS_STRICT&&(i.bakw.c=1/i[e].c)})),t.pointsWeightBuffer=i})).catch((function(t){throw t}))}}])&&Wt(r.prototype,a),n}();function Qt(t){for(var e=t.features,n=0;n<e.length;n++){var r=e[n];"b"==="".concat(r.properties.a.index).substring(0,1)&&"b"==="".concat(r.properties.b.index).substring(0,1)?e[n]={geometry:{type:"Polygon",coordinates:[[r.geometry.coordinates[0][2],r.geometry.coordinates[0][0],r.geometry.coordinates[0][1],r.geometry.coordinates[0][2]]]},properties:{a:{geom:r.properties.c.geom,index:r.properties.c.index},b:{geom:r.properties.a.geom,index:r.properties.a.index},c:{geom:r.properties.b.geom,index:r.properties.b.index}},type:"Feature"}:"b"==="".concat(r.properties.c.index).substring(0,1)&&"b"==="".concat(r.properties.a.index).substring(0,1)&&(e[n]={geometry:{type:"Polygon",coordinates:[[r.geometry.coordinates[0][1],r.geometry.coordinates[0][2],r.geometry.coordinates[0][0],r.geometry.coordinates[0][1]]]},properties:{a:{geom:r.properties.b.geom,index:r.properties.b.index},b:{geom:r.properties.c.geom,index:r.properties.c.index},c:{geom:r.properties.a.geom,index:r.properties.a.index}},type:"Feature"})}return t}function $t(t,e){var n=e.geometry.coordinates;return[0,1,2,3].map((function(r){var o=(r+1)%4,a=t[r],u=t[o],c=a.geometry.coordinates;return[Math.atan2(c[0]-n[0],c[1]-n[1]),s([i([[e,a,u,e].map((function(t){return t.geometry.coordinates}))],{a:{geom:e.properties.target.geom,index:e.properties.target.index},b:{geom:a.properties.target.geom,index:a.properties.target.index},c:{geom:u.properties.target.geom,index:u.properties.target.index}})])]})).reduce((function(t,e){return t[0].push(e[0]),t[1].push(e[1]),t}),[[],[]])}function Zt(t){for(var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e?function(t){return!(t>=0&&t<2*Math.PI)}:function(t){return!(t>-1*Math.PI&&t<=Math.PI)};n(t);)t+=2*Math.PI*(t>0?-1:1);return t}function te(t,n,r){return e(t,{target:{geom:n,index:r}})}function ee(t){return e(t.properties.target.geom,{target:{geom:t.geometry.coordinates,index:t.properties.target.index}})}function ne(t,e,n){var r=e.geometry.coordinates[0][0],i=e.geometry.coordinates[0][1],o=e.geometry.coordinates[0][2],s=t.geometry.coordinates,a=e.properties.a.geom,u=e.properties.b.geom,c=e.properties.c.geom,l=[i[0]-r[0],i[1]-r[1]],h=[o[0]-r[0],o[1]-r[1]],p=[s[0]-r[0],s[1]-r[1]],f=[u[0]-a[0],u[1]-a[1]],g=[c[0]-a[0],c[1]-a[1]],d=(h[1]*p[0]-h[0]*p[1])/(l[0]*h[1]-l[1]*h[0]),y=(l[0]*p[1]-l[1]*p[0])/(l[0]*h[1]-l[1]*h[0]);if(n){var _,v=n[e.properties.a.index],m=n[e.properties.b.index],x=n[e.properties.c.index];if(d<0||y<0||1-d-y<0){var E=d/(d+y),I=y/(d+y);_=d/m/(E/m+I/x),y=y/x/(E/m+I/x)}else _=d/m/(d/m+y/x+(1-d-y)/v),y=y/x/(d/m+y/x+(1-d-y)/v);d=_}return[d*f[0]+y*g[0]+a[0],d*f[1]+y*g[1]+a[1]]}function re(t,e){for(var n=0;n<e.features.length;n++)if(d(t,e.features[n]))return e.features[n]}function ie(t,e,n,r){var i=Math.floor((t-e)/n);return i>=r&&(i=r-1),i}function oe(t,e,n,r,i,o,a,u){var c;if(a&&(c=re(t,s([a]))),!c){if(n){var l=t.geometry.coordinates,h=n.gridNum,p=n.xOrigin,f=n.yOrigin,g=n.xUnit,d=n.yUnit,y=n.gridCache,_=ie(l[0],p,g,h),v=ie(l[1],f,d,h),m=y[_]&&y[_][v]?y[_][v]:[];e=s(m.map((function(t){return e.features[t]})))}c=re(t,e)}return u&&u(c),c?ne(t,c,o):function(t,e,n,r){var i=t.geometry.coordinates,o=n.geometry.coordinates,s=function(t,e){for(var n,r=Zt(t-e[0]),i=2*Math.PI,o=0;o<e.length;o++){var s=Zt(t-e[(o+1)%e.length]),a=Math.min(Math.abs(r),Math.abs(s));r*s<=0&&a<i&&(i=a,n=o),r=s}return n}(Math.atan2(i[0]-o[0],i[1]-o[1]),e[0]);return ne(t,e[1][s].features[0],r)}(t,r,i,o)}function se(t){var e=["a","b","c","a"].map((function(e){return t.properties[e].geom})),n=t.geometry.coordinates[0],r=t.properties;return i([e],{a:{geom:n[0],index:r.a.index},b:{geom:n[1],index:r.b.index},c:{geom:n[2],index:r.c.index}})}function ae(t){return i([[0,1,2,0].map((function(e){return t[e][0][0]}))],{a:{geom:t[0][0][1],index:t[0][1]},b:{geom:t[1][0][1],index:t[1][1]},c:{geom:t[2][0][1],index:t[2][1]}})}function ue(t,e,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=arguments.length>6?arguments[6]:void 0,a=t.map((function(t){(!s||s<2.00703)&&(t=ce(t));var a=isFinite(t)?e[t]:"c"===t?r:"b0"===t?i[0]:"b1"===t?i[1]:"b2"===t?i[2]:"b3"===t?i[3]:function(){var e=t.match(/e(\d+)/);if(e){var r=parseInt(e[1]);return n[r]}throw"Bad index value for indexesToTri"}();return o?[[a[1],a[0]],t]:[[a[0],a[1]],t]}));return ae(a)}function ce(t){return"number"==typeof t?t:t.replace(/^(c|e|b)(?:ent|dgeNode|box)(\d+)?$/,"$1$2")}function le(t,e){return e&&e>=2.00703||Array.isArray(t[0])?t:t.map((function(t){return[t.illstNodes,t.mercNodes,t.startEnd]}))}function he(e){var n={forw:{},bakw:{}};return Promise.all(Object.keys(e).map((function(n){return new Promise((function(r){var i=e[n];if(i.length<2)return r(void 0);["forw","bakw"].map((function(e){var n=function(e,n){var r=g(e),i=g(n);if(F(R(i,{precision:4})).coordinates[0].length<4)return null;if(F(R(r,{precision:4})).coordinates[0].length<4)return null;var o=new N.GeoJSONReader,s=o.read(R(r)),a=o.read(R(i)),u=N.OverlayOp.intersection(s,a);return u.isEmpty()?null:t((new N.GeoJSONWriter).write(u))}(i[0][e],i[1][e]);if(!n||"Point"==n.geometry.type||"LineString"==n.geometry.type)return r(void 0);r(void 0)}))}))}))).then((function(){return 0==Object.keys(n.forw).length&&delete n.forw,0==Object.keys(n.bakw).length&&delete n.bakw,n})).catch((function(t){throw t}))}function pe(t,e,n){var r=ge(e.forw),i=ge(e.bakw);if(JSON.stringify(r)!=JSON.stringify(i))throw"".concat(JSON.stringify(e,null,2),"\n").concat(JSON.stringify(r),"\n").concat(JSON.stringify(i));for(var o=0;o<r.length;o++){var s=r[o];t[s]||(t[s]=[]),t[s].push(e)}n&&(n.forw.features.push(e.forw),n.bakw.features.push(e.bakw))}function fe(t,e,n){var r=ge(e.forw),i=ge(e.bakw);if(JSON.stringify(r)!=JSON.stringify(i))throw"".concat(JSON.stringify(e,null,2),"\n").concat(JSON.stringify(r),"\n").concat(JSON.stringify(i));for(var o=0;o<r.length;o++){var s=r[o],a=t[s].filter((function(t){return t.forw!=e.forw}));0==a.length?delete t[s]:t[s]=a}if(n){var u=n.forw.features.filter((function(t){return t!=e.forw}));n.forw.features=u,u=n.bakw.features.filter((function(t){return t!=e.bakw})),n.bakw.features=u}}function ge(t){var e=["a","b","c"].map((function(e){return t.properties[e].index}));return[[0,1],[0,2],[1,2],[0,1,2]].map((function(t){return t.map((function(t){return e[t]})).sort().join("-")})).sort()}Ht(Kt,"VERTEX_PLAIN","plain"),Ht(Kt,"VERTEX_BIRDEYE","birdeye"),Ht(Kt,"MODE_STRICT","strict"),Ht(Kt,"MODE_AUTO","auto"),Ht(Kt,"MODE_LOOSE","loose"),Ht(Kt,"STATUS_STRICT","strict"),Ht(Kt,"STATUS_ERROR","strict_error"),Ht(Kt,"STATUS_LOOSE","loose"),Ht(Kt,"YAXIS_FOLLOW","follow"),Ht(Kt,"YAXIS_INVERT","invert"),n.g.Tin=Kt})(),r})()}));
2
+ !function(t,r){if("object"==typeof exports&&"object"==typeof module)module.exports=r();else if("function"==typeof define&&define.amd)define([],r);else{var e=r();for(var n in e)("object"==typeof exports?exports:t)[n]=e[n]}}(this,(()=>(()=>{var t={9705:(t,r,e)=>{"use strict";var n=e(1540);function i(t){var r=[1/0,1/0,-1/0,-1/0];return n.coordEach(t,(function(t){r[0]>t[0]&&(r[0]=t[0]),r[1]>t[1]&&(r[1]=t[1]),r[2]<t[0]&&(r[2]=t[0]),r[3]<t[1]&&(r[3]=t[1])})),r}i.default=i,r.Z=i},4102:(t,r)=>{"use strict";function e(t,r,e){void 0===e&&(e={});var n={type:"Feature"};return(0===e.id||e.id)&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.properties=r||{},n.geometry=t,n}function n(t,r,n){if(void 0===n&&(n={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!p(t[0])||!p(t[1]))throw new Error("coordinates must contain numbers");return e({type:"Point",coordinates:t},r,n)}function i(t,r,n){void 0===n&&(n={});for(var i=0,o=t;i<o.length;i++){var a=o[i];if(a.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<a[a.length-1].length;s++)if(a[a.length-1][s]!==a[0][s])throw new Error("First and last Position are not equivalent.")}return e({type:"Polygon",coordinates:t},r,n)}function o(t,r,n){if(void 0===n&&(n={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");return e({type:"LineString",coordinates:t},r,n)}function a(t,r){void 0===r&&(r={});var e={type:"FeatureCollection"};return r.id&&(e.id=r.id),r.bbox&&(e.bbox=r.bbox),e.features=t,e}function s(t,r,n){return void 0===n&&(n={}),e({type:"MultiLineString",coordinates:t},r,n)}function u(t,r,n){return void 0===n&&(n={}),e({type:"MultiPoint",coordinates:t},r,n)}function f(t,r,n){return void 0===n&&(n={}),e({type:"MultiPolygon",coordinates:t},r,n)}function c(t,e){void 0===e&&(e="kilometers");var n=r.factors[e];if(!n)throw new Error(e+" units is invalid");return t*n}function h(t,e){void 0===e&&(e="kilometers");var n=r.factors[e];if(!n)throw new Error(e+" units is invalid");return t/n}function l(t){return t%(2*Math.PI)*180/Math.PI}function p(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}Object.defineProperty(r,"__esModule",{value:!0}),r.earthRadius=6371008.8,r.factors={centimeters:100*r.earthRadius,centimetres:100*r.earthRadius,degrees:r.earthRadius/111325,feet:3.28084*r.earthRadius,inches:39.37*r.earthRadius,kilometers:r.earthRadius/1e3,kilometres:r.earthRadius/1e3,meters:r.earthRadius,metres:r.earthRadius,miles:r.earthRadius/1609.344,millimeters:1e3*r.earthRadius,millimetres:1e3*r.earthRadius,nauticalmiles:r.earthRadius/1852,radians:1,yards:1.0936*r.earthRadius},r.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/r.earthRadius,yards:1.0936133},r.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046},r.feature=e,r.geometry=function(t,r,e){switch(void 0===e&&(e={}),t){case"Point":return n(r).geometry;case"LineString":return o(r).geometry;case"Polygon":return i(r).geometry;case"MultiPoint":return u(r).geometry;case"MultiLineString":return s(r).geometry;case"MultiPolygon":return f(r).geometry;default:throw new Error(t+" is invalid")}},r.point=n,r.points=function(t,r,e){return void 0===e&&(e={}),a(t.map((function(t){return n(t,r)})),e)},r.polygon=i,r.polygons=function(t,r,e){return void 0===e&&(e={}),a(t.map((function(t){return i(t,r)})),e)},r.lineString=o,r.lineStrings=function(t,r,e){return void 0===e&&(e={}),a(t.map((function(t){return o(t,r)})),e)},r.featureCollection=a,r.multiLineString=s,r.multiPoint=u,r.multiPolygon=f,r.geometryCollection=function(t,r,n){return void 0===n&&(n={}),e({type:"GeometryCollection",geometries:t},r,n)},r.round=function(t,r){if(void 0===r&&(r=0),r&&!(r>=0))throw new Error("precision must be a positive number");var e=Math.pow(10,r||0);return Math.round(t*e)/e},r.radiansToLength=c,r.lengthToRadians=h,r.lengthToDegrees=function(t,r){return l(h(t,r))},r.bearingToAzimuth=function(t){var r=t%360;return r<0&&(r+=360),r},r.radiansToDegrees=l,r.degreesToRadians=function(t){return t%360*Math.PI/180},r.convertLength=function(t,r,e){if(void 0===r&&(r="kilometers"),void 0===e&&(e="kilometers"),!(t>=0))throw new Error("length must be a positive number");return c(h(t,r),e)},r.convertArea=function(t,e,n){if(void 0===e&&(e="meters"),void 0===n&&(n="kilometers"),!(t>=0))throw new Error("area must be a positive number");var i=r.areaFactors[e];if(!i)throw new Error("invalid original units");var o=r.areaFactors[n];if(!o)throw new Error("invalid final units");return t/i*o},r.isNumber=p,r.isObject=function(t){return!!t&&t.constructor===Object},r.validateBBox=function(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!p(t))throw new Error("bbox must only contain numbers")}))},r.validateId=function(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}},1540:(t,r,e)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=e(4102);function i(t,r,e){if(null!==t)for(var n,o,a,s,u,f,c,h,l=0,p=0,v=t.type,d="FeatureCollection"===v,g="Feature"===v,y=d?t.features.length:1,m=0;m<y;m++){u=(h=!!(c=d?t.features[m].geometry:g?t.geometry:t)&&"GeometryCollection"===c.type)?c.geometries.length:1;for(var x=0;x<u;x++){var b=0,w=0;if(null!==(s=h?c.geometries[x]:c)){f=s.coordinates;var S=s.type;switch(l=!e||"Polygon"!==S&&"MultiPolygon"!==S?0:1,S){case null:break;case"Point":if(!1===r(f,p,m,b,w))return!1;p++,b++;break;case"LineString":case"MultiPoint":for(n=0;n<f.length;n++){if(!1===r(f[n],p,m,b,w))return!1;p++,"MultiPoint"===S&&b++}"LineString"===S&&b++;break;case"Polygon":case"MultiLineString":for(n=0;n<f.length;n++){for(o=0;o<f[n].length-l;o++){if(!1===r(f[n][o],p,m,b,w))return!1;p++}"MultiLineString"===S&&b++,"Polygon"===S&&w++}"Polygon"===S&&b++;break;case"MultiPolygon":for(n=0;n<f.length;n++){for(w=0,o=0;o<f[n].length;o++){for(a=0;a<f[n][o].length-l;a++){if(!1===r(f[n][o][a],p,m,b,w))return!1;p++}w++}b++}break;case"GeometryCollection":for(n=0;n<s.geometries.length;n++)if(!1===i(s.geometries[n],r,e))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function o(t,r){var e;switch(t.type){case"FeatureCollection":for(e=0;e<t.features.length&&!1!==r(t.features[e].properties,e);e++);break;case"Feature":r(t.properties,0)}}function a(t,r){if("Feature"===t.type)r(t,0);else if("FeatureCollection"===t.type)for(var e=0;e<t.features.length&&!1!==r(t.features[e],e);e++);}function s(t,r){var e,n,i,o,a,s,u,f,c,h,l=0,p="FeatureCollection"===t.type,v="Feature"===t.type,d=p?t.features.length:1;for(e=0;e<d;e++){for(s=p?t.features[e].geometry:v?t.geometry:t,f=p?t.features[e].properties:v?t.properties:{},c=p?t.features[e].bbox:v?t.bbox:void 0,h=p?t.features[e].id:v?t.id:void 0,a=(u=!!s&&"GeometryCollection"===s.type)?s.geometries.length:1,i=0;i<a;i++)if(null!==(o=u?s.geometries[i]:s))switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===r(o,l,f,c,h))return!1;break;case"GeometryCollection":for(n=0;n<o.geometries.length;n++)if(!1===r(o.geometries[n],l,f,c,h))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===r(null,l,f,c,h))return!1;l++}}function u(t,r){s(t,(function(t,e,i,o,a){var s,u=null===t?null:t.type;switch(u){case null:case"Point":case"LineString":case"Polygon":return!1!==r(n.feature(t,i,{bbox:o,id:a}),e,0)&&void 0}switch(u){case"MultiPoint":s="Point";break;case"MultiLineString":s="LineString";break;case"MultiPolygon":s="Polygon"}for(var f=0;f<t.coordinates.length;f++){var c={type:s,coordinates:t.coordinates[f]};if(!1===r(n.feature(c,i),e,f))return!1}}))}function f(t,r){u(t,(function(t,e,o){var a=0;if(t.geometry){var s=t.geometry.type;if("Point"!==s&&"MultiPoint"!==s){var u,f=0,c=0,h=0;return!1!==i(t,(function(i,s,l,p,v){if(void 0===u||e>f||p>c||v>h)return u=i,f=e,c=p,h=v,void(a=0);var d=n.lineString([u,i],t.properties);if(!1===r(d,e,o,v,a))return!1;a++,u=i}))&&void 0}}}))}function c(t,r){if(!t)throw new Error("geojson is required");u(t,(function(t,e,i){if(null!==t.geometry){var o=t.geometry.type,a=t.geometry.coordinates;switch(o){case"LineString":if(!1===r(t,e,i,0,0))return!1;break;case"Polygon":for(var s=0;s<a.length;s++)if(!1===r(n.lineString(a[s],t.properties),e,i,s))return!1}}}))}r.coordAll=function(t){var r=[];return i(t,(function(t){r.push(t)})),r},r.coordEach=i,r.coordReduce=function(t,r,e,n){var o=e;return i(t,(function(t,n,i,a,s){o=0===n&&void 0===e?t:r(o,t,n,i,a,s)}),n),o},r.featureEach=a,r.featureReduce=function(t,r,e){var n=e;return a(t,(function(t,i){n=0===i&&void 0===e?t:r(n,t,i)})),n},r.findPoint=function(t,r){if(r=r||{},!n.isObject(r))throw new Error("options is invalid");var e,i=r.featureIndex||0,o=r.multiFeatureIndex||0,a=r.geometryIndex||0,s=r.coordIndex||0,u=r.properties;switch(t.type){case"FeatureCollection":i<0&&(i=t.features.length+i),u=u||t.features[i].properties,e=t.features[i].geometry;break;case"Feature":u=u||t.properties,e=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":e=t;break;default:throw new Error("geojson is invalid")}if(null===e)return null;var f=e.coordinates;switch(e.type){case"Point":return n.point(f,u,r);case"MultiPoint":return o<0&&(o=f.length+o),n.point(f[o],u,r);case"LineString":return s<0&&(s=f.length+s),n.point(f[s],u,r);case"Polygon":return a<0&&(a=f.length+a),s<0&&(s=f[a].length+s),n.point(f[a][s],u,r);case"MultiLineString":return o<0&&(o=f.length+o),s<0&&(s=f[o].length+s),n.point(f[o][s],u,r);case"MultiPolygon":return o<0&&(o=f.length+o),a<0&&(a=f[o].length+a),s<0&&(s=f[o][a].length-s),n.point(f[o][a][s],u,r)}throw new Error("geojson is invalid")},r.findSegment=function(t,r){if(r=r||{},!n.isObject(r))throw new Error("options is invalid");var e,i=r.featureIndex||0,o=r.multiFeatureIndex||0,a=r.geometryIndex||0,s=r.segmentIndex||0,u=r.properties;switch(t.type){case"FeatureCollection":i<0&&(i=t.features.length+i),u=u||t.features[i].properties,e=t.features[i].geometry;break;case"Feature":u=u||t.properties,e=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":e=t;break;default:throw new Error("geojson is invalid")}if(null===e)return null;var f=e.coordinates;switch(e.type){case"Point":case"MultiPoint":return null;case"LineString":return s<0&&(s=f.length+s-1),n.lineString([f[s],f[s+1]],u,r);case"Polygon":return a<0&&(a=f.length+a),s<0&&(s=f[a].length+s-1),n.lineString([f[a][s],f[a][s+1]],u,r);case"MultiLineString":return o<0&&(o=f.length+o),s<0&&(s=f[o].length+s-1),n.lineString([f[o][s],f[o][s+1]],u,r);case"MultiPolygon":return o<0&&(o=f.length+o),a<0&&(a=f[o].length+a),s<0&&(s=f[o][a].length-s-1),n.lineString([f[o][a][s],f[o][a][s+1]],u,r)}throw new Error("geojson is invalid")},r.flattenEach=u,r.flattenReduce=function(t,r,e){var n=e;return u(t,(function(t,i,o){n=0===i&&0===o&&void 0===e?t:r(n,t,i,o)})),n},r.geomEach=s,r.geomReduce=function(t,r,e){var n=e;return s(t,(function(t,i,o,a,s){n=0===i&&void 0===e?t:r(n,t,i,o,a,s)})),n},r.lineEach=c,r.lineReduce=function(t,r,e){var n=e;return c(t,(function(t,i,o,a){n=0===i&&void 0===e?t:r(n,t,i,o,a)})),n},r.propEach=o,r.propReduce=function(t,r,e){var n=e;return o(t,(function(t,i){n=0===i&&void 0===e?t:r(n,t,i)})),n},r.segmentEach=f,r.segmentReduce=function(t,r,e){var n=e,i=!1;return f(t,(function(t,o,a,s,u){n=!1===i&&void 0===e?t:r(n,t,o,a,s,u),i=!0})),n}},3076:t=>{"use strict";function r(t,r,e,n,i){for(var o=i+1;n<=i;){var a=n+i>>>1,s=t[a];(void 0!==e?e(s,r):s-r)>=0?(o=a,i=a-1):n=a+1}return o}function e(t,r,e,n,i){for(var o=i+1;n<=i;){var a=n+i>>>1,s=t[a];(void 0!==e?e(s,r):s-r)>0?(o=a,i=a-1):n=a+1}return o}function n(t,r,e,n,i){for(var o=n-1;n<=i;){var a=n+i>>>1,s=t[a];(void 0!==e?e(s,r):s-r)<0?(o=a,n=a+1):i=a-1}return o}function i(t,r,e,n,i){for(var o=n-1;n<=i;){var a=n+i>>>1,s=t[a];(void 0!==e?e(s,r):s-r)<=0?(o=a,n=a+1):i=a-1}return o}function o(t,r,e,n,i){for(;n<=i;){var o=n+i>>>1,a=t[o],s=void 0!==e?e(a,r):a-r;if(0===s)return o;s<=0?n=o+1:i=o-1}return-1}function a(t,r,e,n,i,o){return"function"==typeof e?o(t,r,e,void 0===n?0:0|n,void 0===i?t.length-1:0|i):o(t,r,void 0,void 0===e?0:0|e,void 0===n?t.length-1:0|n)}t.exports={ge:function(t,e,n,i,o){return a(t,e,n,i,o,r)},gt:function(t,r,n,i,o){return a(t,r,n,i,o,e)},lt:function(t,r,e,i,o){return a(t,r,e,i,o,n)},le:function(t,r,e,n,o){return a(t,r,e,n,o,i)},eq:function(t,r,e,n,i){return a(t,r,e,n,i,o)}}},5589:(t,r,e)=>{"use strict";var n=e(1147),i=e(6270),o=e(2471),a=e(7608);function s(t){return[Math.min(t[0],t[1]),Math.max(t[0],t[1])]}function u(t,r){return t[0]-r[0]||t[1]-r[1]}function f(t,r,e){return r in t?t[r]:e}t.exports=function(t,r,e){Array.isArray(r)?(e=e||{},r=r||[]):(e=r||{},r=[]);var c=!!f(e,"delaunay",!0),h=!!f(e,"interior",!0),l=!!f(e,"exterior",!0),p=!!f(e,"infinity",!1);if(!h&&!l||0===t.length)return[];var v=n(t,r);if(c||h!==l||p){for(var d=i(t.length,function(t){return t.map(s).sort(u)}(r)),g=0;g<v.length;++g){var y=v[g];d.addTriangle(y[0],y[1],y[2])}return c&&o(t,d),l?h?p?a(d,0,p):d.cells():a(d,1,p):a(d,-1)}return v}},2471:(t,r,e)=>{"use strict";var n=e(1351)[4];function i(t,r,e,i,o,a){var s=r.opposite(i,o);if(!(s<0)){if(o<i){var u=i;i=o,o=u,u=a,a=s,s=u}r.isConstraint(i,o)||n(t[i],t[o],t[a],t[s])<0&&e.push(i,o)}}e(3076),t.exports=function(t,r){for(var e=[],o=t.length,a=r.stars,s=0;s<o;++s)for(var u=a[s],f=1;f<u.length;f+=2)if(!((p=u[f])<s||r.isConstraint(s,p))){for(var c=u[f-1],h=-1,l=1;l<u.length;l+=2)if(u[l-1]===p){h=u[l];break}h<0||n(t[s],t[p],t[c],t[h])<0&&e.push(s,p)}for(;e.length>0;){for(var p=e.pop(),v=(c=-1,h=-1,u=a[s=e.pop()],1);v<u.length;v+=2){var d=u[v-1],g=u[v];d===p?h=g:g===p&&(c=d)}c<0||h<0||n(t[s],t[p],t[c],t[h])>=0||(r.flip(s,p),i(t,r,e,c,s,h),i(t,r,e,s,h,c),i(t,r,e,h,p,c),i(t,r,e,p,c,h))}}},7608:(t,r,e)=>{"use strict";var n,i=e(3076);function o(t,r,e,n,i,o,a){this.cells=t,this.neighbor=r,this.flags=n,this.constraint=e,this.active=i,this.next=o,this.boundary=a}function a(t,r){return t[0]-r[0]||t[1]-r[1]||t[2]-r[2]}t.exports=function(t,r,e){var n=function(t,r){for(var e=t.cells(),n=e.length,i=0;i<n;++i){var s=(y=e[i])[0],u=y[1],f=y[2];u<f?u<s&&(y[0]=u,y[1]=f,y[2]=s):f<s&&(y[0]=f,y[1]=s,y[2]=u)}e.sort(a);var c=new Array(n);for(i=0;i<c.length;++i)c[i]=0;var h=[],l=[],p=new Array(3*n),v=new Array(3*n),d=null;r&&(d=[]);var g=new o(e,p,v,c,h,l,d);for(i=0;i<n;++i)for(var y=e[i],m=0;m<3;++m){s=y[m],u=y[(m+1)%3];var x=p[3*i+m]=g.locate(u,s,t.opposite(u,s)),b=v[3*i+m]=t.isConstraint(s,u);x<0&&(b?l.push(i):(h.push(i),c[i]=1),r&&d.push([u,s,-1]))}return g}(t,e);if(0===r)return e?n.cells.concat(n.boundary):n.cells;for(var i=1,s=n.active,u=n.next,f=n.flags,c=n.cells,h=n.constraint,l=n.neighbor;s.length>0||u.length>0;){for(;s.length>0;){var p=s.pop();if(f[p]!==-i){f[p]=i,c[p];for(var v=0;v<3;++v){var d=l[3*p+v];d>=0&&0===f[d]&&(h[3*p+v]?u.push(d):(s.push(d),f[d]=i))}}}var g=u;u=s,s=g,u.length=0,i=-i}var y=function(t,r,e){for(var n=0,i=0;i<t.length;++i)r[i]===e&&(t[n++]=t[i]);return t.length=n,t}(c,f,r);return e?y.concat(n.boundary):y},o.prototype.locate=(n=[0,0,0],function(t,r,e){var o=t,s=r,u=e;return r<e?r<t&&(o=r,s=e,u=t):e<t&&(o=e,s=t,u=r),o<0?-1:(n[0]=o,n[1]=s,n[2]=u,i.eq(this.cells,n,a))})},1147:(t,r,e)=>{"use strict";var n=e(3076),i=e(146)[3];function o(t,r,e,n,i){this.a=t,this.b=r,this.idx=e,this.lowerIds=n,this.upperIds=i}function a(t,r,e,n){this.a=t,this.b=r,this.type=e,this.idx=n}function s(t,r){var e=t.a[0]-r.a[0]||t.a[1]-r.a[1]||t.type-r.type;return e||(0!==t.type&&(e=i(t.a,t.b,r.b))?e:t.idx-r.idx)}function u(t,r){return i(t.a,t.b,r)}function f(t,r,e,o,a){for(var s=n.lt(r,o,u),f=n.gt(r,o,u),c=s;c<f;++c){for(var h=r[c],l=h.lowerIds,p=l.length;p>1&&i(e[l[p-2]],e[l[p-1]],o)>0;)t.push([l[p-1],l[p-2],a]),p-=1;l.length=p,l.push(a);var v=h.upperIds;for(p=v.length;p>1&&i(e[v[p-2]],e[v[p-1]],o)<0;)t.push([v[p-2],v[p-1],a]),p-=1;v.length=p,v.push(a)}}function c(t,r){var e;return(e=t.a[0]<r.a[0]?i(t.a,t.b,r.a):i(r.b,r.a,t.a))?e:(e=r.b[0]<t.b[0]?i(t.a,t.b,r.b):i(r.b,r.a,t.b))||t.idx-r.idx}function h(t,r,e){var i=n.le(t,e,c),a=t[i],s=a.upperIds,u=s[s.length-1];a.upperIds=[u],t.splice(i+1,0,new o(e.a,e.b,e.idx,[u],s))}function l(t,r,e){var i=e.a;e.a=e.b,e.b=i;var o=n.eq(t,e,c),a=t[o];t[o-1].upperIds=a.upperIds,t.splice(o,1)}t.exports=function(t,r){for(var e=t.length,n=r.length,i=[],u=0;u<e;++u)i.push(new a(t[u],null,0,u));for(u=0;u<n;++u){var c=r[u],p=t[c[0]],v=t[c[1]];p[0]<v[0]?i.push(new a(p,v,2,u),new a(v,p,1,u)):p[0]>v[0]&&i.push(new a(v,p,2,u),new a(p,v,1,u))}i.sort(s);for(var d=i[0].a[0]-(1+Math.abs(i[0].a[0]))*Math.pow(2,-52),g=[new o([d,1],[d,0],-1,[],[],[],[])],y=[],m=(u=0,i.length);u<m;++u){var x=i[u],b=x.type;0===b?f(y,g,t,x.a,x.idx):2===b?h(g,0,x):l(g,0,x)}return y}},6270:(t,r,e)=>{"use strict";var n=e(3076);function i(t,r){this.stars=t,this.edges=r}t.exports=function(t,r){for(var e=new Array(t),n=0;n<t;++n)e[n]=[];return new i(e,r)};var o=i.prototype;function a(t,r,e){for(var n=1,i=t.length;n<i;n+=2)if(t[n-1]===r&&t[n]===e)return t[n-1]=t[i-2],t[n]=t[i-1],void(t.length=i-2)}o.isConstraint=function(){var t=[0,0];function r(t,r){return t[0]-r[0]||t[1]-r[1]}return function(e,i){return t[0]=Math.min(e,i),t[1]=Math.max(e,i),n.eq(this.edges,t,r)>=0}}(),o.removeTriangle=function(t,r,e){var n=this.stars;a(n[t],r,e),a(n[r],e,t),a(n[e],t,r)},o.addTriangle=function(t,r,e){var n=this.stars;n[t].push(r,e),n[r].push(e,t),n[e].push(t,r)},o.opposite=function(t,r){for(var e=this.stars[r],n=1,i=e.length;n<i;n+=2)if(e[n]===t)return e[n-1];return-1},o.flip=function(t,r){var e=this.opposite(t,r),n=this.opposite(r,t);this.removeTriangle(t,r,e),this.removeTriangle(r,t,n),this.addTriangle(t,n,e),this.addTriangle(r,e,n)},o.edges=function(){for(var t=this.stars,r=[],e=0,n=t.length;e<n;++e)for(var i=t[e],o=0,a=i.length;o<a;o+=2)r.push([i[o],i[o+1]]);return r},o.cells=function(){for(var t=this.stars,r=[],e=0,n=t.length;e<n;++e)for(var i=t[e],o=0,a=i.length;o<a;o+=2){var s=i[o],u=i[o+1];e<Math.min(s,u)&&r.push([e,s,u])}return r}},2273:(t,r,e)=>{"use strict";var n=e(1662),i=e(3842),o=e(6960),a=e(8639).orient2d;function s(t,r,e){r=Math.max(0,void 0===r?2:r),e=e||0;var i=function(t){for(var r=t[0],e=t[0],n=t[0],i=t[0],a=0;a<t.length;a++){var s=t[a];s[0]<r[0]&&(r=s),s[0]>n[0]&&(n=s),s[1]<e[1]&&(e=s),s[1]>i[1]&&(i=s)}var u=[r,e,n,i],f=u.slice();for(a=0;a<t.length;a++)o(t[a],u)||f.push(t[a]);return function(t){t.sort(x);for(var r=[],e=0;e<t.length;e++){for(;r.length>=2&&p(r[r.length-2],r[r.length-1],t[e])<=0;)r.pop();r.push(t[e])}for(var n=[],i=t.length-1;i>=0;i--){for(;n.length>=2&&p(n[n.length-2],n[n.length-1],t[i])<=0;)n.pop();n.push(t[i])}return n.pop(),r.pop(),r.concat(n)}(f)}(t),a=new n(16);a.toBBox=function(t){return{minX:t[0],minY:t[1],maxX:t[0],maxY:t[1]}},a.compareMinX=function(t,r){return t[0]-r[0]},a.compareMinY=function(t,r){return t[1]-r[1]},a.load(t);for(var s,f=[],c=0;c<i.length;c++){var h=i[c];a.remove(h),s=d(h,s),f.push(s)}var l=new n(16);for(c=0;c<f.length;c++)l.insert(v(f[c]));for(var y=r*r,m=e*e;f.length;){var b=f.shift(),w=b.p,S=b.next.p,_=g(w,S);if(!(_<m)){var E=_/y;(h=u(a,b.prev.p,w,S,b.next.next.p,E,l))&&Math.min(g(h,w),g(h,S))<=E&&(f.push(b),f.push(d(h,b)),a.remove(h),l.remove(b),l.insert(v(b)),l.insert(v(b.next)))}}b=s;var k=[];do{k.push(b.p),b=b.next}while(b!==s);return k.push(b.p),k}function u(t,r,e,n,o,a,s){for(var u=new i([],f),h=t.data;h;){for(var p=0;p<h.children.length;p++){var v=h.children[p],d=h.leaf?y(v,e,n):c(e,n,v);d>a||u.push({node:v,dist:d})}for(;u.length&&!u.peek().node.children;){var g=u.pop(),m=g.node,x=y(m,r,e),b=y(m,n,o);if(g.dist<x&&g.dist<b&&l(e,m,s)&&l(n,m,s))return m}(h=u.pop())&&(h=h.node)}return null}function f(t,r){return t.dist-r.dist}function c(t,r,e){if(h(t,e)||h(r,e))return 0;var n=m(t[0],t[1],r[0],r[1],e.minX,e.minY,e.maxX,e.minY);if(0===n)return 0;var i=m(t[0],t[1],r[0],r[1],e.minX,e.minY,e.minX,e.maxY);if(0===i)return 0;var o=m(t[0],t[1],r[0],r[1],e.maxX,e.minY,e.maxX,e.maxY);if(0===o)return 0;var a=m(t[0],t[1],r[0],r[1],e.minX,e.maxY,e.maxX,e.maxY);return 0===a?0:Math.min(n,i,o,a)}function h(t,r){return t[0]>=r.minX&&t[0]<=r.maxX&&t[1]>=r.minY&&t[1]<=r.maxY}function l(t,r,e){for(var n,i,o,a,s=Math.min(t[0],r[0]),u=Math.min(t[1],r[1]),f=Math.max(t[0],r[0]),c=Math.max(t[1],r[1]),h=e.search({minX:s,minY:u,maxX:f,maxY:c}),l=0;l<h.length;l++)if(n=h[l].p,i=h[l].next.p,o=t,n!==(a=r)&&i!==o&&p(n,i,o)>0!=p(n,i,a)>0&&p(o,a,n)>0!=p(o,a,i)>0)return!1;return!0}function p(t,r,e){return a(t[0],t[1],r[0],r[1],e[0],e[1])}function v(t){var r=t.p,e=t.next.p;return t.minX=Math.min(r[0],e[0]),t.minY=Math.min(r[1],e[1]),t.maxX=Math.max(r[0],e[0]),t.maxY=Math.max(r[1],e[1]),t}function d(t,r){var e={p:t,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return r?(e.next=r.next,e.prev=r,r.next.prev=e,r.next=e):(e.prev=e,e.next=e),e}function g(t,r){var e=t[0]-r[0],n=t[1]-r[1];return e*e+n*n}function y(t,r,e){var n=r[0],i=r[1],o=e[0]-n,a=e[1]-i;if(0!==o||0!==a){var s=((t[0]-n)*o+(t[1]-i)*a)/(o*o+a*a);s>1?(n=e[0],i=e[1]):s>0&&(n+=o*s,i+=a*s)}return(o=t[0]-n)*o+(a=t[1]-i)*a}function m(t,r,e,n,i,o,a,s){var u,f,c,h,l=e-t,p=n-r,v=a-i,d=s-o,g=t-i,y=r-o,m=l*l+p*p,x=l*v+p*d,b=v*v+d*d,w=l*g+p*y,S=v*g+d*y,_=m*b-x*x,E=_,k=_;0===_?(f=0,E=1,h=S,k=b):(h=m*S-x*w,(f=x*S-b*w)<0?(f=0,h=S,k=b):f>E&&(f=E,h=S+x,k=b)),h<0?(h=0,-w<0?f=0:-w>m?f=E:(f=-w,E=m)):h>k&&(h=k,-w+x<0?f=0:-w+x>m?f=E:(f=-w+x,E=m));var M=(1-(c=0===h?0:h/k))*i+c*a-((1-(u=0===f?0:f/E))*t+u*e),A=(1-c)*o+c*s-((1-u)*r+u*n);return M*M+A*A}function x(t,r){return t[0]===r[0]?t[1]-r[1]:t[0]-r[0]}i.default&&(i=i.default),t.exports=s,t.exports.default=s},1662:function(t){t.exports=function(){"use strict";function t(t,n,i,o,a){!function t(e,n,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,u=n-i+1,f=Math.log(s),c=.5*Math.exp(2*f/3),h=.5*Math.sqrt(f*c*(s-c)/s)*(u-s/2<0?-1:1);t(e,n,Math.max(i,Math.floor(n-u*c/s+h)),Math.min(o,Math.floor(n+(s-u)*c/s+h)),a)}var l=e[n],p=i,v=o;for(r(e,i,n),a(e[o],l)>0&&r(e,i,o);p<v;){for(r(e,p,v),p++,v--;a(e[p],l)<0;)p++;for(;a(e[v],l)>0;)v--}0===a(e[i],l)?r(e,i,v):r(e,++v,o),v<=n&&(i=v+1),n<=v&&(o=v-1)}}(t,n,i||0,o||t.length-1,a||e)}function r(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function e(t,r){return t<r?-1:t>r?1:0}var n=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function i(t,r,e){if(!e)return r.indexOf(t);for(var n=0;n<r.length;n++)if(e(t,r[n]))return n;return-1}function o(t,r){a(t,0,t.children.length,r,t)}function a(t,r,e,n,i){i||(i=v(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o=r;o<e;o++){var a=t.children[o];s(i,t.leaf?n(a):a)}return i}function s(t,r){return t.minX=Math.min(t.minX,r.minX),t.minY=Math.min(t.minY,r.minY),t.maxX=Math.max(t.maxX,r.maxX),t.maxY=Math.max(t.maxY,r.maxY),t}function u(t,r){return t.minX-r.minX}function f(t,r){return t.minY-r.minY}function c(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function h(t){return t.maxX-t.minX+(t.maxY-t.minY)}function l(t,r){return t.minX<=r.minX&&t.minY<=r.minY&&r.maxX<=t.maxX&&r.maxY<=t.maxY}function p(t,r){return r.minX<=t.maxX&&r.minY<=t.maxY&&r.maxX>=t.minX&&r.maxY>=t.minY}function v(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function d(r,e,n,i,o){for(var a=[e,n];a.length;)if(!((n=a.pop())-(e=a.pop())<=i)){var s=e+Math.ceil((n-e)/i/2)*i;t(r,s,e,n,o),a.push(e,s,s,n)}}return n.prototype.all=function(){return this._all(this.data,[])},n.prototype.search=function(t){var r=this.data,e=[];if(!p(t,r))return e;for(var n=this.toBBox,i=[];r;){for(var o=0;o<r.children.length;o++){var a=r.children[o],s=r.leaf?n(a):a;p(t,s)&&(r.leaf?e.push(a):l(t,s)?this._all(a,e):i.push(a))}r=i.pop()}return e},n.prototype.collides=function(t){var r=this.data;if(!p(t,r))return!1;for(var e=[];r;){for(var n=0;n<r.children.length;n++){var i=r.children[n],o=r.leaf?this.toBBox(i):i;if(p(t,o)){if(r.leaf||l(t,o))return!0;e.push(i)}}r=e.pop()}return!1},n.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var r=0;r<t.length;r++)this.insert(t[r]);return this}var e=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(this.data.height<e.height){var n=this.data;this.data=e,e=n}this._insert(e,this.data.height-e.height-1,!0)}else this.data=e;return this},n.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},n.prototype.clear=function(){return this.data=v([]),this},n.prototype.remove=function(t,r){if(!t)return this;for(var e,n,o,a=this.data,s=this.toBBox(t),u=[],f=[];a||u.length;){if(a||(a=u.pop(),n=u[u.length-1],e=f.pop(),o=!0),a.leaf){var c=i(t,a.children,r);if(-1!==c)return a.children.splice(c,1),u.push(a),this._condense(u),this}o||a.leaf||!l(a,s)?n?(e++,a=n.children[e],o=!1):a=null:(u.push(a),f.push(e),e=0,n=a,a=a.children[0])}return this},n.prototype.toBBox=function(t){return t},n.prototype.compareMinX=function(t,r){return t.minX-r.minX},n.prototype.compareMinY=function(t,r){return t.minY-r.minY},n.prototype.toJSON=function(){return this.data},n.prototype.fromJSON=function(t){return this.data=t,this},n.prototype._all=function(t,r){for(var e=[];t;)t.leaf?r.push.apply(r,t.children):e.push.apply(e,t.children),t=e.pop();return r},n.prototype._build=function(t,r,e,n){var i,a=e-r+1,s=this._maxEntries;if(a<=s)return o(i=v(t.slice(r,e+1)),this.toBBox),i;n||(n=Math.ceil(Math.log(a)/Math.log(s)),s=Math.ceil(a/Math.pow(s,n-1))),(i=v([])).leaf=!1,i.height=n;var u=Math.ceil(a/s),f=u*Math.ceil(Math.sqrt(s));d(t,r,e,f,this.compareMinX);for(var c=r;c<=e;c+=f){var h=Math.min(c+f-1,e);d(t,c,h,u,this.compareMinY);for(var l=c;l<=h;l+=u){var p=Math.min(l+u-1,h);i.children.push(this._build(t,l,p,n-1))}}return o(i,this.toBBox),i},n.prototype._chooseSubtree=function(t,r,e,n){for(;n.push(r),!r.leaf&&n.length-1!==e;){for(var i=1/0,o=1/0,a=void 0,s=0;s<r.children.length;s++){var u=r.children[s],f=c(u),h=(l=t,p=u,(Math.max(p.maxX,l.maxX)-Math.min(p.minX,l.minX))*(Math.max(p.maxY,l.maxY)-Math.min(p.minY,l.minY))-f);h<o?(o=h,i=f<i?f:i,a=u):h===o&&f<i&&(i=f,a=u)}r=a||r.children[0]}var l,p;return r},n.prototype._insert=function(t,r,e){var n=e?t:this.toBBox(t),i=[],o=this._chooseSubtree(n,this.data,r,i);for(o.children.push(t),s(o,n);r>=0&&i[r].children.length>this._maxEntries;)this._split(i,r),r--;this._adjustParentBBoxes(n,i,r)},n.prototype._split=function(t,r){var e=t[r],n=e.children.length,i=this._minEntries;this._chooseSplitAxis(e,i,n);var a=this._chooseSplitIndex(e,i,n),s=v(e.children.splice(a,e.children.length-a));s.height=e.height,s.leaf=e.leaf,o(e,this.toBBox),o(s,this.toBBox),r?t[r-1].children.push(s):this._splitRoot(e,s)},n.prototype._splitRoot=function(t,r){this.data=v([t,r]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},n.prototype._chooseSplitIndex=function(t,r,e){for(var n,i,o,s,u,f,h,l=1/0,p=1/0,v=r;v<=e-r;v++){var d=a(t,0,v,this.toBBox),g=a(t,v,e,this.toBBox),y=(i=d,o=g,void 0,void 0,void 0,void 0,s=Math.max(i.minX,o.minX),u=Math.max(i.minY,o.minY),f=Math.min(i.maxX,o.maxX),h=Math.min(i.maxY,o.maxY),Math.max(0,f-s)*Math.max(0,h-u)),m=c(d)+c(g);y<l?(l=y,n=v,p=m<p?m:p):y===l&&m<p&&(p=m,n=v)}return n||e-r},n.prototype._chooseSplitAxis=function(t,r,e){var n=t.leaf?this.compareMinX:u,i=t.leaf?this.compareMinY:f;this._allDistMargin(t,r,e,n)<this._allDistMargin(t,r,e,i)&&t.children.sort(n)},n.prototype._allDistMargin=function(t,r,e,n){t.children.sort(n);for(var i=this.toBBox,o=a(t,0,r,i),u=a(t,e-r,e,i),f=h(o)+h(u),c=r;c<e-r;c++){var l=t.children[c];s(o,t.leaf?i(l):l),f+=h(o)}for(var p=e-r-1;p>=r;p--){var v=t.children[p];s(u,t.leaf?i(v):v),f+=h(u)}return f},n.prototype._adjustParentBBoxes=function(t,r,e){for(var n=e;n>=0;n--)s(r[n],t)},n.prototype._condense=function(t){for(var r=t.length-1,e=void 0;r>=0;r--)0===t[r].children.length?r>0?(e=t[r-1].children).splice(e.indexOf(t[r]),1):this.clear():o(t[r],this.toBBox)},n}()},9662:(t,r,e)=>{var n=e(7854),i=e(614),o=e(6330),a=n.TypeError;t.exports=function(t){if(i(t))return t;throw a(o(t)+" is not a function")}},9483:(t,r,e)=>{var n=e(7854),i=e(4411),o=e(6330),a=n.TypeError;t.exports=function(t){if(i(t))return t;throw a(o(t)+" is not a constructor")}},6077:(t,r,e)=>{var n=e(7854),i=e(614),o=n.String,a=n.TypeError;t.exports=function(t){if("object"==typeof t||i(t))return t;throw a("Can't set "+o(t)+" as a prototype")}},1223:(t,r,e)=>{var n=e(5112),i=e(30),o=e(3070).f,a=n("unscopables"),s=Array.prototype;null==s[a]&&o(s,a,{configurable:!0,value:i(null)}),t.exports=function(t){s[a][t]=!0}},1530:(t,r,e)=>{"use strict";var n=e(8710).charAt;t.exports=function(t,r,e){return r+(e?n(t,r).length:1)}},5787:(t,r,e)=>{var n=e(7854),i=e(7976),o=n.TypeError;t.exports=function(t,r){if(i(r,t))return t;throw o("Incorrect invocation")}},9670:(t,r,e)=>{var n=e(7854),i=e(111),o=n.String,a=n.TypeError;t.exports=function(t){if(i(t))return t;throw a(o(t)+" is not an object")}},4019:t=>{t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},260:(t,r,e)=>{"use strict";var n,i,o,a=e(4019),s=e(9781),u=e(7854),f=e(614),c=e(111),h=e(2597),l=e(648),p=e(6330),v=e(8880),d=e(8052),g=e(3070).f,y=e(7976),m=e(9518),x=e(7674),b=e(5112),w=e(9711),S=u.Int8Array,_=S&&S.prototype,E=u.Uint8ClampedArray,k=E&&E.prototype,M=S&&m(S),A=_&&m(_),P=Object.prototype,O=u.TypeError,T=b("toStringTag"),R=w("TYPED_ARRAY_TAG"),I=w("TYPED_ARRAY_CONSTRUCTOR"),j=a&&!!x&&"Opera"!==l(u.opera),B=!1,L={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},N={BigInt64Array:8,BigUint64Array:8},Y=function(t){if(!c(t))return!1;var r=l(t);return h(L,r)||h(N,r)};for(n in L)(o=(i=u[n])&&i.prototype)?v(o,I,i):j=!1;for(n in N)(o=(i=u[n])&&i.prototype)&&v(o,I,i);if((!j||!f(M)||M===Function.prototype)&&(M=function(){throw O("Incorrect invocation")},j))for(n in L)u[n]&&x(u[n],M);if((!j||!A||A===P)&&(A=M.prototype,j))for(n in L)u[n]&&x(u[n].prototype,A);if(j&&m(k)!==A&&x(k,A),s&&!h(A,T))for(n in B=!0,g(A,T,{get:function(){return c(this)?this[R]:void 0}}),L)u[n]&&v(u[n],R,n);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:j,TYPED_ARRAY_CONSTRUCTOR:I,TYPED_ARRAY_TAG:B&&R,aTypedArray:function(t){if(Y(t))return t;throw O("Target is not a typed array")},aTypedArrayConstructor:function(t){if(f(t)&&(!x||y(M,t)))return t;throw O(p(t)+" is not a typed array constructor")},exportTypedArrayMethod:function(t,r,e,n){if(s){if(e)for(var i in L){var o=u[i];if(o&&h(o.prototype,t))try{delete o.prototype[t]}catch(e){try{o.prototype[t]=r}catch(t){}}}A[t]&&!e||d(A,t,e?r:j&&_[t]||r,n)}},exportTypedArrayStaticMethod:function(t,r,e){var n,i;if(s){if(x){if(e)for(n in L)if((i=u[n])&&h(i,t))try{delete i[t]}catch(t){}if(M[t]&&!e)return;try{return d(M,t,e?r:j&&M[t]||r)}catch(t){}}for(n in L)!(i=u[n])||i[t]&&!e||d(i,t,r)}},isView:function(t){if(!c(t))return!1;var r=l(t);return"DataView"===r||h(L,r)||h(N,r)},isTypedArray:Y,TypedArray:M,TypedArrayPrototype:A}},3331:(t,r,e)=>{"use strict";var n=e(7854),i=e(1702),o=e(9781),a=e(4019),s=e(6530),u=e(8880),f=e(9190),c=e(7293),h=e(5787),l=e(9303),p=e(7466),v=e(7067),d=e(1179),g=e(9518),y=e(7674),m=e(8006).f,x=e(3070).f,b=e(1285),w=e(1589),S=e(8003),_=e(9909),E=s.PROPER,k=s.CONFIGURABLE,M=_.get,A=_.set,P="ArrayBuffer",O="Wrong index",T=n.ArrayBuffer,R=T,I=R&&R.prototype,j=n.DataView,B=j&&j.prototype,L=Object.prototype,N=n.Array,Y=n.RangeError,C=i(b),F=i([].reverse),X=d.pack,U=d.unpack,D=function(t){return[255&t]},G=function(t){return[255&t,t>>8&255]},z=function(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]},q=function(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]},V=function(t){return X(t,23,4)},W=function(t){return X(t,52,8)},J=function(t,r){x(t.prototype,r,{get:function(){return M(this)[r]}})},$=function(t,r,e,n){var i=v(e),o=M(t);if(i+r>o.byteLength)throw Y(O);var a=M(o.buffer).bytes,s=i+o.byteOffset,u=w(a,s,s+r);return n?u:F(u)},K=function(t,r,e,n,i,o){var a=v(e),s=M(t);if(a+r>s.byteLength)throw Y(O);for(var u=M(s.buffer).bytes,f=a+s.byteOffset,c=n(+i),h=0;h<r;h++)u[f+h]=c[o?h:r-h-1]};if(a){var H=E&&T.name!==P;if(c((function(){T(1)}))&&c((function(){new T(-1)}))&&!c((function(){return new T,new T(1.5),new T(NaN),H&&!k})))H&&k&&u(T,"name",P);else{(R=function(t){return h(this,I),new T(v(t))}).prototype=I;for(var Z,Q=m(T),tt=0;Q.length>tt;)(Z=Q[tt++])in R||u(R,Z,T[Z]);I.constructor=R}y&&g(B)!==L&&y(B,L);var rt=new j(new R(2)),et=i(B.setInt8);rt.setInt8(0,2147483648),rt.setInt8(1,2147483649),!rt.getInt8(0)&&rt.getInt8(1)||f(B,{setInt8:function(t,r){et(this,t,r<<24>>24)},setUint8:function(t,r){et(this,t,r<<24>>24)}},{unsafe:!0})}else I=(R=function(t){h(this,I);var r=v(t);A(this,{bytes:C(N(r),0),byteLength:r}),o||(this.byteLength=r)}).prototype,B=(j=function(t,r,e){h(this,B),h(t,I);var n=M(t).byteLength,i=l(r);if(i<0||i>n)throw Y("Wrong offset");if(i+(e=void 0===e?n-i:p(e))>n)throw Y("Wrong length");A(this,{buffer:t,byteLength:e,byteOffset:i}),o||(this.buffer=t,this.byteLength=e,this.byteOffset=i)}).prototype,o&&(J(R,"byteLength"),J(j,"buffer"),J(j,"byteLength"),J(j,"byteOffset")),f(B,{getInt8:function(t){return $(this,1,t)[0]<<24>>24},getUint8:function(t){return $(this,1,t)[0]},getInt16:function(t){var r=$(this,2,t,arguments.length>1?arguments[1]:void 0);return(r[1]<<8|r[0])<<16>>16},getUint16:function(t){var r=$(this,2,t,arguments.length>1?arguments[1]:void 0);return r[1]<<8|r[0]},getInt32:function(t){return q($(this,4,t,arguments.length>1?arguments[1]:void 0))},getUint32:function(t){return q($(this,4,t,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(t){return U($(this,4,t,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(t){return U($(this,8,t,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(t,r){K(this,1,t,D,r)},setUint8:function(t,r){K(this,1,t,D,r)},setInt16:function(t,r){K(this,2,t,G,r,arguments.length>2?arguments[2]:void 0)},setUint16:function(t,r){K(this,2,t,G,r,arguments.length>2?arguments[2]:void 0)},setInt32:function(t,r){K(this,4,t,z,r,arguments.length>2?arguments[2]:void 0)},setUint32:function(t,r){K(this,4,t,z,r,arguments.length>2?arguments[2]:void 0)},setFloat32:function(t,r){K(this,4,t,V,r,arguments.length>2?arguments[2]:void 0)},setFloat64:function(t,r){K(this,8,t,W,r,arguments.length>2?arguments[2]:void 0)}});S(R,P),S(j,"DataView"),t.exports={ArrayBuffer:R,DataView:j}},1048:(t,r,e)=>{"use strict";var n=e(7908),i=e(1400),o=e(6244),a=Math.min;t.exports=[].copyWithin||function(t,r){var e=n(this),s=o(e),u=i(t,s),f=i(r,s),c=arguments.length>2?arguments[2]:void 0,h=a((void 0===c?s:i(c,s))-f,s-u),l=1;for(f<u&&u<f+h&&(l=-1,f+=h-1,u+=h-1);h-- >0;)f in e?e[u]=e[f]:delete e[u],u+=l,f+=l;return e}},1285:(t,r,e)=>{"use strict";var n=e(7908),i=e(1400),o=e(6244);t.exports=function(t){for(var r=n(this),e=o(r),a=arguments.length,s=i(a>1?arguments[1]:void 0,e),u=a>2?arguments[2]:void 0,f=void 0===u?e:i(u,e);f>s;)r[s++]=t;return r}},7745:(t,r,e)=>{var n=e(6244);t.exports=function(t,r){for(var e=0,i=n(r),o=new t(i);i>e;)o[e]=r[e++];return o}},8457:(t,r,e)=>{"use strict";var n=e(7854),i=e(9974),o=e(6916),a=e(7908),s=e(3411),u=e(7659),f=e(4411),c=e(6244),h=e(6135),l=e(8554),p=e(1246),v=n.Array;t.exports=function(t){var r=a(t),e=f(this),n=arguments.length,d=n>1?arguments[1]:void 0,g=void 0!==d;g&&(d=i(d,n>2?arguments[2]:void 0));var y,m,x,b,w,S,_=p(r),E=0;if(!_||this==v&&u(_))for(y=c(r),m=e?new this(y):v(y);y>E;E++)S=g?d(r[E],E):r[E],h(m,E,S);else for(w=(b=l(r,_)).next,m=e?new this:[];!(x=o(w,b)).done;E++)S=g?s(b,d,[x.value,E],!0):x.value,h(m,E,S);return m.length=E,m}},1318:(t,r,e)=>{var n=e(5656),i=e(1400),o=e(6244),a=function(t){return function(r,e,a){var s,u=n(r),f=o(u),c=i(a,f);if(t&&e!=e){for(;f>c;)if((s=u[c++])!=s)return!0}else for(;f>c;c++)if((t||c in u)&&u[c]===e)return t||c||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},2092:(t,r,e)=>{var n=e(9974),i=e(1702),o=e(8361),a=e(7908),s=e(6244),u=e(5417),f=i([].push),c=function(t){var r=1==t,e=2==t,i=3==t,c=4==t,h=6==t,l=7==t,p=5==t||h;return function(v,d,g,y){for(var m,x,b=a(v),w=o(b),S=n(d,g),_=s(w),E=0,k=y||u,M=r?k(v,_):e||l?k(v,0):void 0;_>E;E++)if((p||E in w)&&(x=S(m=w[E],E,b),t))if(r)M[E]=x;else if(x)switch(t){case 3:return!0;case 5:return m;case 6:return E;case 2:f(M,m)}else switch(t){case 4:return!1;case 7:f(M,m)}return h?-1:i||c?c:M}};t.exports={forEach:c(0),map:c(1),filter:c(2),some:c(3),every:c(4),find:c(5),findIndex:c(6),filterReject:c(7)}},6583:(t,r,e)=>{"use strict";var n=e(2104),i=e(5656),o=e(9303),a=e(6244),s=e(9341),u=Math.min,f=[].lastIndexOf,c=!!f&&1/[1].lastIndexOf(1,-0)<0,h=s("lastIndexOf"),l=c||!h;t.exports=l?function(t){if(c)return n(f,this,arguments)||0;var r=i(this),e=a(r),s=e-1;for(arguments.length>1&&(s=u(s,o(arguments[1]))),s<0&&(s=e+s);s>=0;s--)if(s in r&&r[s]===t)return s||0;return-1}:f},1194:(t,r,e)=>{var n=e(7293),i=e(5112),o=e(7392),a=i("species");t.exports=function(t){return o>=51||!n((function(){var r=[];return(r.constructor={})[a]=function(){return{foo:1}},1!==r[t](Boolean).foo}))}},9341:(t,r,e)=>{"use strict";var n=e(7293);t.exports=function(t,r){var e=[][t];return!!e&&n((function(){e.call(null,r||function(){return 1},1)}))}},3671:(t,r,e)=>{var n=e(7854),i=e(9662),o=e(7908),a=e(8361),s=e(6244),u=n.TypeError,f=function(t){return function(r,e,n,f){i(e);var c=o(r),h=a(c),l=s(c),p=t?l-1:0,v=t?-1:1;if(n<2)for(;;){if(p in h){f=h[p],p+=v;break}if(p+=v,t?p<0:l<=p)throw u("Reduce of empty array with no initial value")}for(;t?p>=0:l>p;p+=v)p in h&&(f=e(f,h[p],p,c));return f}};t.exports={left:f(!1),right:f(!0)}},1589:(t,r,e)=>{var n=e(7854),i=e(1400),o=e(6244),a=e(6135),s=n.Array,u=Math.max;t.exports=function(t,r,e){for(var n=o(t),f=i(r,n),c=i(void 0===e?n:e,n),h=s(u(c-f,0)),l=0;f<c;f++,l++)a(h,l,t[f]);return h.length=l,h}},206:(t,r,e)=>{var n=e(1702);t.exports=n([].slice)},4362:(t,r,e)=>{var n=e(1589),i=Math.floor,o=function(t,r){var e=t.length,u=i(e/2);return e<8?a(t,r):s(t,o(n(t,0,u),r),o(n(t,u),r),r)},a=function(t,r){for(var e,n,i=t.length,o=1;o<i;){for(n=o,e=t[o];n&&r(t[n-1],e)>0;)t[n]=t[--n];n!==o++&&(t[n]=e)}return t},s=function(t,r,e,n){for(var i=r.length,o=e.length,a=0,s=0;a<i||s<o;)t[a+s]=a<i&&s<o?n(r[a],e[s])<=0?r[a++]:e[s++]:a<i?r[a++]:e[s++];return t};t.exports=o},7475:(t,r,e)=>{var n=e(7854),i=e(3157),o=e(4411),a=e(111),s=e(5112)("species"),u=n.Array;t.exports=function(t){var r;return i(t)&&(r=t.constructor,(o(r)&&(r===u||i(r.prototype))||a(r)&&null===(r=r[s]))&&(r=void 0)),void 0===r?u:r}},5417:(t,r,e)=>{var n=e(7475);t.exports=function(t,r){return new(n(t))(0===r?0:r)}},3411:(t,r,e)=>{var n=e(9670),i=e(9212);t.exports=function(t,r,e,o){try{return o?r(n(e)[0],e[1]):r(e)}catch(r){i(t,"throw",r)}}},7072:(t,r,e)=>{var n=e(5112)("iterator"),i=!1;try{var o=0,a={next:function(){return{done:!!o++}},return:function(){i=!0}};a[n]=function(){return this},Array.from(a,(function(){throw 2}))}catch(t){}t.exports=function(t,r){if(!r&&!i)return!1;var e=!1;try{var o={};o[n]=function(){return{next:function(){return{done:e=!0}}}},t(o)}catch(t){}return e}},4326:(t,r,e)=>{var n=e(1702),i=n({}.toString),o=n("".slice);t.exports=function(t){return o(i(t),8,-1)}},648:(t,r,e)=>{var n=e(7854),i=e(1694),o=e(614),a=e(4326),s=e(5112)("toStringTag"),u=n.Object,f="Arguments"==a(function(){return arguments}());t.exports=i?a:function(t){var r,e,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(e=function(t,r){try{return t[r]}catch(t){}}(r=u(t),s))?e:f?a(r):"Object"==(n=a(r))&&o(r.callee)?"Arguments":n}},9920:(t,r,e)=>{var n=e(2597),i=e(3887),o=e(1236),a=e(3070);t.exports=function(t,r,e){for(var s=i(r),u=a.f,f=o.f,c=0;c<s.length;c++){var h=s[c];n(t,h)||e&&n(e,h)||u(t,h,f(r,h))}}},8544:(t,r,e)=>{var n=e(7293);t.exports=!n((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},4994:(t,r,e)=>{"use strict";var n=e(3383).IteratorPrototype,i=e(30),o=e(9114),a=e(8003),s=e(7497),u=function(){return this};t.exports=function(t,r,e,f){var c=r+" Iterator";return t.prototype=i(n,{next:o(+!f,e)}),a(t,c,!1,!0),s[c]=u,t}},8880:(t,r,e)=>{var n=e(9781),i=e(3070),o=e(9114);t.exports=n?function(t,r,e){return i.f(t,r,o(1,e))}:function(t,r,e){return t[r]=e,t}},9114:t=>{t.exports=function(t,r){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:r}}},6135:(t,r,e)=>{"use strict";var n=e(4948),i=e(3070),o=e(9114);t.exports=function(t,r,e){var a=n(r);a in t?i.f(t,a,o(0,e)):t[a]=e}},8052:(t,r,e)=>{var n=e(614),i=e(8880),o=e(6339),a=e(3072);t.exports=function(t,r,e,s){s||(s={});var u=s.enumerable,f=void 0!==s.name?s.name:r;return n(e)&&o(e,f,s),s.global?u?t[r]=e:a(r,e):(s.unsafe?t[r]&&(u=!0):delete t[r],u?t[r]=e:i(t,r,e)),t}},9190:(t,r,e)=>{var n=e(8052);t.exports=function(t,r,e){for(var i in r)n(t,i,r[i],e);return t}},3072:(t,r,e)=>{var n=e(7854),i=Object.defineProperty;t.exports=function(t,r){try{i(n,t,{value:r,configurable:!0,writable:!0})}catch(e){n[t]=r}return r}},654:(t,r,e)=>{"use strict";var n=e(2109),i=e(6916),o=e(1913),a=e(6530),s=e(614),u=e(4994),f=e(9518),c=e(7674),h=e(8003),l=e(8880),p=e(8052),v=e(5112),d=e(7497),g=e(3383),y=a.PROPER,m=a.CONFIGURABLE,x=g.IteratorPrototype,b=g.BUGGY_SAFARI_ITERATORS,w=v("iterator"),S="keys",_="values",E="entries",k=function(){return this};t.exports=function(t,r,e,a,v,g,M){u(e,r,a);var A,P,O,T=function(t){if(t===v&&L)return L;if(!b&&t in j)return j[t];switch(t){case S:case _:case E:return function(){return new e(this,t)}}return function(){return new e(this)}},R=r+" Iterator",I=!1,j=t.prototype,B=j[w]||j["@@iterator"]||v&&j[v],L=!b&&B||T(v),N="Array"==r&&j.entries||B;if(N&&(A=f(N.call(new t)))!==Object.prototype&&A.next&&(o||f(A)===x||(c?c(A,x):s(A[w])||p(A,w,k)),h(A,R,!0,!0),o&&(d[R]=k)),y&&v==_&&B&&B.name!==_&&(!o&&m?l(j,"name",_):(I=!0,L=function(){return i(B,this)})),v)if(P={values:T(_),keys:g?L:T(S),entries:T(E)},M)for(O in P)(b||I||!(O in j))&&p(j,O,P[O]);else n({target:r,proto:!0,forced:b||I},P);return o&&!M||j[w]===L||p(j,w,L,{name:v}),d[r]=L,P}},7235:(t,r,e)=>{var n=e(857),i=e(2597),o=e(6061),a=e(3070).f;t.exports=function(t){var r=n.Symbol||(n.Symbol={});i(r,t)||a(r,t,{value:o.f(t)})}},9781:(t,r,e)=>{var n=e(7293);t.exports=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},317:(t,r,e)=>{var n=e(7854),i=e(111),o=n.document,a=i(o)&&i(o.createElement);t.exports=function(t){return a?o.createElement(t):{}}},8324:t=>{t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},8509:(t,r,e)=>{var n=e(317)("span").classList,i=n&&n.constructor&&n.constructor.prototype;t.exports=i===Object.prototype?void 0:i},8886:(t,r,e)=>{var n=e(8113).match(/firefox\/(\d+)/i);t.exports=!!n&&+n[1]},7871:t=>{t.exports="object"==typeof window&&"object"!=typeof Deno},256:(t,r,e)=>{var n=e(8113);t.exports=/MSIE|Trident/.test(n)},1528:(t,r,e)=>{var n=e(8113),i=e(7854);t.exports=/ipad|iphone|ipod/i.test(n)&&void 0!==i.Pebble},6833:(t,r,e)=>{var n=e(8113);t.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(n)},5268:(t,r,e)=>{var n=e(4326),i=e(7854);t.exports="process"==n(i.process)},1036:(t,r,e)=>{var n=e(8113);t.exports=/web0s(?!.*chrome)/i.test(n)},8113:(t,r,e)=>{var n=e(5005);t.exports=n("navigator","userAgent")||""},7392:(t,r,e)=>{var n,i,o=e(7854),a=e(8113),s=o.process,u=o.Deno,f=s&&s.versions||u&&u.version,c=f&&f.v8;c&&(i=(n=c.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!i&&a&&(!(n=a.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=a.match(/Chrome\/(\d+)/))&&(i=+n[1]),t.exports=i},8008:(t,r,e)=>{var n=e(8113).match(/AppleWebKit\/(\d+)\./);t.exports=!!n&&+n[1]},748:t=>{t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},2109:(t,r,e)=>{var n=e(7854),i=e(1236).f,o=e(8880),a=e(8052),s=e(3072),u=e(9920),f=e(4705);t.exports=function(t,r){var e,c,h,l,p,v=t.target,d=t.global,g=t.stat;if(e=d?n:g?n[v]||s(v,{}):(n[v]||{}).prototype)for(c in r){if(l=r[c],h=t.dontCallGetSet?(p=i(e,c))&&p.value:e[c],!f(d?c:v+(g?".":"#")+c,t.forced)&&void 0!==h){if(typeof l==typeof h)continue;u(l,h)}(t.sham||h&&h.sham)&&o(l,"sham",!0),a(e,c,l,t)}}},7293:t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},7007:(t,r,e)=>{"use strict";e(4916);var n=e(1702),i=e(8052),o=e(2261),a=e(7293),s=e(5112),u=e(8880),f=s("species"),c=RegExp.prototype;t.exports=function(t,r,e,h){var l=s(t),p=!a((function(){var r={};return r[l]=function(){return 7},7!=""[t](r)})),v=p&&!a((function(){var r=!1,e=/a/;return"split"===t&&((e={}).constructor={},e.constructor[f]=function(){return e},e.flags="",e[l]=/./[l]),e.exec=function(){return r=!0,null},e[l](""),!r}));if(!p||!v||e){var d=n(/./[l]),g=r(l,""[t],(function(t,r,e,i,a){var s=n(t),u=r.exec;return u===o||u===c.exec?p&&!a?{done:!0,value:d(r,e,i)}:{done:!0,value:s(e,r,i)}:{done:!1}}));i(String.prototype,t,g[0]),i(c,l,g[1])}h&&u(c[l],"sham",!0)}},2104:(t,r,e)=>{var n=e(4374),i=Function.prototype,o=i.apply,a=i.call;t.exports="object"==typeof Reflect&&Reflect.apply||(n?a.bind(o):function(){return a.apply(o,arguments)})},9974:(t,r,e)=>{var n=e(1702),i=e(9662),o=e(4374),a=n(n.bind);t.exports=function(t,r){return i(t),void 0===r?t:o?a(t,r):function(){return t.apply(r,arguments)}}},4374:(t,r,e)=>{var n=e(7293);t.exports=!n((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},6916:(t,r,e)=>{var n=e(4374),i=Function.prototype.call;t.exports=n?i.bind(i):function(){return i.apply(i,arguments)}},6530:(t,r,e)=>{var n=e(9781),i=e(2597),o=Function.prototype,a=n&&Object.getOwnPropertyDescriptor,s=i(o,"name"),u=s&&"something"===function(){}.name,f=s&&(!n||n&&a(o,"name").configurable);t.exports={EXISTS:s,PROPER:u,CONFIGURABLE:f}},1702:(t,r,e)=>{var n=e(4374),i=Function.prototype,o=i.bind,a=i.call,s=n&&o.bind(a,a);t.exports=n?function(t){return t&&s(t)}:function(t){return t&&function(){return a.apply(t,arguments)}}},5005:(t,r,e)=>{var n=e(7854),i=e(614),o=function(t){return i(t)?t:void 0};t.exports=function(t,r){return arguments.length<2?o(n[t]):n[t]&&n[t][r]}},1246:(t,r,e)=>{var n=e(648),i=e(8173),o=e(7497),a=e(5112)("iterator");t.exports=function(t){if(null!=t)return i(t,a)||i(t,"@@iterator")||o[n(t)]}},8554:(t,r,e)=>{var n=e(7854),i=e(6916),o=e(9662),a=e(9670),s=e(6330),u=e(1246),f=n.TypeError;t.exports=function(t,r){var e=arguments.length<2?u(t):r;if(o(e))return a(i(e,t));throw f(s(t)+" is not iterable")}},8173:(t,r,e)=>{var n=e(9662);t.exports=function(t,r){var e=t[r];return null==e?void 0:n(e)}},647:(t,r,e)=>{var n=e(1702),i=e(7908),o=Math.floor,a=n("".charAt),s=n("".replace),u=n("".slice),f=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,c=/\$([$&'`]|\d{1,2})/g;t.exports=function(t,r,e,n,h,l){var p=e+t.length,v=n.length,d=c;return void 0!==h&&(h=i(h),d=f),s(l,d,(function(i,s){var f;switch(a(s,0)){case"$":return"$";case"&":return t;case"`":return u(r,0,e);case"'":return u(r,p);case"<":f=h[u(s,1,-1)];break;default:var c=+s;if(0===c)return i;if(c>v){var l=o(c/10);return 0===l?i:l<=v?void 0===n[l-1]?a(s,1):n[l-1]+a(s,1):i}f=n[c-1]}return void 0===f?"":f}))}},7854:(t,r,e)=>{var n=function(t){return t&&t.Math==Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof e.g&&e.g)||function(){return this}()||Function("return this")()},2597:(t,r,e)=>{var n=e(1702),i=e(7908),o=n({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,r){return o(i(t),r)}},3501:t=>{t.exports={}},842:(t,r,e)=>{var n=e(7854);t.exports=function(t,r){var e=n.console;e&&e.error&&(1==arguments.length?e.error(t):e.error(t,r))}},490:(t,r,e)=>{var n=e(5005);t.exports=n("document","documentElement")},4664:(t,r,e)=>{var n=e(9781),i=e(7293),o=e(317);t.exports=!n&&!i((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},1179:(t,r,e)=>{var n=e(7854).Array,i=Math.abs,o=Math.pow,a=Math.floor,s=Math.log,u=Math.LN2;t.exports={pack:function(t,r,e){var f,c,h,l=n(e),p=8*e-r-1,v=(1<<p)-1,d=v>>1,g=23===r?o(2,-24)-o(2,-77):0,y=t<0||0===t&&1/t<0?1:0,m=0;for((t=i(t))!=t||t===1/0?(c=t!=t?1:0,f=v):(f=a(s(t)/u),t*(h=o(2,-f))<1&&(f--,h*=2),(t+=f+d>=1?g/h:g*o(2,1-d))*h>=2&&(f++,h/=2),f+d>=v?(c=0,f=v):f+d>=1?(c=(t*h-1)*o(2,r),f+=d):(c=t*o(2,d-1)*o(2,r),f=0));r>=8;)l[m++]=255&c,c/=256,r-=8;for(f=f<<r|c,p+=r;p>0;)l[m++]=255&f,f/=256,p-=8;return l[--m]|=128*y,l},unpack:function(t,r){var e,n=t.length,i=8*n-r-1,a=(1<<i)-1,s=a>>1,u=i-7,f=n-1,c=t[f--],h=127&c;for(c>>=7;u>0;)h=256*h+t[f--],u-=8;for(e=h&(1<<-u)-1,h>>=-u,u+=r;u>0;)e=256*e+t[f--],u-=8;if(0===h)h=1-s;else{if(h===a)return e?NaN:c?-1/0:1/0;e+=o(2,r),h-=s}return(c?-1:1)*e*o(2,h-r)}}},8361:(t,r,e)=>{var n=e(7854),i=e(1702),o=e(7293),a=e(4326),s=n.Object,u=i("".split);t.exports=o((function(){return!s("z").propertyIsEnumerable(0)}))?function(t){return"String"==a(t)?u(t,""):s(t)}:s},9587:(t,r,e)=>{var n=e(614),i=e(111),o=e(7674);t.exports=function(t,r,e){var a,s;return o&&n(a=r.constructor)&&a!==e&&i(s=a.prototype)&&s!==e.prototype&&o(t,s),t}},2788:(t,r,e)=>{var n=e(1702),i=e(614),o=e(5465),a=n(Function.toString);i(o.inspectSource)||(o.inspectSource=function(t){return a(t)}),t.exports=o.inspectSource},9909:(t,r,e)=>{var n,i,o,a=e(8536),s=e(7854),u=e(1702),f=e(111),c=e(8880),h=e(2597),l=e(5465),p=e(6200),v=e(3501),d="Object already initialized",g=s.TypeError,y=s.WeakMap;if(a||l.state){var m=l.state||(l.state=new y),x=u(m.get),b=u(m.has),w=u(m.set);n=function(t,r){if(b(m,t))throw new g(d);return r.facade=t,w(m,t,r),r},i=function(t){return x(m,t)||{}},o=function(t){return b(m,t)}}else{var S=p("state");v[S]=!0,n=function(t,r){if(h(t,S))throw new g(d);return r.facade=t,c(t,S,r),r},i=function(t){return h(t,S)?t[S]:{}},o=function(t){return h(t,S)}}t.exports={set:n,get:i,has:o,enforce:function(t){return o(t)?i(t):n(t,{})},getterFor:function(t){return function(r){var e;if(!f(r)||(e=i(r)).type!==t)throw g("Incompatible receiver, "+t+" required");return e}}}},7659:(t,r,e)=>{var n=e(5112),i=e(7497),o=n("iterator"),a=Array.prototype;t.exports=function(t){return void 0!==t&&(i.Array===t||a[o]===t)}},3157:(t,r,e)=>{var n=e(4326);t.exports=Array.isArray||function(t){return"Array"==n(t)}},614:t=>{t.exports=function(t){return"function"==typeof t}},4411:(t,r,e)=>{var n=e(1702),i=e(7293),o=e(614),a=e(648),s=e(5005),u=e(2788),f=function(){},c=[],h=s("Reflect","construct"),l=/^\s*(?:class|function)\b/,p=n(l.exec),v=!l.exec(f),d=function(t){if(!o(t))return!1;try{return h(f,c,t),!0}catch(t){return!1}},g=function(t){if(!o(t))return!1;switch(a(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return v||!!p(l,u(t))}catch(t){return!0}};g.sham=!0,t.exports=!h||i((function(){var t;return d(d.call)||!d(Object)||!d((function(){t=!0}))||t}))?g:d},4705:(t,r,e)=>{var n=e(7293),i=e(614),o=/#|\.prototype\./,a=function(t,r){var e=u[s(t)];return e==c||e!=f&&(i(r)?n(r):!!r)},s=a.normalize=function(t){return String(t).replace(o,".").toLowerCase()},u=a.data={},f=a.NATIVE="N",c=a.POLYFILL="P";t.exports=a},5988:(t,r,e)=>{var n=e(111),i=Math.floor;t.exports=Number.isInteger||function(t){return!n(t)&&isFinite(t)&&i(t)===t}},111:(t,r,e)=>{var n=e(614);t.exports=function(t){return"object"==typeof t?null!==t:n(t)}},1913:t=>{t.exports=!1},7850:(t,r,e)=>{var n=e(111),i=e(4326),o=e(5112)("match");t.exports=function(t){var r;return n(t)&&(void 0!==(r=t[o])?!!r:"RegExp"==i(t))}},2190:(t,r,e)=>{var n=e(7854),i=e(5005),o=e(614),a=e(7976),s=e(3307),u=n.Object;t.exports=s?function(t){return"symbol"==typeof t}:function(t){var r=i("Symbol");return o(r)&&a(r.prototype,u(t))}},408:(t,r,e)=>{var n=e(7854),i=e(9974),o=e(6916),a=e(9670),s=e(6330),u=e(7659),f=e(6244),c=e(7976),h=e(8554),l=e(1246),p=e(9212),v=n.TypeError,d=function(t,r){this.stopped=t,this.result=r},g=d.prototype;t.exports=function(t,r,e){var n,y,m,x,b,w,S,_=e&&e.that,E=!(!e||!e.AS_ENTRIES),k=!(!e||!e.IS_ITERATOR),M=!(!e||!e.INTERRUPTED),A=i(r,_),P=function(t){return n&&p(n,"normal",t),new d(!0,t)},O=function(t){return E?(a(t),M?A(t[0],t[1],P):A(t[0],t[1])):M?A(t,P):A(t)};if(k)n=t;else{if(!(y=l(t)))throw v(s(t)+" is not iterable");if(u(y)){for(m=0,x=f(t);x>m;m++)if((b=O(t[m]))&&c(g,b))return b;return new d(!1)}n=h(t,y)}for(w=n.next;!(S=o(w,n)).done;){try{b=O(S.value)}catch(t){p(n,"throw",t)}if("object"==typeof b&&b&&c(g,b))return b}return new d(!1)}},9212:(t,r,e)=>{var n=e(6916),i=e(9670),o=e(8173);t.exports=function(t,r,e){var a,s;i(t);try{if(!(a=o(t,"return"))){if("throw"===r)throw e;return e}a=n(a,t)}catch(t){s=!0,a=t}if("throw"===r)throw e;if(s)throw a;return i(a),e}},3383:(t,r,e)=>{"use strict";var n,i,o,a=e(7293),s=e(614),u=e(30),f=e(9518),c=e(8052),h=e(5112),l=e(1913),p=h("iterator"),v=!1;[].keys&&("next"in(o=[].keys())?(i=f(f(o)))!==Object.prototype&&(n=i):v=!0),null==n||a((function(){var t={};return n[p].call(t)!==t}))?n={}:l&&(n=u(n)),s(n[p])||c(n,p,(function(){return this})),t.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:v}},7497:t=>{t.exports={}},6244:(t,r,e)=>{var n=e(7466);t.exports=function(t){return n(t.length)}},6339:(t,r,e)=>{var n=e(7293),i=e(614),o=e(2597),a=e(9781),s=e(6530).CONFIGURABLE,u=e(2788),f=e(9909),c=f.enforce,h=f.get,l=Object.defineProperty,p=a&&!n((function(){return 8!==l((function(){}),"length",{value:8}).length})),v=String(String).split("String"),d=t.exports=function(t,r,e){"Symbol("===String(r).slice(0,7)&&(r="["+String(r).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),e&&e.getter&&(r="get "+r),e&&e.setter&&(r="set "+r),(!o(t,"name")||s&&t.name!==r)&&l(t,"name",{value:r,configurable:!0}),p&&e&&o(e,"arity")&&t.length!==e.arity&&l(t,"length",{value:e.arity});try{e&&o(e,"constructor")&&e.constructor?a&&l(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var n=c(t);return o(n,"source")||(n.source=v.join("string"==typeof r?r:"")),t};Function.prototype.toString=d((function(){return i(this)&&h(this).source||u(this)}),"toString")},4758:t=>{var r=Math.ceil,e=Math.floor;t.exports=Math.trunc||function(t){var n=+t;return(n>0?e:r)(n)}},5948:(t,r,e)=>{var n,i,o,a,s,u,f,c,h=e(7854),l=e(9974),p=e(1236).f,v=e(261).set,d=e(6833),g=e(1528),y=e(1036),m=e(5268),x=h.MutationObserver||h.WebKitMutationObserver,b=h.document,w=h.process,S=h.Promise,_=p(h,"queueMicrotask"),E=_&&_.value;E||(n=function(){var t,r;for(m&&(t=w.domain)&&t.exit();i;){r=i.fn,i=i.next;try{r()}catch(t){throw i?a():o=void 0,t}}o=void 0,t&&t.enter()},d||m||y||!x||!b?!g&&S&&S.resolve?((f=S.resolve(void 0)).constructor=S,c=l(f.then,f),a=function(){c(n)}):m?a=function(){w.nextTick(n)}:(v=l(v,h),a=function(){v(n)}):(s=!0,u=b.createTextNode(""),new x(n).observe(u,{characterData:!0}),a=function(){u.data=s=!s})),t.exports=E||function(t){var r={fn:t,next:void 0};o&&(o.next=r),i||(i=r,a()),o=r}},735:(t,r,e)=>{var n=e(133);t.exports=n&&!!Symbol.for&&!!Symbol.keyFor},133:(t,r,e)=>{var n=e(7392),i=e(7293);t.exports=!!Object.getOwnPropertySymbols&&!i((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},8536:(t,r,e)=>{var n=e(7854),i=e(614),o=e(2788),a=n.WeakMap;t.exports=i(a)&&/native code/.test(o(a))},8523:(t,r,e)=>{"use strict";var n=e(9662),i=function(t){var r,e;this.promise=new t((function(t,n){if(void 0!==r||void 0!==e)throw TypeError("Bad Promise constructor");r=t,e=n})),this.resolve=n(r),this.reject=n(e)};t.exports.f=function(t){return new i(t)}},1574:(t,r,e)=>{"use strict";var n=e(9781),i=e(1702),o=e(6916),a=e(7293),s=e(1956),u=e(5181),f=e(5296),c=e(7908),h=e(8361),l=Object.assign,p=Object.defineProperty,v=i([].concat);t.exports=!l||a((function(){if(n&&1!==l({b:1},l(p({},"a",{enumerable:!0,get:function(){p(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},r={},e=Symbol(),i="abcdefghijklmnopqrst";return t[e]=7,i.split("").forEach((function(t){r[t]=t})),7!=l({},t)[e]||s(l({},r)).join("")!=i}))?function(t,r){for(var e=c(t),i=arguments.length,a=1,l=u.f,p=f.f;i>a;)for(var d,g=h(arguments[a++]),y=l?v(s(g),l(g)):s(g),m=y.length,x=0;m>x;)d=y[x++],n&&!o(p,g,d)||(e[d]=g[d]);return e}:l},30:(t,r,e)=>{var n,i=e(9670),o=e(6048),a=e(748),s=e(3501),u=e(490),f=e(317),c=e(6200)("IE_PROTO"),h=function(){},l=function(t){return"<script>"+t+"<\/script>"},p=function(t){t.write(l("")),t.close();var r=t.parentWindow.Object;return t=null,r},v=function(){try{n=new ActiveXObject("htmlfile")}catch(t){}var t,r;v="undefined"!=typeof document?document.domain&&n?p(n):((r=f("iframe")).style.display="none",u.appendChild(r),r.src=String("javascript:"),(t=r.contentWindow.document).open(),t.write(l("document.F=Object")),t.close(),t.F):p(n);for(var e=a.length;e--;)delete v.prototype[a[e]];return v()};s[c]=!0,t.exports=Object.create||function(t,r){var e;return null!==t?(h.prototype=i(t),e=new h,h.prototype=null,e[c]=t):e=v(),void 0===r?e:o.f(e,r)}},6048:(t,r,e)=>{var n=e(9781),i=e(3353),o=e(3070),a=e(9670),s=e(5656),u=e(1956);r.f=n&&!i?Object.defineProperties:function(t,r){a(t);for(var e,n=s(r),i=u(r),f=i.length,c=0;f>c;)o.f(t,e=i[c++],n[e]);return t}},3070:(t,r,e)=>{var n=e(7854),i=e(9781),o=e(4664),a=e(3353),s=e(9670),u=e(4948),f=n.TypeError,c=Object.defineProperty,h=Object.getOwnPropertyDescriptor;r.f=i?a?function(t,r,e){if(s(t),r=u(r),s(e),"function"==typeof t&&"prototype"===r&&"value"in e&&"writable"in e&&!e.writable){var n=h(t,r);n&&n.writable&&(t[r]=e.value,e={configurable:"configurable"in e?e.configurable:n.configurable,enumerable:"enumerable"in e?e.enumerable:n.enumerable,writable:!1})}return c(t,r,e)}:c:function(t,r,e){if(s(t),r=u(r),s(e),o)try{return c(t,r,e)}catch(t){}if("get"in e||"set"in e)throw f("Accessors not supported");return"value"in e&&(t[r]=e.value),t}},1236:(t,r,e)=>{var n=e(9781),i=e(6916),o=e(5296),a=e(9114),s=e(5656),u=e(4948),f=e(2597),c=e(4664),h=Object.getOwnPropertyDescriptor;r.f=n?h:function(t,r){if(t=s(t),r=u(r),c)try{return h(t,r)}catch(t){}if(f(t,r))return a(!i(o.f,t,r),t[r])}},1156:(t,r,e)=>{var n=e(4326),i=e(5656),o=e(8006).f,a=e(1589),s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return s&&"Window"==n(t)?function(t){try{return o(t)}catch(t){return a(s)}}(t):o(i(t))}},8006:(t,r,e)=>{var n=e(6324),i=e(748).concat("length","prototype");r.f=Object.getOwnPropertyNames||function(t){return n(t,i)}},5181:(t,r)=>{r.f=Object.getOwnPropertySymbols},9518:(t,r,e)=>{var n=e(7854),i=e(2597),o=e(614),a=e(7908),s=e(6200),u=e(8544),f=s("IE_PROTO"),c=n.Object,h=c.prototype;t.exports=u?c.getPrototypeOf:function(t){var r=a(t);if(i(r,f))return r[f];var e=r.constructor;return o(e)&&r instanceof e?e.prototype:r instanceof c?h:null}},7976:(t,r,e)=>{var n=e(1702);t.exports=n({}.isPrototypeOf)},6324:(t,r,e)=>{var n=e(1702),i=e(2597),o=e(5656),a=e(1318).indexOf,s=e(3501),u=n([].push);t.exports=function(t,r){var e,n=o(t),f=0,c=[];for(e in n)!i(s,e)&&i(n,e)&&u(c,e);for(;r.length>f;)i(n,e=r[f++])&&(~a(c,e)||u(c,e));return c}},1956:(t,r,e)=>{var n=e(6324),i=e(748);t.exports=Object.keys||function(t){return n(t,i)}},5296:(t,r)=>{"use strict";var e={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,i=n&&!e.call({1:2},1);r.f=i?function(t){var r=n(this,t);return!!r&&r.enumerable}:e},7674:(t,r,e)=>{var n=e(1702),i=e(9670),o=e(6077);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,r=!1,e={};try{(t=n(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(e,[]),r=e instanceof Array}catch(t){}return function(e,n){return i(e),o(n),r?t(e,n):e.__proto__=n,e}}():void 0)},288:(t,r,e)=>{"use strict";var n=e(1694),i=e(648);t.exports=n?{}.toString:function(){return"[object "+i(this)+"]"}},2140:(t,r,e)=>{var n=e(7854),i=e(6916),o=e(614),a=e(111),s=n.TypeError;t.exports=function(t,r){var e,n;if("string"===r&&o(e=t.toString)&&!a(n=i(e,t)))return n;if(o(e=t.valueOf)&&!a(n=i(e,t)))return n;if("string"!==r&&o(e=t.toString)&&!a(n=i(e,t)))return n;throw s("Can't convert object to primitive value")}},3887:(t,r,e)=>{var n=e(5005),i=e(1702),o=e(8006),a=e(5181),s=e(9670),u=i([].concat);t.exports=n("Reflect","ownKeys")||function(t){var r=o.f(s(t)),e=a.f;return e?u(r,e(t)):r}},857:(t,r,e)=>{var n=e(7854);t.exports=n},2534:t=>{t.exports=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}}},3702:(t,r,e)=>{var n=e(7854),i=e(2492),o=e(614),a=e(4705),s=e(2788),u=e(5112),f=e(7871),c=e(1913),h=e(7392),l=i&&i.prototype,p=u("species"),v=!1,d=o(n.PromiseRejectionEvent),g=a("Promise",(function(){var t=s(i),r=t!==String(i);if(!r&&66===h)return!0;if(c&&(!l.catch||!l.finally))return!0;if(h>=51&&/native code/.test(t))return!1;var e=new i((function(t){t(1)})),n=function(t){t((function(){}),(function(){}))};return(e.constructor={})[p]=n,!(v=e.then((function(){}))instanceof n)||!r&&f&&!d}));t.exports={CONSTRUCTOR:g,REJECTION_EVENT:d,SUBCLASSING:v}},2492:(t,r,e)=>{var n=e(7854);t.exports=n.Promise},9478:(t,r,e)=>{var n=e(9670),i=e(111),o=e(8523);t.exports=function(t,r){if(n(t),i(r)&&r.constructor===t)return r;var e=o.f(t);return(0,e.resolve)(r),e.promise}},612:(t,r,e)=>{var n=e(2492),i=e(7072),o=e(3702).CONSTRUCTOR;t.exports=o||!i((function(t){n.all(t).then(void 0,(function(){}))}))},8572:t=>{var r=function(){this.head=null,this.tail=null};r.prototype={add:function(t){var r={item:t,next:null};this.head?this.tail.next=r:this.head=r,this.tail=r},get:function(){var t=this.head;if(t)return this.head=t.next,this.tail===t&&(this.tail=null),t.item}},t.exports=r},7651:(t,r,e)=>{var n=e(7854),i=e(6916),o=e(9670),a=e(614),s=e(4326),u=e(2261),f=n.TypeError;t.exports=function(t,r){var e=t.exec;if(a(e)){var n=i(e,t,r);return null!==n&&o(n),n}if("RegExp"===s(t))return i(u,t,r);throw f("RegExp#exec called on incompatible receiver")}},2261:(t,r,e)=>{"use strict";var n,i,o=e(6916),a=e(1702),s=e(1340),u=e(7066),f=e(2999),c=e(2309),h=e(30),l=e(9909).get,p=e(9441),v=e(7168),d=c("native-string-replace",String.prototype.replace),g=RegExp.prototype.exec,y=g,m=a("".charAt),x=a("".indexOf),b=a("".replace),w=a("".slice),S=(i=/b*/g,o(g,n=/a/,"a"),o(g,i,"a"),0!==n.lastIndex||0!==i.lastIndex),_=f.BROKEN_CARET,E=void 0!==/()??/.exec("")[1];(S||E||_||p||v)&&(y=function(t){var r,e,n,i,a,f,c,p=this,v=l(p),k=s(t),M=v.raw;if(M)return M.lastIndex=p.lastIndex,r=o(y,M,k),p.lastIndex=M.lastIndex,r;var A=v.groups,P=_&&p.sticky,O=o(u,p),T=p.source,R=0,I=k;if(P&&(O=b(O,"y",""),-1===x(O,"g")&&(O+="g"),I=w(k,p.lastIndex),p.lastIndex>0&&(!p.multiline||p.multiline&&"\n"!==m(k,p.lastIndex-1))&&(T="(?: "+T+")",I=" "+I,R++),e=new RegExp("^(?:"+T+")",O)),E&&(e=new RegExp("^"+T+"$(?!\\s)",O)),S&&(n=p.lastIndex),i=o(g,P?e:p,I),P?i?(i.input=w(i.input,R),i[0]=w(i[0],R),i.index=p.lastIndex,p.lastIndex+=i[0].length):p.lastIndex=0:S&&i&&(p.lastIndex=p.global?i.index+i[0].length:n),E&&i&&i.length>1&&o(d,i[0],e,(function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(i[a]=void 0)})),i&&A)for(i.groups=f=h(null),a=0;a<A.length;a++)f[(c=A[a])[0]]=i[c[1]];return i}),t.exports=y},7066:(t,r,e)=>{"use strict";var n=e(9670);t.exports=function(){var t=n(this),r="";return t.hasIndices&&(r+="d"),t.global&&(r+="g"),t.ignoreCase&&(r+="i"),t.multiline&&(r+="m"),t.dotAll&&(r+="s"),t.unicode&&(r+="u"),t.sticky&&(r+="y"),r}},4706:(t,r,e)=>{var n=e(6916),i=e(2597),o=e(7976),a=e(7066),s=RegExp.prototype;t.exports=function(t){var r=t.flags;return void 0!==r||"flags"in s||i(t,"flags")||!o(s,t)?r:n(a,t)}},2999:(t,r,e)=>{var n=e(7293),i=e(7854).RegExp,o=n((function(){var t=i("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),a=o||n((function(){return!i("a","y").sticky})),s=o||n((function(){var t=i("^r","gy");return t.lastIndex=2,null!=t.exec("str")}));t.exports={BROKEN_CARET:s,MISSED_STICKY:a,UNSUPPORTED_Y:o}},9441:(t,r,e)=>{var n=e(7293),i=e(7854).RegExp;t.exports=n((function(){var t=i(".","s");return!(t.dotAll&&t.exec("\n")&&"s"===t.flags)}))},7168:(t,r,e)=>{var n=e(7293),i=e(7854).RegExp;t.exports=n((function(){var t=i("(?<a>b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")}))},4488:(t,r,e)=>{var n=e(7854).TypeError;t.exports=function(t){if(null==t)throw n("Can't call method on "+t);return t}},6340:(t,r,e)=>{"use strict";var n=e(5005),i=e(3070),o=e(5112),a=e(9781),s=o("species");t.exports=function(t){var r=n(t),e=i.f;a&&r&&!r[s]&&e(r,s,{configurable:!0,get:function(){return this}})}},8003:(t,r,e)=>{var n=e(3070).f,i=e(2597),o=e(5112)("toStringTag");t.exports=function(t,r,e){t&&!e&&(t=t.prototype),t&&!i(t,o)&&n(t,o,{configurable:!0,value:r})}},6200:(t,r,e)=>{var n=e(2309),i=e(9711),o=n("keys");t.exports=function(t){return o[t]||(o[t]=i(t))}},5465:(t,r,e)=>{var n=e(7854),i=e(3072),o="__core-js_shared__",a=n[o]||i(o,{});t.exports=a},2309:(t,r,e)=>{var n=e(1913),i=e(5465);(t.exports=function(t,r){return i[t]||(i[t]=void 0!==r?r:{})})("versions",[]).push({version:"3.22.7",mode:n?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.22.7/LICENSE",source:"https://github.com/zloirock/core-js"})},6707:(t,r,e)=>{var n=e(9670),i=e(9483),o=e(5112)("species");t.exports=function(t,r){var e,a=n(t).constructor;return void 0===a||null==(e=n(a)[o])?r:i(e)}},8710:(t,r,e)=>{var n=e(1702),i=e(9303),o=e(1340),a=e(4488),s=n("".charAt),u=n("".charCodeAt),f=n("".slice),c=function(t){return function(r,e){var n,c,h=o(a(r)),l=i(e),p=h.length;return l<0||l>=p?t?"":void 0:(n=u(h,l))<55296||n>56319||l+1===p||(c=u(h,l+1))<56320||c>57343?t?s(h,l):n:t?f(h,l,l+2):c-56320+(n-55296<<10)+65536}};t.exports={codeAt:c(!1),charAt:c(!0)}},6532:(t,r,e)=>{var n=e(6916),i=e(5005),o=e(5112),a=e(8052);t.exports=function(){var t=i("Symbol"),r=t&&t.prototype,e=r&&r.valueOf,s=o("toPrimitive");r&&!r[s]&&a(r,s,(function(t){return n(e,this)}),{arity:1})}},261:(t,r,e)=>{var n,i,o,a,s=e(7854),u=e(2104),f=e(9974),c=e(614),h=e(2597),l=e(7293),p=e(490),v=e(206),d=e(317),g=e(8053),y=e(6833),m=e(5268),x=s.setImmediate,b=s.clearImmediate,w=s.process,S=s.Dispatch,_=s.Function,E=s.MessageChannel,k=s.String,M=0,A={};try{n=s.location}catch(t){}var P=function(t){if(h(A,t)){var r=A[t];delete A[t],r()}},O=function(t){return function(){P(t)}},T=function(t){P(t.data)},R=function(t){s.postMessage(k(t),n.protocol+"//"+n.host)};x&&b||(x=function(t){g(arguments.length,1);var r=c(t)?t:_(t),e=v(arguments,1);return A[++M]=function(){u(r,void 0,e)},i(M),M},b=function(t){delete A[t]},m?i=function(t){w.nextTick(O(t))}:S&&S.now?i=function(t){S.now(O(t))}:E&&!y?(a=(o=new E).port2,o.port1.onmessage=T,i=f(a.postMessage,a)):s.addEventListener&&c(s.postMessage)&&!s.importScripts&&n&&"file:"!==n.protocol&&!l(R)?(i=R,s.addEventListener("message",T,!1)):i="onreadystatechange"in d("script")?function(t){p.appendChild(d("script")).onreadystatechange=function(){p.removeChild(this),P(t)}}:function(t){setTimeout(O(t),0)}),t.exports={set:x,clear:b}},1400:(t,r,e)=>{var n=e(9303),i=Math.max,o=Math.min;t.exports=function(t,r){var e=n(t);return e<0?i(e+r,0):o(e,r)}},7067:(t,r,e)=>{var n=e(7854),i=e(9303),o=e(7466),a=n.RangeError;t.exports=function(t){if(void 0===t)return 0;var r=i(t),e=o(r);if(r!==e)throw a("Wrong length or index");return e}},5656:(t,r,e)=>{var n=e(8361),i=e(4488);t.exports=function(t){return n(i(t))}},9303:(t,r,e)=>{var n=e(4758);t.exports=function(t){var r=+t;return r!=r||0===r?0:n(r)}},7466:(t,r,e)=>{var n=e(9303),i=Math.min;t.exports=function(t){return t>0?i(n(t),9007199254740991):0}},7908:(t,r,e)=>{var n=e(7854),i=e(4488),o=n.Object;t.exports=function(t){return o(i(t))}},4590:(t,r,e)=>{var n=e(7854),i=e(3002),o=n.RangeError;t.exports=function(t,r){var e=i(t);if(e%r)throw o("Wrong offset");return e}},3002:(t,r,e)=>{var n=e(7854),i=e(9303),o=n.RangeError;t.exports=function(t){var r=i(t);if(r<0)throw o("The argument can't be less than 0");return r}},7593:(t,r,e)=>{var n=e(7854),i=e(6916),o=e(111),a=e(2190),s=e(8173),u=e(2140),f=e(5112),c=n.TypeError,h=f("toPrimitive");t.exports=function(t,r){if(!o(t)||a(t))return t;var e,n=s(t,h);if(n){if(void 0===r&&(r="default"),e=i(n,t,r),!o(e)||a(e))return e;throw c("Can't convert object to primitive value")}return void 0===r&&(r="number"),u(t,r)}},4948:(t,r,e)=>{var n=e(7593),i=e(2190);t.exports=function(t){var r=n(t,"string");return i(r)?r:r+""}},1694:(t,r,e)=>{var n={};n[e(5112)("toStringTag")]="z",t.exports="[object z]"===String(n)},1340:(t,r,e)=>{var n=e(7854),i=e(648),o=n.String;t.exports=function(t){if("Symbol"===i(t))throw TypeError("Cannot convert a Symbol value to a string");return o(t)}},6330:(t,r,e)=>{var n=e(7854).String;t.exports=function(t){try{return n(t)}catch(t){return"Object"}}},9843:(t,r,e)=>{"use strict";var n=e(2109),i=e(7854),o=e(6916),a=e(9781),s=e(3832),u=e(260),f=e(3331),c=e(5787),h=e(9114),l=e(8880),p=e(5988),v=e(7466),d=e(7067),g=e(4590),y=e(4948),m=e(2597),x=e(648),b=e(111),w=e(2190),S=e(30),_=e(7976),E=e(7674),k=e(8006).f,M=e(7321),A=e(2092).forEach,P=e(6340),O=e(3070),T=e(1236),R=e(9909),I=e(9587),j=R.get,B=R.set,L=O.f,N=T.f,Y=Math.round,C=i.RangeError,F=f.ArrayBuffer,X=F.prototype,U=f.DataView,D=u.NATIVE_ARRAY_BUFFER_VIEWS,G=u.TYPED_ARRAY_CONSTRUCTOR,z=u.TYPED_ARRAY_TAG,q=u.TypedArray,V=u.TypedArrayPrototype,W=u.aTypedArrayConstructor,J=u.isTypedArray,$="BYTES_PER_ELEMENT",K="Wrong length",H=function(t,r){W(t);for(var e=0,n=r.length,i=new t(n);n>e;)i[e]=r[e++];return i},Z=function(t,r){L(t,r,{get:function(){return j(this)[r]}})},Q=function(t){var r;return _(X,t)||"ArrayBuffer"==(r=x(t))||"SharedArrayBuffer"==r},tt=function(t,r){return J(t)&&!w(r)&&r in t&&p(+r)&&r>=0},rt=function(t,r){return r=y(r),tt(t,r)?h(2,t[r]):N(t,r)},et=function(t,r,e){return r=y(r),!(tt(t,r)&&b(e)&&m(e,"value"))||m(e,"get")||m(e,"set")||e.configurable||m(e,"writable")&&!e.writable||m(e,"enumerable")&&!e.enumerable?L(t,r,e):(t[r]=e.value,t)};a?(D||(T.f=rt,O.f=et,Z(V,"buffer"),Z(V,"byteOffset"),Z(V,"byteLength"),Z(V,"length")),n({target:"Object",stat:!0,forced:!D},{getOwnPropertyDescriptor:rt,defineProperty:et}),t.exports=function(t,r,e){var a=t.match(/\d+$/)[0]/8,u=t+(e?"Clamped":"")+"Array",f="get"+t,h="set"+t,p=i[u],y=p,m=y&&y.prototype,x={},w=function(t,r){L(t,r,{get:function(){return function(t,r){var e=j(t);return e.view[f](r*a+e.byteOffset,!0)}(this,r)},set:function(t){return function(t,r,n){var i=j(t);e&&(n=(n=Y(n))<0?0:n>255?255:255&n),i.view[h](r*a+i.byteOffset,n,!0)}(this,r,t)},enumerable:!0})};D?s&&(y=r((function(t,r,e,n){return c(t,m),I(b(r)?Q(r)?void 0!==n?new p(r,g(e,a),n):void 0!==e?new p(r,g(e,a)):new p(r):J(r)?H(y,r):o(M,y,r):new p(d(r)),t,y)})),E&&E(y,q),A(k(p),(function(t){t in y||l(y,t,p[t])})),y.prototype=m):(y=r((function(t,r,e,n){c(t,m);var i,s,u,f=0,h=0;if(b(r)){if(!Q(r))return J(r)?H(y,r):o(M,y,r);i=r,h=g(e,a);var l=r.byteLength;if(void 0===n){if(l%a)throw C(K);if((s=l-h)<0)throw C(K)}else if((s=v(n)*a)+h>l)throw C(K);u=s/a}else u=d(r),i=new F(s=u*a);for(B(t,{buffer:i,byteOffset:h,byteLength:s,length:u,view:new U(i)});f<u;)w(t,f++)})),E&&E(y,q),m=y.prototype=S(V)),m.constructor!==y&&l(m,"constructor",y),l(m,G,y),z&&l(m,z,u);var _=y!=p;x[u]=y,n({global:!0,constructor:!0,forced:_,sham:!D},x),$ in y||l(y,$,a),$ in m||l(m,$,a),P(u)}):t.exports=function(){}},3832:(t,r,e)=>{var n=e(7854),i=e(7293),o=e(7072),a=e(260).NATIVE_ARRAY_BUFFER_VIEWS,s=n.ArrayBuffer,u=n.Int8Array;t.exports=!a||!i((function(){u(1)}))||!i((function(){new u(-1)}))||!o((function(t){new u,new u(null),new u(1.5),new u(t)}),!0)||i((function(){return 1!==new u(new s(2),1,void 0).length}))},3074:(t,r,e)=>{var n=e(7745),i=e(6304);t.exports=function(t,r){return n(i(t),r)}},7321:(t,r,e)=>{var n=e(9974),i=e(6916),o=e(9483),a=e(7908),s=e(6244),u=e(8554),f=e(1246),c=e(7659),h=e(260).aTypedArrayConstructor;t.exports=function(t){var r,e,l,p,v,d,g=o(this),y=a(t),m=arguments.length,x=m>1?arguments[1]:void 0,b=void 0!==x,w=f(y);if(w&&!c(w))for(d=(v=u(y,w)).next,y=[];!(p=i(d,v)).done;)y.push(p.value);for(b&&m>2&&(x=n(x,arguments[2])),e=s(y),l=new(h(g))(e),r=0;e>r;r++)l[r]=b?x(y[r],r):y[r];return l}},6304:(t,r,e)=>{var n=e(260),i=e(6707),o=n.TYPED_ARRAY_CONSTRUCTOR,a=n.aTypedArrayConstructor;t.exports=function(t){return a(i(t,t[o]))}},9711:(t,r,e)=>{var n=e(1702),i=0,o=Math.random(),a=n(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+a(++i+o,36)}},3307:(t,r,e)=>{var n=e(133);t.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},3353:(t,r,e)=>{var n=e(9781),i=e(7293);t.exports=n&&i((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},8053:(t,r,e)=>{var n=e(7854).TypeError;t.exports=function(t,r){if(t<r)throw n("Not enough arguments");return t}},6061:(t,r,e)=>{var n=e(5112);r.f=n},5112:(t,r,e)=>{var n=e(7854),i=e(2309),o=e(2597),a=e(9711),s=e(133),u=e(3307),f=i("wks"),c=n.Symbol,h=c&&c.for,l=u?c:c&&c.withoutSetter||a;t.exports=function(t){if(!o(f,t)||!s&&"string"!=typeof f[t]){var r="Symbol."+t;s&&o(c,t)?f[t]=c[t]:f[t]=u&&h?h(r):l(r)}return f[t]}},8264:(t,r,e)=>{"use strict";var n=e(2109),i=e(7854),o=e(3331),a=e(6340),s=o.ArrayBuffer;n({global:!0,constructor:!0,forced:i.ArrayBuffer!==s},{ArrayBuffer:s}),a("ArrayBuffer")},2222:(t,r,e)=>{"use strict";var n=e(2109),i=e(7854),o=e(7293),a=e(3157),s=e(111),u=e(7908),f=e(6244),c=e(6135),h=e(5417),l=e(1194),p=e(5112),v=e(7392),d=p("isConcatSpreadable"),g=9007199254740991,y="Maximum allowed index exceeded",m=i.TypeError,x=v>=51||!o((function(){var t=[];return t[d]=!1,t.concat()[0]!==t})),b=l("concat"),w=function(t){if(!s(t))return!1;var r=t[d];return void 0!==r?!!r:a(t)};n({target:"Array",proto:!0,arity:1,forced:!x||!b},{concat:function(t){var r,e,n,i,o,a=u(this),s=h(a,0),l=0;for(r=-1,n=arguments.length;r<n;r++)if(w(o=-1===r?a:arguments[r])){if(l+(i=f(o))>g)throw m(y);for(e=0;e<i;e++,l++)e in o&&c(s,l,o[e])}else{if(l>=g)throw m(y);c(s,l++,o)}return s.length=l,s}})},7327:(t,r,e)=>{"use strict";var n=e(2109),i=e(2092).filter;n({target:"Array",proto:!0,forced:!e(1194)("filter")},{filter:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}})},1038:(t,r,e)=>{var n=e(2109),i=e(8457);n({target:"Array",stat:!0,forced:!e(7072)((function(t){Array.from(t)}))},{from:i})},6992:(t,r,e)=>{"use strict";var n=e(5656),i=e(1223),o=e(7497),a=e(9909),s=e(3070).f,u=e(654),f=e(1913),c=e(9781),h="Array Iterator",l=a.set,p=a.getterFor(h);t.exports=u(Array,"Array",(function(t,r){l(this,{type:h,target:n(t),index:0,kind:r})}),(function(){var t=p(this),r=t.target,e=t.kind,n=t.index++;return!r||n>=r.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==e?{value:n,done:!1}:"values"==e?{value:r[n],done:!1}:{value:[n,r[n]],done:!1}}),"values");var v=o.Arguments=o.Array;if(i("keys"),i("values"),i("entries"),!f&&c&&"values"!==v.name)try{s(v,"name",{value:"values"})}catch(t){}},9600:(t,r,e)=>{"use strict";var n=e(2109),i=e(1702),o=e(8361),a=e(5656),s=e(9341),u=i([].join),f=o!=Object,c=s("join",",");n({target:"Array",proto:!0,forced:f||!c},{join:function(t){return u(a(this),void 0===t?",":t)}})},1249:(t,r,e)=>{"use strict";var n=e(2109),i=e(2092).map;n({target:"Array",proto:!0,forced:!e(1194)("map")},{map:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}})},7042:(t,r,e)=>{"use strict";var n=e(2109),i=e(7854),o=e(3157),a=e(4411),s=e(111),u=e(1400),f=e(6244),c=e(5656),h=e(6135),l=e(5112),p=e(1194),v=e(206),d=p("slice"),g=l("species"),y=i.Array,m=Math.max;n({target:"Array",proto:!0,forced:!d},{slice:function(t,r){var e,n,i,l=c(this),p=f(l),d=u(t,p),x=u(void 0===r?p:r,p);if(o(l)&&(e=l.constructor,(a(e)&&(e===y||o(e.prototype))||s(e)&&null===(e=e[g]))&&(e=void 0),e===y||void 0===e))return v(l,d,x);for(n=new(void 0===e?y:e)(m(x-d,0)),i=0;d<x;d++,i++)d in l&&h(n,i,l[d]);return n.length=i,n}})},2707:(t,r,e)=>{"use strict";var n=e(2109),i=e(1702),o=e(9662),a=e(7908),s=e(6244),u=e(1340),f=e(7293),c=e(4362),h=e(9341),l=e(8886),p=e(256),v=e(7392),d=e(8008),g=[],y=i(g.sort),m=i(g.push),x=f((function(){g.sort(void 0)})),b=f((function(){g.sort(null)})),w=h("sort"),S=!f((function(){if(v)return v<70;if(!(l&&l>3)){if(p)return!0;if(d)return d<603;var t,r,e,n,i="";for(t=65;t<76;t++){switch(r=String.fromCharCode(t),t){case 66:case 69:case 70:case 72:e=3;break;case 68:case 71:e=4;break;default:e=2}for(n=0;n<47;n++)g.push({k:r+n,v:e})}for(g.sort((function(t,r){return r.v-t.v})),n=0;n<g.length;n++)r=g[n].k.charAt(0),i.charAt(i.length-1)!==r&&(i+=r);return"DGBEFHACIJK"!==i}}));n({target:"Array",proto:!0,forced:x||!b||!w||!S},{sort:function(t){void 0!==t&&o(t);var r=a(this);if(S)return void 0===t?y(r):y(r,t);var e,n,i=[],f=s(r);for(n=0;n<f;n++)n in r&&m(i,r[n]);for(c(i,function(t){return function(r,e){return void 0===e?-1:void 0===r?1:void 0!==t?+t(r,e)||0:u(r)>u(e)?1:-1}}(t)),e=i.length,n=0;n<e;)r[n]=i[n++];for(;n<f;)delete r[n++];return r}})},8862:(t,r,e)=>{var n=e(2109),i=e(5005),o=e(2104),a=e(6916),s=e(1702),u=e(7293),f=e(3157),c=e(614),h=e(111),l=e(2190),p=e(206),v=e(133),d=i("JSON","stringify"),g=s(/./.exec),y=s("".charAt),m=s("".charCodeAt),x=s("".replace),b=s(1..toString),w=/[\uD800-\uDFFF]/g,S=/^[\uD800-\uDBFF]$/,_=/^[\uDC00-\uDFFF]$/,E=!v||u((function(){var t=i("Symbol")();return"[null]"!=d([t])||"{}"!=d({a:t})||"{}"!=d(Object(t))})),k=u((function(){return'"\\udf06\\ud834"'!==d("\udf06\ud834")||'"\\udead"'!==d("\udead")})),M=function(t,r){var e=p(arguments),n=r;if((h(r)||void 0!==t)&&!l(t))return f(r)||(r=function(t,r){if(c(n)&&(r=a(n,this,t,r)),!l(r))return r}),e[1]=r,o(d,null,e)},A=function(t,r,e){var n=y(e,r-1),i=y(e,r+1);return g(S,t)&&!g(_,i)||g(_,t)&&!g(S,n)?"\\u"+b(m(t,0),16):t};d&&n({target:"JSON",stat:!0,arity:3,forced:E||k},{stringify:function(t,r,e){var n=p(arguments),i=o(E?M:d,null,n);return k&&"string"==typeof i?x(i,w,A):i}})},9601:(t,r,e)=>{var n=e(2109),i=e(1574);n({target:"Object",stat:!0,arity:2,forced:Object.assign!==i},{assign:i})},9660:(t,r,e)=>{var n=e(2109),i=e(133),o=e(7293),a=e(5181),s=e(7908);n({target:"Object",stat:!0,forced:!i||o((function(){a.f(1)}))},{getOwnPropertySymbols:function(t){var r=a.f;return r?r(s(t)):[]}})},7941:(t,r,e)=>{var n=e(2109),i=e(7908),o=e(1956);n({target:"Object",stat:!0,forced:e(7293)((function(){o(1)}))},{keys:function(t){return o(i(t))}})},1539:(t,r,e)=>{var n=e(1694),i=e(8052),o=e(288);n||i(Object.prototype,"toString",o,{unsafe:!0})},821:(t,r,e)=>{"use strict";var n=e(2109),i=e(6916),o=e(9662),a=e(8523),s=e(2534),u=e(408);n({target:"Promise",stat:!0,forced:e(612)},{all:function(t){var r=this,e=a.f(r),n=e.resolve,f=e.reject,c=s((function(){var e=o(r.resolve),a=[],s=0,c=1;u(t,(function(t){var o=s++,u=!1;c++,i(e,r,t).then((function(t){u||(u=!0,a[o]=t,--c||n(a))}),f)})),--c||n(a)}));return c.error&&f(c.value),e.promise}})},4164:(t,r,e)=>{"use strict";var n=e(2109),i=e(1913),o=e(3702).CONSTRUCTOR,a=e(2492),s=e(5005),u=e(614),f=e(8052),c=a&&a.prototype;if(n({target:"Promise",proto:!0,forced:o,real:!0},{catch:function(t){return this.then(void 0,t)}}),!i&&u(a)){var h=s("Promise").prototype.catch;c.catch!==h&&f(c,"catch",h,{unsafe:!0})}},3401:(t,r,e)=>{"use strict";var n,i,o,a=e(2109),s=e(1913),u=e(5268),f=e(7854),c=e(6916),h=e(8052),l=e(7674),p=e(8003),v=e(6340),d=e(9662),g=e(614),y=e(111),m=e(5787),x=e(6707),b=e(261).set,w=e(5948),S=e(842),_=e(2534),E=e(8572),k=e(9909),M=e(2492),A=e(3702),P=e(8523),O="Promise",T=A.CONSTRUCTOR,R=A.REJECTION_EVENT,I=A.SUBCLASSING,j=k.getterFor(O),B=k.set,L=M&&M.prototype,N=M,Y=L,C=f.TypeError,F=f.document,X=f.process,U=P.f,D=U,G=!!(F&&F.createEvent&&f.dispatchEvent),z="unhandledrejection",q=function(t){var r;return!(!y(t)||!g(r=t.then))&&r},V=function(t,r){var e,n,i,o=r.value,a=1==r.state,s=a?t.ok:t.fail,u=t.resolve,f=t.reject,h=t.domain;try{s?(a||(2===r.rejection&&H(r),r.rejection=1),!0===s?e=o:(h&&h.enter(),e=s(o),h&&(h.exit(),i=!0)),e===t.promise?f(C("Promise-chain cycle")):(n=q(e))?c(n,e,u,f):u(e)):f(o)}catch(t){h&&!i&&h.exit(),f(t)}},W=function(t,r){t.notified||(t.notified=!0,w((function(){for(var e,n=t.reactions;e=n.get();)V(e,t);t.notified=!1,r&&!t.rejection&&$(t)})))},J=function(t,r,e){var n,i;G?((n=F.createEvent("Event")).promise=r,n.reason=e,n.initEvent(t,!1,!0),f.dispatchEvent(n)):n={promise:r,reason:e},!R&&(i=f["on"+t])?i(n):t===z&&S("Unhandled promise rejection",e)},$=function(t){c(b,f,(function(){var r,e=t.facade,n=t.value;if(K(t)&&(r=_((function(){u?X.emit("unhandledRejection",n,e):J(z,e,n)})),t.rejection=u||K(t)?2:1,r.error))throw r.value}))},K=function(t){return 1!==t.rejection&&!t.parent},H=function(t){c(b,f,(function(){var r=t.facade;u?X.emit("rejectionHandled",r):J("rejectionhandled",r,t.value)}))},Z=function(t,r,e){return function(n){t(r,n,e)}},Q=function(t,r,e){t.done||(t.done=!0,e&&(t=e),t.value=r,t.state=2,W(t,!0))},tt=function(t,r,e){if(!t.done){t.done=!0,e&&(t=e);try{if(t.facade===r)throw C("Promise can't be resolved itself");var n=q(r);n?w((function(){var e={done:!1};try{c(n,r,Z(tt,e,t),Z(Q,e,t))}catch(r){Q(e,r,t)}})):(t.value=r,t.state=1,W(t,!1))}catch(r){Q({done:!1},r,t)}}};if(T&&(Y=(N=function(t){m(this,Y),d(t),c(n,this);var r=j(this);try{t(Z(tt,r),Z(Q,r))}catch(t){Q(r,t)}}).prototype,(n=function(t){B(this,{type:O,done:!1,notified:!1,parent:!1,reactions:new E,rejection:!1,state:0,value:void 0})}).prototype=h(Y,"then",(function(t,r){var e=j(this),n=U(x(this,N));return e.parent=!0,n.ok=!g(t)||t,n.fail=g(r)&&r,n.domain=u?X.domain:void 0,0==e.state?e.reactions.add(n):w((function(){V(n,e)})),n.promise})),i=function(){var t=new n,r=j(t);this.promise=t,this.resolve=Z(tt,r),this.reject=Z(Q,r)},P.f=U=function(t){return t===N||void 0===t?new i(t):D(t)},!s&&g(M)&&L!==Object.prototype)){o=L.then,I||h(L,"then",(function(t,r){var e=this;return new N((function(t,r){c(o,e,t,r)})).then(t,r)}),{unsafe:!0});try{delete L.constructor}catch(t){}l&&l(L,Y)}a({global:!0,constructor:!0,wrap:!0,forced:T},{Promise:N}),p(N,O,!1,!0),v(O)},8674:(t,r,e)=>{e(3401),e(821),e(4164),e(6027),e(683),e(6294)},6027:(t,r,e)=>{"use strict";var n=e(2109),i=e(6916),o=e(9662),a=e(8523),s=e(2534),u=e(408);n({target:"Promise",stat:!0,forced:e(612)},{race:function(t){var r=this,e=a.f(r),n=e.reject,f=s((function(){var a=o(r.resolve);u(t,(function(t){i(a,r,t).then(e.resolve,n)}))}));return f.error&&n(f.value),e.promise}})},683:(t,r,e)=>{"use strict";var n=e(2109),i=e(6916),o=e(8523);n({target:"Promise",stat:!0,forced:e(3702).CONSTRUCTOR},{reject:function(t){var r=o.f(this);return i(r.reject,void 0,t),r.promise}})},6294:(t,r,e)=>{"use strict";var n=e(2109),i=e(5005),o=e(1913),a=e(2492),s=e(3702).CONSTRUCTOR,u=e(9478),f=i("Promise"),c=o&&!s;n({target:"Promise",stat:!0,forced:o||s},{resolve:function(t){return u(c&&this===f?a:this,t)}})},4916:(t,r,e)=>{"use strict";var n=e(2109),i=e(2261);n({target:"RegExp",proto:!0,forced:/./.exec!==i},{exec:i})},9714:(t,r,e)=>{"use strict";var n=e(6530).PROPER,i=e(8052),o=e(9670),a=e(1340),s=e(7293),u=e(4706),f="toString",c=RegExp.prototype.toString,h=s((function(){return"/a/b"!=c.call({source:"a",flags:"b"})})),l=n&&c.name!=f;(h||l)&&i(RegExp.prototype,f,(function(){var t=o(this);return"/"+a(t.source)+"/"+a(u(t))}),{unsafe:!0})},8783:(t,r,e)=>{"use strict";var n=e(8710).charAt,i=e(1340),o=e(9909),a=e(654),s="String Iterator",u=o.set,f=o.getterFor(s);a(String,"String",(function(t){u(this,{type:s,string:i(t),index:0})}),(function(){var t,r=f(this),e=r.string,i=r.index;return i>=e.length?{value:void 0,done:!0}:(t=n(e,i),r.index+=t.length,{value:t,done:!1})}))},4723:(t,r,e)=>{"use strict";var n=e(6916),i=e(7007),o=e(9670),a=e(7466),s=e(1340),u=e(4488),f=e(8173),c=e(1530),h=e(7651);i("match",(function(t,r,e){return[function(r){var e=u(this),i=null==r?void 0:f(r,t);return i?n(i,r,e):new RegExp(r)[t](s(e))},function(t){var n=o(this),i=s(t),u=e(r,n,i);if(u.done)return u.value;if(!n.global)return h(n,i);var f=n.unicode;n.lastIndex=0;for(var l,p=[],v=0;null!==(l=h(n,i));){var d=s(l[0]);p[v]=d,""===d&&(n.lastIndex=c(i,a(n.lastIndex),f)),v++}return 0===v?null:p}]}))},5306:(t,r,e)=>{"use strict";var n=e(2104),i=e(6916),o=e(1702),a=e(7007),s=e(7293),u=e(9670),f=e(614),c=e(9303),h=e(7466),l=e(1340),p=e(4488),v=e(1530),d=e(8173),g=e(647),y=e(7651),m=e(5112)("replace"),x=Math.max,b=Math.min,w=o([].concat),S=o([].push),_=o("".indexOf),E=o("".slice),k="$0"==="a".replace(/./,"$0"),M=!!/./[m]&&""===/./[m]("a","$0");a("replace",(function(t,r,e){var o=M?"$":"$0";return[function(t,e){var n=p(this),o=null==t?void 0:d(t,m);return o?i(o,t,n,e):i(r,l(n),t,e)},function(t,i){var a=u(this),s=l(t);if("string"==typeof i&&-1===_(i,o)&&-1===_(i,"$<")){var p=e(r,a,s,i);if(p.done)return p.value}var d=f(i);d||(i=l(i));var m=a.global;if(m){var k=a.unicode;a.lastIndex=0}for(var M=[];;){var A=y(a,s);if(null===A)break;if(S(M,A),!m)break;""===l(A[0])&&(a.lastIndex=v(s,h(a.lastIndex),k))}for(var P,O="",T=0,R=0;R<M.length;R++){for(var I=l((A=M[R])[0]),j=x(b(c(A.index),s.length),0),B=[],L=1;L<A.length;L++)S(B,void 0===(P=A[L])?P:String(P));var N=A.groups;if(d){var Y=w([I],B,j,s);void 0!==N&&S(Y,N);var C=l(n(i,void 0,Y))}else C=g(I,s,j,B,N,i);j>=T&&(O+=E(s,T,j)+C,T=j+I.length)}return O+E(s,T)}]}),!!s((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")}))||!k||M)},3123:(t,r,e)=>{"use strict";var n=e(2104),i=e(6916),o=e(1702),a=e(7007),s=e(7850),u=e(9670),f=e(4488),c=e(6707),h=e(1530),l=e(7466),p=e(1340),v=e(8173),d=e(1589),g=e(7651),y=e(2261),m=e(2999),x=e(7293),b=m.UNSUPPORTED_Y,w=4294967295,S=Math.min,_=[].push,E=o(/./.exec),k=o(_),M=o("".slice);a("split",(function(t,r,e){var o;return o="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,e){var o=p(f(this)),a=void 0===e?w:e>>>0;if(0===a)return[];if(void 0===t)return[o];if(!s(t))return i(r,o,t,a);for(var u,c,h,l=[],v=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),g=0,m=new RegExp(t.source,v+"g");(u=i(y,m,o))&&!((c=m.lastIndex)>g&&(k(l,M(o,g,u.index)),u.length>1&&u.index<o.length&&n(_,l,d(u,1)),h=u[0].length,g=c,l.length>=a));)m.lastIndex===u.index&&m.lastIndex++;return g===o.length?!h&&E(m,"")||k(l,""):k(l,M(o,g)),l.length>a?d(l,0,a):l}:"0".split(void 0,0).length?function(t,e){return void 0===t&&0===e?[]:i(r,this,t,e)}:r,[function(r,e){var n=f(this),a=null==r?void 0:v(r,t);return a?i(a,r,n,e):i(o,p(n),r,e)},function(t,n){var i=u(this),a=p(t),s=e(o,i,a,n,o!==r);if(s.done)return s.value;var f=c(i,RegExp),v=i.unicode,d=(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.unicode?"u":"")+(b?"g":"y"),y=new f(b?"^(?:"+i.source+")":i,d),m=void 0===n?w:n>>>0;if(0===m)return[];if(0===a.length)return null===g(y,a)?[a]:[];for(var x=0,_=0,E=[];_<a.length;){y.lastIndex=b?0:_;var A,P=g(y,b?M(a,_):a);if(null===P||(A=S(l(y.lastIndex+(b?_:0)),a.length))===x)_=h(a,_,v);else{if(k(E,M(a,x,_)),E.length===m)return E;for(var O=1;O<=P.length-1;O++)if(k(E,P[O]),E.length===m)return E;_=x=A}}return k(E,M(a,x)),E}]}),!!x((function(){var t=/(?:)/,r=t.exec;t.exec=function(){return r.apply(this,arguments)};var e="ab".split(t);return 2!==e.length||"a"!==e[0]||"b"!==e[1]})),b)},4032:(t,r,e)=>{"use strict";var n=e(2109),i=e(7854),o=e(6916),a=e(1702),s=e(1913),u=e(9781),f=e(133),c=e(7293),h=e(2597),l=e(7976),p=e(9670),v=e(5656),d=e(4948),g=e(1340),y=e(9114),m=e(30),x=e(1956),b=e(8006),w=e(1156),S=e(5181),_=e(1236),E=e(3070),k=e(6048),M=e(5296),A=e(8052),P=e(2309),O=e(6200),T=e(3501),R=e(9711),I=e(5112),j=e(6061),B=e(7235),L=e(6532),N=e(8003),Y=e(9909),C=e(2092).forEach,F=O("hidden"),X="Symbol",U=Y.set,D=Y.getterFor(X),G=Object.prototype,z=i.Symbol,q=z&&z.prototype,V=i.TypeError,W=i.QObject,J=_.f,$=E.f,K=w.f,H=M.f,Z=a([].push),Q=P("symbols"),tt=P("op-symbols"),rt=P("wks"),et=!W||!W.prototype||!W.prototype.findChild,nt=u&&c((function(){return 7!=m($({},"a",{get:function(){return $(this,"a",{value:7}).a}})).a}))?function(t,r,e){var n=J(G,r);n&&delete G[r],$(t,r,e),n&&t!==G&&$(G,r,n)}:$,it=function(t,r){var e=Q[t]=m(q);return U(e,{type:X,tag:t,description:r}),u||(e.description=r),e},ot=function(t,r,e){t===G&&ot(tt,r,e),p(t);var n=d(r);return p(e),h(Q,n)?(e.enumerable?(h(t,F)&&t[F][n]&&(t[F][n]=!1),e=m(e,{enumerable:y(0,!1)})):(h(t,F)||$(t,F,y(1,{})),t[F][n]=!0),nt(t,n,e)):$(t,n,e)},at=function(t,r){p(t);var e=v(r),n=x(e).concat(ct(e));return C(n,(function(r){u&&!o(st,e,r)||ot(t,r,e[r])})),t},st=function(t){var r=d(t),e=o(H,this,r);return!(this===G&&h(Q,r)&&!h(tt,r))&&(!(e||!h(this,r)||!h(Q,r)||h(this,F)&&this[F][r])||e)},ut=function(t,r){var e=v(t),n=d(r);if(e!==G||!h(Q,n)||h(tt,n)){var i=J(e,n);return!i||!h(Q,n)||h(e,F)&&e[F][n]||(i.enumerable=!0),i}},ft=function(t){var r=K(v(t)),e=[];return C(r,(function(t){h(Q,t)||h(T,t)||Z(e,t)})),e},ct=function(t){var r=t===G,e=K(r?tt:v(t)),n=[];return C(e,(function(t){!h(Q,t)||r&&!h(G,t)||Z(n,Q[t])})),n};f||(A(q=(z=function(){if(l(q,this))throw V("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?g(arguments[0]):void 0,r=R(t),e=function(t){this===G&&o(e,tt,t),h(this,F)&&h(this[F],r)&&(this[F][r]=!1),nt(this,r,y(1,t))};return u&&et&&nt(G,r,{configurable:!0,set:e}),it(r,t)}).prototype,"toString",(function(){return D(this).tag})),A(z,"withoutSetter",(function(t){return it(R(t),t)})),M.f=st,E.f=ot,k.f=at,_.f=ut,b.f=w.f=ft,S.f=ct,j.f=function(t){return it(I(t),t)},u&&($(q,"description",{configurable:!0,get:function(){return D(this).description}}),s||A(G,"propertyIsEnumerable",st,{unsafe:!0}))),n({global:!0,constructor:!0,wrap:!0,forced:!f,sham:!f},{Symbol:z}),C(x(rt),(function(t){B(t)})),n({target:X,stat:!0,forced:!f},{useSetter:function(){et=!0},useSimple:function(){et=!1}}),n({target:"Object",stat:!0,forced:!f,sham:!u},{create:function(t,r){return void 0===r?m(t):at(m(t),r)},defineProperty:ot,defineProperties:at,getOwnPropertyDescriptor:ut}),n({target:"Object",stat:!0,forced:!f},{getOwnPropertyNames:ft}),L(),N(z,X),T[F]=!0},1817:(t,r,e)=>{"use strict";var n=e(2109),i=e(9781),o=e(7854),a=e(1702),s=e(2597),u=e(614),f=e(7976),c=e(1340),h=e(3070).f,l=e(9920),p=o.Symbol,v=p&&p.prototype;if(i&&u(p)&&(!("description"in v)||void 0!==p().description)){var d={},g=function(){var t=arguments.length<1||void 0===arguments[0]?void 0:c(arguments[0]),r=f(v,this)?new p(t):void 0===t?p():p(t);return""===t&&(d[r]=!0),r};l(g,p),g.prototype=v,v.constructor=g;var y="Symbol(test)"==String(p("test")),m=a(v.toString),x=a(v.valueOf),b=/^Symbol\((.*)\)[^)]+$/,w=a("".replace),S=a("".slice);h(v,"description",{configurable:!0,get:function(){var t=x(this),r=m(t);if(s(d,t))return"";var e=y?S(r,7,-1):w(r,b,"$1");return""===e?void 0:e}}),n({global:!0,constructor:!0,forced:!0},{Symbol:g})}},763:(t,r,e)=>{var n=e(2109),i=e(5005),o=e(2597),a=e(1340),s=e(2309),u=e(735),f=s("string-to-symbol-registry"),c=s("symbol-to-string-registry");n({target:"Symbol",stat:!0,forced:!u},{for:function(t){var r=a(t);if(o(f,r))return f[r];var e=i("Symbol")(r);return f[r]=e,c[e]=r,e}})},2165:(t,r,e)=>{e(7235)("iterator")},2526:(t,r,e)=>{e(4032),e(763),e(6620),e(8862),e(9660)},6620:(t,r,e)=>{var n=e(2109),i=e(2597),o=e(2190),a=e(6330),s=e(2309),u=e(735),f=s("symbol-to-string-registry");n({target:"Symbol",stat:!0,forced:!u},{keyFor:function(t){if(!o(t))throw TypeError(a(t)+" is not a symbol");if(i(f,t))return f[t]}})},2990:(t,r,e)=>{"use strict";var n=e(1702),i=e(260),o=n(e(1048)),a=i.aTypedArray;(0,i.exportTypedArrayMethod)("copyWithin",(function(t,r){return o(a(this),t,r,arguments.length>2?arguments[2]:void 0)}))},8927:(t,r,e)=>{"use strict";var n=e(260),i=e(2092).every,o=n.aTypedArray;(0,n.exportTypedArrayMethod)("every",(function(t){return i(o(this),t,arguments.length>1?arguments[1]:void 0)}))},3105:(t,r,e)=>{"use strict";var n=e(260),i=e(6916),o=e(1285),a=n.aTypedArray;(0,n.exportTypedArrayMethod)("fill",(function(t){var r=arguments.length;return i(o,a(this),t,r>1?arguments[1]:void 0,r>2?arguments[2]:void 0)}))},5035:(t,r,e)=>{"use strict";var n=e(260),i=e(2092).filter,o=e(3074),a=n.aTypedArray;(0,n.exportTypedArrayMethod)("filter",(function(t){var r=i(a(this),t,arguments.length>1?arguments[1]:void 0);return o(this,r)}))},7174:(t,r,e)=>{"use strict";var n=e(260),i=e(2092).findIndex,o=n.aTypedArray;(0,n.exportTypedArrayMethod)("findIndex",(function(t){return i(o(this),t,arguments.length>1?arguments[1]:void 0)}))},4345:(t,r,e)=>{"use strict";var n=e(260),i=e(2092).find,o=n.aTypedArray;(0,n.exportTypedArrayMethod)("find",(function(t){return i(o(this),t,arguments.length>1?arguments[1]:void 0)}))},6495:(t,r,e)=>{e(9843)("Float64",(function(t){return function(r,e,n){return t(this,r,e,n)}}))},2846:(t,r,e)=>{"use strict";var n=e(260),i=e(2092).forEach,o=n.aTypedArray;(0,n.exportTypedArrayMethod)("forEach",(function(t){i(o(this),t,arguments.length>1?arguments[1]:void 0)}))},4731:(t,r,e)=>{"use strict";var n=e(260),i=e(1318).includes,o=n.aTypedArray;(0,n.exportTypedArrayMethod)("includes",(function(t){return i(o(this),t,arguments.length>1?arguments[1]:void 0)}))},7209:(t,r,e)=>{"use strict";var n=e(260),i=e(1318).indexOf,o=n.aTypedArray;(0,n.exportTypedArrayMethod)("indexOf",(function(t){return i(o(this),t,arguments.length>1?arguments[1]:void 0)}))},6319:(t,r,e)=>{"use strict";var n=e(7854),i=e(7293),o=e(1702),a=e(260),s=e(6992),u=e(5112)("iterator"),f=n.Uint8Array,c=o(s.values),h=o(s.keys),l=o(s.entries),p=a.aTypedArray,v=a.exportTypedArrayMethod,d=f&&f.prototype,g=!i((function(){d[u].call([1])})),y=!!d&&d.values&&d[u]===d.values&&"values"===d.values.name,m=function(){return c(p(this))};v("entries",(function(){return l(p(this))}),g),v("keys",(function(){return h(p(this))}),g),v("values",m,g||!y,{name:"values"}),v(u,m,g||!y,{name:"values"})},8867:(t,r,e)=>{"use strict";var n=e(260),i=e(1702),o=n.aTypedArray,a=n.exportTypedArrayMethod,s=i([].join);a("join",(function(t){return s(o(this),t)}))},7789:(t,r,e)=>{"use strict";var n=e(260),i=e(2104),o=e(6583),a=n.aTypedArray;(0,n.exportTypedArrayMethod)("lastIndexOf",(function(t){var r=arguments.length;return i(o,a(this),r>1?[t,arguments[1]]:[t])}))},3739:(t,r,e)=>{"use strict";var n=e(260),i=e(2092).map,o=e(6304),a=n.aTypedArray;(0,n.exportTypedArrayMethod)("map",(function(t){return i(a(this),t,arguments.length>1?arguments[1]:void 0,(function(t,r){return new(o(t))(r)}))}))},4483:(t,r,e)=>{"use strict";var n=e(260),i=e(3671).right,o=n.aTypedArray;(0,n.exportTypedArrayMethod)("reduceRight",(function(t){var r=arguments.length;return i(o(this),t,r,r>1?arguments[1]:void 0)}))},9368:(t,r,e)=>{"use strict";var n=e(260),i=e(3671).left,o=n.aTypedArray;(0,n.exportTypedArrayMethod)("reduce",(function(t){var r=arguments.length;return i(o(this),t,r,r>1?arguments[1]:void 0)}))},2056:(t,r,e)=>{"use strict";var n=e(260),i=n.aTypedArray,o=n.exportTypedArrayMethod,a=Math.floor;o("reverse",(function(){for(var t,r=this,e=i(r).length,n=a(e/2),o=0;o<n;)t=r[o],r[o++]=r[--e],r[e]=t;return r}))},3462:(t,r,e)=>{"use strict";var n=e(7854),i=e(6916),o=e(260),a=e(6244),s=e(4590),u=e(7908),f=e(7293),c=n.RangeError,h=n.Int8Array,l=h&&h.prototype,p=l&&l.set,v=o.aTypedArray,d=o.exportTypedArrayMethod,g=!f((function(){var t=new Uint8ClampedArray(2);return i(p,t,{length:1,0:3},1),3!==t[1]})),y=g&&o.NATIVE_ARRAY_BUFFER_VIEWS&&f((function(){var t=new h(2);return t.set(1),t.set("2",1),0!==t[0]||2!==t[1]}));d("set",(function(t){v(this);var r=s(arguments.length>1?arguments[1]:void 0,1),e=u(t);if(g)return i(p,this,e,r);var n=this.length,o=a(e),f=0;if(o+r>n)throw c("Wrong length");for(;f<o;)this[r+f]=e[f++]}),!g||y)},678:(t,r,e)=>{"use strict";var n=e(260),i=e(6304),o=e(7293),a=e(206),s=n.aTypedArray;(0,n.exportTypedArrayMethod)("slice",(function(t,r){for(var e=a(s(this),t,r),n=i(this),o=0,u=e.length,f=new n(u);u>o;)f[o]=e[o++];return f}),o((function(){new Int8Array(1).slice()})))},7462:(t,r,e)=>{"use strict";var n=e(260),i=e(2092).some,o=n.aTypedArray;(0,n.exportTypedArrayMethod)("some",(function(t){return i(o(this),t,arguments.length>1?arguments[1]:void 0)}))},3824:(t,r,e)=>{"use strict";var n=e(7854),i=e(1702),o=e(7293),a=e(9662),s=e(4362),u=e(260),f=e(8886),c=e(256),h=e(7392),l=e(8008),p=u.aTypedArray,v=u.exportTypedArrayMethod,d=n.Uint16Array,g=d&&i(d.prototype.sort),y=!(!g||o((function(){g(new d(2),null)}))&&o((function(){g(new d(2),{})}))),m=!!g&&!o((function(){if(h)return h<74;if(f)return f<67;if(c)return!0;if(l)return l<602;var t,r,e=new d(516),n=Array(516);for(t=0;t<516;t++)r=t%4,e[t]=515-t,n[t]=t-2*r+3;for(g(e,(function(t,r){return(t/4|0)-(r/4|0)})),t=0;t<516;t++)if(e[t]!==n[t])return!0}));v("sort",(function(t){return void 0!==t&&a(t),m?g(this,t):s(p(this),function(t){return function(r,e){return void 0!==t?+t(r,e)||0:e!=e?-1:r!=r?1:0===r&&0===e?1/r>0&&1/e<0?1:-1:r>e}}(t))}),!m||y)},5021:(t,r,e)=>{"use strict";var n=e(260),i=e(7466),o=e(1400),a=e(6304),s=n.aTypedArray;(0,n.exportTypedArrayMethod)("subarray",(function(t,r){var e=s(this),n=e.length,u=o(t,n);return new(a(e))(e.buffer,e.byteOffset+u*e.BYTES_PER_ELEMENT,i((void 0===r?n:o(r,n))-u))}))},2974:(t,r,e)=>{"use strict";var n=e(7854),i=e(2104),o=e(260),a=e(7293),s=e(206),u=n.Int8Array,f=o.aTypedArray,c=o.exportTypedArrayMethod,h=[].toLocaleString,l=!!u&&a((function(){h.call(new u(1))}));c("toLocaleString",(function(){return i(h,l?s(f(this)):f(this),s(arguments))}),a((function(){return[1,2].toLocaleString()!=new u([1,2]).toLocaleString()}))||!a((function(){u.prototype.toLocaleString.call([1,2])})))},5016:(t,r,e)=>{"use strict";var n=e(260).exportTypedArrayMethod,i=e(7293),o=e(7854),a=e(1702),s=o.Uint8Array,u=s&&s.prototype||{},f=[].toString,c=a([].join);i((function(){f.call({})}))&&(f=function(){return c(this)});var h=u.toString!=f;n("toString",f,h)},9135:(t,r,e)=>{e(9843)("Uint32",(function(t){return function(r,e,n){return t(this,r,e,n)}}))},3948:(t,r,e)=>{var n=e(7854),i=e(8324),o=e(8509),a=e(6992),s=e(8880),u=e(5112),f=u("iterator"),c=u("toStringTag"),h=a.values,l=function(t,r){if(t){if(t[f]!==h)try{s(t,f,h)}catch(r){t[f]=h}if(t[c]||s(t,c,r),i[r])for(var e in a)if(t[e]!==a[e])try{s(t,e,a[e])}catch(r){t[e]=a[e]}}};for(var p in i)l(n[p]&&n[p].prototype,p);l(o,"DOMTokenList")},1787:(t,r,e)=>{var n=e(4056),i=e(4102),o=e(1540),a=e(9705).Z,s=o.featureEach,u=(o.coordEach,i.polygon,i.featureCollection);function f(t){var r=new n(t);return r.insert=function(t){if("Feature"!==t.type)throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:a(t),n.prototype.insert.call(this,t)},r.load=function(t){var r=[];return Array.isArray(t)?t.forEach((function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox?t.bbox:a(t),r.push(t)})):s(t,(function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox?t.bbox:a(t),r.push(t)})),n.prototype.load.call(this,r)},r.remove=function(t,r){if("Feature"!==t.type)throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:a(t),n.prototype.remove.call(this,t,r)},r.clear=function(){return n.prototype.clear.call(this)},r.search=function(t){var r=n.prototype.search.call(this,this.toBBox(t));return u(r)},r.collides=function(t){return n.prototype.collides.call(this,this.toBBox(t))},r.all=function(){var t=n.prototype.all.call(this);return u(t)},r.toJSON=function(){return n.prototype.toJSON.call(this)},r.fromJSON=function(t){return n.prototype.fromJSON.call(this,t)},r.toBBox=function(t){var r;if(t.bbox)r=t.bbox;else if(Array.isArray(t)&&4===t.length)r=t;else if(Array.isArray(t)&&6===t.length)r=[t[0],t[1],t[3],t[4]];else if("Feature"===t.type)r=a(t);else{if("FeatureCollection"!==t.type)throw new Error("invalid geojson");r=a(t)}return{minX:r[0],minY:r[1],maxX:r[2],maxY:r[3]}},r}t.exports=f,t.exports.default=f},4056:function(t){t.exports=function(){"use strict";function t(t,n,i,o,a){!function t(e,n,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,u=n-i+1,f=Math.log(s),c=.5*Math.exp(2*f/3),h=.5*Math.sqrt(f*c*(s-c)/s)*(u-s/2<0?-1:1);t(e,n,Math.max(i,Math.floor(n-u*c/s+h)),Math.min(o,Math.floor(n+(s-u)*c/s+h)),a)}var l=e[n],p=i,v=o;for(r(e,i,n),a(e[o],l)>0&&r(e,i,o);p<v;){for(r(e,p,v),p++,v--;a(e[p],l)<0;)p++;for(;a(e[v],l)>0;)v--}0===a(e[i],l)?r(e,i,v):r(e,++v,o),v<=n&&(i=v+1),n<=v&&(o=v-1)}}(t,n,i||0,o||t.length-1,a||e)}function r(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function e(t,r){return t<r?-1:t>r?1:0}var n=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function i(t,r,e){if(!e)return r.indexOf(t);for(var n=0;n<r.length;n++)if(e(t,r[n]))return n;return-1}function o(t,r){a(t,0,t.children.length,r,t)}function a(t,r,e,n,i){i||(i=v(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o=r;o<e;o++){var a=t.children[o];s(i,t.leaf?n(a):a)}return i}function s(t,r){return t.minX=Math.min(t.minX,r.minX),t.minY=Math.min(t.minY,r.minY),t.maxX=Math.max(t.maxX,r.maxX),t.maxY=Math.max(t.maxY,r.maxY),t}function u(t,r){return t.minX-r.minX}function f(t,r){return t.minY-r.minY}function c(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function h(t){return t.maxX-t.minX+(t.maxY-t.minY)}function l(t,r){return t.minX<=r.minX&&t.minY<=r.minY&&r.maxX<=t.maxX&&r.maxY<=t.maxY}function p(t,r){return r.minX<=t.maxX&&r.minY<=t.maxY&&r.maxX>=t.minX&&r.maxY>=t.minY}function v(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function d(r,e,n,i,o){for(var a=[e,n];a.length;)if(!((n=a.pop())-(e=a.pop())<=i)){var s=e+Math.ceil((n-e)/i/2)*i;t(r,s,e,n,o),a.push(e,s,s,n)}}return n.prototype.all=function(){return this._all(this.data,[])},n.prototype.search=function(t){var r=this.data,e=[];if(!p(t,r))return e;for(var n=this.toBBox,i=[];r;){for(var o=0;o<r.children.length;o++){var a=r.children[o],s=r.leaf?n(a):a;p(t,s)&&(r.leaf?e.push(a):l(t,s)?this._all(a,e):i.push(a))}r=i.pop()}return e},n.prototype.collides=function(t){var r=this.data;if(!p(t,r))return!1;for(var e=[];r;){for(var n=0;n<r.children.length;n++){var i=r.children[n],o=r.leaf?this.toBBox(i):i;if(p(t,o)){if(r.leaf||l(t,o))return!0;e.push(i)}}r=e.pop()}return!1},n.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var r=0;r<t.length;r++)this.insert(t[r]);return this}var e=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(this.data.height<e.height){var n=this.data;this.data=e,e=n}this._insert(e,this.data.height-e.height-1,!0)}else this.data=e;return this},n.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},n.prototype.clear=function(){return this.data=v([]),this},n.prototype.remove=function(t,r){if(!t)return this;for(var e,n,o,a=this.data,s=this.toBBox(t),u=[],f=[];a||u.length;){if(a||(a=u.pop(),n=u[u.length-1],e=f.pop(),o=!0),a.leaf){var c=i(t,a.children,r);if(-1!==c)return a.children.splice(c,1),u.push(a),this._condense(u),this}o||a.leaf||!l(a,s)?n?(e++,a=n.children[e],o=!1):a=null:(u.push(a),f.push(e),e=0,n=a,a=a.children[0])}return this},n.prototype.toBBox=function(t){return t},n.prototype.compareMinX=function(t,r){return t.minX-r.minX},n.prototype.compareMinY=function(t,r){return t.minY-r.minY},n.prototype.toJSON=function(){return this.data},n.prototype.fromJSON=function(t){return this.data=t,this},n.prototype._all=function(t,r){for(var e=[];t;)t.leaf?r.push.apply(r,t.children):e.push.apply(e,t.children),t=e.pop();return r},n.prototype._build=function(t,r,e,n){var i,a=e-r+1,s=this._maxEntries;if(a<=s)return o(i=v(t.slice(r,e+1)),this.toBBox),i;n||(n=Math.ceil(Math.log(a)/Math.log(s)),s=Math.ceil(a/Math.pow(s,n-1))),(i=v([])).leaf=!1,i.height=n;var u=Math.ceil(a/s),f=u*Math.ceil(Math.sqrt(s));d(t,r,e,f,this.compareMinX);for(var c=r;c<=e;c+=f){var h=Math.min(c+f-1,e);d(t,c,h,u,this.compareMinY);for(var l=c;l<=h;l+=u){var p=Math.min(l+u-1,h);i.children.push(this._build(t,l,p,n-1))}}return o(i,this.toBBox),i},n.prototype._chooseSubtree=function(t,r,e,n){for(;n.push(r),!r.leaf&&n.length-1!==e;){for(var i=1/0,o=1/0,a=void 0,s=0;s<r.children.length;s++){var u=r.children[s],f=c(u),h=(l=t,p=u,(Math.max(p.maxX,l.maxX)-Math.min(p.minX,l.minX))*(Math.max(p.maxY,l.maxY)-Math.min(p.minY,l.minY))-f);h<o?(o=h,i=f<i?f:i,a=u):h===o&&f<i&&(i=f,a=u)}r=a||r.children[0]}var l,p;return r},n.prototype._insert=function(t,r,e){var n=e?t:this.toBBox(t),i=[],o=this._chooseSubtree(n,this.data,r,i);for(o.children.push(t),s(o,n);r>=0&&i[r].children.length>this._maxEntries;)this._split(i,r),r--;this._adjustParentBBoxes(n,i,r)},n.prototype._split=function(t,r){var e=t[r],n=e.children.length,i=this._minEntries;this._chooseSplitAxis(e,i,n);var a=this._chooseSplitIndex(e,i,n),s=v(e.children.splice(a,e.children.length-a));s.height=e.height,s.leaf=e.leaf,o(e,this.toBBox),o(s,this.toBBox),r?t[r-1].children.push(s):this._splitRoot(e,s)},n.prototype._splitRoot=function(t,r){this.data=v([t,r]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},n.prototype._chooseSplitIndex=function(t,r,e){for(var n,i,o,s,u,f,h,l=1/0,p=1/0,v=r;v<=e-r;v++){var d=a(t,0,v,this.toBBox),g=a(t,v,e,this.toBBox),y=(i=d,o=g,void 0,void 0,void 0,void 0,s=Math.max(i.minX,o.minX),u=Math.max(i.minY,o.minY),f=Math.min(i.maxX,o.maxX),h=Math.min(i.maxY,o.maxY),Math.max(0,f-s)*Math.max(0,h-u)),m=c(d)+c(g);y<l?(l=y,n=v,p=m<p?m:p):y===l&&m<p&&(p=m,n=v)}return n||e-r},n.prototype._chooseSplitAxis=function(t,r,e){var n=t.leaf?this.compareMinX:u,i=t.leaf?this.compareMinY:f;this._allDistMargin(t,r,e,n)<this._allDistMargin(t,r,e,i)&&t.children.sort(n)},n.prototype._allDistMargin=function(t,r,e,n){t.children.sort(n);for(var i=this.toBBox,o=a(t,0,r,i),u=a(t,e-r,e,i),f=h(o)+h(u),c=r;c<e-r;c++){var l=t.children[c];s(o,t.leaf?i(l):l),f+=h(o)}for(var p=e-r-1;p>=r;p--){var v=t.children[p];s(u,t.leaf?i(v):v),f+=h(u)}return f},n.prototype._adjustParentBBoxes=function(t,r,e){for(var n=e;n>=0;n--)s(r[n],t)},n.prototype._condense=function(t){for(var r=t.length-1,e=void 0;r>=0;r--)0===t[r].children.length?r>0?(e=t[r-1].children).splice(e.indexOf(t[r]),1):this.clear():o(t[r],this.toBBox)},n}()},1895:t=>{t.exports=function(t,r,e,n){var i=t[0],o=t[1],a=!1;void 0===e&&(e=0),void 0===n&&(n=r.length);for(var s=(n-e)/2,u=0,f=s-1;u<s;f=u++){var c=r[e+2*u+0],h=r[e+2*u+1],l=r[e+2*f+0],p=r[e+2*f+1];h>o!=p>o&&i<(l-c)*(o-h)/(p-h)+c&&(a=!a)}return a}},6960:(t,r,e)=>{var n=e(1895),i=e(8139);t.exports=function(t,r,e,o){return r.length>0&&Array.isArray(r[0])?i(t,r,e,o):n(t,r,e,o)},t.exports.nested=i,t.exports.flat=n},8139:t=>{t.exports=function(t,r,e,n){var i=t[0],o=t[1],a=!1;void 0===e&&(e=0),void 0===n&&(n=r.length);for(var s=n-e,u=0,f=s-1;u<s;f=u++){var c=r[u+e][0],h=r[u+e][1],l=r[f+e][0],p=r[f+e][1];h>o!=p>o&&i<(l-c)*(o-h)/(p-h)+c&&(a=!a)}return a}},2676:function(t){t.exports=function(){"use strict";function t(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function r(t,r){for(var e=0;e<r.length;e++){var n=r[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function e(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}var n=function(t,r){this.next=null,this.key=t,this.data=r,this.left=null,this.right=null};function i(t,r){return t>r?1:t<r?-1:0}function o(t,r,e){for(var i=new n(null,null),o=i,a=i;;){var s=e(t,r.key);if(s<0){if(null===r.left)break;if(e(t,r.left.key)<0){var u=r.left;if(r.left=u.right,u.right=r,null===(r=u).left)break}a.left=r,a=r,r=r.left}else{if(!(s>0))break;if(null===r.right)break;if(e(t,r.right.key)>0&&(u=r.right,r.right=u.left,u.left=r,null===(r=u).right))break;o.right=r,o=r,r=r.right}}return o.right=r.left,a.left=r.right,r.left=i.right,r.right=i.left,r}function a(t,r,e,i){var a=new n(t,r);if(null===e)return a.left=a.right=null,a;var s=i(t,(e=o(t,e,i)).key);return s<0?(a.left=e.left,a.right=e,e.left=null):s>=0&&(a.right=e.right,a.left=e,e.right=null),a}function s(t,r,e){var n=null,i=null;if(r){var a=e((r=o(t,r,e)).key,t);0===a?(n=r.left,i=r.right):a<0?(i=r.right,r.right=null,n=r):(n=r.left,r.left=null,i=r)}return{left:n,right:i}}function u(t,r,e,n,i){if(t){n(r+(e?"└── ":"├── ")+i(t)+"\n");var o=r+(e?" ":"│ ");t.left&&u(t.left,o,!1,n,i),t.right&&u(t.right,o,!0,n,i)}}var f=function(){function t(t){void 0===t&&(t=i),this._root=null,this._size=0,this._comparator=t}return t.prototype.insert=function(t,r){return this._size++,this._root=a(t,r,this._root,this._comparator)},t.prototype.add=function(t,r){var e=new n(t,r);null===this._root&&(e.left=e.right=null,this._size++,this._root=e);var i=this._comparator,a=o(t,this._root,i),s=i(t,a.key);return 0===s?this._root=a:(s<0?(e.left=a.left,e.right=a,a.left=null):s>0&&(e.right=a.right,e.left=a,a.right=null),this._size++,this._root=e),this._root},t.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},t.prototype._remove=function(t,r,e){var n;return null===r?null:0===e(t,(r=o(t,r,e)).key)?(null===r.left?n=r.right:(n=o(t,r.left,e)).right=r.right,this._size--,n):r},t.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=o(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},t.prototype.findStatic=function(t){for(var r=this._root,e=this._comparator;r;){var n=e(t,r.key);if(0===n)return r;r=n<0?r.left:r.right}return null},t.prototype.find=function(t){return this._root&&(this._root=o(t,this._root,this._comparator),0!==this._comparator(t,this._root.key))?null:this._root},t.prototype.contains=function(t){for(var r=this._root,e=this._comparator;r;){var n=e(t,r.key);if(0===n)return!0;r=n<0?r.left:r.right}return!1},t.prototype.forEach=function(t,r){for(var e=this._root,n=[],i=!1;!i;)null!==e?(n.push(e),e=e.left):0!==n.length?(e=n.pop(),t.call(r,e),e=e.right):i=!0;return this},t.prototype.range=function(t,r,e,n){for(var i=[],o=this._comparator,a=this._root;0!==i.length||a;)if(a)i.push(a),a=a.left;else{if(o((a=i.pop()).key,r)>0)break;if(o(a.key,t)>=0&&e.call(n,a))return this;a=a.right}return this},t.prototype.keys=function(){var t=[];return this.forEach((function(r){var e=r.key;return t.push(e)})),t},t.prototype.values=function(){var t=[];return this.forEach((function(r){var e=r.data;return t.push(e)})),t},t.prototype.min=function(){return this._root?this.minNode(this._root).key:null},t.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},t.prototype.minNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.left;)t=t.left;return t},t.prototype.maxNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.right;)t=t.right;return t},t.prototype.at=function(t){for(var r=this._root,e=!1,n=0,i=[];!e;)if(r)i.push(r),r=r.left;else if(i.length>0){if(r=i.pop(),n===t)return r;n++,r=r.right}else e=!0;return null},t.prototype.next=function(t){var r=this._root,e=null;if(t.right){for(e=t.right;e.left;)e=e.left;return e}for(var n=this._comparator;r;){var i=n(t.key,r.key);if(0===i)break;i<0?(e=r,r=r.left):r=r.right}return e},t.prototype.prev=function(t){var r=this._root,e=null;if(null!==t.left){for(e=t.left;e.right;)e=e.right;return e}for(var n=this._comparator;r;){var i=n(t.key,r.key);if(0===i)break;i<0?r=r.left:(e=r,r=r.right)}return e},t.prototype.clear=function(){return this._root=null,this._size=0,this},t.prototype.toList=function(){return function(t){for(var r=t,e=[],i=!1,o=new n(null,null),a=o;!i;)r?(e.push(r),r=r.left):e.length>0?r=(r=a=a.next=e.pop()).right:i=!0;return a.next=null,o.next}(this._root)},t.prototype.load=function(t,r,e){void 0===r&&(r=[]),void 0===e&&(e=!1);var i=t.length,o=this._comparator;if(e&&l(t,r,0,i-1,o),null===this._root)this._root=c(t,r,0,i),this._size=i;else{var a=function(t,r,e){for(var i=new n(null,null),o=i,a=t,s=r;null!==a&&null!==s;)e(a.key,s.key)<0?(o.next=a,a=a.next):(o.next=s,s=s.next),o=o.next;return null!==a?o.next=a:null!==s&&(o.next=s),i.next}(this.toList(),function(t,r){for(var e=new n(null,null),i=e,o=0;o<t.length;o++)i=i.next=new n(t[o],r[o]);return i.next=null,e.next}(t,r),o);i=this._size+i,this._root=h({head:a},0,i)}return this},t.prototype.isEmpty=function(){return null===this._root},Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),t.prototype.toString=function(t){void 0===t&&(t=function(t){return String(t.key)});var r=[];return u(this._root,"",!0,(function(t){return r.push(t)}),t),r.join("")},t.prototype.update=function(t,r,e){var n=this._comparator,i=s(t,this._root,n),u=i.left,f=i.right;n(t,r)<0?f=a(r,e,f,n):u=a(r,e,u,n),this._root=function(t,r,e){return null===r?t:(null===t||((r=o(t.key,r,e)).left=t),r)}(u,f,n)},t.prototype.split=function(t){return s(t,this._root,this._comparator)},t}();function c(t,r,e,i){var o=i-e;if(o>0){var a=e+Math.floor(o/2),s=t[a],u=r[a],f=new n(s,u);return f.left=c(t,r,e,a),f.right=c(t,r,a+1,i),f}return null}function h(t,r,e){var n=e-r;if(n>0){var i=r+Math.floor(n/2),o=h(t,r,i),a=t.head;return a.left=o,t.head=t.head.next,a.right=h(t,i+1,e),a}return null}function l(t,r,e,n,i){if(!(e>=n)){for(var o=t[e+n>>1],a=e-1,s=n+1;;){do{a++}while(i(t[a],o)<0);do{s--}while(i(t[s],o)>0);if(a>=s)break;var u=t[a];t[a]=t[s],t[s]=u,u=r[a],r[a]=r[s],r[s]=u}l(t,r,e,s,i),l(t,r,s+1,n,i)}}var p=function(t,r){return t.ll.x<=r.x&&r.x<=t.ur.x&&t.ll.y<=r.y&&r.y<=t.ur.y},v=function(t,r){if(r.ur.x<t.ll.x||t.ur.x<r.ll.x||r.ur.y<t.ll.y||t.ur.y<r.ll.y)return null;var e=t.ll.x<r.ll.x?r.ll.x:t.ll.x,n=t.ur.x<r.ur.x?t.ur.x:r.ur.x;return{ll:{x:e,y:t.ll.y<r.ll.y?r.ll.y:t.ll.y},ur:{x:n,y:t.ur.y<r.ur.y?t.ur.y:r.ur.y}}},d=Number.EPSILON;void 0===d&&(d=Math.pow(2,-52));var g=d*d,y=function(t,r){if(-d<t&&t<d&&-d<r&&r<d)return 0;var e=t-r;return e*e<g*t*r?0:t<r?-1:1},m=function(){function r(){t(this,r),this.reset()}return e(r,[{key:"reset",value:function(){this.xRounder=new x,this.yRounder=new x}},{key:"round",value:function(t,r){return{x:this.xRounder.round(t),y:this.yRounder.round(r)}}}]),r}(),x=function(){function r(){t(this,r),this.tree=new f,this.round(0)}return e(r,[{key:"round",value:function(t){var r=this.tree.add(t),e=this.tree.prev(r);if(null!==e&&0===y(r.key,e.key))return this.tree.remove(t),e.key;var n=this.tree.next(r);return null!==n&&0===y(r.key,n.key)?(this.tree.remove(t),n.key):t}}]),r}(),b=new m,w=function(t,r){return t.x*r.y-t.y*r.x},S=function(t,r){return t.x*r.x+t.y*r.y},_=function(t,r,e){var n={x:r.x-t.x,y:r.y-t.y},i={x:e.x-t.x,y:e.y-t.y},o=w(n,i);return y(o,0)},E=function(t){return Math.sqrt(S(t,t))},k=function(t,r,e){var n={x:r.x-t.x,y:r.y-t.y},i={x:e.x-t.x,y:e.y-t.y};return S(i,n)/E(i)/E(n)},M=function(t,r,e){return 0===r.y?null:{x:t.x+r.x/r.y*(e-t.y),y:e}},A=function(t,r,e){return 0===r.x?null:{x:e,y:t.y+r.y/r.x*(e-t.x)}},P=function(){function r(e,n){t(this,r),void 0===e.events?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=n}return e(r,null,[{key:"compare",value:function(t,e){var n=r.comparePoints(t.point,e.point);return 0!==n?n:(t.point!==e.point&&t.link(e),t.isLeft!==e.isLeft?t.isLeft?1:-1:T.compare(t.segment,e.segment))}},{key:"comparePoints",value:function(t,r){return t.x<r.x?-1:t.x>r.x?1:t.y<r.y?-1:t.y>r.y?1:0}}]),e(r,[{key:"link",value:function(t){if(t.point===this.point)throw new Error("Tried to link already linked events");for(var r=t.point.events,e=0,n=r.length;e<n;e++){var i=r[e];this.point.events.push(i),i.point=this.point}this.checkForConsuming()}},{key:"checkForConsuming",value:function(){for(var t=this.point.events.length,r=0;r<t;r++){var e=this.point.events[r];if(void 0===e.segment.consumedBy)for(var n=r+1;n<t;n++){var i=this.point.events[n];void 0===i.consumedBy&&e.otherSE.point.events===i.otherSE.point.events&&e.segment.consume(i.segment)}}}},{key:"getAvailableLinkedEvents",value:function(){for(var t=[],r=0,e=this.point.events.length;r<e;r++){var n=this.point.events[r];n!==this&&!n.segment.ringOut&&n.segment.isInResult()&&t.push(n)}return t}},{key:"getLeftmostComparator",value:function(t){var r=this,e=new Map,n=function(n){var i,o,a,s,u,f=n.otherSE;e.set(n,{sine:(i=r.point,o=t.point,a=f.point,s={x:o.x-i.x,y:o.y-i.y},u={x:a.x-i.x,y:a.y-i.y},w(u,s)/E(u)/E(s)),cosine:k(r.point,t.point,f.point)})};return function(t,r){e.has(t)||n(t),e.has(r)||n(r);var i=e.get(t),o=i.sine,a=i.cosine,s=e.get(r),u=s.sine,f=s.cosine;return o>=0&&u>=0?a<f?1:a>f?-1:0:o<0&&u<0?a<f?-1:a>f?1:0:u<o?-1:u>o?1:0}}}]),r}(),O=0,T=function(){function r(e,n,i,o){t(this,r),this.id=++O,this.leftSE=e,e.segment=this,e.otherSE=n,this.rightSE=n,n.segment=this,n.otherSE=e,this.rings=i,this.windings=o}return e(r,null,[{key:"compare",value:function(t,r){var e=t.leftSE.point.x,n=r.leftSE.point.x,i=t.rightSE.point.x,o=r.rightSE.point.x;if(o<e)return 1;if(i<n)return-1;var a=t.leftSE.point.y,s=r.leftSE.point.y,u=t.rightSE.point.y,f=r.rightSE.point.y;if(e<n){if(s<a&&s<u)return 1;if(s>a&&s>u)return-1;var c=t.comparePoint(r.leftSE.point);if(c<0)return 1;if(c>0)return-1;var h=r.comparePoint(t.rightSE.point);return 0!==h?h:-1}if(e>n){if(a<s&&a<f)return-1;if(a>s&&a>f)return 1;var l=r.comparePoint(t.leftSE.point);if(0!==l)return l;var p=t.comparePoint(r.rightSE.point);return p<0?1:p>0?-1:1}if(a<s)return-1;if(a>s)return 1;if(i<o){var v=r.comparePoint(t.rightSE.point);if(0!==v)return v}if(i>o){var d=t.comparePoint(r.rightSE.point);if(d<0)return 1;if(d>0)return-1}if(i!==o){var g=u-a,y=i-e,m=f-s,x=o-n;if(g>y&&m<x)return 1;if(g<y&&m>x)return-1}return i>o?1:i<o||u<f?-1:u>f?1:t.id<r.id?-1:t.id>r.id?1:0}}]),e(r,[{key:"replaceRightSE",value:function(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var t=this.leftSE.point.y,r=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t<r?t:r},ur:{x:this.rightSE.point.x,y:t>r?t:r}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(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}},{key:"comparePoint",value:function(t){if(this.isAnEndpoint(t))return 0;var r=this.leftSE.point,e=this.rightSE.point,n=this.vector();if(r.x===e.x)return t.x===r.x?0:t.x<r.x?1:-1;var i=(t.y-r.y)/n.y,o=r.x+i*n.x;if(t.x===o)return 0;var a=(t.x-r.x)/n.x,s=r.y+a*n.y;return t.y===s?0:t.y<s?-1:1}},{key:"getIntersection",value:function(t){var r=this.bbox(),e=t.bbox(),n=v(r,e);if(null===n)return null;var i=this.leftSE.point,o=this.rightSE.point,a=t.leftSE.point,s=t.rightSE.point,u=p(r,a)&&0===this.comparePoint(a),f=p(e,i)&&0===t.comparePoint(i),c=p(r,s)&&0===this.comparePoint(s),h=p(e,o)&&0===t.comparePoint(o);if(f&&u)return h&&!c?o:!h&&c?s:null;if(f)return c&&i.x===s.x&&i.y===s.y?null:i;if(u)return h&&o.x===a.x&&o.y===a.y?null:a;if(h&&c)return null;if(h)return o;if(c)return s;var l=function(t,r,e,n){if(0===r.x)return A(e,n,t.x);if(0===n.x)return A(t,r,e.x);if(0===r.y)return M(e,n,t.y);if(0===n.y)return M(t,r,e.y);var i=w(r,n);if(0==i)return null;var o={x:e.x-t.x,y:e.y-t.y},a=w(o,r)/i,s=w(o,n)/i;return{x:(t.x+s*r.x+(e.x+a*n.x))/2,y:(t.y+s*r.y+(e.y+a*n.y))/2}}(i,this.vector(),a,t.vector());return null===l?null:p(n,l)?b.round(l.x,l.y):null}},{key:"split",value:function(t){var e=[],n=void 0!==t.events,i=new P(t,!0),o=new P(t,!1),a=this.rightSE;this.replaceRightSE(o),e.push(o),e.push(i);var s=new r(i,a,this.rings.slice(),this.windings.slice());return P.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),P.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(i.checkForConsuming(),o.checkForConsuming()),e}},{key:"swapEvents",value:function(){var t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var r=0,e=this.windings.length;r<e;r++)this.windings[r]*=-1}},{key:"consume",value:function(t){for(var e=this,n=t;e.consumedBy;)e=e.consumedBy;for(;n.consumedBy;)n=n.consumedBy;var i=r.compare(e,n);if(0!==i){if(i>0){var o=e;e=n,n=o}if(e.prev===n){var a=e;e=n,n=a}for(var s=0,u=n.rings.length;s<u;s++){var f=n.rings[s],c=n.windings[s],h=e.rings.indexOf(f);-1===h?(e.rings.push(f),e.windings.push(c)):e.windings[h]+=c}n.rings=null,n.windings=null,n.consumedBy=e,n.leftSE.consumedBy=e.leftSE,n.rightSE.consumedBy=e.rightSE}}},{key:"prevInResult",value:function(){return void 0!==this._prevInResult||(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null),this._prevInResult}},{key:"beforeState",value:function(){if(void 0!==this._beforeState)return this._beforeState;if(this.prev){var t=this.prev.consumedBy||this.prev;this._beforeState=t.afterState()}else this._beforeState={rings:[],windings:[],multiPolys:[]};return this._beforeState}},{key:"afterState",value:function(){if(void 0!==this._afterState)return this._afterState;var t=this.beforeState();this._afterState={rings:t.rings.slice(0),windings:t.windings.slice(0),multiPolys:[]};for(var r=this._afterState.rings,e=this._afterState.windings,n=this._afterState.multiPolys,i=0,o=this.rings.length;i<o;i++){var a=this.rings[i],s=this.windings[i],u=r.indexOf(a);-1===u?(r.push(a),e.push(s)):e[u]+=s}for(var f=[],c=[],h=0,l=r.length;h<l;h++)if(0!==e[h]){var p=r[h],v=p.poly;if(-1===c.indexOf(v))if(p.isExterior)f.push(v);else{-1===c.indexOf(v)&&c.push(v);var d=f.indexOf(p.poly);-1!==d&&f.splice(d,1)}}for(var g=0,y=f.length;g<y;g++){var m=f[g].multiPoly;-1===n.indexOf(m)&&n.push(m)}return this._afterState}},{key:"isInResult",value:function(){if(this.consumedBy)return!1;if(void 0!==this._isInResult)return this._isInResult;var t=this.beforeState().multiPolys,r=this.afterState().multiPolys;switch(X.type){case"union":var e=0===t.length,n=0===r.length;this._isInResult=e!==n;break;case"intersection":var i,o;t.length<r.length?(i=t.length,o=r.length):(i=r.length,o=t.length),this._isInResult=o===X.numMultiPolys&&i<o;break;case"xor":var a=Math.abs(t.length-r.length);this._isInResult=a%2==1;break;case"difference":var s=function(t){return 1===t.length&&t[0].isSubject};this._isInResult=s(t)!==s(r);break;default:throw new Error("Unrecognized operation type found ".concat(X.type))}return this._isInResult}}],[{key:"fromRing",value:function(t,e,n){var i,o,a,s=P.comparePoints(t,e);if(s<0)i=t,o=e,a=1;else{if(!(s>0))throw new Error("Tried to create degenerate segment at [".concat(t.x,", ").concat(t.y,"]"));i=e,o=t,a=-1}return new r(new P(i,!0),new P(o,!1),[n],[a])}}]),r}(),R=function(){function r(e,n,i){if(t(this,r),!Array.isArray(e)||0===e.length)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=n,this.isExterior=i,this.segments=[],"number"!=typeof e[0][0]||"number"!=typeof e[0][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var o=b.round(e[0][0],e[0][1]);this.bbox={ll:{x:o.x,y:o.y},ur:{x:o.x,y:o.y}};for(var a=o,s=1,u=e.length;s<u;s++){if("number"!=typeof e[s][0]||"number"!=typeof e[s][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var f=b.round(e[s][0],e[s][1]);f.x===a.x&&f.y===a.y||(this.segments.push(T.fromRing(a,f,this)),f.x<this.bbox.ll.x&&(this.bbox.ll.x=f.x),f.y<this.bbox.ll.y&&(this.bbox.ll.y=f.y),f.x>this.bbox.ur.x&&(this.bbox.ur.x=f.x),f.y>this.bbox.ur.y&&(this.bbox.ur.y=f.y),a=f)}o.x===a.x&&o.y===a.y||this.segments.push(T.fromRing(a,o,this))}return e(r,[{key:"getSweepEvents",value:function(){for(var t=[],r=0,e=this.segments.length;r<e;r++){var n=this.segments[r];t.push(n.leftSE),t.push(n.rightSE)}return t}}]),r}(),I=function(){function r(e,n){if(t(this,r),!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new R(e[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(var i=1,o=e.length;i<o;i++){var a=new R(e[i],this,!1);a.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=a.bbox.ll.x),a.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=a.bbox.ll.y),a.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=a.bbox.ur.x),a.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=a.bbox.ur.y),this.interiorRings.push(a)}this.multiPoly=n}return e(r,[{key:"getSweepEvents",value:function(){for(var t=this.exteriorRing.getSweepEvents(),r=0,e=this.interiorRings.length;r<e;r++)for(var n=this.interiorRings[r].getSweepEvents(),i=0,o=n.length;i<o;i++)t.push(n[i]);return t}}]),r}(),j=function(){function r(e,n){if(t(this,r),!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{"number"==typeof e[0][0][0]&&(e=[e])}catch(t){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(var i=0,o=e.length;i<o;i++){var a=new I(e[i],this);a.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=a.bbox.ll.x),a.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=a.bbox.ll.y),a.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=a.bbox.ur.x),a.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=a.bbox.ur.y),this.polys.push(a)}this.isSubject=n}return e(r,[{key:"getSweepEvents",value:function(){for(var t=[],r=0,e=this.polys.length;r<e;r++)for(var n=this.polys[r].getSweepEvents(),i=0,o=n.length;i<o;i++)t.push(n[i]);return t}}]),r}(),B=function(){function r(e){t(this,r),this.events=e;for(var n=0,i=e.length;n<i;n++)e[n].segment.ringOut=this;this.poly=null}return e(r,null,[{key:"factory",value:function(t){for(var e=[],n=0,i=t.length;n<i;n++){var o=t[n];if(o.isInResult()&&!o.ringOut){for(var a=null,s=o.leftSE,u=o.rightSE,f=[s],c=s.point,h=[];a=s,s=u,f.push(s),s.point!==c;)for(;;){var l=s.getAvailableLinkedEvents();if(0===l.length){var p=f[0].point,v=f[f.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(p.x,",")+" ".concat(p.y,"]. Last matching segment found ends at")+" [".concat(v.x,", ").concat(v.y,"]."))}if(1===l.length){u=l[0].otherSE;break}for(var d=null,g=0,y=h.length;g<y;g++)if(h[g].point===s.point){d=g;break}if(null===d){h.push({index:f.length,point:s.point});var m=s.getLeftmostComparator(a);u=l.sort(m)[0].otherSE;break}var x=h.splice(d)[0],b=f.splice(x.index);b.unshift(b[0].otherSE),e.push(new r(b.reverse()))}e.push(new r(f))}}return e}}]),e(r,[{key:"getGeom",value:function(){for(var t=this.events[0].point,r=[t],e=1,n=this.events.length-1;e<n;e++){var i=this.events[e].point,o=this.events[e+1].point;0!==_(i,t,o)&&(r.push(i),t=i)}if(1===r.length)return null;var a=r[0],s=r[1];0===_(a,t,s)&&r.shift(),r.push(r[0]);for(var u=this.isExteriorRing()?1:-1,f=this.isExteriorRing()?0:r.length-1,c=this.isExteriorRing()?r.length:-1,h=[],l=f;l!=c;l+=u)h.push([r[l].x,r[l].y]);return h}},{key:"isExteriorRing",value:function(){if(void 0===this._isExteriorRing){var t=this.enclosingRing();this._isExteriorRing=!t||!t.isExteriorRing()}return this._isExteriorRing}},{key:"enclosingRing",value:function(){return void 0===this._enclosingRing&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}},{key:"_calcEnclosingRing",value:function(){for(var t=this.events[0],r=1,e=this.events.length;r<e;r++){var n=this.events[r];P.compare(t,n)>0&&(t=n)}for(var i=t.segment.prevInResult(),o=i?i.prevInResult():null;;){if(!i)return null;if(!o)return i.ringOut;if(o.ringOut!==i.ringOut)return o.ringOut.enclosingRing()!==i.ringOut?i.ringOut:i.ringOut.enclosingRing();i=o.prevInResult(),o=i?i.prevInResult():null}}}]),r}(),L=function(){function r(e){t(this,r),this.exteriorRing=e,e.poly=this,this.interiorRings=[]}return e(r,[{key:"addInterior",value:function(t){this.interiorRings.push(t),t.poly=this}},{key:"getGeom",value:function(){var t=[this.exteriorRing.getGeom()];if(null===t[0])return null;for(var r=0,e=this.interiorRings.length;r<e;r++){var n=this.interiorRings[r].getGeom();null!==n&&t.push(n)}return t}}]),r}(),N=function(){function r(e){t(this,r),this.rings=e,this.polys=this._composePolys(e)}return e(r,[{key:"getGeom",value:function(){for(var t=[],r=0,e=this.polys.length;r<e;r++){var n=this.polys[r].getGeom();null!==n&&t.push(n)}return t}},{key:"_composePolys",value:function(t){for(var r=[],e=0,n=t.length;e<n;e++){var i=t[e];if(!i.poly)if(i.isExteriorRing())r.push(new L(i));else{var o=i.enclosingRing();o.poly||r.push(new L(o)),o.poly.addInterior(i)}}return r}}]),r}(),Y=function(){function r(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:T.compare;t(this,r),this.queue=e,this.tree=new f(n),this.segments=[]}return e(r,[{key:"process",value:function(t){var r=t.segment,e=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(r),e;var n=t.isLeft?this.tree.insert(r):this.tree.find(r);if(!n)throw new Error("Unable to find segment #".concat(r.id," ")+"[".concat(r.leftSE.point.x,", ").concat(r.leftSE.point.y,"] -> ")+"[".concat(r.rightSE.point.x,", ").concat(r.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var i=n,o=n,a=void 0,s=void 0;void 0===a;)null===(i=this.tree.prev(i))?a=null:void 0===i.key.consumedBy&&(a=i.key);for(;void 0===s;)null===(o=this.tree.next(o))?s=null:void 0===o.key.consumedBy&&(s=o.key);if(t.isLeft){var u=null;if(a){var f=a.getIntersection(r);if(null!==f&&(r.isAnEndpoint(f)||(u=f),!a.isAnEndpoint(f)))for(var c=this._splitSafely(a,f),h=0,l=c.length;h<l;h++)e.push(c[h])}var p=null;if(s){var v=s.getIntersection(r);if(null!==v&&(r.isAnEndpoint(v)||(p=v),!s.isAnEndpoint(v)))for(var d=this._splitSafely(s,v),g=0,y=d.length;g<y;g++)e.push(d[g])}if(null!==u||null!==p){var m;m=null===u?p:null===p||P.comparePoints(u,p)<=0?u:p,this.queue.remove(r.rightSE),e.push(r.rightSE);for(var x=r.split(m),b=0,w=x.length;b<w;b++)e.push(x[b])}e.length>0?(this.tree.remove(r),e.push(t)):(this.segments.push(r),r.prev=a)}else{if(a&&s){var S=a.getIntersection(s);if(null!==S){if(!a.isAnEndpoint(S))for(var _=this._splitSafely(a,S),E=0,k=_.length;E<k;E++)e.push(_[E]);if(!s.isAnEndpoint(S))for(var M=this._splitSafely(s,S),A=0,O=M.length;A<O;A++)e.push(M[A])}}this.tree.remove(r)}return e}},{key:"_splitSafely",value:function(t,r){this.tree.remove(t);var e=t.rightSE;this.queue.remove(e);var n=t.split(r);return n.push(e),void 0===t.consumedBy&&this.tree.insert(t),n}}]),r}(),C="undefined"!=typeof process&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,F="undefined"!=typeof process&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,X=new(function(){function r(){t(this,r)}return e(r,[{key:"run",value:function(t,r,e){X.type=t,b.reset();for(var n=[new j(r,!0)],i=0,o=e.length;i<o;i++)n.push(new j(e[i],!1));if(X.numMultiPolys=n.length,"difference"===X.type)for(var a=n[0],s=1;s<n.length;)null!==v(n[s].bbox,a.bbox)?s++:n.splice(s,1);if("intersection"===X.type)for(var u=0,c=n.length;u<c;u++)for(var h=n[u],l=u+1,p=n.length;l<p;l++)if(null===v(h.bbox,n[l].bbox))return[];for(var d=new f(P.compare),g=0,y=n.length;g<y;g++)for(var m=n[g].getSweepEvents(),x=0,w=m.length;x<w;x++)if(d.insert(m[x]),d.size>C)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var S=new Y(d),_=d.size,E=d.pop();E;){var k=E.key;if(d.size===_){var M=k.segment;throw new Error("Unable to pop() ".concat(k.isLeft?"left":"right"," SweepEvent ")+"[".concat(k.point.x,", ").concat(k.point.y,"] from segment #").concat(M.id," ")+"[".concat(M.leftSE.point.x,", ").concat(M.leftSE.point.y,"] -> ")+"[".concat(M.rightSE.point.x,", ").concat(M.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(d.size>C)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(S.segments.length>F)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var A=S.process(k),O=0,T=A.length;O<T;O++){var R=A[O];void 0===R.consumedBy&&d.insert(R)}_=d.size,E=d.pop()}b.reset();var I=B.factory(S.segments);return new N(I).getGeom()}}]),r}());return{union:function(t){for(var r=arguments.length,e=new Array(r>1?r-1:0),n=1;n<r;n++)e[n-1]=arguments[n];return X.run("union",t,e)},intersection:function(t){for(var r=arguments.length,e=new Array(r>1?r-1:0),n=1;n<r;n++)e[n-1]=arguments[n];return X.run("intersection",t,e)},xor:function(t){for(var r=arguments.length,e=new Array(r>1?r-1:0),n=1;n<r;n++)e[n-1]=arguments[n];return X.run("xor",t,e)},difference:function(t){for(var r=arguments.length,e=new Array(r>1?r-1:0),n=1;n<r;n++)e[n-1]=arguments[n];return X.run("difference",t,e)}}}()},1351:(t,r,e)=>{"use strict";var n=e(8005),i=e(6740),o=e(7972),a=e(5442);function s(t){return(3===t?u:4===t?f:5===t?c:h)(i,o,n,a)}function u(t,r,e,n){return function(i,o,a){var s=e(i[0],i[0]),u=n(s,o[0]),f=n(s,a[0]),c=e(o[0],o[0]),h=n(c,i[0]),l=n(c,a[0]),p=e(a[0],a[0]),v=n(p,i[0]),d=n(p,o[0]),g=t(r(d,l),r(h,u)),y=r(v,f),m=r(g,y);return m[m.length-1]}}function f(t,r,e,n){return function(i,o,a,s){var u=t(e(i[0],i[0]),e(i[1],i[1])),f=n(u,o[0]),c=n(u,a[0]),h=n(u,s[0]),l=t(e(o[0],o[0]),e(o[1],o[1])),p=n(l,i[0]),v=n(l,a[0]),d=n(l,s[0]),g=t(e(a[0],a[0]),e(a[1],a[1])),y=n(g,i[0]),m=n(g,o[0]),x=n(g,s[0]),b=t(e(s[0],s[0]),e(s[1],s[1])),w=n(b,i[0]),S=n(b,o[0]),_=n(b,a[0]),E=t(t(n(r(_,x),o[1]),t(n(r(S,d),-a[1]),n(r(m,v),s[1]))),t(n(r(S,d),i[1]),t(n(r(w,h),-o[1]),n(r(p,f),s[1])))),k=t(t(n(r(_,x),i[1]),t(n(r(w,h),-a[1]),n(r(y,c),s[1]))),t(n(r(m,v),i[1]),t(n(r(y,c),-o[1]),n(r(p,f),a[1])))),M=r(E,k);return M[M.length-1]}}function c(t,r,e,n){return function(i,o,a,s,u){var f=t(e(i[0],i[0]),t(e(i[1],i[1]),e(i[2],i[2]))),c=n(f,o[0]),h=n(f,a[0]),l=n(f,s[0]),p=n(f,u[0]),v=t(e(o[0],o[0]),t(e(o[1],o[1]),e(o[2],o[2]))),d=n(v,i[0]),g=n(v,a[0]),y=n(v,s[0]),m=n(v,u[0]),x=t(e(a[0],a[0]),t(e(a[1],a[1]),e(a[2],a[2]))),b=n(x,i[0]),w=n(x,o[0]),S=n(x,s[0]),_=n(x,u[0]),E=t(e(s[0],s[0]),t(e(s[1],s[1]),e(s[2],s[2]))),k=n(E,i[0]),M=n(E,o[0]),A=n(E,a[0]),P=n(E,u[0]),O=t(e(u[0],u[0]),t(e(u[1],u[1]),e(u[2],u[2]))),T=n(O,i[0]),R=n(O,o[0]),I=n(O,a[0]),j=n(O,s[0]),B=t(t(t(n(t(n(r(j,P),a[1]),t(n(r(I,_),-s[1]),n(r(A,S),u[1]))),o[2]),t(n(t(n(r(j,P),o[1]),t(n(r(R,m),-s[1]),n(r(M,y),u[1]))),-a[2]),n(t(n(r(I,_),o[1]),t(n(r(R,m),-a[1]),n(r(w,g),u[1]))),s[2]))),t(n(t(n(r(A,S),o[1]),t(n(r(M,y),-a[1]),n(r(w,g),s[1]))),-u[2]),t(n(t(n(r(j,P),o[1]),t(n(r(R,m),-s[1]),n(r(M,y),u[1]))),i[2]),n(t(n(r(j,P),i[1]),t(n(r(T,p),-s[1]),n(r(k,l),u[1]))),-o[2])))),t(t(n(t(n(r(R,m),i[1]),t(n(r(T,p),-o[1]),n(r(d,c),u[1]))),s[2]),t(n(t(n(r(M,y),i[1]),t(n(r(k,l),-o[1]),n(r(d,c),s[1]))),-u[2]),n(t(n(r(A,S),o[1]),t(n(r(M,y),-a[1]),n(r(w,g),s[1]))),i[2]))),t(n(t(n(r(A,S),i[1]),t(n(r(k,l),-a[1]),n(r(b,h),s[1]))),-o[2]),t(n(t(n(r(M,y),i[1]),t(n(r(k,l),-o[1]),n(r(d,c),s[1]))),a[2]),n(t(n(r(w,g),i[1]),t(n(r(b,h),-o[1]),n(r(d,c),a[1]))),-s[2]))))),L=t(t(t(n(t(n(r(j,P),a[1]),t(n(r(I,_),-s[1]),n(r(A,S),u[1]))),i[2]),n(t(n(r(j,P),i[1]),t(n(r(T,p),-s[1]),n(r(k,l),u[1]))),-a[2])),t(n(t(n(r(I,_),i[1]),t(n(r(T,p),-a[1]),n(r(b,h),u[1]))),s[2]),n(t(n(r(A,S),i[1]),t(n(r(k,l),-a[1]),n(r(b,h),s[1]))),-u[2]))),t(t(n(t(n(r(I,_),o[1]),t(n(r(R,m),-a[1]),n(r(w,g),u[1]))),i[2]),n(t(n(r(I,_),i[1]),t(n(r(T,p),-a[1]),n(r(b,h),u[1]))),-o[2])),t(n(t(n(r(R,m),i[1]),t(n(r(T,p),-o[1]),n(r(d,c),u[1]))),a[2]),n(t(n(r(w,g),i[1]),t(n(r(b,h),-o[1]),n(r(d,c),a[1]))),-u[2])))),N=r(B,L);return N[N.length-1]}}function h(t,r,e,n){return function(i,o,a,s,u,f){var c=t(t(e(i[0],i[0]),e(i[1],i[1])),t(e(i[2],i[2]),e(i[3],i[3]))),h=n(c,o[0]),l=n(c,a[0]),p=n(c,s[0]),v=n(c,u[0]),d=n(c,f[0]),g=t(t(e(o[0],o[0]),e(o[1],o[1])),t(e(o[2],o[2]),e(o[3],o[3]))),y=n(g,i[0]),m=n(g,a[0]),x=n(g,s[0]),b=n(g,u[0]),w=n(g,f[0]),S=t(t(e(a[0],a[0]),e(a[1],a[1])),t(e(a[2],a[2]),e(a[3],a[3]))),_=n(S,i[0]),E=n(S,o[0]),k=n(S,s[0]),M=n(S,u[0]),A=n(S,f[0]),P=t(t(e(s[0],s[0]),e(s[1],s[1])),t(e(s[2],s[2]),e(s[3],s[3]))),O=n(P,i[0]),T=n(P,o[0]),R=n(P,a[0]),I=n(P,u[0]),j=n(P,f[0]),B=t(t(e(u[0],u[0]),e(u[1],u[1])),t(e(u[2],u[2]),e(u[3],u[3]))),L=n(B,i[0]),N=n(B,o[0]),Y=n(B,a[0]),C=n(B,s[0]),F=n(B,f[0]),X=t(t(e(f[0],f[0]),e(f[1],f[1])),t(e(f[2],f[2]),e(f[3],f[3]))),U=n(X,i[0]),D=n(X,o[0]),G=n(X,a[0]),z=n(X,s[0]),q=n(X,u[0]),V=t(t(t(n(t(t(n(t(n(r(q,F),s[1]),t(n(r(z,j),-u[1]),n(r(C,I),f[1]))),a[2]),n(t(n(r(q,F),a[1]),t(n(r(G,A),-u[1]),n(r(Y,M),f[1]))),-s[2])),t(n(t(n(r(z,j),a[1]),t(n(r(G,A),-s[1]),n(r(R,k),f[1]))),u[2]),n(t(n(r(C,I),a[1]),t(n(r(Y,M),-s[1]),n(r(R,k),u[1]))),-f[2]))),o[3]),t(n(t(t(n(t(n(r(q,F),s[1]),t(n(r(z,j),-u[1]),n(r(C,I),f[1]))),o[2]),n(t(n(r(q,F),o[1]),t(n(r(D,w),-u[1]),n(r(N,b),f[1]))),-s[2])),t(n(t(n(r(z,j),o[1]),t(n(r(D,w),-s[1]),n(r(T,x),f[1]))),u[2]),n(t(n(r(C,I),o[1]),t(n(r(N,b),-s[1]),n(r(T,x),u[1]))),-f[2]))),-a[3]),n(t(t(n(t(n(r(q,F),a[1]),t(n(r(G,A),-u[1]),n(r(Y,M),f[1]))),o[2]),n(t(n(r(q,F),o[1]),t(n(r(D,w),-u[1]),n(r(N,b),f[1]))),-a[2])),t(n(t(n(r(G,A),o[1]),t(n(r(D,w),-a[1]),n(r(E,m),f[1]))),u[2]),n(t(n(r(Y,M),o[1]),t(n(r(N,b),-a[1]),n(r(E,m),u[1]))),-f[2]))),s[3]))),t(t(n(t(t(n(t(n(r(z,j),a[1]),t(n(r(G,A),-s[1]),n(r(R,k),f[1]))),o[2]),n(t(n(r(z,j),o[1]),t(n(r(D,w),-s[1]),n(r(T,x),f[1]))),-a[2])),t(n(t(n(r(G,A),o[1]),t(n(r(D,w),-a[1]),n(r(E,m),f[1]))),s[2]),n(t(n(r(R,k),o[1]),t(n(r(T,x),-a[1]),n(r(E,m),s[1]))),-f[2]))),-u[3]),n(t(t(n(t(n(r(C,I),a[1]),t(n(r(Y,M),-s[1]),n(r(R,k),u[1]))),o[2]),n(t(n(r(C,I),o[1]),t(n(r(N,b),-s[1]),n(r(T,x),u[1]))),-a[2])),t(n(t(n(r(Y,M),o[1]),t(n(r(N,b),-a[1]),n(r(E,m),u[1]))),s[2]),n(t(n(r(R,k),o[1]),t(n(r(T,x),-a[1]),n(r(E,m),s[1]))),-u[2]))),f[3])),t(n(t(t(n(t(n(r(q,F),s[1]),t(n(r(z,j),-u[1]),n(r(C,I),f[1]))),o[2]),n(t(n(r(q,F),o[1]),t(n(r(D,w),-u[1]),n(r(N,b),f[1]))),-s[2])),t(n(t(n(r(z,j),o[1]),t(n(r(D,w),-s[1]),n(r(T,x),f[1]))),u[2]),n(t(n(r(C,I),o[1]),t(n(r(N,b),-s[1]),n(r(T,x),u[1]))),-f[2]))),i[3]),n(t(t(n(t(n(r(q,F),s[1]),t(n(r(z,j),-u[1]),n(r(C,I),f[1]))),i[2]),n(t(n(r(q,F),i[1]),t(n(r(U,d),-u[1]),n(r(L,v),f[1]))),-s[2])),t(n(t(n(r(z,j),i[1]),t(n(r(U,d),-s[1]),n(r(O,p),f[1]))),u[2]),n(t(n(r(C,I),i[1]),t(n(r(L,v),-s[1]),n(r(O,p),u[1]))),-f[2]))),-o[3])))),t(t(t(n(t(t(n(t(n(r(q,F),o[1]),t(n(r(D,w),-u[1]),n(r(N,b),f[1]))),i[2]),n(t(n(r(q,F),i[1]),t(n(r(U,d),-u[1]),n(r(L,v),f[1]))),-o[2])),t(n(t(n(r(D,w),i[1]),t(n(r(U,d),-o[1]),n(r(y,h),f[1]))),u[2]),n(t(n(r(N,b),i[1]),t(n(r(L,v),-o[1]),n(r(y,h),u[1]))),-f[2]))),s[3]),n(t(t(n(t(n(r(z,j),o[1]),t(n(r(D,w),-s[1]),n(r(T,x),f[1]))),i[2]),n(t(n(r(z,j),i[1]),t(n(r(U,d),-s[1]),n(r(O,p),f[1]))),-o[2])),t(n(t(n(r(D,w),i[1]),t(n(r(U,d),-o[1]),n(r(y,h),f[1]))),s[2]),n(t(n(r(T,x),i[1]),t(n(r(O,p),-o[1]),n(r(y,h),s[1]))),-f[2]))),-u[3])),t(n(t(t(n(t(n(r(C,I),o[1]),t(n(r(N,b),-s[1]),n(r(T,x),u[1]))),i[2]),n(t(n(r(C,I),i[1]),t(n(r(L,v),-s[1]),n(r(O,p),u[1]))),-o[2])),t(n(t(n(r(N,b),i[1]),t(n(r(L,v),-o[1]),n(r(y,h),u[1]))),s[2]),n(t(n(r(T,x),i[1]),t(n(r(O,p),-o[1]),n(r(y,h),s[1]))),-u[2]))),f[3]),n(t(t(n(t(n(r(z,j),a[1]),t(n(r(G,A),-s[1]),n(r(R,k),f[1]))),o[2]),n(t(n(r(z,j),o[1]),t(n(r(D,w),-s[1]),n(r(T,x),f[1]))),-a[2])),t(n(t(n(r(G,A),o[1]),t(n(r(D,w),-a[1]),n(r(E,m),f[1]))),s[2]),n(t(n(r(R,k),o[1]),t(n(r(T,x),-a[1]),n(r(E,m),s[1]))),-f[2]))),i[3]))),t(t(n(t(t(n(t(n(r(z,j),a[1]),t(n(r(G,A),-s[1]),n(r(R,k),f[1]))),i[2]),n(t(n(r(z,j),i[1]),t(n(r(U,d),-s[1]),n(r(O,p),f[1]))),-a[2])),t(n(t(n(r(G,A),i[1]),t(n(r(U,d),-a[1]),n(r(_,l),f[1]))),s[2]),n(t(n(r(R,k),i[1]),t(n(r(O,p),-a[1]),n(r(_,l),s[1]))),-f[2]))),-o[3]),n(t(t(n(t(n(r(z,j),o[1]),t(n(r(D,w),-s[1]),n(r(T,x),f[1]))),i[2]),n(t(n(r(z,j),i[1]),t(n(r(U,d),-s[1]),n(r(O,p),f[1]))),-o[2])),t(n(t(n(r(D,w),i[1]),t(n(r(U,d),-o[1]),n(r(y,h),f[1]))),s[2]),n(t(n(r(T,x),i[1]),t(n(r(O,p),-o[1]),n(r(y,h),s[1]))),-f[2]))),a[3])),t(n(t(t(n(t(n(r(G,A),o[1]),t(n(r(D,w),-a[1]),n(r(E,m),f[1]))),i[2]),n(t(n(r(G,A),i[1]),t(n(r(U,d),-a[1]),n(r(_,l),f[1]))),-o[2])),t(n(t(n(r(D,w),i[1]),t(n(r(U,d),-o[1]),n(r(y,h),f[1]))),a[2]),n(t(n(r(E,m),i[1]),t(n(r(_,l),-o[1]),n(r(y,h),a[1]))),-f[2]))),-s[3]),n(t(t(n(t(n(r(R,k),o[1]),t(n(r(T,x),-a[1]),n(r(E,m),s[1]))),i[2]),n(t(n(r(R,k),i[1]),t(n(r(O,p),-a[1]),n(r(_,l),s[1]))),-o[2])),t(n(t(n(r(T,x),i[1]),t(n(r(O,p),-o[1]),n(r(y,h),s[1]))),a[2]),n(t(n(r(E,m),i[1]),t(n(r(_,l),-o[1]),n(r(y,h),a[1]))),-s[2]))),f[3]))))),W=t(t(t(n(t(t(n(t(n(r(q,F),s[1]),t(n(r(z,j),-u[1]),n(r(C,I),f[1]))),a[2]),n(t(n(r(q,F),a[1]),t(n(r(G,A),-u[1]),n(r(Y,M),f[1]))),-s[2])),t(n(t(n(r(z,j),a[1]),t(n(r(G,A),-s[1]),n(r(R,k),f[1]))),u[2]),n(t(n(r(C,I),a[1]),t(n(r(Y,M),-s[1]),n(r(R,k),u[1]))),-f[2]))),i[3]),t(n(t(t(n(t(n(r(q,F),s[1]),t(n(r(z,j),-u[1]),n(r(C,I),f[1]))),i[2]),n(t(n(r(q,F),i[1]),t(n(r(U,d),-u[1]),n(r(L,v),f[1]))),-s[2])),t(n(t(n(r(z,j),i[1]),t(n(r(U,d),-s[1]),n(r(O,p),f[1]))),u[2]),n(t(n(r(C,I),i[1]),t(n(r(L,v),-s[1]),n(r(O,p),u[1]))),-f[2]))),-a[3]),n(t(t(n(t(n(r(q,F),a[1]),t(n(r(G,A),-u[1]),n(r(Y,M),f[1]))),i[2]),n(t(n(r(q,F),i[1]),t(n(r(U,d),-u[1]),n(r(L,v),f[1]))),-a[2])),t(n(t(n(r(G,A),i[1]),t(n(r(U,d),-a[1]),n(r(_,l),f[1]))),u[2]),n(t(n(r(Y,M),i[1]),t(n(r(L,v),-a[1]),n(r(_,l),u[1]))),-f[2]))),s[3]))),t(t(n(t(t(n(t(n(r(z,j),a[1]),t(n(r(G,A),-s[1]),n(r(R,k),f[1]))),i[2]),n(t(n(r(z,j),i[1]),t(n(r(U,d),-s[1]),n(r(O,p),f[1]))),-a[2])),t(n(t(n(r(G,A),i[1]),t(n(r(U,d),-a[1]),n(r(_,l),f[1]))),s[2]),n(t(n(r(R,k),i[1]),t(n(r(O,p),-a[1]),n(r(_,l),s[1]))),-f[2]))),-u[3]),n(t(t(n(t(n(r(C,I),a[1]),t(n(r(Y,M),-s[1]),n(r(R,k),u[1]))),i[2]),n(t(n(r(C,I),i[1]),t(n(r(L,v),-s[1]),n(r(O,p),u[1]))),-a[2])),t(n(t(n(r(Y,M),i[1]),t(n(r(L,v),-a[1]),n(r(_,l),u[1]))),s[2]),n(t(n(r(R,k),i[1]),t(n(r(O,p),-a[1]),n(r(_,l),s[1]))),-u[2]))),f[3])),t(n(t(t(n(t(n(r(q,F),a[1]),t(n(r(G,A),-u[1]),n(r(Y,M),f[1]))),o[2]),n(t(n(r(q,F),o[1]),t(n(r(D,w),-u[1]),n(r(N,b),f[1]))),-a[2])),t(n(t(n(r(G,A),o[1]),t(n(r(D,w),-a[1]),n(r(E,m),f[1]))),u[2]),n(t(n(r(Y,M),o[1]),t(n(r(N,b),-a[1]),n(r(E,m),u[1]))),-f[2]))),i[3]),n(t(t(n(t(n(r(q,F),a[1]),t(n(r(G,A),-u[1]),n(r(Y,M),f[1]))),i[2]),n(t(n(r(q,F),i[1]),t(n(r(U,d),-u[1]),n(r(L,v),f[1]))),-a[2])),t(n(t(n(r(G,A),i[1]),t(n(r(U,d),-a[1]),n(r(_,l),f[1]))),u[2]),n(t(n(r(Y,M),i[1]),t(n(r(L,v),-a[1]),n(r(_,l),u[1]))),-f[2]))),-o[3])))),t(t(t(n(t(t(n(t(n(r(q,F),o[1]),t(n(r(D,w),-u[1]),n(r(N,b),f[1]))),i[2]),n(t(n(r(q,F),i[1]),t(n(r(U,d),-u[1]),n(r(L,v),f[1]))),-o[2])),t(n(t(n(r(D,w),i[1]),t(n(r(U,d),-o[1]),n(r(y,h),f[1]))),u[2]),n(t(n(r(N,b),i[1]),t(n(r(L,v),-o[1]),n(r(y,h),u[1]))),-f[2]))),a[3]),n(t(t(n(t(n(r(G,A),o[1]),t(n(r(D,w),-a[1]),n(r(E,m),f[1]))),i[2]),n(t(n(r(G,A),i[1]),t(n(r(U,d),-a[1]),n(r(_,l),f[1]))),-o[2])),t(n(t(n(r(D,w),i[1]),t(n(r(U,d),-o[1]),n(r(y,h),f[1]))),a[2]),n(t(n(r(E,m),i[1]),t(n(r(_,l),-o[1]),n(r(y,h),a[1]))),-f[2]))),-u[3])),t(n(t(t(n(t(n(r(Y,M),o[1]),t(n(r(N,b),-a[1]),n(r(E,m),u[1]))),i[2]),n(t(n(r(Y,M),i[1]),t(n(r(L,v),-a[1]),n(r(_,l),u[1]))),-o[2])),t(n(t(n(r(N,b),i[1]),t(n(r(L,v),-o[1]),n(r(y,h),u[1]))),a[2]),n(t(n(r(E,m),i[1]),t(n(r(_,l),-o[1]),n(r(y,h),a[1]))),-u[2]))),f[3]),n(t(t(n(t(n(r(C,I),a[1]),t(n(r(Y,M),-s[1]),n(r(R,k),u[1]))),o[2]),n(t(n(r(C,I),o[1]),t(n(r(N,b),-s[1]),n(r(T,x),u[1]))),-a[2])),t(n(t(n(r(Y,M),o[1]),t(n(r(N,b),-a[1]),n(r(E,m),u[1]))),s[2]),n(t(n(r(R,k),o[1]),t(n(r(T,x),-a[1]),n(r(E,m),s[1]))),-u[2]))),i[3]))),t(t(n(t(t(n(t(n(r(C,I),a[1]),t(n(r(Y,M),-s[1]),n(r(R,k),u[1]))),i[2]),n(t(n(r(C,I),i[1]),t(n(r(L,v),-s[1]),n(r(O,p),u[1]))),-a[2])),t(n(t(n(r(Y,M),i[1]),t(n(r(L,v),-a[1]),n(r(_,l),u[1]))),s[2]),n(t(n(r(R,k),i[1]),t(n(r(O,p),-a[1]),n(r(_,l),s[1]))),-u[2]))),-o[3]),n(t(t(n(t(n(r(C,I),o[1]),t(n(r(N,b),-s[1]),n(r(T,x),u[1]))),i[2]),n(t(n(r(C,I),i[1]),t(n(r(L,v),-s[1]),n(r(O,p),u[1]))),-o[2])),t(n(t(n(r(N,b),i[1]),t(n(r(L,v),-o[1]),n(r(y,h),u[1]))),s[2]),n(t(n(r(T,x),i[1]),t(n(r(O,p),-o[1]),n(r(y,h),s[1]))),-u[2]))),a[3])),t(n(t(t(n(t(n(r(Y,M),o[1]),t(n(r(N,b),-a[1]),n(r(E,m),u[1]))),i[2]),n(t(n(r(Y,M),i[1]),t(n(r(L,v),-a[1]),n(r(_,l),u[1]))),-o[2])),t(n(t(n(r(N,b),i[1]),t(n(r(L,v),-o[1]),n(r(y,h),u[1]))),a[2]),n(t(n(r(E,m),i[1]),t(n(r(_,l),-o[1]),n(r(y,h),a[1]))),-u[2]))),-s[3]),n(t(t(n(t(n(r(R,k),o[1]),t(n(r(T,x),-a[1]),n(r(E,m),s[1]))),i[2]),n(t(n(r(R,k),i[1]),t(n(r(O,p),-a[1]),n(r(_,l),s[1]))),-o[2])),t(n(t(n(r(T,x),i[1]),t(n(r(O,p),-o[1]),n(r(y,h),s[1]))),a[2]),n(t(n(r(E,m),i[1]),t(n(r(_,l),-o[1]),n(r(y,h),a[1]))),-s[2]))),u[3]))))),J=r(V,W);return J[J.length-1]}}var l=[function(){return 0},function(){return 0},function(){return 0}];function p(t){var r=l[t.length];return r||(r=l[t.length]=s(t.length)),r.apply(void 0,t)}function v(t,r,e,n,i,o,a,s){return function(r,e,u,f,c,h){switch(arguments.length){case 0:case 1:return 0;case 2:return n(r,e);case 3:return i(r,e,u);case 4:return o(r,e,u,f);case 5:return a(r,e,u,f,c);case 6:return s(r,e,u,f,c,h)}for(var l=new Array(arguments.length),p=0;p<arguments.length;++p)l[p]=arguments[p];return t(l)}}!function(){for(;l.length<=6;)l.push(s(l.length));t.exports=v.apply(void 0,[p].concat(l));for(var r=0;r<=6;++r)t.exports[r]=l[r]}()},146:(t,r,e)=>{"use strict";var n=e(8005),i=e(6740),o=e(5442),a=e(7972);function s(t,r,e,n){return function(e,i,o){var a=t(t(r(i[1],o[0]),r(-o[1],i[0])),t(r(e[1],i[0]),r(-i[1],e[0]))),s=t(r(e[1],o[0]),r(-o[1],e[0])),u=n(a,s);return u[u.length-1]}}function u(t,r,e,n){return function(i,o,a,s){var u=t(t(e(t(r(a[1],s[0]),r(-s[1],a[0])),o[2]),t(e(t(r(o[1],s[0]),r(-s[1],o[0])),-a[2]),e(t(r(o[1],a[0]),r(-a[1],o[0])),s[2]))),t(e(t(r(o[1],s[0]),r(-s[1],o[0])),i[2]),t(e(t(r(i[1],s[0]),r(-s[1],i[0])),-o[2]),e(t(r(i[1],o[0]),r(-o[1],i[0])),s[2])))),f=t(t(e(t(r(a[1],s[0]),r(-s[1],a[0])),i[2]),t(e(t(r(i[1],s[0]),r(-s[1],i[0])),-a[2]),e(t(r(i[1],a[0]),r(-a[1],i[0])),s[2]))),t(e(t(r(o[1],a[0]),r(-a[1],o[0])),i[2]),t(e(t(r(i[1],a[0]),r(-a[1],i[0])),-o[2]),e(t(r(i[1],o[0]),r(-o[1],i[0])),a[2])))),c=n(u,f);return c[c.length-1]}}function f(t,r,e,n){return function(i,o,a,s,u){var f=t(t(t(e(t(e(t(r(s[1],u[0]),r(-u[1],s[0])),a[2]),t(e(t(r(a[1],u[0]),r(-u[1],a[0])),-s[2]),e(t(r(a[1],s[0]),r(-s[1],a[0])),u[2]))),o[3]),t(e(t(e(t(r(s[1],u[0]),r(-u[1],s[0])),o[2]),t(e(t(r(o[1],u[0]),r(-u[1],o[0])),-s[2]),e(t(r(o[1],s[0]),r(-s[1],o[0])),u[2]))),-a[3]),e(t(e(t(r(a[1],u[0]),r(-u[1],a[0])),o[2]),t(e(t(r(o[1],u[0]),r(-u[1],o[0])),-a[2]),e(t(r(o[1],a[0]),r(-a[1],o[0])),u[2]))),s[3]))),t(e(t(e(t(r(a[1],s[0]),r(-s[1],a[0])),o[2]),t(e(t(r(o[1],s[0]),r(-s[1],o[0])),-a[2]),e(t(r(o[1],a[0]),r(-a[1],o[0])),s[2]))),-u[3]),t(e(t(e(t(r(s[1],u[0]),r(-u[1],s[0])),o[2]),t(e(t(r(o[1],u[0]),r(-u[1],o[0])),-s[2]),e(t(r(o[1],s[0]),r(-s[1],o[0])),u[2]))),i[3]),e(t(e(t(r(s[1],u[0]),r(-u[1],s[0])),i[2]),t(e(t(r(i[1],u[0]),r(-u[1],i[0])),-s[2]),e(t(r(i[1],s[0]),r(-s[1],i[0])),u[2]))),-o[3])))),t(t(e(t(e(t(r(o[1],u[0]),r(-u[1],o[0])),i[2]),t(e(t(r(i[1],u[0]),r(-u[1],i[0])),-o[2]),e(t(r(i[1],o[0]),r(-o[1],i[0])),u[2]))),s[3]),t(e(t(e(t(r(o[1],s[0]),r(-s[1],o[0])),i[2]),t(e(t(r(i[1],s[0]),r(-s[1],i[0])),-o[2]),e(t(r(i[1],o[0]),r(-o[1],i[0])),s[2]))),-u[3]),e(t(e(t(r(a[1],s[0]),r(-s[1],a[0])),o[2]),t(e(t(r(o[1],s[0]),r(-s[1],o[0])),-a[2]),e(t(r(o[1],a[0]),r(-a[1],o[0])),s[2]))),i[3]))),t(e(t(e(t(r(a[1],s[0]),r(-s[1],a[0])),i[2]),t(e(t(r(i[1],s[0]),r(-s[1],i[0])),-a[2]),e(t(r(i[1],a[0]),r(-a[1],i[0])),s[2]))),-o[3]),t(e(t(e(t(r(o[1],s[0]),r(-s[1],o[0])),i[2]),t(e(t(r(i[1],s[0]),r(-s[1],i[0])),-o[2]),e(t(r(i[1],o[0]),r(-o[1],i[0])),s[2]))),a[3]),e(t(e(t(r(o[1],a[0]),r(-a[1],o[0])),i[2]),t(e(t(r(i[1],a[0]),r(-a[1],i[0])),-o[2]),e(t(r(i[1],o[0]),r(-o[1],i[0])),a[2]))),-s[3]))))),c=t(t(t(e(t(e(t(r(s[1],u[0]),r(-u[1],s[0])),a[2]),t(e(t(r(a[1],u[0]),r(-u[1],a[0])),-s[2]),e(t(r(a[1],s[0]),r(-s[1],a[0])),u[2]))),i[3]),e(t(e(t(r(s[1],u[0]),r(-u[1],s[0])),i[2]),t(e(t(r(i[1],u[0]),r(-u[1],i[0])),-s[2]),e(t(r(i[1],s[0]),r(-s[1],i[0])),u[2]))),-a[3])),t(e(t(e(t(r(a[1],u[0]),r(-u[1],a[0])),i[2]),t(e(t(r(i[1],u[0]),r(-u[1],i[0])),-a[2]),e(t(r(i[1],a[0]),r(-a[1],i[0])),u[2]))),s[3]),e(t(e(t(r(a[1],s[0]),r(-s[1],a[0])),i[2]),t(e(t(r(i[1],s[0]),r(-s[1],i[0])),-a[2]),e(t(r(i[1],a[0]),r(-a[1],i[0])),s[2]))),-u[3]))),t(t(e(t(e(t(r(a[1],u[0]),r(-u[1],a[0])),o[2]),t(e(t(r(o[1],u[0]),r(-u[1],o[0])),-a[2]),e(t(r(o[1],a[0]),r(-a[1],o[0])),u[2]))),i[3]),e(t(e(t(r(a[1],u[0]),r(-u[1],a[0])),i[2]),t(e(t(r(i[1],u[0]),r(-u[1],i[0])),-a[2]),e(t(r(i[1],a[0]),r(-a[1],i[0])),u[2]))),-o[3])),t(e(t(e(t(r(o[1],u[0]),r(-u[1],o[0])),i[2]),t(e(t(r(i[1],u[0]),r(-u[1],i[0])),-o[2]),e(t(r(i[1],o[0]),r(-o[1],i[0])),u[2]))),a[3]),e(t(e(t(r(o[1],a[0]),r(-a[1],o[0])),i[2]),t(e(t(r(i[1],a[0]),r(-a[1],i[0])),-o[2]),e(t(r(i[1],o[0]),r(-o[1],i[0])),a[2]))),-u[3])))),h=n(f,c);return h[h.length-1]}}function c(t){return(3===t?s:4===t?u:f)(i,n,o,a)}var h=c(3),l=c(4),p=[function(){return 0},function(){return 0},function(t,r){return r[0]-t[0]},function(t,r,e){var n,i=(t[1]-e[1])*(r[0]-e[0]),o=(t[0]-e[0])*(r[1]-e[1]),a=i-o;if(i>0){if(o<=0)return a;n=i+o}else{if(!(i<0))return a;if(o>=0)return a;n=-(i+o)}var s=33306690738754716e-32*n;return a>=s||a<=-s?a:h(t,r,e)},function(t,r,e,n){var i=t[0]-n[0],o=r[0]-n[0],a=e[0]-n[0],s=t[1]-n[1],u=r[1]-n[1],f=e[1]-n[1],c=t[2]-n[2],h=r[2]-n[2],p=e[2]-n[2],v=o*f,d=a*u,g=a*s,y=i*f,m=i*u,x=o*s,b=c*(v-d)+h*(g-y)+p*(m-x),w=7771561172376103e-31*((Math.abs(v)+Math.abs(d))*Math.abs(c)+(Math.abs(g)+Math.abs(y))*Math.abs(h)+(Math.abs(m)+Math.abs(x))*Math.abs(p));return b>w||-b>w?b:l(t,r,e,n)}];function v(t){var r=p[t.length];return r||(r=p[t.length]=c(t.length)),r.apply(void 0,t)}function d(t,r,e,n,i,o,a){return function(r,e,s,u,f){switch(arguments.length){case 0:case 1:return 0;case 2:return n(r,e);case 3:return i(r,e,s);case 4:return o(r,e,s,u);case 5:return a(r,e,s,u,f)}for(var c=new Array(arguments.length),h=0;h<arguments.length;++h)c[h]=arguments[h];return t(c)}}!function(){for(;p.length<=5;)p.push(c(p.length));t.exports=d.apply(void 0,[v].concat(p));for(var r=0;r<=5;++r)t.exports[r]=p[r]}()},8639:function(t,r){!function(t){"use strict";const r=134217729;function e(t,r,e,n,i){let o,a,s,u,f=r[0],c=n[0],h=0,l=0;c>f==c>-f?(o=f,f=r[++h]):(o=c,c=n[++l]);let p=0;if(h<t&&l<e)for(c>f==c>-f?(s=o-((a=f+o)-f),f=r[++h]):(s=o-((a=c+o)-c),c=n[++l]),o=a,0!==s&&(i[p++]=s);h<t&&l<e;)c>f==c>-f?(s=o-((a=o+f)-(u=a-o))+(f-u),f=r[++h]):(s=o-((a=o+c)-(u=a-o))+(c-u),c=n[++l]),o=a,0!==s&&(i[p++]=s);for(;h<t;)s=o-((a=o+f)-(u=a-o))+(f-u),f=r[++h],o=a,0!==s&&(i[p++]=s);for(;l<e;)s=o-((a=o+c)-(u=a-o))+(c-u),c=n[++l],o=a,0!==s&&(i[p++]=s);return 0===o&&0!==p||(i[p++]=o),p}function n(t){return new Float64Array(t)}const i=n(4),o=n(8),a=n(12),s=n(16),u=n(4);t.orient2d=function(t,n,f,c,h,l){const p=(n-l)*(f-h),v=(t-h)*(c-l),d=p-v;if(0===p||0===v||p>0!=v>0)return d;const g=Math.abs(p+v);return Math.abs(d)>=33306690738754716e-32*g?d:-function(t,n,f,c,h,l,p){let v,d,g,y,m,x,b,w,S,_,E,k,M,A,P,O,T,R;const I=t-h,j=f-h,B=n-l,L=c-l;m=(P=(w=I-(b=(x=r*I)-(x-I)))*(_=L-(S=(x=r*L)-(x-L)))-((A=I*L)-b*S-w*S-b*_))-(E=P-(T=(w=B-(b=(x=r*B)-(x-B)))*(_=j-(S=(x=r*j)-(x-j)))-((O=B*j)-b*S-w*S-b*_))),i[0]=P-(E+m)+(m-T),m=(M=A-((k=A+E)-(m=k-A))+(E-m))-(E=M-O),i[1]=M-(E+m)+(m-O),m=(R=k+E)-k,i[2]=k-(R-m)+(E-m),i[3]=R;let N=function(t,r){let e=r[0];for(let t=1;t<4;t++)e+=r[t];return e}(0,i),Y=22204460492503146e-32*p;if(N>=Y||-N>=Y)return N;if(v=t-(I+(m=t-I))+(m-h),g=f-(j+(m=f-j))+(m-h),d=n-(B+(m=n-B))+(m-l),y=c-(L+(m=c-L))+(m-l),0===v&&0===d&&0===g&&0===y)return N;if(Y=11093356479670487e-47*p+33306690738754706e-32*Math.abs(N),(N+=I*y+L*v-(B*g+j*d))>=Y||-N>=Y)return N;m=(P=(w=v-(b=(x=r*v)-(x-v)))*(_=L-(S=(x=r*L)-(x-L)))-((A=v*L)-b*S-w*S-b*_))-(E=P-(T=(w=d-(b=(x=r*d)-(x-d)))*(_=j-(S=(x=r*j)-(x-j)))-((O=d*j)-b*S-w*S-b*_))),u[0]=P-(E+m)+(m-T),m=(M=A-((k=A+E)-(m=k-A))+(E-m))-(E=M-O),u[1]=M-(E+m)+(m-O),m=(R=k+E)-k,u[2]=k-(R-m)+(E-m),u[3]=R;const C=e(4,i,4,u,o);m=(P=(w=I-(b=(x=r*I)-(x-I)))*(_=y-(S=(x=r*y)-(x-y)))-((A=I*y)-b*S-w*S-b*_))-(E=P-(T=(w=B-(b=(x=r*B)-(x-B)))*(_=g-(S=(x=r*g)-(x-g)))-((O=B*g)-b*S-w*S-b*_))),u[0]=P-(E+m)+(m-T),m=(M=A-((k=A+E)-(m=k-A))+(E-m))-(E=M-O),u[1]=M-(E+m)+(m-O),m=(R=k+E)-k,u[2]=k-(R-m)+(E-m),u[3]=R;const F=e(C,o,4,u,a);m=(P=(w=v-(b=(x=r*v)-(x-v)))*(_=y-(S=(x=r*y)-(x-y)))-((A=v*y)-b*S-w*S-b*_))-(E=P-(T=(w=d-(b=(x=r*d)-(x-d)))*(_=g-(S=(x=r*g)-(x-g)))-((O=d*g)-b*S-w*S-b*_))),u[0]=P-(E+m)+(m-T),m=(M=A-((k=A+E)-(m=k-A))+(E-m))-(E=M-O),u[1]=M-(E+m)+(m-O),m=(R=k+E)-k,u[2]=k-(R-m)+(E-m),u[3]=R;const X=e(F,a,4,u,s);return s[X-1]}(t,n,f,c,h,l,g)},t.orient2dfast=function(t,r,e,n,i,o){return(r-o)*(e-i)-(t-i)*(n-o)},Object.defineProperty(t,"__esModule",{value:!0})}(r)},5442:(t,r,e)=>{"use strict";var n=e(8005),i=e(6359);t.exports=function(t,r){var e=t.length;if(1===e){var o=n(t[0],r);return o[0]?o:[o[1]]}var a=new Array(2*e),s=[.1,.1],u=[.1,.1],f=0;n(t[0],r,s),s[0]&&(a[f++]=s[0]);for(var c=1;c<e;++c){n(t[c],r,u);var h=s[1];i(h,u[0],s),s[0]&&(a[f++]=s[0]);var l=u[1],p=s[1],v=l+p,d=p-(v-l);s[1]=v,d&&(a[f++]=d)}return s[1]&&(a[f++]=s[1]),0===f&&(a[f++]=0),a.length=f,a}},7972:t=>{"use strict";t.exports=function(t,r){var e=0|t.length,n=0|r.length;if(1===e&&1===n)return function(t,r){var e=t+r,n=e-t,i=t-(e-n)+(r-n);return i?[i,e]:[e]}(t[0],-r[0]);var i,o,a=new Array(e+n),s=0,u=0,f=0,c=Math.abs,h=t[u],l=c(h),p=-r[f],v=c(p);l<v?(o=h,(u+=1)<e&&(l=c(h=t[u]))):(o=p,(f+=1)<n&&(v=c(p=-r[f]))),u<e&&l<v||f>=n?(i=h,(u+=1)<e&&(l=c(h=t[u]))):(i=p,(f+=1)<n&&(v=c(p=-r[f])));for(var d,g,y=i+o,m=y-i,x=o-m,b=x,w=y;u<e&&f<n;)l<v?(i=h,(u+=1)<e&&(l=c(h=t[u]))):(i=p,(f+=1)<n&&(v=c(p=-r[f]))),(x=(o=b)-(m=(y=i+o)-i))&&(a[s++]=x),b=w-((d=w+y)-(g=d-w))+(y-g),w=d;for(;u<e;)(x=(o=b)-(m=(y=(i=h)+o)-i))&&(a[s++]=x),b=w-((d=w+y)-(g=d-w))+(y-g),w=d,(u+=1)<e&&(h=t[u]);for(;f<n;)(x=(o=b)-(m=(y=(i=p)+o)-i))&&(a[s++]=x),b=w-((d=w+y)-(g=d-w))+(y-g),w=d,(f+=1)<n&&(p=-r[f]);return b&&(a[s++]=b),w&&(a[s++]=w),s||(a[s++]=0),a.length=s,a}},6740:t=>{"use strict";t.exports=function(t,r){var e=0|t.length,n=0|r.length;if(1===e&&1===n)return function(t,r){var e=t+r,n=e-t,i=t-(e-n)+(r-n);return i?[i,e]:[e]}(t[0],r[0]);var i,o,a=new Array(e+n),s=0,u=0,f=0,c=Math.abs,h=t[u],l=c(h),p=r[f],v=c(p);l<v?(o=h,(u+=1)<e&&(l=c(h=t[u]))):(o=p,(f+=1)<n&&(v=c(p=r[f]))),u<e&&l<v||f>=n?(i=h,(u+=1)<e&&(l=c(h=t[u]))):(i=p,(f+=1)<n&&(v=c(p=r[f])));for(var d,g,y=i+o,m=y-i,x=o-m,b=x,w=y;u<e&&f<n;)l<v?(i=h,(u+=1)<e&&(l=c(h=t[u]))):(i=p,(f+=1)<n&&(v=c(p=r[f]))),(x=(o=b)-(m=(y=i+o)-i))&&(a[s++]=x),b=w-((d=w+y)-(g=d-w))+(y-g),w=d;for(;u<e;)(x=(o=b)-(m=(y=(i=h)+o)-i))&&(a[s++]=x),b=w-((d=w+y)-(g=d-w))+(y-g),w=d,(u+=1)<e&&(h=t[u]);for(;f<n;)(x=(o=b)-(m=(y=(i=p)+o)-i))&&(a[s++]=x),b=w-((d=w+y)-(g=d-w))+(y-g),w=d,(f+=1)<n&&(p=r[f]);return b&&(a[s++]=b),w&&(a[s++]=w),s||(a[s++]=0),a.length=s,a}},3842:(t,r,e)=>{"use strict";e.r(r),e.d(r,{default:()=>n});class n{constructor(t=[],r=i){if(this.data=t,this.length=this.data.length,this.compare=r,this.length>0)for(let t=(this.length>>1)-1;t>=0;t--)this._down(t)}push(t){this.data.push(t),this.length++,this._up(this.length-1)}pop(){if(0===this.length)return;const t=this.data[0],r=this.data.pop();return this.length--,this.length>0&&(this.data[0]=r,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:r,compare:e}=this,n=r[t];for(;t>0;){const i=t-1>>1,o=r[i];if(e(n,o)>=0)break;r[t]=o,t=i}r[t]=n}_down(t){const{data:r,compare:e}=this,n=this.length>>1,i=r[t];for(;t<n;){let n=1+(t<<1),o=r[n];const a=n+1;if(a<this.length&&e(r[a],o)<0&&(n=a,o=r[a]),e(o,i)>=0)break;r[t]=o,t=n}r[t]=i}}function i(t,r){return t<r?-1:t>r?1:0}},8005:t=>{"use strict";t.exports=function(t,e,n){var i=t*e,o=r*t,a=o-(o-t),s=t-a,u=r*e,f=u-(u-e),c=e-f,h=s*c-(i-a*f-s*f-a*c);return n?(n[0]=h,n[1]=i,n):[h,i]};var r=+(Math.pow(2,27)+1)},6359:t=>{"use strict";t.exports=function(t,r,e){var n=t+r,i=n-t,o=r-i,a=t-(n-i);return e?(e[0]=a+o,e[1]=n,e):[a+o,n]}}},r={};function e(n){var i=r[n];if(void 0!==i)return i.exports;var o=r[n]={exports:{}};return t[n].call(o.exports,o,o.exports,e),o.exports}e.n=t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},e.d=(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),e.o=(t,r)=>Object.prototype.hasOwnProperty.call(t,r),e.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";function t(t,r,e){void 0===e&&(e={});var n={type:"Feature"};return(0===e.id||e.id)&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.properties=r||{},n.geometry=t,n}function r(r,e,n){if(void 0===n&&(n={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!u(r[0])||!u(r[1]))throw new Error("coordinates must contain numbers");return t({type:"Point",coordinates:r},e,n)}function i(r,e,n){void 0===n&&(n={});for(var i=0,o=r;i<o.length;i++){var a=o[i];if(a.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<a[a.length-1].length;s++)if(a[a.length-1][s]!==a[0][s])throw new Error("First and last Position are not equivalent.")}return t({type:"Polygon",coordinates:r},e,n)}function o(r,e,n){if(void 0===n&&(n={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");return t({type:"LineString",coordinates:r},e,n)}function a(t,r){void 0===r&&(r={});var e={type:"FeatureCollection"};return r.id&&(e.id=r.id),r.bbox&&(e.bbox=r.bbox),e.features=t,e}function s(r,e,n){return void 0===n&&(n={}),t({type:"MultiPolygon",coordinates:r},e,n)}function u(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function f(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if("Feature"===t.type&&null!==t.geometry&&"Point"===t.geometry.type)return t.geometry.coordinates;if("Point"===t.type)return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function c(t){if(Array.isArray(t))return t;if("Feature"===t.type){if(null!==t.geometry)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function h(t){return"Feature"===t.type?t.geometry:t}function l(t,r){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t)throw new Error("point is required");if(!r)throw new Error("polygon is required");var n=f(t),i=h(r),o=i.type,a=r.bbox,s=i.coordinates;if(a&&!p(n,a))return!1;"Polygon"===o&&(s=[s]);for(var u=!1,c=0;c<s.length&&!u;c++){var l=v(n,s[c]);(0===l&&!e.ignoreBoundary||l)&&(u=!0)}return u}function p(t,r){return r[0]<=t[0]&&r[1]<=t[1]&&r[2]>=t[0]&&r[3]>=t[1]}function v(t,r){for(var e=0,n=0,i=0,o=0,a=0,s=0,u=0,f=0,c=null,h=null,l=t[0],p=t[1],v=r.length;e<v;e++){n=0;var d=r[e].length-1,g=r[e];for(a=(c=g[0])[0]-l,s=c[1]-p;n<d;n++)if(f=(h=g[n+1])[1]-p,s<0&&f<0||s>0&&f>0)s=f,a=(c=h)[0]-l;else{if(u=h[0]-t[0],f>0&&s<=0){if((o=a*f-u*s)>0)i+=1;else if(0===o)return 0}else if(s>0&&f<=0){if((o=a*f-u*s)<0)i+=1;else if(0===o)return 0}else if(0===f&&s<0){if(0==(o=a*f-u*s))return 0}else if(0===s&&f<0){if(0==(o=a*f-u*s))return 0}else if(0===s&&0===f){if(u<=0&&a>=0)return 0;if(a<=0&&u>=0)return 0}c=h,s=f,a=u}}return i%2!=0}function d(t,r,e){if(null!==t)for(var n,i,o,a,s,u,f,c,h=0,l=0,p=t.type,v="FeatureCollection"===p,g="Feature"===p,y=v?t.features.length:1,m=0;m<y;m++){s=(c=!!(f=v?t.features[m].geometry:g?t.geometry:t)&&"GeometryCollection"===f.type)?f.geometries.length:1;for(var x=0;x<s;x++){var b=0,w=0;if(null!==(a=c?f.geometries[x]:f)){u=a.coordinates;var S=a.type;switch(h=!e||"Polygon"!==S&&"MultiPolygon"!==S?0:1,S){case null:break;case"Point":if(!1===r(u,l,m,b,w))return!1;l++,b++;break;case"LineString":case"MultiPoint":for(n=0;n<u.length;n++){if(!1===r(u[n],l,m,b,w))return!1;l++,"MultiPoint"===S&&b++}"LineString"===S&&b++;break;case"Polygon":case"MultiLineString":for(n=0;n<u.length;n++){for(i=0;i<u[n].length-h;i++){if(!1===r(u[n][i],l,m,b,w))return!1;l++}"MultiLineString"===S&&b++,"Polygon"===S&&w++}"Polygon"===S&&b++;break;case"MultiPolygon":for(n=0;n<u.length;n++){for(w=0,i=0;i<u[n].length;i++){for(o=0;o<u[n][i].length-h;o++){if(!1===r(u[n][i][o],l,m,b,w))return!1;l++}w++}b++}break;case"GeometryCollection":for(n=0;n<a.geometries.length;n++)if(!1===d(a.geometries[n],r,e))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function g(t,r){if("Feature"===t.type)r(t,0);else if("FeatureCollection"===t.type)for(var e=0;e<t.features.length&&!1!==r(t.features[e],e);e++);}function y(r,e){!function(t,r){var e,n,i,o,a,s,u,f,c,h,l=0,p="FeatureCollection"===t.type,v="Feature"===t.type,d=p?t.features.length:1;for(e=0;e<d;e++){for(s=p?t.features[e].geometry:v?t.geometry:t,f=p?t.features[e].properties:v?t.properties:{},c=p?t.features[e].bbox:v?t.bbox:void 0,h=p?t.features[e].id:v?t.id:void 0,a=(u=!!s&&"GeometryCollection"===s.type)?s.geometries.length:1,i=0;i<a;i++)if(null!==(o=u?s.geometries[i]:s))switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===r(o,l,f,c,h))return!1;break;case"GeometryCollection":for(n=0;n<o.geometries.length;n++)if(!1===r(o.geometries[n],l,f,c,h))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===r(null,l,f,c,h))return!1;l++}}(r,(function(r,n,i,o,a){var s,u=null===r?null:r.type;switch(u){case null:case"Point":case"LineString":case"Polygon":return!1!==e(t(r,i,{bbox:o,id:a}),n,0)&&void 0}switch(u){case"MultiPoint":s="Point";break;case"MultiLineString":s="LineString";break;case"MultiPolygon":s="Polygon"}for(var f=0;f<r.coordinates.length;f++){var c=r.coordinates[f];if(!1===e(t({type:s,coordinates:c},i),n,f))return!1}}))}e.r(n),e.d(n,{default:()=>nt}),e(1249),e(1539),e(7941),e(4916),e(5306),e(1038),e(8783),e(6992),e(8674),e(3948),e(3123),e(4723),e(2707),e(7327),e(9601),e(2222),e(9600);var m=e(2273);function x(t,r){void 0===r&&(r={}),r.concavity=r.concavity||1/0;var e=[];if(d(t,(function(t){e.push([t[0],t[1]])})),!e.length)return null;var n=m(e,r.concavity);return n.length>3?i([n]):null}var b=e(2676);const w=function(t){if(!t)throw new Error("geojson is required");var r=[];return y(t,(function(t){!function(t,r){var e=[],n=t.geometry;if(null!==n){switch(n.type){case"Polygon":e=c(n);break;case"LineString":e=[c(n)]}e.forEach((function(e){var n=function(t,r){var e=[];return t.reduce((function(t,n){var i,a,s,u,f,c,h=o([t,n],r);return h.bbox=(a=n,s=(i=t)[0],u=i[1],[s<(f=a[0])?s:f,u<(c=a[1])?u:c,s>f?s:f,u>c?u:c]),e.push(h),n})),e}(e,t.properties);n.forEach((function(t){t.id=r.length,r.push(t)}))}))}}(t,r)})),a(r)};var S=e(1787);function _(t,e){var n=c(t),i=c(e);if(2!==n.length)throw new Error("<intersects> line1 must only contain 2 coordinates");if(2!==i.length)throw new Error("<intersects> line2 must only contain 2 coordinates");var o=n[0][0],a=n[0][1],s=n[1][0],u=n[1][1],f=i[0][0],h=i[0][1],l=i[1][0],p=i[1][1],v=(p-h)*(s-o)-(l-f)*(u-a);if(0===v)return null;var d=((l-f)*(a-h)-(p-h)*(o-f))/v,g=((s-o)*(a-h)-(u-a)*(o-f))/v;return d>=0&&d<=1&&g>=0&&g<=1?r([o+d*(s-o),a+d*(u-a)]):null}function E(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function k(t,r){for(var e=0;e<r.length;e++){var n=r[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function M(t,r,e){return r&&k(t.prototype,r),e&&k(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function A(t,r,e){return r in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}e(6495),e(2990),e(8927),e(3105),e(5035),e(4345),e(7174),e(2846),e(4731),e(7209),e(6319),e(8867),e(7789),e(3739),e(9368),e(4483),e(2056),e(3462),e(678),e(7462),e(3824),e(5021),e(2974),e(5016),e(9135),e(8264),e(9714),e(7042);var P=function(){function t(r){E(this,t),A(this,"_xx",void 0),A(this,"_yy",void 0),A(this,"_ii",void 0),A(this,"_nn",void 0),A(this,"_zz",void 0),A(this,"_zlimit",0),A(this,"_bb",void 0),A(this,"_allBounds",void 0),A(this,"_arcIter",void 0),A(this,"_filteredArcIter",void 0),A(this,"buf",void 0),this.initArcs(r)}return M(t,[{key:"initArcs",value:function(t){var r=[],e=[],n=t.map((function(t){for(var n=t?t.length:0,i=0;i<n;i++)r.push(t[i][0]),e.push(t[i][1]);return n}));this.initXYData(n,r,e)}},{key:"initXYData",value:function(t,r,e){var n=t.length;this._xx=new Float64Array(r),this._yy=new Float64Array(e),this._nn=new Uint32Array(t),this._zz=null,this._zlimit=0,this._filteredArcIter=null,this._ii=new Uint32Array(n);for(var i=0,o=0;o<n;o++)this._ii[o]=i,i+=t[o];i==this._xx.length&&this._xx.length==this._yy.length||O("ArcCollection#initXYData() Counting error"),this.initBounds(),this._arcIter=new V(this._xx,this._yy)}},{key:"initBounds",value:function(){var t=this.calcArcBounds_(this._xx,this._yy,this._nn);this._bb=t.bb,this._allBounds=t.bounds}},{key:"calcArcBounds_",value:function(t,r,e){for(var n,i,o,a=e.length,s=new Float64Array(4*a),u=new J,f=0,c=0;c<a;c++)(n=e[c])>0&&(i=4*c,o=W(t,r,f,n),s[i++]=o[0],s[i++]=o[1],s[i++]=o[2],s[i]=o[3],f+=n,u.mergeBounds(o));return{bb:s,bounds:u}}},{key:"getBounds",value:function(){return this._allBounds.clone()}},{key:"forEachSegment",value:function(t){for(var r=0,e=0,n=this.size();e<n;e++)r+=this.forEachArcSegment(e,t);return r}},{key:"size",value:function(){return this._ii&&this._ii.length||0}},{key:"forEachArcSegment",value:function(t,r){for(var e=t>=0,n=e?t:~t,i=this.getRetainedInterval(),o=this._nn[n],a=e?1:-1,s=e?this._ii[n]:this._ii[n]+o-1,u=s,f=0,c=1;c<o;c++)u+=a,(0===i||this._zz[u]>=i)&&(r(s,u,this._xx,this._yy),s=u,f++);return f}},{key:"getRetainedInterval",value:function(){return this._zlimit}},{key:"getVertexData",value:function(){return{xx:this._xx,yy:this._yy,zz:this._zz,bb:this._bb,nn:this._nn,ii:this._ii}}},{key:"getUint32Array",value:function(t){var r=4*t;return(!this.buf||this.buf.byteLength<r)&&(this.buf=new ArrayBuffer(r)),new Uint32Array(this.buf,0,t)}},{key:"getAvgSegment2",value:function(){var t=0,r=0,e=this.forEachSegment((function(e,n,i,o){t+=Math.abs(i[e]-i[n]),r+=Math.abs(o[e]-o[n])}));return[t/e||0,r/e||0]}},{key:"calcSegmentIntersectionStripeCount",value:function(){var t=this.getBounds().height(),r=this.getAvgSegment2()[1],e=1;return r>0&&t>0&&(e=Math.ceil(t/r/20)),e||1}},{key:"findSegmentIntersections",value:function(){var t,r,e=this.getBounds(),n=e.ymin,i=e.ymax-n,o=this.calcSegmentIntersectionStripeCount(),a=new Uint32Array(o),s=o>1?function(t){return Math.floor((o-1)*(t-n)/i)}:function(){return 0};this.forEachSegment((function(t,r,e,n){for(var i=s(n[t]),o=s(n[r]);a[i]=a[i]+2,i!=o;)i+=o>i?1:-1}));var u=this.getUint32Array(function(t,r){T(t)||O("utils.sum() expects an array, received:",t);for(var e,n=0,i=0,o=t.length;i<o;i++)(e=t[i])?n+=e:isNaN(e)&&0;return n}(a)),f=0,c=[];!function(t,r,e){if(!T(t))throw new Error("#forEach() takes an array-like argument. ".concat(t));for(var n=0,i=t.length;n<i;n++)r.call(undefined,t[n],n)}(a,(function(t){var r=f;f+=t,c.push(u.subarray(r,f))})),function(t,r){for(var e=0,n=t.length;e<n;e++)t[e]=0}(a),this.forEachSegment((function(t,r,e,n){for(var i,o,u=s(n[t]),f=s(n[r]);i=a[u],a[u]=i+2,(o=c[u])[i]=t,o[i+1]=r,u!=f;)u+=f>u?1:-1}));var h,l=this.getVertexData(),p=[];for(t=0;t<o;t++)for(h=R(c[t],l.xx,l.yy),r=0;r<h.length;r++)p.push(h[r]);return q(p)}}]),t}();function O(){for(var t=arguments.length,r=new Array(t),e=0;e<t;e++)r[e]=arguments[e];var n=r.join(" ");throw new Error(n)}function T(t){return!!t&&(!!function(t){return Array.isArray(t)}(t)||!function(t){return null!=t&&t.toString===String.prototype.toString}(t)&&(0===t.length||t.length>0))}function R(t,r,e){var n,i,o,a,s,u,f,c,h,l,p,v,d,g,y,m,x,b=t.length-2,w=[];for(function(t,r){(function(t,r){for(var e=0,n=r.length;e<n;e+=2)t[r[e]]>t[r[e+1]]&&X(r,e,e+1)})(t,r),U(t,r,0,r.length-2)}(r,t),m=0;m<b;){for(n=t[m],i=t[m+1],s=r[n],u=r[i],h=e[n],l=e[i],x=m;x<b&&!(u<(f=r[o=t[x+=2]]));){if(p=e[o],c=r[a=t[x+1]],v=e[a],h>=p){if(h>v&&l>p&&l>v)continue}else if(h<v&&l<p&&l<v)continue;n!=o&&n!=a&&i!=o&&i!=a&&(d=I(s,h,u,l,f,p,c,v))&&(g=[n,i],y=[o,a],w.push(G(d,g,y,r,e)),4==d.length&&w.push(G(d.slice(2),g,y,r,e)))}m+=2}return w}function I(t,r,e,n,i,o,a,s){var u=function(t,r,e,n,i,o,a,s){return j(t,r,e,n,i,o)*j(t,r,e,n,a,s)<=0&&j(i,o,a,s,t,r)*j(i,o,a,s,e,n)<=0}(t,r,e,n,i,o,a,s),f=null;return u&&(f=function(t,r,e,n,i,o,a,s){var u,f=L(t,r,e,n,i,o,a,s);return f&&(u=function(t,r){for(var e,n=-1,i=1/0,o=0,a=0,s=arguments.length<=2?0:arguments.length-2;a<s;o++,a+=2)(e=Y(t,r,a+2<2||arguments.length<=a+2?void 0:arguments[a+2],a+1+2<2||arguments.length<=a+1+2?void 0:arguments[a+1+2]))<i&&(i=e,n=o);return n}(f[0],f[1],t,r,e,n,i,o,a,s),1==u?f=L(e,n,t,r,i,o,a,s):2==u?f=L(i,o,a,s,t,r,e,n):3==u&&(f=L(a,s,i,o,t,r,e,n))),f&&function(t,r,e,n,i,o,a,s,u){var f=t[0],c=t[1];f=C(f,r,n),f=C(f,o,s),c=C(c,e,i),c=C(c,a,u),t[0]=f,t[1]=c}(f,t,r,e,n,i,o,a,s),f}(t,r,e,n,i,o,a,s),f?function(t,r,e,n,i,o,a,s){return t==i&&r==o||t==a&&r==s||e==i&&n==o||e==a&&n==s}(t,r,e,n,i,o,a,s)&&(f=null):f=function(t,r,e,n,i,o,a,s){var u=Math.min(t,e,i,a),f=Math.max(t,e,i,a),c=Math.min(r,n,o,s),h=Math.max(r,n,o,s),l=h-c>f-u,p=[];return(l?F(r,c,h):F(t,u,f))&&p.push(t,r),(l?F(n,c,h):F(e,u,f))&&p.push(e,n),(l?F(o,c,h):F(i,u,f))&&p.push(i,o),(l?F(s,c,h):F(a,u,f))&&p.push(a,s),(2!=p.length&&4!=p.length||4==p.length&&p[0]==p[2]&&p[1]==p[3])&&(p=null),p}(t,r,e,n,i,o,a,s)),f}function j(t,r,e,n,i,o){return B(t-i,r-o,e-i,n-o)}function B(t,r,e,n){return t*n-r*e}function L(t,r,e,n,i,o,a,s){var u,f=B(e-t,n-r,a-i,s-o);if(0===f)return null;var c=j(i,o,a,s,t,r)/f;return u=f<=1e-18&&f>=-1e-18?function(t,r,e,n,i,o,a,s){var u=null;return N(t,i,a)||N(r,o,s)?N(e,i,a)||N(n,o,s)?N(i,t,e)||N(o,r,n)?N(a,t,e)||N(s,r,n)||(u=[a,s]):u=[i,o]:u=[e,n]:u=[t,r],u}(t,r,e,n,i,o,a,s):[t+c*(e-t),r+c*(n-r)],u}function N(t,r,e){return r<e?t<r||t>e:r>e?t>r||t<e:t!=r}function Y(t,r,e,n){var i=t-e,o=r-n;return i*i+o*o}function C(t,r,e){var n;return N(t,r,e)&&(n=Math.abs(t-r)<Math.abs(t-e)?r:e,Math.abs(t-n),t=n),t}function F(t,r,e){return t>r&&t<e}function X(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function U(t,r,e,n){for(var i,o,a=e,s=n;a<n;){for(i=t[r[e+n>>2<<1]];a<=s;){for(;t[r[a]]<i;)a+=2;for(;t[r[s]]>i;)s-=2;a<=s&&(o=r[a],r[a]=r[s],r[s]=o,o=r[a+1],r[a+1]=r[s+1],r[s+1]=o,a+=2,s-=2)}if(s-e<40?D(t,r,e,s):U(t,r,e,s),n-a<40)return void D(t,r,a,n);e=a,s=n}}function D(t,r,e,n){for(var i,o,a=e+2;a<=n;a+=2){i=r[a],o=r[a+1];var s=void 0;for(s=a-2;s>=e&&t[i]<t[r[s]];s-=2)r[s+2]=r[s],r[s+3]=r[s+1];r[s+2]=i,r[s+3]=o}}function G(t,r,e,n,i){var o=t[0],a=t[1];r=z(o,a,r[0],r[1],n,i),e=z(o,a,e[0],e[1],n,i);var s=r[0]<e[0]?r:e;return{x:o,y:a,a:s,b:s==r?e:r}}function z(t,r,e,n,i,o){var a=e<n?e:n,s=a===e?n:e;return i[a]==t&&o[a]==r?s=a:i[s]==t&&o[s]==r&&(a=s),[a,s]}function q(t){var r={};return t.filter((function(t){var e=function(t){return"".concat(t.a.join(","),";").concat(t.b.join(","))}(t);return!(e in r)&&(r[e]=!0,!0)}))}var V=M((function t(r,e){E(this,t),A(this,"_i",0),A(this,"_n",0),A(this,"_inc",1),A(this,"_xx",void 0),A(this,"_yy",void 0),A(this,"i",0),A(this,"x",0),A(this,"y",0),this._xx=r,this._yy=e}));function W(t,r,e,n){var i,o,a,s,u,f,c=0|e,h=isNaN(n)?t.length-c:n+c;if(!(h>0))return[void 0,void 0,void 0,void 0];for(a=u=t[c],s=f=r[c],c++;c<h;c++)(i=t[c])<a&&(a=i),i>u&&(u=i),(o=r[c])<s&&(s=o),o>f&&(f=o);return[a,s,u,f]}var J=function(){function t(){E(this,t),A(this,"xmin",void 0),A(this,"ymin",void 0),A(this,"xmax",void 0),A(this,"ymax",void 0);for(var r=arguments.length,e=new Array(r),n=0;n<r;n++)e[n]=arguments[n];e.length>0&&this.setBounds(e)}return M(t,[{key:"cloneBounds",value:function(){return this.clone()}},{key:"clone",value:function(){return new t(this.xmin,this.ymin,this.xmax,this.ymax)}},{key:"width",value:function(){return this.xmax-this.xmin||0}},{key:"height",value:function(){return this.ymax-this.ymin||0}},{key:"setBounds",value:function(t,r,e,n){return 1==arguments.length&&(T(t)?(r=t[1],e=t[2],n=t[3],t=t[0]):(r=t.ymin,e=t.xmax,n=t.ymax,t=t.xmin)),this.xmin=t,this.ymin=r,this.xmax=e,this.ymax=n,(t>e||r>n)&&this.update(),this}},{key:"update",value:function(){var t;this.xmin>this.xmax&&(t=this.xmin,this.xmin=this.xmax,this.xmax=t),this.ymin>this.ymax&&(t=this.ymin,this.ymin=this.ymax,this.ymax=t)}},{key:"mergeBounds",value:function(r){var e,n,i,o;return r instanceof t?(e=r.xmin,n=r.ymin,i=r.xmax,o=r.ymax):3==(arguments.length<=1?0:arguments.length-1)?(e=r,n=arguments.length<=1?void 0:arguments[1],i=arguments.length<=2?void 0:arguments[2],o=arguments.length<=3?void 0:arguments[3]):4==r.length?(e=r[0],n=r[1],i=r[2],o=r[3]):O("Bounds#mergeBounds() invalid argument:",r),void 0===this.xmin?this.setBounds(e,n,i,o):(e<this.xmin&&(this.xmin=e),n<this.ymin&&(this.ymin=n),i>this.xmax&&(this.xmax=i),o>this.ymax&&(this.ymax=o)),this}}]),t}(),$=(e(2526),e(1817),e(2165),e(5589)),K=e.n($);function H(t){return H="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},H(t)}function Z(t,r,e){if(r||(r=[]),"object"!==H(t)||"FeatureCollection"!==t.type)throw"Argument points must be FeatureCollection";if(!Array.isArray(r))throw"Argument points must be Array of Array";var n=t.features.map((function(t){return t.geometry.coordinates})),o=K()(n,r),s=["a","b","c"];return a(o.map((function(r){var n={},o=r.map((function(r,i){var o=t.features[r],a=o.geometry.coordinates,u=[a[0],a[1]];return 3===a.length?u[2]=a[2]:n[s[i]]=o.properties[e],u}));return o[3]=o[0],i([o],n)})))}function Q(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function tt(t,r){for(var e=0;e<r.length;e++){var n=r[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function rt(t,r,e){return r in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}var et=2.00703,nt=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Q(this,e),rt(this,"bounds",void 0),rt(this,"boundsPolygon",void 0),rt(this,"centroid",void 0),rt(this,"edgeNodes",void 0),rt(this,"edges",void 0),rt(this,"importance",void 0),rt(this,"indexedTins",void 0),rt(this,"kinks",void 0),rt(this,"points",[]),rt(this,"pointsWeightBuffer",void 0),rt(this,"priority",void 0),rt(this,"stateBackward",void 0),rt(this,"stateFull",void 0),rt(this,"stateTriangle",void 0),rt(this,"strictMode",void 0),rt(this,"strict_status",void 0),rt(this,"tins",void 0),rt(this,"vertexMode",void 0),rt(this,"vertices_params",void 0),rt(this,"wh",void 0),rt(this,"xy",void 0),rt(this,"yaxisMode",void 0),rt(this,"pointsSet",void 0),t.bounds?this.setBounds(t.bounds):(this.setWh(t.wh),this.vertexMode=t.vertexMode||e.VERTEX_PLAIN),this.strictMode=t.strictMode||e.MODE_AUTO,this.yaxisMode=t.yaxisMode||e.YAXIS_INVERT,this.importance=t.importance||0,this.priority=t.priority||0,this.stateFull=t.stateFull||!1,t.points&&this.setPoints(t.points),t.edges&&this.setEdges(t.edges)}var n,u;return n=e,u=[{key:"getFormatVersion",value:function(){return et}},{key:"setPoints",value:function(t){this.yaxisMode==e.YAXIS_FOLLOW&&(t=t.map((function(t){return[t[0],[t[1][0],-1*t[1][1]]]}))),this.points=t,this.tins=void 0,this.indexedTins=void 0}},{key:"setEdges",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.edges=yt(t),this.edgeNodes=void 0,this.tins=void 0,this.indexedTins=void 0}},{key:"setBounds",value:function(t){this.bounds=t;for(var r=t[0][0],n=r,o=t[0][1],a=o,s=[t[0]],u=1;u<t.length;u++){var f=t[u];f[0]<r&&(r=f[0]),f[0]>n&&(n=f[0]),f[1]<o&&(o=f[1]),f[1]>a&&(a=f[1]),s.push(f)}s.push(t[0]),this.boundsPolygon=i([s]),this.xy=[r,o],this.wh=[n-r,a-o],this.vertexMode=e.VERTEX_PLAIN,this.tins=void 0,this.indexedTins=void 0}},{key:"setCompiled",value:function(t){var n=this;if(t.version||!t.tins&&t.points&&t.tins_points){this.points=t.points,this.pointsWeightBuffer=!t.version||t.version<2.00703?["forw","bakw"].reduce((function(r,e){var n=t.weight_buffer[e];return n&&(r[e]=Object.keys(n).reduce((function(t,r){return t[gt(r)]=n[r],t}),{})),r}),{}):t.weight_buffer,t.strict_status?this.strict_status=t.strict_status:t.kinks_points?this.strict_status=e.STATUS_ERROR:2==t.tins_points.length?this.strict_status=e.STATUS_LOOSE:this.strict_status=e.STATUS_STRICT,this.vertices_params={forw:[t.vertices_params[0]],bakw:[t.vertices_params[1]]},this.vertices_params.forw[1]=[0,1,2,3].map((function(r){var e=(r+1)%4;return a([dt(["c","b".concat(r),"b".concat(e)],t.points,t.edgeNodes||[],t.centroid_point,t.vertices_points,!1,et)])})),this.vertices_params.bakw[1]=[0,1,2,3].map((function(r){var e=(r+1)%4;return a([dt(["c","b".concat(r),"b".concat(e)],t.points,t.edgeNodes||[],t.centroid_point,t.vertices_points,!0,et)])})),this.centroid={forw:r(t.centroid_point[0],{target:{geom:t.centroid_point[1],index:"c"}}),bakw:r(t.centroid_point[1],{target:{geom:t.centroid_point[0],index:"c"}})},this.edges=yt(t.edges||[]),this.edgeNodes=t.edgeNodes||[];var i=1==t.tins_points.length?0:1;this.tins={forw:a(t.tins_points[0].map((function(r){return dt(r,t.points,t.edgeNodes||[],t.centroid_point,t.vertices_points,!1,t.version)}))),bakw:a(t.tins_points[i].map((function(r){return dt(r,t.points,t.edgeNodes||[],t.centroid_point,t.vertices_points,!0,t.version)})))},this.addIndexedTin(),t.kinks_points&&(this.kinks={bakw:a(t.kinks_points.map((function(t){return r(t)})))}),t.yaxisMode?this.yaxisMode=t.yaxisMode:this.yaxisMode=e.YAXIS_INVERT,t.vertexMode&&(this.vertexMode=t.vertexMode),t.strictMode&&(this.strictMode=t.strictMode),t.bounds?(this.bounds=t.bounds,this.boundsPolygon=t.boundsPolygon,this.xy=t.xy,this.wh=t.wh):(this.xy=[0,0],t.wh&&(this.wh=t.wh),this.bounds=void 0,this.boundsPolygon=void 0)}else!function(){t=JSON.parse(JSON.stringify(t).replace('"cent"','"c"').replace(/"bbox(\d+)"/g,'"b$1"')),n.tins=t.tins,n.addIndexedTin(),n.strict_status=t.strict_status,n.pointsWeightBuffer=t.weight_buffer,n.vertices_params=t.vertices_params,n.centroid=t.centroid,n.kinks=t.kinks;for(var r=[],e=function(t){var e=n.tins.forw.features[t];["a","b","c"].map((function(t,n){var i=e.geometry.coordinates[0][n],o=e.properties[t].geom,a=e.properties[t].index;r[a]=[i,o]}))},i=0;i<n.tins.forw.features.length;i++)e(i);n.points=r}();return{tins:this.tins,strict_status:this.strict_status,weight_buffer:this.pointsWeightBuffer,vertices_params:this.vertices_params,centroid:this.centroid,kinks:this.kinks}}},{key:"getCompiled",value:function(){var t={};t.version=et,t.points=this.points,t.weight_buffer=this.pointsWeightBuffer,t.centroid_point=[this.centroid.forw.geometry.coordinates,this.centroid.forw.properties.target.geom],t.vertices_params=[this.vertices_params.forw[0],this.vertices_params.bakw[0]],t.vertices_points=[];var r=this.vertices_params.forw[1];return[0,1,2,3].map((function(e){var n=r[e].features[0],i=n.geometry.coordinates[0][1],o=n.properties.b.geom;t.vertices_points[e]=[i,o]})),t.strict_status=this.strict_status,t.tins_points=[[]],this.tins.forw.features.map((function(r){t.tins_points[0].push(["a","b","c"].map((function(t){return r.properties[t].index})))})),this.strict_status==e.STATUS_LOOSE?(t.tins_points[1]=[],this.tins.bakw.features.map((function(r){t.tins_points[1].push(["a","b","c"].map((function(t){return r.properties[t].index})))}))):this.strict_status==e.STATUS_ERROR&&(t.kinks_points=this.kinks.bakw.features.map((function(t){return t.geometry.coordinates}))),t.yaxisMode=this.yaxisMode,t.vertexMode=this.vertexMode,t.strictMode=this.strictMode,this.bounds?(t.bounds=this.bounds,t.boundsPolygon=this.boundsPolygon,t.xy=this.xy,t.wh=this.wh):t.wh=this.wh,t.edges=this.edges,t.edgeNodes=this.edgeNodes,t}},{key:"addIndexedTin",value:function(){var t=this.tins,r=t.forw,e=t.bakw,n=Math.ceil(Math.sqrt(r.features.length));if(n<3)this.indexedTins=void 0;else{var i=[],o=[],a=r.features.map((function(t){var r=[];return c(t)[0].map((function(t){0===i.length?i=[Array.from(t),Array.from(t)]:(t[0]<i[0][0]&&(i[0][0]=t[0]),t[0]>i[1][0]&&(i[1][0]=t[0]),t[1]<i[0][1]&&(i[0][1]=t[1]),t[1]>i[1][1]&&(i[1][1]=t[1])),0===r.length?r=[Array.from(t),Array.from(t)]:(t[0]<r[0][0]&&(r[0][0]=t[0]),t[0]>r[1][0]&&(r[1][0]=t[0]),t[1]<r[0][1]&&(r[0][1]=t[1]),t[1]>r[1][1]&&(r[1][1]=t[1]))})),r})),s=(i[1][0]-i[0][0])/n,u=(i[1][1]-i[0][1])/n,f=a.reduce((function(t,r,e){for(var o=ht(r[0][0],i[0][0],s,n),a=ht(r[1][0],i[0][0],s,n),f=ht(r[0][1],i[0][1],u,n),c=ht(r[1][1],i[0][1],u,n),h=o;h<=a;h++){t[h]||(t[h]=[]);for(var l=f;l<=c;l++)t[h][l]||(t[h][l]=[]),t[h][l].push(e)}return t}),[]),h=e.features.map((function(t){var r=[];return c(t)[0].map((function(t){0===o.length?o=[Array.from(t),Array.from(t)]:(t[0]<o[0][0]&&(o[0][0]=t[0]),t[0]>o[1][0]&&(o[1][0]=t[0]),t[1]<o[0][1]&&(o[0][1]=t[1]),t[1]>o[1][1]&&(o[1][1]=t[1])),0===r.length?r=[Array.from(t),Array.from(t)]:(t[0]<r[0][0]&&(r[0][0]=t[0]),t[0]>r[1][0]&&(r[1][0]=t[0]),t[1]<r[0][1]&&(r[0][1]=t[1]),t[1]>r[1][1]&&(r[1][1]=t[1]))})),r})),l=(o[1][0]-o[0][0])/n,p=(o[1][1]-o[0][1])/n,v=h.reduce((function(t,r,e){for(var i=ht(r[0][0],o[0][0],l,n),a=ht(r[1][0],o[0][0],l,n),s=ht(r[0][1],o[0][1],p,n),u=ht(r[1][1],o[0][1],p,n),f=i;f<=a;f++){t[f]||(t[f]=[]);for(var c=s;c<=u;c++)t[f][c]||(t[f][c]=[]),t[f][c].push(e)}return t}),[]);this.indexedTins={forw:{gridNum:n,xOrigin:i[0][0],yOrigin:i[0][1],xUnit:s,yUnit:u,gridCache:f},bakw:{gridNum:n,xOrigin:o[0][0],yOrigin:o[0][1],xUnit:l,yUnit:p,gridCache:v}}}}},{key:"setWh",value:function(t){this.wh=t,this.xy=[0,0],this.bounds=void 0,this.boundsPolygon=void 0,this.tins=void 0,this.indexedTins=void 0}},{key:"setVertexMode",value:function(t){this.vertexMode=t,this.tins=void 0,this.indexedTins=void 0}},{key:"setStrictMode",value:function(t){this.strictMode=t,this.tins=void 0,this.indexedTins=void 0}},{key:"calcurateStrictTinAsync",value:function(){var t=this,n=this.pointsSet.edges;return Promise.all(this.tins.forw.features.map((function(t){return Promise.resolve(pt(t))}))).then((function(r){t.tins.bakw=a(r)})).then((function(){var r={};return Promise.all(t.tins.forw.features.map((function(e,n){var i=t.tins.bakw.features[n];return Promise.resolve(xt(r,{forw:e,bakw:i}))}))).then((function(){return Promise.all([mt(r),Promise.resolve(r)])})).catch((function(t){throw t}))})).then((function(o){var u=o[0],f=o[1];return u.bakw&&Object.keys(u.bakw).map((function(r){if("Not include case"!=u.bakw[r]){var e=f[r],o=function(t,r,e){void 0===e&&(e={});var n=h(t),o=h(r),a=b.union(n.coordinates,o.coordinates);return 0===a.length?null:1===a.length?i(a[0],e.properties):s(a,e.properties)}(e[0].forw,e[1].forw),c=x(a([e[0].forw,e[1].forw]));if(m=o,w=h(y=c),S=h(m),_=y.properties||{},0===(E=b.difference(w.coordinates,S.coordinates)).length||!(1===E.length?i(E[0],_):s(E,_))){var l=r.split("-");if(l[0].match(/^[0-9]+$/)&&l[1].match(/^[0-9]+$/))for(var p=l.map((function(t){return parseInt(t)})).sort((function(t,r){return t<r?-1:1})),v=0;v<n.length-1;v++)if(p[0]==n[v][0]&&p[1]==n[v][1])return;var d=l.map((function(t){return["a","b","c"].map((function(t,r){var n=e[0].bakw.properties[t];return{geom:e[0].bakw.geometry.coordinates[0][r],prop:n}})).filter((function(r){return r.prop.index==t}))[0]})),g=e.map((function(t){return["a","b","c"].map((function(r,e){var n=t.bakw.properties[r];return{geom:t.bakw.geometry.coordinates[0][e],prop:n}})).filter((function(t){return t.prop.index!=d[0].prop.index&&t.prop.index!=d[1].prop.index}))[0]}));bt(f,e[0],t.tins),bt(f,e[1],t.tins),d.map((function(r){var e=i([[r.geom,g[0].geom,g[1].geom,r.geom]],{a:r.prop,b:g[0].prop,c:g[1].prop}),n=pt(e);xt(f,{forw:n,bakw:e},t.tins)}))}}var y,m,w,S,_,E})),Promise.all(["forw","bakw"].map((function(e){return new Promise((function(n){var i;n((i=t.tins[e].features.map((function(t){return t.geometry.coordinates[0]})),q(new P(i).findSegmentIntersections()).reduce((function(t,e,n,i){return t||(t={}),t["".concat(e.x,":").concat(e.y)]=e,n!=i.length-1?t:Object.keys(t).map((function(e){return r([t[e].x,t[e].y])}))}),[])))})).catch((function(t){throw t}))}))).then((function(r){0==r[0].length&&0==r[1].length?(t.strict_status=e.STATUS_STRICT,delete t.kinks):(t.strict_status=e.STATUS_ERROR,t.kinks={},r[0].length>0&&(t.kinks.forw=a(r[0])),r[1].length>0&&(t.kinks.bakw=a(r[1])))})).catch((function(t){throw t}))})).catch((function(t){throw t}))}},{key:"generatePointsSet",value:function(){for(var t=this,r={forw:[],bakw:[]},e=0;e<this.points.length;e++){var n=st(this.points[e][0],this.points[e][1],e);r.forw.push(n),r.bakw.push(ut(n))}var i=[],o=0;this.edgeNodes=[],this.edges||(this.edges=[]);for(var s=function(e){var n=t.edges[e][2],a=Object.assign([],t.edges[e][0]),s=Object.assign([],t.edges[e][1]);if(0===a.length&&0===s.length)return i.push(n),"continue";a.unshift(t.points[n[0]][0]),a.push(t.points[n[1]][0]),s.unshift(t.points[n[0]][1]),s.push(t.points[n[1]][1]);var u=[a,s].map((function(t){var r=t.map((function(t,r,e){if(0===r)return 0;var n=e[r-1];return Math.sqrt(Math.pow(t[0]-n[0],2)+Math.pow(t[1]-n[1],2))})),e=r.reduce((function(t,r,e){return 0===e?[0]:(t.push(t[e-1]+r),t)}),[]);return e.map((function(n,i,o){var a=n/o[o.length-1];return[t[i],r[i],e[i],a]}))}));u.map((function(t,r){var e=u[r?0:1];return t.filter((function(r,e){return!(0===e||e===t.length-1||"handled"===r[4])})).map((function(t){var n=t[0],i=t[3],o=e.reduce((function(t,r,e,n){if(t)return t;var o=n[e+1];return r[3]===i?(r[4]="handled",[r]):r[3]<i&&o[3]>i?[r,o]:void 0}),void 0);if(1===o.length)return 0===r?[n,o[0][0],i]:[o[0][0],n,i];var a=o[0],s=o[1],u=(i-a[3])/(s[3]-a[3]),f=[(s[0][0]-a[0][0])*u+a[0][0],(s[0][1]-a[0][1])*u+a[0][1]];return 0===r?[n,f,i]:[f,n,i]}))})).reduce((function(t,r){return t.concat(r)}),[]).sort((function(t,r){return t[2]<r[2]?-1:1})).map((function(e,a,s){t.edgeNodes[o]=[e[0],e[1]];var u=st(e[0],e[1],"e".concat(o));o++,r.forw.push(u),r.bakw.push(ut(u)),0===a?i.push([n[0],r.forw.length-1]):i.push([r.forw.length-2,r.forw.length-1]),a===s.length-1&&i.push([r.forw.length-1,n[1]])}))},u=0;u<this.edges.length;u++)s(u);return{forw:a(r.forw),bakw:a(r.bakw),edges:i}}},{key:"updateTinAsync",value:function(){var n=this,i=this.strictMode,s=this.xy[0]-.05*this.wh[0],u=this.xy[0]+1.05*this.wh[0],f=this.xy[1]-.05*this.wh[1],h=this.xy[1]+1.05*this.wh[1],p=this.bounds?function(t){return l(t,n.boundsPolygon)}:function(t){return t[0]>=n.xy[0]&&t[0]<=n.xy[0]+n.wh[0]&&t[1]>=n.xy[1]&&t[1]<=n.xy[1]+n.wh[1]};return this.points.reduce((function(t,r){return t&&p(r[0])}),!0)?new Promise((function(t){i!=e.MODE_STRICT&&i!=e.MODE_LOOSE&&(i=e.MODE_AUTO);var r=[];n.wh&&(r=[[s,f],[u,f],[s,h],[u,h]]),t([n.generatePointsSet(),r])})).then((function(t){var e=t[0];return Promise.all([new Promise((function(t){t(Z(e.forw,e.edges,"target"))})),new Promise((function(t){t(Z(e.bakw,e.edges,"target"))})),new Promise((function(t){t(function(t,e){void 0===e&&(e={});var n=0,i=0,o=0;return d(t,(function(t){n+=t[0],i+=t[1],o++}),!0),r([n/o,i/o],e.properties)}(e.forw))})),Promise.resolve(t)]).catch((function(t){throw t}))})).then((function(t){var e=t[0],i=t[1],o=t[2],a=t[3],s=a[0];if(0==e.features.length||0==i.features.length)throw"TOO LINEAR1";var u={forw:o.geometry.coordinates,bakw:lt(o,e)},f=st(u.forw,u.bakw,"c");n.centroid={forw:f,bakw:ut(f)};var c={};return Promise.all([new Promise((function(t){var n,i=x(s.forw).geometry.coordinates[0];try{n=i.map((function(t){return{forw:t,bakw:lt(r(t),e)}}))}catch(t){throw"TOO LINEAR2"}n.map((function(t){c["".concat(t.forw[0],":").concat(t.forw[1])]=t})),t(void 0)})),new Promise((function(t){var e,n=x(s.bakw).geometry.coordinates[0];try{e=n.map((function(t){return{bakw:t,forw:lt(r(t),i)}}))}catch(t){throw"TOO LINEAR2"}e.map((function(t){c["".concat(t.forw[0],":").concat(t.forw[1])]=t})),t(void 0)}))]).then((function(){return[u,c,a]})).catch((function(t){throw t}))})).then((function(t){var r=t[0],i=t[1],o=t[2],a=Object.keys(i).reduce((function(t,e,n,o){var a=i[e].forw,c=i[e].bakw,l={forw:[a[0]-r.forw[0],a[1]-r.forw[1]]};l.bakw=[c[0]-r.bakw[0],c[1]-r.bakw[1]];var p=0==l.forw[0]?1/0:((l.forw[0]<0?s:u)-r.forw[0])/l.forw[0],v=0==l.forw[1]?1/0:((l.forw[1]<0?f:h)-r.forw[1])/l.forw[1];if(Math.abs(p)/Math.abs(v)<1.1){var d={forw:[l.forw[0]*p+r.forw[0],l.forw[1]*p+r.forw[1]],bakw:[l.bakw[0]*p+r.bakw[0],l.bakw[1]*p+r.bakw[1]]};l.forw[0]<0?t[3].push(d):t[1].push(d)}if(Math.abs(v)/Math.abs(p)<1.1){var g={forw:[l.forw[0]*v+r.forw[0],l.forw[1]*v+r.forw[1]],bakw:[l.bakw[0]*v+r.bakw[0],l.bakw[1]*v+r.bakw[1]]};l.forw[1]<0?t[0].push(g):t[2].push(g)}return t}),[[],[],[],[]]),c=Object.keys(i).reduce((function(t,o,a,s){var u=i[o].forw,f=i[o].bakw,c={forw:[u[0]-r.forw[0],u[1]-r.forw[1]]};if(c.bakw=[f[0]-r.bakw[0],r.bakw[1]-f[1]],0==c.forw[0]||0==c.forw[1])return t;var h=0;return c.forw[0]>0&&(h+=1),c.forw[1]>0&&(h+=2),t[h].push([c.forw,c.bakw]),a==s.length-1?t.length==t.filter((function(t){return t.length>0})).length&&n.vertexMode==e.VERTEX_BIRDEYE?t:t.reduce((function(t,r){return[t[0].concat(r)]}),[[]]):t}),[[],[],[],[]]).map((function(t){return t.reduce((function(t,r,e,n){t||(t=[1/0,0,0]);var i=Math.sqrt(Math.pow(r[0][0],2)+Math.pow(r[0][1],2))/Math.sqrt(Math.pow(r[1][0],2)+Math.pow(r[1][1],2));i=i<t[0]?i:t[0];var o=Math.atan2(r[0][0],r[0][1])-Math.atan2(r[1][0],r[1][1]),a=t[1]+Math.cos(o),s=t[2]+Math.sin(o);return e==n.length-1?[i,Math.atan2(s,a)]:[i,a,s]}),null)}));return 1==c.length&&(c=[c[0],c[0],c[0],c[0]]),[c,r,a,o]})).then((function(r){var e=r[0],n=r[1],i=r[2],s=r[3][0],u=r[3][1],f=e.map((function(t,r){var e=u[r],i=[e[0]-n.forw[0],e[1]-n.forw[1]],o=Math.sqrt(Math.pow(i[0],2)+Math.pow(i[1],2))/t[0],a=Math.atan2(i[0],i[1])-t[1];return{forw:e,bakw:[n.bakw[0]+o*Math.sin(a),n.bakw[1]-o*Math.cos(a)]}})),h=f[2];f[2]=f[3],f[3]=h;for(var l=[1,1,1,1],p=function(r){var e=(r+1)%4,s=o([f[r].bakw,f[e].bakw]);i[r].map((function(i){var u=o([n.bakw,i.bakw]),f=function(r,e){var n={},i=[];if("LineString"===r.type&&(r=t(r)),"LineString"===e.type&&(e=t(e)),"Feature"===r.type&&"Feature"===e.type&&null!==r.geometry&&null!==e.geometry&&"LineString"===r.geometry.type&&"LineString"===e.geometry.type&&2===r.geometry.coordinates.length&&2===e.geometry.coordinates.length){var o=_(r,e);return o&&i.push(o),a(i)}var s=S();return s.load(w(e)),g(w(r),(function(t){g(s.search(t),(function(r){var e=_(t,r);if(e){var o=c(e).join(",");n[o]||(n[o]=!0,i.push(e))}}))})),a(i)}(s,u);if(f.features.length>0&&f.features[0].geometry){var h=f.features[0],p=Math.sqrt(Math.pow(i.bakw[0]-n.bakw[0],2)+Math.pow(i.bakw[1]-n.bakw[1],2))/Math.sqrt(Math.pow(h.geometry.coordinates[0]-n.bakw[0],2)+Math.pow(h.geometry.coordinates[1]-n.bakw[1],2));p>l[r]&&(l[r]=p),p>l[e]&&(l[e]=p)}}))},v=0;v<4;v++)p(v);return[f=f.map((function(t,r){var e=l[r],i=[(t.bakw[0]-n.bakw[0])*e+n.bakw[0],(t.bakw[1]-n.bakw[1])*e+n.bakw[1]];return{forw:t.forw,bakw:i}})),s]})).then((function(t){for(var r=t[0],o=t[1],a={forw:[],bakw:[]},s=0;s<r.length;s++){var u=st(r[s].forw,r[s].bakw,"b".concat(s)),f=ut(u);o.forw.features.push(u),o.bakw.features.push(f),a.forw.push(u),a.bakw.push(f)}return n.pointsSet=o,n.tins={forw:it(Z(o.forw,o.edges,"target"))},(i==e.MODE_STRICT||i==e.MODE_AUTO?n.calcurateStrictTinAsync():Promise.resolve()).then((function(){return(i==e.MODE_LOOSE||i==e.MODE_AUTO&&n.strict_status==e.STATUS_ERROR)&&(n.tins.bakw=it(Z(o.bakw,o.edges,"target")),delete n.kinks,n.strict_status=e.STATUS_LOOSE),n.vertices_params={forw:ot(a.forw,n.centroid.forw),bakw:ot(a.bakw,n.centroid.bakw)},n.addIndexedTin(),n.calculatePointsWeightAsync()})).catch((function(t){throw t}))})).catch((function(t){throw t})):new Promise((function(t,r){r("SOME POINTS OUTSIDE")}))}},{key:"transform",value:function(t,n,i){var o=this;if(n&&this.strict_status==e.STATUS_ERROR)throw'Backward transform is not allowed if strict_status == "strict_error"';this.yaxisMode==e.YAXIS_FOLLOW&&n&&(t=[t[0],-1*t[1]]);var a=r(t);if(this.bounds&&!n&&!i&&!l(a,this.boundsPolygon))return!1;var s=n?this.tins.bakw:this.tins.forw,u=n?this.indexedTins.bakw:this.indexedTins.forw,f=n?this.vertices_params.bakw:this.vertices_params.forw,c=n?this.centroid.bakw:this.centroid.forw,h=n?this.pointsWeightBuffer.bakw:this.pointsWeightBuffer.forw,p=void 0,v=void 0;this.stateFull&&(this.stateBackward==n?p=this.stateTriangle:(this.stateBackward=n,this.stateTriangle=void 0),v=function(t){o.stateTriangle=t});var d=lt(a,s,u,f,c,h,p,v);if(this.bounds&&n&&!i){if(!l(r(d),this.boundsPolygon))return!1}else this.yaxisMode!=e.YAXIS_FOLLOW||n||(d=[d[0],-1*d[1]]);return d}},{key:"calculatePointsWeightAsync",value:function(){var t=this,r=["forw"];this.strict_status==e.STATUS_LOOSE&&r.push("bakw");var n={};return Promise.all(r.map((function(r){n[r]={};var e={},i=t.tins[r];return Promise.all(i.features.map((function(t){var i=["a","b","c"];return new Promise((function(o){for(var a=0;a<3;a++){var s=(a+1)%3,u=i[a],f=i[s],c=t.properties[u].index,h=t.properties[f].index,l=[c,h].sort().join("-");if(!e[l]){var p=t.geometry.coordinates[0][a],v=t.geometry.coordinates[0][s],d=t.properties[u].geom,g=t.properties[f].geom;e[l]=1;var y=Math.sqrt(Math.pow(d[0]-g[0],2)+Math.pow(d[1]-g[1],2))/Math.sqrt(Math.pow(p[0]-v[0],2)+Math.pow(p[1]-v[1],2));n[r][c]||(n[r][c]={}),n[r][h]||(n[r][h]={}),n[r][c][l]=y,n[r][h][l]=y}}o(void 0)}))}))).catch((function(t){throw t}))}))).then((function(){var i={};r.map((function(r){i[r]={},t.strict_status==e.STATUS_STRICT&&(i.bakw={}),Object.keys(n[r]).map((function(o){i[r][o]=Object.keys(n[r][o]).reduce((function(t,e,i,a){return t+=n[r][o][e],i==a.length-1?t/a.length:t}),0),t.strict_status==e.STATUS_STRICT&&(i.bakw[o]=1/i[r][o])})),i[r].c=[0,1,2,3].reduce((function(t,e){var n="b".concat(e);return t+=i[r][n],3==e?t/4:t}),0),t.strict_status==e.STATUS_STRICT&&(i.bakw.c=1/i[r].c)})),t.pointsWeightBuffer=i})).catch((function(t){throw t}))}}],u&&tt(n.prototype,u),Object.defineProperty(n,"prototype",{writable:!1}),e}();function it(t){for(var r=t.features,e=0;e<r.length;e++){var n=r[e];"b"==="".concat(n.properties.a.index).substring(0,1)&&"b"==="".concat(n.properties.b.index).substring(0,1)?r[e]={geometry:{type:"Polygon",coordinates:[[n.geometry.coordinates[0][2],n.geometry.coordinates[0][0],n.geometry.coordinates[0][1],n.geometry.coordinates[0][2]]]},properties:{a:{geom:n.properties.c.geom,index:n.properties.c.index},b:{geom:n.properties.a.geom,index:n.properties.a.index},c:{geom:n.properties.b.geom,index:n.properties.b.index}},type:"Feature"}:"b"==="".concat(n.properties.c.index).substring(0,1)&&"b"==="".concat(n.properties.a.index).substring(0,1)&&(r[e]={geometry:{type:"Polygon",coordinates:[[n.geometry.coordinates[0][1],n.geometry.coordinates[0][2],n.geometry.coordinates[0][0],n.geometry.coordinates[0][1]]]},properties:{a:{geom:n.properties.b.geom,index:n.properties.b.index},b:{geom:n.properties.c.geom,index:n.properties.c.index},c:{geom:n.properties.a.geom,index:n.properties.a.index}},type:"Feature"})}return t}function ot(t,r){var e=r.geometry.coordinates;return[0,1,2,3].map((function(n){var o=(n+1)%4,s=t[n],u=t[o],f=s.geometry.coordinates;return[Math.atan2(f[0]-e[0],f[1]-e[1]),a([i([[r,s,u,r].map((function(t){return t.geometry.coordinates}))],{a:{geom:r.properties.target.geom,index:r.properties.target.index},b:{geom:s.properties.target.geom,index:s.properties.target.index},c:{geom:u.properties.target.geom,index:u.properties.target.index}})])]})).reduce((function(t,r){return t[0].push(r[0]),t[1].push(r[1]),t}),[[],[]])}function at(t){for(var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],e=r?function(t){return!(t>=0&&t<2*Math.PI)}:function(t){return!(t>-1*Math.PI&&t<=Math.PI)};e(t);)t+=2*Math.PI*(t>0?-1:1);return t}function st(t,e,n){return r(t,{target:{geom:e,index:n}})}function ut(t){return r(t.properties.target.geom,{target:{geom:t.geometry.coordinates,index:t.properties.target.index}})}function ft(t,r,e){var n=r.geometry.coordinates[0][0],i=r.geometry.coordinates[0][1],o=r.geometry.coordinates[0][2],a=t.geometry.coordinates,s=r.properties.a.geom,u=r.properties.b.geom,f=r.properties.c.geom,c=[i[0]-n[0],i[1]-n[1]],h=[o[0]-n[0],o[1]-n[1]],l=[a[0]-n[0],a[1]-n[1]],p=[u[0]-s[0],u[1]-s[1]],v=[f[0]-s[0],f[1]-s[1]],d=(h[1]*l[0]-h[0]*l[1])/(c[0]*h[1]-c[1]*h[0]),g=(c[0]*l[1]-c[1]*l[0])/(c[0]*h[1]-c[1]*h[0]);if(e){var y,m=e[r.properties.a.index],x=e[r.properties.b.index],b=e[r.properties.c.index];if(d<0||g<0||1-d-g<0){var w=d/(d+g),S=g/(d+g);y=d/x/(w/x+S/b),g=g/b/(w/x+S/b)}else y=d/x/(d/x+g/b+(1-d-g)/m),g=g/b/(d/x+g/b+(1-d-g)/m);d=y}return[d*p[0]+g*v[0]+s[0],d*p[1]+g*v[1]+s[1]]}function ct(t,r){for(var e=0;e<r.features.length;e++)if(l(t,r.features[e]))return r.features[e]}function ht(t,r,e,n){var i=Math.floor((t-r)/e);return i>=n&&(i=n-1),i}function lt(t,r,e,n,i,o,s,u){var f;if(s&&(f=ct(t,a([s]))),!f){if(e){var c=t.geometry.coordinates,h=e.gridNum,l=e.xOrigin,p=e.yOrigin,v=e.xUnit,d=e.yUnit,g=e.gridCache,y=ht(c[0],l,v,h),m=ht(c[1],p,d,h),x=g[y]&&g[y][m]?g[y][m]:[];r=a(x.map((function(t){return r.features[t]})))}f=ct(t,r)}return u&&u(f),f?ft(t,f,o):function(t,r,e,n){var i=t.geometry.coordinates,o=e.geometry.coordinates,a=function(t,r){for(var e,n=at(t-r[0]),i=2*Math.PI,o=0;o<r.length;o++){var a=at(t-r[(o+1)%r.length]),s=Math.min(Math.abs(n),Math.abs(a));n*a<=0&&s<i&&(i=s,e=o),n=a}return e}(Math.atan2(i[0]-o[0],i[1]-o[1]),r[0]);return ft(t,r[1][a].features[0],n)}(t,n,i,o)}function pt(t){var r=["a","b","c","a"].map((function(r){return t.properties[r].geom})),e=t.geometry.coordinates[0],n=t.properties;return i([r],{a:{geom:e[0],index:n.a.index},b:{geom:e[1],index:n.b.index},c:{geom:e[2],index:n.c.index}})}function vt(t){return i([[0,1,2,0].map((function(r){return t[r][0][0]}))],{a:{geom:t[0][0][1],index:t[0][1]},b:{geom:t[1][0][1],index:t[1][1]},c:{geom:t[2][0][1],index:t[2][1]}})}function dt(t,r,e,n,i){var o=arguments.length>5&&void 0!==arguments[5]&&arguments[5],a=arguments.length>6?arguments[6]:void 0,s=t.map((function(t){(!a||a<2.00703)&&(t=gt(t));var s=isFinite(t)?r[t]:"c"===t?n:"b0"===t?i[0]:"b1"===t?i[1]:"b2"===t?i[2]:"b3"===t?i[3]:function(){var r=t.match(/e(\d+)/);if(r){var n=parseInt(r[1]);return e[n]}throw"Bad index value for indexesToTri"}();return o?[[s[1],s[0]],t]:[[s[0],s[1]],t]}));return vt(s)}function gt(t){return"number"==typeof t?t:t.replace(/^(c|e|b)(?:ent|dgeNode|box)(\d+)?$/,"$1$2")}function yt(t,r){return r&&r>=2.00703||Array.isArray(t[0])?t:t.map((function(t){return[t.illstNodes,t.mercNodes,t.startEnd]}))}function mt(t){var r={forw:{},bakw:{}};return Promise.all(Object.keys(t).map((function(r){return new Promise((function(e){var n=t[r];if(n.length<2)return e(void 0);["forw","bakw"].map((function(t){var r=function(t,r,e){void 0===e&&(e={});var n=h(t),o=h(r),a=b.intersection(n.coordinates,o.coordinates);return 0===a.length?null:1===a.length?i(a[0],e.properties):s(a,e.properties)}(n[0][t],n[1][t]);if(!r||"Point"==r.geometry.type||"LineString"==r.geometry.type)return e(void 0);e(void 0)}))}))}))).then((function(){return 0==Object.keys(r.forw).length&&delete r.forw,0==Object.keys(r.bakw).length&&delete r.bakw,r})).catch((function(t){throw t}))}function xt(t,r,e){var n=wt(r.forw),i=wt(r.bakw);if(JSON.stringify(n)!=JSON.stringify(i))throw"".concat(JSON.stringify(r,null,2),"\n").concat(JSON.stringify(n),"\n").concat(JSON.stringify(i));for(var o=0;o<n.length;o++){var a=n[o];t[a]||(t[a]=[]),t[a].push(r)}e&&(e.forw.features.push(r.forw),e.bakw.features.push(r.bakw))}function bt(t,r,e){var n=wt(r.forw),i=wt(r.bakw);if(JSON.stringify(n)!=JSON.stringify(i))throw"".concat(JSON.stringify(r,null,2),"\n").concat(JSON.stringify(n),"\n").concat(JSON.stringify(i));for(var o=0;o<n.length;o++){var a=n[o],s=t[a].filter((function(t){return t.forw!=r.forw}));0==s.length?delete t[a]:t[a]=s}if(e){var u=e.forw.features.filter((function(t){return t!=r.forw}));e.forw.features=u,u=e.bakw.features.filter((function(t){return t!=r.bakw})),e.bakw.features=u}}function wt(t){var r=["a","b","c"].map((function(r){return t.properties[r].index}));return[[0,1],[0,2],[1,2],[0,1,2]].map((function(t){return t.map((function(t){return r[t]})).sort().join("-")})).sort()}rt(nt,"VERTEX_PLAIN","plain"),rt(nt,"VERTEX_BIRDEYE","birdeye"),rt(nt,"MODE_STRICT","strict"),rt(nt,"MODE_AUTO","auto"),rt(nt,"MODE_LOOSE","loose"),rt(nt,"STATUS_STRICT","strict"),rt(nt,"STATUS_ERROR","strict_error"),rt(nt,"STATUS_LOOSE","loose"),rt(nt,"YAXIS_FOLLOW","follow"),rt(nt,"YAXIS_INVERT","invert"),e.g.Tin=nt})(),n})()));
3
3
  //# sourceMappingURL=index.js.map