zh-mapbox 0.1.47 → 0.1.48

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.
Files changed (2) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see index.js.LICENSE.txt */
2
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("zMapUtil",[],e):"object"==typeof exports?exports.zMapUtil=e():t.zMapUtil=e()}(this,(()=>{return e={705:(t,e,n)=>{"use strict";var r=n(540);function i(t){var e=[1/0,1/0,-1/0,-1/0];return r.coordEach(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}e.Z=i.default=i},102:(t,e)=>{"use strict";function n(t,e,n){var r={type:"Feature"};return 0!==(n=void 0===n?{}:n).id&&!n.id||(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=e||{},r.geometry=t,r}function r(t,e,r){if(void 0===r&&(r={}),!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(f(t[0])&&f(t[1]))return n({type:"Point",coordinates:t},e,r);throw new Error("coordinates must contain numbers")}function i(t,e,r){void 0===r&&(r={});for(var i=0,o=t;i<o.length;i++){var s=o[i];if(s.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<s[s.length-1].length;a++)if(s[s.length-1][a]!==s[0][a])throw new Error("First and last Position are not equivalent.")}return n({type:"Polygon",coordinates:t},e,r)}function o(t,e,r){if(void 0===r&&(r={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");return n({type:"LineString",coordinates:t},e,r)}function s(t,e){var n={type:"FeatureCollection"};return(e=void 0===e?{}:e).id&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.features=t,n}function a(t,e,r){return n({type:"MultiLineString",coordinates:t},e,r=void 0===r?{}:r)}function u(t,e,r){return n({type:"MultiPoint",coordinates:t},e,r=void 0===r?{}:r)}function l(t,e,r){return n({type:"MultiPolygon",coordinates:t},e,r=void 0===r?{}:r)}function c(t,n){var r=e.factors[n=void 0===n?"kilometers":n];if(r)return t*r;throw new Error(n+" units is invalid")}function h(t,n){var r=e.factors[n=void 0===n?"kilometers":n];if(r)return t/r;throw new Error(n+" units is invalid")}function p(t){return t%(2*Math.PI)*180/Math.PI}function f(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.earthRadius=6371008.8,e.factors={centimeters:100*e.earthRadius,centimetres:100*e.earthRadius,degrees:e.earthRadius/111325,feet:3.28084*e.earthRadius,inches:39.37*e.earthRadius,kilometers:e.earthRadius/1e3,kilometres:e.earthRadius/1e3,meters:e.earthRadius,metres:e.earthRadius,miles:e.earthRadius/1609.344,millimeters:1e3*e.earthRadius,millimetres:1e3*e.earthRadius,nauticalmiles:e.earthRadius/1852,radians:1,yards:1.0936*e.earthRadius},e.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/e.earthRadius,yards:1.0936133},e.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},e.feature=n,e.geometry=function(t,e,n){switch(void 0===n&&(n={}),t){case"Point":return r(e).geometry;case"LineString":return o(e).geometry;case"Polygon":return i(e).geometry;case"MultiPoint":return u(e).geometry;case"MultiLineString":return a(e).geometry;case"MultiPolygon":return l(e).geometry;default:throw new Error(t+" is invalid")}},e.point=r,e.points=function(t,e,n){return void 0===n&&(n={}),s(t.map((function(t){return r(t,e)})),n)},e.polygon=i,e.polygons=function(t,e,n){return void 0===n&&(n={}),s(t.map((function(t){return i(t,e)})),n)},e.lineString=o,e.lineStrings=function(t,e,n){return void 0===n&&(n={}),s(t.map((function(t){return o(t,e)})),n)},e.featureCollection=s,e.multiLineString=a,e.multiPoint=u,e.multiPolygon=l,e.geometryCollection=function(t,e,r){return n({type:"GeometryCollection",geometries:t},e,r=void 0===r?{}:r)},e.round=function(t,e){if(!(e=void 0===e?0:e)||0<=e)return e=Math.pow(10,e||0),Math.round(t*e)/e;throw new Error("precision must be a positive number")},e.radiansToLength=c,e.lengthToRadians=h,e.lengthToDegrees=function(t,e){return p(h(t,e))},e.bearingToAzimuth=function(t){return(t%=360)<0&&(t+=360),t},e.radiansToDegrees=p,e.degreesToRadians=function(t){return t%360*Math.PI/180},e.convertLength=function(t,e,n){if(void 0===e&&(e="kilometers"),void 0===n&&(n="kilometers"),0<=t)return c(h(t,e),n);throw new Error("length must be a positive number")},e.convertArea=function(t,n,r){if(void 0===n&&(n="meters"),void 0===r&&(r="kilometers"),!(0<=t))throw new Error("area must be a positive number");if(!(n=e.areaFactors[n]))throw new Error("invalid original units");if(r=e.areaFactors[r])return t/n*r;throw new Error("invalid final units")},e.isNumber=f,e.isObject=function(t){return!!t&&t.constructor===Object},e.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(!f(t))throw new Error("bbox must only contain numbers")}))},e.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")}},540:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(102);function i(t,e,n){if(null!==t)for(var r,o,s,a=0,u=t.type,l="FeatureCollection"===u,c="Feature"===u,h=l?t.features.length:1,p=0;p<h;p++)for(var f,g,d=(g=!!(f=l?t.features[p].geometry:c?t.geometry:t)&&"GeometryCollection"===f.type)?f.geometries.length:1,y=0;y<d;y++){var m=0,_=0,v=g?f.geometries[y]:f;if(null!==v){var x=v.coordinates,E=v.type,b=!n||"Polygon"!==E&&"MultiPolygon"!==E?0:1;switch(E){case null:break;case"Point":if(!1===e(x,a,p,m,_))return!1;a++,m++;break;case"LineString":case"MultiPoint":for(r=0;r<x.length;r++){if(!1===e(x[r],a,p,m,_))return!1;a++,"MultiPoint"===E&&m++}"LineString"===E&&m++;break;case"Polygon":case"MultiLineString":for(r=0;r<x.length;r++){for(o=0;o<x[r].length-b;o++){if(!1===e(x[r][o],a,p,m,_))return!1;a++}"MultiLineString"===E&&m++,"Polygon"===E&&_++}"Polygon"===E&&m++;break;case"MultiPolygon":for(r=0;r<x.length;r++){for(o=_=0;o<x[r].length;o++){for(s=0;s<x[r][o].length-b;s++){if(!1===e(x[r][o][s],a,p,m,_))return!1;a++}_++}m++}break;case"GeometryCollection":for(r=0;r<v.geometries.length;r++)if(!1===i(v.geometries[r],e,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}function o(t,e){var n;switch(t.type){case"FeatureCollection":for(n=0;n<t.features.length&&!1!==e(t.features[n].properties,n);n++);break;case"Feature":e(t.properties,0)}}function s(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var n=0;n<t.features.length&&!1!==e(t.features[n],n);n++);}function a(t,e){for(var n,r,i,o,s,a,u,l,c,h=0,p="FeatureCollection"===t.type,f="Feature"===t.type,g=p?t.features.length:1,d=0;d<g;d++){for(s=p?t.features[d].geometry:f?t.geometry:t,u=p?t.features[d].properties:f?t.properties:{},l=p?t.features[d].bbox:f?t.bbox:void 0,c=p?t.features[d].id:f?t.id:void 0,o=(a=!!s&&"GeometryCollection"===s.type)?s.geometries.length:1,r=0;r<o;r++)if(null===(i=a?s.geometries[r]:s)){if(!1===e(null,h,u,l,c))return!1}else switch(i.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===e(i,h,u,l,c))return!1;break;case"GeometryCollection":for(n=0;n<i.geometries.length;n++)if(!1===e(i.geometries[n],h,u,l,c))return!1;break;default:throw new Error("Unknown Geometry Type")}h++}}function u(t,e){a(t,(function(t,n,i,o,s){var a,u=null===t?null:t.type;switch(u){case null:case"Point":case"LineString":case"Polygon":return!1!==e(r.feature(t,i,{bbox:o,id:s}),n,0)&&void 0}switch(u){case"MultiPoint":a="Point";break;case"MultiLineString":a="LineString";break;case"MultiPolygon":a="Polygon"}for(var l=0;l<t.coordinates.length;l++){var c=t.coordinates[l];if(!1===e(r.feature({type:a,coordinates:c},i),n,l))return!1}}))}function l(t,e){u(t,(function(t,n,o){var s=0;if(t.geometry){var a,u,l,c,h=t.geometry.type;if("Point"!==h&&"MultiPoint"!==h)return c=l=u=0,!1!==i(t,(function(i,h,p,f,g){if(void 0===a||u<n||l<f||c<g)a=i,u=n,l=f,c=g,s=0;else{if(f=r.lineString([a,i],t.properties),!1===e(f,n,o,g,s))return!1;s++,a=i}}))&&void 0}}))}function c(t,e){if(!t)throw new Error("geojson is required");u(t,(function(t,n,i){if(null!==t.geometry){var o=t.geometry.type,s=t.geometry.coordinates;switch(o){case"LineString":if(!1===e(t,n,i,0,0))return!1;break;case"Polygon":for(var a=0;a<s.length;a++)if(!1===e(r.lineString(s[a],t.properties),n,i,a))return!1}}}))}e.coordAll=function(t){var e=[];return i(t,(function(t){e.push(t)})),e},e.coordEach=i,e.coordReduce=function(t,e,n,r){var o=n;return i(t,(function(t,r,i,s,a){o=0===r&&void 0===n?t:e(o,t,r,i,s,a)}),r),o},e.featureEach=s,e.featureReduce=function(t,e,n){var r=n;return s(t,(function(t,i){r=0===i&&void 0===n?t:e(r,t,i)})),r},e.findPoint=function(t,e){if(!r.isObject(e=e||{}))throw new Error("options is invalid");var n,i=e.featureIndex||0,o=e.multiFeatureIndex||0,s=e.geometryIndex||0,a=e.coordIndex||0,u=e.properties;switch(t.type){case"FeatureCollection":i<0&&(i=t.features.length+i),u=u||t.features[i].properties,n=t.features[i].geometry;break;case"Feature":u=u||t.properties,n=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":n=t;break;default:throw new Error("geojson is invalid")}if(null===n)return null;var l=n.coordinates;switch(n.type){case"Point":return r.point(l,u,e);case"MultiPoint":return o<0&&(o=l.length+o),r.point(l[o],u,e);case"LineString":return a<0&&(a=l.length+a),r.point(l[a],u,e);case"Polygon":return s<0&&(s=l.length+s),a<0&&(a=l[s].length+a),r.point(l[s][a],u,e);case"MultiLineString":return o<0&&(o=l.length+o),a<0&&(a=l[o].length+a),r.point(l[o][a],u,e);case"MultiPolygon":return o<0&&(o=l.length+o),s<0&&(s=l[o].length+s),a<0&&(a=l[o][s].length-a),r.point(l[o][s][a],u,e)}throw new Error("geojson is invalid")},e.findSegment=function(t,e){if(!r.isObject(e=e||{}))throw new Error("options is invalid");var n,i=e.featureIndex||0,o=e.multiFeatureIndex||0,s=e.geometryIndex||0,a=e.segmentIndex||0,u=e.properties;switch(t.type){case"FeatureCollection":i<0&&(i=t.features.length+i),u=u||t.features[i].properties,n=t.features[i].geometry;break;case"Feature":u=u||t.properties,n=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":n=t;break;default:throw new Error("geojson is invalid")}if(null===n)return null;var l=n.coordinates;switch(n.type){case"Point":case"MultiPoint":return null;case"LineString":return a<0&&(a=l.length+a-1),r.lineString([l[a],l[a+1]],u,e);case"Polygon":return s<0&&(s=l.length+s),a<0&&(a=l[s].length+a-1),r.lineString([l[s][a],l[s][a+1]],u,e);case"MultiLineString":return o<0&&(o=l.length+o),a<0&&(a=l[o].length+a-1),r.lineString([l[o][a],l[o][a+1]],u,e);case"MultiPolygon":return o<0&&(o=l.length+o),s<0&&(s=l[o].length+s),a<0&&(a=l[o][s].length-a-1),r.lineString([l[o][s][a],l[o][s][a+1]],u,e)}throw new Error("geojson is invalid")},e.flattenEach=u,e.flattenReduce=function(t,e,n){var r=n;return u(t,(function(t,i,o){r=0===i&&0===o&&void 0===n?t:e(r,t,i,o)})),r},e.geomEach=a,e.geomReduce=function(t,e,n){var r=n;return a(t,(function(t,i,o,s,a){r=0===i&&void 0===n?t:e(r,t,i,o,s,a)})),r},e.lineEach=c,e.lineReduce=function(t,e,n){var r=n;return c(t,(function(t,i,o,s){r=0===i&&void 0===n?t:e(r,t,i,o,s)})),r},e.propEach=o,e.propReduce=function(t,e,n){var r=n;return o(t,(function(t,i){r=0===i&&void 0===n?t:e(r,t,i)})),r},e.segmentEach=l,e.segmentReduce=function(t,e,n){var r=n,i=!1;return l(t,(function(t,o,s,a,u){r=!1===i&&void 0===n?t:e(r,t,o,s,a,u),i=!0})),r}},630:function(t){var e;e=function(){return e=[function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isNotPNG=function(t){return t===o},e.isNotAPNG=function(t){return t===s},e.default=function(t){var e=new Uint8Array(t);if(Array.prototype.some.call(a,(function(t,n){return t!==e[n]})))return o;var n=!1;if(u(e,(function(t){return!(n="acTL"===t)})),!n)return s;var r=[],p=[],f=null,g=null,d=0,y=new i.APNG;if(u(e,(function(t,e,n,o){var s=new DataView(e.buffer);switch(t){case"IHDR":f=e.subarray(n+8,n+8+o),y.width=s.getUint32(n+8),y.height=s.getUint32(n+12);break;case"acTL":y.numPlays=s.getUint32(n+8+4);break;case"fcTL":g&&(y.frames.push(g),d++),(g=new i.Frame).width=s.getUint32(n+8+4),g.height=s.getUint32(n+8+8),g.left=s.getUint32(n+8+12),g.top=s.getUint32(n+8+16);var a=s.getUint16(n+8+20),u=s.getUint16(n+8+22);g.delay=1e3*a/(u=0===u?100:u),g.delay<=10&&(g.delay=100),y.playTime+=g.delay,g.disposeOp=s.getUint8(n+8+24),g.blendOp=s.getUint8(n+8+25),g.dataParts=[],0===d&&2===g.disposeOp&&(g.disposeOp=1);break;case"fdAT":g&&g.dataParts.push(e.subarray(n+8+4,n+8+o));break;case"IDAT":g&&g.dataParts.push(e.subarray(n+8,n+8+o));break;case"IEND":p.push(l(e,n,12+o));break;default:r.push(l(e,n,12+o))}})),g&&y.frames.push(g),0==y.frames.length)return s;var m=new Blob(r),_=new Blob(p);return y.frames.forEach((function(t){var e=[];e.push(a),f.set(h(t.width),0),f.set(h(t.height),4),e.push(c("IHDR",f)),e.push(m),t.dataParts.forEach((function(t){return e.push(c("IDAT",t))})),e.push(_),t.imageData=new Blob(e,{type:"image/png"}),delete t.dataParts,e=null})),y};var r=(e=n(1))&&e.__esModule?e:{default:e},i=n(2),o=new Error("Not a PNG"),s=new Error("Not an animated PNG"),a=new Uint8Array([137,80,78,71,13,10,26,10]);function u(t,e){for(var n,r,i,o=new DataView(t.buffer),s=8;r=o.getUint32(s),i=e(n=function(t,e,n){return t=Array.prototype.slice.call(t.subarray(e,e+4)),String.fromCharCode.apply(String,t)}(t,s+4),t,s,r),s+=12+r,!1!==i&&"IEND"!=n&&s<t.length;);}function l(t,e,n){var r=new Uint8Array(n);return r.set(t.subarray(e,e+n)),r}var c=function(t,e){var n=t.length+e.length,i=new Uint8Array(n+8),o=new DataView(i.buffer);return o.setUint32(0,e.length),i.set(function(t){for(var e=new Uint8Array(t.length),n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}(t),4),i.set(e,8),t=(0,r.default)(i,4,n),o.setUint32(n+4,t),i},h=function(t){return new Uint8Array([t>>>24&255,t>>>16&255,t>>>8&255,255&t])}},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){for(var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,r=-1,i=e,o=e+(2<arguments.length&&void 0!==arguments[2]?arguments[2]:t.length-e);i<o;i++)r=r>>>8^n[255&(r^t[i])];return-1^r};for(var n=new Uint32Array(256),r=0;r<256;r++){for(var i=r,o=0;o<8;o++)i=0!=(1&i)?3988292384^i>>>1:i>>>1;n[r]=i}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Frame=e.APNG=void 0;var r=function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t};function i(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)}}var o=(n=n(3))&&n.__esModule?n:{default:n};function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(){s(this,a),this.width=0,this.height=0,this.numPlays=0,this.playTime=0,this.frames=[]}function u(){s(this,u),this.left=0,this.top=0,this.width=0,this.height=0,this.delay=0,this.disposeOp=0,this.blendOp=0,this.imageData=null,this.imageElement=null}e.APNG=(r(a,[{key:"createImages",value:function(){return Promise.all(this.frames.map((function(t){return t.createImage()})))}},{key:"getPlayer",value:function(t){var e=this,n=1<arguments.length&&void 0!==arguments[1]&&arguments[1];return this.createImages().then((function(){return new o.default(e,t,n)}))}}]),a),e.Frame=(r(u,[{key:"createImage",value:function(){var t=this;return this.imageElement?Promise.resolve():new Promise((function(e,n){var r=URL.createObjectURL(t.imageData);t.imageElement=document.createElement("img"),t.imageElement.onload=function(){URL.revokeObjectURL(r),e()},t.imageElement.onerror=function(){URL.revokeObjectURL(r),t.imageElement=null,n(new Error("Image creation error"))},t.imageElement.src=r}))}}]),u)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t};function i(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=function(t){var e=n;if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);function n(t,e,r){var i;if(this instanceof n)return(i=function(t,e){if(t)return!e||"object"!=typeof e&&"function"!=typeof e?t:e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this))).playbackRate=1,i._currentFrameNumber=0,i._ended=!1,i._paused=!0,i._numPlays=0,i._rafId=null,i._apng=t,i.context=e,i.stop(),r&&i.play(),i;throw new TypeError("Cannot call a class as a function")}return e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t),r(n,[{key:"renderNextFrame",value:function(){this._currentFrameNumber=(this._currentFrameNumber+1)%this._apng.frames.length,this._currentFrameNumber===this._apng.frames.length-1&&(this._numPlays++,0!==this._apng.numPlays)&&this._numPlays>=this._apng.numPlays&&(this._ended=!0,this._paused=!0),this._prevFrame&&1==this._prevFrame.disposeOp?this.context.clearRect(this._prevFrame.left,this._prevFrame.top,this._prevFrame.width,this._prevFrame.height):this._prevFrame&&2==this._prevFrame.disposeOp&&this.context.putImageData(this._prevFrameData,this._prevFrame.left,this._prevFrame.top);var t=this.currentFrame;this._prevFrame=t,this._prevFrameData=null,2==t.disposeOp&&(this._prevFrameData=this.context.getImageData(t.left,t.top,t.width,t.height)),0==t.blendOp&&this.context.clearRect(t.left,t.top,t.width,t.height),this.context.drawImage(t.imageElement,t.left,t.top),this.emit("frame",this._currentFrameNumber),this._ended&&this.emit("end")}},{key:"play",value:function(){var t=this,e=(this._rafId&&cancelAnimationFrame(this._rafId),this.emit("play"),this._ended&&this.stop(),this._paused=!1,performance.now()+this.currentFrame.delay/this.playbackRate);this._rafId=requestAnimationFrame((function n(r){if(!t._ended&&!t._paused){if(e<=r){for(;r-e>=t._apng.playTime/t.playbackRate;)e+=t._apng.playTime/t.playbackRate,t._numPlays++;for(;t.renderNextFrame(),e+=t.currentFrame.delay/t.playbackRate,!t._ended&&!t._paused&&e<r;);}t._rafId=requestAnimationFrame(n)}}))}},{key:"pause",value:function(){this._paused||(this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null),this.emit("pause"),this._paused=!0)}},{key:"stop",value:function(){this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null),this.emit("stop"),this._numPlays=0,this._ended=!1,this._paused=!0,this._currentFrameNumber=-1,this.context.clearRect(0,0,this._apng.width,this._apng.height),this.renderNextFrame()}},{key:"currentFrameNumber",get:function(){return this._currentFrameNumber}},{key:"currentFrame",get:function(){return this._apng.frames[this._currentFrameNumber]}},{key:"paused",get:function(){return this._paused}},{key:"ended",get:function(){return this._ended}}]),n}(((n=n(4))&&n.__esModule?n:{default:n}).default),e.default=n},function(t,e){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(t){return"function"==typeof t}function i(t){return"object"==typeof t&&null!==t}function o(t){return void 0===t}((t.exports=n).EventEmitter=n).prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},n.prototype.emit=function(t){var e,n,s,a,u,l,c;if(this._events||(this._events={}),"error"===t&&(!this._events.error||i(this._events.error)&&!this._events.error.length))throw(c=arguments[1])instanceof Error?c:((l=new Error('Uncaught, unspecified "error" event. ('+c+")")).context=c,l);if(o(e=this._events[t]))return!1;if(r(e))switch(arguments.length){case 1:e.call(this);break;case 2:e.call(this,arguments[1]);break;case 3:e.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),e.apply(this,s)}else if(i(e))for(s=Array.prototype.slice.call(arguments,1),n=(u=e.slice()).length,a=0;a<n;a++)u[a].apply(this,s);return!0},n.prototype.on=n.prototype.addListener=function(t,e){if(r(e))return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,r(e.listener)?e.listener:e),this._events[t]?i(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,i(this._events[t])&&!this._events[t].warned&&(e=o(this._maxListeners)?n.defaultMaxListeners:this._maxListeners)&&0<e&&this._events[t].length>e&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace)&&console.trace(),this;throw TypeError("listener must be a function")},n.prototype.once=function(t,e){var n;if(r(e))return n=!1,i.listener=e,this.on(t,i),this;throw TypeError("listener must be a function");function i(){this.removeListener(t,i),n||(n=!0,e.apply(this,arguments))}},n.prototype.removeListener=function(t,e){var n,o,s,a;if(!r(e))throw TypeError("listener must be a function");if(this._events&&this._events[t])if(s=(n=this._events[t]).length,o=-1,n===e||r(n.listener)&&n.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(i(n)){for(a=s;0<a--;)if(n[a]===e||n[a].listener&&n[a].listener===e){o=a;break}if(o<0)return this;1===n.length?(n.length=0,delete this._events[t]):n.splice(o,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,n;if(this._events)if(this._events.removeListener)if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);this.removeAllListeners("removeListener"),this._events={}}else{if(r(n=this._events[t]))this.removeListener(t,n);else if(n)for(;n.length;)this.removeListener(t,n[n.length-1]);delete this._events[t]}else 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t];return this},n.prototype.listeners=function(t){return this._events&&this._events[t]?r(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){if(r(t=this._events[t]))return 1;if(t)return t.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}}],n={},t.m=e,t.c=n,t.p="",t(0);function t(r){var i;return(n[r]||(i=n[r]={exports:{},id:r,loaded:!1},e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i)).exports}var e,n},t.exports=e()},787:(t,e,n)=>{var r=n(582),i=n(102),o=n(540),s=n(705).Z,a=o.featureEach,u=(o.coordEach,i.polygon,i.featureCollection);function l(t){return(t=new r(t)).insert=function(t){if("Feature"!==t.type)throw new Error("invalid feature");return t.bbox=t.bbox||s(t),r.prototype.insert.call(this,t)},t.load=function(t){var e=[];return Array.isArray(t)?t.forEach((function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox||s(t),e.push(t)})):a(t,(function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox||s(t),e.push(t)})),r.prototype.load.call(this,e)},t.remove=function(t,e){if("Feature"!==t.type)throw new Error("invalid feature");return t.bbox=t.bbox||s(t),r.prototype.remove.call(this,t,e)},t.clear=function(){return r.prototype.clear.call(this)},t.search=function(t){return t=r.prototype.search.call(this,this.toBBox(t)),u(t)},t.collides=function(t){return r.prototype.collides.call(this,this.toBBox(t))},t.all=function(){var t=r.prototype.all.call(this);return u(t)},t.toJSON=function(){return r.prototype.toJSON.call(this)},t.fromJSON=function(t){return r.prototype.fromJSON.call(this,t)},t.toBBox=function(t){var e;if(t.bbox)e=t.bbox;else if(Array.isArray(t)&&4===t.length)e=t;else if(Array.isArray(t)&&6===t.length)e=[t[0],t[1],t[3],t[4]];else{if("Feature"!==t.type&&"FeatureCollection"!==t.type)throw new Error("invalid geojson");e=s(t)}return{minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}},t}t.exports=l,t.exports.default=l},481:function(t,e){var n;void 0!==(e="function"==typeof(n=function(){var t=function(t){return t.reduce((function(t,e){return 2*t+e}),0)},e=function(t){for(var e=[],n=7;n>=0;n--)e.push(!!(t&1<<n));return e},n=function(t){this.data=t,this.len=this.data.length,this.pos=0,this.readByte=function(){if(this.pos>=this.data.length)throw new Error("Attempted to read past end of stream.");return t instanceof Uint8Array?t[this.pos++]:255&t.charCodeAt(this.pos++)},this.readBytes=function(t){for(var e=[],n=0;n<t;n++)e.push(this.readByte());return e},this.read=function(t){for(var e="",n=0;n<t;n++)e+=String.fromCharCode(this.readByte());return e},this.readUnsigned=function(){var t=this.readBytes(2);return(t[1]<<8)+t[0]}},r=function(n,r){r||(r={});var i=function(t){for(var e=[],r=0;r<t;r++)e.push(n.readBytes(3));return e},o=function(){var t,e;e="";do{t=n.readByte(),e+=n.read(t)}while(0!==t);return e},s=function(){var a={};switch(a.sentinel=n.readByte(),String.fromCharCode(a.sentinel)){case"!":a.type="ext",function(i){switch(i.label=n.readByte(),i.label){case 249:i.extType="gce",function(i){n.readByte();var o=e(n.readByte());i.reserved=o.splice(0,3),i.disposalMethod=t(o.splice(0,3)),i.userInput=o.shift(),i.transparencyGiven=o.shift(),i.delayTime=n.readUnsigned(),i.transparencyIndex=n.readByte(),i.terminator=n.readByte(),r.gce&&r.gce(i)}(i);break;case 254:i.extType="com",function(t){t.comment=o(),r.com&&r.com(t)}(i);break;case 1:i.extType="pte",function(t){n.readByte(),t.ptHeader=n.readBytes(12),t.ptData=o(),r.pte&&r.pte(t)}(i);break;case 255:i.extType="app",function(t){n.readByte(),t.identifier=n.read(8),t.authCode=n.read(3),"NETSCAPE"===t.identifier?function(t){n.readByte(),t.unknown=n.readByte(),t.iterations=n.readUnsigned(),t.terminator=n.readByte(),r.app&&r.app.NETSCAPE&&r.app.NETSCAPE(t)}(t):function(t){t.appData=o(),r.app&&r.app[t.identifier]&&r.app[t.identifier](t)}(t)}(i);break;default:i.extType="unknown",function(t){t.data=o(),r.unknown&&r.unknown(t)}(i)}}(a);break;case",":a.type="img",function(s){s.leftPos=n.readUnsigned(),s.topPos=n.readUnsigned(),s.width=n.readUnsigned(),s.height=n.readUnsigned();var a=e(n.readByte());s.lctFlag=a.shift(),s.interlaced=a.shift(),s.sorted=a.shift(),s.reserved=a.splice(0,2),s.lctSize=t(a.splice(0,3)),s.lctFlag&&(s.lct=i(1<<s.lctSize+1)),s.lzwMinCodeSize=n.readByte();var u=o();s.pixels=function(t,e){for(var n,r,i=0,o=function(t){for(var n=0,r=0;r<t;r++)e.charCodeAt(i>>3)&1<<(7&i)&&(n|=1<<r),i++;return n},s=[],a=1<<t,u=a+1,l=t+1,c=[],h=function(){c=[],l=t+1;for(var e=0;e<a;e++)c[e]=[e];c[a]=[],c[u]=null};;)if(r=n,(n=o(l))!==a){if(n===u)break;if(n<c.length)r!==a&&c.push(c[r].concat(c[n][0]));else{if(n!==c.length)throw new Error("Invalid LZW code.");c.push(c[r].concat(c[r][0]))}s.push.apply(s,c[n]),c.length===1<<l&&l<12&&l++}else h();return s}(s.lzwMinCodeSize,u),s.interlaced&&(s.pixels=function(t,e){for(var n=new Array(t.length),r=t.length/e,i=function(r,i){var o=t.slice(i*e,(i+1)*e);n.splice.apply(n,[r*e,e].concat(o))},o=[0,4,2,1],s=[8,8,4,2],a=0,u=0;u<4;u++)for(var l=o[u];l<r;l+=s[u])i(l,a),a++;return n}(s.pixels,s.width)),r.img&&r.img(s)}(a);break;case";":a.type="eof",r.eof&&r.eof(a);break;default:throw new Error("Unknown block: 0x"+a.sentinel.toString(16))}"eof"!==a.type&&setTimeout(s,0)};!function(){var o={};if(o.sig=n.read(3),o.ver=n.read(3),"GIF"!==o.sig)throw new Error("Not a GIF file.");o.width=n.readUnsigned(),o.height=n.readUnsigned();var s=e(n.readByte());o.gctFlag=s.shift(),o.colorRes=t(s.splice(0,3)),o.sorted=s.shift(),o.gctSize=t(s.splice(0,3)),o.bgColor=n.readByte(),o.pixelAspectRatio=n.readByte(),o.gctFlag&&(o.gct=i(1<<o.gctSize+1)),r.hdr&&r.hdr(o)}(),setTimeout(s,0)};return function(t){var e,i,o={vp_l:0,vp_t:0,vp_w:null,vp_h:null,c_w:null,c_h:null};for(var s in t)o[s]=t[s];o.vp_w&&o.vp_h&&(o.is_vp=!0);var a=null,u=!1,l=null,c=null,h=null,p=null,f=null,g=null,d=null,y=!0,m=!1,_=[],v=[],x=o.gif;void 0===o.auto_play&&(o.auto_play=!x.getAttribute("rel:auto_play")||"1"==x.getAttribute("rel:auto_play"));var E,b,I,w,N=o.hasOwnProperty("on_end")?o.on_end:null,L=o.hasOwnProperty("loop_delay")?o.loop_delay:0,S=o.hasOwnProperty("loop_mode")?o.loop_mode:"auto",C=!o.hasOwnProperty("draw_while_loading")||o.draw_while_loading,P=!!C&&(!o.hasOwnProperty("show_progress_bar")||o.show_progress_bar),M=o.hasOwnProperty("progressbar_height")?o.progressbar_height:25,T=o.hasOwnProperty("progressbar_background_color")?o.progressbar_background_color:"rgba(255,255,255,0.4)",R=o.hasOwnProperty("progressbar_foreground_color")?o.progressbar_foreground_color:"rgba(255,0,22,.8)",O=function(){l=null,c=null,f=h,h=null,g=null},A=function(){try{r(e,j)}catch(t){k("parse")}},D=function(t,e){E.width=t*X(),E.height=e*X(),I.style.minWidth=t*X()+"px",w.width=t,w.height=e,w.style.width=t+"px",w.style.height=e+"px",w.getContext("2d").setTransform(1,0,0,1,0,0)},F=function(t,e,n){if(n&&P){var r,i,s,a=M;o.is_vp?m?(i=(o.vp_t+o.vp_h-a)/X(),a/=X(),r=o.vp_l/X()+t/e*(o.vp_w/X()),s=E.width/X()):(i=o.vp_t+o.vp_h-a,r=o.vp_l+t/e*o.vp_w,s=E.width):(i=(E.height-a)/(m?X():1),r=t/e*E.width/(m?X():1),s=E.width/(m?X():1),a/=m?X():1),b.fillStyle=T,b.fillRect(r,i,s-r,a),b.fillStyle=R,b.fillRect(0,i,r,a)}},k=function(t){a=t,i={width:x.width,height:x.height},_=[],b.fillStyle="black",b.fillRect(0,0,o.c_w?o.c_w:i.width,o.c_h?o.c_h:i.height),b.strokeStyle="red",b.lineWidth=3,b.moveTo(0,0),b.lineTo(o.c_w?o.c_w:i.width,o.c_h?o.c_h:i.height),b.moveTo(0,o.c_h?o.c_h:i.height),b.lineTo(o.c_w?o.c_w:i.width,0),b.stroke()},G=function(){g&&(_.push({data:g.getImageData(0,0,i.width,i.height),delay:c}),v.push({x:0,y:0}))},B=function(){var t=-1,e=0,n=function(e){t+=e,i()},r=function(){var r=!1,i=function(){null!==N&&N(x),e++,!1!==S||e<0?o():(r=!1,y=!1)},o=function(){if(r=y){n(1);var e=10*_[t].delay;e||(e=100),0==(t+1+_.length)%_.length?(e+=L,setTimeout(i,e)):setTimeout(o,e)}};return function(){r||setTimeout(o,0)}}(),i=function(){var e;(t=parseInt(t,10))>_.length-1&&(t=0),t<0&&(t=0),e=v[t],w.getContext("2d").putImageData(_[t].data,e.x,e.y),b.globalCompositeOperation="copy",b.drawImage(w,0,0)};return{init:function(){a||(o.c_w&&o.c_h||b.scale(X(),X()),o.auto_play?r():(t=0,i()))},step:r,play:function(){y=!0,r()},pause:function(){y=!1},playing:y,move_relative:n,current_frame:function(){return t},length:function(){return _.length},move_to:function(e){t=e,i()}}}(),U=function(t){F(e.pos,e.data.length,t)},q=function(){},z=function(t,e){return function(n){t(n),U(e)}},j={hdr:z((function(t){D((i=t).width,i.height)})),gce:z((function(t){G(),O(),l=t.transparencyGiven?t.transparencyIndex:null,c=t.delayTime,h=t.disposalMethod})),com:z(q),app:{NETSCAPE:z(q)},img:z((function(t){g||(g=w.getContext("2d"));var e=_.length,n=t.lctFlag?t.lct:i.gct;e>0&&(3===f?null!==p?g.putImageData(_[p].data,0,0):g.clearRect(d.leftPos,d.topPos,d.width,d.height):p=e-1,2===f&&g.clearRect(d.leftPos,d.topPos,d.width,d.height));var r=g.getImageData(t.leftPos,t.topPos,t.width,t.height);t.pixels.forEach((function(t,e){t!==l&&(r.data[4*e+0]=n[t][0],r.data[4*e+1]=n[t][1],r.data[4*e+2]=n[t][2],r.data[4*e+3]=255)})),g.putImageData(r,t.leftPos,t.topPos),m||(b.scale(X(),X()),m=!0),C&&(b.drawImage(w,0,0),C=o.auto_play),d=t}),!0),eof:function(t){G(),U(!1),o.c_w&&o.c_h||(E.width=i.width*X(),E.height=i.height*X()),B.init(),u=!1,H&&H(x)}},V=function(){var t=x.parentNode,e=document.createElement("div");E=document.createElement("canvas"),b=E.getContext("2d"),I=document.createElement("div"),w=document.createElement("canvas"),e.width=E.width=x.width,e.height=E.height=x.height,I.style.minWidth=x.width+"px",e.className="jsgif",I.className="jsgif_toolbar",e.appendChild(E),e.appendChild(I),t.insertBefore(e,x),t.removeChild(x),o.c_w&&o.c_h&&D(o.c_w,o.c_h),Y=!0},X=function(){return o.max_width&&i&&i.width>o.max_width?o.max_width/i.width:1},Y=!1,H=!1,W=function(t){return!u&&(H=t||!1,u=!0,_=[],O(),p=null,f=null,g=null,d=null,!0)},J=function(){return _.reduce((function(t,e){return t+e.delay}),0)};return{play:B.play,pause:B.pause,move_relative:B.move_relative,move_to:B.move_to,get_playing:function(){return y},get_canvas:function(){return E},get_canvas_scale:function(){return X()},get_loading:function(){return u},get_auto_play:function(){return o.auto_play},get_length:function(){return B.length()},get_frames:function(){return _},get_duration:function(){return J()},get_duration_ms:function(){return 10*J()},get_current_frame:function(){return B.current_frame()},load_url:function(t,r){if(W(r)){var i=new XMLHttpRequest;i.open("GET",t,!0),"overrideMimeType"in i?i.overrideMimeType("text/plain; charset=x-user-defined"):"responseType"in i?i.responseType="arraybuffer":i.setRequestHeader("Accept-Charset","x-user-defined"),i.onloadstart=function(){Y||V()},i.onload=function(t){200!=this.status&&k("xhr - response"),"response"in this||(this.response=new VBArray(this.responseText).toArray().map(String.fromCharCode).join(""));var r=this.response;r.toString().indexOf("ArrayBuffer")>0&&(r=new Uint8Array(r)),e=new n(r),setTimeout(A,0)},i.onprogress=function(t){t.lengthComputable&&F(t.loaded,t.total,!0)},i.onerror=function(){k("xhr")},i.send()}},load:function(t){this.load_url(x.getAttribute("rel:animated_src")||x.src,t)},load_raw:function(t,r){W(r)&&(Y||V(),e=new n(t),setTimeout(A,0))},set_frame_offset:function(t,e){v[t]?(void 0!==e.x&&(v[t].x=e.x),void 0!==e.y&&(v[t].y=e.y)):v[t]=e}}}})?n.apply(e,[]):n)&&(t.exports=e)},676:function(t){t.exports=function(){"use strict";var t=function(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.right=null};function e(t,e){return t>e?1:t<e?-1:0}function n(e,n,r){for(var i=new t(null,null),o=i,s=i;;){var a=r(e,n.key);if(a<0){if(null===n.left)break;if(r(e,n.left.key)<0){var u=n.left;if(n.left=u.right,u.right=n,null===(n=u).left)break}s.left=n,s=n,n=n.left}else{if(!(a>0))break;if(null===n.right)break;if(r(e,n.right.key)>0&&(u=n.right,n.right=u.left,u.left=n,null===(n=u).right))break;o.right=n,o=n,n=n.right}}return o.right=n.left,s.left=n.right,n.left=i.right,n.right=i.left,n}function r(e,r,i,o){var s=new t(e,r);if(null===i)return s.left=s.right=null,s;var a=o(e,(i=n(e,i,o)).key);return a<0?(s.left=i.left,s.right=i,i.left=null):a>=0&&(s.right=i.right,s.left=i,i.right=null),s}function i(t,e,r){var i=null,o=null;if(e){var s=r((e=n(t,e,r)).key,t);0===s?(i=e.left,o=e.right):s<0?(o=e.right,e.right=null,i=e):(i=e.left,e.left=null,o=e)}return{left:i,right:o}}function o(t,e,r){return null===e?t:(null===t||((e=n(t.key,e,r)).left=t),e)}function s(t,e,n,r,i){if(t){r(e+(n?"└── ":"├── ")+i(t)+"\n");var o=e+(n?" ":"│ ");t.left&&s(t.left,o,!1,r,i),t.right&&s(t.right,o,!0,r,i)}}var a=function(){function a(t){void 0===t&&(t=e),this._root=null,this._size=0,this._comparator=t}return a.prototype.insert=function(t,e){return this._size++,this._root=r(t,e,this._root,this._comparator)},a.prototype.add=function(e,r){var i=new t(e,r);null===this._root&&(i.left=i.right=null,this._size++,this._root=i);var o=this._comparator,s=n(e,this._root,o),a=o(e,s.key);return 0===a?this._root=s:(a<0?(i.left=s.left,i.right=s,s.left=null):a>0&&(i.right=s.right,i.left=s,s.right=null),this._size++,this._root=i),this._root},a.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},a.prototype._remove=function(t,e,r){var i;return null===e?null:0===r(t,(e=n(t,e,r)).key)?(null===e.left?i=e.right:(i=n(t,e.left,r)).right=e.right,this._size--,i):e},a.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=n(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},a.prototype.findStatic=function(t){for(var e=this._root,n=this._comparator;e;){var r=n(t,e.key);if(0===r)return e;e=r<0?e.left:e.right}return null},a.prototype.find=function(t){return this._root&&(this._root=n(t,this._root,this._comparator),0!==this._comparator(t,this._root.key))?null:this._root},a.prototype.contains=function(t){for(var e=this._root,n=this._comparator;e;){var r=n(t,e.key);if(0===r)return!0;e=r<0?e.left:e.right}return!1},a.prototype.forEach=function(t,e){for(var n=this._root,r=[],i=!1;!i;)null!==n?(r.push(n),n=n.left):0!==r.length?(n=r.pop(),t.call(e,n),n=n.right):i=!0;return this},a.prototype.range=function(t,e,n,r){for(var i=[],o=this._comparator,s=this._root;0!==i.length||s;)if(s)i.push(s),s=s.left;else{if(o((s=i.pop()).key,e)>0)break;if(o(s.key,t)>=0&&n.call(r,s))return this;s=s.right}return this},a.prototype.keys=function(){var t=[];return this.forEach((function(e){var n=e.key;return t.push(n)})),t},a.prototype.values=function(){var t=[];return this.forEach((function(e){var n=e.data;return t.push(n)})),t},a.prototype.min=function(){return this._root?this.minNode(this._root).key:null},a.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},a.prototype.minNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.left;)t=t.left;return t},a.prototype.maxNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.right;)t=t.right;return t},a.prototype.at=function(t){for(var e=this._root,n=!1,r=0,i=[];!n;)if(e)i.push(e),e=e.left;else if(i.length>0){if(e=i.pop(),r===t)return e;r++,e=e.right}else n=!0;return null},a.prototype.next=function(t){var e=this._root,n=null;if(t.right){for(n=t.right;n.left;)n=n.left;return n}for(var r=this._comparator;e;){var i=r(t.key,e.key);if(0===i)break;i<0?(n=e,e=e.left):e=e.right}return n},a.prototype.prev=function(t){var e=this._root,n=null;if(null!==t.left){for(n=t.left;n.right;)n=n.right;return n}for(var r=this._comparator;e;){var i=r(t.key,e.key);if(0===i)break;i<0?e=e.left:(n=e,e=e.right)}return n},a.prototype.clear=function(){return this._root=null,this._size=0,this},a.prototype.toList=function(){return function(e){for(var n=e,r=[],i=!1,o=new t(null,null),s=o;!i;)n?(r.push(n),n=n.left):r.length>0?n=(n=s=s.next=r.pop()).right:i=!0;return s.next=null,o.next}(this._root)},a.prototype.load=function(e,n,r){void 0===n&&(n=[]),void 0===r&&(r=!1);var i=e.length,o=this._comparator;if(r&&c(e,n,0,i-1,o),null===this._root)this._root=u(e,n,0,i),this._size=i;else{var s=function(e,n,r){for(var i=new t(null,null),o=i,s=e,a=n;null!==s&&null!==a;)r(s.key,a.key)<0?(o.next=s,s=s.next):(o.next=a,a=a.next),o=o.next;return null!==s?o.next=s:null!==a&&(o.next=a),i.next}(this.toList(),function(e,n){for(var r=new t(null,null),i=r,o=0;o<e.length;o++)i=i.next=new t(e[o],n[o]);return i.next=null,r.next}(e,n),o);i=this._size+i,this._root=l({head:s},0,i)}return this},a.prototype.isEmpty=function(){return null===this._root},Object.defineProperty(a.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),a.prototype.toString=function(t){void 0===t&&(t=function(t){return String(t.key)});var e=[];return s(this._root,"",!0,(function(t){return e.push(t)}),t),e.join("")},a.prototype.update=function(t,e,n){var s=this._comparator,a=i(t,this._root,s),u=a.left,l=a.right;s(t,e)<0?l=r(e,n,l,s):u=r(e,n,u,s),this._root=o(u,l,s)},a.prototype.split=function(t){return i(t,this._root,this._comparator)},a.prototype[Symbol.iterator]=function(){var t,e,n;return function(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(t){return function(e){return u([t,e])}}function u(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}}(this,(function(r){switch(r.label){case 0:t=this._root,e=[],n=!1,r.label=1;case 1:return n?[3,6]:null===t?[3,2]:(e.push(t),t=t.left,[3,5]);case 2:return 0===e.length?[3,4]:[4,t=e.pop()];case 3:return r.sent(),t=t.right,[3,5];case 4:n=!0,r.label=5;case 5:return[3,1];case 6:return[2]}}))},a}();function u(e,n,r,i){var o=i-r;if(o>0){var s=r+Math.floor(o/2),a=e[s],l=n[s],c=new t(a,l);return c.left=u(e,n,r,s),c.right=u(e,n,s+1,i),c}return null}function l(t,e,n){var r=n-e;if(r>0){var i=e+Math.floor(r/2),o=l(t,e,i),s=t.head;return s.left=o,t.head=t.head.next,s.right=l(t,i+1,n),s}return null}function c(t,e,n,r,i){if(!(n>=r)){for(var o=t[n+r>>1],s=n-1,a=r+1;;){do{s++}while(i(t[s],o)<0);do{a--}while(i(t[a],o)>0);if(s>=a)break;var u=t[s];t[s]=t[a],t[a]=u,u=e[s],e[s]=e[a],e[a]=u}c(t,e,n,a,i),c(t,e,a+1,r,i)}}const h=(t,e)=>t.ll.x<=e.x&&e.x<=t.ur.x&&t.ll.y<=e.y&&e.y<=t.ur.y,p=(t,e)=>{if(e.ur.x<t.ll.x||t.ur.x<e.ll.x||e.ur.y<t.ll.y||t.ur.y<e.ll.y)return null;const n=t.ll.x<e.ll.x?e.ll.x:t.ll.x,r=t.ur.x<e.ur.x?t.ur.x:e.ur.x;return{ll:{x:n,y:t.ll.y<e.ll.y?e.ll.y:t.ll.y},ur:{x:r,y:t.ur.y<e.ur.y?t.ur.y:e.ur.y}}};let f=Number.EPSILON;void 0===f&&(f=Math.pow(2,-52));const g=f*f,d=(t,e)=>{if(-f<t&&t<f&&-f<e&&e<f)return 0;const n=t-e;return n*n<g*t*e?0:t<e?-1:1};class y{constructor(){this.tree=new a,this.round(0)}round(t){const e=this.tree.add(t),n=this.tree.prev(e);if(null!==n&&0===d(e.key,n.key))return this.tree.remove(t),n.key;const r=this.tree.next(e);return null!==r&&0===d(e.key,r.key)?(this.tree.remove(t),r.key):t}}const m=new class{constructor(){this.reset()}reset(){this.xRounder=new y,this.yRounder=new y}round(t,e){return{x:this.xRounder.round(t),y:this.yRounder.round(e)}}},_=134217729;function v(t,e,n,r,i){let o,s,a,u,l=e[0],c=r[0],h=0,p=0;c>l==c>-l?(o=l,l=e[++h]):(o=c,c=r[++p]);let f=0;if(h<t&&p<n)for(c>l==c>-l?(s=l+o,a=o-(s-l),l=e[++h]):(s=c+o,a=o-(s-c),c=r[++p]),o=s,0!==a&&(i[f++]=a);h<t&&p<n;)c>l==c>-l?(s=o+l,u=s-o,a=o-(s-u)+(l-u),l=e[++h]):(s=o+c,u=s-o,a=o-(s-u)+(c-u),c=r[++p]),o=s,0!==a&&(i[f++]=a);for(;h<t;)s=o+l,u=s-o,a=o-(s-u)+(l-u),l=e[++h],o=s,0!==a&&(i[f++]=a);for(;p<n;)s=o+c,u=s-o,a=o-(s-u)+(c-u),c=r[++p],o=s,0!==a&&(i[f++]=a);return 0===o&&0!==f||(i[f++]=o),f}function x(t){return new Float64Array(t)}const E=x(4),b=x(8),I=x(12),w=x(16),N=x(4);const L=(t,e)=>t.x*e.y-t.y*e.x,S=(t,e)=>t.x*e.x+t.y*e.y,C=(t,e,n)=>{const r=function(t,e,n,r,i,o){const s=(e-o)*(n-i),a=(t-i)*(r-o),u=s-a,l=Math.abs(s+a);return Math.abs(u)>=33306690738754716e-32*l?u:-function(t,e,n,r,i,o,s){let a,u,l,c,h,p,f,g,d,y,m,x,L,S,C,P,M,T;const R=t-i,O=n-i,A=e-o,D=r-o;S=R*D,p=_*R,f=p-(p-R),g=R-f,p=_*D,d=p-(p-D),y=D-d,C=g*y-(S-f*d-g*d-f*y),P=A*O,p=_*A,f=p-(p-A),g=A-f,p=_*O,d=p-(p-O),y=O-d,M=g*y-(P-f*d-g*d-f*y),m=C-M,h=C-m,E[0]=C-(m+h)+(h-M),x=S+m,h=x-S,L=S-(x-h)+(m-h),m=L-P,h=L-m,E[1]=L-(m+h)+(h-P),T=x+m,h=T-x,E[2]=x-(T-h)+(m-h),E[3]=T;let F=function(t,e){let n=e[0];for(let t=1;t<4;t++)n+=e[t];return n}(0,E),k=22204460492503146e-32*s;if(F>=k||-F>=k)return F;if(h=t-R,a=t-(R+h)+(h-i),h=n-O,l=n-(O+h)+(h-i),h=e-A,u=e-(A+h)+(h-o),h=r-D,c=r-(D+h)+(h-o),0===a&&0===u&&0===l&&0===c)return F;if(k=11093356479670487e-47*s+33306690738754706e-32*Math.abs(F),F+=R*c+D*a-(A*l+O*u),F>=k||-F>=k)return F;S=a*D,p=_*a,f=p-(p-a),g=a-f,p=_*D,d=p-(p-D),y=D-d,C=g*y-(S-f*d-g*d-f*y),P=u*O,p=_*u,f=p-(p-u),g=u-f,p=_*O,d=p-(p-O),y=O-d,M=g*y-(P-f*d-g*d-f*y),m=C-M,h=C-m,N[0]=C-(m+h)+(h-M),x=S+m,h=x-S,L=S-(x-h)+(m-h),m=L-P,h=L-m,N[1]=L-(m+h)+(h-P),T=x+m,h=T-x,N[2]=x-(T-h)+(m-h),N[3]=T;const G=v(4,E,4,N,b);S=R*c,p=_*R,f=p-(p-R),g=R-f,p=_*c,d=p-(p-c),y=c-d,C=g*y-(S-f*d-g*d-f*y),P=A*l,p=_*A,f=p-(p-A),g=A-f,p=_*l,d=p-(p-l),y=l-d,M=g*y-(P-f*d-g*d-f*y),m=C-M,h=C-m,N[0]=C-(m+h)+(h-M),x=S+m,h=x-S,L=S-(x-h)+(m-h),m=L-P,h=L-m,N[1]=L-(m+h)+(h-P),T=x+m,h=T-x,N[2]=x-(T-h)+(m-h),N[3]=T;const B=v(G,b,4,N,I);S=a*c,p=_*a,f=p-(p-a),g=a-f,p=_*c,d=p-(p-c),y=c-d,C=g*y-(S-f*d-g*d-f*y),P=u*l,p=_*u,f=p-(p-u),g=u-f,p=_*l,d=p-(p-l),y=l-d,M=g*y-(P-f*d-g*d-f*y),m=C-M,h=C-m,N[0]=C-(m+h)+(h-M),x=S+m,h=x-S,L=S-(x-h)+(m-h),m=L-P,h=L-m,N[1]=L-(m+h)+(h-P),T=x+m,h=T-x,N[2]=x-(T-h)+(m-h),N[3]=T;const U=v(B,I,4,N,w);return w[U-1]}(t,e,n,r,i,o,l)}(t.x,t.y,e.x,e.y,n.x,n.y);return r>0?-1:r<0?1:0},P=t=>Math.sqrt(S(t,t)),M=(t,e,n)=>{const r={x:e.x-t.x,y:e.y-t.y},i={x:n.x-t.x,y:n.y-t.y};return L(i,r)/P(i)/P(r)},T=(t,e,n)=>{const r={x:e.x-t.x,y:e.y-t.y},i={x:n.x-t.x,y:n.y-t.y};return S(i,r)/P(i)/P(r)},R=(t,e,n)=>0===e.y?null:{x:t.x+e.x/e.y*(n-t.y),y:n},O=(t,e,n)=>0===e.x?null:{x:n,y:t.y+e.y/e.x*(n-t.x)};class A{static compare(t,e){const n=A.comparePoints(t.point,e.point);return 0!==n?n:(t.point!==e.point&&t.link(e),t.isLeft!==e.isLeft?t.isLeft?1:-1:F.compare(t.segment,e.segment))}static comparePoints(t,e){return t.x<e.x?-1:t.x>e.x?1:t.y<e.y?-1:t.y>e.y?1:0}constructor(t,e){void 0===t.events?t.events=[this]:t.events.push(this),this.point=t,this.isLeft=e}link(t){if(t.point===this.point)throw new Error("Tried to link already linked events");const e=t.point.events;for(let t=0,n=e.length;t<n;t++){const n=e[t];this.point.events.push(n),n.point=this.point}this.checkForConsuming()}checkForConsuming(){const t=this.point.events.length;for(let e=0;e<t;e++){const n=this.point.events[e];if(void 0===n.segment.consumedBy)for(let r=e+1;r<t;r++){const t=this.point.events[r];void 0===t.consumedBy&&n.otherSE.point.events===t.otherSE.point.events&&n.segment.consume(t.segment)}}}getAvailableLinkedEvents(){const t=[];for(let e=0,n=this.point.events.length;e<n;e++){const n=this.point.events[e];n!==this&&!n.segment.ringOut&&n.segment.isInResult()&&t.push(n)}return t}getLeftmostComparator(t){const e=new Map,n=n=>{const r=n.otherSE;e.set(n,{sine:M(this.point,t.point,r.point),cosine:T(this.point,t.point,r.point)})};return(t,r)=>{e.has(t)||n(t),e.has(r)||n(r);const{sine:i,cosine:o}=e.get(t),{sine:s,cosine:a}=e.get(r);return i>=0&&s>=0?o<a?1:o>a?-1:0:i<0&&s<0?o<a?-1:o>a?1:0:s<i?-1:s>i?1:0}}}let D=0;class F{static compare(t,e){const n=t.leftSE.point.x,r=e.leftSE.point.x,i=t.rightSE.point.x,o=e.rightSE.point.x;if(o<n)return 1;if(i<r)return-1;const s=t.leftSE.point.y,a=e.leftSE.point.y,u=t.rightSE.point.y,l=e.rightSE.point.y;if(n<r){if(a<s&&a<u)return 1;if(a>s&&a>u)return-1;const n=t.comparePoint(e.leftSE.point);if(n<0)return 1;if(n>0)return-1;const r=e.comparePoint(t.rightSE.point);return 0!==r?r:-1}if(n>r){if(s<a&&s<l)return-1;if(s>a&&s>l)return 1;const n=e.comparePoint(t.leftSE.point);if(0!==n)return n;const r=t.comparePoint(e.rightSE.point);return r<0?1:r>0?-1:1}if(s<a)return-1;if(s>a)return 1;if(i<o){const n=e.comparePoint(t.rightSE.point);if(0!==n)return n}if(i>o){const n=t.comparePoint(e.rightSE.point);if(n<0)return 1;if(n>0)return-1}if(i!==o){const t=u-s,e=i-n,c=l-a,h=o-r;if(t>e&&c<h)return 1;if(t<e&&c>h)return-1}return i>o?1:i<o||u<l?-1:u>l?1:t.id<e.id?-1:t.id>e.id?1:0}constructor(t,e,n,r){this.id=++D,this.leftSE=t,t.segment=this,t.otherSE=e,this.rightSE=e,e.segment=this,e.otherSE=t,this.rings=n,this.windings=r}static fromRing(t,e,n){let r,i,o;const s=A.comparePoints(t,e);if(s<0)r=t,i=e,o=1;else{if(!(s>0))throw new Error(`Tried to create degenerate segment at [${t.x}, ${t.y}]`);r=e,i=t,o=-1}const a=new A(r,!0),u=new A(i,!1);return new F(a,u,[n],[o])}replaceRightSE(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const t=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t<e?t:e},ur:{x:this.rightSE.point.x,y:t>e?t:e}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}comparePoint(t){if(this.isAnEndpoint(t))return 0;const e=this.leftSE.point,n=this.rightSE.point,r=this.vector();if(e.x===n.x)return t.x===e.x?0:t.x<e.x?1:-1;const i=(t.y-e.y)/r.y,o=e.x+i*r.x;if(t.x===o)return 0;const s=(t.x-e.x)/r.x,a=e.y+s*r.y;return t.y===a?0:t.y<a?-1:1}getIntersection(t){const e=this.bbox(),n=t.bbox(),r=p(e,n);if(null===r)return null;const i=this.leftSE.point,o=this.rightSE.point,s=t.leftSE.point,a=t.rightSE.point,u=h(e,s)&&0===this.comparePoint(s),l=h(n,i)&&0===t.comparePoint(i),c=h(e,a)&&0===this.comparePoint(a),f=h(n,o)&&0===t.comparePoint(o);if(l&&u)return f&&!c?o:!f&&c?a:null;if(l)return c&&i.x===a.x&&i.y===a.y?null:i;if(u)return f&&o.x===s.x&&o.y===s.y?null:s;if(f&&c)return null;if(f)return o;if(c)return a;const g=((t,e,n,r)=>{if(0===e.x)return O(n,r,t.x);if(0===r.x)return O(t,e,n.x);if(0===e.y)return R(n,r,t.y);if(0===r.y)return R(t,e,n.y);const i=L(e,r);if(0==i)return null;const o={x:n.x-t.x,y:n.y-t.y},s=L(o,e)/i,a=L(o,r)/i;return{x:(t.x+a*e.x+(n.x+s*r.x))/2,y:(t.y+a*e.y+(n.y+s*r.y))/2}})(i,this.vector(),s,t.vector());return null===g?null:h(r,g)?m.round(g.x,g.y):null}split(t){const e=[],n=void 0!==t.events,r=new A(t,!0),i=new A(t,!1),o=this.rightSE;this.replaceRightSE(i),e.push(i),e.push(r);const s=new F(r,o,this.rings.slice(),this.windings.slice());return A.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),A.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(r.checkForConsuming(),i.checkForConsuming()),e}swapEvents(){const t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let t=0,e=this.windings.length;t<e;t++)this.windings[t]*=-1}consume(t){let e=this,n=t;for(;e.consumedBy;)e=e.consumedBy;for(;n.consumedBy;)n=n.consumedBy;const r=F.compare(e,n);if(0!==r){if(r>0){const t=e;e=n,n=t}if(e.prev===n){const t=e;e=n,n=t}for(let t=0,r=n.rings.length;t<r;t++){const r=n.rings[t],i=n.windings[t],o=e.rings.indexOf(r);-1===o?(e.rings.push(r),e.windings.push(i)):e.windings[o]+=i}n.rings=null,n.windings=null,n.consumedBy=e,n.leftSE.consumedBy=e.leftSE,n.rightSE.consumedBy=e.rightSE}}prevInResult(){return void 0!==this._prevInResult||(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null),this._prevInResult}beforeState(){if(void 0!==this._beforeState)return this._beforeState;if(this.prev){const t=this.prev.consumedBy||this.prev;this._beforeState=t.afterState()}else this._beforeState={rings:[],windings:[],multiPolys:[]};return this._beforeState}afterState(){if(void 0!==this._afterState)return this._afterState;const t=this.beforeState();this._afterState={rings:t.rings.slice(0),windings:t.windings.slice(0),multiPolys:[]};const e=this._afterState.rings,n=this._afterState.windings,r=this._afterState.multiPolys;for(let t=0,r=this.rings.length;t<r;t++){const r=this.rings[t],i=this.windings[t],o=e.indexOf(r);-1===o?(e.push(r),n.push(i)):n[o]+=i}const i=[],o=[];for(let t=0,r=e.length;t<r;t++){if(0===n[t])continue;const r=e[t],s=r.poly;if(-1===o.indexOf(s))if(r.isExterior)i.push(s);else{-1===o.indexOf(s)&&o.push(s);const t=i.indexOf(r.poly);-1!==t&&i.splice(t,1)}}for(let t=0,e=i.length;t<e;t++){const e=i[t].multiPoly;-1===r.indexOf(e)&&r.push(e)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(void 0!==this._isInResult)return this._isInResult;const t=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(Y.type){case"union":{const n=0===t.length,r=0===e.length;this._isInResult=n!==r;break}case"intersection":{let n,r;t.length<e.length?(n=t.length,r=e.length):(n=e.length,r=t.length),this._isInResult=r===Y.numMultiPolys&&n<r;break}case"xor":{const n=Math.abs(t.length-e.length);this._isInResult=n%2==1;break}case"difference":{const n=t=>1===t.length&&t[0].isSubject;this._isInResult=n(t)!==n(e);break}default:throw new Error(`Unrecognized operation type found ${Y.type}`)}return this._isInResult}}class k{constructor(t,e,n){if(!Array.isArray(t)||0===t.length)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=n,this.segments=[],"number"!=typeof t[0][0]||"number"!=typeof t[0][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const r=m.round(t[0][0],t[0][1]);this.bbox={ll:{x:r.x,y:r.y},ur:{x:r.x,y:r.y}};let i=r;for(let e=1,n=t.length;e<n;e++){if("number"!=typeof t[e][0]||"number"!=typeof t[e][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let n=m.round(t[e][0],t[e][1]);n.x===i.x&&n.y===i.y||(this.segments.push(F.fromRing(i,n,this)),n.x<this.bbox.ll.x&&(this.bbox.ll.x=n.x),n.y<this.bbox.ll.y&&(this.bbox.ll.y=n.y),n.x>this.bbox.ur.x&&(this.bbox.ur.x=n.x),n.y>this.bbox.ur.y&&(this.bbox.ur.y=n.y),i=n)}r.x===i.x&&r.y===i.y||this.segments.push(F.fromRing(i,r,this))}getSweepEvents(){const t=[];for(let e=0,n=this.segments.length;e<n;e++){const n=this.segments[e];t.push(n.leftSE),t.push(n.rightSE)}return t}}class G{constructor(t,e){if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new k(t[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let e=1,n=t.length;e<n;e++){const n=new k(t[e],this,!1);n.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=n.bbox.ll.x),n.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=n.bbox.ll.y),n.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=n.bbox.ur.x),n.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=n.bbox.ur.y),this.interiorRings.push(n)}this.multiPoly=e}getSweepEvents(){const t=this.exteriorRing.getSweepEvents();for(let e=0,n=this.interiorRings.length;e<n;e++){const n=this.interiorRings[e].getSweepEvents();for(let e=0,r=n.length;e<r;e++)t.push(n[e])}return t}}class B{constructor(t,e){if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{"number"==typeof t[0][0][0]&&(t=[t])}catch(e){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let e=0,n=t.length;e<n;e++){const n=new G(t[e],this);n.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=n.bbox.ll.x),n.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=n.bbox.ll.y),n.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=n.bbox.ur.x),n.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=n.bbox.ur.y),this.polys.push(n)}this.isSubject=e}getSweepEvents(){const t=[];for(let e=0,n=this.polys.length;e<n;e++){const n=this.polys[e].getSweepEvents();for(let e=0,r=n.length;e<r;e++)t.push(n[e])}return t}}class U{static factory(t){const e=[];for(let n=0,r=t.length;n<r;n++){const r=t[n];if(!r.isInResult()||r.ringOut)continue;let i=null,o=r.leftSE,s=r.rightSE;const a=[o],u=o.point,l=[];for(;i=o,o=s,a.push(o),o.point!==u;)for(;;){const t=o.getAvailableLinkedEvents();if(0===t.length){const t=a[0].point,e=a[a.length-1].point;throw new Error(`Unable to complete output ring starting at [${t.x}, ${t.y}]. Last matching segment found ends at [${e.x}, ${e.y}].`)}if(1===t.length){s=t[0].otherSE;break}let n=null;for(let t=0,e=l.length;t<e;t++)if(l[t].point===o.point){n=t;break}if(null!==n){const t=l.splice(n)[0],r=a.splice(t.index);r.unshift(r[0].otherSE),e.push(new U(r.reverse()));continue}l.push({index:a.length,point:o.point});const r=o.getLeftmostComparator(i);s=t.sort(r)[0].otherSE;break}e.push(new U(a))}return e}constructor(t){this.events=t;for(let e=0,n=t.length;e<n;e++)t[e].segment.ringOut=this;this.poly=null}getGeom(){let t=this.events[0].point;const e=[t];for(let n=1,r=this.events.length-1;n<r;n++){const r=this.events[n].point,i=this.events[n+1].point;0!==C(r,t,i)&&(e.push(r),t=r)}if(1===e.length)return null;const n=e[0],r=e[1];0===C(n,t,r)&&e.shift(),e.push(e[0]);const i=this.isExteriorRing()?1:-1,o=this.isExteriorRing()?0:e.length-1,s=this.isExteriorRing()?e.length:-1,a=[];for(let t=o;t!=s;t+=i)a.push([e[t].x,e[t].y]);return a}isExteriorRing(){if(void 0===this._isExteriorRing){const t=this.enclosingRing();this._isExteriorRing=!t||!t.isExteriorRing()}return this._isExteriorRing}enclosingRing(){return void 0===this._enclosingRing&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let t=this.events[0];for(let e=1,n=this.events.length;e<n;e++){const n=this.events[e];A.compare(t,n)>0&&(t=n)}let e=t.segment.prevInResult(),n=e?e.prevInResult():null;for(;;){if(!e)return null;if(!n)return e.ringOut;if(n.ringOut!==e.ringOut)return n.ringOut.enclosingRing()!==e.ringOut?e.ringOut:e.ringOut.enclosingRing();e=n.prevInResult(),n=e?e.prevInResult():null}}}class q{constructor(t){this.exteriorRing=t,t.poly=this,this.interiorRings=[]}addInterior(t){this.interiorRings.push(t),t.poly=this}getGeom(){const t=[this.exteriorRing.getGeom()];if(null===t[0])return null;for(let e=0,n=this.interiorRings.length;e<n;e++){const n=this.interiorRings[e].getGeom();null!==n&&t.push(n)}return t}}class z{constructor(t){this.rings=t,this.polys=this._composePolys(t)}getGeom(){const t=[];for(let e=0,n=this.polys.length;e<n;e++){const n=this.polys[e].getGeom();null!==n&&t.push(n)}return t}_composePolys(t){const e=[];for(let n=0,r=t.length;n<r;n++){const r=t[n];if(!r.poly)if(r.isExteriorRing())e.push(new q(r));else{const t=r.enclosingRing();t.poly||e.push(new q(t)),t.poly.addInterior(r)}}return e}}class j{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:F.compare;this.queue=t,this.tree=new a(e),this.segments=[]}process(t){const e=t.segment,n=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(e),n;const r=t.isLeft?this.tree.add(e):this.tree.find(e);if(!r)throw new Error(`Unable to find segment #${e.id} [${e.leftSE.point.x}, ${e.leftSE.point.y}] -> [${e.rightSE.point.x}, ${e.rightSE.point.y}] in SweepLine tree.`);let i,o,s=r,a=r;for(;void 0===i;)s=this.tree.prev(s),null===s?i=null:void 0===s.key.consumedBy&&(i=s.key);for(;void 0===o;)a=this.tree.next(a),null===a?o=null:void 0===a.key.consumedBy&&(o=a.key);if(t.isLeft){let r=null;if(i){const t=i.getIntersection(e);if(null!==t&&(e.isAnEndpoint(t)||(r=t),!i.isAnEndpoint(t))){const e=this._splitSafely(i,t);for(let t=0,r=e.length;t<r;t++)n.push(e[t])}}let s=null;if(o){const t=o.getIntersection(e);if(null!==t&&(e.isAnEndpoint(t)||(s=t),!o.isAnEndpoint(t))){const e=this._splitSafely(o,t);for(let t=0,r=e.length;t<r;t++)n.push(e[t])}}if(null!==r||null!==s){let t=null;t=null===r?s:null===s||A.comparePoints(r,s)<=0?r:s,this.queue.remove(e.rightSE),n.push(e.rightSE);const i=e.split(t);for(let t=0,e=i.length;t<e;t++)n.push(i[t])}n.length>0?(this.tree.remove(e),n.push(t)):(this.segments.push(e),e.prev=i)}else{if(i&&o){const t=i.getIntersection(o);if(null!==t){if(!i.isAnEndpoint(t)){const e=this._splitSafely(i,t);for(let t=0,r=e.length;t<r;t++)n.push(e[t])}if(!o.isAnEndpoint(t)){const e=this._splitSafely(o,t);for(let t=0,r=e.length;t<r;t++)n.push(e[t])}}}this.tree.remove(e)}return n}_splitSafely(t,e){this.tree.remove(t);const n=t.rightSE;this.queue.remove(n);const r=t.split(e);return r.push(n),void 0===t.consumedBy&&this.tree.add(t),r}}const V="undefined"!=typeof process&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,X="undefined"!=typeof process&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,Y=new class{run(t,e,n){Y.type=t,m.reset();const r=[new B(e,!0)];for(let t=0,e=n.length;t<e;t++)r.push(new B(n[t],!1));if(Y.numMultiPolys=r.length,"difference"===Y.type){const t=r[0];let e=1;for(;e<r.length;)null!==p(r[e].bbox,t.bbox)?e++:r.splice(e,1)}if("intersection"===Y.type)for(let t=0,e=r.length;t<e;t++){const e=r[t];for(let n=t+1,i=r.length;n<i;n++)if(null===p(e.bbox,r[n].bbox))return[]}const i=new a(A.compare);for(let t=0,e=r.length;t<e;t++){const e=r[t].getSweepEvents();for(let t=0,n=e.length;t<n;t++)if(i.insert(e[t]),i.size>V)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const o=new j(i);let s=i.size,u=i.pop();for(;u;){const t=u.key;if(i.size===s){const e=t.segment;throw new Error(`Unable to pop() ${t.isLeft?"left":"right"} SweepEvent [${t.point.x}, ${t.point.y}] from segment #${e.id} [${e.leftSE.point.x}, ${e.leftSE.point.y}] -> [${e.rightSE.point.x}, ${e.rightSE.point.y}] from queue.`)}if(i.size>V)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(o.segments.length>X)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const e=o.process(t);for(let t=0,n=e.length;t<n;t++){const n=e[t];void 0===n.consumedBy&&i.insert(n)}s=i.size,u=i.pop()}m.reset();const l=U.factory(o.segments);return new z(l).getGeom()}};return{union:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return Y.run("union",t,n)},intersection:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return Y.run("intersection",t,n)},xor:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return Y.run("xor",t,n)},difference:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return Y.run("difference",t,n)}}}()},582:function(t){t.exports=function(){"use strict";function t(t,r,i,o,s){!function t(n,r,i,o,s){for(;o>i;){if(o-i>600){var a=o-i+1,u=r-i+1,l=Math.log(a),c=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*c*(a-c)/a)*(u-a/2<0?-1:1);t(n,r,Math.max(i,Math.floor(r-u*c/a+h)),Math.min(o,Math.floor(r+(a-u)*c/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)}}(t,r,i||0,o||t.length-1,s||n)}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}var r=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,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 o(t,e){s(t,0,t.children.length,e,t)}function s(t,e,n,r,i){i||(i=g(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o=e;o<n;o++){var s=t.children[o];a(i,t.leaf?r(s):s)}return i}function a(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 u(t,e){return t.minX-e.minX}function l(t,e){return t.minY-e.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 p(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function f(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function g(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function d(e,n,r,i,o){for(var s=[n,r];s.length;)if(!((r=s.pop())-(n=s.pop())<=i)){var a=n+Math.ceil((r-n)/i/2)*i;t(e,a,n,r,o),s.push(n,a,a,r)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(t){var e=this.data,n=[];if(!f(t,e))return n;for(var r=this.toBBox,i=[];e;){for(var o=0;o<e.children.length;o++){var s=e.children[o],a=e.leaf?r(s):s;f(t,a)&&(e.leaf?n.push(s):p(t,a)?this._all(s,n):i.push(s))}e=i.pop()}return n},r.prototype.collides=function(t){var e=this.data;if(!f(t,e))return!1;for(var n=[];e;){for(var r=0;r<e.children.length;r++){var i=e.children[r],o=e.leaf?this.toBBox(i):i;if(f(t,o)){if(e.leaf||p(t,o))return!0;n.push(i)}}e=n.pop()}return!1},r.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0;e<t.length;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},r.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},r.prototype.clear=function(){return this.data=g([]),this},r.prototype.remove=function(t,e){if(!t)return this;for(var n,r,o,s=this.data,a=this.toBBox(t),u=[],l=[];s||u.length;){if(s||(s=u.pop(),r=u[u.length-1],n=l.pop(),o=!0),s.leaf){var c=i(t,s.children,e);if(-1!==c)return s.children.splice(c,1),u.push(s),this._condense(u),this}o||s.leaf||!p(s,a)?r?(n++,s=r.children[n],o=!1):s=null:(u.push(s),l.push(n),n=0,r=s,s=s.children[0])}return this},r.prototype.toBBox=function(t){return t},r.prototype.compareMinX=function(t,e){return t.minX-e.minX},r.prototype.compareMinY=function(t,e){return t.minY-e.minY},r.prototype.toJSON=function(){return this.data},r.prototype.fromJSON=function(t){return this.data=t,this},r.prototype._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},r.prototype._build=function(t,e,n,r){var i,s=n-e+1,a=this._maxEntries;if(s<=a)return o(i=g(t.slice(e,n+1)),this.toBBox),i;r||(r=Math.ceil(Math.log(s)/Math.log(a)),a=Math.ceil(s/Math.pow(a,r-1))),(i=g([])).leaf=!1,i.height=r;var u=Math.ceil(s/a),l=u*Math.ceil(Math.sqrt(a));d(t,e,n,l,this.compareMinX);for(var c=e;c<=n;c+=l){var h=Math.min(c+l-1,n);d(t,c,h,u,this.compareMinY);for(var p=c;p<=h;p+=u){var f=Math.min(p+u-1,h);i.children.push(this._build(t,p,f,r-1))}}return o(i,this.toBBox),i},r.prototype._chooseSubtree=function(t,e,n,r){for(;r.push(e),!e.leaf&&r.length-1!==n;){for(var i=1/0,o=1/0,s=void 0,a=0;a<e.children.length;a++){var u=e.children[a],l=c(u),h=(p=t,f=u,(Math.max(f.maxX,p.maxX)-Math.min(f.minX,p.minX))*(Math.max(f.maxY,p.maxY)-Math.min(f.minY,p.minY))-l);h<o?(o=h,i=l<i?l:i,s=u):h===o&&l<i&&(i=l,s=u)}e=s||e.children[0]}var p,f;return e},r.prototype._insert=function(t,e,n){var r=n?t:this.toBBox(t),i=[],o=this._chooseSubtree(r,this.data,e,i);for(o.children.push(t),a(o,r);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(r,i,e)},r.prototype._split=function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var s=this._chooseSplitIndex(n,i,r),a=g(n.children.splice(s,n.children.length-s));a.height=n.height,a.leaf=n.leaf,o(n,this.toBBox),o(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(n,a)},r.prototype._splitRoot=function(t,e){this.data=g([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(t,e,n){for(var r,i,o,a,u,l,h,p=1/0,f=1/0,g=e;g<=n-e;g++){var d=s(t,0,g,this.toBBox),y=s(t,g,n,this.toBBox),m=(i=d,o=y,a=Math.max(i.minX,o.minX),u=Math.max(i.minY,o.minY),l=Math.min(i.maxX,o.maxX),h=Math.min(i.maxY,o.maxY),Math.max(0,l-a)*Math.max(0,h-u)),_=c(d)+c(y);m<p?(p=m,r=g,f=_<f?_:f):m===p&&_<f&&(f=_,r=g)}return r||n-e},r.prototype._chooseSplitAxis=function(t,e,n){var r=t.leaf?this.compareMinX:u,i=t.leaf?this.compareMinY:l;this._allDistMargin(t,e,n,r)<this._allDistMargin(t,e,n,i)&&t.children.sort(r)},r.prototype._allDistMargin=function(t,e,n,r){t.children.sort(r);for(var i=this.toBBox,o=s(t,0,e,i),u=s(t,n-e,n,i),l=h(o)+h(u),c=e;c<n-e;c++){var p=t.children[c];a(o,t.leaf?i(p):p),l+=h(o)}for(var f=n-e-1;f>=e;f--){var g=t.children[f];a(u,t.leaf?i(g):g),l+=h(u)}return l},r.prototype._adjustParentBBoxes=function(t,e,n){for(var r=n;r>=0;r--)a(e[r],t)},r.prototype._condense=function(t){for(var e=t.length-1,n=void 0;e>=0;e--)0===t[e].children.length?e>0?(n=t[e-1].children).splice(n.indexOf(t[e]),1):this.clear():o(t[e],this.toBBox)},r}()},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 l(t){return null===t?null:t.left}function c(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 m=function(){},_=(m.prototype.interfaces_=function(){return[]},m.prototype.getClass=function(){return m},m.prototype.equalsWithTolerance=function(t,e,n){return Math.abs(t-e)<=n},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)),v=function(){},x={MAX_VALUE:{configurable:!0}},E=(v.isNaN=function(t){return Number.isNaN(t)},v.doubleToLongBits=function(t){return t},v.longBitsToDouble=function(t){return t},v.isInfinite=function(t){return!Number.isFinite(t)},x.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(v,x),function(){}),b=function(){},I=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}},L=(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 _("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!!m.equalsWithTolerance(this.x,e.x,n)&&!!m.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 _("Invalid ordinate index: "+t)},w.prototype.equals3D=function(t){return this.x===t.x&&this.y===t.y&&(this.z===t.z||v.isNaN(this.z))&&v.isNaN(t.z)},w.prototype.equals=function(t){return t instanceof w&&this.equals2D(t)},w.prototype.equalInZ=function(t,e){return m.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,b,e]},w.prototype.getClass=function(){return w},w.hashCode=function(){if(1===arguments.length){var t=v.doubleToLongBits(arguments[0]);return Math.trunc((t^t)>>>32)}},N.DimensionalComparator.get=function(){return L},N.serialVersionUID.get=function(){return 0x5cbf2c235c7e5800},N.NULL_ORDINATE.get=function(){return v.NaN},N.X.get=function(){return 0},N.Y.get=function(){return 1},N.Z.get=function(){return 2},Object.defineProperties(w,N),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 _("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}}),S=(L.prototype.compare=function(t,e){var n=t,r=e,i=L.compare(n.x,r.x);if(0!==i)return i;var o=L.compare(n.y,r.y);return 0!==o?o:this._dimensionsToTest<=2?0:L.compare(n.z,r.z)},L.prototype.interfaces_=function(){return[I]},L.prototype.getClass=function(){return L},L.compare=function(t,e){return t<e?-1:t>e?1:v.isNaN(t)?v.isNaN(e)?0:-1:v.isNaN(e)?1:0},function(){}),C=(S.prototype.create=function(){},S.prototype.interfaces_=function(){return[]},S.prototype.getClass=function(){return S},function(){}),P={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}},M=(C.prototype.interfaces_=function(){return[]},C.prototype.getClass=function(){return C},C.toLocationSymbol=function(t){switch(t){case C.EXTERIOR:return"e";case C.BOUNDARY:return"b";case C.INTERIOR:return"i";case C.NONE:return"-"}throw new _("Unknown location value: "+t)},P.INTERIOR.get=function(){return 0},P.BOUNDARY.get=function(){return 1},P.EXTERIOR.get=function(){return 2},P.NONE.get=function(){return-1},Object.defineProperties(C,P),function(t,e){return t.interfaces_&&t.interfaces_().indexOf(e)>-1}),T=function(){},R={LOG_10:{configurable:!0}},O=(T.prototype.interfaces_=function(){return[]},T.prototype.getClass=function(){return T},T.log10=function(t){var e=Math.log(t);return v.isInfinite(e)||v.isNaN(e)?e:e/T.LOG_10},T.min=function(t,e,n,r){var i=t;return e<i&&(i=e),n<i&&(i=n),r<i&&(i=r),i},T.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}},T.wrap=function(t,e){return t<0?e- -t%e:t%e},T.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}},T.average=function(t,e){return(t+e)/2},R.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(T,R),function(t){this.str=t}),A=(O.prototype.append=function(t){this.str+=t},O.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},O.prototype.toString=function(t){return this.str},function(t){this.value=t}),D=(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)},function(){}),F=(D.isWhitespace=function(t){return t<=32&&t>=0||127===t},D.toUpperCase=function(t){return t.toUpperCase()},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}},G=(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 O,a=F.MAX_PRINT_DIGITS-1,u=0;u<=a;u++){t&&u===o&&s.append(".");var l=Math.trunc(n._hi);if(l<0)break;var c=!1,h=0;l>9?(c=!0,h="9"):h="0"+l,s.append(h),n=n.subtract(F.valueOf(l)).multiply(F.TEN),c&&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,r,i,o,s=arguments[0],a=arguments[1],u=null,l=null,c=null,h=null;return i=this._hi/s,h=(u=(c=F.SPLIT*i)-(u=c-i))*(l=(h=F.SPLIT*s)-(l=h-s))-(o=i*s)+u*(r=s-l)+(n=i-u)*l+n*r,h=i+(c=(this._hi-o-h+this._lo-i*a)/s),this._hi=h,this._lo=i-h+c,this}},F.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},F.prototype.divide=function(){if(arguments[0]instanceof F){var t,e,n,r,i=arguments[0],o=null,s=null,a=null,u=null;return t=(n=this._hi/i._hi)-(o=(a=F.SPLIT*n)-(o=a-n)),u=o*(s=(u=F.SPLIT*i._hi)-(s=u-i._hi))-(r=n*i._hi)+o*(e=i._hi-s)+t*s+t*e,a=(this._hi-r-u+this._lo-n*i._lo)/i._hi,new F(u=n+a,n-u+a)}if("number"==typeof arguments[0]){var l=arguments[0];return v.isNaN(l)?F.createNaN():F.copy(this).selfDivide(l,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,n,r,i,o,s=arguments[0],a=null;return a=(r=this._hi+s)-(i=r-this._hi),n=(o=(a=s-i+(this._hi-a))+this._lo)+(r-(e=r+o)),this._hi=e+n,this._lo=n+(e-this._hi),this}}else if(2===arguments.length){var u,l,c,h,p=arguments[0],f=arguments[1],g=null,d=null,y=null;c=this._hi+p,l=this._lo+f,d=c-(y=c-this._hi),g=l-(h=l-this._lo);var m=(u=c+(y=(d=p-y+(this._hi-d))+l))+(y=(g=f-h+(this._lo-g))+(y+(c-u))),_=y+(u-m);return this._hi=m,this._lo=_,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,r,i=arguments[0],o=arguments[1],s=null,a=null,u=null,l=null;s=(u=F.SPLIT*this._hi)-this._hi,l=F.SPLIT*i,s=u-s,n=this._hi-s,a=l-i;var c=(u=this._hi*i)+(l=s*(a=l-a)-u+s*(r=i-a)+n*a+n*r+(this._hi*o+this._lo*i)),h=l+(s=u-c);return this._hi=c,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 v.isNaN(e)?F.createNaN():F.copy(this).selfMultiply(e,0)}},F.prototype.isNaN=function(){return v.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,b]},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 l=t.charAt(e);if(e++,D.isDigit(l)){var c=l-"0";o.selfMultiply(F.TEN),o.selfAdd(c),s++}else{if("."!==l){if("e"===l||"E"===l){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 '"+l+"' 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(v.NaN,v.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 O,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(v.NaN,v.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),function(){}),B={DP_SAFE_EPSILON:{configurable:!0}},U=(G.prototype.interfaces_=function(){return[]},G.prototype.getClass=function(){return G},G.orientationIndex=function(t,e,n){var r=G.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()},G.signOfDet2x2=function(t,e,n,r){return t.multiply(r).selfSubtract(e.multiply(n)).signum()},G.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)),l=a.subtract(u).selfDivide(s).doubleValue(),c=F.valueOf(t.x).selfAdd(F.valueOf(e.x).selfSubtract(t.x).selfMultiply(l)).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(c,g)},G.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 G.signum(s);r=i+o}else{if(!(i<0))return G.signum(s);if(o>=0)return G.signum(s);r=-i-o}var a=G.DP_SAFE_EPSILON*r;return s>=a||-s>=a?G.signum(s):2},G.signum=function(t){return t>0?1:t<0?-1:0},B.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(G,B),function(){}),q={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}},z=(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[b]},U.prototype.getClass=function(){return U},Object.defineProperties(U,q),function(){}),j=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}(z),V=function(){},X=(V.arraycopy=function(t,e,n,r,i){for(var o=0,s=e;s<e+i;s++)n[r+o]=t[s],o++},V.getProperty=function(t){return{"line.separator":"\n"}[t]},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],l=arguments[1],c=arguments[2];this.x=u,this.y=l,this.w=c}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,m=h.x*p.y-p.x*h.y,_=f.y-g.y,v=g.x-f.x,x=f.x*g.y-g.x*f.y;this.x=y*x-v*m,this.y=_*m-d*x,this.w=d*v-_*y}}),Y=(X.prototype.getY=function(){var t=this.y/this.w;if(v.isNaN(t)||v.isInfinite(t))throw new j;return t},X.prototype.getX=function(){var t=this.x/this.w;if(v.isNaN(t)||v.isInfinite(t))throw new j;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,l=n.x*r.y-r.x*n.y,c=i*u-a*o,h=(o*l-u*s)/c,p=(a*s-i*l)/c;if(v.isNaN(h)||v.isInfinite(h)||v.isNaN(p)||v.isInfinite(p))throw new j;return new w(h,p)},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)}}),H={serialVersionUID:{configurable:!0}},W=(Y.prototype.getArea=function(){return this.getWidth()*this.getHeight()},Y.prototype.equals=function(t){if(!(t instanceof Y))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()},Y.prototype.intersection=function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new Y;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 Y(e,r,n,i)},Y.prototype.isNull=function(){return this._maxx<this._minx},Y.prototype.getMaxX=function(){return this._maxx},Y.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 Y){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}},Y.prototype.intersects=function(){if(1===arguments.length){if(arguments[0]instanceof Y){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)}},Y.prototype.getMinY=function(){return this._miny},Y.prototype.getMinX=function(){return this._minx},Y.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 Y){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))}},Y.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t<e?t:e},Y.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},Y.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},Y.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},Y.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},Y.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},Y.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},Y.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},Y.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()}},Y.prototype.contains=function(){if(1===arguments.length){if(arguments[0]instanceof Y){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)}},Y.prototype.centre=function(){return this.isNull()?null:new w((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},Y.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 Y){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)}},Y.prototype.getMaxY=function(){return this._maxy},Y.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)},Y.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)},Y.prototype.interfaces_=function(){return[E,e]},Y.prototype.getClass=function(){return Y},Y.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),l=Math.min(r.x,i.x),c=Math.max(r.x,i.x);return!(l>u||c<a||(a=Math.min(o.y,s.y),u=Math.max(o.y,s.y),l=Math.min(r.y,i.y),c=Math.max(r.y,i.y),l>u||c<a))}},H.serialVersionUID.get=function(){return 0x51845cd552189800},Object.defineProperties(Y,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 me},K=(J.prototype.read=function(t){var e,n,r;t=t.replace(/[\n\r]/g," ");var i=W.typeStr.exec(t);if(-1!==t.search("EMPTY")&&((i=W.emptyTypeStr.exec(t))[2]=void 0),i&&(n=i[1].toLowerCase(),r=i[2],Z[n]&&(e=Z[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])+")"},{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(",")}}),Z={point:function(t){if(void 0===t)return this.geometryFactory.createPoint();var e=t.trim().split(W.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(W.trimParens,"$1"),r.push(Z.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(W.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(W.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(W.parenComma),r=[],i=0,o=n.length;i<o;++i)e=n[i].replace(W.trimParens,"$1"),r.push(Z.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(W.parenComma),s=[],a=0,u=o.length;a<u;++a)e=o[a].replace(W.trimParens,"$1"),n=Z.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(W.doubleParenComma),r=[],i=0,o=n.length;i<o;++i)e=n[i].replace(W.trimParens,"$1"),r.push(Z.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)},Q=($.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+" )"},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}(Q),et=function(){},nt=(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:""))},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}},it=(nt.prototype.getIndexAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]},nt.prototype.getTopologySummary=function(){var t=new O;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),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 Y(this._inputLines[0][0],this._inputLines[0][1]),n=new Y(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,Y.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 j))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=G.intersection(t,e,n,r),s=this.isInSegmentEnvelopes(o);V.out.println("DD in env = "+s+" --------------------- "+o),i.distance(o)>1e-4&&V.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 l=this.safeHCoordinateIntersection(i,o,s,a);return l.x+=u.x,l.y+=u.y,l},e.prototype.computeCollinearIntersection=function(e,n,r,i){var o=Y.intersects(e,n,r),s=Y.intersects(e,n,i),a=Y.intersects(r,i,e),u=Y.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,l=n.x<r.x?n.x:r.x,c=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>l?o:l)+(a<h?a:h))/2,g=((s>c?s:c)+(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,!Y.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(){},st=(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}},function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t}),at=(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()!==C.EXTERIOR},st.prototype.getLocation=function(){return this._isPointOnSegment?C.BOUNDARY:this._crossingCount%2==1?C.INTERIOR:C.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&&M(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],l=o[a-1];if(s.countSegment(u,l),s.isOnSegment())return s.getLocation()}return s.getLocation()}},function(){}),ut={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}},lt=(at.prototype.interfaces_=function(){return[]},at.prototype.getClass=function(){return at},at.orientationIndex=function(t,e,n){return G.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(M(arguments[0],U)){var s=arguments[0],a=s.size();if(a<3)return 0;var u=new w,l=new w,c=new w;s.getCoordinate(0,l),s.getCoordinate(1,c);var h=l.x;c.x-=h;for(var p=0,f=1;f<a-1;f++)u.y=l.y,l.x=c.x,l.y=c.y,s.getCoordinate(f+1,c),c.x-=h,p+=l.x*(u.y-c.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(Y.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?T.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)!==C.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,l=a-i,c=u-o;n+=Math.sqrt(l*l+c*c),i=a,o=u}return n},at.isCCW=function(t){var e=t.length-1;if(e<3)throw new _("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],l=t[a];if(u.equals2D(n)||l.equals2D(n)||u.equals2D(l))return!1;var c=at.computeOrientation(u,n,l);return 0===c?u.x>l.x:c>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 _("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),l=((o.x-s.x)*(a.x-s.x)+(o.y-s.y)*(a.y-s.y))/u;if(l<=0)return o.distance(s);if(l>=1)return o.distance(a);var c=((s.y-o.y)*(a.x-s.x)-(s.x-o.x)*(a.y-s.y))/u;return Math.abs(c)*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),function(){}),ct=(lt.prototype.filter=function(t){},lt.prototype.interfaces_=function(){return[]},lt.prototype.getClass=function(){return 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}},pt=(ct.prototype.isGeometryCollection=function(){return this.getSortIndex()===ct.SORTINDEX_GEOMETRYCOLLECTION},ct.prototype.getFactory=function(){return this._factory},ct.prototype.getGeometryN=function(t){return this},ct.prototype.getArea=function(){return 0},ct.prototype.isRectangle=function(){return!1},ct.prototype.equals=function(){if(arguments[0]instanceof ct){var t=arguments[0];return null!==t&&this.equalsTopo(t)}if(arguments[0]instanceof Object){var e=arguments[0];if(!(e instanceof ct))return!1;var n=e;return this.equalsExact(n)}},ct.prototype.equalsExact=function(t){return this===t||this.equalsExact(t,0)},ct.prototype.geometryChanged=function(){this.apply(ct.geometryChangedFilter)},ct.prototype.geometryChangedAction=function(){this._envelope=null},ct.prototype.equalsNorm=function(t){return null!==t&&this.norm().equalsExact(t.norm())},ct.prototype.getLength=function(){return 0},ct.prototype.getNumGeometries=function(){return 1},ct.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)}},ct.prototype.getUserData=function(){return this._userData},ct.prototype.getSRID=function(){return this._SRID},ct.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},ct.prototype.checkNotGeometryCollection=function(t){if(t.getSortIndex()===ct.SORTINDEX_GEOMETRYCOLLECTION)throw new _("This method does not support GeometryCollection arguments")},ct.prototype.equal=function(t,e,n){return 0===n?t.equals(e):t.distance(e)<=n},ct.prototype.norm=function(){var t=this.copy();return t.normalize(),t},ct.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},ct.prototype.getEnvelopeInternal=function(){return null===this._envelope&&(this._envelope=this.computeEnvelopeInternal()),new Y(this._envelope)},ct.prototype.setSRID=function(t){this._SRID=t},ct.prototype.setUserData=function(t){this._userData=t},ct.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},ct.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},ct.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===ct.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===ct.SORTINDEX_MULTIPOINT||this.getSortIndex()===ct.SORTINDEX_MULTILINESTRING||this.getSortIndex()===ct.SORTINDEX_MULTIPOLYGON},ct.prototype.interfaces_=function(){return[b,E,e]},ct.prototype.getClass=function(){return ct},ct.hasNonEmptyElements=function(t){for(var e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1},ct.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(ct,ht),function(){}),ft=(pt.interfaces_=function(){return[lt]},pt.filter=function(t){t.geometryChangedAction()},function(){}),gt=(ft.prototype.filter=function(t){},ft.prototype.interfaces_=function(){return[]},ft.prototype.getClass=function(){return ft},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}},yt=(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 mt},dt.MultiValentEndPointBoundaryNodeRule.get=function(){return _t},dt.MonoValentEndPointBoundaryNodeRule.get=function(){return vt},dt.MOD2_BOUNDARY_RULE.get=function(){return new yt},dt.ENDPOINT_BOUNDARY_RULE.get=function(){return new mt},dt.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new _t},dt.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new vt},dt.OGC_SFS_BOUNDARY_RULE.get=function(){return gt.MOD2_BOUNDARY_RULE},Object.defineProperties(gt,dt),function(){}),mt=(yt.prototype.isInBoundary=function(t){return t%2==1},yt.prototype.interfaces_=function(){return[gt]},yt.prototype.getClass=function(){return yt},function(){}),_t=(mt.prototype.isInBoundary=function(t){return t>0},mt.prototype.interfaces_=function(){return[gt]},mt.prototype.getClass=function(){return mt},function(){}),vt=(_t.prototype.isInBoundary=function(t){return t>1},_t.prototype.interfaces_=function(){return[gt]},_t.prototype.getClass=function(){return _t},function(){}),xt=(vt.prototype.isInBoundary=function(t){return 1===t},vt.prototype.interfaces_=function(){return[gt]},vt.prototype.getClass=function(){return vt},function(){}),Et=(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",function(){}),bt=(Et.prototype.hasNext=function(){},Et.prototype.next=function(){},Et.prototype.remove=function(){},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)),It=((r.prototype=new Error).name="NoSuchElementException",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}(bt)),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 l=0;l<a.length;l++)this.add(a[l],u);else for(var c=a.length-1;c>=0;c--)this.add(a[c],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],m=arguments[3],_=1;y>m&&(_=-1);for(var v=y;v!==m;v+=_)this.add(g[v],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}(It),Lt=function(){},St={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}},Ct=(St.ForwardComparator.get=function(){return Ct},St.BidirectionalComparator.get=function(){return Pt},St.coordArrayType.get=function(){return new Array(0).fill(null)},Lt.prototype.interfaces_=function(){return[]},Lt.prototype.getClass=function(){return Lt},Lt.isRing=function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))},Lt.ptNotInList=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(Lt.indexOf(r,e)<0)return r}return null},Lt.scroll=function(t,e){var n=Lt.indexOf(e,t);if(n<0)return null;var r=new Array(t.length).fill(null);V.arraycopy(t,n,r,0,t.length-n),V.arraycopy(t,0,r,t.length-n,n),V.arraycopy(r,0,t,0,t.length)},Lt.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}},Lt.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()},Lt.hasRepeatedPoints=function(t){for(var e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1},Lt.removeRepeatedPoints=function(t){return Lt.hasRepeatedPoints(t)?new Nt(t,!1).toCoordinateArray():t},Lt.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}},Lt.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},Lt.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])},Lt.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},Lt.envelope=function(t){for(var e=new Y,n=0;n<t.length;n++)e.expandToInclude(t[n]);return e},Lt.toCoordinateArray=function(t){return t.toArray(Lt.coordArrayType)},Lt.atLeastNCoordinatesOrNothing=function(t,e){return e.length>=t?e:[]},Lt.indexOf=function(t,e){for(var n=0;n<e.length;n++)if(t.equals(e[n]))return n;return-1},Lt.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},Lt.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},Lt.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},Lt.extract=function(t,e,n){e=T.clamp(e,0,t.length);var r=(n=T.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(Lt,St),function(){}),Pt=(Ct.prototype.compare=function(t,e){return Lt.compare(t,e)},Ct.prototype.interfaces_=function(){return[I]},Ct.prototype.getClass=function(){return Ct},function(){}),Mt=(Pt.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=Lt.compare(n,r);return Lt.isEqualReversed(n,r)?0:i},Pt.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=Lt.increasingDirection(n),o=Lt.increasingDirection(r),s=i>0?0:n.length-1,a=o>0?0:n.length-1,u=0;u<n.length;u++){var l=n[s].compareTo(r[a]);if(0!==l)return l;s+=i,a+=o}return 0},Pt.prototype.interfaces_=function(){return[I]},Pt.prototype.getClass=function(){return Pt},function(){}),Tt=(Mt.prototype.get=function(){},Mt.prototype.put=function(){},Mt.prototype.size=function(){},Mt.prototype.values=function(){},Mt.prototype.entrySet=function(){},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}(Mt)),Rt=((i.prototype=new Error).name="OperationNotSupported",(o.prototype=new xt).contains=function(){},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 Ot(this)},e}(o)),Ot=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,Dt=((h.prototype=new Tt).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)===l(a(a(t)))){var e=c(a(a(t)));1===s(e)?(u(a(t),At),u(e,At),u(a(a(t)),1),t=a(a(t))):(t===c(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=l(a(a(t)));1===s(n)?(u(a(t),At),u(n,At),u(a(a(t)),1),t=a(a(t))):(t===l(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 It,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 Rt,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_},function(){}),Ft=(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)},function(t){this.treeSet_=t,this.position_=0}),kt=(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},function(){}),Gt=(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 It,n=0,r=t.length;n<r;n++)e.add(t[n]);return e},function(){}),Bt={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}},Ut=(Bt.P.get=function(){return 0},Bt.L.get=function(){return 1},Bt.A.get=function(){return 2},Bt.FALSE.get=function(){return-1},Bt.TRUE.get=function(){return-2},Bt.DONTCARE.get=function(){return-3},Bt.SYM_FALSE.get=function(){return"F"},Bt.SYM_TRUE.get=function(){return"T"},Bt.SYM_DONTCARE.get=function(){return"*"},Bt.SYM_P.get=function(){return"0"},Bt.SYM_L.get=function(){return"1"},Bt.SYM_A.get=function(){return"2"},Gt.prototype.interfaces_=function(){return[]},Gt.prototype.getClass=function(){return Gt},Gt.toDimensionSymbol=function(t){switch(t){case Gt.FALSE:return Gt.SYM_FALSE;case Gt.TRUE:return Gt.SYM_TRUE;case Gt.DONTCARE:return Gt.SYM_DONTCARE;case Gt.P:return Gt.SYM_P;case Gt.L:return Gt.SYM_L;case Gt.A:return Gt.SYM_A}throw new _("Unknown dimension value: "+t)},Gt.toDimensionValue=function(t){switch(D.toUpperCase(t)){case Gt.SYM_FALSE:return Gt.FALSE;case Gt.SYM_TRUE:return Gt.TRUE;case Gt.SYM_DONTCARE:return Gt.DONTCARE;case Gt.SYM_P:return Gt.P;case Gt.SYM_L:return Gt.L;case Gt.SYM_A:return Gt.A}throw new _("Unknown dimension symbol: "+t)},Object.defineProperties(Gt,Bt),function(){}),qt=(Ut.prototype.filter=function(t){},Ut.prototype.interfaces_=function(){return[]},Ut.prototype.getClass=function(){return Ut},function(){}),zt=(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},function(t){function e(e,n){if(t.call(this,n),this._geometries=e||[],t.hasNullElements(this._geometries))throw new _("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 Y,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=Gt.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=Gt.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),l=i.getGeometryN(a),c=u.compareToSameClass(l,r);if(0!==c)return c;a++}return a<o?1:a<s?-1:0}},e.prototype.apply=function(){if(M(arguments[0],ft))for(var t=arguments[0],e=0;e<this._geometries.length;e++)this._geometries[e].apply(t);else if(M(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(M(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(M(arguments[0],lt)){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}(ct)),jt=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 ct.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()?Gt.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 Vt(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}(zt),Vt=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}},Xt=(Vt.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)},Vt.prototype.getBoundary=function(){return this._geom instanceof Jt?this.boundaryLineString(this._geom):this._geom instanceof jt?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},Vt.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()])},Vt.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},Vt.prototype.computeBoundaryCoordinates=function(t){var e=new It;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 Lt.toCoordinateArray(e)},Vt.prototype.addEndpoint=function(t){var e=this._endpointMap.get(t);null===e&&(e=new Xt,this._endpointMap.put(t,e)),e.count++},Vt.prototype.interfaces_=function(){return[]},Vt.prototype.getClass=function(){return Vt},Vt.getBoundary=function(){return 1===arguments.length?new Vt(arguments[0]).getBoundary():2===arguments.length?new Vt(arguments[0],arguments[1]).getBoundary():void 0},function(){this.count=null}),Yt=(Xt.prototype.interfaces_=function(){return[]},Xt.prototype.getClass=function(){return Xt},function(){}),Ht={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}},Wt=(Yt.prototype.interfaces_=function(){return[]},Yt.prototype.getClass=function(){return Yt},Yt.chars=function(t,e){for(var n=new Array(e).fill(null),r=0;r<e;r++)n[r]=t;return String(n)},Yt.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(){}(Yt.getStackTrace(r))),a=0;a<i;a++)try{o+=s.readLine()+Yt.NEWLINE}catch(t){if(!(t instanceof g))throw t;et.shouldNeverReachHere()}return o}},Yt.split=function(t,e){for(var n=e.length,r=new It,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},Yt.toString=function(){if(1===arguments.length){var t=arguments[0];return Yt.SIMPLE_ORDINATE_FORMAT.format(t)}},Yt.spaces=function(t){return Yt.chars(" ",t)},Ht.NEWLINE.get=function(){return V.getProperty("line.separator")},Ht.SIMPLE_ORDINATE_FORMAT.get=function(){return new function(){}("0.#")},Object.defineProperties(Yt,Ht),function(){}),Jt=(Wt.prototype.interfaces_=function(){return[]},Wt.prototype.getClass=function(){return Wt},Wt.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))},Wt.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)},Wt.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)||v.isNaN(s)&&v.isNaN(a)))return!1}return!0},Wt.extend=function(t,e,n){var r=t.create(n,e.getDimension()),i=e.size();if(Wt.copy(e,0,r,0,i),i>0)for(var o=i;o<n;o++)Wt.copy(e,i-1,r,o,1);return r},Wt.reverse=function(t){for(var e=t.size()-1,n=Math.trunc(e/2),r=0;r<=n;r++)Wt.swap(t,r,e-r)},Wt.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)}},Wt.copy=function(t,e,n,r,i){for(var o=0;o<i;o++)Wt.copyCoord(t,e+o,n,r+o)},Wt.toString=function(){if(1===arguments.length){var t=arguments[0],e=t.size();if(0===e)return"()";var n=t.getDimension(),r=new O;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(Yt.toString(t.getOrdinate(i,o)))}return r.append(")"),r.toString()}},Wt.ensureValidRing=function(t,e){var n=e.size();return 0===n?e:n<=3?Wt.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:Wt.createClosedRing(t,e,n+1)},Wt.createClosedRing=function(t,e,n){var r=t.create(n,e.getDimension()),i=e.size();Wt.copy(e,0,r,0,i);for(var o=i;o<n;o++)Wt.copy(e,0,r,o,1);return r},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 Y:this._points.expandEnvelope(new Y)},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&&Wt.reverse(this._points),null}},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?Gt.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 Wt.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(M(arguments[0],ft))for(var t=arguments[0],e=0;e<this._points.size();e++)t.filter(this._points.getCoordinate(e));else if(M(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(M(arguments[0],Ut)||M(arguments[0],lt))&&arguments[0].filter(this)},e.prototype.getBoundary=function(){return new Vt(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 _("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}(ct)),Kt=function(){},Zt=(Kt.prototype.interfaces_=function(){return[]},Kt.prototype.getClass=function(){return Kt},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 Y;var t=new Y;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 Gt.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(M(arguments[0],ft)){var t=arguments[0];if(this.isEmpty())return null;t.filter(this.getCoordinate())}else if(M(arguments[0],qt)){var e=arguments[0];if(this.isEmpty())return null;e.filter(this._coordinates,0),e.isGeometryChanged()&&this.geometryChanged()}else(M(arguments[0],Ut)||M(arguments[0],lt))&&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}(ct)),$t=function(){},Qt=($t.prototype.interfaces_=function(){return[]},$t.prototype.getClass=function(){return $t},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 _("holes must not contain null elements");if(e.isEmpty()&&t.hasNonEmptyElements(n))throw new _("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),l=t.getY(a);if(u!==o==(l!==s))return!1;o=u,s=l}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);V.arraycopy(e.getCoordinates(),0,r,0,r.length);var i=Lt.minCoordinate(e.getCoordinates());Lt.scroll(r,i),V.arraycopy(r,0,e.getCoordinates(),0,r.length),e.getCoordinates()[r.length]=r[0],at.isCCW(e.getCoordinates())===n&&Lt.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(),l=i.getNumInteriorRing(),c=0;c<u&&c<l;){var h=this.getInteriorRingN(c),p=i.getInteriorRingN(c),f=h.compareToSameClass(p,r);if(0!==f)return f;c++}return c<u?1:c<l?-1:0}},e.prototype.apply=function(t){if(M(t,ft)){this._shell.apply(t);for(var e=0;e<this._holes.length;e++)this._holes[e].apply(t)}else if(M(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(M(t,Ut))t.filter(this);else if(M(t,lt)){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}(ct)),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 ct.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 Gt.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}(zt),ee=function(t){function e(e,n){e instanceof w&&n instanceof me&&(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 ct.SORTINDEX_LINEARRING},e.prototype.getBoundaryDimension=function(){return Gt.FALSE},e.prototype.isClosed=function(){return!!this.isEmpty()||t.prototype.isClosed.call(this)},e.prototype.reverse=function(){var t=this._points.copy();return Wt.reverse(t),this.getFactory().createLinearRing(t)},e.prototype.validateConstruction=function(){if(!this.isEmpty()&&!t.prototype.isClosed.call(this))throw new _("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<e.MINIMUM_VALID_SIZE)throw new _("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 ct.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 It,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}(zt),re=function(t){this._factory=t||null,this._isUserDataCopied=!1},ie={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}},oe=(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 zt?this.editGeometryCollection(t,e):t instanceof Qt?this.editPolygon(t,e):t instanceof Zt||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 It,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()===jt?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 It,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),function(){}),se=(oe.prototype.edit=function(t,e){return t},oe.prototype.interfaces_=function(){return[re.GeometryEditorOperation]},oe.prototype.getClass=function(){return oe},function(){}),ae=(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 Zt?n.length>0?e.createPoint(n[0]):e.createPoint():t},se.prototype.interfaces_=function(){return[re.GeometryEditorOperation]},se.prototype.getClass=function(){return se},function(){}),ue=(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 Zt?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},ae.prototype.interfaces_=function(){return[re.GeometryEditorOperation]},ae.prototype.getClass=function(){return ae},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(M(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}}),le={serialVersionUID:{configurable:!0}},ce=(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 _("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 v.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 O(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},le.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(ue,le),function(){}),he={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}},pe=(ce.prototype.readResolve=function(){return ce.instance()},ce.prototype.create=function(){if(1===arguments.length){if(arguments[0]instanceof Array)return new ue(arguments[0]);if(M(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)}},ce.prototype.interfaces_=function(){return[S,e]},ce.prototype.getClass=function(){return ce},ce.instance=function(){return ce.instanceObject},he.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},he.instanceObject.get=function(){return new ce},Object.defineProperties(ce,he),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 It,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 Rt;return this.map_.entries().forEach((function(e){return t.add(e)})),t},e.prototype.size=function(){return this.map_.size()},e}(Mt)),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}},de=(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 v.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),function t(e){this._name=e||null,t.nameToTypeMap.put(e,this)}),ye={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}},me=(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"),function t(){this._precisionModel=new fe,this._SRID=0,this._coordinateSequenceFactory=t.getDefaultCoordinateSequenceFactory(),0===arguments.length||(1===arguments.length?M(arguments[0],S)?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]))}),_e={serialVersionUID:{configurable:!0}},ve=(me.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)},me.prototype.createLineString=function(t){return t?t instanceof Array?new Jt(this.getCoordinateSequenceFactory().create(t),this):M(t,U)?new Jt(t,this):void 0:new Jt(this.getCoordinateSequenceFactory().create([]),this)},me.prototype.createMultiLineString=function(){return 0===arguments.length?new jt(null,this):1===arguments.length?new jt(arguments[0],this):void 0},me.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(me.toGeometryArray(t));var a=t.iterator().next();if(t.size()>1){if(a instanceof Qt)return this.createMultiPolygon(me.toPolygonArray(t));if(a instanceof Jt)return this.createMultiLineString(me.toLineStringArray(t));if(a instanceof Zt)return this.createMultiPoint(me.toPointArray(t));et.shouldNeverReachHere("Unhandled class: "+a.getClass().getName())}return a},me.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)},me.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(M(arguments[0],U))return new Zt(arguments[0],this)}},me.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},me.prototype.createPolygon=function(){if(0===arguments.length)return new Qt(null,null,this);if(1===arguments.length){if(M(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 Qt(arguments[0],arguments[1],this)},me.prototype.getSRID=function(){return this._SRID},me.prototype.createGeometryCollection=function(){return 0===arguments.length?new zt(null,this):1===arguments.length?new zt(arguments[0],this):void 0},me.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)}}})},me.prototype.getPrecisionModel=function(){return this._precisionModel},me.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(M(arguments[0],U))return new ee(arguments[0],this)}},me.prototype.createMultiPolygon=function(){return 0===arguments.length?new ne(null,this):1===arguments.length?new ne(arguments[0],this):void 0},me.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(M(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());Wt.copy(e,r,i,0,1),n[r]=this.createPoint(i)}return this.createMultiPoint(n)}}},me.prototype.interfaces_=function(){return[e]},me.prototype.getClass=function(){return me},me.toMultiPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},me.toGeometryArray=function(t){if(null===t)return null;var e=new Array(t.size()).fill(null);return t.toArray(e)},me.getDefaultCoordinateSequenceFactory=function(){return ce.instance()},me.toMultiLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},me.toLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},me.toMultiPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},me.toLinearRingArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},me.toPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},me.toPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},me.createPointFromInternalCoord=function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)},_e.serialVersionUID.get=function(){return-0x5ea75f2051eeb400},Object.defineProperties(me,_e),["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"]),xe=function(t){this.geometryFactory=t||new me},Ee=(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!==ve.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(!be[e])throw new Error("Geometry is not supported");return be[e].apply(this,[t])},{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)}}),be={coordinate:function(t){return[t.x,t.y]},Point:function(t){return{type:"Point",coordinates:be.coordinate.apply(this,[t.getCoordinate()])}},MultiPoint:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=be.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(be.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=be.LineString.apply(this,[r]);e.push(i.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(t){var e=[],n=be.LineString.apply(this,[t._shell]);e.push(n.coordinates);for(var r=0;r<t._holes.length;++r){var i=t._holes[r],o=be.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=be.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(be[i].apply(this,[r]))}return{type:"GeometryCollection",geometries:e}}},Ie=function(t){this.geometryFactory=t||new me,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new xe(this.geometryFactory)},we=(Ie.prototype.read=function(t){var e=this.parser.read(t);return this.precisionModel.getType()===fe.FIXED&&this.reducePrecision(e),e},Ie.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])},function(){this.parser=new xe(this.geometryFactory)}),Ne=(we.prototype.write=function(t){return this.parser.write(t)},function(){}),Le={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}},Se=(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},Le.ON.get=function(){return 0},Le.LEFT.get=function(){return 1},Le.RIGHT.get=function(){return 2},Object.defineProperties(Ne,Le),(d.prototype=new Error).name="EmptyStackException",(y.prototype=new bt).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},function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null}),Ce=(Se.prototype.getCoordinate=function(){return this._minCoord},Se.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},Se.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)},Se.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},Se.prototype.getEdge=function(){return this._orientedDe},Se.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])},Se.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)},Se.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())},Se.prototype.interfaces_=function(){return[]},Se.prototype.getClass=function(){return Se},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}(Q)),Pe=function(){this.array_=[]},Me=(Pe.prototype.addLast=function(t){this.array_.push(t)},Pe.prototype.removeFirst=function(){return this.array_.shift()},Pe.prototype.isEmpty=function(){return 0===this.array_.length},function(){this._finder=null,this._dirEdgeList=new It,this._nodes=new It,this._rightMostCoord=null,this._env=null,this._finder=new Se}),Te=(Me.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();)t.next().setVisited(!1)},Me.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},Me.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 Ce("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)}},Me.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(Ne.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},Me.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},Me.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)}},Me.prototype.computeDepths=function(t){var e=new Rt,n=new Pe,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))}}}},Me.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.x<e._rightMostCoord.x?-1:this._rightMostCoord.x>e._rightMostCoord.x?1:0},Me.prototype.getEnvelope=function(){if(null===this._env){for(var t=new Y,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},Me.prototype.addReachable=function(t){var e=new y;for(e.add(t);!e.empty();){var n=e.pop();this.add(n,e)}},Me.prototype.copySymDepths=function(t){var e=t.getSym();e.setDepth(Ne.LEFT,t.getDepth(Ne.RIGHT)),e.setDepth(Ne.RIGHT,t.getDepth(Ne.LEFT))},Me.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)}},Me.prototype.getNodes=function(){return this._nodes},Me.prototype.getDirectedEdges=function(){return this._dirEdgeList},Me.prototype.interfaces_=function(){return[E]},Me.prototype.getClass=function(){return 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}}),Re=(Te.prototype.setAllLocations=function(t){for(var e=0;e<this.location.length;e++)this.location[e]=t},Te.prototype.isNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]!==C.NONE)return!1;return!0},Te.prototype.setAllLocationsIfNull=function(t){for(var e=0;e<this.location.length;e++)this.location[e]===C.NONE&&(this.location[e]=t)},Te.prototype.isLine=function(){return 1===this.location.length},Te.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]=C.NONE,e[Ne.RIGHT]=C.NONE,this.location=e}for(var n=0;n<this.location.length;n++)this.location[n]===C.NONE&&n<t.location.length&&(this.location[n]=t.location[n])},Te.prototype.getLocations=function(){return this.location},Te.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},Te.prototype.toString=function(){var t=new O;return this.location.length>1&&t.append(C.toLocationSymbol(this.location[Ne.LEFT])),t.append(C.toLocationSymbol(this.location[Ne.ON])),this.location.length>1&&t.append(C.toLocationSymbol(this.location[Ne.RIGHT])),t.toString()},Te.prototype.setLocations=function(t,e,n){this.location[Ne.ON]=t,this.location[Ne.LEFT]=e,this.location[Ne.RIGHT]=n},Te.prototype.get=function(t){return t<this.location.length?this.location[t]:C.NONE},Te.prototype.isArea=function(){return this.location.length>1},Te.prototype.isAnyNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]===C.NONE)return!0;return!1},Te.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}},Te.prototype.init=function(t){this.location=new Array(t).fill(null),this.setAllLocations(C.NONE)},Te.prototype.isEqualOnSide=function(t,e){return this.location[e]===t.location[e]},Te.prototype.allPositionsEqual=function(t){for(var e=0;e<this.location.length;e++)if(this.location[e]!==t)return!1;return!0},Te.prototype.interfaces_=function(){return[]},Te.prototype.getClass=function(){return Te},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 Te(e),this.elt[1]=new Te(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.elt[0]=new Te(n.elt[0]),this.elt[1]=new Te(n.elt[1])}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.elt[0]=new Te(C.NONE),this.elt[1]=new Te(C.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 Te(o,s,a),this.elt[1]=new Te(o,s,a)}else if(4===arguments.length){var u=arguments[0],l=arguments[1],c=arguments[2],h=arguments[3];this.elt[0]=new Te(C.NONE,C.NONE,C.NONE),this.elt[1]=new Te(C.NONE,C.NONE,C.NONE),this.elt[u].setLocations(l,c,h)}}),Oe=(Re.prototype.getGeometryCount=function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t},Re.prototype.setAllLocations=function(t,e){this.elt[t].setAllLocations(e)},Re.prototype.isNull=function(t){return this.elt[t].isNull()},Re.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)}},Re.prototype.isLine=function(t){return this.elt[t].isLine()},Re.prototype.merge=function(t){for(var e=0;e<2;e++)null===this.elt[e]&&null!==t.elt[e]?this.elt[e]=new Te(t.elt[e]):this.elt[e].merge(t.elt[e])},Re.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},Re.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)}},Re.prototype.toString=function(){var t=new O;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()},Re.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()}},Re.prototype.isAnyNull=function(t){return this.elt[t].isAnyNull()},Re.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)}},Re.prototype.isEqualOnSide=function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)},Re.prototype.allPositionsEqual=function(t,e){return this.elt[t].allPositionsEqual(e)},Re.prototype.toLine=function(t){this.elt[t].isArea()&&(this.elt[t]=new Te(this.elt[t].location[0]))},Re.prototype.interfaces_=function(){return[]},Re.prototype.getClass=function(){return Re},Re.toLineLabel=function(t){for(var e=new Re(C.NONE),n=0;n<2;n++)e.setLocation(n,t.getLocation(n));return e},function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new It,this._pts=new It,this._label=new Re(C.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new It,this._geometryFactory=null;var t=arguments[0],e=arguments[1];this._geometryFactory=e,this.computePoints(t),this.computeRing()}),Ae=(Oe.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())},Oe.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},Oe.prototype.computePoints=function(t){this._startDe=t;var e=t,n=!0;do{if(null===e)throw new Ce("Found null DirectedEdge");if(e.getEdgeRing()===this)throw new Ce("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)},Oe.prototype.getLinearRing=function(){return this._ring},Oe.prototype.getCoordinate=function(t){return this._pts.get(t)},Oe.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},Oe.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])}},Oe.prototype.isHole=function(){return this._isHole},Oe.prototype.setInResult=function(){var t=this._startDe;do{t.getEdge().setInResult(!0),t=t.getNext()}while(t!==this._startDe)},Oe.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},Oe.prototype.addHole=function(t){this._holes.add(t)},Oe.prototype.isShell=function(){return null===this._shell},Oe.prototype.getLabel=function(){return this._label},Oe.prototype.getEdges=function(){return this._edges},Oe.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},Oe.prototype.getShell=function(){return this._shell},Oe.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===C.NONE)return null;if(this._label.getLocation(e)===C.NONE)return this._label.setLocation(e,n),null}},Oe.prototype.setShell=function(t){this._shell=t,null!==t&&t.addHole(this)},Oe.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)},Oe.prototype.interfaces_=function(){return[]},Oe.prototype.getClass=function(){return Oe},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}(Oe)),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 It,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}(Oe),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}},ke=(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},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 Re(0,C.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=C.NONE;if(n=this._label.getLocation(e),!t.isNull(e)){var r=t.getLocation(e);n!==C.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 Re(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 Re)for(var n=arguments[0],r=0;r<2;r++){var i=this.computeMergedLocation(n,r);this._label.getLocation(r)===C.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=C.NONE;null!==this._label&&(e=this._label.getLocation(t));var n=null;switch(e){case C.BOUNDARY:n=C.INTERIOR;break;case C.INTERIOR:default:n=C.BOUNDARY}this._label.setLocation(t,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Fe)),Ge=function(){this.nodeMap=new h,this.nodeFact=null;var t=arguments[0];this.nodeFact=t},Be=(Ge.prototype.find=function(t){return this.nodeMap.get(t)},Ge.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)}},Ge.prototype.print=function(t){for(var e=this.iterator();e.hasNext();)e.next().print(t)},Ge.prototype.iterator=function(){return this.nodeMap.values().iterator()},Ge.prototype.values=function(){return this.nodeMap.values()},Ge.prototype.getBoundaryNodes=function(t){for(var e=new It,n=this.iterator();n.hasNext();){var r=n.next();r.getLabel().getLocation(t)===C.BOUNDARY&&e.add(r)}return e},Ge.prototype.add=function(t){var e=t.getCoordinate();this.addNode(e).add(t)},Ge.prototype.interfaces_=function(){return[]},Ge.prototype.getClass=function(){return Ge},function(){}),Ue={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}},qe=(Be.prototype.interfaces_=function(){return[]},Be.prototype.getClass=function(){return Be},Be.isNorthern=function(t){return t===Be.NE||t===Be.NW},Be.isOpposite=function(t,e){return t!==e&&2==(t-e+4)%4},Be.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},Be.isInHalfPlane=function(t,e){return e===Be.SE?t===Be.SE||t===Be.SW:t===e||t===e+1},Be.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 _("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?Be.NE:Be.SE:e>=0?Be.NW:Be.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 _("Cannot compute the quadrant for two identical points "+n);return r.x>=n.x?r.y>=n.y?Be.NE:Be.SE:r.y>=n.y?Be.NW:Be.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(Be,Ue),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}}),ze=(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=Be.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},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 Re(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 Ce("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)===C.INTERIOR&&this._label.getLocation(e,Ne.RIGHT)===C.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,C.EXTERIOR),n=!this._label.isArea(1)||this._label.allPositionsEqual(1,C.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===C.EXTERIOR&&e===C.INTERIOR?1:t===C.INTERIOR&&e===C.EXTERIOR?-1:0},e}(qe)),je=function(){},Ve=(je.prototype.createNode=function(t){return new ke(t,null)},je.prototype.interfaces_=function(){return[]},je.prototype.getClass=function(){return je},function(){if(this._edges=new It,this._nodes=null,this._edgeEndList=new It,0===arguments.length)this._nodes=new Ge(new je);else if(1===arguments.length){var t=arguments[0];this._nodes=new Ge(t)}}),Xe=(Ve.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)}},Ve.prototype.find=function(t){return this._nodes.find(t)},Ve.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)}},Ve.prototype.getNodeIterator=function(){return this._nodes.iterator()},Ve.prototype.linkResultDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkResultDirectedEdges()},Ve.prototype.debugPrintln=function(t){V.out.println(t)},Ve.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)===C.BOUNDARY},Ve.prototype.linkAllDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkAllDirectedEdges()},Ve.prototype.matchInSameDirection=function(t,e,n,r){return!!t.equals(n)&&at.computeOrientation(t,e,r)===at.COLLINEAR&&Be.quadrant(t,e)===Be.quadrant(n,r)},Ve.prototype.getEdgeEnds=function(){return this._edgeEndList},Ve.prototype.debugPrint=function(t){V.out.print(t)},Ve.prototype.getEdgeIterator=function(){return this._edges.iterator()},Ve.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},Ve.prototype.insertEdge=function(t){this._edges.add(t)},Ve.prototype.findEdgeEnd=function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var n=e.next();if(n.getEdge()===t)return n}return null},Ve.prototype.addEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this._edges.add(n);var r=new ze(n,!0),i=new ze(n,!1);r.setSym(i),i.setSym(r),this.add(r),this.add(i)}},Ve.prototype.add=function(t){this._nodes.add(t),this._edgeEndList.add(t)},Ve.prototype.getNodes=function(){return this._nodes.values()},Ve.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},Ve.prototype.interfaces_=function(){return[]},Ve.prototype.getClass=function(){return Ve},Ve.linkResultDirectedEdges=function(t){for(var e=t.iterator();e.hasNext();)e.next().getEdges().linkResultDirectedEdges()},function(){this._geometryFactory=null,this._shellList=new It;var t=arguments[0];this._geometryFactory=t}),Ye=(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 It,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 Ce("unable to assign hole to a shell",r.getCoordinate(0));r.setShell(i)}}},Xe.prototype.buildMinimalEdgeRings=function(t,e,n){for(var r=new It,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 It,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(),l=u.getLinearRing(),c=l.getEnvelopeInternal();null!==o&&(s=o.getLinearRing().getEnvelopeInternal());var h=!1;c.contains(r)&&at.isPointInRing(i,l.getCoordinates())&&(h=!0),h&&(null===o||s.contains(c))&&(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];Ve.linkResultDirectedEdges(n);var r=this.buildMaximalEdgeRings(e),i=new It,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},function(){}),He=(Ye.prototype.getBounds=function(){},Ye.prototype.interfaces_=function(){return[]},Ye.prototype.getClass=function(){return Ye},function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e}),We=(He.prototype.getItem=function(){return this._item},He.prototype.getBounds=function(){return this._bounds},He.prototype.interfaces_=function(){return[Ye,e]},He.prototype.getClass=function(){return He},function(){this._size=null,this._items=null,this._size=0,this._items=new It,this._items.add(null)}),Je=(We.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},We.prototype.size=function(){return this._size},We.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)},We.prototype.clear=function(){this._size=0,this._items.clear()},We.prototype.isEmpty=function(){return 0===this._size},We.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)},We.prototype.interfaces_=function(){return[]},We.prototype.getClass=function(){return We},function(){}),Ke=(Je.prototype.visitItem=function(t){},Je.prototype.interfaces_=function(){return[]},Je.prototype.getClass=function(){return Je},function(){}),Ze=(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},function(){if(this._childBoundables=new It,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=(Ze.prototype.getLevel=function(){return this._level},Ze.prototype.size=function(){return this._childBoundables.size()},Ze.prototype.getChildBoundables=function(){return this._childBoundables},Ze.prototype.addChildBoundable=function(t){et.isTrue(null===this._bounds),this._childBoundables.add(t)},Ze.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Ze.prototype.getBounds=function(){return null===this._bounds&&(this._bounds=this.computeBounds()),this._bounds},Ze.prototype.interfaces_=function(){return[Ye,e]},Ze.prototype.getClass=function(){return Ze},$e.serialVersionUID.get=function(){return 0x5a1e55ec41369800},Object.defineProperties(Ze,$e),function(){}),tn=(Qe.reverseOrder=function(){return{compare:function(t,e){return e.compareTo(t)}}},Qe.min=function(t){return Qe.sort(t),t.get(0)},Qe.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])},Qe.singletonList=function(t){var e=new It;return e.add(t),e},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()}),en=(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 _("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 Ze},function t(){if(this._root=null,this._built=!1,this._itemBoundables=new It,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}},rn=(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 Ze?t+=this.size(n):n instanceof He&&(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 He&&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 It:t}if(1===arguments.length){for(var e=arguments[0],n=new It,r=e.getChildBoundables().iterator();r.hasNext();){var i=r.next();if(i instanceof Ze){var o=this.itemsTree(i);null!==o&&n.add(o)}else i instanceof He?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 He(t,e))},en.prototype.boundablesAtLevel=function(){if(1===arguments.length){var t=arguments[0],e=new It;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 Ze?this.boundablesAtLevel(n,s,i):(et.isTrue(s instanceof He),-1===n&&i.add(s))}return null}},en.prototype.query=function(){if(1===arguments.length){var t=arguments[0];this.build();var e=new It;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(M(arguments[2],Je)&&arguments[0]instanceof Object&&arguments[1]instanceof Ze)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 Ze?this.query(i,u,o):u instanceof He?o.visitItem(u.getItem()):et.shouldNeverReachHere())}else if(M(arguments[2],bt)&&arguments[0]instanceof Object&&arguments[1]instanceof Ze)for(var l=arguments[0],c=arguments[2],h=arguments[1].getChildBoundables(),p=0;p<h.size();p++){var f=h.get(p);this.getIntersectsOp().intersects(f.getBounds(),l)&&(f instanceof Ze?this.query(l,f,c):f instanceof He?c.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 Ze&&(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 Ze){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 It;n.add(this.createNode(e));var r=new It(t);Qe.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),function(){}),on=function(){},sn=(on.prototype.distance=function(t,e){},on.prototype.interfaces_=function(){return[]},on.prototype.getClass=function(){return on},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 It,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 It;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(M(arguments[2],Je)&&arguments[0]instanceof Object&&arguments[1]instanceof Ze){var i=arguments[0],o=arguments[1],s=arguments[2];t.prototype.query.call(this,i,o,s)}else if(M(arguments[2],bt)&&arguments[0]instanceof Object&&arguments[1]instanceof Ze){var a=arguments[0],u=arguments[1],l=arguments[2];t.prototype.query.call(this,a,u,l)}},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 It(t);Qe.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(M(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,v.POSITIVE_INFINITY)}}else if(2===arguments.length){if(arguments[0]instanceof n&&M(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],l=null,c=new We;for(c.add(a);!c.isEmpty()&&u>0;){var h=c.poll(),p=h.getDistance();if(p>=u)break;h.isLeaves()?(u=p,l=h):h.expandToQueue(c,u)}return[l.getBoundable(0).getItem(),l.getBoundable(1).getItem()]}}else if(3===arguments.length){var f=arguments[2],g=new He(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[I]},compare:function(e,r){return t.compareDoubles(n.centreX(e.getBounds()),n.centreX(r.getBounds()))}}},r.yComparator.get=function(){return{interfaces_:function(){return[I]},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 Y(n.getBounds()):t.expandToInclude(n.getBounds())}return t},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ze),un=function(){},ln=(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},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=(ln.prototype.getCoordinate=function(){return this.coord},ln.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},ln.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)},ln.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===t},ln.prototype.isInterior=function(){return this._isInterior},ln.prototype.interfaces_=function(){return[E]},ln.prototype.getClass=function(){return ln},function(){this._nodeMap=new h,this._edge=null;var t=arguments[0];this._edge=t}),hn=(cn.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()},cn.prototype.addCollapsedNodes=function(){var t=new It;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)}},cn.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},cn.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))}},cn.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))},cn.prototype.iterator=function(){return this._nodeMap.values().iterator()},cn.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}},cn.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)},cn.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}},cn.prototype.getEdge=function(){return this._edge},cn.prototype.addEndpoints=function(){var t=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(t),t)},cn.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())},cn.prototype.add=function(t,e){var n=new ln(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)},cn.prototype.checkSplitEdgesCorrectness=function(t){var e=this._edge.getCoordinates(),n=t.get(0).getCoordinate(0);if(!n.equals2D(e[0]))throw new Q("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 Q("bad split edge end point at "+i)},cn.prototype.interfaces_=function(){return[]},cn.prototype.getClass=function(){return cn},function(){}),pn=(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 _("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 _("Cannot compute the octant for two identical points "+i);return hn.octant(s,a)}},function(){}),fn=(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},function(){}),gn=(fn.prototype.addIntersection=function(t,e){},fn.prototype.interfaces_=function(){return[pn]},fn.prototype.getClass=function(){return fn},function(){this._nodeList=new cn(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e}),dn=(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 It;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)},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}},mn=(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?v.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=v.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 j))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||v.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=v.doubleToLongBits(this.p0.x);t^=31*v.doubleToLongBits(this.p0.y);var e=Math.trunc(t)^Math.trunc(t>>32),n=v.doubleToLongBits(this.p1.x);return n^=31*v.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),function(){this.tempEnv1=new Y,this.tempEnv2=new Y,this._overlapSeg1=new dn,this._overlapSeg2=new dn}),_n=(mn.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)}},mn.prototype.interfaces_=function(){return[]},mn.prototype.getClass=function(){return mn},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=(_n.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},_n.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)},_n.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},_n.prototype.computeOverlaps=function(t,e){this.computeOverlapsInternal(this._start,this._end,t,t._start,t._end,e)},_n.prototype.setId=function(t){this._id=t},_n.prototype.select=function(t,e){this.computeSelect(t,this._start,this._end,e)},_n.prototype.getEnvelope=function(){if(null===this._env){var t=this._pts[this._start],e=this._pts[this._end];this._env=new Y(t,e)}return this._env},_n.prototype.getEndIndex=function(){return this._end},_n.prototype.getStartIndex=function(){return this._start},_n.prototype.getContext=function(){return this._context},_n.prototype.getId=function(){return this._id},_n.prototype.computeOverlapsInternal=function(t,e,n,r,i,o){var s=this._pts[t],a=this._pts[e],u=n._pts[r],l=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,l),!o.tempEnv1.intersects(o.tempEnv2))return null;var c=Math.trunc((t+e)/2),h=Math.trunc((r+i)/2);t<c&&(r<h&&this.computeOverlapsInternal(t,c,n,r,h,o),h<i&&this.computeOverlapsInternal(t,c,n,h,i,o)),c<e&&(r<h&&this.computeOverlapsInternal(c,e,n,r,h,o),h<i&&this.computeOverlapsInternal(c,e,n,h,i,o))},_n.prototype.interfaces_=function(){return[]},_n.prototype.getClass=function(){return _n},function(){}),xn=(vn.prototype.interfaces_=function(){return[]},vn.prototype.getClass=function(){return vn},vn.getChainStartIndices=function(t){var e=0,n=new It;n.add(new A(e));do{var r=vn.findChainEnd(t,e);n.add(new A(r)),e=r}while(e<t.length-1);return vn.toIntArray(n)},vn.findChainEnd=function(t,e){for(var n=e;n<t.length-1&&t[n].equals2D(t[n+1]);)n++;if(n>=t.length-1)return t.length-1;for(var r=Be.quadrant(t[n],t[n+1]),i=e+1;i<t.length&&(t[i-1].equals2D(t[i])||Be.quadrant(t[i-1],t[i])===r);)i++;return i-1},vn.getChains=function(){if(1===arguments.length){var t=arguments[0];return vn.getChains(t,null)}if(2===arguments.length){for(var e=arguments[0],n=arguments[1],r=new It,i=vn.getChainStartIndices(e),o=0;o<i.length-1;o++){var s=new _n(e,i[o],i[o+1],n);r.add(s)}return r}},vn.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e},function(){}),En=(xn.prototype.computeNodes=function(t){},xn.prototype.getNodedSubstrings=function(){},xn.prototype.interfaces_=function(){return[]},xn.prototype.getClass=function(){return xn},function(){if(this._segInt=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.setSegmentIntersector(t)}}),bn=(En.prototype.setSegmentIntersector=function(t){this._segInt=t},En.prototype.interfaces_=function(){return[xn]},En.prototype.getClass=function(){return En},function(t){function e(e){e?t.call(this,e):t.call(this),this._monoChains=new It,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=vn.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 In(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 In},Object.defineProperties(e,n),e}(En)),In=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}(mn),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}},Ln=(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),function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=at.COUNTERCLOCKWISE,this._inputLine=t||null}),Sn={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}},Cn=(Ln.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)},Ln.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]=Ln.DELETE,i=!0,r=!0),t=i?n:e,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e)}return r},Ln.prototype.isShallowConcavity=function(t,e,n,r){return at.computeOrientation(t,e,n)===this._angleOrientation&&at.distancePointLine(e,t,n)<r},Ln.prototype.isShallowSampled=function(t,e,n,r,i){var o=Math.trunc((r-n)/Ln.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},Ln.prototype.isConcave=function(t,e,n){return at.computeOrientation(t,e,n)===this._angleOrientation},Ln.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()},Ln.prototype.findNextNonDeletedIndex=function(t){for(var e=t+1;e<this._inputLine.length&&this._isDeleted[e]===Ln.DELETE;)e++;return e},Ln.prototype.isShallow=function(t,e,n,r){return at.distancePointLine(e,t,n)<r},Ln.prototype.collapseLine=function(){for(var t=new Nt,e=0;e<this._inputLine.length;e++)this._isDeleted[e]!==Ln.DELETE&&t.add(this._inputLine[e]);return t.toCoordinateArray()},Ln.prototype.interfaces_=function(){return[]},Ln.prototype.getClass=function(){return Ln},Ln.simplify=function(t,e){return new Ln(t).simplify(e)},Sn.INIT.get=function(){return 0},Sn.DELETE.get=function(){return 1},Sn.KEEP.get=function(){return 1},Sn.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(Ln,Sn),function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new It}),Pn={COORDINATE_ARRAY_TYPE:{configurable:!0}},Mn=(Cn.prototype.getCoordinates=function(){return this._ptList.toArray(Cn.COORDINATE_ARRAY_TYPE)},Cn.prototype.setPrecisionModel=function(t){this._precisionModel=t},Cn.prototype.addPt=function(t){var e=new w(t);if(this._precisionModel.makePrecise(e),this.isRedundant(e))return null;this._ptList.add(e)},Cn.prototype.revere=function(){},Cn.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])},Cn.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},Cn.prototype.toString=function(){return(new me).createLineString(this.getCoordinates()).toString()},Cn.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)},Cn.prototype.setMinimumVertexDistance=function(t){this._minimimVertexDistance=t},Cn.prototype.interfaces_=function(){return[]},Cn.prototype.getClass=function(){return Cn},Pn.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(Cn,Pn),function(){}),Tn={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}},Rn=(Mn.prototype.interfaces_=function(){return[]},Mn.prototype.getClass=function(){return Mn},Mn.toDegrees=function(t){return 180*t/Math.PI},Mn.normalize=function(t){for(;t>Math.PI;)t-=Mn.PI_TIMES_2;for(;t<=-Math.PI;)t+=Mn.PI_TIMES_2;return t},Mn.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)}},Mn.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},Mn.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},Mn.interiorAngle=function(t,e,n){var r=Mn.angle(e,t),i=Mn.angle(e,n);return Math.abs(i-r)},Mn.normalizePositive=function(t){if(t<0){for(;t<0;)t+=Mn.PI_TIMES_2;t>=Mn.PI_TIMES_2&&(t=0)}else{for(;t>=Mn.PI_TIMES_2;)t-=Mn.PI_TIMES_2;t<0&&(t=0)}return t},Mn.angleBetween=function(t,e,n){var r=Mn.angle(e,t),i=Mn.angle(e,n);return Mn.diff(r,i)},Mn.diff=function(t,e){var n=null;return(n=t<e?e-t:t-e)>Math.PI&&(n=2*Math.PI-n),n},Mn.toRadians=function(t){return t*Math.PI/180},Mn.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?Mn.COUNTERCLOCKWISE:n<0?Mn.CLOCKWISE:Mn.NONE},Mn.angleBetweenOriented=function(t,e,n){var r=Mn.angle(e,t),i=Mn.angle(e,n)-r;return i<=-Math.PI?i+Mn.PI_TIMES_2:i>Math.PI?i-Mn.PI_TIMES_2:i},Tn.PI_TIMES_2.get=function(){return 2*Math.PI},Tn.PI_OVER_2.get=function(){return Math.PI/2},Tn.PI_OVER_4.get=function(){return Math.PI/4},Tn.COUNTERCLOCKWISE.get=function(){return at.COUNTERCLOCKWISE},Tn.CLOCKWISE.get=function(){return at.CLOCKWISE},Tn.NONE.get=function(){return at.COLLINEAR},Object.defineProperties(Mn,Tn),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)}),On={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}},An=(Rn.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)},Rn.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 l=new w(r.p1.x+u.x,r.p1.y+u.y),c=new w(i.p1.x+u.x,i.p1.y+u.y);this._segList.addPt(l),this._segList.addPt(c)}},Rn.prototype.getCoordinates=function(){return this._segList.getCoordinates()},Rn.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 j))throw t;o=new w(0,0),i=!1}i?this._segList.addPt(o):this.addLimitedMitreJoin(e,n,r,this._bufParams.getMitreLimit())},Rn.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,l=n.y-t.y,c=Math.atan2(l,u);r===at.CLOCKWISE?a<=c&&(a+=2*Math.PI):a>=c&&(a-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,a,c,r,i),this._segList.addPt(n)},Rn.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*Rn.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))},Rn.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()},Rn.prototype.addSegments=function(t,e){this._segList.addPts(t,e)},Rn.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},Rn.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},Rn.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)},Rn.prototype.addLimitedMitreJoin=function(t,e,n,r){var i=this._seg0.p1,o=Mn.angle(i,this._seg0.p0),s=Mn.angleBetweenOriented(this._seg0.p0,i,this._seg1.p1)/2,a=Mn.normalize(o+s),u=Mn.normalize(a+Math.PI),l=r*n,c=n-l*Math.abs(Math.sin(s)),h=i.x+l*Math.cos(u),p=i.y+l*Math.sin(u),f=new w(h,p),g=new dn(i,f),d=g.pointAlongOffset(1,c),y=g.pointAlongOffset(1,-c);this._side===Ne.LEFT?(this._segList.addPt(d),this._segList.addPt(y)):(this._segList.addPt(y),this._segList.addPt(d))},Rn.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,l=i*n*s/a;r.p0.x=t.p0.x-l,r.p0.y=t.p0.y+u,r.p1.x=t.p1.x-l,r.p1.y=t.p1.y+u},Rn.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,l=0,c=new w;l<s;){var h=e+o*l;c.x=t.x+i*Math.cos(h),c.y=t.y+i*Math.sin(h),this._segList.addPt(c),l+=u}},Rn.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*Rn.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)}},Rn.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()},Rn.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},Rn.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Cn,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*Rn.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},Rn.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))},Rn.prototype.closeRing=function(){this._segList.closeRing()},Rn.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},Rn.prototype.interfaces_=function(){return[]},Rn.prototype.getClass=function(){return Rn},On.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return.001},On.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return.001},On.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},On.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(Rn,On),function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e}),Dn=(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&&Lt.reverse(o),o},An.prototype.computeSingleSidedBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){n.addSegments(t,!0);var i=Ln.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=Ln.simplify(t,r),u=a.length-1;n.initSideSegments(a[0],a[1],Ne.LEFT),n.addFirstSegment();for(var l=2;l<=u;l++)n.addNextSegment(a[l],!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=Ln.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=Ln.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=Ln.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=Ln.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=Ln.simplify(t,r),u=a.length-1;n.initSideSegments(a[0],a[1],Ne.LEFT),n.addFirstSegment();for(var l=2;l<=u;l++)n.addNextSegment(a[l],!0)}n.addLastSegment()},An.prototype.getSegGen=function(t){return new Rn(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},function(){this._subgraphs=null,this._seg=new dn,this._cga=new at;var t=arguments[0];this._subgraphs=t}),Fn={DepthSegment:{configurable:!0}},kn=(Dn.prototype.findStabbedSegments=function(){if(1===arguments.length){for(var t=arguments[0],e=new It,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(M(arguments[2],bt)&&arguments[0]instanceof w&&arguments[1]instanceof ze){for(var o=arguments[0],s=arguments[1],a=arguments[2],u=s.getEdge().getCoordinates(),l=0;l<u.length-1;l++)if(this._seg.p0=u[l],this._seg.p1=u[l+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 c=s.getDepth(Ne.LEFT);this._seg.p0.equals(u[l])||(c=s.getDepth(Ne.RIGHT));var h=new kn(this._seg,c);a.add(h)}}else if(M(arguments[2],bt)&&arguments[0]instanceof w&&M(arguments[1],bt))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:Qe.min(e)._leftDepth},Dn.prototype.interfaces_=function(){return[]},Dn.prototype.getClass=function(){return Dn},Fn.DepthSegment.get=function(){return kn},Object.defineProperties(Dn,Fn),function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new dn(t),this._leftDepth=e}),Gn=(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},function(t,e,n){this.p0=t||null,this.p1=e||null,this.p2=n||null}),Bn=(Gn.prototype.area=function(){return Gn.area(this.p0,this.p1,this.p2)},Gn.prototype.signedArea=function(){return Gn.signedArea(this.p0,this.p1,this.p2)},Gn.prototype.interpolateZ=function(t){if(null===t)throw new _("Supplied point is null.");return Gn.interpolateZ(t,this.p0,this.p1,this.p2)},Gn.prototype.longestSideLength=function(){return Gn.longestSideLength(this.p0,this.p1,this.p2)},Gn.prototype.isAcute=function(){return Gn.isAcute(this.p0,this.p1,this.p2)},Gn.prototype.circumcentre=function(){return Gn.circumcentre(this.p0,this.p1,this.p2)},Gn.prototype.area3D=function(){return Gn.area3D(this.p0,this.p1,this.p2)},Gn.prototype.centroid=function(){return Gn.centroid(this.p0,this.p1,this.p2)},Gn.prototype.inCentre=function(){return Gn.inCentre(this.p0,this.p1,this.p2)},Gn.prototype.interfaces_=function(){return[]},Gn.prototype.getClass=function(){return Gn},Gn.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)},Gn.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2},Gn.det=function(t,e,n,r){return t*r-e*n},Gn.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,l=r.y-o,c=s*l-a*u,h=t.x-i,p=t.y-o,f=(l*h-a*p)/c,g=(-u*h+s*p)/c;return e.z+f*(n.z-e.z)+g*(r.z-e.z)},Gn.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},Gn.isAcute=function(t,e,n){return!!Mn.isAcute(t,e,n)&&!!Mn.isAcute(e,n,t)&&!!Mn.isAcute(n,t,e)},Gn.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,l=2*Gn.det(o,s,a,u),c=Gn.det(s,o*o+s*s,u,a*a+u*u),h=Gn.det(o,o*o+s*s,a,a*a+u*u);return new w(r-c/l,i+h/l)},Gn.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)},Gn.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)},Gn.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,l=i*u-o*a,c=o*s-r*u,h=r*a-i*s,p=l*l+c*c+h*h;return Math.sqrt(p)/2},Gn.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)},Gn.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)},function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new It;var t=arguments[0],e=arguments[1],n=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=n}),Un=(Bn.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,C.EXTERIOR,C.INTERIOR)},Bn.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=Lt.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,C.EXTERIOR,C.INTERIOR);for(var o=0;o<t.getNumInteriorRing();o++){var s=t.getInteriorRingN(o),a=Lt.removeRepeatedPoints(s.getCoordinates());this._distance>0&&this.isErodedCompletely(s,-this._distance)||this.addPolygonRing(a,e,Ne.opposite(n),C.INTERIOR,C.EXTERIOR)}},Bn.prototype.isTriangleErodedCompletely=function(t,e){var n=new Gn(t[0],t[1],t[2]),r=n.inCentre();return at.distancePointLine(r,n.p0,n.p1)<Math.abs(e)},Bn.prototype.addLineString=function(t){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var e=Lt.removeRepeatedPoints(t.getCoordinates()),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,C.EXTERIOR,C.INTERIOR)},Bn.prototype.addCurve=function(t,e,n){if(null===t||t.length<2)return null;var r=new gn(t,new Re(0,C.BOUNDARY,e,n));this._curveList.add(r)},Bn.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},Bn.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)},Bn.prototype.add=function(t){if(t.isEmpty())return null;t instanceof Qt?this.addPolygon(t):t instanceof Jt?this.addLineString(t):t instanceof Zt?this.addPoint(t):(t instanceof te||t instanceof jt||t instanceof ne||t instanceof zt)&&this.addCollection(t)},Bn.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},Bn.prototype.addCollection=function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);this.add(n)}},Bn.prototype.interfaces_=function(){return[]},Bn.prototype.getClass=function(){return Bn},function(){}),qn=(Un.prototype.locate=function(t){},Un.prototype.interfaces_=function(){return[]},Un.prototype.getClass=function(){return Un},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()}),zn=(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 zt?(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 zt)},function(){this._geom=null;var t=arguments[0];this._geom=t}),jn=(zn.prototype.locate=function(t){return zn.locate(t,this._geom)},zn.prototype.interfaces_=function(){return[Un]},zn.prototype.getClass=function(){return zn},zn.isPointInRing=function(t,e){return!!e.getEnvelopeInternal().intersects(t)&&at.isPointInRing(t,e.getCoordinates())},zn.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!zn.isPointInRing(t,n))return!1;for(var r=0;r<e.getNumInteriorRing();r++){var i=e.getInteriorRingN(r);if(zn.isPointInRing(t,i))return!1}return!0},zn.containsPoint=function(t,e){if(e instanceof Qt)return zn.containsPointInPolygon(t,e);if(e instanceof zt)for(var n=new qn(e);n.hasNext();){var r=n.next();if(r!==e&&zn.containsPoint(t,r))return!0}return!1},zn.locate=function(t,e){return e.isEmpty()?C.EXTERIOR:zn.containsPoint(t,e)?C.INTERIOR:C.EXTERIOR},function(){this._edgeMap=new h,this._edgeList=null,this._ptInAreaLocation=[C.NONE,C.NONE]}),Vn=(jn.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)},jn.prototype.propagateSideLabels=function(t){for(var e=C.NONE,n=this.iterator();n.hasNext();){var r=n.next().getLabel();r.isArea(t)&&r.getLocation(t,Ne.LEFT)!==C.NONE&&(e=r.getLocation(t,Ne.LEFT))}if(e===C.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)===C.NONE&&a.setLocation(t,Ne.ON,i),a.isArea(t)){var u=a.getLocation(t,Ne.LEFT),l=a.getLocation(t,Ne.RIGHT);if(l!==C.NONE){if(l!==i)throw new Ce("side location conflict",s.getCoordinate());u===C.NONE&&et.shouldNeverReachHere("found single null side (at "+s.getCoordinate()+")"),i=u}else et.isTrue(a.getLocation(t,Ne.LEFT)===C.NONE,"found single null side"),a.setLocation(t,Ne.RIGHT,i),a.setLocation(t,Ne.LEFT,i)}}},jn.prototype.getCoordinate=function(){var t=this.iterator();return t.hasNext()?t.next().getCoordinate():null},jn.prototype.print=function(t){V.out.println("EdgeEndStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();)e.next().print(t)},jn.prototype.isAreaLabelsConsistent=function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},jn.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!==C.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},jn.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},jn.prototype.iterator=function(){return this.getEdges().iterator()},jn.prototype.getEdges=function(){return null===this._edgeList&&(this._edgeList=new It(this._edgeMap.values())),this._edgeList},jn.prototype.getLocation=function(t,e,n){return this._ptInAreaLocation[t]===C.NONE&&(this._ptInAreaLocation[t]=zn.locate(e,n[t].getGeometry())),this._ptInAreaLocation[t]},jn.prototype.toString=function(){var t=new O;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()},jn.prototype.computeEdgeEndLabels=function(t){for(var e=this.iterator();e.hasNext();)e.next().computeLabel(t)},jn.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)===C.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 l=C.NONE;if(e[u])l=C.EXTERIOR;else{var c=s.getCoordinate();l=this.getLocation(u,c,t)}a.setAllLocationsIfNull(u,l)}},jn.prototype.getDegree=function(){return this._edgeMap.size()},jn.prototype.insertEdgeEnd=function(t,e){this._edgeMap.put(t,e),this._edgeList=null},jn.prototype.interfaces_=function(){return[]},jn.prototype.getClass=function(){return jn},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 Ce("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 Be.isNorthern(i)&&Be.isNorthern(o)?n:Be.isNorthern(i)||Be.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){V.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 It;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 Ce("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=C.NONE,e=this.iterator();e.hasNext();){var n=e.next(),r=n.getSym();if(!n.isLineEdge()){if(n.isInResult()){t=C.INTERIOR;break}if(r.isInResult()){t=C.EXTERIOR;break}}}if(t===C.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===C.INTERIOR):(s.isInResult()&&(i=C.EXTERIOR),a.isInResult()&&(i=C.INTERIOR))}},e.prototype.computeLabelling=function(e){t.prototype.computeLabelling.call(this,e),this._label=new Re(C.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!==C.INTERIOR&&o!==C.BOUNDARY||this._label.setLocation(i,C.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(jn)),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 Vn)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(je),Yn=function t(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=t.orientation(e)},Hn=(Yn.prototype.compareTo=function(t){var e=t;return Yn.compareOriented(this._pts,this._orientation,e._pts,e._orientation)},Yn.prototype.interfaces_=function(){return[E]},Yn.prototype.getClass=function(){return Yn},Yn.orientation=function(t){return 1===Lt.increasingDirection(t)},Yn.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,l=r?0:n.length-1;;){var c=t[u].compareTo(n[l]);if(0!==c)return c;var h=(u+=i)===s,p=(l+=o)===a;if(h&&!p)return-1;if(!h&&p)return 1;if(h&&p)return 0}},function(){this._edges=new It,this._ocaMap=new h}),Wn=(Hn.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(") ")},Hn.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())},Hn.prototype.findEdgeIndex=function(t){for(var e=0;e<this._edges.size();e++)if(this._edges.get(e).equals(t))return e;return-1},Hn.prototype.iterator=function(){return this._edges.iterator()},Hn.prototype.getEdges=function(){return this._edges},Hn.prototype.get=function(t){return this._edges.get(t)},Hn.prototype.findEqualEdge=function(t){var e=new Yn(t.getCoordinates());return this._ocaMap.get(e)},Hn.prototype.add=function(t){this._edges.add(t);var e=new Yn(t.getCoordinates());this._ocaMap.put(e,t)},Hn.prototype.interfaces_=function(){return[]},Hn.prototype.getClass=function(){return Hn},function(){}),Jn=(Wn.prototype.processIntersections=function(t,e,n,r){},Wn.prototype.isDone=function(){},Wn.prototype.interfaces_=function(){return[]},Wn.prototype.getClass=function(){return Wn},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}),Kn=(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[Wn]},Jn.prototype.getClass=function(){return Jn},Jn.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)},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}),Zn=(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},function(){this._nodeMap=new h,this.edge=null;var t=arguments[0];this.edge=t}),$n=(Zn.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},Zn.prototype.iterator=function(){return this._nodeMap.values().iterator()},Zn.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}},Zn.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)},Zn.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 Re(this.edge._label))},Zn.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)},Zn.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();)if(e.next().coord.equals(t))return!0;return!1},Zn.prototype.interfaces_=function(){return[]},Zn.prototype.getClass=function(){return Zn},function(){}),Qn=($n.prototype.getChainStartIndices=function(t){var e=0,n=new It;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=Be.quadrant(t[e],t[e+1]),r=e+1;r<t.length&&Be.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},function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new Y,this.env2=new Y;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new $n;this.startIndex=e.getChainStartIndices(this.pts)}),tr=(Qn.prototype.getCoordinates=function(){return this.pts},Qn.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},Qn.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},Qn.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],l=arguments[5],c=this.pts[i],h=this.pts[o],p=s.pts[a],f=s.pts[u];if(o-i==1&&u-a==1)return l.addIntersections(this.e,i,s.e,a),null;if(this.env1.init(c,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,l),d<u&&this.computeIntersectsForChain(i,g,s,d,u,l)),g<o&&(a<d&&this.computeIntersectsForChain(g,o,s,a,d,l),d<u&&this.computeIntersectsForChain(g,o,s,d,u,l))}},Qn.prototype.getStartIndexes=function(){return this.startIndex},Qn.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)},Qn.prototype.interfaces_=function(){return[]},Qn.prototype.getClass=function(){return Qn},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}},nr=(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?C.EXTERIOR:C.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!==C.EXTERIOR&&r!==C.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]===C.INTERIOR&&this._depth[i][o]++}},tr.prototype.interfaces_=function(){return[]},tr.prototype.getClass=function(){return tr},tr.depthAtLocation=function(t){return t===C.EXTERIOR?0:t===C.INTERIOR?1:tr.NULL_VALUE},er.NULL_VALUE.get=function(){return-1},Object.defineProperties(tr,er),function(t){function e(){if(t.call(this),this.pts=null,this._env=null,this.eiList=new Zn(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,Re.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 Qn(this)),this._mce},e.prototype.getEnvelope=function(){if(null===this._env){this._env=new Y;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 O;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 Hn,this._bufParams=t||null},ir=(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 Re(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 It,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 It,n=t.getNodes().iterator();n.hasNext();){var r=n.next();if(!r.isVisited()){var i=new Me;i.create(r),e.add(i)}}return Qe.sort(e,Qe.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 bn,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 Bn(t,e,r).getCurves();if(i.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(i,n),this._graph=new Ve(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 Re(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===C.INTERIOR&&n===C.EXTERIOR?1:e===C.EXTERIOR&&n===C.INTERIOR?-1:0},rr.convertSegStrings=function(t){for(var e=new me,n=new It;t.hasNext();){var r=t.next(),i=e.createLineString(r.getCoordinates());n.add(i)}return e.buildGeometry(n)},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()}}),or=(ir.prototype.rescale=function(){if(M(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])&&V.out.println(n)}},ir.prototype.scale=function(){if(M(arguments[0],xt)){for(var t=arguments[0],e=new It,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 Lt.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},function(){this._li=new it,this._segStrings=null;var t=arguments[0];this._segStrings=t}),sr={fact:{configurable:!0}},ar=(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 Q("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 l=0;l<a.length-1;l++)this.checkInteriorIntersections(i,u,o,l);else if(4===arguments.length){var c=arguments[0],h=arguments[1],p=arguments[2],f=arguments[3];if(c===p&&h===f)return null;var g=c.getCoordinates()[h],d=c.getCoordinates()[h+1],y=p.getCoordinates()[f],m=p.getCoordinates()[f+1];if(this._li.computeIntersection(g,d,y,m),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,g,d)||this.hasInteriorIntersection(this._li,y,m)))throw new Q("found non-noded intersection at "+g+"-"+d+" and "+y+"-"+m)}},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 Q("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 me},Object.defineProperties(or,sr),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 _("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}},lr=(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 Y(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),function(){this.tempEnv1=new Y,this.selectedSegment=new dn}),cr=(lr.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)}},lr.prototype.interfaces_=function(){return[]},lr.prototype.getClass=function(){return lr},function(){this._index=null;var t=arguments[0];this._index=t}),hr={HotPixelSnapAction:{configurable:!0}},pr=(cr.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()}},cr.prototype.interfaces_=function(){return[]},cr.prototype.getClass=function(){return cr},hr.HotPixelSnapAction.get=function(){return pr},Object.defineProperties(cr,hr),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}(lr)),fr=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new It},gr=(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[Wn]},fr.prototype.getClass=function(){return fr},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()}),dr=(gr.prototype.checkCorrectness=function(t){var e=gn.getNodedSubstrings(t),n=new or(e);try{n.checkValid()}catch(t){if(!(t instanceof z))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(M(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 bn,this._pointSnapper=new cr(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},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}},mr=(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 Ce))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 Q))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 ct&&"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 ct&&"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=T.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),function(){this._pt=[new w,new w],this._distance=v.NaN,this._isNull=!0}),_r=(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.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},function(){}),vr=(_r.prototype.interfaces_=function(){return[]},_r.prototype.getClass=function(){return _r},_r.computeDistance=function(){if(arguments[2]instanceof mr&&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 mr&&arguments[0]instanceof Qt&&arguments[1]instanceof w){var s=arguments[0],a=arguments[1],u=arguments[2];_r.computeDistance(s.getExteriorRing(),a,u);for(var l=0;l<s.getNumInteriorRing();l++)_r.computeDistance(s.getInteriorRingN(l),a,u)}else if(arguments[2]instanceof mr&&arguments[0]instanceof ct&&arguments[1]instanceof w){var c=arguments[0],h=arguments[1],p=arguments[2];if(c instanceof Jt)_r.computeDistance(c,h,p);else if(c instanceof Qt)_r.computeDistance(c,h,p);else if(c instanceof zt)for(var f=c,g=0;g<f.getNumGeometries();g++){var d=f.getGeometryN(g);_r.computeDistance(d,h,p)}else p.setMinimum(c.getCoordinate(),h)}else if(arguments[2]instanceof mr&&arguments[0]instanceof dn&&arguments[1]instanceof w){var y=arguments[1],m=arguments[2],_=arguments[0].closestPoint(y);m.setMinimum(_,y)}},function(t){this._maxPtDist=new mr,this._inputGeom=t||null}),xr={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}},Er=(vr.prototype.computeMaxMidpointDistance=function(t){var e=new br(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},vr.prototype.computeMaxVertexDistance=function(t){var e=new Er(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},vr.prototype.findDistance=function(t){return this.computeMaxVertexDistance(t),this.computeMaxMidpointDistance(t),this._maxPtDist.getDistance()},vr.prototype.getDistancePoints=function(){return this._maxPtDist},vr.prototype.interfaces_=function(){return[]},vr.prototype.getClass=function(){return vr},xr.MaxPointDistanceFilter.get=function(){return Er},xr.MaxMidpointDistanceFilter.get=function(){return br},Object.defineProperties(vr,xr),function(t){this._maxPtDist=new mr,this._minPtDist=new mr,this._geom=t||null}),br=(Er.prototype.filter=function(t){this._minPtDist.initialize(),_r.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},function(t){this._maxPtDist=new mr,this._minPtDist=new mr,this._geom=t||null}),Ir=(br.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(),_r.computeDistance(this._geom,i,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},br.prototype.isDone=function(){return!1},br.prototype.isGeometryChanged=function(){return!1},br.prototype.getMaxPointDistance=function(){return this._maxPtDist},br.prototype.interfaces_=function(){return[qt]},br.prototype.getClass=function(){return br},function(t){this._comps=t||null}),wr=(Ir.prototype.filter=function(t){t instanceof Qt&&this._comps.add(t)},Ir.prototype.interfaces_=function(){return[Ut]},Ir.prototype.getClass=function(){return Ir},Ir.getPolygons=function(){if(1===arguments.length){var t=arguments[0];return Ir.getPolygons(t,new It)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof Qt?n.add(e):e instanceof zt&&e.apply(new Ir(n)),n}},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}}),Nr=(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[lt]},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(M(arguments[0],xt)&&M(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 ct&&"boolean"==typeof arguments[1]){var i=arguments[0],o=arguments[1],s=new It;return i.apply(new wr(s,o)),s}if(arguments[0]instanceof ct&&M(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]&&M(arguments[0],xt)&&M(arguments[1],xt)){for(var l=arguments[1],c=arguments[2],h=arguments[0].iterator();h.hasNext();){var p=h.next();wr.getLines(p,l,c)}return l}if("boolean"==typeof arguments[2]&&arguments[0]instanceof ct&&M(arguments[1],xt)){var f=arguments[1],g=arguments[2];return arguments[0].apply(new wr(f,g)),f}}},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 _("Rule must be non-null");this._boundaryRule=t}}),Lr=(Nr.prototype.locateInternal=function(){if(arguments[0]instanceof w&&arguments[1]instanceof Qt){var t=arguments[0],e=arguments[1];if(e.isEmpty())return C.EXTERIOR;var n=e.getExteriorRing(),r=this.locateInPolygonRing(t,n);if(r===C.EXTERIOR)return C.EXTERIOR;if(r===C.BOUNDARY)return C.BOUNDARY;for(var i=0;i<e.getNumInteriorRing();i++){var o=e.getInteriorRingN(i),s=this.locateInPolygonRing(t,o);if(s===C.INTERIOR)return C.EXTERIOR;if(s===C.BOUNDARY)return C.BOUNDARY}return C.INTERIOR}if(arguments[0]instanceof w&&arguments[1]instanceof Jt){var a=arguments[0],u=arguments[1];if(!u.getEnvelopeInternal().intersects(a))return C.EXTERIOR;var l=u.getCoordinates();return u.isClosed()||!a.equals(l[0])&&!a.equals(l[l.length-1])?at.isOnLine(a,l)?C.INTERIOR:C.EXTERIOR:C.BOUNDARY}if(arguments[0]instanceof w&&arguments[1]instanceof Zt){var c=arguments[0];return arguments[1].getCoordinate().equals2D(c)?C.INTERIOR:C.EXTERIOR}},Nr.prototype.locateInPolygonRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?at.locatePointInRing(t,e.getCoordinates()):C.EXTERIOR},Nr.prototype.intersects=function(t,e){return this.locate(t,e)!==C.EXTERIOR},Nr.prototype.updateLocationInfo=function(t){t===C.INTERIOR&&(this._isIn=!0),t===C.BOUNDARY&&this._numBoundaries++},Nr.prototype.computeLocation=function(t,e){if(e instanceof Zt&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof Jt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Qt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof jt)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 zt)for(var u=new qn(e);u.hasNext();){var l=u.next();l!==e&&this.computeLocation(t,l)}},Nr.prototype.locate=function(t,e){return e.isEmpty()?C.EXTERIOR:e instanceof Jt||e instanceof Qt?this.locateInternal(t,e):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(t,e),this._boundaryRule.isInBoundary(this._numBoundaries)?C.BOUNDARY:this._numBoundaries>0||this._isIn?C.INTERIOR:C.EXTERIOR)},Nr.prototype.interfaces_=function(){return[]},Nr.prototype.getClass=function(){return Nr},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}}),Sr={INSIDE_AREA:{configurable:!0}},Cr=(Lr.prototype.isInsideArea=function(){return this._segIndex===Lr.INSIDE_AREA},Lr.prototype.getCoordinate=function(){return this._pt},Lr.prototype.getGeometryComponent=function(){return this._component},Lr.prototype.getSegmentIndex=function(){return this._segIndex},Lr.prototype.interfaces_=function(){return[]},Lr.prototype.getClass=function(){return Lr},Sr.INSIDE_AREA.get=function(){return-1},Object.defineProperties(Lr,Sr),function(t){this._pts=t||null}),Pr=(Cr.prototype.filter=function(t){t instanceof Zt&&this._pts.add(t)},Cr.prototype.interfaces_=function(){return[Ut]},Cr.prototype.getClass=function(){return Cr},Cr.getPoints=function(){if(1===arguments.length){var t=arguments[0];return t instanceof Zt?Qe.singletonList(t):Cr.getPoints(t,new It)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof Zt?n.add(e):e instanceof zt&&e.apply(new Cr(n)),n}},function(){this._locations=null;var t=arguments[0];this._locations=t}),Mr=(Pr.prototype.filter=function(t){(t instanceof Zt||t instanceof Jt||t instanceof Qt)&&this._locations.add(new Lr(t,0,t.getCoordinate()))},Pr.prototype.interfaces_=function(){return[Ut]},Pr.prototype.getClass=function(){return Pr},Pr.getLocations=function(t){var e=new It;return t.apply(new Pr(e)),e},function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new Nr,this._minDistanceLocation=null,this._minDistance=v.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=(Mr.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=Ir.getPolygons(this._geom[e]);if(i.size()>0){var o=Pr.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&&M(arguments[0],bt)&&M(arguments[1],bt)){for(var s=arguments[0],a=arguments[1],u=arguments[2],l=0;l<s.size();l++)for(var c=s.get(l),h=0;h<a.size();h++)if(this.computeContainmentDistance(c,a.get(h),u),this._minDistance<=this._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof Lr&&arguments[1]instanceof Qt){var p=arguments[0],f=arguments[1],g=arguments[2],d=p.getCoordinate();if(C.EXTERIOR!==this._ptLocator.locate(d,f))return this._minDistance=0,g[0]=p,g[1]=new Lr(f,d),null}},Mr.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}},Mr.prototype.computeFacetDistance=function(){var t=new Array(2).fill(null),e=wr.getLines(this._geom[0]),n=wr.getLines(this._geom[1]),r=Cr.getPoints(this._geom[0]),i=Cr.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))))},Mr.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},Mr.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])},Mr.prototype.nearestPoints=function(){return this.computeMinDistance(),[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()]},Mr.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 Zt){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 Lr(t,o,a),n[1]=new Lr(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],l=arguments[1],c=arguments[2];if(u.getEnvelopeInternal().distance(l.getEnvelopeInternal())>this._minDistance)return null;for(var h=u.getCoordinates(),p=l.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]),m=new dn(p[g],p[g+1]),_=y.closestPoints(m);c[0]=new Lr(u,f,_[0]),c[1]=new Lr(l,g,_[1])}if(this._minDistance<=this._terminateDistance)return null}}},Mr.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 Lr(i,0,i.getCoordinate()),n[1]=new Lr(s,0,s.getCoordinate())),this._minDistance<=this._terminateDistance)return null}},Mr.prototype.distance=function(){if(null===this._geom[0]||null===this._geom[1])throw new _("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},Mr.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}},Mr.prototype.interfaces_=function(){return[]},Mr.prototype.getClass=function(){return Mr},Mr.distance=function(t,e){return new Mr(t,e).distance()},Mr.isWithinDistance=function(t,e,n){return new Mr(t,e,n).distance()<=n},Mr.nearestPoints=function(t,e){return new Mr(t,e).nearestPoints()},function(){this._pt=[new w,new w],this._distance=v.NaN,this._isNull=!0}),Rr=(Tr.prototype.getCoordinates=function(){return this._pt},Tr.prototype.getCoordinate=function(t){return this._pt[t]},Tr.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)}},Tr.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}},Tr.prototype.toString=function(){return $.toLineString(this._pt[0],this._pt[1])},Tr.prototype.getDistance=function(){return this._distance},Tr.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)}},Tr.prototype.interfaces_=function(){return[]},Tr.prototype.getClass=function(){return Tr},function(){}),Or=(Rr.prototype.interfaces_=function(){return[]},Rr.prototype.getClass=function(){return Rr},Rr.computeDistance=function(){if(arguments[2]instanceof Tr&&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 Tr&&arguments[0]instanceof Qt&&arguments[1]instanceof w){var a=arguments[0],u=arguments[1],l=arguments[2];Rr.computeDistance(a.getExteriorRing(),u,l);for(var c=0;c<a.getNumInteriorRing();c++)Rr.computeDistance(a.getInteriorRingN(c),u,l)}else if(arguments[2]instanceof Tr&&arguments[0]instanceof ct&&arguments[1]instanceof w){var h=arguments[0],p=arguments[1],f=arguments[2];if(h instanceof Jt)Rr.computeDistance(h,p,f);else if(h instanceof Qt)Rr.computeDistance(h,p,f);else if(h instanceof zt)for(var g=h,d=0;d<g.getNumGeometries();d++){var y=g.getGeometryN(d);Rr.computeDistance(y,p,f)}else f.setMinimum(h.getCoordinate(),p)}else if(arguments[2]instanceof Tr&&arguments[0]instanceof dn&&arguments[1]instanceof w){var m=arguments[1],_=arguments[2],v=arguments[0].closestPoint(m);_.setMinimum(v,m)}},function(){this._g0=null,this._g1=null,this._ptDist=new Tr,this._densifyFrac=0;var t=arguments[0],e=arguments[1];this._g0=t,this._g1=e}),Ar={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}},Dr=(Or.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},Or.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new _("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},Or.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},Or.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Or.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())}},Or.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Or.prototype.interfaces_=function(){return[]},Or.prototype.getClass=function(){return Or},Or.distance=function(){if(2===arguments.length)return new Or(arguments[0],arguments[1]).distance();if(3===arguments.length){var t=arguments[2],e=new Or(arguments[0],arguments[1]);return e.setDensifyFraction(t),e.distance()}},Ar.MaxPointDistanceFilter.get=function(){return Dr},Ar.MaxDensifiedByFractionDistanceFilter.get=function(){return Fr},Object.defineProperties(Or,Ar),function(){this._maxPtDist=new Tr,this._minPtDist=new Tr,this._euclideanDist=new Rr,this._geom=null;var t=arguments[0];this._geom=t}),Fr=(Dr.prototype.filter=function(t){this._minPtDist.initialize(),Rr.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},function(){this._maxPtDist=new Tr,this._minPtDist=new Tr,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))}),kr=(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,l=new w(a,u);this._minPtDist.initialize(),Rr.computeDistance(this._geom,l,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},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}),Gr={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}},Br=(kr.prototype.checkMaximumDistance=function(t,e,n){var r=new Or(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&&V.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 Qt||this._input instanceof ne||this._input instanceof zt))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 Mr(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 It,n=new wr(e),r=Ir.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},Gr.VERBOSE.get=function(){return!1},Gr.MAX_DISTANCE_DIFF_FRAC.get=function(){return.012},Object.defineProperties(kr,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}},qr=(Br.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},Br.prototype.checkEnvelope=function(){if(this._distance<0)return null;var t=this._distance*Br.MAX_ENV_DIFF_FRAC;0===t&&(t=.001);var e=new Y(this._input.getEnvelopeInternal());e.expandBy(this._distance);var n=new Y(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")},Br.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")},Br.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")},Br.prototype.checkPolygonal=function(){this._result instanceof Qt||this._result instanceof ne||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},Br.prototype.getErrorIndicator=function(){return this._errorIndicator},Br.prototype.getErrorLocation=function(){return this._errorLocation},Br.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"))},Br.prototype.report=function(t){if(!Br.VERBOSE)return null;V.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},Br.prototype.getErrorMessage=function(){return this._errorMsg},Br.prototype.interfaces_=function(){return[]},Br.prototype.getClass=function(){return Br},Br.isValidMsg=function(t,e,n){var r=new Br(t,e,n);return r.isValid()?null:r.getErrorMessage()},Br.isValid=function(t,e,n){return!!new Br(t,e,n).isValid()},Ur.VERBOSE.get=function(){return!1},Ur.MAX_ENV_DIFF_FRAC.get=function(){return.012},Object.defineProperties(Br,Ur),function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e}),zr=(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},function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new It,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null}),jr=(zr.prototype.getInteriorIntersection=function(){return this._interiorIntersection},zr.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},zr.prototype.getIntersectionSegments=function(){return this._intSegments},zr.prototype.count=function(){return this._intersectionCount},zr.prototype.getIntersections=function(){return this._intersections},zr.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},zr.prototype.setKeepIntersections=function(t){this._keepIntersections=t},zr.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++)},zr.prototype.isEndSegment=function(t,e){return 0===e||e>=t.size()-2},zr.prototype.hasIntersection=function(){return null!==this._interiorIntersection},zr.prototype.isDone=function(){return!this._findAllIntersections&&null!==this._interiorIntersection},zr.prototype.interfaces_=function(){return[Wn]},zr.prototype.getClass=function(){return zr},zr.createAllIntersectionsFinder=function(t){var e=new zr(t);return e.setFindAllIntersections(!0),e},zr.createAnyIntersectionFinder=function(t){return new zr(t)},zr.createIntersectionCounter=function(t){var e=new zr(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e},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=(jr.prototype.execute=function(){if(null!==this._segInt)return null;this.checkInteriorIntersections()},jr.prototype.getIntersections=function(){return this._segInt.getIntersections()},jr.prototype.isValid=function(){return this.execute(),this._isValid},jr.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},jr.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new zr(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new bn;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},jr.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Ce(this.getErrorMessage(),this._segInt.getInteriorIntersection())},jr.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])},jr.prototype.interfaces_=function(){return[]},jr.prototype.getClass=function(){return jr},jr.computeIntersections=function(t){var e=new jr(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()},function t(){this._nv=null;var e=arguments[0];this._nv=new jr(t.toSegmentStrings(e))}),Xr=(Vr.prototype.checkValid=function(){this._nv.checkValid()},Vr.prototype.interfaces_=function(){return[]},Vr.prototype.getClass=function(){return Vr},Vr.toSegmentStrings=function(t){for(var e=new It,n=t.iterator();n.hasNext();){var r=n.next();e.add(new qr(r.getCoordinates(),r))}return e},Vr.checkValid=function(t){new Vr(t).checkValid()},function(t){this._mapOp=t}),Yr=(Xr.prototype.map=function(t){for(var e=new It,n=0;n<t.getNumGeometries();n++){var r=this._mapOp.map(t.getGeometryN(n));r.isEmpty()||e.add(r)}return t.getFactory().createGeometryCollection(me.toGeometryArray(e))},Xr.prototype.interfaces_=function(){return[]},Xr.prototype.getClass=function(){return Xr},Xr.map=function(t,e){return new Xr(e).map(t)},function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new It,this._resultLineList=new It;var t=arguments[0],e=arguments[1],n=arguments[2];this._op=t,this._geometryFactory=e,this._ptLocator=n}),Hr=(Yr.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)}},Yr.prototype.labelIsolatedLine=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(e));t.getLabel().setLocation(e,n)},Yr.prototype.build=function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList},Yr.prototype.collectLineEdge=function(t,e,n){var r=t.getLabel(),i=t.getEdge();t.isLineEdge()&&(t.isVisited()||!Li.isResultOfOp(r,e)||i.isCovered()||(n.add(i),t.setVisitedEdge(!0)))},Yr.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)}}},Yr.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))}},Yr.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)}},Yr.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(Li.isResultOfOp(r,e)&&e===Li.INTERSECTION&&(n.add(t.getEdge()),t.setVisitedEdge(!0))))},Yr.prototype.interfaces_=function(){return[]},Yr.prototype.getClass=function(){return Yr},function(){this._op=null,this._geometryFactory=null,this._resultPointList=new It;var t=arguments[0],e=arguments[1];this._op=t,this._geometryFactory=e}),Wr=(Hr.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var n=this._geometryFactory.createPoint(e);this._resultPointList.add(n)}},Hr.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!==Li.INTERSECTION)){var r=n.getLabel();Li.isResultOfOp(r,t)&&this.filterCoveredNodeToPoint(n)}}},Hr.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList},Hr.prototype.interfaces_=function(){return[]},Hr.prototype.getClass=function(){return Hr},function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1}),Jr=(Wr.prototype.transformPoint=function(t,e){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},Wr.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 It,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 It;return null!==r&&a.add(r),a.addAll(i),this._factory.buildGeometry(a)},Wr.prototype.createCoordinateSequence=function(t){return this._factory.getCoordinateSequenceFactory().create(t)},Wr.prototype.getInputGeometry=function(){return this._inputGeom},Wr.prototype.transformMultiLineString=function(t,e){for(var n=new It,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)},Wr.prototype.transformCoordinates=function(t,e){return this.copy(t)},Wr.prototype.transformLineString=function(t,e){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))},Wr.prototype.transformMultiPoint=function(t,e){for(var n=new It,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)},Wr.prototype.transformMultiPolygon=function(t,e){for(var n=new It,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)},Wr.prototype.copy=function(t){return t.copy()},Wr.prototype.transformGeometryCollection=function(t,e){for(var n=new It,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(me.toGeometryArray(n)):this._factory.buildGeometry(n)},Wr.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof Zt)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 jt)return this.transformMultiLineString(t,null);if(t instanceof Qt)return this.transformPolygon(t,null);if(t instanceof ne)return this.transformMultiPolygon(t,null);if(t instanceof zt)return this.transformGeometryCollection(t,null);throw new _("Unknown Geometry subtype: "+t.getClass().getName())},Wr.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)},Wr.prototype.interfaces_=function(){return[]},Wr.prototype.getClass=function(){return Wr},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}}),Kr=(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=v.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])},function(t){this._srcGeom=t||null}),Zr={SNAP_PRECISION_FACTOR:{configurable:!0}},$r=(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&&M(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=v.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)},Zr.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(Kr,Zr),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}(Wr)),Qr=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null},ti=(Qr.prototype.getCommon=function(){return v.longBitsToDouble(this._commonBits)},Qr.prototype.add=function(t){var e=v.doubleToLongBits(t);return this._isFirst?(this._commonBits=e,this._commonSignExp=Qr.signExpBits(this._commonBits),this._isFirst=!1,null):Qr.signExpBits(e)!==this._commonSignExp?(this._commonBits=0,null):(this._commonMantissaBitsCount=Qr.numCommonMostSigMantissaBits(this._commonBits,e),void(this._commonBits=Qr.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))))},Qr.prototype.toString=function(){if(1===arguments.length){var t=arguments[0],e=v.longBitsToDouble(t),n="0000000000000000000000000000000000000000000000000000000000000000"+v.toBinaryString(t),r=n.substring(n.length-64);return r.substring(0,1)+" "+r.substring(1,12)+"(exp) "+r.substring(12)+" [ "+e+" ]"}},Qr.prototype.interfaces_=function(){return[]},Qr.prototype.getClass=function(){return Qr},Qr.getBit=function(t,e){return 0!=(t&1<<e)?1:0},Qr.signExpBits=function(t){return t>>52},Qr.zeroLowerBits=function(t,e){return t&~((1<<e)-1)},Qr.numCommonMostSigMantissaBits=function(t,e){for(var n=0,r=52;r>=0;r--){if(Qr.getBit(t,r)!==Qr.getBit(e,r))return n;n++}return 52},function(){this._commonCoord=null,this._ccFilter=new ni}),ei={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}},ni=(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),function(){this._commonBitsX=new Qr,this._commonBitsY=new Qr}),ri=(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},function(){this.trans=null;var t=arguments[0];this.trans=t}),ii=(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},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()}),oi=(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=Li.overlayOp(e[0],e[1],t);return this.prepareResult(n)},ii.prototype.checkValid=function(t){t.isValid()||V.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,Li.UNION)},ii.intersection=function(t,e){return ii.overlayOp(t,e,Li.INTERSECTION)},ii.symDifference=function(t,e){return ii.overlayOp(t,e,Li.SYMDIFFERENCE)},ii.difference=function(t,e){return ii.overlayOp(t,e,Li.DIFFERENCE)},function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e}),si=(oi.prototype.getResultGeometry=function(t){var e=null,n=!1,r=null;try{e=Li.overlayOp(this._geom[0],this._geom[1],t),n=!0}catch(t){if(!(t instanceof Q))throw t;r=t}if(!n)try{e=ii.overlayOp(this._geom[0],this._geom[1],t)}catch(t){throw t instanceof Q?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,Li.UNION)},oi.intersection=function(t,e){return oi.overlayOp(t,e,Li.INTERSECTION)},oi.symDifference=function(t,e){return oi.overlayOp(t,e,Li.SYMDIFFERENCE)},oi.difference=function(t,e){return oi.overlayOp(t,e,Li.DIFFERENCE)},function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e}),ai=(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},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}},li=(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),function(){}),ci=(li.prototype.interfaces_=function(){return[]},li.prototype.getClass=function(){return 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}),hi=(ci.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&1===this._li.getIntersectionNum()){if(ci.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},ci.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},ci.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},ci.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},ci.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},ci.prototype.hasProperIntersection=function(){return this._hasProper},ci.prototype.hasIntersection=function(){return this._hasIntersection},ci.prototype.isDone=function(){return this._isDone},ci.prototype.isBoundaryPoint=function(t,e){return!(null===e||!this.isBoundaryPointInternal(t,e[0])&&!this.isBoundaryPointInternal(t,e[1]))},ci.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},ci.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))))},ci.prototype.interfaces_=function(){return[]},ci.prototype.getClass=function(){return ci},ci.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)},function(t){function e(){t.call(this),this.events=new It,this.nOverlaps=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.prepareEvents=function(){Qe.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 ci&&M(arguments[0],bt)&&M(arguments[1],bt)){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]&&M(arguments[0],bt)&&arguments[1]instanceof ci){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}(li)),pi=function(){this._min=v.POSITIVE_INFINITY,this._max=v.NEGATIVE_INFINITY},fi={NodeComparator:{configurable:!0}},gi=(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),function(){}),di=(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[I]},gi.prototype.getClass=function(){return gi},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),mi=function(){this._leaves=new It,this._root=null,this._level=0},_i=(mi.prototype.buildTree=function(){Qe.sort(this._leaves,new pi.NodeComparator);for(var t=this._leaves,e=null,n=new It;;){if(this.buildLevel(t,n),1===n.size())return n.get(0);e=t,t=n,n=e}},mi.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))},mi.prototype.query=function(t,e,n){this.init(),this._root.query(t,e,n)},mi.prototype.buildRoot=function(){if(null!==this._root)return null;this._root=this.buildTree()},mi.prototype.printNode=function(t){V.out.println($.toLineString(new w(t._min,this._level),new w(t._max,this._level)))},mi.prototype.init=function(){if(null!==this._root)return null;this.buildRoot()},mi.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)}}},mi.prototype.interfaces_=function(){return[]},mi.prototype.getClass=function(){return mi},function(){this._items=new It}),vi=(_i.prototype.visitItem=function(t){this._items.add(t)},_i.prototype.getItems=function(){return this._items},_i.prototype.interfaces_=function(){return[Je]},_i.prototype.getClass=function(){return _i},function(){this._index=null;var t=arguments[0];if(!M(t,$t))throw new _("Argument must be Polygonal");this._index=new bi(t)}),xi={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}},Ei=(vi.prototype.locate=function(t){var e=new st(t),n=new Ei(e);return this._index.query(t.y,t.y,n),e.getLocation()},vi.prototype.interfaces_=function(){return[Un]},vi.prototype.getClass=function(){return vi},xi.SegmentVisitor.get=function(){return Ei},xi.IntervalIndexedGeometry.get=function(){return bi},Object.defineProperties(vi,xi),function(){this._counter=null;var t=arguments[0];this._counter=t}),bi=(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},function(){this._index=new mi;var t=arguments[0];this.init(t)}),Ii=(bi.prototype.init=function(t){for(var e=wr.getLines(t).iterator();e.hasNext();){var n=e.next().getCoordinates();this.addLine(n)}},bi.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)}},bi.prototype.query=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new _i;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)}},bi.prototype.interfaces_=function(){return[]},bi.prototype.getClass=function(){return 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;C.NONE,r.getLocation(t,Ne.ON)===C.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 ci(arguments[0],!0,!1);i.setIsDoneIfProperInt(r);var o=this.createEdgeSetIntersector(),s=this._parentGeom instanceof ee||this._parentGeom instanceof Qt||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 ci(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 Zt){var t=arguments[0].getCoordinate();this.insertPoint(this._argIndex,t,C.INTERIOR)}else if(arguments[0]instanceof w){var e=arguments[0];this.insertPoint(this._argIndex,e,C.INTERIOR)}},e.prototype.addPolygon=function(t){this.addPolygonRing(t.getExteriorRing(),C.EXTERIOR,C.INTERIOR);for(var e=0;e<t.getNumInteriorRing();e++){var n=t.getInteriorRingN(e);this.addPolygonRing(n,C.INTERIOR,C.EXTERIOR)}},e.prototype.addEdge=function(t){this.insertEdge(t);var e=t.getCoordinates();this.insertPoint(this._argIndex,e[0],C.BOUNDARY),this.insertPoint(this._argIndex,e[e.length-1],C.BOUNDARY)},e.prototype.addLineString=function(t){var e=Lt.removeRepeatedPoints(t.getCoordinates());if(e.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=e[0],null;var n=new nr(e,new Re(this._argIndex,C.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===C.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=Lt.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 Re(this._argIndex,C.BOUNDARY,i,o));this._lineEdgeMap.put(t,s),this.insertEdge(s),this.insertPoint(this._argIndex,r[0],C.BOUNDARY)},e.prototype.insertPoint=function(t,e,n){var r=this._nodes.addNode(e),i=r.getLabel();null===i?r._label=new Re(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 Qt)this.addPolygon(e);else if(e instanceof Jt)this.addLineString(e);else if(e instanceof Zt)this.addPoint(e);else if(e instanceof te)this.addCollection(e);else if(e instanceof jt)this.addCollection(e);else if(e instanceof ne)this.addCollection(e);else{if(!(e instanceof zt))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 M(this._parentGeom,$t)&&this._parentGeom.getNumGeometries()>50?(null===this._areaPtLocator&&(this._areaPtLocator=new vi(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)?C.BOUNDARY:C.INTERIOR},e}(Ve)),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 Ii(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 Ii(0,e,r),this._arg[1]=new Ii(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 Ii(0,i,s),this._arg[1]=new Ii(1,o,s)}},Ni=(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},function(){}),Li=(Ni.prototype.interfaces_=function(){return[]},Ni.prototype.getClass=function(){return Ni},Ni.map=function(){if(arguments[0]instanceof ct&&M(arguments[1],Ni.MapOp)){for(var t=arguments[0],e=arguments[1],n=new It,r=0;r<t.getNumGeometries();r++){var i=e.map(t.getGeometryN(r));null!==i&&n.add(i)}return t.getFactory().buildGeometry(n)}if(M(arguments[0],xt)&&M(arguments[1],Ni.MapOp)){for(var o=arguments[0],s=arguments[1],a=new It,u=o.iterator();u.hasNext();){var l=u.next(),c=s.map(l);null!==c&&a.add(c)}return a}},Ni.MapOp=function(){},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 Hn,this._resultPolyList=new It,this._resultLineList=new It,this._resultPointList=new It,this._graph=new Ve(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 Re(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 It;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)!==C.EXTERIOR)return!0}return!1},e.prototype.replaceCollapsedEdges=function(){for(var t=new It,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 It;this._arg[0].computeSplitEdges(e),this._arg[1].computeSplitEdges(e),this.insertUniqueEdges(e),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),Vr.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 Yr(this,this._geomFact,this._ptLocator);this._resultLineList=r.build(t);var i=new Hr(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=(Li.overlayOp=function(t,e,n){return new Li(t,e).getResultGeometry(n)},Li.intersection=function(t,e){if(t.isEmpty()||e.isEmpty())return Li.createEmptyResult(Li.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,Li.INTERSECTION)},Li.symDifference=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return Li.createEmptyResult(Li.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,Li.SYMDIFFERENCE)},Li.resultDimension=function(t,e,n){var r=e.getDimension(),i=n.getDimension(),o=-1;switch(t){case Li.INTERSECTION:o=Math.min(r,i);break;case Li.UNION:o=Math.max(r,i);break;case Li.DIFFERENCE:o=r;break;case Li.SYMDIFFERENCE:o=Math.max(r,i)}return o},Li.createEmptyResult=function(t,e,n,r){var i=null;switch(Li.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},Li.difference=function(t,e){return t.isEmpty()?Li.createEmptyResult(Li.DIFFERENCE,t,e,t.getFactory()):e.isEmpty()?t.copy():(t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),oi.overlayOp(t,e,Li.DIFFERENCE))},Li.isResultOfOp=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=t.getLocation(0),r=t.getLocation(1);return Li.isResultOfOp(n,r,e)}if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];switch(i===C.BOUNDARY&&(i=C.INTERIOR),o===C.BOUNDARY&&(o=C.INTERIOR),s){case Li.INTERSECTION:return i===C.INTERIOR&&o===C.INTERIOR;case Li.UNION:return i===C.INTERIOR||o===C.INTERIOR;case Li.DIFFERENCE:return i===C.INTERIOR&&o!==C.INTERIOR;case Li.SYMDIFFERENCE:return i===C.INTERIOR&&o!==C.INTERIOR||i!==C.INTERIOR&&o===C.INTERIOR}return!1}},Li.INTERSECTION=1,Li.UNION=2,Li.DIFFERENCE=3,Li.SYMDIFFERENCE=4,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=(Si.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},Si.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?C.BOUNDARY:this._ptLocator.locate(t,this._g)},Si.prototype.extractLinework=function(t){var e=new Ci;t.apply(e);var n=e.getLinework(),r=me.toLineStringArray(n);return t.getFactory().createMultiLineString(r)},Si.prototype.interfaces_=function(){return[]},Si.prototype.getClass=function(){return Si},function(){this._linework=null,this._linework=new It}),Pi=(Ci.prototype.getLinework=function(){return this._linework},Ci.prototype.filter=function(t){if(t instanceof Qt){var e=t;this._linework.add(e.getExteriorRing());for(var n=0;n<e.getNumInteriorRing();n++)this._linework.add(e.getInteriorRingN(n))}},Ci.prototype.interfaces_=function(){return[Ut]},Ci.prototype.getClass=function(){return Ci},function(){this._g=null,this._doLeft=!0,this._doRight=!0;var t=arguments[0];this._g=t}),Mi=(Pi.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)},Pi.prototype.setSidesToGenerate=function(t,e){this._doLeft=t,this._doRight=e},Pi.prototype.getPoints=function(t){for(var e=new It,n=wr.getLines(this._g).iterator();n.hasNext();){var r=n.next();this.extractPoints(r,t,e)}return e},Pi.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,l=(e.x+t.x)/2,c=(e.y+t.y)/2;if(this._doLeft){var h=new w(l-u,c+a);r.add(h)}if(this._doRight){var p=new w(l+u,c-a);r.add(p)}},Pi.prototype.interfaces_=function(){return[]},Pi.prototype.getClass=function(){return Pi},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 It;var e=arguments[0],n=arguments[1],r=arguments[2];this._boundaryDistanceTolerance=t.computeBoundaryDistanceTolerance(e,n),this._geom=[e,n,r],this._locFinder=[new Si(this._geom[0],this._boundaryDistanceTolerance),new Si(this._geom[1],this._boundaryDistanceTolerance),new Si(this._geom[2],this._boundaryDistanceTolerance)]}),Ti={TOLERANCE:{configurable:!0}},Ri=(Mi.prototype.reportResult=function(t,e,n){V.out.println("Overlay result invalid - A:"+C.toLocationSymbol(e[0])+" B:"+C.toLocationSymbol(e[1])+" expected:"+(n?"i":"e")+" actual:"+C.toLocationSymbol(e[2]))},Mi.prototype.isValid=function(t){return this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]),this.checkValid(t)},Mi.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),!!Mi.hasLocation(this._location,C.BOUNDARY)||this.isValidResult(r,this._location)}},Mi.prototype.addTestPts=function(t){var e=new Pi(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))},Mi.prototype.isValidResult=function(t,e){var n=Li.isResultOfOp(e[0],e[1],t),r=!(n^e[2]===C.INTERIOR);return r||this.reportResult(t,e,n),r},Mi.prototype.getInvalidLocation=function(){return this._invalidLocation},Mi.prototype.interfaces_=function(){return[]},Mi.prototype.getClass=function(){return Mi},Mi.hasLocation=function(t,e){for(var n=0;n<3;n++)if(t[n]===e)return!0;return!1},Mi.computeBoundaryDistanceTolerance=function(t,e){return Math.min(Kr.computeSizeBasedSnapTolerance(t),Kr.computeSizeBasedSnapTolerance(e))},Mi.isValid=function(t,e,n,r){return new Mi(t,e,r).isValid(n)},Ti.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(Mi,Ti),function t(e){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=t.extractFactory(e),this._inputGeoms=e}),Oi=(Ri.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)}},Ri.prototype.combine=function(){for(var t=new It,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)},Ri.prototype.interfaces_=function(){return[]},Ri.prototype.getClass=function(){return Ri},Ri.combine=function(){if(1===arguments.length)return new Ri(arguments[0]).combine();if(2===arguments.length){var t=arguments[0],e=arguments[1];return new Ri(Ri.createList(t,e)).combine()}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];return new Ri(Ri.createList(n,r,i)).combine()}},Ri.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},Ri.createList=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new It;return n.add(t),n.add(e),n}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2],s=new It;return s.add(r),s.add(i),s.add(o),s}},function(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,null===this._inputPolys&&(this._inputPolys=new It)}),Ai={STRTREE_NODE_CAPACITY:{configurable:!0}},Di=(Oi.prototype.reduceToGeometries=function(t){for(var e=new It,n=t.iterator();n.hasNext();){var r=n.next(),i=null;M(r,bt)?i=this.unionTree(r):r instanceof ct&&(i=r),e.add(i)}return e},Oi.prototype.extractByEnvelope=function(t,e,n){for(var r=new It,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)},Oi.prototype.unionOptimized=function(t,e){var n=t.getEnvelopeInternal(),r=e.getEnvelopeInternal();if(!n.intersects(r))return Ri.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)},Oi.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(Oi.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)},Oi.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=Oi.getGeometry(e,n);return this.unionSafe(i,null)}if(r-n==2)return this.unionSafe(Oi.getGeometry(e,n),Oi.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)}},Oi.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},Oi.prototype.unionSafe=function(t,e){return null===t&&null===e?null:null===t?e.copy():null===e?t.copy():this.unionOptimized(t,e)},Oi.prototype.unionActual=function(t,e){return Oi.restrictToPolygons(t.union(e))},Oi.prototype.unionTree=function(t){var e=this.reduceToGeometries(t);return this.binaryUnion(e)},Oi.prototype.unionUsingEnvelopeIntersection=function(t,e,n){var r=new It,i=this.extractByEnvelope(n,t,r),o=this.extractByEnvelope(n,e,r),s=this.unionActual(i,o);return r.add(s),Ri.combine(r)},Oi.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)}},Oi.prototype.interfaces_=function(){return[]},Oi.prototype.getClass=function(){return Oi},Oi.restrictToPolygons=function(t){if(M(t,$t))return t;var e=Ir.getPolygons(t);return 1===e.size()?e.get(0):t.getFactory().createMultiPolygon(me.toPolygonArray(e))},Oi.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)},Oi.union=function(t){return new Oi(t).union()},Ai.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(Oi,Ai),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 Li.createEmptyResult(Li.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,Li.UNION)},t.GeoJSONReader=Ie,t.GeoJSONWriter=we,t.OverlayOp=Li,t.UnionOp=Di,t.BufferOp=dr,Object.defineProperty(t,"__esModule",{value:!0})}(e)},61:(t,e,n)=>{var r=n(698).default;t.exports=function(){"use strict";t.exports=function(){return n},t.exports.__esModule=!0,t.exports.default=t.exports;var e,n={},i=Object.prototype,o=i.hasOwnProperty,s=Object.defineProperty||function(t,e,n){t[e]=n.value},a=(E="function"==typeof Symbol?Symbol:{}).iterator||"@@iterator",u=E.asyncIterator||"@@asyncIterator",l=E.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(e){c=function(t,e,n){return t[e]=n}}function h(t,n,r,i){var o,a,u,l;return n=n&&n.prototype instanceof _?n:_,n=Object.create(n.prototype),i=new C(i||[]),s(n,"_invoke",{value:(o=t,a=r,u=i,l=f,function(t,n){if(l===d)throw new Error("Generator is already running");if(l===y){if("throw"===t)throw n;return{value:e,done:!0}}for(u.method=t,u.arg=n;;){var r=u.delegate;if(r&&(r=function t(n,r){var i=r.method,o=n.iterator[i];return o===e?(r.delegate=null,"throw"===i&&n.iterator.return&&(r.method="return",r.arg=e,t(n,r),"throw"===r.method)||"return"!==i&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+i+"' method")),m):"throw"===(i=p(o,n.iterator,r.arg)).type?(r.method="throw",r.arg=i.arg,r.delegate=null,m):(o=i.arg)?o.done?(r[n.resultName]=o.value,r.next=n.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}(r,u),r)){if(r===m)continue;return r}if("next"===u.method)u.sent=u._sent=u.arg;else if("throw"===u.method){if(l===f)throw l=y,u.arg;u.dispatchException(u.arg)}else"return"===u.method&&u.abrupt("return",u.arg);if(l=d,"normal"===(r=p(o,a,u)).type){if(l=u.done?y:g,r.arg===m)continue;return{value:r.arg,done:u.done}}"throw"===r.type&&(l=y,u.method="throw",u.arg=r.arg)}})}),n}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}n.wrap=h;var f="suspendedStart",g="suspendedYield",d="executing",y="completed",m={};function _(){}function v(){}function x(){}var E,b,I=(c(E={},a,(function(){return this})),(b=(b=Object.getPrototypeOf)&&b(b(P([]))))&&b!==i&&o.call(b,a)&&(E=b),x.prototype=_.prototype=Object.create(E));function w(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function N(t,e){var n;s(this,"_invoke",{value:function(i,s){function a(){return new e((function(n,a){!function n(i,s,a,u){var l;if("throw"!==(i=p(t[i],t,s)).type)return(s=(l=i.arg).value)&&"object"==r(s)&&o.call(s,"__await")?e.resolve(s.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,u)}));u(i.arg)}(i,s,n,a)}))}return n=n?n.then(a,a):a()}})}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function P(t){if(t||""===t){var n,i=t[a];if(i)return i.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return n=-1,(i=function r(){for(;++n<t.length;)if(o.call(t,n))return r.value=t[n],r.done=!1,r;return r.value=e,r.done=!0,r}).next=i}throw new TypeError(r(t)+" is not iterable")}return s(I,"constructor",{value:v.prototype=x,configurable:!0}),s(x,"constructor",{value:v,configurable:!0}),v.displayName=c(x,l,"GeneratorFunction"),n.isGeneratorFunction=function(t){return!!(t="function"==typeof t&&t.constructor)&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,c(t,l,"GeneratorFunction")),t.prototype=Object.create(I),t},n.awrap=function(t){return{__await:t}},w(N.prototype),c(N.prototype,u,(function(){return this})),n.AsyncIterator=N,n.async=function(t,e,r,i,o){void 0===o&&(o=Promise);var s=new N(h(t,e,r,i),o);return n.isGeneratorFunction(e)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},w(I),c(I,l,"Generator"),c(I,a,(function(){return this})),c(I,"toString",(function(){return"[object Generator]"})),n.keys=function(t){var e,n=Object(t),r=[];for(e in n)r.push(e);return r.reverse(),function t(){for(;r.length;){var e=r.pop();if(e in n)return t.value=e,t.done=!1,t}return t.done=!0,t}},n.values=P,C.prototype={constructor:C,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(S),!t)for(var n in this)"t"===n.charAt(0)&&o.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function r(r,i){return a.type="throw",a.arg=t,n.next=r,i&&(n.method="next",n.arg=e),!!i}for(var i=this.tryEntries.length-1;0<=i;--i){var s=this.tryEntries[i],a=s.completion;if("root"===s.tryLoc)return r("end");if(s.tryLoc<=this.prev){var u=o.call(s,"catchLoc"),l=o.call(s,"finallyLoc");if(u&&l){if(this.prev<s.catchLoc)return r(s.catchLoc,!0);if(this.prev<s.finallyLoc)return r(s.finallyLoc)}else if(u){if(this.prev<s.catchLoc)return r(s.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return r(s.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}var s=(i=i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc?null:i)?i.completion:{};return s.type=t,s.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),S(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n,r,i=this.tryEntries[e];if(i.tryLoc===t)return"throw"===(n=i.completion).type&&(r=n.arg,S(i)),r}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:P(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),m}},n},t.exports.__esModule=!0,t.exports.default=t.exports},698:t=>{function e(n){return t.exports=e="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.exports.__esModule=!0,t.exports.default=t.exports,e(n)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},687:(t,e,n)=>{n=n(61)(),t.exports=n;try{regeneratorRuntime=n}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}}},n={},t.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},t.d=(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},t.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r={},(()=>{"use strict";function e(t,e,n,r,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void n(t)}a.done?e(u):Promise.resolve(u).then(r,i)}function n(t){return function(){var n=this,r=arguments;return new Promise((function(i,o){var s=t.apply(n,r);function a(t){e(s,i,o,a,u,"next",t)}function u(t){e(s,i,o,a,u,"throw",t)}a(void 0)}))}}function i(t,e){if(null==t)return{};for(var n,r={},i=Object.keys(t),o=0;o<i.length;o++)n=i[o],0<=e.indexOf(n)||(r[n]=t[n]);return r}function o(){return(o=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n,r=arguments[e];for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}t.r(r),t.d(r,{MapLayer:()=>mr,RegisterMapBoxMethod:()=>function(t,e){if(t&&t.Map&&!t.Map.prototype.MapTooltip){Er=t;var r,s,u=((d=(window.mapboxgl=Er).Map.prototype._setupPainter)&&-1===d.toString().indexOf("webgl2")&&(r=d,Er.Map.prototype._setupPainter=function(){var t=this._canvas.getContext;this._canvas.getContext=function(e,n){return t.apply(this,["webgl2",n])||t.apply(this,["webgl",n])||t.apply(this,["experimental-webgl",n])},r.apply(this),this._canvas.getContext=t}),t.Map),h=function(t,e){var r=t.prototype.setStyle,s=t.prototype.addControl;return{initData:function(){var t;this[Cr]||(this[Cr]={},this.style[Cr]={},Ar(this,{source:t=Array.isArray(e)&&0<e.length&&e.every((function(t){return"string"==typeof t}))?e:[],defaultSources:t,layerSource:{layers:[],sources:[]},customLayer:[],images:{},layerIndex:[],showHeader:!1,bounds:null,cameraOptions:{},measure:{line:0,circle:0,polygon:0},mapLayer:[]}),Ar(this.style,{layerObject:{}}))},clearData:function(){var t=Dr(this,"defaultSources");Ar(this,{source:t,defaultSources:t,layerSource:{layers:[],sources:[]},customLayer:[],images:{},layerIndex:[],showHeader:!1,bounds:null,cameraOptions:{},measure:{line:0,circle:0,polygon:0},mapLayer:[]})},setPaint:function(t,e){Mr(this,t,e,"setPaintProperty")},setLayout:function(t,e){Mr(this,t,e,"setLayoutProperty")},customStyle:function(t){if(t&&"object"==typeof t)for(var e in t){var n,r=t[e];"string"==typeof r?Pr(this,e,r):Array.isArray(r)&&(Ir(r[0])||Array.isArray(r[0]))&&(n=null,"number"!=typeof r[1]&&!Array.isArray(r[1])||(n=r[1]),Pr(this,e,r[0],n))}},getAllLayerAndSource:function(t,e){void 0===e&&(e=!0),null==t&&(t=Dr(this,"source"));for(var n,r=this.getStyle(),i=r.layers,o=r.sources,s={layers:[],sources:[]},a=function(e){return t.includes(e)},u=0;u<i.length;u++)"background"===i[u].type||a(i[u].source)||(n=i[u].id,this.getLayer(n)&&(s.layers.push(l(i[u])),e||this.removeLayer(n)));for(var c=Object.keys(o),h=0;h<c.length;h++){var p=c[h];a(p)||this.isSourceLoaded(p)&&(s.sources.push({name:p,source:l(o[p])}),e||this.removeSource(p))}return s},removeAllCustomLayer:function(){var t=this,e=Dr(this,"customLayer");e.forEach((function(e){t.getLayer(e.layer.id)&&t.removeLayer(e.layer.id)})),e.length=0},removeAllLayerAndSource:function(t){return null==t&&(t=Dr(this,"source")),this.removeAllCustomLayer(),this.getAllLayerAndSource(t,!1)},removeEvents:function(t){var e=this;void 0===t&&(t=["click","mousemove","mouseout"]),Array.isArray(t)&&t.forEach((function(t){t in e._listeners&&(e._listeners[t]=[])}))},removePopup:function(t){t&&"string"==typeof t?["tooltip","popup"].includes(t)&&this._popups.forEach((function(e){e.options.type===t&&e.remove()})):this._popups.forEach((function(t){t.remove()}))},findCustomLayer:function(t,e){null==e&&(e=Dr(this,"source"));for(var n=this.getStyle().layers,r=[],i=0;i<n.length;i++)"background"===n[i].type||e.includes(n[i].source)||r.push(n[i]);if(t){if("string"==typeof t)return r.filter((function(e){return e.type===t}));if(Array.isArray(t)&&0<t.length)return r.filter((function(e){return t.includes(e.type)}))}return r},MapTooltip:function(t,e){return t=new C(this,t,e),Tr(this,t),t},MapPopup:function(t,e){return t=new M(this,t,e),Tr(this,t),t},addLayer:function(t,e){void 0===this._layers&&(this._layers=[],this._sortLayers=[]),t.id&&this._layers.push(t),"zIndex"in t&&this._sortLayers.push(t),this._lazyInitEmptyStyle();var n=Dr(this,"layerIndex"),r=Dr(this,"customLayer");return"custom"===t.type&&r.push({layer:t,beforeId:e}),e?-1!==(r=n.findIndex((function(t){return t.id===e})))&&n.splice(r,0,{type:t.type,id:t.id}):n.push({type:t.type,id:t.id}),this.style.addLayer(t,e),"zIndex"in t&&(r=this._sortLayers.sort((function(t,e){return t.zIndex-e.zIndex})),this.orderLayers(r.map((function(t){return t.id})))),this.fire("layerdata",o({},t,{add:!0})),this._update(!0)},removeLayer:function(t){void 0===this._layers&&(this._layers=[],this._sortLayers=[]);var e=this.style.getLayer(t),n=(this._layers=this._layers.filter((function(e){return e.id!==t})),this._sortLayers=this._sortLayers.filter((function(e){return e.id!==t})),Dr(this,"customLayer")),r=Dr(this,"layerIndex"),i=n.findIndex((function(e){return e.layer.id===t}));return-1!==i&&n.splice(i,1),n=r.findIndex((function(e){return e.id===t})),-1!==n&&r.splice(n,1),this.style.removeLayer(t),this.fire("layerdata",o({},e,{add:!1})),this._update(!0)},moveLayer:function(t,e){var n,r=Dr(this,"layerIndex"),i=r.findIndex((function(e){return e.id===t})),o=r.findIndex((function(t){return t.id===e}));return-1!==i&&-1!==o&&(n=r.splice(i,1)[0],o=Math.max(0,Math.min(o,r.length)),r.splice(o,0,n)),this.style.moveLayer(t,e),this._update(!0)},MapLine:function(){var t=new R(this);return Tr(this,t),t},MapCustom:function(){var t=new O(this);return Tr(this,t),t},fitBoundsGeoJson:function(t,e,n){t&&(t=[[(t=rt(t)).bbox[0],t.bbox[1]],[t.bbox[2],t.bbox[3]]],this.fitBoundsPosition(t,e,n))},fitBoundsPosition:function(t,e,n){var r,s,a,u;Array.isArray(t)&&0!==(null==t?void 0:t.length)&&(r=void 0===(r=(e=null!=e?e:{}).padding)?40:r,s=void 0===(s=e.animate)||s,a=void 0===(a=e.maxZoom)?15:a,u=void 0===(u=e.essential)||u,e=i(e,_r),this.fitBounds(t,o({linear:!1,padding:r,animate:s,essential:u,maxZoom:a},e),n))},getInvertMask:function(t,e){var n;if(c(t)&&0!==(t=null!=(t=t.features[0].geometry.coordinates)?t:[]).length)return n=[],t.forEach((function(t){n.push(t[0])})),e=(t=null!=e?e:{}).id,t=void 0===(t=t.layerConfig)?{paint:{"fill-color":"rgba(0,0,0,0.8)"},layout:{visibility:"visible"}}:t,o({id:void 0===e?"mask":e,type:"fill",source:{type:"geojson",data:{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-180,90],[180,90],[180,-90],[-180,-90]]].concat(n)}}}},t)},fitMap:function(){for(var t={},e=!1,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];var s=void 0===(s=r[0])?null:s,a=void 0===(a=r[1])?null:a,u=Dr(this,"bounds"),l=Dr(this,"cameraOptions");s?c(s)?(e=!1,u=s,a&&!c(a)&&"object"==typeof a&&(l=a)):"object"==typeof s&&(e=!0,t=s):u&&(e=!0),e&&u&&this.fitBoundsGeoJson(u,o({},l,t))},loadImages:function(t){var e=this;return new Promise((function(n){var r={};if(t&&0!==Object.keys(t).length)for(var o in t){var s,a,u=t[o];"string"==typeof u?e.loadImage(u,l(o)):"object"==typeof u&&(u.url?(s=u.url,a=i(u,vr),e.loadImage(s,l(o,a))):u.layer&&u.layer.render&&"function"==typeof u.layer.render&&l(o,u.config||{})(null,u.layer))}else n(r);function l(e,i){return function(o,s){r[e]={data:i,url:o?null:s},Object.keys(r).length===Object.keys(t).length&&n(r)}}}))},loadAddImages:function(t){var e=this;return new Promise((function(n){e.loadImages(t).then((function(t){for(var r in t){var i=t[r],s=o({},null==i?void 0:i.data,{type:"custom"});e.hasImage(r)||e.addImage(r,i.url,s)}n()}))}))},MapCircle:function(){var t=new ct(this);return Tr(this,t),t},MapEvent:function(t){return t=new ht(this,t),Tr(this,t),t},MapMoreCustom:function(){var t=new gt(this);return Tr(this,t),t},removeLayerSource:function(t){function e(t){n.getSource(t)&&(n.removeLayer(t),n.removeSource(t))}var n=this,r=t.name,i=null!=(i=t.sources)?i:[];t=null!=(t=t.layers)?t:[],Array.isArray(r)&&0<r.length?r.forEach((function(t){e(t)})):"string"==typeof r&&e(r),0<(null==i?void 0:i.length)&&0<(null==t?void 0:t.length)&&(t.forEach((function(t){n.getLayer(t)&&n.removeLayer(t)})),i.forEach((function(t){n.getSource(t)&&n.removeSource(t)})))},removeLayerEvent:function(t,e){if(void 0===e&&(e=!0),"object"==typeof t&&null!=t)if(t.destroy&&"function"==typeof t.destroy)t.destroy();else for(var n in t)t[n]&&t[n].destroy&&"function"==typeof t[n].destroy&&(t[n].destroy(),e)&&(t[n]=null)},MapMarker:function(t){return t=new mt(this,t),Tr(this,t),t},findCustomIcon:function(){var t,e=this.style.imageManager.images,n={};for(t in e)"custom"===e[t].type&&(n[t]=e[t]);return n},getCustomLayer:function(){var t=this,e=Dr(this,"customLayer"),n=[];return e.map((function(e){t.getLayer(e.layer.id)&&n.push(e.layer)})),n},setStyle:function(t,e,n){var i,o,s,a,u,l,c=this;return null!=e&&e.save&&(s=(o=null!=e?e:{}).source,o=void 0!==(o=o.custom)&&o,s=null!=(i=s=void 0===s?[]:s)?i:[],Dr(this,"images"),a=Dr(this,"layerSource"),u=Dr(this,"customLayer"),l=this.findCustomIcon(),Array.isArray(s)&&0!==s.length?o||(s=Array.from(new Set([].concat(s,["composite","mapbox://mapbox.satellite"])))):s=["composite","mapbox://mapbox.satellite"],a=this.getAllLayerAndSource(s),this.once("style.load",(function(r){var i,o=[];for(i in l)o.push(i),c.style.imageManager.images[i]=l[i];var s=[];a.sources.map((function(t){var e=a.layers.filter((function(e){return e.source===t.name}));s.push({name:t.name,source:t.source,layer:e})})),null!=e&&e.log&&console.log(s),s.map((function(t){c.getSource(t.name)||c.addSource(t.name,t.source),t.layer.map((function(t){c.getLayer(t.id)||c.addLayer(t)}))})),u.forEach((function(t){c.getLayer(t.layer.id)||c.addLayer(t.layer,t.beforeId)})),n&&"function"==typeof n&&n({style:t,images:o,layerSource:a})}))),r.call(this,t,e)},getLayerIndex:function(t){var e=Dr(this,"layerIndex");if(t){var n=e.findIndex((function(e){return e.id===t}));if(-1!==n)return n}return 0===e.length?0:e.length-1},getLayerId:function(t,e){void 0===e&&(e=0);var n=Dr(this,"layerIndex");return t+=e,e=Number(t),isNaN(e)||t<0&&t>=n.length?"":null!=(n=null==n||null==(e=n[t])?void 0:e.id)?n:void 0},getMinLayerId:function(){var t=Dr(this,"layerIndex");return null!=(t=null==t||null==(t=t[0])?void 0:t.id)?t:void 0},getMaxLayerId:function(){var t=Dr(this,"layerIndex");return null!=(t=null==t||null==(t=t[t.length-1])?void 0:t.id)?t:void 0},getAllLayerId:function(){return Dr(this,"layerIndex").map((function(t){return t.id}))},getAllLayer:function(){return Dr(this,"layerIndex")},getLineLayer:function(){return Dr(this,"layerIndex").map((function(t,e){return"line"!==t.type?null:{index:e,id:t.id}})).filter(Boolean)},AnimateLine:function(t,e){return t=new _t(this,t,e),Tr(this,t),t},addHeader:function(t,e){var n,r=Dr(this,"showHeader");e&&"function"==typeof e&&!r&&(n=this._requestManager.transformRequest,this._requestManager.transformRequest=function(i,s){return s=n.call(this,i,s),(i=e(i))&&"boolean"==typeof i?(r=!0,o({headers:t},s)):s})},getTileByPosition:function(t,e){var n,r;return t&&Array.isArray(t)&&2<=t.length&&t.every((function(t){return"number"==typeof t}))?(n=(t=Er.MercatorCoordinate.fromLngLat({lng:t[0],lat:t[1]})).x,t=t.y,e=null!=(r=e)?r:this.getZoom(),r=Math.floor(e),e=Math.pow(2,r),[Math.floor(n*e),Math.floor(t*e),r]):[]},getPositionByTile:function(t){var e,n,r,i;return!(t&&Array.isArray(t)&&3===t.length&&t.every((function(t){return"number"==typeof t})))||(i=t[0],e=t[1],t=Math.floor(t[2]),t=Math.pow(2,t),i<0)||e<0||t<=i||t<=e?[]:(n=I(e/t),r=b(i/t),i=b((i+1)/t),[r,I((e+1)/t),i,n])},getTilesByBounds:function(t,e){var n=void 0===(n=(e=null!=(e=e=void 0===e?{}:e)?e:{}).expand)?0:n,r=(e=void 0!==(e=e.reversal)&&e,t=null!=(i=t)?i:this.getZoom(),Math.floor(t)),i=this.getBounds().toArray(),o=(t=this.getTileByPosition(i[0],r))[0],s=t[1],a=(t=this.getTileByPosition(i[1],r))[0],u=t[1];if(u-=n="number"!=typeof n||n<0||2<n?0:n,a+=n,s+=n,!(E(o-=n)&&E(a)&&E(u)&&E(s)))return[];var l=[];if(e)for(var c=u;c<=s;c++)for(var h=o;h<=a;h++)l.push([h,c,r]);else for(var p=o;p<=a;p++)for(var f=u;f<=s;f++)l.push([p,f,r]);var g=Math.pow(2,r);return l.forEach((function(t){t[0]<0&&(t[0]=t[0]+g)})),l.filter((function(t){return 0<=t[1]}))},loadSpriteGraph:function(t){var e=this;return new Promise(function(){var r=n(a().mark((function r(i){var o,s,u,l;return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(t)return o=[],"object"==typeof t&&t.image&&t.json?o=[t]:Array.isArray(t)&&t.every((function(t){return"object"==typeof t&&t.image&&t.json}))&&(o=t),s={},u=function(){var t=n(a().mark((function t(){var e,n,r,i,u,l,c,h,p,f,g,d,y,m,_,v,x;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=0;case 1:if(e<o.length){if(n=o[e].image,r=o[e].json,i={},"string"==typeof r)return t.next=8,fetch(r).then((function(t){return t.json()}));t.next=12}else t.next=20;break;case 8:u=t.sent,i="object"==typeof u?u:{},t.next=13;break;case 12:"object"==typeof r&&(i=r);case 13:return t.next=15,function(){return Et.apply(this,arguments)}(n);case 15:for(c in l=t.sent,i)v=i[c],h=v.width,p=v.height,f=v.x,g=v.y,d=v.sdf,y=v.pixelRatio,m=v.stretchX,_=v.stretchY,v=v.content,x=new vt({width:h,height:p}),vt.copy(l,x,{x:f,y:g},{x:0,y:0},{width:h,height:p}),s[c]={data:x,pixelRatio:y,sdf:d,stretchX:m,stretchY:_,content:v};case 17:e++,t.next=1;break;case 20:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),r.next=7,u();r.next=9;break;case 7:for(l in s)e.style.addImage(l,s[l]);i();case 9:case"end":return r.stop()}}),r)})));return function(t){return r.apply(this,arguments)}}())},MapClusterMarker:function(t){return t=new It(this,t),Tr(this,t),t},MapSourceEvent:function(t,e){return t=new Nt(this,t,e),Tr(this,t),t},TileByGeoJson:function(t){return t=new kt(this,t),Tr(this,t),t},MapMenu:function(t){return t=new zt(this,t),Tr(this,t),t},MapMeasure:function(t){return t=new ne(this,t,Cr),Tr(this,t),t},addControl:function(t,e){return this.initData(),s.call(this,t,e)},MapTileClusterCustom:function(t){return t=new oe(this,t),Tr(this,t),t},updateGlyphs:function(t){this.style.updateGlyphs(t)},orderLayers:function(t){void 0===t&&(t=[]);var e=this.style._layers,n=Object.keys(e).map((function(t){return e[t]})),r=[],i=[];return t.forEach((function(t){var e;t&&(e=n.find((function(e){return e.id===t})))&&r.push(e)})),n.forEach((function(t){r.find((function(e){return e.id===t.id}))||i.push(t)})),t=i.concat(r),this.style._checkLoaded(),this.style._changed=!0,this.style._order=t.map((function(t){return t.id})),this.style._layerOrderChanged=!0,t},MapPositionImage:function(){var t=new se(this);return Tr(this,t),t},MapLabelByGeoJson:function(){var t=new er(this);return Tr(this,t),t},MapImageByGeoJson:function(t){return t=new pr(this,t),Tr(this,t),t},getMapLayer:function(){return Rr(this)},clearMapLayer:function(t,e){Or(this,t,e=void 0===e||e)}}}(u,e);for(s in new Event("layerdata"),h)u.prototype[s]=h[s];var p,f=Er.Style,g=function(t){var e=t.prototype.addImage,n=t.prototype.updateImage,r=t.prototype._loadSprite,o=t.prototype.queryRenderedFeatures,s=t.prototype.addLayer,a=t.prototype.removeLayer;return{addImage:function(t,n){return n.type="custom",e.call(this,t,n),this},updateImage:function(t,e){e.type="custom",n.call(this,t,e)},_loadSprite:function(t,e){var n,i=this;void 0===e&&(e=!1),r.call(this,t),e&&(n=this._availableImages.length,this.map.on("data",(function t(e){if(i.map&&i._availableImages){var r=i._availableImages.length;if("style"===e.dataType&&r!==n&&n<r){for(var o=i._availableImages.slice(n),s=0;s<o.length;s++)i.imageManager&&i.imageManager.images&&i.imageManager.images[o[s]]&&(i.imageManager.images[o[s]].type="custom");i.map.off("data",t)}}else i.map&&i.map.off("data",t)})))},loadSprite:function(t){this._loadSprite(t,!0)},addLayer:function(t,e){var n=void 0===(n=t.interactive)||n,r=(null!=this&&null!=(r=this[Cr])&&r.layerObject||Ar(this,{layerObject:{}}),this),i=["layerObject",t.id];if(r&&r[Cr]&&Array.isArray(i)&&0!==i.length){for(var o=r[Cr],a=0;a<i.length-1;a++){var u=i[a];o[u]||(o[u]={}),o=o[u]}o[i[i.length-1]]=n}s.call(this,t,e)},removeLayer:function(t){!function(t,e){if(t&&t[Cr]&&Array.isArray(e)&&0!==e.length)try{for(var n=t[Cr],r=0;r<e.length-1;r++){if(!n||!n[e[r]])return;n=n[e[r]]}var i=e[e.length-1];n&&i in n&&delete n[i]}catch(t){console.warn("Error deleting property:",t)}}(this,["layerObject",t]),a.call(this,t)},queryRenderedFeatures:function(t,e,n){var r=void 0===(r=(e=null!=e?e:{}).interactive)||r,s=(e=i(e,xr),o.call(this,t,e,n));if(r){if(0<s.length)for(var a,u=null==(t=this[Cr])?void 0:t.layerObject,l=0;l<s.length;l++)u&&s[l].layer&&s[l].layer.id?(a=u[s[l].layer.id],s[l].layer.interactive=null==a||a):s[l].layer.interactive=!0;return s.filter((function(t){return t.layer.interactive}))}return s},updateGlyphs:function(t){this.glyphManager.setURL(t)}}}(f);for(p in g)f.prototype[p]=g[p];var d,y=(d=Er.Popup).prototype.setDOMContent;d.prototype._closeClick=function(){},d.prototype.setDOMContent=function(t){return t=y.call(this,t),this._closeButton&&this._closeButton.addEventListener("click",this._closeClick),t}}},RegisterMapBoxModel:()=>function(t,e){if(Er&&t&&e){(br=t).GLTFLoader=e,window.THREE=br;var n,r=Er.Map,i={initGLTF:function(t,e,n){return new T(t,e,n)}};for(n in i)r.prototype[n]=i[n]}},RegisterMapClass:()=>function(t,e){var n;t&&(n=(e=null!=e?e:{}).tooltipClass,e=e.popupClass,t.tooltipClass=null!=n?n:"commonTooltip",t.popupClass=null!=e?e:"commonPopup")},convertPolygonToLinePolygon:()=>function(t,e){if(c(t)){var n=t.features.filter((function(t){return"Polygon"===t.geometry.type||"MultiPolygon"===t.geometry.type})),r=(n=[].concat(n.map((function(t){return le(t)})),t.features.filter((function(t){return"LineString"===t.geometry.type||"MultiLineString"===t.geometry.type}))),[]);if(n.forEach((function(t){t=Dn(t,e,{units:"meters"}),r.push.apply(r,t.features)})),0<r.length)return{type:"FeatureCollection",features:r}}return null},deepClone:()=>l,gcj02ToWgs84:()=>Rt,generateUUID:()=>L,getAPNGSymbol:()=>function(t){var e,n=void 0===(e=(t=null!=t?t:{}).width)?50:e,r=void 0===(e=t.height)?50:e,i=void 0===(e=t.duration)?null:e,o=void 0===(e=t.url)?"":e;return new Promise((function(t){fetch(o).then((function(t){return t.arrayBuffer()})).then((function(e){var o;e=yr()(e),!(0,dr.isNotAPNG)(e)&&0<(null==(o=e.frames)?void 0:o.length)?(i="number"==typeof i?i:e.playTime/e.frames.length,o=e.frames.map((function(t){return URL.createObjectURL(t.imageData)})),Promise.all(o.map((function(t){var e=new Image;return e.src=t,new Promise((function(t){e.onload=function(){var i;((i=document.createElement("canvas")).width=n,i.height=r,i=i.getContext("2d")).drawImage(e,0,0,n,r),t(i.getImageData(0,0,n,r).data)}}))}))).then((function(e){e={urls:e,width:n,height:r,data:new Uint8Array(n*r*4),onAdd:function(t){this.map=t,(t=document.createElement("canvas")).width=this.width,t.height=this.height,this.canvas=t,this.context=t.getContext("2d"),this.index=0,this.duration=i,this.dataNow=performance.now()},render:function(){var t=this.urls[this.index];return performance.now()-this.dataNow>this.duration&&(this.index++,this.index>=this.urls.length&&(this.index=0),this.dataNow=performance.now()),this.data=t,this.map.triggerRepaint(),!0}},t(e)})).catch((function(e){t(null)}))):t(null)}))}))},getArrayDepth:()=>m,getGifSymbol:()=>function(t){var e,n=void 0===(e=(t=null!=t?t:{}).width)?50:e,r=void 0===(e=t.height)?50:e,i=void 0===(e=t.duration)?null:e,o=void 0===(e=t.url)?"":e;return new Promise((function(t){var e,s,a;o&&("gif"===(a=(s=o).split("/"))[a.length-1].split(".").pop().toLowerCase()||s.startsWith("data:image/gif"))?(a=document.createElement("div"),(s=document.createElement("img")).setAttribute("rel:animated_src",o),s.setAttribute("rel:auto_play","0"),a.appendChild(s),(e=new(gr())({gif:s})).load((function(){var o=[];i="number"==typeof i?i:e.get_duration_ms()/e.get_length();for(var s,a=1;a<=e.get_length();a++){e.move_to(a);var u=((u=e.get_canvas().getContext("2d")).drawImage(e.get_canvas(),0,0,n,r),u.getImageData(0,0,n,r).data);o.push(u)}0<o.length?(s={urls:o,width:n,height:r,data:new Uint8Array(n*r*4),onAdd:function(t){this.map=t,(t=document.createElement("canvas")).width=this.width,t.height=this.height,this.canvas=t,this.context=t.getContext("2d"),this.index=0,this.duration=i,this.dataNow=performance.now()},render:function(){var t=this.urls[this.index];return performance.now()-this.dataNow>this.duration&&(this.index++,this.index>=this.urls.length&&(this.index=0),this.dataNow=performance.now()),this.data=t,this.map.triggerRepaint(),!0}},t(s)):t(null)}))):t(null)}))},getPositionType:()=>d,getSymbolRipple:()=>function(t){var e,n=void 0===(e=(t=null!=t?t:{}).size)?30:e,r=void 0===(e=t.duration)?1e3:e,i=void 0===(e=t.color)?"#ff0000":e,o=t.custom,s=_(i,!0),a=!1;return o&&"function"==typeof o&&(a=!0),{width:n,height:n,data:new Uint8Array(n*n*4),onAdd:function(t){this.map=t,(t=document.createElement("canvas")).width=this.width,t.height=this.height,this.context=t.getContext("2d")},render:function(){var t,e,u,l=this.context;return a?l=o({width:this.width,height:this.height,duration:r,color:i,context:l}):(t=performance.now()%r/r,e=n/2*.2,u=n/2*t,l.clearRect(0,0,this.width,this.height),l.beginPath(),l.arc(this.width/2,this.height/2,u,0,2*Math.PI),l.strokeStyle="rgba("+s[0]+","+s[1]+","+s[2]+","+(1-t+.1)+")",l.lineWidth=2,l.stroke(),l.fillStyle="rgba("+s[0]+","+s[1]+","+s[2]+","+(1-t)+")",l.fill(),l.beginPath(),l.arc(this.width/2,this.height/2,e,0,2*Math.PI),l.fillStyle="rgba("+s[0]+","+s[1]+","+s[2]+","+(1-t)+")",l.lineWidth=2+4*(1-t),l.fill()),this.data=l.getImageData(0,0,this.width,this.height).data,this.map.triggerRepaint(),!0}}},hexToRgba:()=>_,invertMask:()=>function(t,e){if(c(t)){var n=(e&&Array.isArray(e)&&"Polygon"===d(e)||(e=[[[-180,90],[180,90],[180,-90],[-180,-90],[-180,90]]]),t.features.filter((function(t){return"Polygon"===t.geometry.type||"MultiPolygon"===t.geometry.type})));if(0===n.length)return null;if(1===n)return{type:"FeatureCollection",features:n};for(var r=n[0],i=0;i<n.slice(1).length;i++)r=Qn(r,n[i+1]);return{type:"FeatureCollection",features:[$n(r,G(e))]}}},isClosedGraph:()=>y,isGeoJSON:()=>c,isNumber:()=>x,isValidNumber:()=>E,judgePointInPolygon:()=>tr,judgeSizeLngLat:()=>p,latFromMercatorY:()=>I,lngFromMercatorX:()=>b,mergeGeoJson:()=>function(){for(var t={type:"FeatureCollection",features:[]},e=[],n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];for(var o=0;o<r.length;o++)Array.isArray(r[o])?e.push.apply(e,r[o]):r[o]&&"object"==typeof r[o]&&e.push(r[o]);for(var s,a=0;a<e.length;a++){var u=e[a];c(u)&&(u=u.features,(s=t.features).push.apply(s,u))}return t},object2Geojson:()=>function(t,e,n){var r=l(t);if(r&&"Object"===u(r)&&(r=[r]),!Array.isArray(r))return null;t={type:"FeatureCollection"};for(var i=[],o=function(t){var o=r[t],s=function(t,e){if(e)if("string"==typeof e){var n=e.split(".").filter(Boolean);if(1!==n.length)return g(t,n);if(n=t[n[0]])return[f(n)]}else if(Array.isArray(e)){if(2===e.length)return[[t[e[0]],t[e[1]]].filter(Boolean)];if(3===e.length&&e[2])return g(t,n=e[2].split(".").filter(Boolean),[e[0],e[1]])}return[]}(o,e);0<s.length&&s.map((function(e){var s=d(e),a=!1;(a=!(!s||!("type"===s||0<e.length||"Feature"===s||"GeometryCollection"===s))||a)&&("GeometryCollection"===s?(null!=(a=e.geometries)?a:[]).forEach((function(e){var o={type:"Feature"};o.geometry=e,n&&n.key&&"string"==typeof n.key&&(n.alias&&"string"==typeof n.alias?o[n.alias]=r[t][n.key]:o[n.key]=r[t][n.key]),i.push(o)})):(a={type:"Feature"},"Feature"!==s?(a.properties=o,a.geometry="type"===s?e:{type:s,coordinates:e}):a=e,n&&n.key&&"string"==typeof n.key&&(n.alias&&"string"==typeof n.alias?a[n.alias]=r[t][n.key]:a[n.key]=r[t][n.key]),i.push(a)))}))},s=0;s<r.length;s++)o(s);return t.features=i,t},outOfChina:()=>Tt,parseValue:()=>N,performChunk:()=>function(t,e,n){var r,i,o=[];"number"==typeof t?o=new Array(t):Array.isArray(t)&&(o=t),0!==o.length&&"function"==typeof e&&(!(r="function"==typeof n?n:null)&&globalThis.requestIdleCallback&&(r=function(t){requestIdleCallback((function(e){t((function(){return 0<e.timeRemaining()}))}))}),i=0,function t(){i!==o.length&&r((function(n){for(var r=Date.now();n(Date.now()-r)&&i<o.length;){var s=o[i];e(s,i),i++}t()}))}())},pointNearOnLine:()=>function(t,e){return Array.isArray(t)&&Array.isArray(e)?(e=B(e),t=k(t),Un(e,t,{units:"miles"}).geometry.coordinates):null},polygonCenter:()=>function(t){var e;return c(t)?(e={type:"FeatureCollection",features:[]},t.features.filter((function(t){return"Polygon"===t.geometry.type||"MultiPolygon"===t.geometry.type})).forEach((function(t){a=et(n=t),a=Jn(a,(a[2]-a[0])/100,{units:"degrees"}),r=0,i=null,s=le(n),a.features.forEach((function(t){var e;Ot(t,n)&&(e="FeatureCollection"===s.type?Math.min.apply(Math,s.features.map((function(e){return Vn(t,e,{units:"degrees"})}))):Vn(t,s,{units:"degrees"}),r<e)&&(r=e,i=t)}));var n,r,i,s,a=(i||Zt(n)).geometry.coordinates;e.features.push({type:"Feature",geometry:{type:"Point",coordinates:a},properties:o({},t.properties)})})),e):null},resversalGeojson:()=>v,reversalGeojson:()=>function(t,e){return void 0===e&&(e=!0),v(t,e=!0)},reversalLngLat:()=>h,transformGeojson:()=>function(t,e){return c(t)&&"function"==typeof e?((t=l(t)).features.forEach((function(t){var n=t.geometry;t.geometry.coordinates=w(n.coordinates,e)})),t):null},transformLngLat:()=>w,wgs84ToGcj02:()=>function(t,e){var n,r,i,o,s;return Tt(t=+t,e=+e)?[t,e]:(n=Pt(t-105,e-35),r=Mt(t-105,e-35),i=e/180*Lt,o=Math.sin(i),o=1-Ct*o*o,s=Math.sqrt(o),n=180*n/(St*(1-Ct)/(o*s)*Lt),[t+(r=180*r/(St/s*Math.cos(i)*Lt)),e+n])}});var s=t(687),a=t.n(s),u=function(t){var e=typeof t;return"object"!=e?e:Object.prototype.toString.call(t).replace(/^\[object (\S+)\]$/,"$1")},l=function t(e){var n,r=u(e);if("Array"===r)n=[];else{if("Object"!==r)return e;n={}}if("Array"===r)for(var i=0,o=e.length;i<o;i++)n.push(t(e[i]));else if("Object"===r)for(var s in e)n[s]=t(e[s]);return n};function c(t){return"object"==typeof t&&null!==t&&"FeatureCollection"===t.type&&Array.isArray(t.features)}function h(t,e){return void 0===e&&(e=!0),t&&("string"==typeof t&&(t=JSON.parse(t)),Array.isArray(t))?x(t[0])?p(t,e):function t(e){for(var n=[],r=0;r<e.length;r++){var i=e[r];x(i[0])?n.push(p(i)):n.push(t(i))}return n}(t):[]}function p(t,e){void 0===e&&(e=!0);var n=Number(t[0]);return t=Number(t[1]),e&&n<t?[t,n]:[n,t]}function f(t){try{return"string"==typeof t?JSON.parse(t):t}catch(e){return t}}function g(t,e,n){var r=[],i=2===(n=void 0===n?[]:n).length;return function t(e,o){var s;e&&o.length&&(s=o.shift(),e.hasOwnProperty(s))&&(e=N(e[s]),Array.isArray(e)?0!==o.length||i?e.forEach((function(e){i?r.push([e[n[0]],e[n[1]]]):t(e,l(o))})):e&&(s=f(e),r.push(s)):"object"==typeof e?0===o.length?r.push(i?[e[n[0]],e[n[1]]]:e):t(e,o):0===o.length&&e&&(s=f(e),r.push(s)))}(t,e),r}function d(t){if(Array.isArray(t)){var e=m(t=t.filter(Boolean));if(0!==e)switch(e){case 1:return"Point";case 2:return"LineString";case 3:return y(t.map((function(t){return[t[0],t[t.length-1]]})))?"Polygon":"MultiLineString";case 4:return"MultiPolygon";default:return null}}else if(t&&"object"==typeof t){if(["Point","LineString","Polygon","MultiLineString","MultiPolygon"].includes(t.type))return"type";if("Feature"===t.type)return"Feature";if("GeometryCollection"===t.type)return"GeometryCollection"}return null}function y(t){if(0===t.length)return!1;function e(t,e,n){return void 0===n&&(n=1e-9),Math.abs(t[0]-e[0])<n&&Math.abs(t[1]-e[1])<n}for(var n=0;n<t.length-1;n++)if(!e(t[n][1],t[n+1][0]))return!1;return e(t[0][0],t[t.length-1][1])}function m(t){return Array.isArray(t)?Array.isArray(t[0])?1+m(t[0]):1:0}function _(t,e){void 0===e&&(e=!1);var n,r,i=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,n,r){return e+e+n+n+r+r}));return(i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(i))?(n=parseInt(i[1],16),r=parseInt(i[2],16),i=parseInt(i[3],16),e?[n,r,i,1]:"rgba("+n+","+r+","+i+",1)"):t}function v(t,e){if(void 0===e&&(e=!0),c(t)){for(var n={type:"FeatureCollection",features:[]},r=t.features,i=0;i<r.length;i++){var s,a=r[i],u={};for(s in a)"geometry"!==s&&"properties"!==s&&"type"!==s&&(u[s]=a[s]);var l=a.geometry.coordinates,f=a.geometry.type,g={type:f,coordinates:null};g.coordinates=("Point"===f?p:h)(l,e),n.features.push(o({type:"Feature",geometry:g,properties:a.properties},u))}return n}return null}function x(t){return"number"==typeof t||!("string"!=typeof t||!t||t.includes(" ")||isNaN(Number(t)))}function E(t){return isFinite(t)&&!isNaN(t)}function b(t){return 360*t-180}function I(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}function w(t,e){return t&&"function"==typeof e&&("string"==typeof t&&(t=JSON.parse(t)),Array.isArray(t))?x(t[0])?e(t):function t(e,n){for(var r=[],i=0;i<e.length;i++){var o=e[i];x(o[0])?r.push(n(o)):r.push(t(o,n))}return r}(t,e):[]}function N(t){try{return"string"==typeof t?JSON.parse(t):t}catch(e){return t}}function L(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))}var S=["customName"],C=function(){function t(t,e,r){var s=this,u=(this._mouseEnter=function(){var t=n(a().mark((function t(e){var n,r,i,o,u,l,c,h,p,f;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("Map"!==e.originalEvent.target.ariaLabel)return t.abrupt("return");t.next=2;break;case 2:if(r=e.point,i=e.lngLat,o=s.map.queryRenderedFeatures(r),c=null!=(c=o[0])?c:{},u=c.properties,l=c.geometry,c.source,c=c.layer,s.layerName.includes(c.id)){t.next=8;break}return null!=(c=s.popup)&&c.remove(),t.abrupt("return");case 8:if(s._mouseEnterProcessed)return t.abrupt("return");t.next=10;break;case 10:if(s._mouseEnterProcessed=!0,c=l.coordinates,h=[i.lng,i.lat],"mouseenter"===s.mouseType&&(h=s._getPosition(c)),!(0<(null==(n=h)?void 0:n.length))){t.next=20;break}for(f in p={},u)if("string"==typeof u[f]&&isNaN(Number(u[f])))try{p[f]=JSON.parse(u[f])}catch(t){p[f]=u[f]}else p[f]=u[f];return t.next=19,s._setHTML(p,h,i,l,r,o);case 19:s._mouseInOut&&"function"==typeof s._mouseInOut&&s._mouseInOut(!0,o,e);case 20:setTimeout((function(){s._mouseEnterProcessed=!1}),0);case 21:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this._mouseLeave=function(t){var e;s._mouseLeaveProcessed||(s._mouseLeaveProcessed=!0,s.popup.remove(),e=t.point,t.lngLat,e=s.map.queryRenderedFeatures(e),s._mouseInOut&&"function"==typeof s._mouseInOut&&s._mouseInOut(!0,e,t),setTimeout((function(){s._mouseLeaveProcessed=!1}),0))},this.map=t,"string"==typeof e?this.layerName=[e]:Array.isArray(e)&&(this.layerName=e),t=null!=(e=t.tooltipClass)?e:"commonTooltip",void 0!==(u=(e=null!=r?r:{}).customName)&&u);e=i(e,S),u=u?"":t+" ",this.className=u,null!=r&&r.className&&(u+=r.className),u=u.split(" ").filter(Boolean).join(" "),this.fullName=u,this.allMove=null!=(t=null==r?void 0:r.allMove)&&t,this.popup=new mapboxgl.Popup(o({},e,{className:u,closeButton:null!=(t=null==r?void 0:r.closeButton)&&t,closeOnClick:null!=(e=null==r?void 0:r.closeOnClick)&&e,anchor:null!=(u=null==r?void 0:r.anchor)?u:"left",type:"tooltip"}))}var e=t.prototype;return e.show=function(t,e){var n=this;"function"==typeof(this.htmlCallBack=t)&&(this.mouseType="mouseenter","move"===e&&(this.mouseType="mousemove"),0<(null==(t=this.layerName)?void 0:t.length))&&this.layerName.forEach((function(t){n.map.on(n.allMove?"mousemove":n.mouseType,t,n._mouseEnter).on("mouseleave",t,n._mouseLeave)}))},e.setClassName=function(t,e){var n=this;void 0===e&&(e=!1),this.popup&&"string"==typeof t&&t!==this.oldClassName&&(Array.from(this.popup._classList).map((function(t){t&&t.replaceAll(" ","")&&n.popup.addClassName(t)})),(e?this.fullName+" "+t:this.className+" "+t).split(" ").filter(Boolean).map((function(t){n.popup.addClassName(t)})),this.oldClassName=t)},e.destroy=function(){var t,e=this;null!=(t=this.popup)&&t.remove(),null!=(t=this.layerName)&&t.forEach((function(t){e.map.off(e.allMove?"mousemove":e.mouseType,t,e._mouseEnter).off("mouseleave",t,e._mouseLeave)}))},e._setHTML=function(){var t=n(a().mark((function t(e,n,r,i,o,s){var u,l,c=this;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.htmlCallBack(e,n,{lngLat:r,geometry:i,point:o,features:s,feature:s[0]});case 2:u=t.sent,l=function(t){c.popup.setLngLat(n).setHTML(t).addTo(c.map)},"object"==typeof u?u.hasOwnProperty("nodeType")?l(u):u.hasOwnProperty("show")&&"boolean"==typeof u.show?u.show&&l(u.data):l(""):"string"!=typeof u&&"number"!=typeof u||l(u);case 5:case"end":return t.stop()}}),t,this)})));return function(e,n,r,i,o,s){return t.apply(this,arguments)}}(),e.mouseInOut=function(t){t&&"function"==typeof t&&(this._mouseInOut=t)},e.showPosition=function(t,e){var n=this,r=this.map.project(t),i=this.map.queryRenderedFeatures(r),o=null!=(o=i.filter((function(t){return n.layerName.includes(t.layer.id)}))[0])?o:{},s=void 0===(a=o.properties)?{}:a,a=o.geometry;if(o=o.layer,this.layerName.includes((void 0===o?{}:o).id)){o=void 0===(o=(null!=a?a:{}).coordinates)?[]:o;var u=Array.isArray(t)?t:[t.lng,t.lat];if(0<(null==(o=u="mouseenter"===this.mouseType?this._getPosition(o):u)?void 0:o.length)){var l,c={};for(l in s)if("string"==typeof s[l]&&isNaN(Number(s[l])))try{c[l]=JSON.parse(s[l])}catch(t){c[l]=s[l]}else c[l]=s[l];o=e&&"object"==typeof e?e:c,this._setHTML(o,u,t,a,r,i)}}else null!=(e=this.popup)&&e.remove()},e._getPosition=function(t){return function t(e){return Array.isArray(e[0])?t(e[0]):e}(t)},t}(),P=["destroyComponent","customClick","popupClose","closeOther","noCloseLayerName","customName","offset","closeClick"],M=function(){function t(t,e,r){var s=this,u=(this._closeOtherPopup=function(){var t;s.closeOther&&null!=(t=s.map)&&null!=(t=t._popups)&&t.forEach((function(t){var e;"popup"===t.options.type&&(Array.isArray(s.noCloseLayerName)&&0<s.noCloseLayerName.length?(e=t.options.sourceName.join("|"),new RegExp(e).test(s.noCloseLayerName)&&null!=t&&null!=(e=t._onClose)&&e.call(t)):null!=t&&null!=(e=t._onClose)&&e.call(t))}))},this._click=function(){var t=n(a().mark((function t(e){var n,r,i,o,u,l,c,h,p,f,g,d,y,m;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("Map"!==e.originalEvent.target.ariaLabel)return t.abrupt("return");t.next=2;break;case 2:if(s._closeOtherPopup(),n=e.point,r=e.lngLat,i=s.map.queryRenderedFeatures(n),c=null!=(c=i[0])?c:{},o=c.properties,u=c.geometry,c.source,c=c.layer,s.layerName.includes(c.id)){t.next=8;break}return t.abrupt("return");case 8:if(s.customClick){t.next=30;break}for(p in h={},o)if("string"==typeof o[p]&&isNaN(Number(o[p])))try{h[p]=JSON.parse(o[p])}catch(t){h[p]=o[p]}else h[p]=o[p];return f=u.coordinates,g=u.type,t.next=14,null==(c=s.componentCallBack)?void 0:c.call(s,{properties:h,lngLat:r,coordinates:f,point:n,features:i,feature:i[0]});case 14:if(t.t1=l=t.sent,t.t0=null!==t.t1,!t.t0){t.next=18;break}t.t0=void 0!==l;case 18:t.t0?(t.t2=l,t.next=23):t.next=22;break;case 22:t.t2={};case 23:y=t.t2,d=y.component,y=y.instance,m=r,"Point"===g&&(m=f),s.vueInstance=y,d&&(s.popup.setOffset(s.offset),s.popup.setLngLat(m).setDOMContent(d).addTo(s.map));case 30:"function"!=typeof s.callBack||s._clickProcessed||(s._clickProcessed=!0,s.callBack({lngLat:r,properties:o,geometry:u,point:n}),setTimeout((function(){s._clickProcessed=!1}),0));case 31:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.map=t,this.popup=null,"string"==typeof e?this.layerName=[e]:Array.isArray(e)&&(this.layerName=e),void 0!==(l=(e=r||{}).destroyComponent)&&l),l=void 0!==(l=e.customClick)&&l,c=void 0!==(c=e.popupClose)&&c,h=void 0===(h=e.closeOther)||h,p=void 0===(p=e.noCloseLayerName)?[]:p,f=void 0!==(f=e.customName)&&f,g=void 0===(g=e.offset)?[0,0]:g,d=e.closeClick;e=i(e,P),t=null!=(t=t.popupClass)?t:"commonPopup",f=f?"":t+" ",this.className=f,null!=r&&r.className&&(f+=r.className),f=f.split(" ").filter(Boolean).join(" "),this.fullName=f,this.noCloseLayerName=p,this.noCloseLayerName=[],this.customClick=l,this.popupCloseSign=c,this.closeOther=h,this.offset=g="number"==typeof g?[g,g]:g,this.vueInstance=null,this.closeCallback=null,this.customClick||(this.popup=new mapboxgl.Popup(o({},e,{offset:g,className:f,closeButton:null!=(t=null==e?void 0:e.closeButton)&&t,closeOnClick:null!=(r=null==e?void 0:e.closeOnClick)&&r,anchor:null!=(p=null==e?void 0:e.anchor)?p:"bottom",focusAfterOpen:null!=(l=null==e?void 0:e.focusAfterOpen)&&l,type:"popup",sourceName:this.layerName})),d&&"function"==typeof d&&(this.popup._closeClick=d),null!=(c=this.popup)&&c.on("close",(function(t){"function"==typeof s.closeCallback&&s.closeCallback(t),s.popupCloseSign&&null!=(t=s.vueInstance)&&t.popupClose&&"function"==typeof s.vueInstance.popupClose&&s.vueInstance.popupClose(),s.vueInstance&&u&&null!=(t=s.vueInstance)&&t.$destroy()})))}var e=t.prototype;return e.show=function(t,e){var n=this;this.componentCallBack=t,this.callBack=e,0<(null==(t=this.layerName)?void 0:t.length)&&this.layerName.forEach((function(t){n.map.on("click",t,n._click)}))},e.setClassName=function(t,e){var n=this;void 0===e&&(e=!1),this.popup&&"string"==typeof t&&t!==this.oldClassName&&(Array.from(this.popup._classList).map((function(t){n.popup.removeClassName(t)})),(e?this.fullName+" "+t:this.className+" "+t).split(" ").filter(Boolean).map((function(t){t&&t.replaceAll(" ","")&&n.popup.addClassName(t)})),this.oldClassName=t)},e.showPosition=function(t,e,n,r){t&&(this._closeOtherPopup(),(n=(null!=n?n:{}).offset)&&this.popup.setOffset(n),this.popup.setLngLat(t).setDOMContent(e).addTo(this.map),r)&&"function"==typeof r&&r()},e.close=function(){var t;null!=(t=this.popup)&&t._onClose()},e.closeBack=function(t){this.closeCallback=t},e.destroy=function(){var t,e=this;null!=(t=this.popup)&&t.remove(),null!=(t=this.layerName)&&t.forEach((function(t){e.map.off("click",t,e._click)}))},t}(),T=function(){function t(t,e,n){var r=this,i=(this.clickEvent=function(t){var e=new THREE.Vector2,n=r.map.getCanvas();e.x=(t.clientX-n.getBoundingClientRect().left)/n.offsetWidth*2-1,e.y=-(t.clientY-n.getBoundingClientRect().top)/n.offsetHeight*2+1,t=(new THREE.Matrix4).getInverse(r.camera.projectionMatrix),n=(new THREE.Vector3).applyMatrix4(t),e=new THREE.Vector3(e.x,e.y,1).applyMatrix4(t).clone().sub(n).normalize(),(t=new THREE.Raycaster).set(n,e),n=t.intersectObjects(r.scene.children,!0),r.callback&&0<n.length&&(e=n[0],t=r.findProperties(e.object),r.callback(t))},this.findProperties=function(t){var e={},n=null;return"Scene"!==t.type&&(n=(t.lngLat?(e=t.properties,t):(e=(t=r.findProperties(t.parent)).properties,t)).lngLat),{properties:e,lngLat:n}},this.id="3d-"+t,this.type="custom",this.renderingMode="3d","function"==typeof n&&(this.callback=n),t=e.lngLat,n=e.url,void 0===(i=e.scale)?1:i),o=void 0===(o=e.height)?0:o,s=void 0===(s=e.rotate)?[Math.PI/2,0,0]:s,a=void 0===(a=e.properties)?{}:a,u=void 0===(u=e.AmbientLight)?{show:!0,color:16777215,intensity:.5}:u,l=void 0===(l=e.DirectionalLight)?[]:l,c=void 0===(c=e.PointLight)?[]:c;e=void 0!==(e=e.click)&&e,this.lngLat=t,this.url=n,this.scale=i,this.height=o,this.rotate=s,this.properties=a,this.AmbientLight=u,this.DirectionalLight=l,this.PointLight=c,this.click=e,this.modelAsMercatorCoordinate=mapboxgl.MercatorCoordinate.fromLngLat(t,o),this.modelTransform={translateX:this.modelAsMercatorCoordinate.x,translateY:this.modelAsMercatorCoordinate.y,translateZ:this.modelAsMercatorCoordinate.z,rotateX:s[0],rotateY:s[1],rotateZ:s[2],scale:i*this.modelAsMercatorCoordinate.meterInMercatorCoordinateUnits()}}var e=t.prototype;return e.onAdd=function(t,e){var n,r,i=this;this.map=t,t=this.map.getCanvas(),this.camera=new THREE.PerspectiveCamera(50,t.innerWidth/t.innerHeight,.1,1e4),this.scene=new THREE.Scene,this.AmbientLight&&this.AmbientLight.show&&(r=this.AmbientLight.color||16777215,n=this.AmbientLight.intensity||.5,r=new THREE.AmbientLight(r,n),this.scene.add(r)),this.DirectionalLight&&Array.isArray(this.DirectionalLight)&&this.DirectionalLight.forEach((function(t){var e=t.color||16777215,n=t.intensity||1;t=t.position||[0,0,0],(e=new THREE.DirectionalLight(e,n)).position.set(t[0],t[1],t[2]).normalize(),i.scene.add(e)})),this.PointLight&&Array.isArray(this.PointLight)&&this.PointLight.forEach((function(t){var e=t.color||16777215,n=t.intensity||1,r=t.distance||0,o=t.decay||2;t=t.position||[0,0,0],(e=new THREE.PointLight(e,n,r,o)).position.set(t[0],t[1],t[2]).normalize(),i.scene.add(e)})),(new THREE.GLTFLoader).load(this.url,(function(t){for(var e=0;e<t.scene.children.length;e++)t.scene.children[e].properties=i.properties,t.scene.children[e].lngLat=i.lngLat;i.scene.add(t.scene)})),this.renderer=new THREE.WebGLRenderer({canvas:t,context:e,antialias:!0}),this.renderer.autoClear=!1,this.click&&this.renderer.domElement.addEventListener("click",this.clickEvent)},e.render=function(t,e){var n=(new THREE.Matrix4).makeRotationAxis(new THREE.Vector3(1,0,0),this.modelTransform.rotateX),r=(new THREE.Matrix4).makeRotationAxis(new THREE.Vector3(0,1,0),this.modelTransform.rotateY),i=(new THREE.Matrix4).makeRotationAxis(new THREE.Vector3(0,0,1),this.modelTransform.rotateZ),o=(new THREE.Matrix4).fromArray(e);n=(new THREE.Matrix4).makeTranslation(this.modelTransform.translateX,this.modelTransform.translateY,this.modelTransform.translateZ).scale(new THREE.Vector3(this.modelTransform.scale,-this.modelTransform.scale,this.modelTransform.scale)).multiply(n).multiply(r).multiply(i),this.camera.projectionMatrix.elements=e,this.camera.projectionMatrix=o.multiply(n),this.renderer.state.reset(),this.renderer.render(this.scene,this.camera),this.map.triggerRepaint()},e.onRemove=function(){this.click&&this.renderer.domElement.removeEventListener("click",this.clickEvent),this.renderer&&(this.renderer.dispose(),this.renderer=null),this.scene&&(this.scene.clear(),this.scene=null)},t}(),R=function(){function t(t){this.map=t,this.sourceName=[],this.sourceType="geojson"}var e=t.prototype;return e.draw=function(t,e,n){if(t&&this.map)return"vector"===t.type?(this.sourceName=[e],this.sourceType="vector",this._clearSource(),this._addSourceLayer(e,t,n),this.sourceName):"FeatureCollection"===t.type||Array.isArray(t.features)?(this.sourceName=[e],this._clearSource(),this._addSourceLayer(e,t,n),n.lineConfig?[].concat(this.sourceName,[this.lineName]):this.sourceName):void 0},e.destroy=function(){this._clearSource()},e.visible=function(t){var e,n=this;"boolean"==typeof t&&null!=(e=this.sourceName)&&e.forEach((function(e){n.map.getLayer(e)&&n.map.setLayoutProperty(e,"visibility",t?"visible":"none")}))},e._addSourceLayer=function(t,e,n){"vector"===this.sourceType?this.map.addSource(t,o({},e,n.sourceConfig)):this.map.addSource(t,o({type:"geojson",data:e},n.sourceConfig)),(e=n.beforeId||null)&&!this.map.getLayer(e)&&(e=null),this.map.addLayer(o({id:t,type:"line",source:t},n.layerConfig),e),n.lineConfig&&(this.lineName=t+"-highlight",this.map.addLayer(o({id:this.lineName,type:"line",source:t},n.lineConfig)))},e._clearSource=function(){var t,e=this;null!=(t=this.sourceName)&&t.forEach((function(t){var n;(null==(n=e.map)?void 0:n.getSource(t))&&(e.map.getLayer(t)&&e.map.removeLayer(t),e.lineName&&e.map.getLayer(t+"-highlight")&&e.map.removeLayer(t+"-highlight"),e.map.removeSource(t))}))},t}(),O=function(){function t(t){this.map=t,this.sourceName=[],this.type="symbol",this.sourceType="geojson"}var e=t.prototype;return e.draw=function(t,e,n){if(t&&this.map){if("vector"===t.type)return this.sourceType="vector",this._addSourceLayer(e,t,n),this.sourceName=[e],this.sourceName;var r;if("FeatureCollection"===t.type||Array.isArray(t.features)){this.type=null!=(r=n.type)?r:"symbol";var i=n.sliceNum;if(!i||i<1e3)this.sourceName=[e],this._clearSource(),this._addSourceLayer(e,t,n);else{this._clearSource();for(var o=0,s=0;s<t.features.length;s+=i){var a={type:"FeatureCollection",features:[]},u=t.features.slice(s,i);a.features=[].concat(u),u=e+"-"+o,this.sourceName.push(u),this._addSourceLayer(u,a,n),o++}}return this.sourceName}}},e.destroy=function(){this._clearSource()},e.visible=function(t){var e,n=this;"boolean"==typeof t&&null!=(e=this.sourceName)&&e.forEach((function(e){n.map.getLayer(e)&&n.map.setLayoutProperty(e,"visibility",t?"visible":"none")}))},e._clearSource=function(){var t,e=this;null!=(t=this.sourceName)&&t.forEach((function(t){var n;(null==(n=e.map)?void 0:n.getSource(t))&&(e.map.getLayer(t)&&e.map.removeLayer(t),e.map.removeSource(t))}))},e._addSourceLayer=function(t,e,n){"vector"===this.sourceType?this.map.addSource(t,o({},e,n.sourceConfig)):this.map.addSource(t,o({type:"geojson",data:e},n.sourceConfig)),(e=n.beforeId||null)&&!this.map.getLayer(e)&&(e=null),this.map.addLayer(o({id:t,type:this.type,source:t},n.layerConfig),e)},t}(),A=6371008.8,D={centimeters:100*A,centimetres:100*A,degrees:A/111325,feet:3.28084*A,inches:39.37*A,kilometers:A/1e3,kilometres:A/1e3,meters:A,metres:A,miles:A/1609.344,millimeters:1e3*A,millimetres:1e3*A,nauticalmiles:A/1852,radians:1,yards:1.0936*A};function F(t,e,n){var r={type:"Feature"};return 0!==(n=void 0===n?{}:n).id&&!n.id||(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=e||{},r.geometry=t,r}function k(t,e,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(H(t[0])&&H(t[1]))return F({type:"Point",coordinates:t},e,n);throw new Error("coordinates must contain numbers")}function G(t,e,n){void 0===n&&(n={});for(var r=0,i=t;r<i.length;r++){var o=i[r];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<o[o.length-1].length;s++)if(o[o.length-1][s]!==o[0][s])throw new Error("First and last Position are not equivalent.")}return F({type:"Polygon",coordinates:t},e,n)}function B(t,e,n){if(void 0===n&&(n={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");return F({type:"LineString",coordinates:t},e,n)}function U(t,e){var n={type:"FeatureCollection"};return(e=void 0===e?{}:e).id&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.features=t,n}function q(t,e,n){return F({type:"MultiPolygon",coordinates:t},e,n=void 0===n?{}:n)}function z(t,e){var n=D[e=void 0===e?"kilometers":e];if(n)return t*n;throw new Error(e+" units is invalid")}function j(t,e){var n=D[e=void 0===e?"kilometers":e];if(n)return t/n;throw new Error(e+" units is invalid")}function V(t){return t%(2*Math.PI)*180/Math.PI}function X(t){return t%360*Math.PI/180}function Y(t,e,n){if(void 0===e&&(e="kilometers"),void 0===n&&(n="kilometers"),0<=t)return z(j(t,e),n);throw new Error("length must be a positive number")}function H(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function W(t){return t&&t.constructor===Object}function J(t,e,n){if(null!==t)for(var r,i,o,s=0,a=t.type,u="FeatureCollection"===a,l="Feature"===a,c=u?t.features.length:1,h=0;h<c;h++)for(var p,f,g=(f=!!(p=u?t.features[h].geometry:l?t.geometry:t)&&"GeometryCollection"===p.type)?p.geometries.length:1,d=0;d<g;d++){var y=0,m=0,_=f?p.geometries[d]:p;if(null!==_){var v=_.coordinates,x=_.type,E=!n||"Polygon"!==x&&"MultiPolygon"!==x?0:1;switch(x){case null:break;case"Point":if(!1===e(v,s,h,y,m))return!1;s++,y++;break;case"LineString":case"MultiPoint":for(r=0;r<v.length;r++){if(!1===e(v[r],s,h,y,m))return!1;s++,"MultiPoint"===x&&y++}"LineString"===x&&y++;break;case"Polygon":case"MultiLineString":for(r=0;r<v.length;r++){for(i=0;i<v[r].length-E;i++){if(!1===e(v[r][i],s,h,y,m))return!1;s++}"MultiLineString"===x&&y++,"Polygon"===x&&m++}"Polygon"===x&&y++;break;case"MultiPolygon":for(r=0;r<v.length;r++){for(i=m=0;i<v[r].length;i++){for(o=0;o<v[r][i].length-E;o++){if(!1===e(v[r][i][o],s,h,y,m))return!1;s++}m++}y++}break;case"GeometryCollection":for(r=0;r<_.geometries.length;r++)if(!1===J(_.geometries[r],e,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}function K(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var n=0;n<t.features.length&&!1!==e(t.features[n],n);n++);}function Z(t,e){for(var n,r,i,o,s,a,u,l,c,h=0,p="FeatureCollection"===t.type,f="Feature"===t.type,g=p?t.features.length:1,d=0;d<g;d++){for(s=p?t.features[d].geometry:f?t.geometry:t,u=p?t.features[d].properties:f?t.properties:{},l=p?t.features[d].bbox:f?t.bbox:void 0,c=p?t.features[d].id:f?t.id:void 0,o=(a=!!s&&"GeometryCollection"===s.type)?s.geometries.length:1,r=0;r<o;r++)if(null===(i=a?s.geometries[r]:s)){if(!1===e(null,h,u,l,c))return}else switch(i.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===e(i,h,u,l,c))return;break;case"GeometryCollection":for(n=0;n<i.geometries.length;n++)if(!1===e(i.geometries[n],h,u,l,c))return;break;default:throw new Error("Unknown Geometry Type")}h++}}function $(t,e){Z(t,(function(t,n,r,i,o){var s,a=null===t?null:t.type;switch(a){case null:case"Point":case"LineString":case"Polygon":return!1!==e(F(t,r,{bbox:i,id:o}),n,0)&&void 0}switch(a){case"MultiPoint":s="Point";break;case"MultiLineString":s="LineString";break;case"MultiPolygon":s="Polygon"}for(var u=0;u<t.coordinates.length;u++){var l=t.coordinates[u];if(!1===e(F({type:s,coordinates:l},r),n,u))return!1}}))}function Q(t,e){$(t,(function(t,n,r){var i=0;if(t.geometry){var o,s,a,u,l=t.geometry.type;if("Point"!==l&&"MultiPoint"!==l)return u=a=s=0,!1!==J(t,(function(l,c,h,p,f){if(void 0===o||s<n||a<p||u<f)o=l,s=n,a=p,u=f,i=0;else{if(p=B([o,l],t.properties),!1===e(p,n,r,f,i))return!1;i++,o=l}}))&&void 0}}))}function tt(t){var e=[1/0,1/0,-1/0,-1/0];return J(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 et=tt.default=tt;function nt(t,e){void 0===e&&(e={});var n=Number(t[0]),r=Number(t[1]),i=Number(t[2]),o=Number(t[3]);if(6===t.length)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var s=[n,r];return G([[s,[i,r],[i,o],[n,o],s]],e.properties,{bbox:t,id:e.id})}const rt=function(t){return nt(et(t))};function it(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)&&2<=t.length&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function ot(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 st(t,e,n){if(!t)throw new Error("No feature passed");if(!n)throw new Error(".featureOf() requires a name");if(!t||"Feature"!==t.type||!t.geometry)throw new Error("Invalid input to "+n+", Feature with geometry required");if(!t.geometry||t.geometry.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.geometry.type)}function at(t){return"Feature"===t.type?t.geometry:t}function ut(t,e,n,r){void 0===r&&(r={});var i=X((t=it(t))[0]),o=(t=X(t[1]),n=X(n),e=j(e,r.units),Math.asin(Math.sin(t)*Math.cos(e)+Math.cos(t)*Math.sin(e)*Math.cos(n)));return k([V(i+Math.atan2(Math.sin(n)*Math.sin(e)*Math.cos(t),Math.cos(e)-Math.sin(t)*Math.sin(o))),V(o)],r.properties)}const lt=function(t,e,n){for(var r=(n=void 0===n?{}:n).steps||64,i=n.properties||(!Array.isArray(t)&&"Feature"===t.type&&t.properties?t.properties:{}),o=[],s=0;s<r;s++)o.push(ut(t,e,-360*s/r,n).geometry.coordinates);return o.push(o[0]),G([o],i)};var ct=function(){function t(t){this.map=t,this.sourceName=[],this.lineName=""}var e=t.prototype;return e.draw=function(t,e,n){if(t){this.sourceName=[e];var r,i=null!=n?n:{},o=void 0===(r=i.radius)?0:r,s=void 0===(r=i.steps)?64:r,a=i.endRadius,u=[];if("object"==typeof t){if("FeatureCollection"!==t.type&&!Array.isArray(t.features))return;for(var l=t.features,c=0;c<l.length;c++){var h,p,f,g,d,y=l[c].geometry.coordinates;"number"==typeof y[0]&&"number"==typeof y[1]&&(y[0]<y[1]&&(h=[y[1],y[0]],y[0]=h[0],y[1]=h[1]),h=!1,p=0<(p=(h="string"==typeof o||h)?l[c].properties[o]:o)?p:0,f={steps:s,units:"kilometers",properties:l[c].properties},g=lt(y,p,f),a?(d=!1,d=0<(d=(d="string"==typeof a||d)?l[c].properties[a]:a)?d:0,y=lt(y,a,f),u.push(p===d?g:p<d?this._getRingJson(y.geometry.coordinates[0],g.geometry.coordinates[0],g.properties):this._getRingJson(g.geometry.coordinates[0],y.geometry.coordinates[0],g.properties))):u.push(g))}}return this._addSourceLayer(e,{type:"FeatureCollection",features:u},n),n.lineConfig?[].concat(this.sourceName,[this.lineName]):this.sourceName}},e._getRingJson=function(t,e,n){return{type:"Feature",geometry:{coordinates:[t,e],type:"Polygon"},properties:n}},e._addSourceLayer=function(t,e,n){this.lineName=t+"-line",n.lineConfig&&null!=(r=this.map)&&r.getLayer(this.lineName)&&this.map.removeLayer(this.lineName),null!=(r=this.map)&&r.getLayer(t)&&this.map.removeLayer(t),null!=(r=this.map)&&r.getSource(t)&&this.map.removeSource(t),this.map.addSource(t,o({type:"geojson",data:e},n.sourceConfig));var r=(null!=n?n:{}).beforeId;r&&!this.map.getLayer(r)&&(r=null),this.map.addLayer(o({id:t,type:"fill",source:t},n.layerConfig),r),n.lineConfig&&this.map.addLayer(o({id:this.lineName,type:"line",source:t},n.lineConfig),r)},e.destroy=function(){this._clearSource()},e.visible=function(t){var e,n=this;"boolean"==typeof t&&(null!=(e=this.sourceName)&&e.forEach((function(e){n.map.getLayer(e)&&n.map.setLayoutProperty(e,"visibility",t?"visible":"none")})),this.lineName)&&this.map.getLayer(this.lineName)&&this.map.setLayoutProperty(this.lineName,"visibility",t?"visible":"none")},e._clearSource=function(){var t,e=this;null!=(t=this.sourceName)&&t.forEach((function(t){e.map.getSource(t)&&(e.map.getLayer(t)&&e.map.removeLayer(t),e.lineName&&e.map.getLayer(t+"-line")&&e.map.removeLayer(t+"-line"),e.map.removeSource(t))}))},t}(),ht=function(){function t(t,e){this.map=t,this.name=[],"string"==typeof e?this.name=[e]:Array.isArray(e)&&e.every((function(t){return"string"==typeof t}))&&(this.name=e),this.event=[]}var e=t.prototype;return e.add=function(t){var e,n=this;if(0===(null==(e=this.event)?void 0:e.length)&&t&&"object"==typeof t){var r,i=function(e){var r,i;n.event.push(e),0<(null==(i=n.name)?void 0:i.length)?null!=(i=n.name)&&i.forEach((function(r){function i(n){var r;"Map"===(null==n||null==(r=n.originalEvent)||null==(r=r.target)?void 0:r.ariaLabel)&&t[e](n)}var o;n[e]=i,null!=(o=n.map)&&o.on(e,r,i)})):(n[e]=i=function(n){var r;"Map"===(null==n||null==(r=n.originalEvent)||null==(r=r.target)?void 0:r.ariaLabel)&&t[e](n)},null!=(r=n.map)&&r.on(e,i))};for(r in t)i(r)}},e.destroy=function(t){var e,n=this;t&&Array.isArray(t)&&t.every((function(t){return"string"==typeof t}))?null!=(e=this.name)&&e.forEach((function(e){t.forEach((function(t){var r,i;n.event.includes(t)&&(i=n[t],null!=(r=n.map))&&r.off(t,e,i)}))})):0<(null==(e=this.name)?void 0:e.length)?null!=(e=this.name)&&e.forEach((function(t){n.event.forEach((function(e){var r,i=n[e];null!=(r=n.map)&&r.off(e,t,i)}))})):this.event.forEach((function(t){var e,r=n[t];null!=(e=n.map)&&e.off(t,r)}))},t}(),pt=["id","type"],ft=["id","type","beforeId"],gt=function(){function t(t){this.map=t,this.sourceName=[]}var e=t.prototype;return e.draw=function(t,e){var n,r,s,a,u,l=this;return c(t)||"vector"===t.type?(n=(s=null!=(s=e.sourceConfig)?s:{}).id,r=void 0===(r=s.type)?"geojson":r,s=i(s,pt),a=n,e=null!=(e=e.layerConfig)?e:{},u=[],Array.isArray(e)?u=e:"object"==typeof e&&u.push(e),u.forEach((function(t){var e;(t=t.id)&&null!=(e=l.map)&&e.getLayer(t)&&l.map.removeLayer(t)})),null!=(e=this.map)&&e.getSource(a)&&this.map.removeSource(a),"vector"===t.type?this.map.addSource(n,o({},s,t)):this.map.addSource(n,o({type:r,data:t},s)),u.forEach((function(t){var e=t.id,n=t.type,r=t.beforeId;t=i(t,ft),r&&!l.map.getLayer(r)&&(r=null),l.map.addLayer(o({id:e,type:n,source:a},t),r)})),this.sourceName=[a].concat(u.map((function(t){return t.id}))).filter(Boolean),this.sourceName=Array.from(new Set(this.sourceName)),this.sourceName):[]},e.destroy=function(){var t,e,n=this;0<(null==(e=this.sourceName)?void 0:e.length)&&(1===this.sourceName.length?this.map.getSource(this.sourceName[0])&&(this.map.removeLayer(this.sourceName[0]),this.map.removeSource(this.sourceName[0])):(t=(e=this.sourceName)[0],e=e.slice(1),this.map.getSource(t)&&(this.map.getLayer(t)&&this.map.removeLayer(t),e.forEach((function(t){n.map.removeLayer(t)})),this.map.removeSource(t))))},e.visible=function(t){var e,n=this;"boolean"==typeof t&&null!=(e=this.sourceName)&&e.forEach((function(e){n.map.getLayer(e)&&n.map.setLayoutProperty(e,"visibility",t?"visible":"none")}))},t}();function dt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var yt,mt=function(){function t(t,e){this.map=t,this.markers=[],this.options=e,this.properties=[]}var e=t.prototype;return e.draw=function(t,e){if(c(t))for(var n,r=null!=(n=this.options)?n:{},i=0,s=function(t,e){var n,r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=function(t,e){var n;if(t)return"string"==typeof t?dt(t,e):"Map"===(n="Object"===(n=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?dt(t,e):void 0}(t)))return r&&(t=r),n=0,function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(t.features);!(l=s()).done;){var a,u,l=l.value;"Point"===l.geometry.type&&(a=r,e&&"function"==typeof e&&1===(null==(u=e({lngLat:l.geometry.coordinates,properties:l.properties,index:i}))?void 0:u.nodeType)&&(a=o({},a,{element:u})),u=new mapboxgl.Marker(a).setLngLat(l.geometry.coordinates).addTo(this.map),this.markers.push(u),this.properties.push(l.properties),i++)}},e.addEvent=function(t){var e=this;if(t&&"object"==typeof t)for(var n=0;n<this.markers.length;n++)!function(n){["dragstart","drag","dragend"].forEach((function(r){t[r]&&"function"==typeof t[r]&&e.markers[n].on(r,(function(i){t[r](o({},i,{properties:e.properties[n]}))}))}))}(n)},e.destroy=function(){for(var t=0;t<this.markers.length;t++)this.markers[t].remove();this.markers=[]},e.visible=function(t){var e;"boolean"==typeof t&&null!=(e=this.markers)&&e.forEach((function(e){e.getElement().style.display=t?"block":"none"}))},t}(),_t=function(){function t(t,e,n){var r;n=null!=(r=n)?r:{},this.map=t,this.name=e,this.dash=Array.isArray(n.dash)?n.dash:[[0,4,3],[.5,4,2.5],[1,4,2],[1.5,4,1.5],[2,4,1],[2.5,4,.5],[3,4,0],[0,.5,3,3.5],[0,1,3,3],[0,1.5,3,2.5],[0,2,3,2],[0,2.5,3,1.5],[0,3,3,1],[0,3.5,3,.5]],this.step=null!=(r=n.step)?r:50,this.animateId=null}var e=t.prototype;return e.animate=function(){var t,e=this;this.name&&this.map.getLayer(this.name)&&function n(r){(r=parseInt(r/e.step%e.dash.length))!==t&&(e.map.setPaintProperty(e.name,"line-dasharray",e.dash[t]),t=r),e.animateId=requestAnimationFrame(n)}(t=0)},e.destroy=function(){this.animateId&&(cancelAnimationFrame(this.animateId),this.animateId=null)},t}(),vt=(s={},function(){function t(t,e){this.width=void 0,this.height=void 0,this.data=void 0;var n=this,r=t.width;if(t=t.height,e){if(e instanceof Uint8ClampedArray)e=new Uint8Array(e.buffer);else if(e.length!==r*t*4)throw new RangeError("mismatched image size")}else e=new Uint8Array(r*t*4);n.width=r,n.height=t,n.data=e}var e=t.prototype;return e.resize=function(e){var n,r,i;n=this,r=(e=new t(e)).width,i=e.height,r===n.width&&i===n.height||(xt(n,e,{x:0,y:0},{x:0,y:0},{width:Math.min(n.width,r),height:Math.min(n.height,i)},4),n.width=r,n.height=i,n.data=e.data)},e.replace=function(t,e){e?this.data.set(t):t instanceof Uint8ClampedArray?this.data=new Uint8Array(t.buffer):this.data=t},e.clone=function(){return new t({width:this.width,height:this.height},new Uint8Array(this.data))},t.copy=function(t,e,n,r,i){xt(t,e,n,r,i,4)},t}());function xt(t,e,n,r,i,o){if(0!==i.width&&0!==i.height){if(i.width>t.width||i.height>t.height||n.x>t.width-i.width||n.y>t.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>e.width||i.height>e.height||r.x>e.width-i.width||r.y>e.height-i.height)throw new RangeError("out of range destination coordinates for image copy");var s=t.data,a=e.data;if(s===a)throw new RangeError("image is the same");for(var u=0;u<i.height;u++)for(var l=((n.y+u)*t.width+n.x)*o,c=((r.y+u)*e.width+r.x)*o,h=0;h<i.width*o;h++)a[c+h]=s[l+h]}}function Et(){return(Et=n(a().mark((function t(e,n){var r;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return void 0===n&&(n=0),t.next=3,new Promise((function(t){var r=new Image;r.src=e,r.crossOrigin="Anonymous",r.onload=function(){var e=r.width,i=r.height,o=(yt=yt||window.document.createElement("canvas")).getContext("2d",{willReadFrequently:!0});if(!o)throw new Error("failed to create canvas 2d context");(e>yt.width||i>yt.height)&&(yt.width=e,yt.height=i),o.clearRect(-n,-n,e+2*n,i+2*n),o.drawImage(r,0,0,e,i),t(o.getImageData(-n,-n,e+2*n,i+2*n))}}));case 3:return r=t.sent,t.abrupt("return",r);case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function bt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}Rn=vt,void 0===fr&&(fr={}),(sn="RGBAImage")?s[sn]?console.error(sn+" is already registered."):(Object.defineProperty(Rn,"_classRegistryKey",{value:sn,writeable:!1}),s[sn]={klass:Rn,omit:fr.omit||[]}):console.error("Can't register a class without a name.");var It=function(){function t(t,e){this.map=t,this.options=null!=e?e:{key:"id"},this.markers={},this.mapEvent=null}var e=t.prototype;return e.draw=function(t,e){var n=this,r={};this.mapEvent=function(){if(n.map.getSource(t)&&n.map.isSourceLoaded(t)){for(var i,s={},a=function(t,e){var n,r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=function(t,e){var n;if(t)return"string"==typeof t?bt(t,e):"Map"===(n="Object"===(n=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?bt(t,e):void 0}(t)))return r&&(t=r),n=0,function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(n.map.querySourceFeatures(t));!(h=a()).done;){var u,l,c,h,p=(h=h.value).geometry.coordinates;(h=h.properties).cluster||(u=h[n.options.key],(c=n.markers[u])?(l=c.getLngLat().toArray())[0]===p[0]&&l[1]===p[1]||c.setLngLat(p):(l=null,l="function"==typeof e?e({properties:h,lngLat:p}):document.createElement("div"),c=n.markers[u]=new mapboxgl.Marker(o({},n.options,{element:l})).setLngLat(p)),s[u]=c,r[u])||c.addTo(n.map)}for(i in r)s[i]||r[i].remove();r=s}},this.map.on("render",this.mapEvent)},e.destroy=function(){for(var t in this.markers)null!=(t=this.markers[t])&&t.remove();this.markers={},this.mapEvent&&this.map.off("render",this.mapEvent)},e.visible=function(t){if("boolean"==typeof t)for(var e in this.markers)this.markers[e]&&this.markers.hasOwnProperty(e)&&(this.markers[e].getElement().style.display=t?"block":"none")},t}(),wt=["once"],Nt=function(){function t(t,e,n){this.map=t,this.options=null!=n?n:{},this.sourceName=e,n=void 0===(e=(t=(this.mapEvent=null)!=n?n:{}).once)||e,e=i(t,wt),this.once=n,this.other=e}var e=t.prototype;return e.open=function(t){var e=this;this.sourceName&&(this.mapEvent=function(){var n;e.map.getSource(e.sourceName)&&e.map.isSourceLoaded(e.sourceName)&&"function"==typeof t&&(n=e.map.querySourceFeatures(e.sourceName,e.other),t(n),e.once)&&e.destroy()},this.map.on("render",this.mapEvent))},e.destroy=function(){var t;null!=(t=this.map)&&t.off("render",this.mapEvent),this.mapEvent=null},t}(),Lt=Math.PI,St=6378245,Ct=.006693421622965943;function Pt(t,e){var n=2*(t=+t)-100+3*(e=+e)+.2*e*e+.1*t*e+.2*Math.sqrt(Math.abs(t));return(n+=2*(20*Math.sin(6*t*Lt)+20*Math.sin(2*t*Lt))/3)+2*(20*Math.sin(e*Lt)+40*Math.sin(e/3*Lt))/3+2*(160*Math.sin(e/12*Lt)+320*Math.sin(e*Lt/30))/3}function Mt(t,e){return e=300+(t=+t)+2*(e=+e)+.1*t*t+.1*t*e+.1*Math.sqrt(Math.abs(t)),(e+=2*(20*Math.sin(6*t*Lt)+20*Math.sin(2*t*Lt))/3)+2*(20*Math.sin(t*Lt)+40*Math.sin(t/3*Lt))/3+2*(150*Math.sin(t/12*Lt)+300*Math.sin(t/30*Lt))/3}function Tt(t,e){return e=+e,!(73.66<(t=+t)&&t<135.05&&3.86<e&&e<53.55)}function Rt(t,e){var n,r,i,o,s;return Tt(t,e)?[t,e]:(o=Pt(t-105,e-35),s=Mt(t-105,e-35),n=e/180*Lt,r=Math.sin(n),r=1-Ct*r*r,i=Math.sqrt(r),o=180*o/(St*(1-Ct)/(r*i)*Lt),[2*t-(t+(s=180*s/(St/i*Math.cos(n)*Lt))),2*e-(e+o)])}function Ot(t,e,n){if(void 0===n&&(n={}),!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var r=it(t),i=(t=at(e)).type,o=(e=e.bbox,t.coordinates);if(e&&0==(t=r,e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]))return!1;"Polygon"===i&&(o=[o]);for(var s=!1,a=0;a<o.length&&!s;a++)if(At(r,o[a][0],n.ignoreBoundary)){for(var u=!1,l=1;l<o[a].length&&!u;)At(r,o[a][l],!n.ignoreBoundary)&&(u=!0),l++;u||(s=!0)}return s}function At(t,e,n){for(var r=!1,i=0,o=(e=e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]?e.slice(0,e.length-1):e).length-1;i<e.length;o=i++){var s=e[i][0],a=e[i][1],u=e[o][0],l=e[o][1];if(t[1]*(s-u)+a*(u-t[0])+l*(t[0]-s)==0&&(s-t[0])*(u-t[0])<=0&&(a-t[1])*(l-t[1])<=0)return!n;a>t[1]!=l>t[1]&&t[0]<(u-s)*(t[1]-a)/(l-a)+s&&(r=!r)}return r}function Dt(t,e){var n,r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=function(t,e){var n;if(t)return"string"==typeof t?Ft(t,e):"Map"===(n="Object"===(n=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ft(t,e):void 0}(t))||e&&t&&"number"==typeof t.length)return r&&(t=r),n=0,function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ft(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var kt=function(){function t(t,e){this.map=t,this.options=null!=e?e:{}}var e=t.prototype;return e.draw=function(t,e,n,r){var i;t&&e&&c(t)&&n&&(this.id=n,i=rt(t).bbox,this.destroy(),this.map.addLayer(function(t,e,n){function r(t){if("FeatureCollection"===b.type){for(var e=0;e<b.features.length;e++)if(Ot(t,b.features[e]))return!0;return!1}if("Feature"===b.type)return Ot(t,b.geometry)}var i,s=n.bbox,a=n.isGCJ,u=n.replaceUrl,l=null!=(i=n.isJudgement)&&i,c=n.filter,h=n.coordTransform,p=n.judgementBox,f=n.judgementPoint,g=null!=(i=n.maxZoom)?i:18,d=null!=(i=n.minZoom)?i:0,y=null==(i=n.judgeBound)||i,m=null==(i=n.isPrecision)||i,_=null!=(i=n.expand)?i:0,v=null==(i=n.minShow)||i,x=null==(i=n.maxShow)||i,E=null!=(i=n.textureType)?i:"NEAREST",b=null!=(i=n.json)?i:{},I=null!=(i=n.gradualLoad)&&i,w=null==(i=n.isThrottle)||i,N=null!=(i=n.fetchOptions)?i:{},L=document.createElement("canvas"),S=0;return{id:t,type:"custom",onAdd:function(t,e){var n=this,r=(this.map=t,this.tileCache={},this.gridCache={},this.coordCache={},this.showTiles=[],t=e.createShader(e.VERTEX_SHADER),e.shaderSource(t,"\nuniform mat4 u_matrix;\nattribute vec3 a_pos;\nattribute vec2 a_uv;\nvarying vec2 v_uv;\nvoid main() {\n v_uv = a_uv;\n gl_Position = u_matrix * vec4(a_pos, 1.0);\n}"),e.compileShader(t),e.createShader(e.FRAGMENT_SHADER)),i=(e.shaderSource(r,"\nprecision mediump float;\nvarying vec2 v_uv;\nuniform sampler2D u_sampler;\nvoid main() {\n gl_FragColor = texture2D(u_sampler, v_uv);\n}"),e.compileShader(r),this.program=e.createProgram(),e.attachShader(this.program,t),e.attachShader(this.program,r),e.linkProgram(this.program),null);this.map.on("move",(function(t){w?i||(n.updateLayer(e),i=setTimeout((function(){i=null}),100)):n.updateLayer(e)})),this.updateLayer(e)},updateLayer:function(t){var e=this.map.getZoom(),n=e;if(m&&(e+=1.4),n<d){if(e=d,!v)return void(this.showTiles=[])}else g<e&&n<g&&(e=g);if(g<e&&g<n){if(!x)return void(this.showTiles=[]);e=g}this.drawLayer(e,t)},drawLayer:function(t,e){for(var n=this,r=parseInt(t),i=(t=[(t=this.map.getBounds().toArray())[0][0],t[0][1],t[1][0],t[1][1]],Math.min(t[2],s[2])),o=Math.min(t[3],s[3]),a=Math.max(t[0],s[0]),u=(t=Math.max(t[1],s[1]),a=this.map.getTileByPosition([a,t],r),t=this.map.getTileByPosition([i,o],r),i=a[0]-_,t[0]+_),l=t[1]-_,c=a[1]+_,h=[],p=i;p<=u;p++)for(var f=l;f<=c;f++){var g={x:p,y:f,z:r};h.push(g),this.addGridCache(g,0,0),p===u&&this.addGridCache(g,1,0),f===c&&this.addGridCache(g,0,1),p===u&&f===c&&this.addGridCache(g,1,1)}o=this.map.getCenter();var d=this.map.getTileByPosition([o.lng,o.lat],r);if(h.sort((function(t,e){return n.tileDistance(t,d)-n.tileDistance(e,d)})),t=this.showTiles||[],this.showTiles=[],I&&0<t.length){var y=t[0].xyz?t[0].xyz.z:r;if(2<=Math.abs(r-y))for(var m in this.tileCache)(m=this.tileCache[m]).abortController&&!m.isLoad&&m.xyz&&(y<m.xyz.z&&m.xyz.z<r||r<m.xyz.z&&m.xyz.z<y)&&m.abortController.abort()}for(var v=0,x=h;v<x.length;v++){var E,b=x[v];this.tileCache[this.createTileKey(b)]?this.showTiles.push(this.tileCache[this.createTileKey(b)]):(E=this.createTile(e,b),this.showTiles.push(E),this.tileCache[this.createTileKey(b)]=E)}I?!(a=this.showTiles.every((function(t){return void 0!==t.isLoad})))&&0<t.length?(i=t.filter((function(t){return t.isLoad})),this.showTiles=[].concat(i,this.showTiles)):a&&this._cleanupOldTiles(h):setTimeout((function(){n._cleanupOldTiles(h)}),0)},_cleanupOldTiles:function(t){var e,n=this,r={},i=(t.forEach((function(t){r[n.createTileKey(t)]=!0})),Date.now()),o=0;for(e in this.tileCache)o++;if(1e3<o)for(var s=Object.entries(this.tileCache).sort((function(t,e){return(t[1].timestamp||0)-(e[1].timestamp||0)})),a=Math.min(o-1e3+50,o),u=0;u<a;u++){var l,c=s[u][0];r[c]||((l=this.tileCache[c]).abortController&&!l.isLoad&&l.abortController.abort(),delete this.tileCache[c])}else for(var h in this.tileCache){var p=this.tileCache[h];(!r[h]||p.timestamp&&3e5<i-p.timestamp)&&(p.abortController&&!p.isLoad&&p.abortController.abort(),delete this.tileCache[h])}},tileDistance:function(t,e){return Math.sqrt(Math.pow(t.x-e[0],2)+Math.pow(t.y-e[1],2))},addGridCache:function(t,e,n){var r,i=this.createTileKey(t.x+e,t.y+n,t.z);this.gridCache[i]||(n=(e=this.map.getPositionByTile([t.x+e,t.y+n,t.z]))[0],t=e[1],r=e[2],e=e[3],void 0!==t&&void 0!==e&&void 0!==r&&void 0!==n&&(a?(this.coordCache[t="gcj:"+n+","+e]||(r=Rt(n,e),this.coordCache[t]=[r[0],r[1]]),r=this.coordCache[t],this.gridCache[i]={lng:r[0],lat:r[1]}):h&&"function"==typeof h?(this.coordCache[t="custom:"+n+","+e]||(r=h(n,e),Array.isArray(r)&&2===r.length?this.coordCache[t]=[r[0],r[1]]:this.coordCache[t]="object"==typeof r?[r.lng,r.lat]:[n,e]),r=this.coordCache[t],this.gridCache[i]={lng:r[0],lat:r[1]}):this.gridCache[i]={lng:n,lat:e}))},createTileKey:function(t,e,n){return t instanceof Object?t.z+"/"+t.x+"/"+t.y:n+"/"+t+"/"+e},createTile:function(t,n){var i,s,a,h,p,g=this,d=Array.isArray(e)?(_=e.length,v=e[S],_<=++S&&(S=0),u&&"function"==typeof u?u(v,n):v.replace("{z}",n.z).replace("{x}",n.x).replace("{y}",n.y)):u&&"function"==typeof u?u(e,n):e.replace("{z}",n.z).replace("{x}",n.x).replace("{y}",n.y),m={xyz:n,timestamp:Date.now(),abortController:new AbortController},_=this.gridCache[this.createTileKey(n)],v=this.gridCache[this.createTileKey(n.x+1,n.y,n.z)],x=this.gridCache[this.createTileKey(n.x,n.y+1,n.z)];return n=this.gridCache[this.createTileKey(n.x+1,n.y+1,n.z)],x&&v&&x&&n&&(x=this.getBufferData(x,n,v,_),i=_.lat,s=_.lng,v=n.lat,_=n.lng,a=(_-s)/256,h=(i-v)/256,p=!!y&&this.getAllIn(s,v,_,i),m.aPos=t.getAttribLocation(this.program,"a_pos"),m.aUv=t.getAttribLocation(this.program,"a_uv"),m.uSamplerLoc=t.getUniformLocation(this.program,"u_sampler"),m.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,m.texture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array([0,0,0,0])),fetch(d,o({signal:m.abortController.signal,mode:"cors"},N)).then((function(t){if(t.ok)return t.blob();throw new Error("Network response was not ok")})).then((function(t){return createImageBitmap(t)})).then((function(e){L.width=e.width,L.height=e.height;var n=L.getContext("2d"),o=(n.imageSmoothingEnabled=!0,n.imageSmoothingQuality="high",n.drawImage(e,0,0),c&&"function"==typeof c);if((l||o)&&(!p||o)){for(var u,d,y,_=n.getImageData(0,0,L.width,L.height),v=_.data.length,x=0;x<v;x+=4)p||(u=(y=Math.floor(x/4))%256,y=Math.floor(y/256),d=r([u=s+u*a,y=i-y*h]),f&&"function"==typeof f&&(d=null==(u=f(u,y))||u),_.data[x+3]=d?255:0),o&&(y=c([_.data[x],_.data[x+1],_.data[x+2],_.data[x+3]]),Array.isArray(y))&&4===y.length&&(_.data[x]=y[0],_.data[x+1]=y[1],_.data[x+2]=y[2],_.data[x+3]=y[3]);n.putImageData(_,0,0)}t.bindTexture(t.TEXTURE_2D,m.texture),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,!0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,L),t.generateMipmap(t.TEXTURE_2D),m.isLoad=!0,g.map.triggerRepaint()})).catch((function(t){"AbortError"!==t.name&&(console.warn("Failed to load image:",t),m.isLoad=!0,g.map.triggerRepaint())})),m.buffer=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,m.buffer),t.bufferData(t.ARRAY_BUFFER,x,t.STATIC_DRAW)),m},getBufferData:function(t,e,n,r){var i=this.map.queryTerrainElevation&&this.map.queryTerrainElevation(new mapboxgl.LngLat(t.lng,t.lat))||0,o=this.map.queryTerrainElevation&&this.map.queryTerrainElevation(new mapboxgl.LngLat(e.lng,e.lat))||0,s=this.map.queryTerrainElevation&&this.map.queryTerrainElevation(new mapboxgl.LngLat(n.lng,n.lat))||0,a=this.map.queryTerrainElevation&&this.map.queryTerrainElevation(new mapboxgl.LngLat(r.lng,r.lat))||0;return t=mapboxgl.MercatorCoordinate.fromLngLat(t,i),i=mapboxgl.MercatorCoordinate.fromLngLat(e,o),e=mapboxgl.MercatorCoordinate.fromLngLat(n,s),o=mapboxgl.MercatorCoordinate.fromLngLat(r,a),new Float32Array([t.x,t.y,t.z,0,0,i.x,i.y,i.z,1,0,e.x,e.y,e.z,1,1,t.x,t.y,t.z,0,0,e.x,e.y,e.z,1,1,o.x,o.y,o.z,0,1])},getAllIn:function(t,e,n,i){var o;return p&&"function"==typeof p?null==(o=p(t,e,n,i))||o:[[t,i],[t,e],[n,e],[n,i],[(t+n)/2,i],[n,(e+i)/2],[(t+n)/2,e],[t,(e+i)/2],[(t+n)/2,(e+i)/2]].every(r)},render:function(t,e){t.useProgram(this.program),t.uniformMatrix4fv(t.getUniformLocation(this.program,"u_matrix"),!1,e);for(var n=Dt(this.showTiles);!(i=n()).done;){var r,i=i.value;i.isLoad&&i.texture&&(t.bindTexture(t.TEXTURE_2D,i.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),r=["NEAREST","LINEAR"].includes(E)?t[E]:t.NEAREST,t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,r),t.bindBuffer(t.ARRAY_BUFFER,i.buffer),t.enableVertexAttribArray(i.aPos),t.enableVertexAttribArray(i.aUv),t.vertexAttribPointer(i.aPos,3,t.FLOAT,!1,20,0),t.vertexAttribPointer(i.aUv,2,t.FLOAT,!1,20,12),t.enable(t.BLEND),t.blendFunc(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA),t.blendEquation(t.FUNC_ADD),t.drawArrays(t.TRIANGLES,0,6))}},onRemove:function(t,e){if(this.map.off("move",this.updateLayer),this.showTiles)for(var n=Dt(this.showTiles);!(r=n()).done;){var r=r.value;r.texture&&e.deleteTexture(r.texture),r.buffer&&e.deleteBuffer(r.buffer)}if(this.tileCache={},this.gridCache={},this.coordCache={},this.showTiles=[],this.program){for(var i=Dt(e.getAttachedShaders(this.program));!(o=i()).done;){var o=o.value;e.detachShader(this.program,o),e.deleteShader(o)}e.deleteProgram(this.program),this.program=null}L&&(L.width=0,L.height=0,L=null)}}}(n,e,o({},this.options,{bbox:i,isGCJ:null!=(n=this.options.isGCJ)&&n,json:t})),r))},e.destroy=function(){this.map.getLayer(this.id)&&this.map.removeLayer(this.id),this.map.getSource(this.id)&&this.map.removeSource(this.id)},e.visible=function(t){this.id&&this.map.getLayer(this.id)&&this.map.setLayoutProperty(this.id,"visibility",t?"visible":"none")},t}();function Gt(t){return(Gt="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 Bt(t){return t=function(t,e){if("object"!==Gt(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0===n)return String(t);if("object"!==Gt(n=n.call(t,"string")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(t),"symbol"===Gt(t)?t:String(t)}function Ut(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,Bt(r.key),r)}}function qt(t,e,n){e&&Ut(t.prototype,e),n&&Ut(t,n),Object.defineProperty(t,"prototype",{writable:!1})}var zt=function(){function t(t,e){this.map=t,this._contextMenu=null,this._moveMenu=null,this._context=null,e=(t=(this._position=null)!=e?e:{}).move,t=void 0===(t=t.className)?"mapMenu":t,this._move=void 0!==e&&e,this._className=t}var e=t.prototype;return e.init=function(t,e){var n,r=this;this.map&&!this._context&&((n=document.createElement("div")).className=this._className,n.style.display="none",n.style.position="absolute",this.map.getCanvas().offsetParent.appendChild(n),t instanceof Element?n.appendChild(t):"string"==typeof t&&(n.innerHTML=t),this._context=n,this._contextMenu=function(t){var n;r._position=t.lngLat,e&&"function"==typeof e?(n=r.map.queryRenderedFeatures(t.point),"boolean"==typeof(n=void 0===(n=(null!=(n=e(o({},t,{features:n})))?n:{}).show)||n)&&(r.visible(n),r.updateXY(t.point))):(r.visible(!0),r.updateXY(t.point))},this.map.on("contextmenu",this._contextMenu),this._move)&&(this._moveMenu=function(t){var e;r._context&&"none"!==r._context.style.display&&r._position&&(e=r.map.project([r._position.lng,r._position.lat]),r.updateXY(e))},this.map.on("move",this._moveMenu),window.addEventListener("resize",this._moveMenu))},e.visible=function(t){this._context&&(this._context.style.display=t?"block":"none")},e.updateXY=function(t){var e,n,r,i,o;this._context&&t&&(e=isNaN(Number(t.x))?0:Number(t.x),t=isNaN(Number(t.y))?0:Number(t.y),this._move||(n=(r=this._context).offsetWidth,r=r.offsetHeight,(o=(i=this.map.getCanvas()).offsetWidth)<e+n&&(e=o-n),(o=i.offsetHeight)<t+r&&(t=o-r)),this._context.style.top=t+"px",this._context.style.left=e+"px")},e.destroy=function(){this.map&&(this.map.off("contextmenu",this._contextMenu),this._contextMenu=null,this._context&&(this._context.remove(),this._context=null),this._move)&&(this.map.off("move",this._moveMenu),window.removeEventListener("resize",this._moveMenu),this._moveMenu=null)},qt(t,[{key:"show",get:function(){var t;return null!=(t=this._context&&"none"!==this._context.style.display)&&t}}]),t}();const jt=function(t,e,n){void 0===n&&(n={}),t=it(t);var r=X((e=it(e))[1]-t[1]),i=X(e[0]-t[0]);return t=X(t[1]),e=X(e[1]),r=Math.pow(Math.sin(r/2),2)+Math.pow(Math.sin(i/2),2)*Math.cos(t)*Math.cos(e),z(2*Math.atan2(Math.sqrt(r),Math.sqrt(1-r)),n.units)};function Vt(t,e){return void 0===e&&(e={}),r=0,n=function(t,n){return n=n.geometry.coordinates,t+jt(n[0],n[1],e)},Q(t,(function(t,e,i,o,s){r=n(r,t)})),r;var n,r}function Xt(t,e,n){var r,i;return!0===(n=void 0===n?{}:n).final?(Xt(e,t)+180)%360:(n=it(t),t=it(e),e=X(n[0]),r=X(t[0]),n=X(n[1]),t=X(t[1]),i=Math.sin(r-e)*Math.cos(t),n=Math.cos(n)*Math.sin(t)-Math.sin(n)*Math.cos(t)*Math.cos(r-e),V(Math.atan2(i,n)))}const Yt=function(t,e){return ut(t,jt(t,e)/2,Xt(t,e))};var Ht=6378137;function Wt(t){var e=0;if(t&&0<t.length){e+=Math.abs(Jt(t[0]));for(var n=1;n<t.length;n++)e-=Math.abs(Jt(t[n]))}return e}function Jt(t){var e,n,r,i,o,s,a=0,u=t.length;if(2<u){for(s=0;s<u;s++)o=s===u-2?(r=u-2,i=u-1,0):s===u-1?(r=u-1,i=0,1):(i=(r=s)+1,s+2),e=t[r],n=t[i],a+=(Kt(t[o][0])-Kt(e[0]))*Math.sin(Kt(n[1]));a=a*Ht*Ht/2}return a}function Kt(t){return t*Math.PI/180}const Zt=function(t,e){void 0===e&&(e={});var n=0,r=0,i=0;return J(t,(function(t){n+=t[0],r+=t[1],i++}),!0),k([n/i,r/i],e.properties)};function $t(t){return(t%=360)<0&&(t+=360),t}function Qt(t){return(t%=360)<0&&(t+=360),t}const te=function(t,e,n,r,i){if(!W(i=i||{}))throw new Error("options is invalid");var o,s,a=i.properties;if(!t)throw new Error("center is required");if(null==n)throw new Error("bearing1 is required");if(null==r)throw new Error("bearing2 is required");if(!e)throw new Error("radius is required");if("object"!=typeof i)throw new Error("options must be an object");return Qt(n)===Qt(r)?lt(t,e,i):(o=ot(t),t=function(t,e,n,r,i){var o=(i=void 0===i?{}:i).steps||64,s=(n=$t(n),r=$t(r),Array.isArray(t)||"Feature"!==t.type?{}:t.properties);if(n===r)return B(lt(t,e,i).geometry.coordinates[0],s);for(var a=n,u=n<r?r:r+360,l=a,c=[],h=0;l<u;)c.push(ut(t,e,l,i).geometry.coordinates),l=a+360*++h/o;return u<l&&c.push(ut(t,e,u,i).geometry.coordinates),B(c,s)}(t,e,n,r,i),s=[[o]],J(t,(function(t){s[0].push(t)})),s[0].push(o),G(s,a))};var ee="zh_measure_",ne=function(){function t(t,e,n){var r=this,i=(this._click=function(t){var e,n=t.originalEvent.target.ariaLabel;r.isOpen&&"measure"!==n&&(r.isDraw||(r.isDraw=!0,r.positions.push(r.currentPosition),r.texts.push(r.currentText)),e=t.lngLat.toArray(),n=function(){r.currentPosition.push(e),r._drawPoint(),r._drawLine(),r._measureDistance(e)},0<r.currentPosition.length?"line"===r.type||"polygon"===r.type?(t=r.currentPosition[r.currentPosition.length-1],e[0]!==t[0]||e[1]!==t[1]?n():"polygon"===r.type?2<r.currentPosition.length?(r._createTextRemove(r.index),t=[].concat(r.currentPosition,[r.currentPosition[0]]),r._updateLine(t,r.index),t=Zt(G([t])),r._measureArea(t.geometry.coordinates),r._callback()):1===r.currentPosition.length&&(r._removeMarker(r.index),r._removePoint(r.index),r._removeLine(r.index),r._callback()):(r._createTextRemove(r.index),1===r.currentPosition.length&&(r._removeMarker(r.index),r._removePoint(r.index),r._removeLine(r.index)),r._callback())):"sector"===r.type&&(t=r.currentPosition[r.currentPosition.length-1],e[0]===t[0]&&e[1]===t[1]||1!==r.currentPosition.length||n()):n())},this._move=function(t){r.isOpen&&(t=t.lngLat.toArray(),r.isDraw&&0<r.currentPosition.length&&("line"===r.type?r._drawMoveLine(t):"circle"===r.type?(r._drawCircle(t),r._drawMoveLine(t)):"polygon"===r.type?(1<r.currentPosition.length&&r._drawPolygon(t),r._drawMoveLine(t)):"rect"===r.type?(r._drawRect(t),r._drawMoveLine(t)):"sector"===r.type&&(1<r.currentPosition.length?r._drawSector(t):r._drawMoveLine(t))),r._drawMovePoint(t))},this._dblclick=function(t){if(r.isOpen&&r.isDraw&&("circle"===r.type&&(e=t.lngLat.toArray(),!(n=r.currentPosition[0])||n[0]===e[0]&&n[1]===e[1]?(r._removeMarker(r.index),r._removePoint(r.index),r._removeLine(r.index),r._removeCircle(r.index)):(r.currentPosition.push(e),r._drawPoint(),r._drawCircle(e,!1),r._drawLine(),n=Yt(k(e),k(r.currentPosition[0])),r._measureDistance(e),r._measureArea(n.geometry.coordinates),r._createTextRemove(r.index),r._callback())),!("polygon"===r.type&&0<r.currentPosition.length&&r.currentPosition.length<3))){if("rect"===r.type&&(e=t.lngLat.toArray(),!(n=r.currentPosition[0])||n[0]===e[0]&&n[1]===e[1]?(r._removeMarker(r.index),r._removePoint(r.index),r._removeLine(r.index),r._removeRect(r.index)):(r.currentPosition.push(e),r._drawPoint(),r._drawRect(e,!1),n=Yt(k(e),k(r.currentPosition[0])),r._measureDistance(e),r._measureArea(n.geometry.coordinates),r._createTextRemove(r.index),r._callback())),"sector"===r.type){var e=t.lngLat.toArray(),n=r.currentPosition[r.currentPosition.length-1];if(2!==r.currentPosition.length||e[0]===n[0]&&e[1]===n[1]){if(1!==r.currentPosition.length)return;r._removeMarker(r.index),r._removePoint(r.index),r._removeLine(r.index),r._removeSector(r.index)}else r._drawSector(e,!1),t=Zt(r.map.getSource(r.moveSectorName)._data),r._measureArea(t.geometry.coordinates),r._createTextRemove(r.index),r._callback()}null!=(n=r.moveLineLayers[r.index])&&n.destroy(),r.moveLineLayers.splice(r.index,1),r._removeMoveMarker(),r.isDraw=!1,r.currentPosition=[],r.currentText=[],r.index++}},this.map=t,t=null!=(t=(e=null!=(t=e)?t:{}).point)?t:{},null!=(i=e.pointMove)?i:{}),o=null!=(o=e.fixed)?o:[2,2],s=(this.calcAll=null==(u=e.calcAll)||u,"number"==typeof o?this.fixed=[o,o]:Array.isArray(o)&&o.every((function(t){return"number"==typeof t}))?this.fixed=o:this.fixed=[2,2],this.dash=null==(u=e.dash)||u,this.type=null!=(o=e.type)?o:"line",["line","circle","polygon","rect","sector"].includes(this.type)||(this.type="line"),this.units={line:["km","m"],circle:["km²","m²"],polygon:["km²","m²"],rect:["km²","m²"],sector:["km²","m²"]},e.units);if(s)for(var a in this.units)s[a]&&Array.isArray(s[a])&&s[a].every((function(t){return"string"==typeof t}))&&(this.units[a][0]=s[a][0],this.units[a][1]=s[a][1]);this.className=null!=(u=e.className)?u:"",this.pointMoveProps={color:null!=(o=i.color)?o:"#ffffff",radius:null!=(u=i.radius)?u:10,opacity:null!=(o=i.opacity)?o:.01,strokeWidth:null!=(u=i.strokeWidth)?u:2,strokeColor:null!=(o=i.strokeColor)?o:"#ffffff",strokeOpacity:null!=(u=i.strokeOpacity)?u:.01},this.pointProps={color:null!=(o=t.color)?o:"rgb(255,255,255)",radius:null!=(i=t.radius)?i:4,strokeWidth:null!=(u=t.strokeWidth)?u:2,strokeColor:null!=(o=t.strokeColor)?o:"#00ccff"};var u=null!=(i=e.line)?i:{};this.lineProps={color:null!=(t=u.color)?t:"#00ccff",width:null!=(o=u.width)?o:2,dasharray:null!=(i=u.dasharray)?i:[5,5]},o=null!=(t=e.fill)?t:{},this.fillProps={color:null!=(u=o.color)?u:"rgba(0,230,255,0.1)"},this._custom=n,this.isOpen=!1,this.moveMarker=null,this._init()}var e=t.prototype;return e._init=function(){var t;this.positions=[],this.currentPosition=[],this.index=null!=(t=null==(t=this.map[this._custom])||null==(t=t.measure)?void 0:t[this.type])?t:0,this.isDraw=!1,this.pointLayers=[],this.movepointLayers=[],this.lineLayers=[],this.moveLineLayers=[],this.moveCircleLayers=[],this.movePolygonLayers=[],this.moveRectLayers=[],this.moveSectorLayers=[],this.texts=[],this.currentText=[]},e.draw=function(t){t&&"function"==typeof t&&(this.callback=t),this.isOpen||(this.isOpen=!0,this.map.on("click",this._click),this.map.on("mousemove",this._move),this.map.on("dblclick",this._dblclick))},e._callback=function(){this.callback&&"function"==typeof this.callback&&this.callback()},e._drawPoint=function(){var t,e=this,n=U(this.currentPosition.map((function(t,n){return k(t,{pointIndex:n,lineIndex:e.index})})));this.pointLayer?this.map.getSource(this.pointName).setData(n):((t=this.map.MapCustom()).draw(n,this.pointName,{layerConfig:{type:"circle",paint:{"circle-color":this.pointProps.color,"circle-radius":this.pointProps.radius,"circle-stroke-width":this.pointProps.strokeWidth,"circle-stroke-color":this.pointProps.strokeColor}}}),this.pointLayers.push(t))},e._drawMovePoint=function(t){var e;t={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:t},properties:{pointIndex:0,lineIndex:this.index}}]},this.movePointLayer?this.map.getSource(this.movePointName).setData(t):((e=this.map.MapCustom()).draw(t,this.movePointName,{layerConfig:{type:"circle",paint:{"circle-opacity":this.pointMoveProps.opacity,"circle-color":this.pointMoveProps.color,"circle-radius":this.pointMoveProps.radius,"circle-stroke-width":this.pointMoveProps.strokeWidth,"circle-stroke-color":this.pointMoveProps.strokeColor,"circle-stroke-opacity":this.pointMoveProps.strokeOpacity}}}),this.movepointLayers.push(e))},e._drawLine=function(){var t,e=U([B(1<this.currentPosition.length?this.currentPosition:[this.currentPosition[0],this.currentPosition[0]],{lineIndex:this.index})]);this.lineLayer?(this.map.getSource(this.lineName).setData(e),this.map.moveLayer(this.lineName,this.pointName)):((t=this.map.MapLine()).draw(e,this.lineName,{layerConfig:{paint:{"line-color":this.lineProps.color,"line-width":this.lineProps.width}},beforeId:this.pointName}),this.lineLayers.push(t))},e._drawMoveLine=function(t){var e=U([B([this.currentPosition[this.currentPosition.length-1],t],{lineIndex:this.index})]),n=("polygon"===this.type&&1<this.currentPosition.length&&(e=U([B([this.currentPosition[0],t,this.currentPosition[this.currentPosition.length-1]],{lineIndex:this.index})])),this.moveLineLayer?this.map.getSource(this.moveLineName).setData(e):((n=this.map.MapLine()).draw(e,this.moveLineName,{layerConfig:{paint:{"line-color":this.lineProps.color,"line-width":this.lineProps.width,"line-dasharray":this.dash?this.lineProps.dasharray:[]}},beforeId:this.pointName}),this.moveLineLayers.push(n)),U([B([].concat(this.currentPosition,[t]))]));this._drawMoveMarker(this.calcAll?n:e,t)},e._drawMoveMarker=function(t,e){t=this._calcLength(t),this.moveMarker?(this.moveMarker.getElement().children[0].innerHTML=t,this.moveMarker.setLngLat(e)):(this.moveMarker=this._createMoveText(t),this.moveMarker.setLngLat(e).addTo(this.map))},e._removeMoveMarker=function(){this.moveMarker&&(this.moveMarker.remove(),this.moveMarker=null)},e._drawCircle=function(t,e){void 0===e&&(e=!0);var n,r=this.currentPosition[0],i=U([k(r,{circleIndex:this.index})]);t=Vt(U([B([r,t],{circleIndex:this.index})]),{units:"kilometers"}),this.moveCircleLayer?(n={steps:64,units:"kilometers",properties:{circleIndex:this.index}},r=U([lt(r,t,n)]),this.map.getSource(this.moveCircleName).setData(r),e||this.map.setPaintProperty(this.moveCircleLayer.lineName,"line-dasharray",[])):((n=this.map.MapCircle()).draw(i,this.moveCircleName,{endRadius:t,layerConfig:{paint:{"fill-color":this.fillProps.color}},lineConfig:{paint:{"line-color":this.lineProps.color,"line-width":this.lineProps.width,"line-dasharray":this.dash?this.lineProps.dasharray:[]}},beforeId:this.pointName}),this.moveCircleLayers.push(n))},e._drawPolygon=function(t){var e;t=U([G([[].concat(this.currentPosition,[t,this.currentPosition[0]])],{polygonIndex:this.index})]),this.movePolygonLayer?this.map.getSource(this.movePolygonName).setData(t):((e=this.map.MapMoreCustom()).draw(t,{sourceConfig:{id:this.movePolygonName,type:"geojson",data:t},layerConfig:[{id:this.movePolygonName,type:"fill",paint:{"fill-color":this.fillProps.color},beforeId:this.moveLineName}]}),this.movePolygonLayers.push(e))},e._drawRect=function(t,e){void 0===e&&(e=!0),t=U([nt(et(B([this.currentPosition[0],t])),{properties:{rectIndex:this.index}})]),this.moveRectLayer?(this.map.getSource(this.moveRectName).setData(t),e||this.map.setPaintProperty(this.moveRectName+"-line","line-dasharray",[])):((e=this.map.MapMoreCustom()).draw(t,{sourceConfig:{id:this.moveRectName,type:"geojson",data:t},layerConfig:[{id:this.moveRectName,type:"fill",paint:{"fill-color":this.fillProps.color},beforeId:this.pointName},{id:this.moveRectName+"-line",type:"line",paint:{"line-color":this.lineProps.color,"line-width":this.lineProps.width,"line-dasharray":this.dash?this.lineProps.dasharray:[]},beforeId:this.pointName}]}),this.moveRectLayers.push(e))},e._drawSector=function(t,e){void 0===e&&(e=!0);var n=Vt(B(this.currentPosition,{units:"kilometers"})),r=Xt(this.currentPosition[0],this.currentPosition[1]);t=Xt(this.currentPosition[0],t),n=U([te(this.currentPosition[0],n,r,t,{units:"kilometers",properties:{sectorIndex:this.index}})]),this.moveSectorLayer?(this.map.getSource(this.moveSectorName).setData(n),e||this.map.setPaintProperty(this.moveSectorName+"-line","line-dasharray",[])):((r=this.map.MapMoreCustom()).draw(n,{sourceConfig:{id:this.moveSectorName,type:"geojson",data:n},layerConfig:[{id:this.moveSectorName,type:"fill",paint:{"fill-color":this.fillProps.color},beforeId:this.pointName},{id:this.moveSectorName+"-line",type:"line",paint:{"line-color":this.lineProps.color,"line-width":this.lineProps.width,"line-dasharray":this.dash?this.lineProps.dasharray:[]},beforeId:this.pointName}]}),this.moveSectorLayers.push(r))},e._removeRect=function(t){var e=this.moveRectLayers[t];e&&(e.destroy(),this.moveRectLayers[t]=null)},e._removeSector=function(t){var e=this.moveSectorLayers[t];e&&(e.destroy(),this.moveSectorLayers[t]=null)},e._createText=function(t,e,n){var r,i=this,o=(void 0===t&&(t="起点"),void 0===n&&(n=!0),document.createElement("div"));return((o.style.background="#ffffff",o.style.cursor="default",o.style.padding="0 5px",o.style.borderRadius="3px",o.style.display="flex",o.style.alignItems="center",o.className=this.className?this.className+" measure-box":"measure-box",o.ariaLabel="measure",r=document.createElement("span")).className="measure-text",r.innerHTML=t,r.ariaLabel="measure",o.appendChild(r),n&&((t=document.createElement("span")).className="measure-close",t.style.paddingLeft="5px",t.innerHTML="x",t.ariaLabel="measure",t.addEventListener("click",(function(t){i.isDraw||(t=t.target.parentNode._marker)&&i._removeGroup(t)})),o.appendChild(t)),r=new mapboxgl.Marker({element:o,offset:[10,0],anchor:"left"})).pointIndex=e,r.lineIndex=this.index,r.showBtn=n,this.currentText.push(r),o._marker=r},e._createMoveText=function(t){var e=document.createElement("div"),n=(e.style.background="#ffffff",e.style.cursor="default",e.style.padding="0 5px",e.style.borderRadius="3px",e.style.display="flex",e.style.alignItems="center",e.className=this.className?this.className+" measure-box":"measure-box",e.ariaLabel="measure",document.createElement("span"));return n.className="measure-text",n.innerHTML=t,n.ariaLabel="measure",e.appendChild(n),new mapboxgl.Marker({element:e,offset:[10,0],anchor:"left"})},e._createTextRemove=function(t){for(var e=this,n=document.createElement("div"),r=(n.className="measure-remove",n.style.width="15px",n.style.height="14px",n.style.marginLeft="5px",n.ariaLabel="measure",n.style.backgroundImage='url(\'data:image/svg+xml;utf8,%3Csvg xmlns="http://www.w3.org/2000/svg" width="20" height="20">%3Cpath d="M10,3.4 c-0.8,0-1.5,0.5-1.8,1.2H5l-1,1v1h12v-1l-1-1h-3.2C11.5,3.9,10.8,3.4,10,3.4z M5,8v7c0,1,1,2,2,2h6c1,0,2-1,2-2V8h-2v5.5h-1.5V8h-3 v5.5H7V8H5z"/>%3C/svg>\')',n.style.backgroundSize="100% 100%",n.addEventListener("click",(function(t){e.isDraw||(t=t.target.parentNode._marker)&&e._removeGroupLine(t)})),this.texts[t]),i=null,o=r.length-1;0<=o;o--)if(r[o].showBtn){i=o;break}(null!==i?r[i]:r[r.length-1]).getElement().appendChild(n)},e._measureDistance=function(t){var e="起点",n=(1<this.currentPosition.length&&(n=U([B(this.currentPosition,{lineIndex:this.index})]),e=this._calcLength(n)),this._createText(e,this.currentPosition.length-1,"circle"!==this.type&&"rect"!==this.type&&"sector"!==this.type));return n.setLngLat(t).addTo(this.map),n},e._measureArea=function(t){var e,n,r;["circle","polygon","rect","sector"].includes(this.type)&&(n=null,"circle"===this.type?(r=Vt(U([B(this.currentPosition)]),{units:"kilometers"}),e={steps:64,units:"kilometers",properties:{circleIndex:this.index}},n=lt(this.currentPosition[0],r,e)):"polygon"===this.type?n=G([[].concat(this.currentPosition,[this.currentPosition[0]])]):"rect"===this.type?n=nt(et(B(this.currentPosition)),{properties:{rectIndex:this.index}}):"sector"===this.type&&(n=this.map.getSource(this.moveSectorName)._data.features[0]),null!==n)&&(r=this._calcArea(n),this._createText(r,this.currentPosition.length,!1).setLngLat(t).addTo(this.map))},e._calcLength=function(t){return 1e3<(t=Vt(t,{units:"meters"}))?Number((t/1e3).toFixed(this.fixed[0]))+this.units.line[0]:Number(t.toFixed(this.fixed[1]))+this.units.line[1]},e._calcArea=function(t){return t=function(t){return e=function(t,e){return t+function(t){var e,n=0;switch(t.type){case"Polygon":return Wt(t.coordinates);case"MultiPolygon":for(e=0;e<t.coordinates.length;e++)n+=Wt(t.coordinates[e]);return n;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}(e)},n=0,Z(t,(function(t,r,i,o,s){n=e(n,t)})),n;var e,n}(t),1e6<t?Number((t/1e6).toFixed(this.fixed[0]))+this.units[this.type][0]:Number(t.toFixed(this.fixed[1]))+this.units[this.type][1]},e._removeGroup=function(t){var e,n,r,i=t.lineIndex,o=t.pointIndex;t.remove(),this.texts[i].splice(o,1),this.positions[i].splice(o,1),t=this.positions[i],this._updateLine(t,i),this._updatePoint(t,i),this._updateText(t,i),"polygon"===this.type?(this._updatePolygon(t,i),r=[].concat(t,[t[0]]),this._updateLine(r,i),t.length<3?(this._removeMarker(i),this._removePoint(i),this._removeLine(i)):t.length===o&&this._createTextRemove(i),2<t.length&&(r=G([r]),e=Zt(r),0<(n=this.texts[i]).length)&&(n=n[n.length-1],r=this._calcArea(r),this._updateMarkerText(n,r),n.setLngLat(e.geometry.coordinates).addTo(this.map))):"line"===this.type&&(t.length<2?this._removeMarker(i):t.length===o&&this._createTextRemove(i))},e._removeGroupLine=function(t){t=t.lineIndex,this._removeMarker(t),this._removePoint(t),this._removeLine(t),"circle"===this.type?this._removeCircle(t):"polygon"===this.type?this._removePolygon(t):"rect"===this.type?this._removeRect(t):"sector"===this.type&&this._removeSector(t)},e._removeMarker=function(t){this.texts[t].forEach((function(t){t.remove()})),this.texts[t]=[]},e._updateLine=function(t,e){var n=ee+"_"+this.type+"_"+e+"_line";t.length<2?this._removeLine(e):(t=U([B(t,{lineIndex:e})]),this.map.getSource(n).setData(t))},e._updatePolygon=function(t,e){var n=ee+"_"+this.type+"_"+e+"_polygon_move";t.length<3?this._removePolygon(e):(e=U([G([[].concat(t,[t[0]])])]),this.map.getSource(n).setData(e))},e._removePolygon=function(t){var e=this.movePolygonLayers[t];e&&(e.destroy(),this.movePolygonLayers[t]=null)},e._removeLine=function(t){var e=this.lineLayers[t];e&&(e.destroy(),this.lineLayers[t]=null),this.currentPosition=[]},e._removeCircle=function(t){var e=this.moveCircleLayers[t];e&&(e.destroy(),this.moveCircleLayers[t]=null)},e._updatePoint=function(t,e){var n=ee+"_"+this.type+"_"+e+"_point";t.length<2?this._removePoint(e):(t=U(t.map((function(t,n){return k(t,{pointIndex:n,lineIndex:e})}))),this.map.getSource(n).setData(t))},e._removePoint=function(t){var e=this.pointLayers[t];e&&(e.destroy(),this.pointLayers[t]=null)},e._updateText=function(t,e){var n=this,r=this.texts[e];t.forEach((function(e,i){var o,s="起点";0!==i&&(o=U([B(t.slice(0,i+1))]),s=n._calcLength(o)),r[i]&&(r[i].pointIndex=i,n._updateMarkerText(r[i],s))}))},e._updateMarkerText=function(t,e){t.getElement().children[0].innerHTML=e},e.off=function(){this.isDraw||(this.map.off("click",this._click),this.map.off("mousemove",this._move),this.map.off("dblclick",this._dblclick))},e.remove=function(){this.isDraw||(this.pointLayers.forEach((function(t){null!=t&&t.destroy()})),this.movepointLayers.forEach((function(t){null!=t&&t.destroy()})),this.lineLayers.forEach((function(t){null!=t&&t.destroy()})),this.moveLineLayers.forEach((function(t){null!=t&&t.destroy()})),this.texts.forEach((function(t){null!=t&&t.forEach((function(t){t.remove()}))})),this.moveCircleLayers.forEach((function(t){null!=t&&t.destroy()})),this.movePolygonLayers.forEach((function(t){null!=t&&t.destroy()})),this.moveRectLayers.forEach((function(t){null!=t&&t.destroy()})),this.moveSectorLayers.forEach((function(t){null!=t&&t.destroy()})),this._removeMoveMarker(),this._init())},e.visible=function(t){"boolean"!=typeof t||this.isDraw||(this.pointLayers.forEach((function(e){null!=e&&e.visible(t)})),this.movepointLayers.forEach((function(e){null!=e&&e.visible(t)})),this.lineLayers.forEach((function(e){null!=e&&e.visible(t)})),this.moveLineLayers.forEach((function(e){null!=e&&e.visible(t)})),this.texts.forEach((function(e){null!=e&&e.forEach((function(e){e.getElement().style.display=t?"flex":"none"}))})),this.moveCircleLayers.forEach((function(e){null!=e&&e.visible(t)})),this.movePolygonLayers.forEach((function(e){null!=e&&e.visible(t)})),this.moveRectLayers.forEach((function(e){null!=e&&e.visible(t)})),this.moveSectorLayers.forEach((function(e){null!=e&&e.visible(t)})))},e.destroy=function(){this.isOpen=!1,this.isDraw=!1,this.remove(),this.off()},qt(t,[{key:"pointName",get:function(){return ee+"_"+this.type+"_"+this.index+"_point"}},{key:"movePointName",get:function(){return ee+"_"+this.type+"_"+this.index+"_point_move"}},{key:"lineName",get:function(){return ee+"_"+this.type+"_"+this.index+"_line"}},{key:"moveLineName",get:function(){return ee+"_"+this.type+"_"+this.index+"_line_move"}},{key:"moveCircleName",get:function(){return ee+"_"+this.type+"_"+this.index+"_circle_move"}},{key:"movePolygonName",get:function(){return ee+"_"+this.type+"_"+this.index+"_polygon_move"}},{key:"moveRectName",get:function(){return ee+"_"+this.type+"_"+this.index+"_rect_move"}},{key:"moveSectorName",get:function(){return ee+"_"+this.type+"_"+this.index+"_sector_move"}},{key:"pointLayer",get:function(){return this.pointLayers[this.index]}},{key:"movePointLayer",get:function(){return this.movepointLayers[this.index]}},{key:"lineLayer",get:function(){return this.lineLayers[this.index]}},{key:"moveLineLayer",get:function(){return this.moveLineLayers[this.index]}},{key:"moveCircleLayer",get:function(){return this.moveCircleLayers[this.index]}},{key:"movePolygonLayer",get:function(){return this.movePolygonLayers[this.index]}},{key:"moveRectLayer",get:function(){return this.moveRectLayers[this.index]}},{key:"moveSectorLayer",get:function(){return this.moveSectorLayers[this.index]}}]),t}(),re=["id"],ie=["id","type","beforeId","source-layer"],oe=function(){function t(t,e){void 0===e&&(e={}),this.map=t,this.sourceName=[],this.layerName=[],this.type="symbol",this.custom=null!=(e=null==(t=e)?void 0:t.custom)&&e,this.isInit=!1,this.callback=null,this.mapEvent=null}var e=t.prototype;return e.draw=function(t,e,n){if(t&&this.map)return this.callback=n,"vector"===t.type?(this.type=null!=(n=e.type)?n:"symbol",this._addSourceLayer(t,e),{source:this.sourceName,layer:this.layerName}):void 0},e.destroy=function(){this._clearSource(),this.mapEvent&&this.map.off("render",this.mapEvent)},e.visible=function(t){var e,n=this;"boolean"==typeof t&&null!=(e=this.layerName)&&e.filter((function(t){return!t.includes("__copy")})).forEach((function(e){n.map.getLayer(e)&&n.map.setLayoutProperty(e,"visibility",t?"visible":"none")}))},e._addSourceLayer=function(t,e){var n,r,s=this,a=(this.sourceName=[],this.layerName=[],r=null!=(r=e.sourceConfig)?r:{}).id,u=i(r,re),c=a,h=(this.map.addSource(c,o({},t,u)),this.sourceName.push(c),(r=e.beforeId||null)&&this.map.getLayer(r),a=l(e.layerConfig),[]);Array.isArray(a)?h=a:"object"==typeof a&&h.push(a),0<h.length&&(t=h[0],r={id:c+"__copy",type:"circle",source:c,"source-layer":t["source-layer"],paint:{"circle-radius":1,"circle-opacity":0},interactive:!1},this.map.addLayer(r),this.layerName.push(c+"__copy"),n={sourceLayer:t["source-layer"]},this.mapEvent=function(t){var e,r=s.map.getSource(c);r&&r.loaded()&&s.map.isSourceLoaded(c)&&(r={type:"FeatureCollection",features:s.map.querySourceFeatures(c,n)},s.custom?s.callback&&"function"==typeof s.callback&&s.callback(r):(e=c+"__geojson",s.isInit?s.map.getSource(e)&&s.map.getSource(e).setData(r):(s.map.addSource(e,o({type:"geojson",data:r},u)),s.sourceName.push(e),h.forEach((function(t){var n=(t=l(t)).id,r=t.type,a=t.beforeId;t["source-layer"],t=i(t,ie),a&&!s.map.getLayer(a)&&(a=null),s.map.addLayer(o({id:n,type:r},t,{source:e}),a),s.layerName.push(n)})),s.isInit=!0)))},this.map.on("render",this.mapEvent))},e._clearSource=function(){var t,e=this;null!=(t=this.layerName)&&t.forEach((function(t){var n;(null==(n=e.map)?void 0:n.getLayer(t))&&e.map.removeLayer(t)})),null!=(t=this.sourceName)&&t.forEach((function(t){var n;(null==(n=e.map)?void 0:n.getSource(t))&&e.map.removeSource(t)}))},t}(),se=function(){function t(t){this.map=t}var e=t.prototype;return e.draw=function(t){var e,n,r,i,o,s,a,u,l;this.options=t,this.layer=(e=(t=this.options).id,n=t.url,r=t.crossOrigin,i=void 0===r?"":r,r=void 0===(r=t.position)?[]:r,t=t.altitude,o=void 0===t?0:t,s=r[0],a=r[1],u=r[2],l=r[3],{id:e,type:"custom",onAdd:function(t,e){var r=this,c=e.createShader(e.VERTEX_SHADER),h=(e.shaderSource(c,"\nuniform mat4 u_matrix;\nattribute vec3 a_pos;\nattribute vec2 a_uv;\nvarying vec2 v_uv;\nvoid main() {\n v_uv = a_uv;\n gl_Position = u_matrix * vec4(a_pos, 1.0);\n}"),e.compileShader(c),e.createShader(e.FRAGMENT_SHADER)),p=(e.shaderSource(h,"\nprecision mediump float;\nvarying vec2 v_uv;\nuniform sampler2D u_sampler;\nvoid main() {\n gl_FragColor = texture2D(u_sampler, v_uv);\n}"),e.compileShader(h),this.program=e.createProgram(),e.attachShader(this.program,c),e.attachShader(this.program,h),e.linkProgram(this.program),this.aPos=e.getAttribLocation(this.program,"a_pos"),this.aUv=e.getAttribLocation(this.program,"a_uv"),this.uSamplerLoc=e.getUniformLocation(this.program,"u_sampler"),c=mapboxgl.MercatorCoordinate.fromLngLat({lng:s,lat:a},o),h=mapboxgl.MercatorCoordinate.fromLngLat({lng:u,lat:a},o),mapboxgl.MercatorCoordinate.fromLngLat({lng:u,lat:l},o)),f=mapboxgl.MercatorCoordinate.fromLngLat({lng:s,lat:l},o),g=new Image;g.crossOrigin=i,g.src=n,this.texture=e.createTexture(),g.onload=function(){e.bindTexture(e.TEXTURE_2D,r.texture),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!0),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,g)},this.buffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,this.buffer),e.bufferData(e.ARRAY_BUFFER,new Float32Array([c.x,c.y,c.z,0,0,h.x,h.y,h.z,1,0,p.x,p.y,p.z,1,1,c.x,c.y,c.z,0,0,p.x,p.y,p.z,1,1,f.x,f.y,f.z,0,1]),e.STATIC_DRAW)},render:function(t,e){t.useProgram(this.program),t.uniformMatrix4fv(t.getUniformLocation(this.program,"u_matrix"),!1,e),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.bindBuffer(t.ARRAY_BUFFER,this.buffer),t.enableVertexAttribArray(this.aPos),t.enableVertexAttribArray(this.aUv),t.vertexAttribPointer(this.aPos,3,t.FLOAT,!1,20,0),t.vertexAttribPointer(this.aUv,2,t.FLOAT,!1,20,12),t.enable(t.BLEND),t.blendFunc(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA),t.drawArrays(t.TRIANGLES,0,6)}}),this.map.addLayer(this.layer)},e.visible=function(t){t?this.map.addLayer(this.layer):this.map.removeLayer(this.options.id)},e.destroy=function(){this.map.getLayer(this.options.id)&&this.map.removeLayer(this.options.id)},t}();function ae(t,e,n={}){var r={type:"Feature"};return 0!==n.id&&!n.id||(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=e||{},r.geometry=t,r}function ue(t){return"Feature"===t.type?t.geometry:t}function le(t,e={}){var n,r=ue(t);switch(e.properties||"Feature"!==t.type||(e.properties=t.properties),r.type){case"Polygon":return[i,n={}]=[r,e],ce(o=(o=ue(i)).coordinates,n=n.properties||("Feature"===i.type?i.properties:{}));case"MultiPolygon":{var[i,o={}]=[r,e];const t=ue(i).coordinates,n=o.properties||("Feature"===i.type?i.properties:{}),s=[];return t.forEach((t=>{s.push(ce(t,n))})),function(t,e={}){var n={type:"FeatureCollection"};return e.id&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.features=t,n}(s)}default:throw new Error("invalid poly")}}function ce(t,e){return 1<t.length?function(t,e,n={}){return ae({type:"MultiLineString",coordinates:t},e,n)}(t,e):function(t,e,n={}){if(t.length<2)throw new Error("coordinates must be an array of two or more positions");return ae({type:"LineString",coordinates:t},e,n)}(t[0],e)}Math.PI;const he=function(t,e){return void 0===e&&(e={}),k([((t=et(t))[0]+t[2])/2,(t[1]+t[3])/2],e.properties,e)};var pe=t(675);function fe(){return new ge}function ge(){this.reset()}ge.prototype={constructor:ge,reset:function(){this.s=this.t=0},add:function(t){ye(de,t,this.t),ye(this,de.s,this.s),this.s?this.t+=de.t:this.s=de.t},valueOf:function(){return this.s}};var de=new ge;function ye(t,e,n){var r=t.s=e+n,i=r-e;t.t=e-(r-i)+(n-i)}var me=1e-6,_e=Math.PI,ve=_e/2,xe=_e/4,Ee=2*_e,be=180/_e,Ie=_e/180,we=Math.abs,Ne=Math.atan,Le=Math.atan2,Se=Math.cos,Ce=(Math.ceil,Math.exp,Math.floor,Math.log,Math.pow,Math.sin),Pe=(Math.sign,Math.sqrt);function Me(t){return 1<t?0:t<-1?_e:Math.acos(t)}function Te(t){return 1<t?ve:t<-1?-ve:Math.asin(t)}function Re(){}function Oe(t,e){t&&De.hasOwnProperty(t.type)&&De[t.type](t,e)}Math.tan;var Ae={Feature:function(t,e){Oe(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)Oe(n[r].geometry,e)}},De={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){Fe(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)Fe(n[r],e,0)},Polygon:function(t,e){ke(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)ke(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)Oe(n[r],e)}};function Fe(t,e,n){var r,i=-1,o=t.length-n;for(e.lineStart();++i<o;)r=t[i],e.point(r[0],r[1],r[2]);e.lineEnd()}function ke(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)Fe(t[n],e,1);e.polygonEnd()}function Ge(t){return[Le(t[1],t[0]),Te(t[2])]}function Be(t){var e=t[0],n=(t=t[1],Se(t));return[n*Se(e),n*Ce(e),Ce(t)]}function Ue(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function qe(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function ze(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function je(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Ve(t){var e=Pe(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function Xe(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,r){return(n=e.invert(n,r))&&t.invert(n[0],n[1])}),n}function Ye(t,e){return[_e<t?t-Ee:t<-_e?t+Ee:t,e]}function He(t,e,n){return(t%=Ee)?e||n?Xe(Je(t),Ke(e,n)):Je(t):e||n?Ke(e,n):Ye}function We(t){return function(e,n){return[_e<(e+=t)?e-Ee:e<-_e?e+Ee:e,n]}}function Je(t){var e=We(t);return e.invert=We(-t),e}function Ke(t,e){var n=Se(t),r=Ce(t),i=Se(e),o=Ce(e);function s(t,e){var s=Se(e),a=Se(t)*s;return t=Ce(t)*s,s=Ce(e),[Le(t*i-(e=s*n+a*r)*o,a*n-s*r),Te(e*i+t*o)]}return s.invert=function(t,e){var s=Se(e),a=Se(t)*s;return t=Ce(t)*s,s=Ce(e),[Le(t*i+s*o,a*n+(e=s*i-t*o)*r),Te(e*n-a*r)]},s}function Ze(t,e){return(e=Be(e))[0]-=t,Ve(e),t=Me(-e[1]),((-e[2]<0?-t:t)+Ee-me)%Ee}function $e(){var t,e=[];return{point:function(e,n){t.push([e,n])},lineStart:function(){e.push(t=[])},lineEnd:Re,rejoin:function(){1<e.length&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Qe(t,e){return we(t[0]-e[0])<me&&we(t[1]-e[1])<me}function tn(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function en(t,e,n,r,i){var o,s,a=[],u=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],s=t[e];if(Qe(r,s)){for(i.lineStart(),o=0;o<e;++o)i.point((r=t[o])[0],r[1]);i.lineEnd()}else a.push(n=new tn(r,t,null,!0)),u.push(n.o=new tn(r,null,n,!1)),a.push(n=new tn(s,t,null,!1)),u.push(n.o=new tn(s,null,n,!0))}})),a.length){for(u.sort(e),nn(a),nn(u),o=0,s=u.length;o<s;++o)u[o].e=n=!n;for(var l,c,h=a[0];;){for(var p=h,f=!0;p.v;)if((p=p.n)===h)return;l=p.z,i.lineStart();do{if(p.v=p.o.v=!0,p.e){if(f)for(o=0,s=l.length;o<s;++o)i.point((c=l[o])[0],c[1]);else r(p.x,p.n.x,1,i);p=p.n}else{if(f)for(l=p.p.z,o=l.length-1;0<=o;--o)i.point((c=l[o])[0],c[1]);else r(p.x,p.p.x,-1,i);p=p.p}}while(l=(p=p.o).z,f=!f,!p.v);i.lineEnd()}}}function nn(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r<e;)i.n=n=t[r],n.p=i,i=n;i.n=n=t[0],n.p=i}}function rn(t,e){return t<e?-1:e<t?1:e<=t?0:NaN}fe(),fe(),fe(),Ye.invert=Ye,1===(s=rn).length&&(on=s,s=function(t,e){return rn(on(t),e)});var on,sn=Array.prototype;function an(t){for(var e,n,r,i=t.length,o=-1,s=0;++o<i;)s+=t[o].length;for(n=new Array(s);0<=--i;)for(e=(r=t[i]).length;0<=--e;)n[--s]=r[e];return n}sn.slice,sn.map,Math.sqrt(50),Math.sqrt(10),Math.sqrt(2);var un=1e9,ln=-un;function cn(t,e,n,r){function i(i,o){return t<=i&&i<=n&&e<=o&&o<=r}function o(i,o,a,l){var c=0,h=0;if(null==i||(c=s(i,a))!==(h=s(o,a))||u(i,o)<0^0<a)for(;l.point(0===c||3===c?t:n,1<c?r:e),(c=(c+a+4)%4)!==h;);else l.point(o[0],o[1])}function s(r,i){return we(r[0]-t)<me?0<i?0:3:we(r[0]-n)<me?0<i?2:1:we(r[1]-e)<me?0<i?1:0:0<i?3:2}function a(t,e){return u(t.x,e.x)}function u(t,e){var n=s(t,1),r=s(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(s){var u,l,c,h,p,f,g,d,y,m,_,v=s,x=$e(),E={point:b,lineStart:function(){E.point=I,l&&l.push(c=[]),m=!0,y=!1,g=d=NaN},lineEnd:function(){u&&(I(h,p),f&&y&&x.rejoin(),u.push(x.result())),E.point=b,y&&v.lineEnd()},polygonStart:function(){v=x,u=[],l=[],_=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=l.length;n<i;++n)for(var o,s,a=l[n],u=1,c=a.length,h=a[0],p=h[0],f=h[1];u<c;++u)o=p,s=f,p=(h=a[u])[0],f=h[1],s<=r?r<f&&(f-s)*(t-o)<(p-o)*(r-s)&&++e:f<=r&&(p-o)*(r-s)<(f-s)*(t-o)&&--e;return e}(),n=_&&e,i=(u=an(u)).length;(n||i)&&(s.polygonStart(),n&&(s.lineStart(),o(null,null,1,s),s.lineEnd()),i&&en(u,a,e,o,s),s.polygonEnd()),v=s,u=l=c=null}};function b(t,e){i(t,e)&&v.point(t,e)}function I(o,s){var a,u,x=i(o,s);l&&c.push([o,s]),m?(h=o,p=s,m=!1,(f=x)&&(v.lineStart(),v.point(o,s))):x&&y?v.point(o,s):function(t,e,n,r,i,o){var s=t[0],a=t[1],u=0,l=1,c=e[0]-s,h=e[1]-a;if(n-=s,c||!(0<n)){if(n/=c,c<0){if(n<u)return;n<l&&(l=n)}else if(0<c){if(l<n)return;u<n&&(u=n)}if(n=i-s,c||!(n<0)){if(n/=c,c<0){if(l<n)return;u<n&&(u=n)}else if(0<c){if(n<u)return;n<l&&(l=n)}if(n=r-a,h||!(0<n)){if(n/=h,h<0){if(n<u)return;n<l&&(l=n)}else if(0<h){if(l<n)return;u<n&&(u=n)}if(n=o-a,h||!(n<0)){if(n/=h,h<0){if(l<n)return;u<n&&(u=n)}else if(0<h){if(n<u)return;n<l&&(l=n)}return 0<u&&(t[0]=s+u*c,t[1]=a+u*h),l<1&&(e[0]=s+l*c,e[1]=a+l*h),1}}}}}(a=[g=Math.max(ln,Math.min(un,g)),d=Math.max(ln,Math.min(un,d))],u=[o=Math.max(ln,Math.min(un,o)),s=Math.max(ln,Math.min(un,s))],t,e,n,r)?(y||(v.lineStart(),v.point(a[0],a[1])),v.point(u[0],u[1]),x||v.lineEnd(),_=!1):x&&(v.lineStart(),v.point(o,s),_=!1),g=o,d=s,y=x}return E}}var hn=fe();fe(),fe(),fe();var pn=1/0,fn=pn,gn=-pn,dn=gn;const yn={point:function(t,e){t<pn&&(pn=t),gn<t&&(gn=t),e<fn&&(fn=e),dn<e&&(dn=e)},lineStart:Re,lineEnd:Re,polygonStart:Re,polygonEnd:Re,result:function(){var t=[[pn,fn],[gn,dn]];return gn=dn=-(fn=pn=1/0),t}};function mn(t,e,n,r){return function(i,o){var s,a,u,l=e(o),c=i.invert(r[0],r[1]),h=$e(),p=e(h),f=!1,g={point:d,lineStart:m,lineEnd:_,polygonStart:function(){g.point=v,g.lineStart=x,g.lineEnd=E,a=[],s=[]},polygonEnd:function(){g.point=d,g.lineStart=m,g.lineEnd=_,a=an(a);var t=function(t,e){var n=e[0],r=e[1],i=[Ce(n),-Se(n),0],o=0,s=0;hn.reset();for(var a=0,u=t.length;a<u;++a)if(c=(l=t[a]).length)for(var l,c,h=l[c-1],p=h[0],f=h[1]/2+xe,g=Ce(f),d=Se(f),y=0;y<c;++y,p=_,g=x,d=v,h=m){var m=l[y],_=m[0],v=m[1]/2+xe,x=Ce(v),E=(v=Se(v),_-p),b=0<=E?1:-1,I=b*E,w=_e<I,N=g*x;hn.add(Le(N*b*Ce(I),d*v+N*Se(I))),o+=w?E+b*Ee:E,w^n<=p^n<=_&&(Ve(N=qe(Be(h),Be(m))),Ve(I=qe(i,N)),(b=(w^0<=E?-1:1)*Te(I[2]))<r||r===b&&(N[0]||N[1]))&&(s+=w^0<=E?1:-1)}return(o<-me||o<me&&hn<-me)^1&s}(s,c);a.length?(f||(o.polygonStart(),f=!0),en(a,vn,t,n,o)):t&&(f||(o.polygonStart(),f=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),f&&(o.polygonEnd(),f=!1),a=s=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function d(e,n){var r=i(e,n);t(e=r[0],n=r[1])&&o.point(e,n)}function y(t,e){t=i(t,e),l.point(t[0],t[1])}function m(){g.point=y,l.lineStart()}function _(){g.point=d,l.lineEnd()}function v(t,e){u.push([t,e]),t=i(t,e),p.point(t[0],t[1])}function x(){p.lineStart(),u=[]}function E(){v(u[0][0],u[0][1]),p.lineEnd();var t,e,n,r,i=p.clean(),l=h.result(),c=l.length;if(u.pop(),s.push(u),u=null,c)if(1&i){if(0<(e=(n=l[0]).length-1)){for(f||(o.polygonStart(),f=!0),o.lineStart(),t=0;t<e;++t)o.point((r=n[t])[0],r[1]);o.lineEnd()}}else 1<c&&2&i&&l.push(l.pop().concat(l.shift())),a.push(l.filter(_n))}return g}}function _n(t){return 1<t.length}function vn(t,e){return((t=t.x)[0]<0?t[1]-ve-me:ve-t[1])-((e=e.x)[0]<0?e[1]-ve-me:ve-e[1])}fe();const xn=mn((function(){return 1}),(function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,s){var a,u,l,c,h,p=0<o?_e:-_e,f=we(o-n);we(f-_e)<me?(t.point(n,r=0<(r+s)/2?ve:-ve),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(p,r),t.point(o,r),e=0):i!==p&&_e<=f&&(we(n-i)<me&&(n-=i*me),we(o-p)<me&&(o-=p*me),f=r,l=s,h=Ce((a=n)-(u=o)),r=we(h)>me?Ne((Ce(f)*(c=Se(l))*Ce(u)-Ce(l)*(u=Se(f))*Ce(a))/(u*c*h)):(f+l)/2,t.point(i,r),t.lineEnd(),t.lineStart(),t.point(p,r),e=0),t.point(n=o,r=s),i=p},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}}),(function(t,e,n,r){var i;null==t?(i=n*ve,r.point(-_e,i),r.point(0,i),r.point(_e,i),r.point(_e,0),r.point(_e,-i),r.point(0,-i),r.point(-_e,-i),r.point(-_e,0),r.point(-_e,i)):we(t[0]-e[0])>me?(i=n*(t=t[0]<e[0]?_e:-_e)/2,r.point(-t,i),r.point(0,i),r.point(t,i)):r.point(e[0],e[1])}),[-_e,-ve]);function En(t,e){var n=Se(t),r=0<n,i=we(n)>me;function o(t,e){return Se(t)*Se(e)>n}function s(t,e,r){var i,o,s,a,u,l,c,h=[1,0,0],p=qe(Be(t),Be(e)),f=Ue(p,p),g=p[0],d=f-g*g;return d?(i=qe(h,p),ze(h=je(h,n*f/d),je(p,-n*g/d)),(d=(p=Ue(h,f=i))*p-(g=Ue(f,f))*(Ue(h,h)-1))<0?void 0:(ze(d=je(f,(-p-(i=Pe(d)))/g),h),d=Ge(d),r?(o=t[0],s=e[0],a=t[1],e=e[1],s<o&&(c=o,o=s,s=c),!(l=we((u=s-o)-_e)<me)&&e<a&&(c=a,a=e,e=c),(l||u<me?l?0<a+e^d[1]<(we(d[0]-o)<me?a:e):a<=d[1]&&d[1]<=e:_e<u^(o<=d[0]&&d[0]<=s))?(ze(c=je(f,(-p+i)/g),h),[d,Ge(c)]):void 0):d)):!r&&t}function a(e,n){var i=r?t:_e-t,o=0;return e<-i?o|=1:i<e&&(o|=2),n<-i?o|=4:i<n&&(o|=8),o}return mn(o,(function(t){var e,n,u,l,c;return{lineStart:function(){l=u=!1,c=1},point:function(h,p){var f,g=[h,p],d=o(h,p);h=r?d?0:a(h,p):d?a(h+(h<0?_e:-_e),p):0,!e&&(l=u=d)&&t.lineStart(),d===u||(f=s(e,g))&&!Qe(e,f)&&!Qe(g,f)||(g[0]+=me,g[1]+=me,d=o(g[0],g[1])),d!==u?(c=0,d?(t.lineStart(),f=s(g,e),t.point(f[0],f[1])):(f=s(e,g),t.point(f[0],f[1]),t.lineEnd()),e=f):i&&e&&r^d&&(h&n||!(p=s(g,e,!0))||(c=0,r?(t.lineStart(),t.point(p[0][0],p[0][1]),t.point(p[1][0],p[1][1]),t.lineEnd()):(t.point(p[1][0],p[1][1]),t.lineEnd(),t.lineStart(),t.point(p[0][0],p[0][1])))),!d||e&&Qe(e,g)||t.point(g[0],g[1]),e=g,u=d,n=h},lineEnd:function(){u&&t.lineEnd(),e=null},clean:function(){return c|(l&&u)<<1}}}),(function(n,r,i,o){!function(t,e,n,r,i,o){if(n){var s=Se(e),a=Ce(e),u=r*n;null==i?(i=e+r*Ee,o=e-u/2):(i=Ze(s,i),o=Ze(s,o),(0<r?i<o:o<i)&&(i+=r*Ee));for(var l,c=i;0<r?o<c:c<o;c-=u)l=Ge([s,-a*Se(c),-a*Ce(c)]),t.point(l[0],l[1])}}(o,t,e,i,n,r)}),r?[0,-t]:[-_e,t-_e])}function bn(t){return t}function In(t){return function(e){var n,r=new wn;for(n in t)r[n]=t[n];return r.stream=e,r}}function wn(){}function Nn(t,e,n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],o=t.clipExtent&&t.clipExtent(),s=(t.scale(150).translate([0,0]),null!=o&&t.clipExtent(null),function(t,e){t&&Ae.hasOwnProperty(t.type)?Ae[t.type](t,e):Oe(t,e)}(n,t.stream(yn)),n=yn.result(),Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])));return r=+e[0][0]+(r-s*(n[1][0]+n[0][0]))/2,e=+e[0][1]+(i-s*(n[1][1]+n[0][1]))/2,null!=o&&t.clipExtent(o),t.scale(150*s).translate([r,e])}wn.prototype={constructor:wn,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var Ln=16,Sn=Se(30*Ie);function Cn(t,e){return+e?(r=t,i=e,function(t){var e,n,i,s,a,u,l,c,h,p,f,g,d={point:y,lineStart:m,lineEnd:v,polygonStart:function(){t.polygonStart(),d.lineStart=x},polygonEnd:function(){t.polygonEnd(),d.lineStart=m}};function y(e,n){e=r(e,n),t.point(e[0],e[1])}function m(){c=NaN,d.point=_,t.lineStart()}function _(e,n){var i=Be([e,n]);n=r(e,n),o(c,h,l,p,f,g,c=n[0],h=n[1],l=e,p=i[0],f=i[1],g=i[2],Ln,t),t.point(c,h)}function v(){d.point=y,t.lineEnd()}function x(){m(),d.point=E,d.lineEnd=b}function E(t,r){_(e=t,r),n=c,i=h,s=p,a=f,u=g,d.point=_}function b(){o(c,h,l,p,f,g,n,i,e,s,a,u,Ln,t),d.lineEnd=v,v()}return d}):(n=t,In({point:function(t,e){t=n(t,e),this.stream.point(t[0],t[1])}}));var n,r,i;function o(t,e,n,s,a,u,l,c,h,p,f,g,d,y){var m,_,v,x,E,b,I,w,N,L,S=l-t,C=c-e,P=S*S+C*C;4*i<P&&d--&&(v=u+g,I=Te(v/=x=Pe((m=s+p)*m+(_=a+f)*_+v*v)),E=we(we(v)-1)<me||we(n-h)<me?(n+h)/2:Le(_,m),b=(I=r(E,I))[0],I=I[1],i<(L=C*(w=b-t)-S*(N=I-e))*L/P||.3<we((S*w+C*N)/P-.5)||s*p+a*f+u*g<Sn)&&(o(t,e,n,s,a,u,b,I,E,m/=x,_/=x,v,d,y),y.point(b,I),o(b,I,E,m,_,v,l,c,h,p,f,g,d,y))}}var Pn=In({point:function(t,e){this.stream.point(t*Ie,e*Ie)}});function Mn(t){return function(e,n){var r=Se(e),i=Se(n);return[(r=t(r*i))*i*Ce(e),r*Ce(n)]}}function Tn(t){return function(e,n){var r=Pe(e*e+n*n),i=t(r),o=Ce(i);return i=Se(i),[Le(e*o,r*i),Te(r&&n*o/r)]}}var Rn=Mn((function(t){return Pe(2/(1+t))}));Rn.invert=Tn((function(t){return 2*Te(t/2)}));var On=Mn((function(t){return(t=Me(t))&&t/Ce(t)}));function An(t,e,n,r){var i,o,s=t.properties||{},a="Feature"===t.type?t.geometry:t;return"GeometryCollection"===a.type?(i=[],Z(t,(function(t){(t=An(t,e,n,r))&&i.push(t)})),U(i)):(t=function(t){return t=[-(t=he(t).geometry.coordinates)[0],-t[1]],function(t){return s=function(){return t},m=150,_=480,v=250,w=I=b=E=x=0,N=null,L=xn,S=null,C=bn,M=Cn(r,P=.5),e.stream=function(t){return d&&y===t?d:d=Pn(L(c,M(C(y=t))))},e.clipAngle=function(t){return arguments.length?(L=+t?En(N=t*Ie,6*Ie):(N=null,xn),o()):N*be},e.clipExtent=function(t){return arguments.length?(C=null==t?(S=p=f=g=null,bn):cn(S=+t[0][0],p=+t[0][1],f=+t[1][0],g=+t[1][1]),o()):null==S?null:[[S,p],[f,g]]},e.scale=function(t){return arguments.length?(m=+t,i()):m},e.translate=function(t){return arguments.length?(_=+t[0],v=+t[1],i()):[_,v]},e.center=function(t){return arguments.length?(x=t[0]%360*Ie,E=t[1]%360*Ie,i()):[x*be,E*be]},e.rotate=function(t){return arguments.length?(b=t[0]%360*Ie,I=t[1]%360*Ie,w=2<t.length?t[2]%360*Ie:0,i()):[b*be,I*be,w*be]},e.precision=function(t){return arguments.length?(M=Cn(r,P=t*t),o()):Pe(P)},e.fitExtent=function(t,n){return Nn(e,t,n)},e.fitSize=function(t,n){return Nn(e,[[0,0],t],n)},function(){return a=s.apply(this,arguments),e.invert=a.invert&&n,i()}();function e(t){return[(t=h(t[0]*Ie,t[1]*Ie))[0]*m+u,l-t[1]*m]}function n(t){return(t=h.invert((t[0]-u)/m,(l-t[1])/m))&&[t[0]*be,t[1]*be]}function r(t,e){return[(t=a(t,e))[0]*m+u,l-t[1]*m]}function i(){h=Xe(c=He(b,I,w),a);var t=a(x,E);return u=_-t[0]*m,l=v+t[1]*m,o()}function o(){return d=y=null,e}var s,a,u,l,c,h,p,f,g,d,y,m,_,v,x,E,b,I,w,N,L,S,C,P,M}(On).scale(79.4188).clipAngle(179.999).rotate(t).scale(A)}(a),a={type:a.type,coordinates:function t(e,n){return"object"!=typeof e[0]?n(e):e.map((function(e){return t(e,n)}))}(a.coordinates,t)},a=(new pe.GeoJSONReader).read(a),o=z(j(e,n),"meters"),a=pe.BufferOp.bufferOp(a,o,r),function t(e){return Array.isArray(e[0])?t(e[0]):isNaN(e[0])}((a=(new pe.GeoJSONWriter).write(a)).coordinates)?void 0:F({type:a.type,coordinates:function t(e,n){return"object"!=typeof e[0]?n.invert(e):e.map((function(e){return t(e,n)}))}(a.coordinates,t)},s))}On.invert=Tn((function(t){return t})),Tn(Ne),Tn(Te),Tn((function(t){return 2*Ne(t)}));const Dn=function(t,e,n){var r=(n=n||{}).units||"kilometers",i=n.steps||8;if(!t)throw new Error("geojson is required");if("object"!=typeof n)throw new Error("options must be an object");if("number"!=typeof i)throw new Error("steps must be an number");if(void 0===e)throw new Error("radius is required");if(i<=0)throw new Error("steps must be greater than 0");var o=[];switch(t.type){case"GeometryCollection":return Z(t,(function(t){(t=An(t,e,r,i))&&o.push(t)})),U(o);case"FeatureCollection":return K(t,(function(t){(t=An(t,e,r,i))&&K(t,(function(t){t&&o.push(t)}))})),U(o)}return An(t,e,r,i)},Fn=function(t){var e;if(t)return e=[],$(t,(function(t){var n=t,r=e,i=[],o=n.geometry;if(null!==o){switch(o.type){case"Polygon":i=ot(o);break;case"LineString":i=[ot(o)]}i.forEach((function(t){var e,i;e=n.properties,i=[],t.reduce((function(t,n){var r,o,s,a=B([t,n],e);return a.bbox=(r=n,o=t[0],t=t[1],[o<(s=r[0])?o:s,t<(r=r[1])?t:r,s<o?o:s,r<t?t:r]),i.push(a),n})),i.forEach((function(t){t.id=r.length,r.push(t)}))}))}})),U(e);throw new Error("geojson is required")};var kn=t(787);function Gn(t,e){if(t=ot(t),e=ot(e),2!==t.length)throw new Error("<intersects> line1 must only contain 2 coordinates");if(2!==e.length)throw new Error("<intersects> line2 must only contain 2 coordinates");var n=t[0][0],r=t[0][1],i=t[1][0],o=(t=t[1][1],e[0][0]),s=e[0][1],a=e[1][0],u=((e=e[1][1])-s)*(i-n)-(a-o)*(t-r);return a=(a-o)*(r-s)-(e-s)*(n-o),e=(i-n)*(r-s)-(t-r)*(n-o),0!=u&&(s=e/u,0<=(o=a/u))&&o<=1&&0<=s&&s<=1?k([n+o*(i-n),r+o*(t-r)]):null}const Bn=function(t,e){var n,r,i={},o=[];return"LineString"===t.type&&(t=F(t)),"LineString"===e.type&&(e=F(e)),"Feature"===t.type&&"Feature"===e.type&&null!==t.geometry&&null!==e.geometry&&"LineString"===t.geometry.type&&"LineString"===e.geometry.type&&2===t.geometry.coordinates.length&&2===e.geometry.coordinates.length?(n=Gn(t,e))&&o.push(n):((r=kn()).load(Fn(e)),K(Fn(t),(function(t){K(r.search(t),(function(e){var n;(e=Gn(t,e))&&(n=ot(e).join(","),i[n]||(i[n]=!0,o.push(e)))}))}))),U(o)},Un=function(t,e,n){void 0===n&&(n={});var r=k([1/0,1/0],{dist:1/0}),i=0;return $(t,(function(t){for(var o=ot(t),s=0;s<o.length-1;s++){var a=k(o[s]),u=(a.properties.dist=jt(e,a,n),k(o[s+1])),l=(u.properties.dist=jt(e,u,n),jt(a,u,n)),c=Math.max(a.properties.dist,u.properties.dist),h=Xt(a,u),p=ut(e,c,h+90,n);c=ut(e,c,h-90,n),h=Bn(B([p.geometry.coordinates,c.geometry.coordinates]),B([a.geometry.coordinates,u.geometry.coordinates])),p=null,0<h.features.length&&((p=h.features[0]).properties.dist=jt(e,p,n),p.properties.location=i+jt(a,p,n)),a.properties.dist<r.properties.dist&&((r=a).properties.index=s,r.properties.location=i),u.properties.dist<r.properties.dist&&((r=u).properties.index=s+1,r.properties.location=i+l),p&&p.properties.dist<r.properties.dist&&((r=p).properties.index=s),i+=l}})),r},qn=function(t,e,n){return void 0===n&&(n={}),t=it(t),(e=it(e))[0]+=180<e[0]-t[0]?-360:180<t[0]-e[0]?360:0,Y(function(t,e,n){n=n=void 0===n?A:Number(n);var r=t[1]*Math.PI/180,i=e[1]*Math.PI/180,o=i-r;return(e=Math.abs(e[0]-t[0])*Math.PI/180)>Math.PI&&(e-=2*Math.PI),t=Math.log(Math.tan(i/2+Math.PI/4)/Math.tan(r/2+Math.PI/4)),i=1e-11<Math.abs(t)?o/t:Math.cos(r),Math.sqrt(o*o+i*i*e*e)*n}(t,e),"meters",n.units)};function zn(t,e){return t[0]*e[0]+t[1]*e[1]}function jn(t,e,n){return("planar"===n.method?qn:jt)(t,e,n)}const Vn=function(t,e,n){if((n=void 0===n?{}:n).method||(n.method="geodesic"),n.units||(n.units="kilometers"),!t)throw new Error("pt is required");if(Array.isArray(t)?t=k(t):"Point"===t.type?t=F(t):st(t,"Point","point"),!e)throw new Error("line is required");Array.isArray(e)?e=B(e):"LineString"===e.type?e=F(e):st(e,"LineString","line");var r=1/0,i=t.geometry.coordinates;return Q(e,(function(t){var e=t.geometry.coordinates[0];t=t.geometry.coordinates[1],e=function(t,e,n,r){var i=[n[0]-e[0],n[1]-e[1]],o=zn([t[0]-e[0],t[1]-e[1]],i);if(o<=0)return jn(t,e,{method:r.method,units:"degrees"});var s=zn(i,i);return s<=o?jn(t,n,{method:r.method,units:"degrees"}):(n=o/s,jn(t,o=[e[0]+n*i[0],e[1]+n*i[1]],{method:r.method,units:"degrees"}))}(i,e,t,n),e<r&&(r=e)})),Y(r,"degrees",n.units)},Xn=function(t,e,n){void 0===n&&(n={});for(var r=it(t),i=ot(e),o=0;o<i.length-1;o++){var s=!1;if(n.ignoreEndVertices&&(0===o&&(s="start"),o===i.length-2&&(s="end"),0===o)&&o+1===i.length-1&&(s="both"),function(t,e,n,r,i){var o=n[0],s=n[1],a=t[0],u=(t=t[1],e[0]),l=u-a,c=(e=e[1])-t,h=(h=n[0]-a)*c-(n=n[1]-t)*l;if(null!==i){if(Math.abs(h)>i)return}else if(0!=h)return;return r?"start"===r?Math.abs(l)>=Math.abs(c)?0<l?a<o&&o<=u:u<=o&&o<a:0<c?t<s&&s<=e:e<=s&&s<t:"end"===r?Math.abs(l)>=Math.abs(c)?0<l?a<=o&&o<u:u<o&&o<=a:0<c?t<=s&&s<e:e<s&&s<=t:"both"===r?Math.abs(l)>=Math.abs(c)?0<l?a<o&&o<u:u<o&&o<a:0<c?t<s&&s<e:e<s&&s<t:void 0:Math.abs(l)>=Math.abs(c)?0<l?a<=o&&o<=u:u<=o&&o<=a:0<c?t<=s&&s<=e:e<=s&&s<=t}(i[o],i[o+1],r,s,void 0===n.epsilon?null:n.epsilon))return!0}return!1};function Yn(t,e){return!(t[0]>e[0]||t[2]<e[2]||t[1]>e[1]||t[3]<e[3])}function Hn(t,e){return t[0]===e[0]&&t[1]===e[1]}const Wn=function(t,e){var n=at(t),r=at(e),i=n.type,o=r.type;switch(i){case"Point":switch(o){case"MultiPoint":var s,a=n,u=r,l=!1;for(s=0;s<u.coordinates.length;s++)if(Hn(u.coordinates[s],a.coordinates)){l=!0;break}return l;case"LineString":return Xn(n,r,{ignoreEndVertices:!0});case"Polygon":case"MultiPolygon":return Ot(n,r,{ignoreBoundary:!0});default:throw new Error("feature2 "+o+" geometry not supported")}case"MultiPoint":switch(o){case"MultiPoint":for(var c=n,h=r,p=0;p<c.coordinates.length;p++){for(var f=!1,g=0;g<h.coordinates.length;g++)Hn(c.coordinates[p],h.coordinates[g])&&(f=!0);if(!f)return!1}return!0;case"LineString":for(var d=n,y=r,m=!1,_=0;_<d.coordinates.length;_++){if(!Xn(d.coordinates[_],y))return!1;m=m||Xn(d.coordinates[_],y,{ignoreEndVertices:!0})}return m;case"Polygon":case"MultiPolygon":for(var v=n,x=r,E=!0,b=!1,I=0;I<v.coordinates.length;I++){if(!(b=Ot(v.coordinates[1],x))){E=!1;break}b=Ot(v.coordinates[1],x,{ignoreBoundary:!0})}return E&&b;default:throw new Error("feature2 "+o+" geometry not supported")}case"LineString":switch(o){case"LineString":for(var w=n,N=r,L=0;L<w.coordinates.length;L++)if(!Xn(w.coordinates[L],N))return!1;return!0;case"Polygon":case"MultiPolygon":var S=n,C=r;if(!Yn(et(C),et(S)))return!1;for(var P,M=!1,T=0;T<S.coordinates.length-1;T++){if(!Ot(S.coordinates[T],C))return!1;(M=M||Ot(S.coordinates[T],C,{ignoreBoundary:!0}))||(P=function(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]}(S.coordinates[T],S.coordinates[T+1]),M=Ot(P,C,{ignoreBoundary:!0}))}return M;default:throw new Error("feature2 "+o+" geometry not supported")}case"Polygon":switch(o){case"Polygon":case"MultiPolygon":var R=n,O=r,A=et(R);if(!Yn(et(O),A))return!1;for(var D=0;D<R.coordinates[0].length;D++)if(!Ot(R.coordinates[0][D],O))return!1;return!0;default:throw new Error("feature2 "+o+" geometry not supported")}default:throw new Error("feature1 "+i+" geometry not supported")}},Jn=function(t,e,n){(n=void 0===n?{}:n).mask&&!n.units&&(n.units="kilometers");for(var r=[],i=t[0],o=t[1],s=t[2],a=t[3],u=e/jt([i,o],[s,o],n)*(s-i),l=e/jt([i,o],[i,a],n)*(a-o),c=(t=s-i,e=a-o,Math.floor(t/u)),h=(e-Math.floor(e/l)*l)/2,p=i+(t-c*u)/2;p<=s;){for(var f=o+h;f<=a;){var g=k([p,f],n.properties);(!n.mask||Wn(g,n.mask))&&r.push(g),f+=l}p+=u}return U(r)};var Kn=t(676);function Zn(t){return q(t)}const $n=function(t,e){var n=G(e&&e.geometry.coordinates||[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]);return("FeatureCollection"===t.type?Zn(2===(e=t).features.length?Kn.union(e.features[0].geometry.coordinates,e.features[1].geometry.coordinates):Kn.union.apply(Kn,e.features.map((function(t){return t.geometry.coordinates})))):Zn(Kn.union(t.geometry.coordinates))).geometry.coordinates.forEach((function(t){n.geometry.coordinates.push(t[0])})),n},Qn=function(t,e,n){return void 0===n&&(n={}),t=at(t),e=at(e),0===(t=Kn.union(t.coordinates,e.coordinates)).length?null:1===t.length?G(t[0],n.properties):q(t,n.properties)};function tr(t,e){if("FeatureCollection"===e.type){for(var n=0;n<e.features.length;n++)if(Ot(t,e.features[n]))return!0;return!1}if("Feature"===e.type)return Ot(t,e.geometry)}var er=function(){function t(t){if(!t)throw new Error("Map instance is required");this.map=t}var e=t.prototype;return e.draw=function(t,e,n){var r,i=this;if(c(t)&&e)try{n=n||{},this.options=n;var s,a,u=(r=this.map).querySourceFeatures.apply(r,[e].concat(n)).filter((function(e){return tr(e.geometry.coordinates,t)})),l=this.map.style._layers,h=[],p=[];for(s in l)!Object.prototype.hasOwnProperty.call(l,s)||(a=l[s]).source!==e||n.sourceLayer&&n.sourceLayer!==a.sourceLayer||(h.push(a.id),p.push(this.map.getLayer(a.id)));var f={type:"FeatureCollection",features:u.map((function(t){return{id:t.id,type:t.type,geometry:t.geometry,properties:t.properties}}))};this.sourceName=e+"_copy",this.layerName=[],this.map.addSource(this.sourceName,{type:"geojson",data:f}),p.forEach((function(t){var n=t.id+"_copy";delete(t=o({},t,{source:e+"_copy","source-layer":void 0,id:n}))["source-layer"],i.layerName.push(n),i.map.addLayer(t)})),(this.originLayerName=h).forEach((function(t){i.map.setLayoutProperty(t,"visibility","none")}))}catch(n){throw console.error("Error in MapLabelByGeoJson.draw:",n),n}},e.update=function(t){var e,n,r,i,o=this;try{c(t)&&this.sourceName&&(r=this.sourceName.replace("_copy",""),i={type:"FeatureCollection",features:(e=this.map).querySourceFeatures.apply(e,[r].concat(this.options)).filter((function(e){return tr(e.geometry.coordinates,t)})).map((function(t){return{id:t.id,type:t.type,geometry:t.geometry,properties:t.properties}}))},this.map.getSource(this.sourceName).setData(i),0<(null==(n=this.layerName)?void 0:n.length))&&this.layerName.forEach((function(t){o.map.setLayoutProperty(t,"visibility","visible")}))}catch(e){throw console.error("Error in MapLabelByGeoJson.update:",e),e}},e.visible=function(t){var e,n=this;try{0<(null==(e=this.layerName)?void 0:e.length)&&this.layerName.forEach((function(e){n.map.setLayoutProperty(e,"visibility",t?"visible":"none")}))}catch(e){throw console.error("Error in MapLabelByGeoJson.visible:",e),e}},e.visibleOrigin=function(t){var e,n=this;try{0<(null==(e=this.originLayerName)?void 0:e.length)&&this.originLayerName.forEach((function(e){n.map.setLayoutProperty(e,"visibility",t?"visible":"none")}))}catch(e){throw console.error("Error in MapLabelByGeoJson.visibleOrigin:",e),e}},e.destroy=function(){var t,e=this;try{0<(null==(t=this.layerName)?void 0:t.length)&&(this.layerName.forEach((function(t){e.map.removeLayer(t)})),this.layerName=[]),this.sourceName&&(this.map.removeSource(this.sourceName),this.sourceName=null)}catch(t){throw console.error("Error in MapLabelByGeoJson.destroy:",t),t}},t}();function nr(t,e){var n=X(t[1]),r=X(e[1]);return(e=X(e[0]-t[0]))>Math.PI&&(e-=2*Math.PI),e<-Math.PI&&(e+=2*Math.PI),t=Math.log(Math.tan(r/2+Math.PI/4)/Math.tan(n/2+Math.PI/4)),(V(Math.atan2(e,t))+360)%360}const rr=function(t,e,n){return 180<(n=(n=void 0===n?{}:n).final?nr(it(e),it(t)):nr(it(t),it(e)))?-(360-n):n},ir=function(t,e,n,r){void 0===r&&(r={});var i,o,s,a,u=e<0;return e=Y(Math.abs(e),r.units,"meters"),u&&(e=-Math.abs(e)),t=u=it(t),e/=i=void 0===i?A:Number(i),i=t[0]*Math.PI/180,t=X(t[1]),n=X(n),s=t+(o=e*Math.cos(n)),Math.abs(s)>Math.PI/2&&(s=0<s?Math.PI-s:-Math.PI-s),a=Math.log(Math.tan(s/2+Math.PI/4)/Math.tan(t/2+Math.PI/4)),o=1e-11<Math.abs(a)?o/a:Math.cos(t),(t=[(180*(i+(a=e*Math.sin(n)/o))/Math.PI+540)%360-180,180*s/Math.PI])[0]+=180<t[0]-u[0]?-360:180<u[0]-t[0]?360:0,k(t,r.properties)};function or(t){var e={type:"Feature"};return Object.keys(t).forEach((function(n){switch(n){case"type":case"properties":case"geometry":return;default:e[n]=t[n]}})),e.properties=function t(e){var n={};return e?(Object.keys(e).forEach((function(r){var i=e[r];"object"==typeof i?null===i?n[r]=null:Array.isArray(i)?n[r]=i.map((function(t){return t})):n[r]=t(i):n[r]=i})),n):n}(t.properties),e.geometry=sr(t.geometry),e}function sr(t){var e={type:t.type};return t.bbox&&(e.bbox=t.bbox),"GeometryCollection"===t.type?e.geometries=t.geometries.map(sr):e.coordinates=function t(e){return"object"!=typeof e[0]?e.slice():e.map((function(e){return t(e)}))}(t.coordinates),e}const ar=function(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return or(t);case"FeatureCollection":return e=t,n={type:"FeatureCollection"},Object.keys(e).forEach((function(t){switch(t){case"type":case"features":return;default:n[t]=e[t]}})),n.features=e.features.map(or),n;case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return sr(t);default:throw new Error("unknown GeoJSON type")}var e,n};function ur(t,e,n){var r="Point"===("FeatureCollection"===(r=t).type?"FeatureCollection":"GeometryCollection"===r.type?"GeometryCollection":("Feature"===r.type&&null!==r.geometry?r.geometry:r).type);return n=function(t,e){if(null==e&&(e="centroid"),Array.isArray(e)||"object"==typeof e)return it(e);var n=t.bbox||et(t),r=n[0],i=n[1],o=n[2],s=n[3];switch(e){case"sw":case"southwest":case"westsouth":case"bottomleft":return k([r,i]);case"se":case"southeast":case"eastsouth":case"bottomright":return k([o,i]);case"nw":case"northwest":case"westnorth":case"topleft":return k([r,s]);case"ne":case"northeast":case"eastnorth":case"topright":return k([o,s]);case"center":return he(t);case void 0:case null:case"centroid":return Zt(t);default:throw new Error("invalid origin")}}(t,n),1===e||r||J(t,(function(t){var r=qn(n,t),i=rr(n,t);r=ot(ir(n,r*=e,i)),t[0]=r[0],t[1]=r[1],3===t.length&&(t[2]*=e)})),t}var lr=["beforeId","rotation","pivot","factor","origin","distance","direction"];function cr(t,e){var n,r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=function(t,e){var n;if(t)return"string"==typeof t?hr(t,e):"Map"===(n="Object"===(n=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?hr(t,e):void 0}(t))||e&&t&&"number"==typeof t.length)return r&&(t=r),n=0,function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function hr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var pr=function(){function t(t,e){this.map=t,this.addedSources=new Map,this.addedLayers=new Set,this.visibleFeatures=new Set,this.sourceConfig=null!=(t=null==e?void 0:e.sourceConfig)?t:{}}var e=t.prototype;return e.draw=function(t,e,n){c(t)&&e&&n&&"function"==typeof n&&(t=l(t).features,this.key=e,this.callback=n,this.features=t.filter((function(t){return"Polygon"===t.geometry.type})),this._updateVisibleImages=this._updateVisibleImages.bind(this),this._updateVisibleImages(),this.map.on("move",this._updateVisibleImages))},e._getVisibleFeatures=function(){var t=this,e=this.map.getBounds(),n=[];return this.features.forEach((function(r,i){var o,s,a,u,l;r.geometry&&r.geometry.coordinates&&r.geometry.coordinates[0]&&((o=r.geometry.coordinates[0]).length<3||(a=s=1/0,l=u=-1/0,o.forEach((function(t){s=Math.min(s,t[0]),u=Math.max(u,t[0]),a=Math.min(a,t[1]),l=Math.max(l,t[1])})),t._boundsIntersect(e,{getWest:function(){return s},getEast:function(){return u},getSouth:function(){return a},getNorth:function(){return l}})&&n.push({feature:r,index:i})))})),n},e._boundsIntersect=function(t,e){return!(t.getWest()>e.getEast()||t.getEast()<e.getWest()||t.getSouth()>e.getNorth()||t.getNorth()<e.getSouth())},e._updateVisibleImages=function(){var t=this,e=this._getVisibleFeatures(),n=new Set;e.forEach((function(e){var r=e.feature,i=e=e.index;n.add(i),t.visibleFeatures.has(i)||(t._addImageFeature(r,e),t.visibleFeatures.add(i))}));for(var r=cr(this.visibleFeatures);!(i=r()).done;){var i=i.value;n.has(i)||(this._removeImageFeature(i),this.visibleFeatures.delete(i))}},e._addImageFeature=function(t,e){if(t&&t.properties){var n="image-source-"+e,r="image-layer-"+e,s=this.callback(t),a=void 0===(a=(p=s||{}).rotation)?0:a,u=p.pivot,l=void 0===(l=p.factor)?1:l,c=p.origin,h=void 0===(h=p.distance)?0:h,p=void 0===(p=p.direction)?0:p,f=(s&&Object.prototype.hasOwnProperty.call(s,this.key)?s:t.properties)[this.key];u=u&&Array.isArray(u)&&2===u.length?u:null,c=c&&Array.isArray(c)&&2===c.length?c:null;try{var g,d,y,m,_=t;0===h&&0===p||(_=function(t,e,n,r){if(!W(r=r||{}))throw new Error("options is invalid");var i=r.units,o=r.zTranslation;if(r=r.mutate,!t)throw new Error("geojson is required");if(null==e||isNaN(e))throw new Error("distance is required");if(o&&"number"!=typeof o&&isNaN(o))throw new Error("zTranslation is not a number");if(o=void 0!==o?o:0,0!==e||0!==o){if(null==n||isNaN(n))throw new Error("direction is required");e<0&&(e=-e,n+=180),J(t=!1!==r&&void 0!==r?t:ar(t),(function(t){var r=ot(ir(t,e,n,{units:i}));t[0]=r[0],t[1]=r[1],o&&3===t.length&&(t[2]+=o)}))}return t}(_,h,p,{units:"meters"})),0!==a&&(_=function(t,e,n){if(!W(n=n||{}))throw new Error("options is invalid");var r=n.pivot;if(n=n.mutate,!t)throw new Error("geojson is required");if(null==e||isNaN(e))throw new Error("angle is required");return 0!==e&&(r=r||Zt(t),J(t=!1!==n&&void 0!==n?t:ar(t),(function(t){var n=rr(r,t)+e,i=qn(r,t);i=ot(ir(r,i,n)),t[0]=i[0],t[1]=i[1]}))),t}(_,a,{pivot:u})),(_=1!==l?function(t,e,n){if(!W(n=n||{}))throw new Error("options is invalid");var r=n.origin;if(n=n.mutate,!t)throw new Error("geojson required");if("number"!=typeof e||0===e)throw new Error("invalid factor");var i=Array.isArray(r)||"object"==typeof r;return"FeatureCollection"!==(t=!0!==n?ar(t):t).type||i?ur(t,e,r):(K(t,(function(n,i){t.features[i]=ur(n,e,r)})),t)}(_,l,{origin:c}):_).geometry&&_.geometry.coordinates&&_.geometry.coordinates[0]?(g=_.geometry.coordinates[0].slice(0,4),this.addedSources.has(e)||(d=o({},this.sourceConfig,{type:"image",coordinates:g}),"string"==typeof f?d.url=f:f instanceof HTMLImageElement?d.url=f.src:(f instanceof ImageData||"object"==typeof f&&f.data&&f.width&&f.height,d.url=f),this.map.addSource(n,d),this.addedSources.set(e,n)),this.addedLayers.has(r)||(s&&"object"==typeof s?(y=s.beforeId,s.rotation,s.pivot,s.factor,s.origin,s.distance,s.direction,m=i(s,lr),Object.prototype.hasOwnProperty.call(m,this.key)&&delete m[this.key],this.map.addLayer(o({},m,{id:r,type:"raster",source:n}),y)):this.map.addLayer({id:r,type:"raster",source:n,paint:{"raster-opacity":1}}),this.addedLayers.add(r))):console.warn("Transformed feature has invalid geometry")}catch(t){console.error("Error processing image feature:",t)}}else console.warn("Invalid feature provided to _addImageFeature")},e._removeImageFeature=function(t){var e="image-source-"+t,n="image-layer-"+t;this.addedLayers.has(n)&&this.map.getLayer(n)&&(this.map.removeLayer(n),this.addedLayers.delete(n)),this.addedSources.has(t)&&this.map.getSource(e)&&(this.map.removeSource(e),this.addedSources.delete(t))},e.visible=function(t){var e=this;this.addedLayers.forEach((function(n){e.map.setLayoutProperty(n,"visibility",t?"visible":"none")}))},e.destroy=function(){var t;if(0<(null==(t=this.features)?void 0:t.length)&&this.key&&this.callback){this.map.off("move",this._updateVisibleImages);for(var e=cr(this.visibleFeatures);!(n=e()).done;){var n=n.value;this._removeImageFeature(n)}this.visibleFeatures.clear(),this.addedSources.clear(),this.addedLayers.clear()}},t}(),fr=t(481),gr=t.n(fr),dr=t(630),yr=t.n(dr),mr=function(){function t(e,n,r){if((this instanceof t?this.constructor:void 0)!==t)throw new Error("MapLayer is a constructor and should be called with the new keyword");this._type="MapLayer";var i={layer:null,tooltip:null,popup:null};return n&&"object"==typeof n&&(i=o({},i,n)),this.name=null===e||""===e||void 0===e?L():e,this.layers=i,this.prop=null!=r?r:{},new Proxy(this,{deleteProperty:function(t,e){return(t!==this||"layers"!==e&&"name"!==e)&&(delete t[e],!0)},set:function(t,e,n){return(t!==this||"layers"!==e&&"name"!==e)&&(t[e]=n,!0)}})}var e=t.prototype;return e.addLayer=function(t){if(t&&"object"==typeof t)for(var e in t)this.layers[e]=t[e]},e.addProp=function(t){if(t&&"object"==typeof t)for(var e in t)this.prop[e]=t[e]},t}(),_r=["padding","animate","maxZoom","essential"],vr=["url"],xr=["interactive"],Er=null,br=null,Ir=function(t){return/^#([0-9a-fA-F]{3}){1,2}$/.test(t)},wr=["line-color","line-opacity"],Nr=["fill-color","fill-opacity"],Lr=["background-color","background-opacity"],Sr=["text-color","text-opacity"],Cr="zh_custom",Pr=function(t,e,n,r){if(n&&(Ir(n)||Array.isArray(n))){var i=t.getLayer(e);if(i){var o=[];switch(i.type){case"line":o=wr;break;case"fill":o=Nr;break;case"background":o=Lr;break;case"symbol":o=Sr}0<o.length&&(t.setPaintProperty(e,o[0],n),null!==r)&&t.setPaintProperty(e,o[1],r)}}},Mr=function(t,e,n,r){if(e&&n&&"string"==typeof e&&t.getLayer(e)&&"object"==typeof n)for(var i in n)null!==n[i]&&void 0!==n[i]&&t[r](e,i,n[i])},Tr=function(t,e){var n;null!=(n=t[Cr])&&n.mapLayer||(t[Cr].mapLayer=[]),t[Cr].mapLayer.push(e)},Rr=function(t){var e;return null!=(e=t[Cr])&&e.mapLayer||(t[Cr].mapLayer=[]),t[Cr].mapLayer},Or=function(t,e,n){var r,i,o;void 0===n&&(n=!0),null!=(r=t[Cr])&&r.mapLayer||(t[Cr].mapLayer=[]),e?(i=[],"string"==typeof e?i=[e]:Array.isArray(e)&&(i=e.filter((function(t){return"string"==typeof t}))),o=[],t[Cr].mapLayer.forEach((function(t){var e=t&&"MapLayer"===t._type;n?e&&i.includes(t.name)?t.destroy&&"function"==typeof t.destroy&&t.destroy():o.push(t):e&&i.includes(t.name)?o.push(t):e&&i.includes(t.name)||t&&t.destroy&&"function"==typeof t.destroy&&t.destroy()})),t[Cr].mapLayer=o):(t[Cr].mapLayer.forEach((function(t){t&&t.destroy&&"function"==typeof t.destroy&&t.destroy()})),t[Cr].mapLayer=[])};function Ar(t,e){if(t&&(void 0!==t[Cr]&&null!==t[Cr]||(t[Cr]={}),e)&&"object"==typeof e&&0<Object.keys(e).length){var n,r=l(e);for(n in r)t[Cr][n]=r[n]}}function Dr(t,e){if(!t||!t[Cr])return null;var n=[];if("string"==typeof e?n=e.split(".").filter(Boolean):Array.isArray(e)&&(n=e),0===n.length)return null;try{return n.reduce((function(t,e){return t&&void 0!==t[e]?t[e]:null}),t[Cr])}catch(t){return console.warn("Error getting property:",t),null}}})(),r;function t(r){var i=n[r];return void 0!==i||(i=n[r]={exports:{}},e[r].call(i.exports,i,i.exports,t)),i.exports}var e,n,r}));
2
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("zMapUtil",[],e):"object"==typeof exports?exports.zMapUtil=e():t.zMapUtil=e()}(this,(()=>{return e={705:(t,e,n)=>{"use strict";var r=n(540);function i(t){var e=[1/0,1/0,-1/0,-1/0];return r.coordEach(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}e.Z=i.default=i},102:(t,e)=>{"use strict";function n(t,e,n){var r={type:"Feature"};return 0!==(n=void 0===n?{}:n).id&&!n.id||(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=e||{},r.geometry=t,r}function r(t,e,r){if(void 0===r&&(r={}),!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(f(t[0])&&f(t[1]))return n({type:"Point",coordinates:t},e,r);throw new Error("coordinates must contain numbers")}function i(t,e,r){void 0===r&&(r={});for(var i=0,o=t;i<o.length;i++){var s=o[i];if(s.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<s[s.length-1].length;a++)if(s[s.length-1][a]!==s[0][a])throw new Error("First and last Position are not equivalent.")}return n({type:"Polygon",coordinates:t},e,r)}function o(t,e,r){if(void 0===r&&(r={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");return n({type:"LineString",coordinates:t},e,r)}function s(t,e){var n={type:"FeatureCollection"};return(e=void 0===e?{}:e).id&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.features=t,n}function a(t,e,r){return n({type:"MultiLineString",coordinates:t},e,r=void 0===r?{}:r)}function u(t,e,r){return n({type:"MultiPoint",coordinates:t},e,r=void 0===r?{}:r)}function l(t,e,r){return n({type:"MultiPolygon",coordinates:t},e,r=void 0===r?{}:r)}function c(t,n){var r=e.factors[n=void 0===n?"kilometers":n];if(r)return t*r;throw new Error(n+" units is invalid")}function h(t,n){var r=e.factors[n=void 0===n?"kilometers":n];if(r)return t/r;throw new Error(n+" units is invalid")}function p(t){return t%(2*Math.PI)*180/Math.PI}function f(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.earthRadius=6371008.8,e.factors={centimeters:100*e.earthRadius,centimetres:100*e.earthRadius,degrees:e.earthRadius/111325,feet:3.28084*e.earthRadius,inches:39.37*e.earthRadius,kilometers:e.earthRadius/1e3,kilometres:e.earthRadius/1e3,meters:e.earthRadius,metres:e.earthRadius,miles:e.earthRadius/1609.344,millimeters:1e3*e.earthRadius,millimetres:1e3*e.earthRadius,nauticalmiles:e.earthRadius/1852,radians:1,yards:1.0936*e.earthRadius},e.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/e.earthRadius,yards:1.0936133},e.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},e.feature=n,e.geometry=function(t,e,n){switch(void 0===n&&(n={}),t){case"Point":return r(e).geometry;case"LineString":return o(e).geometry;case"Polygon":return i(e).geometry;case"MultiPoint":return u(e).geometry;case"MultiLineString":return a(e).geometry;case"MultiPolygon":return l(e).geometry;default:throw new Error(t+" is invalid")}},e.point=r,e.points=function(t,e,n){return void 0===n&&(n={}),s(t.map((function(t){return r(t,e)})),n)},e.polygon=i,e.polygons=function(t,e,n){return void 0===n&&(n={}),s(t.map((function(t){return i(t,e)})),n)},e.lineString=o,e.lineStrings=function(t,e,n){return void 0===n&&(n={}),s(t.map((function(t){return o(t,e)})),n)},e.featureCollection=s,e.multiLineString=a,e.multiPoint=u,e.multiPolygon=l,e.geometryCollection=function(t,e,r){return n({type:"GeometryCollection",geometries:t},e,r=void 0===r?{}:r)},e.round=function(t,e){if(!(e=void 0===e?0:e)||0<=e)return e=Math.pow(10,e||0),Math.round(t*e)/e;throw new Error("precision must be a positive number")},e.radiansToLength=c,e.lengthToRadians=h,e.lengthToDegrees=function(t,e){return p(h(t,e))},e.bearingToAzimuth=function(t){return(t%=360)<0&&(t+=360),t},e.radiansToDegrees=p,e.degreesToRadians=function(t){return t%360*Math.PI/180},e.convertLength=function(t,e,n){if(void 0===e&&(e="kilometers"),void 0===n&&(n="kilometers"),0<=t)return c(h(t,e),n);throw new Error("length must be a positive number")},e.convertArea=function(t,n,r){if(void 0===n&&(n="meters"),void 0===r&&(r="kilometers"),!(0<=t))throw new Error("area must be a positive number");if(!(n=e.areaFactors[n]))throw new Error("invalid original units");if(r=e.areaFactors[r])return t/n*r;throw new Error("invalid final units")},e.isNumber=f,e.isObject=function(t){return!!t&&t.constructor===Object},e.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(!f(t))throw new Error("bbox must only contain numbers")}))},e.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")}},540:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(102);function i(t,e,n){if(null!==t)for(var r,o,s,a=0,u=t.type,l="FeatureCollection"===u,c="Feature"===u,h=l?t.features.length:1,p=0;p<h;p++)for(var f,g,d=(g=!!(f=l?t.features[p].geometry:c?t.geometry:t)&&"GeometryCollection"===f.type)?f.geometries.length:1,y=0;y<d;y++){var m=0,_=0,v=g?f.geometries[y]:f;if(null!==v){var x=v.coordinates,E=v.type,b=!n||"Polygon"!==E&&"MultiPolygon"!==E?0:1;switch(E){case null:break;case"Point":if(!1===e(x,a,p,m,_))return!1;a++,m++;break;case"LineString":case"MultiPoint":for(r=0;r<x.length;r++){if(!1===e(x[r],a,p,m,_))return!1;a++,"MultiPoint"===E&&m++}"LineString"===E&&m++;break;case"Polygon":case"MultiLineString":for(r=0;r<x.length;r++){for(o=0;o<x[r].length-b;o++){if(!1===e(x[r][o],a,p,m,_))return!1;a++}"MultiLineString"===E&&m++,"Polygon"===E&&_++}"Polygon"===E&&m++;break;case"MultiPolygon":for(r=0;r<x.length;r++){for(o=_=0;o<x[r].length;o++){for(s=0;s<x[r][o].length-b;s++){if(!1===e(x[r][o][s],a,p,m,_))return!1;a++}_++}m++}break;case"GeometryCollection":for(r=0;r<v.geometries.length;r++)if(!1===i(v.geometries[r],e,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}function o(t,e){var n;switch(t.type){case"FeatureCollection":for(n=0;n<t.features.length&&!1!==e(t.features[n].properties,n);n++);break;case"Feature":e(t.properties,0)}}function s(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var n=0;n<t.features.length&&!1!==e(t.features[n],n);n++);}function a(t,e){for(var n,r,i,o,s,a,u,l,c,h=0,p="FeatureCollection"===t.type,f="Feature"===t.type,g=p?t.features.length:1,d=0;d<g;d++){for(s=p?t.features[d].geometry:f?t.geometry:t,u=p?t.features[d].properties:f?t.properties:{},l=p?t.features[d].bbox:f?t.bbox:void 0,c=p?t.features[d].id:f?t.id:void 0,o=(a=!!s&&"GeometryCollection"===s.type)?s.geometries.length:1,r=0;r<o;r++)if(null===(i=a?s.geometries[r]:s)){if(!1===e(null,h,u,l,c))return!1}else switch(i.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===e(i,h,u,l,c))return!1;break;case"GeometryCollection":for(n=0;n<i.geometries.length;n++)if(!1===e(i.geometries[n],h,u,l,c))return!1;break;default:throw new Error("Unknown Geometry Type")}h++}}function u(t,e){a(t,(function(t,n,i,o,s){var a,u=null===t?null:t.type;switch(u){case null:case"Point":case"LineString":case"Polygon":return!1!==e(r.feature(t,i,{bbox:o,id:s}),n,0)&&void 0}switch(u){case"MultiPoint":a="Point";break;case"MultiLineString":a="LineString";break;case"MultiPolygon":a="Polygon"}for(var l=0;l<t.coordinates.length;l++){var c=t.coordinates[l];if(!1===e(r.feature({type:a,coordinates:c},i),n,l))return!1}}))}function l(t,e){u(t,(function(t,n,o){var s=0;if(t.geometry){var a,u,l,c,h=t.geometry.type;if("Point"!==h&&"MultiPoint"!==h)return c=l=u=0,!1!==i(t,(function(i,h,p,f,g){if(void 0===a||u<n||l<f||c<g)a=i,u=n,l=f,c=g,s=0;else{if(f=r.lineString([a,i],t.properties),!1===e(f,n,o,g,s))return!1;s++,a=i}}))&&void 0}}))}function c(t,e){if(!t)throw new Error("geojson is required");u(t,(function(t,n,i){if(null!==t.geometry){var o=t.geometry.type,s=t.geometry.coordinates;switch(o){case"LineString":if(!1===e(t,n,i,0,0))return!1;break;case"Polygon":for(var a=0;a<s.length;a++)if(!1===e(r.lineString(s[a],t.properties),n,i,a))return!1}}}))}e.coordAll=function(t){var e=[];return i(t,(function(t){e.push(t)})),e},e.coordEach=i,e.coordReduce=function(t,e,n,r){var o=n;return i(t,(function(t,r,i,s,a){o=0===r&&void 0===n?t:e(o,t,r,i,s,a)}),r),o},e.featureEach=s,e.featureReduce=function(t,e,n){var r=n;return s(t,(function(t,i){r=0===i&&void 0===n?t:e(r,t,i)})),r},e.findPoint=function(t,e){if(!r.isObject(e=e||{}))throw new Error("options is invalid");var n,i=e.featureIndex||0,o=e.multiFeatureIndex||0,s=e.geometryIndex||0,a=e.coordIndex||0,u=e.properties;switch(t.type){case"FeatureCollection":i<0&&(i=t.features.length+i),u=u||t.features[i].properties,n=t.features[i].geometry;break;case"Feature":u=u||t.properties,n=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":n=t;break;default:throw new Error("geojson is invalid")}if(null===n)return null;var l=n.coordinates;switch(n.type){case"Point":return r.point(l,u,e);case"MultiPoint":return o<0&&(o=l.length+o),r.point(l[o],u,e);case"LineString":return a<0&&(a=l.length+a),r.point(l[a],u,e);case"Polygon":return s<0&&(s=l.length+s),a<0&&(a=l[s].length+a),r.point(l[s][a],u,e);case"MultiLineString":return o<0&&(o=l.length+o),a<0&&(a=l[o].length+a),r.point(l[o][a],u,e);case"MultiPolygon":return o<0&&(o=l.length+o),s<0&&(s=l[o].length+s),a<0&&(a=l[o][s].length-a),r.point(l[o][s][a],u,e)}throw new Error("geojson is invalid")},e.findSegment=function(t,e){if(!r.isObject(e=e||{}))throw new Error("options is invalid");var n,i=e.featureIndex||0,o=e.multiFeatureIndex||0,s=e.geometryIndex||0,a=e.segmentIndex||0,u=e.properties;switch(t.type){case"FeatureCollection":i<0&&(i=t.features.length+i),u=u||t.features[i].properties,n=t.features[i].geometry;break;case"Feature":u=u||t.properties,n=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":n=t;break;default:throw new Error("geojson is invalid")}if(null===n)return null;var l=n.coordinates;switch(n.type){case"Point":case"MultiPoint":return null;case"LineString":return a<0&&(a=l.length+a-1),r.lineString([l[a],l[a+1]],u,e);case"Polygon":return s<0&&(s=l.length+s),a<0&&(a=l[s].length+a-1),r.lineString([l[s][a],l[s][a+1]],u,e);case"MultiLineString":return o<0&&(o=l.length+o),a<0&&(a=l[o].length+a-1),r.lineString([l[o][a],l[o][a+1]],u,e);case"MultiPolygon":return o<0&&(o=l.length+o),s<0&&(s=l[o].length+s),a<0&&(a=l[o][s].length-a-1),r.lineString([l[o][s][a],l[o][s][a+1]],u,e)}throw new Error("geojson is invalid")},e.flattenEach=u,e.flattenReduce=function(t,e,n){var r=n;return u(t,(function(t,i,o){r=0===i&&0===o&&void 0===n?t:e(r,t,i,o)})),r},e.geomEach=a,e.geomReduce=function(t,e,n){var r=n;return a(t,(function(t,i,o,s,a){r=0===i&&void 0===n?t:e(r,t,i,o,s,a)})),r},e.lineEach=c,e.lineReduce=function(t,e,n){var r=n;return c(t,(function(t,i,o,s){r=0===i&&void 0===n?t:e(r,t,i,o,s)})),r},e.propEach=o,e.propReduce=function(t,e,n){var r=n;return o(t,(function(t,i){r=0===i&&void 0===n?t:e(r,t,i)})),r},e.segmentEach=l,e.segmentReduce=function(t,e,n){var r=n,i=!1;return l(t,(function(t,o,s,a,u){r=!1===i&&void 0===n?t:e(r,t,o,s,a,u),i=!0})),r}},630:function(t){var e;e=function(){return e=[function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isNotPNG=function(t){return t===o},e.isNotAPNG=function(t){return t===s},e.default=function(t){var e=new Uint8Array(t);if(Array.prototype.some.call(a,(function(t,n){return t!==e[n]})))return o;var n=!1;if(u(e,(function(t){return!(n="acTL"===t)})),!n)return s;var r=[],p=[],f=null,g=null,d=0,y=new i.APNG;if(u(e,(function(t,e,n,o){var s=new DataView(e.buffer);switch(t){case"IHDR":f=e.subarray(n+8,n+8+o),y.width=s.getUint32(n+8),y.height=s.getUint32(n+12);break;case"acTL":y.numPlays=s.getUint32(n+8+4);break;case"fcTL":g&&(y.frames.push(g),d++),(g=new i.Frame).width=s.getUint32(n+8+4),g.height=s.getUint32(n+8+8),g.left=s.getUint32(n+8+12),g.top=s.getUint32(n+8+16);var a=s.getUint16(n+8+20),u=s.getUint16(n+8+22);g.delay=1e3*a/(u=0===u?100:u),g.delay<=10&&(g.delay=100),y.playTime+=g.delay,g.disposeOp=s.getUint8(n+8+24),g.blendOp=s.getUint8(n+8+25),g.dataParts=[],0===d&&2===g.disposeOp&&(g.disposeOp=1);break;case"fdAT":g&&g.dataParts.push(e.subarray(n+8+4,n+8+o));break;case"IDAT":g&&g.dataParts.push(e.subarray(n+8,n+8+o));break;case"IEND":p.push(l(e,n,12+o));break;default:r.push(l(e,n,12+o))}})),g&&y.frames.push(g),0==y.frames.length)return s;var m=new Blob(r),_=new Blob(p);return y.frames.forEach((function(t){var e=[];e.push(a),f.set(h(t.width),0),f.set(h(t.height),4),e.push(c("IHDR",f)),e.push(m),t.dataParts.forEach((function(t){return e.push(c("IDAT",t))})),e.push(_),t.imageData=new Blob(e,{type:"image/png"}),delete t.dataParts,e=null})),y};var r=(e=n(1))&&e.__esModule?e:{default:e},i=n(2),o=new Error("Not a PNG"),s=new Error("Not an animated PNG"),a=new Uint8Array([137,80,78,71,13,10,26,10]);function u(t,e){for(var n,r,i,o=new DataView(t.buffer),s=8;r=o.getUint32(s),i=e(n=function(t,e,n){return t=Array.prototype.slice.call(t.subarray(e,e+4)),String.fromCharCode.apply(String,t)}(t,s+4),t,s,r),s+=12+r,!1!==i&&"IEND"!=n&&s<t.length;);}function l(t,e,n){var r=new Uint8Array(n);return r.set(t.subarray(e,e+n)),r}var c=function(t,e){var n=t.length+e.length,i=new Uint8Array(n+8),o=new DataView(i.buffer);return o.setUint32(0,e.length),i.set(function(t){for(var e=new Uint8Array(t.length),n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}(t),4),i.set(e,8),t=(0,r.default)(i,4,n),o.setUint32(n+4,t),i},h=function(t){return new Uint8Array([t>>>24&255,t>>>16&255,t>>>8&255,255&t])}},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){for(var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,r=-1,i=e,o=e+(2<arguments.length&&void 0!==arguments[2]?arguments[2]:t.length-e);i<o;i++)r=r>>>8^n[255&(r^t[i])];return-1^r};for(var n=new Uint32Array(256),r=0;r<256;r++){for(var i=r,o=0;o<8;o++)i=0!=(1&i)?3988292384^i>>>1:i>>>1;n[r]=i}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Frame=e.APNG=void 0;var r=function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t};function i(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)}}var o=(n=n(3))&&n.__esModule?n:{default:n};function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(){s(this,a),this.width=0,this.height=0,this.numPlays=0,this.playTime=0,this.frames=[]}function u(){s(this,u),this.left=0,this.top=0,this.width=0,this.height=0,this.delay=0,this.disposeOp=0,this.blendOp=0,this.imageData=null,this.imageElement=null}e.APNG=(r(a,[{key:"createImages",value:function(){return Promise.all(this.frames.map((function(t){return t.createImage()})))}},{key:"getPlayer",value:function(t){var e=this,n=1<arguments.length&&void 0!==arguments[1]&&arguments[1];return this.createImages().then((function(){return new o.default(e,t,n)}))}}]),a),e.Frame=(r(u,[{key:"createImage",value:function(){var t=this;return this.imageElement?Promise.resolve():new Promise((function(e,n){var r=URL.createObjectURL(t.imageData);t.imageElement=document.createElement("img"),t.imageElement.onload=function(){URL.revokeObjectURL(r),e()},t.imageElement.onerror=function(){URL.revokeObjectURL(r),t.imageElement=null,n(new Error("Image creation error"))},t.imageElement.src=r}))}}]),u)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t};function i(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=function(t){var e=n;if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);function n(t,e,r){var i;if(this instanceof n)return(i=function(t,e){if(t)return!e||"object"!=typeof e&&"function"!=typeof e?t:e;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this))).playbackRate=1,i._currentFrameNumber=0,i._ended=!1,i._paused=!0,i._numPlays=0,i._rafId=null,i._apng=t,i.context=e,i.stop(),r&&i.play(),i;throw new TypeError("Cannot call a class as a function")}return e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t),r(n,[{key:"renderNextFrame",value:function(){this._currentFrameNumber=(this._currentFrameNumber+1)%this._apng.frames.length,this._currentFrameNumber===this._apng.frames.length-1&&(this._numPlays++,0!==this._apng.numPlays)&&this._numPlays>=this._apng.numPlays&&(this._ended=!0,this._paused=!0),this._prevFrame&&1==this._prevFrame.disposeOp?this.context.clearRect(this._prevFrame.left,this._prevFrame.top,this._prevFrame.width,this._prevFrame.height):this._prevFrame&&2==this._prevFrame.disposeOp&&this.context.putImageData(this._prevFrameData,this._prevFrame.left,this._prevFrame.top);var t=this.currentFrame;this._prevFrame=t,this._prevFrameData=null,2==t.disposeOp&&(this._prevFrameData=this.context.getImageData(t.left,t.top,t.width,t.height)),0==t.blendOp&&this.context.clearRect(t.left,t.top,t.width,t.height),this.context.drawImage(t.imageElement,t.left,t.top),this.emit("frame",this._currentFrameNumber),this._ended&&this.emit("end")}},{key:"play",value:function(){var t=this,e=(this._rafId&&cancelAnimationFrame(this._rafId),this.emit("play"),this._ended&&this.stop(),this._paused=!1,performance.now()+this.currentFrame.delay/this.playbackRate);this._rafId=requestAnimationFrame((function n(r){if(!t._ended&&!t._paused){if(e<=r){for(;r-e>=t._apng.playTime/t.playbackRate;)e+=t._apng.playTime/t.playbackRate,t._numPlays++;for(;t.renderNextFrame(),e+=t.currentFrame.delay/t.playbackRate,!t._ended&&!t._paused&&e<r;);}t._rafId=requestAnimationFrame(n)}}))}},{key:"pause",value:function(){this._paused||(this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null),this.emit("pause"),this._paused=!0)}},{key:"stop",value:function(){this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null),this.emit("stop"),this._numPlays=0,this._ended=!1,this._paused=!0,this._currentFrameNumber=-1,this.context.clearRect(0,0,this._apng.width,this._apng.height),this.renderNextFrame()}},{key:"currentFrameNumber",get:function(){return this._currentFrameNumber}},{key:"currentFrame",get:function(){return this._apng.frames[this._currentFrameNumber]}},{key:"paused",get:function(){return this._paused}},{key:"ended",get:function(){return this._ended}}]),n}(((n=n(4))&&n.__esModule?n:{default:n}).default),e.default=n},function(t,e){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(t){return"function"==typeof t}function i(t){return"object"==typeof t&&null!==t}function o(t){return void 0===t}((t.exports=n).EventEmitter=n).prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},n.prototype.emit=function(t){var e,n,s,a,u,l,c;if(this._events||(this._events={}),"error"===t&&(!this._events.error||i(this._events.error)&&!this._events.error.length))throw(c=arguments[1])instanceof Error?c:((l=new Error('Uncaught, unspecified "error" event. ('+c+")")).context=c,l);if(o(e=this._events[t]))return!1;if(r(e))switch(arguments.length){case 1:e.call(this);break;case 2:e.call(this,arguments[1]);break;case 3:e.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),e.apply(this,s)}else if(i(e))for(s=Array.prototype.slice.call(arguments,1),n=(u=e.slice()).length,a=0;a<n;a++)u[a].apply(this,s);return!0},n.prototype.on=n.prototype.addListener=function(t,e){if(r(e))return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,r(e.listener)?e.listener:e),this._events[t]?i(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,i(this._events[t])&&!this._events[t].warned&&(e=o(this._maxListeners)?n.defaultMaxListeners:this._maxListeners)&&0<e&&this._events[t].length>e&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace)&&console.trace(),this;throw TypeError("listener must be a function")},n.prototype.once=function(t,e){var n;if(r(e))return n=!1,i.listener=e,this.on(t,i),this;throw TypeError("listener must be a function");function i(){this.removeListener(t,i),n||(n=!0,e.apply(this,arguments))}},n.prototype.removeListener=function(t,e){var n,o,s,a;if(!r(e))throw TypeError("listener must be a function");if(this._events&&this._events[t])if(s=(n=this._events[t]).length,o=-1,n===e||r(n.listener)&&n.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(i(n)){for(a=s;0<a--;)if(n[a]===e||n[a].listener&&n[a].listener===e){o=a;break}if(o<0)return this;1===n.length?(n.length=0,delete this._events[t]):n.splice(o,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,n;if(this._events)if(this._events.removeListener)if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);this.removeAllListeners("removeListener"),this._events={}}else{if(r(n=this._events[t]))this.removeListener(t,n);else if(n)for(;n.length;)this.removeListener(t,n[n.length-1]);delete this._events[t]}else 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t];return this},n.prototype.listeners=function(t){return this._events&&this._events[t]?r(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){if(r(t=this._events[t]))return 1;if(t)return t.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}}],n={},t.m=e,t.c=n,t.p="",t(0);function t(r){var i;return(n[r]||(i=n[r]={exports:{},id:r,loaded:!1},e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i)).exports}var e,n},t.exports=e()},787:(t,e,n)=>{var r=n(582),i=n(102),o=n(540),s=n(705).Z,a=o.featureEach,u=(o.coordEach,i.polygon,i.featureCollection);function l(t){return(t=new r(t)).insert=function(t){if("Feature"!==t.type)throw new Error("invalid feature");return t.bbox=t.bbox||s(t),r.prototype.insert.call(this,t)},t.load=function(t){var e=[];return Array.isArray(t)?t.forEach((function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox||s(t),e.push(t)})):a(t,(function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox||s(t),e.push(t)})),r.prototype.load.call(this,e)},t.remove=function(t,e){if("Feature"!==t.type)throw new Error("invalid feature");return t.bbox=t.bbox||s(t),r.prototype.remove.call(this,t,e)},t.clear=function(){return r.prototype.clear.call(this)},t.search=function(t){return t=r.prototype.search.call(this,this.toBBox(t)),u(t)},t.collides=function(t){return r.prototype.collides.call(this,this.toBBox(t))},t.all=function(){var t=r.prototype.all.call(this);return u(t)},t.toJSON=function(){return r.prototype.toJSON.call(this)},t.fromJSON=function(t){return r.prototype.fromJSON.call(this,t)},t.toBBox=function(t){var e;if(t.bbox)e=t.bbox;else if(Array.isArray(t)&&4===t.length)e=t;else if(Array.isArray(t)&&6===t.length)e=[t[0],t[1],t[3],t[4]];else{if("Feature"!==t.type&&"FeatureCollection"!==t.type)throw new Error("invalid geojson");e=s(t)}return{minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}},t}t.exports=l,t.exports.default=l},481:function(t,e){var n;void 0!==(e="function"==typeof(n=function(){var t=function(t){return t.reduce((function(t,e){return 2*t+e}),0)},e=function(t){for(var e=[],n=7;n>=0;n--)e.push(!!(t&1<<n));return e},n=function(t){this.data=t,this.len=this.data.length,this.pos=0,this.readByte=function(){if(this.pos>=this.data.length)throw new Error("Attempted to read past end of stream.");return t instanceof Uint8Array?t[this.pos++]:255&t.charCodeAt(this.pos++)},this.readBytes=function(t){for(var e=[],n=0;n<t;n++)e.push(this.readByte());return e},this.read=function(t){for(var e="",n=0;n<t;n++)e+=String.fromCharCode(this.readByte());return e},this.readUnsigned=function(){var t=this.readBytes(2);return(t[1]<<8)+t[0]}},r=function(n,r){r||(r={});var i=function(t){for(var e=[],r=0;r<t;r++)e.push(n.readBytes(3));return e},o=function(){var t,e;e="";do{t=n.readByte(),e+=n.read(t)}while(0!==t);return e},s=function(){var a={};switch(a.sentinel=n.readByte(),String.fromCharCode(a.sentinel)){case"!":a.type="ext",function(i){switch(i.label=n.readByte(),i.label){case 249:i.extType="gce",function(i){n.readByte();var o=e(n.readByte());i.reserved=o.splice(0,3),i.disposalMethod=t(o.splice(0,3)),i.userInput=o.shift(),i.transparencyGiven=o.shift(),i.delayTime=n.readUnsigned(),i.transparencyIndex=n.readByte(),i.terminator=n.readByte(),r.gce&&r.gce(i)}(i);break;case 254:i.extType="com",function(t){t.comment=o(),r.com&&r.com(t)}(i);break;case 1:i.extType="pte",function(t){n.readByte(),t.ptHeader=n.readBytes(12),t.ptData=o(),r.pte&&r.pte(t)}(i);break;case 255:i.extType="app",function(t){n.readByte(),t.identifier=n.read(8),t.authCode=n.read(3),"NETSCAPE"===t.identifier?function(t){n.readByte(),t.unknown=n.readByte(),t.iterations=n.readUnsigned(),t.terminator=n.readByte(),r.app&&r.app.NETSCAPE&&r.app.NETSCAPE(t)}(t):function(t){t.appData=o(),r.app&&r.app[t.identifier]&&r.app[t.identifier](t)}(t)}(i);break;default:i.extType="unknown",function(t){t.data=o(),r.unknown&&r.unknown(t)}(i)}}(a);break;case",":a.type="img",function(s){s.leftPos=n.readUnsigned(),s.topPos=n.readUnsigned(),s.width=n.readUnsigned(),s.height=n.readUnsigned();var a=e(n.readByte());s.lctFlag=a.shift(),s.interlaced=a.shift(),s.sorted=a.shift(),s.reserved=a.splice(0,2),s.lctSize=t(a.splice(0,3)),s.lctFlag&&(s.lct=i(1<<s.lctSize+1)),s.lzwMinCodeSize=n.readByte();var u=o();s.pixels=function(t,e){for(var n,r,i=0,o=function(t){for(var n=0,r=0;r<t;r++)e.charCodeAt(i>>3)&1<<(7&i)&&(n|=1<<r),i++;return n},s=[],a=1<<t,u=a+1,l=t+1,c=[],h=function(){c=[],l=t+1;for(var e=0;e<a;e++)c[e]=[e];c[a]=[],c[u]=null};;)if(r=n,(n=o(l))!==a){if(n===u)break;if(n<c.length)r!==a&&c.push(c[r].concat(c[n][0]));else{if(n!==c.length)throw new Error("Invalid LZW code.");c.push(c[r].concat(c[r][0]))}s.push.apply(s,c[n]),c.length===1<<l&&l<12&&l++}else h();return s}(s.lzwMinCodeSize,u),s.interlaced&&(s.pixels=function(t,e){for(var n=new Array(t.length),r=t.length/e,i=function(r,i){var o=t.slice(i*e,(i+1)*e);n.splice.apply(n,[r*e,e].concat(o))},o=[0,4,2,1],s=[8,8,4,2],a=0,u=0;u<4;u++)for(var l=o[u];l<r;l+=s[u])i(l,a),a++;return n}(s.pixels,s.width)),r.img&&r.img(s)}(a);break;case";":a.type="eof",r.eof&&r.eof(a);break;default:throw new Error("Unknown block: 0x"+a.sentinel.toString(16))}"eof"!==a.type&&setTimeout(s,0)};!function(){var o={};if(o.sig=n.read(3),o.ver=n.read(3),"GIF"!==o.sig)throw new Error("Not a GIF file.");o.width=n.readUnsigned(),o.height=n.readUnsigned();var s=e(n.readByte());o.gctFlag=s.shift(),o.colorRes=t(s.splice(0,3)),o.sorted=s.shift(),o.gctSize=t(s.splice(0,3)),o.bgColor=n.readByte(),o.pixelAspectRatio=n.readByte(),o.gctFlag&&(o.gct=i(1<<o.gctSize+1)),r.hdr&&r.hdr(o)}(),setTimeout(s,0)};return function(t){var e,i,o={vp_l:0,vp_t:0,vp_w:null,vp_h:null,c_w:null,c_h:null};for(var s in t)o[s]=t[s];o.vp_w&&o.vp_h&&(o.is_vp=!0);var a=null,u=!1,l=null,c=null,h=null,p=null,f=null,g=null,d=null,y=!0,m=!1,_=[],v=[],x=o.gif;void 0===o.auto_play&&(o.auto_play=!x.getAttribute("rel:auto_play")||"1"==x.getAttribute("rel:auto_play"));var E,b,I,w,N=o.hasOwnProperty("on_end")?o.on_end:null,L=o.hasOwnProperty("loop_delay")?o.loop_delay:0,S=o.hasOwnProperty("loop_mode")?o.loop_mode:"auto",C=!o.hasOwnProperty("draw_while_loading")||o.draw_while_loading,P=!!C&&(!o.hasOwnProperty("show_progress_bar")||o.show_progress_bar),M=o.hasOwnProperty("progressbar_height")?o.progressbar_height:25,T=o.hasOwnProperty("progressbar_background_color")?o.progressbar_background_color:"rgba(255,255,255,0.4)",R=o.hasOwnProperty("progressbar_foreground_color")?o.progressbar_foreground_color:"rgba(255,0,22,.8)",O=function(){l=null,c=null,f=h,h=null,g=null},A=function(){try{r(e,j)}catch(t){k("parse")}},D=function(t,e){E.width=t*X(),E.height=e*X(),I.style.minWidth=t*X()+"px",w.width=t,w.height=e,w.style.width=t+"px",w.style.height=e+"px",w.getContext("2d").setTransform(1,0,0,1,0,0)},F=function(t,e,n){if(n&&P){var r,i,s,a=M;o.is_vp?m?(i=(o.vp_t+o.vp_h-a)/X(),a/=X(),r=o.vp_l/X()+t/e*(o.vp_w/X()),s=E.width/X()):(i=o.vp_t+o.vp_h-a,r=o.vp_l+t/e*o.vp_w,s=E.width):(i=(E.height-a)/(m?X():1),r=t/e*E.width/(m?X():1),s=E.width/(m?X():1),a/=m?X():1),b.fillStyle=T,b.fillRect(r,i,s-r,a),b.fillStyle=R,b.fillRect(0,i,r,a)}},k=function(t){a=t,i={width:x.width,height:x.height},_=[],b.fillStyle="black",b.fillRect(0,0,o.c_w?o.c_w:i.width,o.c_h?o.c_h:i.height),b.strokeStyle="red",b.lineWidth=3,b.moveTo(0,0),b.lineTo(o.c_w?o.c_w:i.width,o.c_h?o.c_h:i.height),b.moveTo(0,o.c_h?o.c_h:i.height),b.lineTo(o.c_w?o.c_w:i.width,0),b.stroke()},G=function(){g&&(_.push({data:g.getImageData(0,0,i.width,i.height),delay:c}),v.push({x:0,y:0}))},B=function(){var t=-1,e=0,n=function(e){t+=e,i()},r=function(){var r=!1,i=function(){null!==N&&N(x),e++,!1!==S||e<0?o():(r=!1,y=!1)},o=function(){if(r=y){n(1);var e=10*_[t].delay;e||(e=100),0==(t+1+_.length)%_.length?(e+=L,setTimeout(i,e)):setTimeout(o,e)}};return function(){r||setTimeout(o,0)}}(),i=function(){var e;(t=parseInt(t,10))>_.length-1&&(t=0),t<0&&(t=0),e=v[t],w.getContext("2d").putImageData(_[t].data,e.x,e.y),b.globalCompositeOperation="copy",b.drawImage(w,0,0)};return{init:function(){a||(o.c_w&&o.c_h||b.scale(X(),X()),o.auto_play?r():(t=0,i()))},step:r,play:function(){y=!0,r()},pause:function(){y=!1},playing:y,move_relative:n,current_frame:function(){return t},length:function(){return _.length},move_to:function(e){t=e,i()}}}(),U=function(t){F(e.pos,e.data.length,t)},q=function(){},z=function(t,e){return function(n){t(n),U(e)}},j={hdr:z((function(t){D((i=t).width,i.height)})),gce:z((function(t){G(),O(),l=t.transparencyGiven?t.transparencyIndex:null,c=t.delayTime,h=t.disposalMethod})),com:z(q),app:{NETSCAPE:z(q)},img:z((function(t){g||(g=w.getContext("2d"));var e=_.length,n=t.lctFlag?t.lct:i.gct;e>0&&(3===f?null!==p?g.putImageData(_[p].data,0,0):g.clearRect(d.leftPos,d.topPos,d.width,d.height):p=e-1,2===f&&g.clearRect(d.leftPos,d.topPos,d.width,d.height));var r=g.getImageData(t.leftPos,t.topPos,t.width,t.height);t.pixels.forEach((function(t,e){t!==l&&(r.data[4*e+0]=n[t][0],r.data[4*e+1]=n[t][1],r.data[4*e+2]=n[t][2],r.data[4*e+3]=255)})),g.putImageData(r,t.leftPos,t.topPos),m||(b.scale(X(),X()),m=!0),C&&(b.drawImage(w,0,0),C=o.auto_play),d=t}),!0),eof:function(t){G(),U(!1),o.c_w&&o.c_h||(E.width=i.width*X(),E.height=i.height*X()),B.init(),u=!1,H&&H(x)}},V=function(){var t=x.parentNode,e=document.createElement("div");E=document.createElement("canvas"),b=E.getContext("2d"),I=document.createElement("div"),w=document.createElement("canvas"),e.width=E.width=x.width,e.height=E.height=x.height,I.style.minWidth=x.width+"px",e.className="jsgif",I.className="jsgif_toolbar",e.appendChild(E),e.appendChild(I),t.insertBefore(e,x),t.removeChild(x),o.c_w&&o.c_h&&D(o.c_w,o.c_h),Y=!0},X=function(){return o.max_width&&i&&i.width>o.max_width?o.max_width/i.width:1},Y=!1,H=!1,W=function(t){return!u&&(H=t||!1,u=!0,_=[],O(),p=null,f=null,g=null,d=null,!0)},J=function(){return _.reduce((function(t,e){return t+e.delay}),0)};return{play:B.play,pause:B.pause,move_relative:B.move_relative,move_to:B.move_to,get_playing:function(){return y},get_canvas:function(){return E},get_canvas_scale:function(){return X()},get_loading:function(){return u},get_auto_play:function(){return o.auto_play},get_length:function(){return B.length()},get_frames:function(){return _},get_duration:function(){return J()},get_duration_ms:function(){return 10*J()},get_current_frame:function(){return B.current_frame()},load_url:function(t,r){if(W(r)){var i=new XMLHttpRequest;i.open("GET",t,!0),"overrideMimeType"in i?i.overrideMimeType("text/plain; charset=x-user-defined"):"responseType"in i?i.responseType="arraybuffer":i.setRequestHeader("Accept-Charset","x-user-defined"),i.onloadstart=function(){Y||V()},i.onload=function(t){200!=this.status&&k("xhr - response"),"response"in this||(this.response=new VBArray(this.responseText).toArray().map(String.fromCharCode).join(""));var r=this.response;r.toString().indexOf("ArrayBuffer")>0&&(r=new Uint8Array(r)),e=new n(r),setTimeout(A,0)},i.onprogress=function(t){t.lengthComputable&&F(t.loaded,t.total,!0)},i.onerror=function(){k("xhr")},i.send()}},load:function(t){this.load_url(x.getAttribute("rel:animated_src")||x.src,t)},load_raw:function(t,r){W(r)&&(Y||V(),e=new n(t),setTimeout(A,0))},set_frame_offset:function(t,e){v[t]?(void 0!==e.x&&(v[t].x=e.x),void 0!==e.y&&(v[t].y=e.y)):v[t]=e}}}})?n.apply(e,[]):n)&&(t.exports=e)},676:function(t){t.exports=function(){"use strict";var t=function(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.right=null};function e(t,e){return t>e?1:t<e?-1:0}function n(e,n,r){for(var i=new t(null,null),o=i,s=i;;){var a=r(e,n.key);if(a<0){if(null===n.left)break;if(r(e,n.left.key)<0){var u=n.left;if(n.left=u.right,u.right=n,null===(n=u).left)break}s.left=n,s=n,n=n.left}else{if(!(a>0))break;if(null===n.right)break;if(r(e,n.right.key)>0&&(u=n.right,n.right=u.left,u.left=n,null===(n=u).right))break;o.right=n,o=n,n=n.right}}return o.right=n.left,s.left=n.right,n.left=i.right,n.right=i.left,n}function r(e,r,i,o){var s=new t(e,r);if(null===i)return s.left=s.right=null,s;var a=o(e,(i=n(e,i,o)).key);return a<0?(s.left=i.left,s.right=i,i.left=null):a>=0&&(s.right=i.right,s.left=i,i.right=null),s}function i(t,e,r){var i=null,o=null;if(e){var s=r((e=n(t,e,r)).key,t);0===s?(i=e.left,o=e.right):s<0?(o=e.right,e.right=null,i=e):(i=e.left,e.left=null,o=e)}return{left:i,right:o}}function o(t,e,r){return null===e?t:(null===t||((e=n(t.key,e,r)).left=t),e)}function s(t,e,n,r,i){if(t){r(e+(n?"└── ":"├── ")+i(t)+"\n");var o=e+(n?" ":"│ ");t.left&&s(t.left,o,!1,r,i),t.right&&s(t.right,o,!0,r,i)}}var a=function(){function a(t){void 0===t&&(t=e),this._root=null,this._size=0,this._comparator=t}return a.prototype.insert=function(t,e){return this._size++,this._root=r(t,e,this._root,this._comparator)},a.prototype.add=function(e,r){var i=new t(e,r);null===this._root&&(i.left=i.right=null,this._size++,this._root=i);var o=this._comparator,s=n(e,this._root,o),a=o(e,s.key);return 0===a?this._root=s:(a<0?(i.left=s.left,i.right=s,s.left=null):a>0&&(i.right=s.right,i.left=s,s.right=null),this._size++,this._root=i),this._root},a.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},a.prototype._remove=function(t,e,r){var i;return null===e?null:0===r(t,(e=n(t,e,r)).key)?(null===e.left?i=e.right:(i=n(t,e.left,r)).right=e.right,this._size--,i):e},a.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=n(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},a.prototype.findStatic=function(t){for(var e=this._root,n=this._comparator;e;){var r=n(t,e.key);if(0===r)return e;e=r<0?e.left:e.right}return null},a.prototype.find=function(t){return this._root&&(this._root=n(t,this._root,this._comparator),0!==this._comparator(t,this._root.key))?null:this._root},a.prototype.contains=function(t){for(var e=this._root,n=this._comparator;e;){var r=n(t,e.key);if(0===r)return!0;e=r<0?e.left:e.right}return!1},a.prototype.forEach=function(t,e){for(var n=this._root,r=[],i=!1;!i;)null!==n?(r.push(n),n=n.left):0!==r.length?(n=r.pop(),t.call(e,n),n=n.right):i=!0;return this},a.prototype.range=function(t,e,n,r){for(var i=[],o=this._comparator,s=this._root;0!==i.length||s;)if(s)i.push(s),s=s.left;else{if(o((s=i.pop()).key,e)>0)break;if(o(s.key,t)>=0&&n.call(r,s))return this;s=s.right}return this},a.prototype.keys=function(){var t=[];return this.forEach((function(e){var n=e.key;return t.push(n)})),t},a.prototype.values=function(){var t=[];return this.forEach((function(e){var n=e.data;return t.push(n)})),t},a.prototype.min=function(){return this._root?this.minNode(this._root).key:null},a.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},a.prototype.minNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.left;)t=t.left;return t},a.prototype.maxNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.right;)t=t.right;return t},a.prototype.at=function(t){for(var e=this._root,n=!1,r=0,i=[];!n;)if(e)i.push(e),e=e.left;else if(i.length>0){if(e=i.pop(),r===t)return e;r++,e=e.right}else n=!0;return null},a.prototype.next=function(t){var e=this._root,n=null;if(t.right){for(n=t.right;n.left;)n=n.left;return n}for(var r=this._comparator;e;){var i=r(t.key,e.key);if(0===i)break;i<0?(n=e,e=e.left):e=e.right}return n},a.prototype.prev=function(t){var e=this._root,n=null;if(null!==t.left){for(n=t.left;n.right;)n=n.right;return n}for(var r=this._comparator;e;){var i=r(t.key,e.key);if(0===i)break;i<0?e=e.left:(n=e,e=e.right)}return n},a.prototype.clear=function(){return this._root=null,this._size=0,this},a.prototype.toList=function(){return function(e){for(var n=e,r=[],i=!1,o=new t(null,null),s=o;!i;)n?(r.push(n),n=n.left):r.length>0?n=(n=s=s.next=r.pop()).right:i=!0;return s.next=null,o.next}(this._root)},a.prototype.load=function(e,n,r){void 0===n&&(n=[]),void 0===r&&(r=!1);var i=e.length,o=this._comparator;if(r&&c(e,n,0,i-1,o),null===this._root)this._root=u(e,n,0,i),this._size=i;else{var s=function(e,n,r){for(var i=new t(null,null),o=i,s=e,a=n;null!==s&&null!==a;)r(s.key,a.key)<0?(o.next=s,s=s.next):(o.next=a,a=a.next),o=o.next;return null!==s?o.next=s:null!==a&&(o.next=a),i.next}(this.toList(),function(e,n){for(var r=new t(null,null),i=r,o=0;o<e.length;o++)i=i.next=new t(e[o],n[o]);return i.next=null,r.next}(e,n),o);i=this._size+i,this._root=l({head:s},0,i)}return this},a.prototype.isEmpty=function(){return null===this._root},Object.defineProperty(a.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),a.prototype.toString=function(t){void 0===t&&(t=function(t){return String(t.key)});var e=[];return s(this._root,"",!0,(function(t){return e.push(t)}),t),e.join("")},a.prototype.update=function(t,e,n){var s=this._comparator,a=i(t,this._root,s),u=a.left,l=a.right;s(t,e)<0?l=r(e,n,l,s):u=r(e,n,u,s),this._root=o(u,l,s)},a.prototype.split=function(t){return i(t,this._root,this._comparator)},a.prototype[Symbol.iterator]=function(){var t,e,n;return function(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(t){return function(e){return u([t,e])}}function u(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}}(this,(function(r){switch(r.label){case 0:t=this._root,e=[],n=!1,r.label=1;case 1:return n?[3,6]:null===t?[3,2]:(e.push(t),t=t.left,[3,5]);case 2:return 0===e.length?[3,4]:[4,t=e.pop()];case 3:return r.sent(),t=t.right,[3,5];case 4:n=!0,r.label=5;case 5:return[3,1];case 6:return[2]}}))},a}();function u(e,n,r,i){var o=i-r;if(o>0){var s=r+Math.floor(o/2),a=e[s],l=n[s],c=new t(a,l);return c.left=u(e,n,r,s),c.right=u(e,n,s+1,i),c}return null}function l(t,e,n){var r=n-e;if(r>0){var i=e+Math.floor(r/2),o=l(t,e,i),s=t.head;return s.left=o,t.head=t.head.next,s.right=l(t,i+1,n),s}return null}function c(t,e,n,r,i){if(!(n>=r)){for(var o=t[n+r>>1],s=n-1,a=r+1;;){do{s++}while(i(t[s],o)<0);do{a--}while(i(t[a],o)>0);if(s>=a)break;var u=t[s];t[s]=t[a],t[a]=u,u=e[s],e[s]=e[a],e[a]=u}c(t,e,n,a,i),c(t,e,a+1,r,i)}}const h=(t,e)=>t.ll.x<=e.x&&e.x<=t.ur.x&&t.ll.y<=e.y&&e.y<=t.ur.y,p=(t,e)=>{if(e.ur.x<t.ll.x||t.ur.x<e.ll.x||e.ur.y<t.ll.y||t.ur.y<e.ll.y)return null;const n=t.ll.x<e.ll.x?e.ll.x:t.ll.x,r=t.ur.x<e.ur.x?t.ur.x:e.ur.x;return{ll:{x:n,y:t.ll.y<e.ll.y?e.ll.y:t.ll.y},ur:{x:r,y:t.ur.y<e.ur.y?t.ur.y:e.ur.y}}};let f=Number.EPSILON;void 0===f&&(f=Math.pow(2,-52));const g=f*f,d=(t,e)=>{if(-f<t&&t<f&&-f<e&&e<f)return 0;const n=t-e;return n*n<g*t*e?0:t<e?-1:1};class y{constructor(){this.tree=new a,this.round(0)}round(t){const e=this.tree.add(t),n=this.tree.prev(e);if(null!==n&&0===d(e.key,n.key))return this.tree.remove(t),n.key;const r=this.tree.next(e);return null!==r&&0===d(e.key,r.key)?(this.tree.remove(t),r.key):t}}const m=new class{constructor(){this.reset()}reset(){this.xRounder=new y,this.yRounder=new y}round(t,e){return{x:this.xRounder.round(t),y:this.yRounder.round(e)}}},_=134217729;function v(t,e,n,r,i){let o,s,a,u,l=e[0],c=r[0],h=0,p=0;c>l==c>-l?(o=l,l=e[++h]):(o=c,c=r[++p]);let f=0;if(h<t&&p<n)for(c>l==c>-l?(s=l+o,a=o-(s-l),l=e[++h]):(s=c+o,a=o-(s-c),c=r[++p]),o=s,0!==a&&(i[f++]=a);h<t&&p<n;)c>l==c>-l?(s=o+l,u=s-o,a=o-(s-u)+(l-u),l=e[++h]):(s=o+c,u=s-o,a=o-(s-u)+(c-u),c=r[++p]),o=s,0!==a&&(i[f++]=a);for(;h<t;)s=o+l,u=s-o,a=o-(s-u)+(l-u),l=e[++h],o=s,0!==a&&(i[f++]=a);for(;p<n;)s=o+c,u=s-o,a=o-(s-u)+(c-u),c=r[++p],o=s,0!==a&&(i[f++]=a);return 0===o&&0!==f||(i[f++]=o),f}function x(t){return new Float64Array(t)}const E=x(4),b=x(8),I=x(12),w=x(16),N=x(4);const L=(t,e)=>t.x*e.y-t.y*e.x,S=(t,e)=>t.x*e.x+t.y*e.y,C=(t,e,n)=>{const r=function(t,e,n,r,i,o){const s=(e-o)*(n-i),a=(t-i)*(r-o),u=s-a,l=Math.abs(s+a);return Math.abs(u)>=33306690738754716e-32*l?u:-function(t,e,n,r,i,o,s){let a,u,l,c,h,p,f,g,d,y,m,x,L,S,C,P,M,T;const R=t-i,O=n-i,A=e-o,D=r-o;S=R*D,p=_*R,f=p-(p-R),g=R-f,p=_*D,d=p-(p-D),y=D-d,C=g*y-(S-f*d-g*d-f*y),P=A*O,p=_*A,f=p-(p-A),g=A-f,p=_*O,d=p-(p-O),y=O-d,M=g*y-(P-f*d-g*d-f*y),m=C-M,h=C-m,E[0]=C-(m+h)+(h-M),x=S+m,h=x-S,L=S-(x-h)+(m-h),m=L-P,h=L-m,E[1]=L-(m+h)+(h-P),T=x+m,h=T-x,E[2]=x-(T-h)+(m-h),E[3]=T;let F=function(t,e){let n=e[0];for(let t=1;t<4;t++)n+=e[t];return n}(0,E),k=22204460492503146e-32*s;if(F>=k||-F>=k)return F;if(h=t-R,a=t-(R+h)+(h-i),h=n-O,l=n-(O+h)+(h-i),h=e-A,u=e-(A+h)+(h-o),h=r-D,c=r-(D+h)+(h-o),0===a&&0===u&&0===l&&0===c)return F;if(k=11093356479670487e-47*s+33306690738754706e-32*Math.abs(F),F+=R*c+D*a-(A*l+O*u),F>=k||-F>=k)return F;S=a*D,p=_*a,f=p-(p-a),g=a-f,p=_*D,d=p-(p-D),y=D-d,C=g*y-(S-f*d-g*d-f*y),P=u*O,p=_*u,f=p-(p-u),g=u-f,p=_*O,d=p-(p-O),y=O-d,M=g*y-(P-f*d-g*d-f*y),m=C-M,h=C-m,N[0]=C-(m+h)+(h-M),x=S+m,h=x-S,L=S-(x-h)+(m-h),m=L-P,h=L-m,N[1]=L-(m+h)+(h-P),T=x+m,h=T-x,N[2]=x-(T-h)+(m-h),N[3]=T;const G=v(4,E,4,N,b);S=R*c,p=_*R,f=p-(p-R),g=R-f,p=_*c,d=p-(p-c),y=c-d,C=g*y-(S-f*d-g*d-f*y),P=A*l,p=_*A,f=p-(p-A),g=A-f,p=_*l,d=p-(p-l),y=l-d,M=g*y-(P-f*d-g*d-f*y),m=C-M,h=C-m,N[0]=C-(m+h)+(h-M),x=S+m,h=x-S,L=S-(x-h)+(m-h),m=L-P,h=L-m,N[1]=L-(m+h)+(h-P),T=x+m,h=T-x,N[2]=x-(T-h)+(m-h),N[3]=T;const B=v(G,b,4,N,I);S=a*c,p=_*a,f=p-(p-a),g=a-f,p=_*c,d=p-(p-c),y=c-d,C=g*y-(S-f*d-g*d-f*y),P=u*l,p=_*u,f=p-(p-u),g=u-f,p=_*l,d=p-(p-l),y=l-d,M=g*y-(P-f*d-g*d-f*y),m=C-M,h=C-m,N[0]=C-(m+h)+(h-M),x=S+m,h=x-S,L=S-(x-h)+(m-h),m=L-P,h=L-m,N[1]=L-(m+h)+(h-P),T=x+m,h=T-x,N[2]=x-(T-h)+(m-h),N[3]=T;const U=v(B,I,4,N,w);return w[U-1]}(t,e,n,r,i,o,l)}(t.x,t.y,e.x,e.y,n.x,n.y);return r>0?-1:r<0?1:0},P=t=>Math.sqrt(S(t,t)),M=(t,e,n)=>{const r={x:e.x-t.x,y:e.y-t.y},i={x:n.x-t.x,y:n.y-t.y};return L(i,r)/P(i)/P(r)},T=(t,e,n)=>{const r={x:e.x-t.x,y:e.y-t.y},i={x:n.x-t.x,y:n.y-t.y};return S(i,r)/P(i)/P(r)},R=(t,e,n)=>0===e.y?null:{x:t.x+e.x/e.y*(n-t.y),y:n},O=(t,e,n)=>0===e.x?null:{x:n,y:t.y+e.y/e.x*(n-t.x)};class A{static compare(t,e){const n=A.comparePoints(t.point,e.point);return 0!==n?n:(t.point!==e.point&&t.link(e),t.isLeft!==e.isLeft?t.isLeft?1:-1:F.compare(t.segment,e.segment))}static comparePoints(t,e){return t.x<e.x?-1:t.x>e.x?1:t.y<e.y?-1:t.y>e.y?1:0}constructor(t,e){void 0===t.events?t.events=[this]:t.events.push(this),this.point=t,this.isLeft=e}link(t){if(t.point===this.point)throw new Error("Tried to link already linked events");const e=t.point.events;for(let t=0,n=e.length;t<n;t++){const n=e[t];this.point.events.push(n),n.point=this.point}this.checkForConsuming()}checkForConsuming(){const t=this.point.events.length;for(let e=0;e<t;e++){const n=this.point.events[e];if(void 0===n.segment.consumedBy)for(let r=e+1;r<t;r++){const t=this.point.events[r];void 0===t.consumedBy&&n.otherSE.point.events===t.otherSE.point.events&&n.segment.consume(t.segment)}}}getAvailableLinkedEvents(){const t=[];for(let e=0,n=this.point.events.length;e<n;e++){const n=this.point.events[e];n!==this&&!n.segment.ringOut&&n.segment.isInResult()&&t.push(n)}return t}getLeftmostComparator(t){const e=new Map,n=n=>{const r=n.otherSE;e.set(n,{sine:M(this.point,t.point,r.point),cosine:T(this.point,t.point,r.point)})};return(t,r)=>{e.has(t)||n(t),e.has(r)||n(r);const{sine:i,cosine:o}=e.get(t),{sine:s,cosine:a}=e.get(r);return i>=0&&s>=0?o<a?1:o>a?-1:0:i<0&&s<0?o<a?-1:o>a?1:0:s<i?-1:s>i?1:0}}}let D=0;class F{static compare(t,e){const n=t.leftSE.point.x,r=e.leftSE.point.x,i=t.rightSE.point.x,o=e.rightSE.point.x;if(o<n)return 1;if(i<r)return-1;const s=t.leftSE.point.y,a=e.leftSE.point.y,u=t.rightSE.point.y,l=e.rightSE.point.y;if(n<r){if(a<s&&a<u)return 1;if(a>s&&a>u)return-1;const n=t.comparePoint(e.leftSE.point);if(n<0)return 1;if(n>0)return-1;const r=e.comparePoint(t.rightSE.point);return 0!==r?r:-1}if(n>r){if(s<a&&s<l)return-1;if(s>a&&s>l)return 1;const n=e.comparePoint(t.leftSE.point);if(0!==n)return n;const r=t.comparePoint(e.rightSE.point);return r<0?1:r>0?-1:1}if(s<a)return-1;if(s>a)return 1;if(i<o){const n=e.comparePoint(t.rightSE.point);if(0!==n)return n}if(i>o){const n=t.comparePoint(e.rightSE.point);if(n<0)return 1;if(n>0)return-1}if(i!==o){const t=u-s,e=i-n,c=l-a,h=o-r;if(t>e&&c<h)return 1;if(t<e&&c>h)return-1}return i>o?1:i<o||u<l?-1:u>l?1:t.id<e.id?-1:t.id>e.id?1:0}constructor(t,e,n,r){this.id=++D,this.leftSE=t,t.segment=this,t.otherSE=e,this.rightSE=e,e.segment=this,e.otherSE=t,this.rings=n,this.windings=r}static fromRing(t,e,n){let r,i,o;const s=A.comparePoints(t,e);if(s<0)r=t,i=e,o=1;else{if(!(s>0))throw new Error(`Tried to create degenerate segment at [${t.x}, ${t.y}]`);r=e,i=t,o=-1}const a=new A(r,!0),u=new A(i,!1);return new F(a,u,[n],[o])}replaceRightSE(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const t=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t<e?t:e},ur:{x:this.rightSE.point.x,y:t>e?t:e}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}comparePoint(t){if(this.isAnEndpoint(t))return 0;const e=this.leftSE.point,n=this.rightSE.point,r=this.vector();if(e.x===n.x)return t.x===e.x?0:t.x<e.x?1:-1;const i=(t.y-e.y)/r.y,o=e.x+i*r.x;if(t.x===o)return 0;const s=(t.x-e.x)/r.x,a=e.y+s*r.y;return t.y===a?0:t.y<a?-1:1}getIntersection(t){const e=this.bbox(),n=t.bbox(),r=p(e,n);if(null===r)return null;const i=this.leftSE.point,o=this.rightSE.point,s=t.leftSE.point,a=t.rightSE.point,u=h(e,s)&&0===this.comparePoint(s),l=h(n,i)&&0===t.comparePoint(i),c=h(e,a)&&0===this.comparePoint(a),f=h(n,o)&&0===t.comparePoint(o);if(l&&u)return f&&!c?o:!f&&c?a:null;if(l)return c&&i.x===a.x&&i.y===a.y?null:i;if(u)return f&&o.x===s.x&&o.y===s.y?null:s;if(f&&c)return null;if(f)return o;if(c)return a;const g=((t,e,n,r)=>{if(0===e.x)return O(n,r,t.x);if(0===r.x)return O(t,e,n.x);if(0===e.y)return R(n,r,t.y);if(0===r.y)return R(t,e,n.y);const i=L(e,r);if(0==i)return null;const o={x:n.x-t.x,y:n.y-t.y},s=L(o,e)/i,a=L(o,r)/i;return{x:(t.x+a*e.x+(n.x+s*r.x))/2,y:(t.y+a*e.y+(n.y+s*r.y))/2}})(i,this.vector(),s,t.vector());return null===g?null:h(r,g)?m.round(g.x,g.y):null}split(t){const e=[],n=void 0!==t.events,r=new A(t,!0),i=new A(t,!1),o=this.rightSE;this.replaceRightSE(i),e.push(i),e.push(r);const s=new F(r,o,this.rings.slice(),this.windings.slice());return A.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),A.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(r.checkForConsuming(),i.checkForConsuming()),e}swapEvents(){const t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let t=0,e=this.windings.length;t<e;t++)this.windings[t]*=-1}consume(t){let e=this,n=t;for(;e.consumedBy;)e=e.consumedBy;for(;n.consumedBy;)n=n.consumedBy;const r=F.compare(e,n);if(0!==r){if(r>0){const t=e;e=n,n=t}if(e.prev===n){const t=e;e=n,n=t}for(let t=0,r=n.rings.length;t<r;t++){const r=n.rings[t],i=n.windings[t],o=e.rings.indexOf(r);-1===o?(e.rings.push(r),e.windings.push(i)):e.windings[o]+=i}n.rings=null,n.windings=null,n.consumedBy=e,n.leftSE.consumedBy=e.leftSE,n.rightSE.consumedBy=e.rightSE}}prevInResult(){return void 0!==this._prevInResult||(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null),this._prevInResult}beforeState(){if(void 0!==this._beforeState)return this._beforeState;if(this.prev){const t=this.prev.consumedBy||this.prev;this._beforeState=t.afterState()}else this._beforeState={rings:[],windings:[],multiPolys:[]};return this._beforeState}afterState(){if(void 0!==this._afterState)return this._afterState;const t=this.beforeState();this._afterState={rings:t.rings.slice(0),windings:t.windings.slice(0),multiPolys:[]};const e=this._afterState.rings,n=this._afterState.windings,r=this._afterState.multiPolys;for(let t=0,r=this.rings.length;t<r;t++){const r=this.rings[t],i=this.windings[t],o=e.indexOf(r);-1===o?(e.push(r),n.push(i)):n[o]+=i}const i=[],o=[];for(let t=0,r=e.length;t<r;t++){if(0===n[t])continue;const r=e[t],s=r.poly;if(-1===o.indexOf(s))if(r.isExterior)i.push(s);else{-1===o.indexOf(s)&&o.push(s);const t=i.indexOf(r.poly);-1!==t&&i.splice(t,1)}}for(let t=0,e=i.length;t<e;t++){const e=i[t].multiPoly;-1===r.indexOf(e)&&r.push(e)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(void 0!==this._isInResult)return this._isInResult;const t=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(Y.type){case"union":{const n=0===t.length,r=0===e.length;this._isInResult=n!==r;break}case"intersection":{let n,r;t.length<e.length?(n=t.length,r=e.length):(n=e.length,r=t.length),this._isInResult=r===Y.numMultiPolys&&n<r;break}case"xor":{const n=Math.abs(t.length-e.length);this._isInResult=n%2==1;break}case"difference":{const n=t=>1===t.length&&t[0].isSubject;this._isInResult=n(t)!==n(e);break}default:throw new Error(`Unrecognized operation type found ${Y.type}`)}return this._isInResult}}class k{constructor(t,e,n){if(!Array.isArray(t)||0===t.length)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=n,this.segments=[],"number"!=typeof t[0][0]||"number"!=typeof t[0][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const r=m.round(t[0][0],t[0][1]);this.bbox={ll:{x:r.x,y:r.y},ur:{x:r.x,y:r.y}};let i=r;for(let e=1,n=t.length;e<n;e++){if("number"!=typeof t[e][0]||"number"!=typeof t[e][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let n=m.round(t[e][0],t[e][1]);n.x===i.x&&n.y===i.y||(this.segments.push(F.fromRing(i,n,this)),n.x<this.bbox.ll.x&&(this.bbox.ll.x=n.x),n.y<this.bbox.ll.y&&(this.bbox.ll.y=n.y),n.x>this.bbox.ur.x&&(this.bbox.ur.x=n.x),n.y>this.bbox.ur.y&&(this.bbox.ur.y=n.y),i=n)}r.x===i.x&&r.y===i.y||this.segments.push(F.fromRing(i,r,this))}getSweepEvents(){const t=[];for(let e=0,n=this.segments.length;e<n;e++){const n=this.segments[e];t.push(n.leftSE),t.push(n.rightSE)}return t}}class G{constructor(t,e){if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new k(t[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let e=1,n=t.length;e<n;e++){const n=new k(t[e],this,!1);n.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=n.bbox.ll.x),n.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=n.bbox.ll.y),n.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=n.bbox.ur.x),n.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=n.bbox.ur.y),this.interiorRings.push(n)}this.multiPoly=e}getSweepEvents(){const t=this.exteriorRing.getSweepEvents();for(let e=0,n=this.interiorRings.length;e<n;e++){const n=this.interiorRings[e].getSweepEvents();for(let e=0,r=n.length;e<r;e++)t.push(n[e])}return t}}class B{constructor(t,e){if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{"number"==typeof t[0][0][0]&&(t=[t])}catch(e){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let e=0,n=t.length;e<n;e++){const n=new G(t[e],this);n.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=n.bbox.ll.x),n.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=n.bbox.ll.y),n.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=n.bbox.ur.x),n.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=n.bbox.ur.y),this.polys.push(n)}this.isSubject=e}getSweepEvents(){const t=[];for(let e=0,n=this.polys.length;e<n;e++){const n=this.polys[e].getSweepEvents();for(let e=0,r=n.length;e<r;e++)t.push(n[e])}return t}}class U{static factory(t){const e=[];for(let n=0,r=t.length;n<r;n++){const r=t[n];if(!r.isInResult()||r.ringOut)continue;let i=null,o=r.leftSE,s=r.rightSE;const a=[o],u=o.point,l=[];for(;i=o,o=s,a.push(o),o.point!==u;)for(;;){const t=o.getAvailableLinkedEvents();if(0===t.length){const t=a[0].point,e=a[a.length-1].point;throw new Error(`Unable to complete output ring starting at [${t.x}, ${t.y}]. Last matching segment found ends at [${e.x}, ${e.y}].`)}if(1===t.length){s=t[0].otherSE;break}let n=null;for(let t=0,e=l.length;t<e;t++)if(l[t].point===o.point){n=t;break}if(null!==n){const t=l.splice(n)[0],r=a.splice(t.index);r.unshift(r[0].otherSE),e.push(new U(r.reverse()));continue}l.push({index:a.length,point:o.point});const r=o.getLeftmostComparator(i);s=t.sort(r)[0].otherSE;break}e.push(new U(a))}return e}constructor(t){this.events=t;for(let e=0,n=t.length;e<n;e++)t[e].segment.ringOut=this;this.poly=null}getGeom(){let t=this.events[0].point;const e=[t];for(let n=1,r=this.events.length-1;n<r;n++){const r=this.events[n].point,i=this.events[n+1].point;0!==C(r,t,i)&&(e.push(r),t=r)}if(1===e.length)return null;const n=e[0],r=e[1];0===C(n,t,r)&&e.shift(),e.push(e[0]);const i=this.isExteriorRing()?1:-1,o=this.isExteriorRing()?0:e.length-1,s=this.isExteriorRing()?e.length:-1,a=[];for(let t=o;t!=s;t+=i)a.push([e[t].x,e[t].y]);return a}isExteriorRing(){if(void 0===this._isExteriorRing){const t=this.enclosingRing();this._isExteriorRing=!t||!t.isExteriorRing()}return this._isExteriorRing}enclosingRing(){return void 0===this._enclosingRing&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let t=this.events[0];for(let e=1,n=this.events.length;e<n;e++){const n=this.events[e];A.compare(t,n)>0&&(t=n)}let e=t.segment.prevInResult(),n=e?e.prevInResult():null;for(;;){if(!e)return null;if(!n)return e.ringOut;if(n.ringOut!==e.ringOut)return n.ringOut.enclosingRing()!==e.ringOut?e.ringOut:e.ringOut.enclosingRing();e=n.prevInResult(),n=e?e.prevInResult():null}}}class q{constructor(t){this.exteriorRing=t,t.poly=this,this.interiorRings=[]}addInterior(t){this.interiorRings.push(t),t.poly=this}getGeom(){const t=[this.exteriorRing.getGeom()];if(null===t[0])return null;for(let e=0,n=this.interiorRings.length;e<n;e++){const n=this.interiorRings[e].getGeom();null!==n&&t.push(n)}return t}}class z{constructor(t){this.rings=t,this.polys=this._composePolys(t)}getGeom(){const t=[];for(let e=0,n=this.polys.length;e<n;e++){const n=this.polys[e].getGeom();null!==n&&t.push(n)}return t}_composePolys(t){const e=[];for(let n=0,r=t.length;n<r;n++){const r=t[n];if(!r.poly)if(r.isExteriorRing())e.push(new q(r));else{const t=r.enclosingRing();t.poly||e.push(new q(t)),t.poly.addInterior(r)}}return e}}class j{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:F.compare;this.queue=t,this.tree=new a(e),this.segments=[]}process(t){const e=t.segment,n=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(e),n;const r=t.isLeft?this.tree.add(e):this.tree.find(e);if(!r)throw new Error(`Unable to find segment #${e.id} [${e.leftSE.point.x}, ${e.leftSE.point.y}] -> [${e.rightSE.point.x}, ${e.rightSE.point.y}] in SweepLine tree.`);let i,o,s=r,a=r;for(;void 0===i;)s=this.tree.prev(s),null===s?i=null:void 0===s.key.consumedBy&&(i=s.key);for(;void 0===o;)a=this.tree.next(a),null===a?o=null:void 0===a.key.consumedBy&&(o=a.key);if(t.isLeft){let r=null;if(i){const t=i.getIntersection(e);if(null!==t&&(e.isAnEndpoint(t)||(r=t),!i.isAnEndpoint(t))){const e=this._splitSafely(i,t);for(let t=0,r=e.length;t<r;t++)n.push(e[t])}}let s=null;if(o){const t=o.getIntersection(e);if(null!==t&&(e.isAnEndpoint(t)||(s=t),!o.isAnEndpoint(t))){const e=this._splitSafely(o,t);for(let t=0,r=e.length;t<r;t++)n.push(e[t])}}if(null!==r||null!==s){let t=null;t=null===r?s:null===s||A.comparePoints(r,s)<=0?r:s,this.queue.remove(e.rightSE),n.push(e.rightSE);const i=e.split(t);for(let t=0,e=i.length;t<e;t++)n.push(i[t])}n.length>0?(this.tree.remove(e),n.push(t)):(this.segments.push(e),e.prev=i)}else{if(i&&o){const t=i.getIntersection(o);if(null!==t){if(!i.isAnEndpoint(t)){const e=this._splitSafely(i,t);for(let t=0,r=e.length;t<r;t++)n.push(e[t])}if(!o.isAnEndpoint(t)){const e=this._splitSafely(o,t);for(let t=0,r=e.length;t<r;t++)n.push(e[t])}}}this.tree.remove(e)}return n}_splitSafely(t,e){this.tree.remove(t);const n=t.rightSE;this.queue.remove(n);const r=t.split(e);return r.push(n),void 0===t.consumedBy&&this.tree.add(t),r}}const V="undefined"!=typeof process&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,X="undefined"!=typeof process&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,Y=new class{run(t,e,n){Y.type=t,m.reset();const r=[new B(e,!0)];for(let t=0,e=n.length;t<e;t++)r.push(new B(n[t],!1));if(Y.numMultiPolys=r.length,"difference"===Y.type){const t=r[0];let e=1;for(;e<r.length;)null!==p(r[e].bbox,t.bbox)?e++:r.splice(e,1)}if("intersection"===Y.type)for(let t=0,e=r.length;t<e;t++){const e=r[t];for(let n=t+1,i=r.length;n<i;n++)if(null===p(e.bbox,r[n].bbox))return[]}const i=new a(A.compare);for(let t=0,e=r.length;t<e;t++){const e=r[t].getSweepEvents();for(let t=0,n=e.length;t<n;t++)if(i.insert(e[t]),i.size>V)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const o=new j(i);let s=i.size,u=i.pop();for(;u;){const t=u.key;if(i.size===s){const e=t.segment;throw new Error(`Unable to pop() ${t.isLeft?"left":"right"} SweepEvent [${t.point.x}, ${t.point.y}] from segment #${e.id} [${e.leftSE.point.x}, ${e.leftSE.point.y}] -> [${e.rightSE.point.x}, ${e.rightSE.point.y}] from queue.`)}if(i.size>V)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(o.segments.length>X)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const e=o.process(t);for(let t=0,n=e.length;t<n;t++){const n=e[t];void 0===n.consumedBy&&i.insert(n)}s=i.size,u=i.pop()}m.reset();const l=U.factory(o.segments);return new z(l).getGeom()}};return{union:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return Y.run("union",t,n)},intersection:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return Y.run("intersection",t,n)},xor:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return Y.run("xor",t,n)},difference:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return Y.run("difference",t,n)}}}()},582:function(t){t.exports=function(){"use strict";function t(t,r,i,o,s){!function t(n,r,i,o,s){for(;o>i;){if(o-i>600){var a=o-i+1,u=r-i+1,l=Math.log(a),c=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*c*(a-c)/a)*(u-a/2<0?-1:1);t(n,r,Math.max(i,Math.floor(r-u*c/a+h)),Math.min(o,Math.floor(r+(a-u)*c/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)}}(t,r,i||0,o||t.length-1,s||n)}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}var r=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,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 o(t,e){s(t,0,t.children.length,e,t)}function s(t,e,n,r,i){i||(i=g(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o=e;o<n;o++){var s=t.children[o];a(i,t.leaf?r(s):s)}return i}function a(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 u(t,e){return t.minX-e.minX}function l(t,e){return t.minY-e.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 p(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function f(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function g(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function d(e,n,r,i,o){for(var s=[n,r];s.length;)if(!((r=s.pop())-(n=s.pop())<=i)){var a=n+Math.ceil((r-n)/i/2)*i;t(e,a,n,r,o),s.push(n,a,a,r)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(t){var e=this.data,n=[];if(!f(t,e))return n;for(var r=this.toBBox,i=[];e;){for(var o=0;o<e.children.length;o++){var s=e.children[o],a=e.leaf?r(s):s;f(t,a)&&(e.leaf?n.push(s):p(t,a)?this._all(s,n):i.push(s))}e=i.pop()}return n},r.prototype.collides=function(t){var e=this.data;if(!f(t,e))return!1;for(var n=[];e;){for(var r=0;r<e.children.length;r++){var i=e.children[r],o=e.leaf?this.toBBox(i):i;if(f(t,o)){if(e.leaf||p(t,o))return!0;n.push(i)}}e=n.pop()}return!1},r.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0;e<t.length;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},r.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},r.prototype.clear=function(){return this.data=g([]),this},r.prototype.remove=function(t,e){if(!t)return this;for(var n,r,o,s=this.data,a=this.toBBox(t),u=[],l=[];s||u.length;){if(s||(s=u.pop(),r=u[u.length-1],n=l.pop(),o=!0),s.leaf){var c=i(t,s.children,e);if(-1!==c)return s.children.splice(c,1),u.push(s),this._condense(u),this}o||s.leaf||!p(s,a)?r?(n++,s=r.children[n],o=!1):s=null:(u.push(s),l.push(n),n=0,r=s,s=s.children[0])}return this},r.prototype.toBBox=function(t){return t},r.prototype.compareMinX=function(t,e){return t.minX-e.minX},r.prototype.compareMinY=function(t,e){return t.minY-e.minY},r.prototype.toJSON=function(){return this.data},r.prototype.fromJSON=function(t){return this.data=t,this},r.prototype._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},r.prototype._build=function(t,e,n,r){var i,s=n-e+1,a=this._maxEntries;if(s<=a)return o(i=g(t.slice(e,n+1)),this.toBBox),i;r||(r=Math.ceil(Math.log(s)/Math.log(a)),a=Math.ceil(s/Math.pow(a,r-1))),(i=g([])).leaf=!1,i.height=r;var u=Math.ceil(s/a),l=u*Math.ceil(Math.sqrt(a));d(t,e,n,l,this.compareMinX);for(var c=e;c<=n;c+=l){var h=Math.min(c+l-1,n);d(t,c,h,u,this.compareMinY);for(var p=c;p<=h;p+=u){var f=Math.min(p+u-1,h);i.children.push(this._build(t,p,f,r-1))}}return o(i,this.toBBox),i},r.prototype._chooseSubtree=function(t,e,n,r){for(;r.push(e),!e.leaf&&r.length-1!==n;){for(var i=1/0,o=1/0,s=void 0,a=0;a<e.children.length;a++){var u=e.children[a],l=c(u),h=(p=t,f=u,(Math.max(f.maxX,p.maxX)-Math.min(f.minX,p.minX))*(Math.max(f.maxY,p.maxY)-Math.min(f.minY,p.minY))-l);h<o?(o=h,i=l<i?l:i,s=u):h===o&&l<i&&(i=l,s=u)}e=s||e.children[0]}var p,f;return e},r.prototype._insert=function(t,e,n){var r=n?t:this.toBBox(t),i=[],o=this._chooseSubtree(r,this.data,e,i);for(o.children.push(t),a(o,r);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(r,i,e)},r.prototype._split=function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var s=this._chooseSplitIndex(n,i,r),a=g(n.children.splice(s,n.children.length-s));a.height=n.height,a.leaf=n.leaf,o(n,this.toBBox),o(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(n,a)},r.prototype._splitRoot=function(t,e){this.data=g([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(t,e,n){for(var r,i,o,a,u,l,h,p=1/0,f=1/0,g=e;g<=n-e;g++){var d=s(t,0,g,this.toBBox),y=s(t,g,n,this.toBBox),m=(i=d,o=y,a=Math.max(i.minX,o.minX),u=Math.max(i.minY,o.minY),l=Math.min(i.maxX,o.maxX),h=Math.min(i.maxY,o.maxY),Math.max(0,l-a)*Math.max(0,h-u)),_=c(d)+c(y);m<p?(p=m,r=g,f=_<f?_:f):m===p&&_<f&&(f=_,r=g)}return r||n-e},r.prototype._chooseSplitAxis=function(t,e,n){var r=t.leaf?this.compareMinX:u,i=t.leaf?this.compareMinY:l;this._allDistMargin(t,e,n,r)<this._allDistMargin(t,e,n,i)&&t.children.sort(r)},r.prototype._allDistMargin=function(t,e,n,r){t.children.sort(r);for(var i=this.toBBox,o=s(t,0,e,i),u=s(t,n-e,n,i),l=h(o)+h(u),c=e;c<n-e;c++){var p=t.children[c];a(o,t.leaf?i(p):p),l+=h(o)}for(var f=n-e-1;f>=e;f--){var g=t.children[f];a(u,t.leaf?i(g):g),l+=h(u)}return l},r.prototype._adjustParentBBoxes=function(t,e,n){for(var r=n;r>=0;r--)a(e[r],t)},r.prototype._condense=function(t){for(var e=t.length-1,n=void 0;e>=0;e--)0===t[e].children.length?e>0?(n=t[e-1].children).splice(n.indexOf(t[e]),1):this.clear():o(t[e],this.toBBox)},r}()},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 l(t){return null===t?null:t.left}function c(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 m=function(){},_=(m.prototype.interfaces_=function(){return[]},m.prototype.getClass=function(){return m},m.prototype.equalsWithTolerance=function(t,e,n){return Math.abs(t-e)<=n},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)),v=function(){},x={MAX_VALUE:{configurable:!0}},E=(v.isNaN=function(t){return Number.isNaN(t)},v.doubleToLongBits=function(t){return t},v.longBitsToDouble=function(t){return t},v.isInfinite=function(t){return!Number.isFinite(t)},x.MAX_VALUE.get=function(){return Number.MAX_VALUE},Object.defineProperties(v,x),function(){}),b=function(){},I=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}},L=(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 _("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!!m.equalsWithTolerance(this.x,e.x,n)&&!!m.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 _("Invalid ordinate index: "+t)},w.prototype.equals3D=function(t){return this.x===t.x&&this.y===t.y&&(this.z===t.z||v.isNaN(this.z))&&v.isNaN(t.z)},w.prototype.equals=function(t){return t instanceof w&&this.equals2D(t)},w.prototype.equalInZ=function(t,e){return m.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,b,e]},w.prototype.getClass=function(){return w},w.hashCode=function(){if(1===arguments.length){var t=v.doubleToLongBits(arguments[0]);return Math.trunc((t^t)>>>32)}},N.DimensionalComparator.get=function(){return L},N.serialVersionUID.get=function(){return 0x5cbf2c235c7e5800},N.NULL_ORDINATE.get=function(){return v.NaN},N.X.get=function(){return 0},N.Y.get=function(){return 1},N.Z.get=function(){return 2},Object.defineProperties(w,N),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 _("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}}),S=(L.prototype.compare=function(t,e){var n=t,r=e,i=L.compare(n.x,r.x);if(0!==i)return i;var o=L.compare(n.y,r.y);return 0!==o?o:this._dimensionsToTest<=2?0:L.compare(n.z,r.z)},L.prototype.interfaces_=function(){return[I]},L.prototype.getClass=function(){return L},L.compare=function(t,e){return t<e?-1:t>e?1:v.isNaN(t)?v.isNaN(e)?0:-1:v.isNaN(e)?1:0},function(){}),C=(S.prototype.create=function(){},S.prototype.interfaces_=function(){return[]},S.prototype.getClass=function(){return S},function(){}),P={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}},M=(C.prototype.interfaces_=function(){return[]},C.prototype.getClass=function(){return C},C.toLocationSymbol=function(t){switch(t){case C.EXTERIOR:return"e";case C.BOUNDARY:return"b";case C.INTERIOR:return"i";case C.NONE:return"-"}throw new _("Unknown location value: "+t)},P.INTERIOR.get=function(){return 0},P.BOUNDARY.get=function(){return 1},P.EXTERIOR.get=function(){return 2},P.NONE.get=function(){return-1},Object.defineProperties(C,P),function(t,e){return t.interfaces_&&t.interfaces_().indexOf(e)>-1}),T=function(){},R={LOG_10:{configurable:!0}},O=(T.prototype.interfaces_=function(){return[]},T.prototype.getClass=function(){return T},T.log10=function(t){var e=Math.log(t);return v.isInfinite(e)||v.isNaN(e)?e:e/T.LOG_10},T.min=function(t,e,n,r){var i=t;return e<i&&(i=e),n<i&&(i=n),r<i&&(i=r),i},T.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}},T.wrap=function(t,e){return t<0?e- -t%e:t%e},T.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}},T.average=function(t,e){return(t+e)/2},R.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(T,R),function(t){this.str=t}),A=(O.prototype.append=function(t){this.str+=t},O.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},O.prototype.toString=function(t){return this.str},function(t){this.value=t}),D=(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)},function(){}),F=(D.isWhitespace=function(t){return t<=32&&t>=0||127===t},D.toUpperCase=function(t){return t.toUpperCase()},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}},G=(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 O,a=F.MAX_PRINT_DIGITS-1,u=0;u<=a;u++){t&&u===o&&s.append(".");var l=Math.trunc(n._hi);if(l<0)break;var c=!1,h=0;l>9?(c=!0,h="9"):h="0"+l,s.append(h),n=n.subtract(F.valueOf(l)).multiply(F.TEN),c&&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,r,i,o,s=arguments[0],a=arguments[1],u=null,l=null,c=null,h=null;return i=this._hi/s,h=(u=(c=F.SPLIT*i)-(u=c-i))*(l=(h=F.SPLIT*s)-(l=h-s))-(o=i*s)+u*(r=s-l)+(n=i-u)*l+n*r,h=i+(c=(this._hi-o-h+this._lo-i*a)/s),this._hi=h,this._lo=i-h+c,this}},F.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},F.prototype.divide=function(){if(arguments[0]instanceof F){var t,e,n,r,i=arguments[0],o=null,s=null,a=null,u=null;return t=(n=this._hi/i._hi)-(o=(a=F.SPLIT*n)-(o=a-n)),u=o*(s=(u=F.SPLIT*i._hi)-(s=u-i._hi))-(r=n*i._hi)+o*(e=i._hi-s)+t*s+t*e,a=(this._hi-r-u+this._lo-n*i._lo)/i._hi,new F(u=n+a,n-u+a)}if("number"==typeof arguments[0]){var l=arguments[0];return v.isNaN(l)?F.createNaN():F.copy(this).selfDivide(l,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,n,r,i,o,s=arguments[0],a=null;return a=(r=this._hi+s)-(i=r-this._hi),n=(o=(a=s-i+(this._hi-a))+this._lo)+(r-(e=r+o)),this._hi=e+n,this._lo=n+(e-this._hi),this}}else if(2===arguments.length){var u,l,c,h,p=arguments[0],f=arguments[1],g=null,d=null,y=null;c=this._hi+p,l=this._lo+f,d=c-(y=c-this._hi),g=l-(h=l-this._lo);var m=(u=c+(y=(d=p-y+(this._hi-d))+l))+(y=(g=f-h+(this._lo-g))+(y+(c-u))),_=y+(u-m);return this._hi=m,this._lo=_,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,r,i=arguments[0],o=arguments[1],s=null,a=null,u=null,l=null;s=(u=F.SPLIT*this._hi)-this._hi,l=F.SPLIT*i,s=u-s,n=this._hi-s,a=l-i;var c=(u=this._hi*i)+(l=s*(a=l-a)-u+s*(r=i-a)+n*a+n*r+(this._hi*o+this._lo*i)),h=l+(s=u-c);return this._hi=c,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 v.isNaN(e)?F.createNaN():F.copy(this).selfMultiply(e,0)}},F.prototype.isNaN=function(){return v.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,b]},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 l=t.charAt(e);if(e++,D.isDigit(l)){var c=l-"0";o.selfMultiply(F.TEN),o.selfAdd(c),s++}else{if("."!==l){if("e"===l||"E"===l){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 '"+l+"' 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(v.NaN,v.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 O,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(v.NaN,v.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),function(){}),B={DP_SAFE_EPSILON:{configurable:!0}},U=(G.prototype.interfaces_=function(){return[]},G.prototype.getClass=function(){return G},G.orientationIndex=function(t,e,n){var r=G.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()},G.signOfDet2x2=function(t,e,n,r){return t.multiply(r).selfSubtract(e.multiply(n)).signum()},G.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)),l=a.subtract(u).selfDivide(s).doubleValue(),c=F.valueOf(t.x).selfAdd(F.valueOf(e.x).selfSubtract(t.x).selfMultiply(l)).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(c,g)},G.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 G.signum(s);r=i+o}else{if(!(i<0))return G.signum(s);if(o>=0)return G.signum(s);r=-i-o}var a=G.DP_SAFE_EPSILON*r;return s>=a||-s>=a?G.signum(s):2},G.signum=function(t){return t>0?1:t<0?-1:0},B.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(G,B),function(){}),q={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}},z=(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[b]},U.prototype.getClass=function(){return U},Object.defineProperties(U,q),function(){}),j=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}(z),V=function(){},X=(V.arraycopy=function(t,e,n,r,i){for(var o=0,s=e;s<e+i;s++)n[r+o]=t[s],o++},V.getProperty=function(t){return{"line.separator":"\n"}[t]},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],l=arguments[1],c=arguments[2];this.x=u,this.y=l,this.w=c}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,m=h.x*p.y-p.x*h.y,_=f.y-g.y,v=g.x-f.x,x=f.x*g.y-g.x*f.y;this.x=y*x-v*m,this.y=_*m-d*x,this.w=d*v-_*y}}),Y=(X.prototype.getY=function(){var t=this.y/this.w;if(v.isNaN(t)||v.isInfinite(t))throw new j;return t},X.prototype.getX=function(){var t=this.x/this.w;if(v.isNaN(t)||v.isInfinite(t))throw new j;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,l=n.x*r.y-r.x*n.y,c=i*u-a*o,h=(o*l-u*s)/c,p=(a*s-i*l)/c;if(v.isNaN(h)||v.isInfinite(h)||v.isNaN(p)||v.isInfinite(p))throw new j;return new w(h,p)},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)}}),H={serialVersionUID:{configurable:!0}},W=(Y.prototype.getArea=function(){return this.getWidth()*this.getHeight()},Y.prototype.equals=function(t){if(!(t instanceof Y))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()},Y.prototype.intersection=function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new Y;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 Y(e,r,n,i)},Y.prototype.isNull=function(){return this._maxx<this._minx},Y.prototype.getMaxX=function(){return this._maxx},Y.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 Y){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}},Y.prototype.intersects=function(){if(1===arguments.length){if(arguments[0]instanceof Y){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)}},Y.prototype.getMinY=function(){return this._miny},Y.prototype.getMinX=function(){return this._minx},Y.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 Y){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))}},Y.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t<e?t:e},Y.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx},Y.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},Y.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},Y.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},Y.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},Y.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},Y.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},Y.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()}},Y.prototype.contains=function(){if(1===arguments.length){if(arguments[0]instanceof Y){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)}},Y.prototype.centre=function(){return this.isNull()?null:new w((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},Y.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 Y){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)}},Y.prototype.getMaxY=function(){return this._maxy},Y.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)},Y.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)},Y.prototype.interfaces_=function(){return[E,e]},Y.prototype.getClass=function(){return Y},Y.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),l=Math.min(r.x,i.x),c=Math.max(r.x,i.x);return!(l>u||c<a||(a=Math.min(o.y,s.y),u=Math.max(o.y,s.y),l=Math.min(r.y,i.y),c=Math.max(r.y,i.y),l>u||c<a))}},H.serialVersionUID.get=function(){return 0x51845cd552189800},Object.defineProperties(Y,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 me},K=(J.prototype.read=function(t){var e,n,r;t=t.replace(/[\n\r]/g," ");var i=W.typeStr.exec(t);if(-1!==t.search("EMPTY")&&((i=W.emptyTypeStr.exec(t))[2]=void 0),i&&(n=i[1].toLowerCase(),r=i[2],Z[n]&&(e=Z[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])+")"},{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(",")}}),Z={point:function(t){if(void 0===t)return this.geometryFactory.createPoint();var e=t.trim().split(W.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(W.trimParens,"$1"),r.push(Z.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(W.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(W.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(W.parenComma),r=[],i=0,o=n.length;i<o;++i)e=n[i].replace(W.trimParens,"$1"),r.push(Z.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(W.parenComma),s=[],a=0,u=o.length;a<u;++a)e=o[a].replace(W.trimParens,"$1"),n=Z.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(W.doubleParenComma),r=[],i=0,o=n.length;i<o;++i)e=n[i].replace(W.trimParens,"$1"),r.push(Z.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)},Q=($.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+" )"},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}(Q),et=function(){},nt=(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:""))},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}},it=(nt.prototype.getIndexAlongSegment=function(t,e){return this.computeIntLineIndex(),this._intLineIndex[t][e]},nt.prototype.getTopologySummary=function(){var t=new O;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),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 Y(this._inputLines[0][0],this._inputLines[0][1]),n=new Y(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,Y.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 j))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=G.intersection(t,e,n,r),s=this.isInSegmentEnvelopes(o);V.out.println("DD in env = "+s+" --------------------- "+o),i.distance(o)>1e-4&&V.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 l=this.safeHCoordinateIntersection(i,o,s,a);return l.x+=u.x,l.y+=u.y,l},e.prototype.computeCollinearIntersection=function(e,n,r,i){var o=Y.intersects(e,n,r),s=Y.intersects(e,n,i),a=Y.intersects(r,i,e),u=Y.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,l=n.x<r.x?n.x:r.x,c=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>l?o:l)+(a<h?a:h))/2,g=((s>c?s:c)+(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,!Y.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(){},st=(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}},function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var t=arguments[0];this._p=t}),at=(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()!==C.EXTERIOR},st.prototype.getLocation=function(){return this._isPointOnSegment?C.BOUNDARY:this._crossingCount%2==1?C.INTERIOR:C.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&&M(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],l=o[a-1];if(s.countSegment(u,l),s.isOnSegment())return s.getLocation()}return s.getLocation()}},function(){}),ut={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}},lt=(at.prototype.interfaces_=function(){return[]},at.prototype.getClass=function(){return at},at.orientationIndex=function(t,e,n){return G.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(M(arguments[0],U)){var s=arguments[0],a=s.size();if(a<3)return 0;var u=new w,l=new w,c=new w;s.getCoordinate(0,l),s.getCoordinate(1,c);var h=l.x;c.x-=h;for(var p=0,f=1;f<a-1;f++)u.y=l.y,l.x=c.x,l.y=c.y,s.getCoordinate(f+1,c),c.x-=h,p+=l.x*(u.y-c.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(Y.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?T.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)!==C.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,l=a-i,c=u-o;n+=Math.sqrt(l*l+c*c),i=a,o=u}return n},at.isCCW=function(t){var e=t.length-1;if(e<3)throw new _("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],l=t[a];if(u.equals2D(n)||l.equals2D(n)||u.equals2D(l))return!1;var c=at.computeOrientation(u,n,l);return 0===c?u.x>l.x:c>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 _("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),l=((o.x-s.x)*(a.x-s.x)+(o.y-s.y)*(a.y-s.y))/u;if(l<=0)return o.distance(s);if(l>=1)return o.distance(a);var c=((s.y-o.y)*(a.x-s.x)-(s.x-o.x)*(a.y-s.y))/u;return Math.abs(c)*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),function(){}),ct=(lt.prototype.filter=function(t){},lt.prototype.interfaces_=function(){return[]},lt.prototype.getClass=function(){return 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}},pt=(ct.prototype.isGeometryCollection=function(){return this.getSortIndex()===ct.SORTINDEX_GEOMETRYCOLLECTION},ct.prototype.getFactory=function(){return this._factory},ct.prototype.getGeometryN=function(t){return this},ct.prototype.getArea=function(){return 0},ct.prototype.isRectangle=function(){return!1},ct.prototype.equals=function(){if(arguments[0]instanceof ct){var t=arguments[0];return null!==t&&this.equalsTopo(t)}if(arguments[0]instanceof Object){var e=arguments[0];if(!(e instanceof ct))return!1;var n=e;return this.equalsExact(n)}},ct.prototype.equalsExact=function(t){return this===t||this.equalsExact(t,0)},ct.prototype.geometryChanged=function(){this.apply(ct.geometryChangedFilter)},ct.prototype.geometryChangedAction=function(){this._envelope=null},ct.prototype.equalsNorm=function(t){return null!==t&&this.norm().equalsExact(t.norm())},ct.prototype.getLength=function(){return 0},ct.prototype.getNumGeometries=function(){return 1},ct.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)}},ct.prototype.getUserData=function(){return this._userData},ct.prototype.getSRID=function(){return this._SRID},ct.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},ct.prototype.checkNotGeometryCollection=function(t){if(t.getSortIndex()===ct.SORTINDEX_GEOMETRYCOLLECTION)throw new _("This method does not support GeometryCollection arguments")},ct.prototype.equal=function(t,e,n){return 0===n?t.equals(e):t.distance(e)<=n},ct.prototype.norm=function(){var t=this.copy();return t.normalize(),t},ct.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()},ct.prototype.getEnvelopeInternal=function(){return null===this._envelope&&(this._envelope=this.computeEnvelopeInternal()),new Y(this._envelope)},ct.prototype.setSRID=function(t){this._SRID=t},ct.prototype.setUserData=function(t){this._userData=t},ct.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},ct.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()},ct.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===ct.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===ct.SORTINDEX_MULTIPOINT||this.getSortIndex()===ct.SORTINDEX_MULTILINESTRING||this.getSortIndex()===ct.SORTINDEX_MULTIPOLYGON},ct.prototype.interfaces_=function(){return[b,E,e]},ct.prototype.getClass=function(){return ct},ct.hasNonEmptyElements=function(t){for(var e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1},ct.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(ct,ht),function(){}),ft=(pt.interfaces_=function(){return[lt]},pt.filter=function(t){t.geometryChangedAction()},function(){}),gt=(ft.prototype.filter=function(t){},ft.prototype.interfaces_=function(){return[]},ft.prototype.getClass=function(){return ft},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}},yt=(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 mt},dt.MultiValentEndPointBoundaryNodeRule.get=function(){return _t},dt.MonoValentEndPointBoundaryNodeRule.get=function(){return vt},dt.MOD2_BOUNDARY_RULE.get=function(){return new yt},dt.ENDPOINT_BOUNDARY_RULE.get=function(){return new mt},dt.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new _t},dt.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new vt},dt.OGC_SFS_BOUNDARY_RULE.get=function(){return gt.MOD2_BOUNDARY_RULE},Object.defineProperties(gt,dt),function(){}),mt=(yt.prototype.isInBoundary=function(t){return t%2==1},yt.prototype.interfaces_=function(){return[gt]},yt.prototype.getClass=function(){return yt},function(){}),_t=(mt.prototype.isInBoundary=function(t){return t>0},mt.prototype.interfaces_=function(){return[gt]},mt.prototype.getClass=function(){return mt},function(){}),vt=(_t.prototype.isInBoundary=function(t){return t>1},_t.prototype.interfaces_=function(){return[gt]},_t.prototype.getClass=function(){return _t},function(){}),xt=(vt.prototype.isInBoundary=function(t){return 1===t},vt.prototype.interfaces_=function(){return[gt]},vt.prototype.getClass=function(){return vt},function(){}),Et=(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",function(){}),bt=(Et.prototype.hasNext=function(){},Et.prototype.next=function(){},Et.prototype.remove=function(){},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)),It=((r.prototype=new Error).name="NoSuchElementException",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}(bt)),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 l=0;l<a.length;l++)this.add(a[l],u);else for(var c=a.length-1;c>=0;c--)this.add(a[c],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],m=arguments[3],_=1;y>m&&(_=-1);for(var v=y;v!==m;v+=_)this.add(g[v],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}(It),Lt=function(){},St={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}},Ct=(St.ForwardComparator.get=function(){return Ct},St.BidirectionalComparator.get=function(){return Pt},St.coordArrayType.get=function(){return new Array(0).fill(null)},Lt.prototype.interfaces_=function(){return[]},Lt.prototype.getClass=function(){return Lt},Lt.isRing=function(t){return!(t.length<4||!t[0].equals2D(t[t.length-1]))},Lt.ptNotInList=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(Lt.indexOf(r,e)<0)return r}return null},Lt.scroll=function(t,e){var n=Lt.indexOf(e,t);if(n<0)return null;var r=new Array(t.length).fill(null);V.arraycopy(t,n,r,0,t.length-n),V.arraycopy(t,0,r,t.length-n,n),V.arraycopy(r,0,t,0,t.length)},Lt.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}},Lt.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()},Lt.hasRepeatedPoints=function(t){for(var e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1},Lt.removeRepeatedPoints=function(t){return Lt.hasRepeatedPoints(t)?new Nt(t,!1).toCoordinateArray():t},Lt.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}},Lt.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},Lt.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])},Lt.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},Lt.envelope=function(t){for(var e=new Y,n=0;n<t.length;n++)e.expandToInclude(t[n]);return e},Lt.toCoordinateArray=function(t){return t.toArray(Lt.coordArrayType)},Lt.atLeastNCoordinatesOrNothing=function(t,e){return e.length>=t?e:[]},Lt.indexOf=function(t,e){for(var n=0;n<e.length;n++)if(t.equals(e[n]))return n;return-1},Lt.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},Lt.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},Lt.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},Lt.extract=function(t,e,n){e=T.clamp(e,0,t.length);var r=(n=T.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(Lt,St),function(){}),Pt=(Ct.prototype.compare=function(t,e){return Lt.compare(t,e)},Ct.prototype.interfaces_=function(){return[I]},Ct.prototype.getClass=function(){return Ct},function(){}),Mt=(Pt.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=Lt.compare(n,r);return Lt.isEqualReversed(n,r)?0:i},Pt.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=Lt.increasingDirection(n),o=Lt.increasingDirection(r),s=i>0?0:n.length-1,a=o>0?0:n.length-1,u=0;u<n.length;u++){var l=n[s].compareTo(r[a]);if(0!==l)return l;s+=i,a+=o}return 0},Pt.prototype.interfaces_=function(){return[I]},Pt.prototype.getClass=function(){return Pt},function(){}),Tt=(Mt.prototype.get=function(){},Mt.prototype.put=function(){},Mt.prototype.size=function(){},Mt.prototype.values=function(){},Mt.prototype.entrySet=function(){},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}(Mt)),Rt=((i.prototype=new Error).name="OperationNotSupported",(o.prototype=new xt).contains=function(){},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 Ot(this)},e}(o)),Ot=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,Dt=((h.prototype=new Tt).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)===l(a(a(t)))){var e=c(a(a(t)));1===s(e)?(u(a(t),At),u(e,At),u(a(a(t)),1),t=a(a(t))):(t===c(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=l(a(a(t)));1===s(n)?(u(a(t),At),u(n,At),u(a(a(t)),1),t=a(a(t))):(t===l(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 It,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 Rt,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_},function(){}),Ft=(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)},function(t){this.treeSet_=t,this.position_=0}),kt=(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},function(){}),Gt=(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 It,n=0,r=t.length;n<r;n++)e.add(t[n]);return e},function(){}),Bt={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}},Ut=(Bt.P.get=function(){return 0},Bt.L.get=function(){return 1},Bt.A.get=function(){return 2},Bt.FALSE.get=function(){return-1},Bt.TRUE.get=function(){return-2},Bt.DONTCARE.get=function(){return-3},Bt.SYM_FALSE.get=function(){return"F"},Bt.SYM_TRUE.get=function(){return"T"},Bt.SYM_DONTCARE.get=function(){return"*"},Bt.SYM_P.get=function(){return"0"},Bt.SYM_L.get=function(){return"1"},Bt.SYM_A.get=function(){return"2"},Gt.prototype.interfaces_=function(){return[]},Gt.prototype.getClass=function(){return Gt},Gt.toDimensionSymbol=function(t){switch(t){case Gt.FALSE:return Gt.SYM_FALSE;case Gt.TRUE:return Gt.SYM_TRUE;case Gt.DONTCARE:return Gt.SYM_DONTCARE;case Gt.P:return Gt.SYM_P;case Gt.L:return Gt.SYM_L;case Gt.A:return Gt.SYM_A}throw new _("Unknown dimension value: "+t)},Gt.toDimensionValue=function(t){switch(D.toUpperCase(t)){case Gt.SYM_FALSE:return Gt.FALSE;case Gt.SYM_TRUE:return Gt.TRUE;case Gt.SYM_DONTCARE:return Gt.DONTCARE;case Gt.SYM_P:return Gt.P;case Gt.SYM_L:return Gt.L;case Gt.SYM_A:return Gt.A}throw new _("Unknown dimension symbol: "+t)},Object.defineProperties(Gt,Bt),function(){}),qt=(Ut.prototype.filter=function(t){},Ut.prototype.interfaces_=function(){return[]},Ut.prototype.getClass=function(){return Ut},function(){}),zt=(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},function(t){function e(e,n){if(t.call(this,n),this._geometries=e||[],t.hasNullElements(this._geometries))throw new _("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 Y,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=Gt.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=Gt.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),l=i.getGeometryN(a),c=u.compareToSameClass(l,r);if(0!==c)return c;a++}return a<o?1:a<s?-1:0}},e.prototype.apply=function(){if(M(arguments[0],ft))for(var t=arguments[0],e=0;e<this._geometries.length;e++)this._geometries[e].apply(t);else if(M(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(M(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(M(arguments[0],lt)){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}(ct)),jt=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 ct.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()?Gt.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 Vt(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}(zt),Vt=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}},Xt=(Vt.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)},Vt.prototype.getBoundary=function(){return this._geom instanceof Jt?this.boundaryLineString(this._geom):this._geom instanceof jt?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()},Vt.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()])},Vt.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()},Vt.prototype.computeBoundaryCoordinates=function(t){var e=new It;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 Lt.toCoordinateArray(e)},Vt.prototype.addEndpoint=function(t){var e=this._endpointMap.get(t);null===e&&(e=new Xt,this._endpointMap.put(t,e)),e.count++},Vt.prototype.interfaces_=function(){return[]},Vt.prototype.getClass=function(){return Vt},Vt.getBoundary=function(){return 1===arguments.length?new Vt(arguments[0]).getBoundary():2===arguments.length?new Vt(arguments[0],arguments[1]).getBoundary():void 0},function(){this.count=null}),Yt=(Xt.prototype.interfaces_=function(){return[]},Xt.prototype.getClass=function(){return Xt},function(){}),Ht={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}},Wt=(Yt.prototype.interfaces_=function(){return[]},Yt.prototype.getClass=function(){return Yt},Yt.chars=function(t,e){for(var n=new Array(e).fill(null),r=0;r<e;r++)n[r]=t;return String(n)},Yt.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(){}(Yt.getStackTrace(r))),a=0;a<i;a++)try{o+=s.readLine()+Yt.NEWLINE}catch(t){if(!(t instanceof g))throw t;et.shouldNeverReachHere()}return o}},Yt.split=function(t,e){for(var n=e.length,r=new It,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},Yt.toString=function(){if(1===arguments.length){var t=arguments[0];return Yt.SIMPLE_ORDINATE_FORMAT.format(t)}},Yt.spaces=function(t){return Yt.chars(" ",t)},Ht.NEWLINE.get=function(){return V.getProperty("line.separator")},Ht.SIMPLE_ORDINATE_FORMAT.get=function(){return new function(){}("0.#")},Object.defineProperties(Yt,Ht),function(){}),Jt=(Wt.prototype.interfaces_=function(){return[]},Wt.prototype.getClass=function(){return Wt},Wt.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))},Wt.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)},Wt.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)||v.isNaN(s)&&v.isNaN(a)))return!1}return!0},Wt.extend=function(t,e,n){var r=t.create(n,e.getDimension()),i=e.size();if(Wt.copy(e,0,r,0,i),i>0)for(var o=i;o<n;o++)Wt.copy(e,i-1,r,o,1);return r},Wt.reverse=function(t){for(var e=t.size()-1,n=Math.trunc(e/2),r=0;r<=n;r++)Wt.swap(t,r,e-r)},Wt.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)}},Wt.copy=function(t,e,n,r,i){for(var o=0;o<i;o++)Wt.copyCoord(t,e+o,n,r+o)},Wt.toString=function(){if(1===arguments.length){var t=arguments[0],e=t.size();if(0===e)return"()";var n=t.getDimension(),r=new O;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(Yt.toString(t.getOrdinate(i,o)))}return r.append(")"),r.toString()}},Wt.ensureValidRing=function(t,e){var n=e.size();return 0===n?e:n<=3?Wt.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:Wt.createClosedRing(t,e,n+1)},Wt.createClosedRing=function(t,e,n){var r=t.create(n,e.getDimension()),i=e.size();Wt.copy(e,0,r,0,i);for(var o=i;o<n;o++)Wt.copy(e,0,r,o,1);return r},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 Y:this._points.expandEnvelope(new Y)},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&&Wt.reverse(this._points),null}},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?Gt.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 Wt.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(M(arguments[0],ft))for(var t=arguments[0],e=0;e<this._points.size();e++)t.filter(this._points.getCoordinate(e));else if(M(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(M(arguments[0],Ut)||M(arguments[0],lt))&&arguments[0].filter(this)},e.prototype.getBoundary=function(){return new Vt(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 _("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}(ct)),Kt=function(){},Zt=(Kt.prototype.interfaces_=function(){return[]},Kt.prototype.getClass=function(){return Kt},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 Y;var t=new Y;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 Gt.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(M(arguments[0],ft)){var t=arguments[0];if(this.isEmpty())return null;t.filter(this.getCoordinate())}else if(M(arguments[0],qt)){var e=arguments[0];if(this.isEmpty())return null;e.filter(this._coordinates,0),e.isGeometryChanged()&&this.geometryChanged()}else(M(arguments[0],Ut)||M(arguments[0],lt))&&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}(ct)),$t=function(){},Qt=($t.prototype.interfaces_=function(){return[]},$t.prototype.getClass=function(){return $t},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 _("holes must not contain null elements");if(e.isEmpty()&&t.hasNonEmptyElements(n))throw new _("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),l=t.getY(a);if(u!==o==(l!==s))return!1;o=u,s=l}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);V.arraycopy(e.getCoordinates(),0,r,0,r.length);var i=Lt.minCoordinate(e.getCoordinates());Lt.scroll(r,i),V.arraycopy(r,0,e.getCoordinates(),0,r.length),e.getCoordinates()[r.length]=r[0],at.isCCW(e.getCoordinates())===n&&Lt.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(),l=i.getNumInteriorRing(),c=0;c<u&&c<l;){var h=this.getInteriorRingN(c),p=i.getInteriorRingN(c),f=h.compareToSameClass(p,r);if(0!==f)return f;c++}return c<u?1:c<l?-1:0}},e.prototype.apply=function(t){if(M(t,ft)){this._shell.apply(t);for(var e=0;e<this._holes.length;e++)this._holes[e].apply(t)}else if(M(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(M(t,Ut))t.filter(this);else if(M(t,lt)){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}(ct)),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 ct.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 Gt.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}(zt),ee=function(t){function e(e,n){e instanceof w&&n instanceof me&&(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 ct.SORTINDEX_LINEARRING},e.prototype.getBoundaryDimension=function(){return Gt.FALSE},e.prototype.isClosed=function(){return!!this.isEmpty()||t.prototype.isClosed.call(this)},e.prototype.reverse=function(){var t=this._points.copy();return Wt.reverse(t),this.getFactory().createLinearRing(t)},e.prototype.validateConstruction=function(){if(!this.isEmpty()&&!t.prototype.isClosed.call(this))throw new _("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<e.MINIMUM_VALID_SIZE)throw new _("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 ct.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 It,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}(zt),re=function(t){this._factory=t||null,this._isUserDataCopied=!1},ie={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}},oe=(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 zt?this.editGeometryCollection(t,e):t instanceof Qt?this.editPolygon(t,e):t instanceof Zt||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 It,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()===jt?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 It,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),function(){}),se=(oe.prototype.edit=function(t,e){return t},oe.prototype.interfaces_=function(){return[re.GeometryEditorOperation]},oe.prototype.getClass=function(){return oe},function(){}),ae=(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 Zt?n.length>0?e.createPoint(n[0]):e.createPoint():t},se.prototype.interfaces_=function(){return[re.GeometryEditorOperation]},se.prototype.getClass=function(){return se},function(){}),ue=(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 Zt?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},ae.prototype.interfaces_=function(){return[re.GeometryEditorOperation]},ae.prototype.getClass=function(){return ae},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(M(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}}),le={serialVersionUID:{configurable:!0}},ce=(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 _("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 v.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 O(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},le.serialVersionUID.get=function(){return-0xcb44a778db18e00},Object.defineProperties(ue,le),function(){}),he={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}},pe=(ce.prototype.readResolve=function(){return ce.instance()},ce.prototype.create=function(){if(1===arguments.length){if(arguments[0]instanceof Array)return new ue(arguments[0]);if(M(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)}},ce.prototype.interfaces_=function(){return[S,e]},ce.prototype.getClass=function(){return ce},ce.instance=function(){return ce.instanceObject},he.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},he.instanceObject.get=function(){return new ce},Object.defineProperties(ce,he),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 It,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 Rt;return this.map_.entries().forEach((function(e){return t.add(e)})),t},e.prototype.size=function(){return this.map_.size()},e}(Mt)),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}},de=(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 v.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),function t(e){this._name=e||null,t.nameToTypeMap.put(e,this)}),ye={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}},me=(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"),function t(){this._precisionModel=new fe,this._SRID=0,this._coordinateSequenceFactory=t.getDefaultCoordinateSequenceFactory(),0===arguments.length||(1===arguments.length?M(arguments[0],S)?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]))}),_e={serialVersionUID:{configurable:!0}},ve=(me.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)},me.prototype.createLineString=function(t){return t?t instanceof Array?new Jt(this.getCoordinateSequenceFactory().create(t),this):M(t,U)?new Jt(t,this):void 0:new Jt(this.getCoordinateSequenceFactory().create([]),this)},me.prototype.createMultiLineString=function(){return 0===arguments.length?new jt(null,this):1===arguments.length?new jt(arguments[0],this):void 0},me.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(me.toGeometryArray(t));var a=t.iterator().next();if(t.size()>1){if(a instanceof Qt)return this.createMultiPolygon(me.toPolygonArray(t));if(a instanceof Jt)return this.createMultiLineString(me.toLineStringArray(t));if(a instanceof Zt)return this.createMultiPoint(me.toPointArray(t));et.shouldNeverReachHere("Unhandled class: "+a.getClass().getName())}return a},me.prototype.createMultiPointFromCoords=function(t){return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)},me.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(M(arguments[0],U))return new Zt(arguments[0],this)}},me.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},me.prototype.createPolygon=function(){if(0===arguments.length)return new Qt(null,null,this);if(1===arguments.length){if(M(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 Qt(arguments[0],arguments[1],this)},me.prototype.getSRID=function(){return this._SRID},me.prototype.createGeometryCollection=function(){return 0===arguments.length?new zt(null,this):1===arguments.length?new zt(arguments[0],this):void 0},me.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)}}})},me.prototype.getPrecisionModel=function(){return this._precisionModel},me.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(M(arguments[0],U))return new ee(arguments[0],this)}},me.prototype.createMultiPolygon=function(){return 0===arguments.length?new ne(null,this):1===arguments.length?new ne(arguments[0],this):void 0},me.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(M(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());Wt.copy(e,r,i,0,1),n[r]=this.createPoint(i)}return this.createMultiPoint(n)}}},me.prototype.interfaces_=function(){return[e]},me.prototype.getClass=function(){return me},me.toMultiPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},me.toGeometryArray=function(t){if(null===t)return null;var e=new Array(t.size()).fill(null);return t.toArray(e)},me.getDefaultCoordinateSequenceFactory=function(){return ce.instance()},me.toMultiLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},me.toLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},me.toMultiPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},me.toLinearRingArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},me.toPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},me.toPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},me.createPointFromInternalCoord=function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)},_e.serialVersionUID.get=function(){return-0x5ea75f2051eeb400},Object.defineProperties(me,_e),["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"]),xe=function(t){this.geometryFactory=t||new me},Ee=(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!==ve.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(!be[e])throw new Error("Geometry is not supported");return be[e].apply(this,[t])},{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)}}),be={coordinate:function(t){return[t.x,t.y]},Point:function(t){return{type:"Point",coordinates:be.coordinate.apply(this,[t.getCoordinate()])}},MultiPoint:function(t){for(var e=[],n=0;n<t._geometries.length;++n){var r=t._geometries[n],i=be.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(be.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=be.LineString.apply(this,[r]);e.push(i.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(t){var e=[],n=be.LineString.apply(this,[t._shell]);e.push(n.coordinates);for(var r=0;r<t._holes.length;++r){var i=t._holes[r],o=be.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=be.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(be[i].apply(this,[r]))}return{type:"GeometryCollection",geometries:e}}},Ie=function(t){this.geometryFactory=t||new me,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new xe(this.geometryFactory)},we=(Ie.prototype.read=function(t){var e=this.parser.read(t);return this.precisionModel.getType()===fe.FIXED&&this.reducePrecision(e),e},Ie.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])},function(){this.parser=new xe(this.geometryFactory)}),Ne=(we.prototype.write=function(t){return this.parser.write(t)},function(){}),Le={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}},Se=(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},Le.ON.get=function(){return 0},Le.LEFT.get=function(){return 1},Le.RIGHT.get=function(){return 2},Object.defineProperties(Ne,Le),(d.prototype=new Error).name="EmptyStackException",(y.prototype=new bt).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},function(){this._minIndex=-1,this._minCoord=null,this._minDe=null,this._orientedDe=null}),Ce=(Se.prototype.getCoordinate=function(){return this._minCoord},Se.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},Se.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)},Se.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},Se.prototype.getEdge=function(){return this._orientedDe},Se.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])},Se.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)},Se.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())},Se.prototype.interfaces_=function(){return[]},Se.prototype.getClass=function(){return Se},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}(Q)),Pe=function(){this.array_=[]},Me=(Pe.prototype.addLast=function(t){this.array_.push(t)},Pe.prototype.removeFirst=function(){return this.array_.shift()},Pe.prototype.isEmpty=function(){return 0===this.array_.length},function(){this._finder=null,this._dirEdgeList=new It,this._nodes=new It,this._rightMostCoord=null,this._env=null,this._finder=new Se}),Te=(Me.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();)t.next().setVisited(!1)},Me.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},Me.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 Ce("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)}},Me.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths(Ne.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},Me.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},Me.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)}},Me.prototype.computeDepths=function(t){var e=new Rt,n=new Pe,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))}}}},Me.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.x<e._rightMostCoord.x?-1:this._rightMostCoord.x>e._rightMostCoord.x?1:0},Me.prototype.getEnvelope=function(){if(null===this._env){for(var t=new Y,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},Me.prototype.addReachable=function(t){var e=new y;for(e.add(t);!e.empty();){var n=e.pop();this.add(n,e)}},Me.prototype.copySymDepths=function(t){var e=t.getSym();e.setDepth(Ne.LEFT,t.getDepth(Ne.RIGHT)),e.setDepth(Ne.RIGHT,t.getDepth(Ne.LEFT))},Me.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)}},Me.prototype.getNodes=function(){return this._nodes},Me.prototype.getDirectedEdges=function(){return this._dirEdgeList},Me.prototype.interfaces_=function(){return[E]},Me.prototype.getClass=function(){return 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}}),Re=(Te.prototype.setAllLocations=function(t){for(var e=0;e<this.location.length;e++)this.location[e]=t},Te.prototype.isNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]!==C.NONE)return!1;return!0},Te.prototype.setAllLocationsIfNull=function(t){for(var e=0;e<this.location.length;e++)this.location[e]===C.NONE&&(this.location[e]=t)},Te.prototype.isLine=function(){return 1===this.location.length},Te.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]=C.NONE,e[Ne.RIGHT]=C.NONE,this.location=e}for(var n=0;n<this.location.length;n++)this.location[n]===C.NONE&&n<t.location.length&&(this.location[n]=t.location[n])},Te.prototype.getLocations=function(){return this.location},Te.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},Te.prototype.toString=function(){var t=new O;return this.location.length>1&&t.append(C.toLocationSymbol(this.location[Ne.LEFT])),t.append(C.toLocationSymbol(this.location[Ne.ON])),this.location.length>1&&t.append(C.toLocationSymbol(this.location[Ne.RIGHT])),t.toString()},Te.prototype.setLocations=function(t,e,n){this.location[Ne.ON]=t,this.location[Ne.LEFT]=e,this.location[Ne.RIGHT]=n},Te.prototype.get=function(t){return t<this.location.length?this.location[t]:C.NONE},Te.prototype.isArea=function(){return this.location.length>1},Te.prototype.isAnyNull=function(){for(var t=0;t<this.location.length;t++)if(this.location[t]===C.NONE)return!0;return!1},Te.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}},Te.prototype.init=function(t){this.location=new Array(t).fill(null),this.setAllLocations(C.NONE)},Te.prototype.isEqualOnSide=function(t,e){return this.location[e]===t.location[e]},Te.prototype.allPositionsEqual=function(t){for(var e=0;e<this.location.length;e++)if(this.location[e]!==t)return!1;return!0},Te.prototype.interfaces_=function(){return[]},Te.prototype.getClass=function(){return Te},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 Te(e),this.elt[1]=new Te(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.elt[0]=new Te(n.elt[0]),this.elt[1]=new Te(n.elt[1])}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.elt[0]=new Te(C.NONE),this.elt[1]=new Te(C.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 Te(o,s,a),this.elt[1]=new Te(o,s,a)}else if(4===arguments.length){var u=arguments[0],l=arguments[1],c=arguments[2],h=arguments[3];this.elt[0]=new Te(C.NONE,C.NONE,C.NONE),this.elt[1]=new Te(C.NONE,C.NONE,C.NONE),this.elt[u].setLocations(l,c,h)}}),Oe=(Re.prototype.getGeometryCount=function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t},Re.prototype.setAllLocations=function(t,e){this.elt[t].setAllLocations(e)},Re.prototype.isNull=function(t){return this.elt[t].isNull()},Re.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)}},Re.prototype.isLine=function(t){return this.elt[t].isLine()},Re.prototype.merge=function(t){for(var e=0;e<2;e++)null===this.elt[e]&&null!==t.elt[e]?this.elt[e]=new Te(t.elt[e]):this.elt[e].merge(t.elt[e])},Re.prototype.flip=function(){this.elt[0].flip(),this.elt[1].flip()},Re.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)}},Re.prototype.toString=function(){var t=new O;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()},Re.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()}},Re.prototype.isAnyNull=function(t){return this.elt[t].isAnyNull()},Re.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)}},Re.prototype.isEqualOnSide=function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)},Re.prototype.allPositionsEqual=function(t,e){return this.elt[t].allPositionsEqual(e)},Re.prototype.toLine=function(t){this.elt[t].isArea()&&(this.elt[t]=new Te(this.elt[t].location[0]))},Re.prototype.interfaces_=function(){return[]},Re.prototype.getClass=function(){return Re},Re.toLineLabel=function(t){for(var e=new Re(C.NONE),n=0;n<2;n++)e.setLocation(n,t.getLocation(n));return e},function(){this._startDe=null,this._maxNodeDegree=-1,this._edges=new It,this._pts=new It,this._label=new Re(C.NONE),this._ring=null,this._isHole=null,this._shell=null,this._holes=new It,this._geometryFactory=null;var t=arguments[0],e=arguments[1];this._geometryFactory=e,this.computePoints(t),this.computeRing()}),Ae=(Oe.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())},Oe.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},Oe.prototype.computePoints=function(t){this._startDe=t;var e=t,n=!0;do{if(null===e)throw new Ce("Found null DirectedEdge");if(e.getEdgeRing()===this)throw new Ce("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)},Oe.prototype.getLinearRing=function(){return this._ring},Oe.prototype.getCoordinate=function(t){return this._pts.get(t)},Oe.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},Oe.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])}},Oe.prototype.isHole=function(){return this._isHole},Oe.prototype.setInResult=function(){var t=this._startDe;do{t.getEdge().setInResult(!0),t=t.getNext()}while(t!==this._startDe)},Oe.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},Oe.prototype.addHole=function(t){this._holes.add(t)},Oe.prototype.isShell=function(){return null===this._shell},Oe.prototype.getLabel=function(){return this._label},Oe.prototype.getEdges=function(){return this._edges},Oe.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},Oe.prototype.getShell=function(){return this._shell},Oe.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===C.NONE)return null;if(this._label.getLocation(e)===C.NONE)return this._label.setLocation(e,n),null}},Oe.prototype.setShell=function(t){this._shell=t,null!==t&&t.addHole(this)},Oe.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)},Oe.prototype.interfaces_=function(){return[]},Oe.prototype.getClass=function(){return Oe},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}(Oe)),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 It,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}(Oe),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}},ke=(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},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 Re(0,C.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=C.NONE;if(n=this._label.getLocation(e),!t.isNull(e)){var r=t.getLocation(e);n!==C.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 Re(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 Re)for(var n=arguments[0],r=0;r<2;r++){var i=this.computeMergedLocation(n,r);this._label.getLocation(r)===C.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=C.NONE;null!==this._label&&(e=this._label.getLocation(t));var n=null;switch(e){case C.BOUNDARY:n=C.INTERIOR;break;case C.INTERIOR:default:n=C.BOUNDARY}this._label.setLocation(t,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Fe)),Ge=function(){this.nodeMap=new h,this.nodeFact=null;var t=arguments[0];this.nodeFact=t},Be=(Ge.prototype.find=function(t){return this.nodeMap.get(t)},Ge.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)}},Ge.prototype.print=function(t){for(var e=this.iterator();e.hasNext();)e.next().print(t)},Ge.prototype.iterator=function(){return this.nodeMap.values().iterator()},Ge.prototype.values=function(){return this.nodeMap.values()},Ge.prototype.getBoundaryNodes=function(t){for(var e=new It,n=this.iterator();n.hasNext();){var r=n.next();r.getLabel().getLocation(t)===C.BOUNDARY&&e.add(r)}return e},Ge.prototype.add=function(t){var e=t.getCoordinate();this.addNode(e).add(t)},Ge.prototype.interfaces_=function(){return[]},Ge.prototype.getClass=function(){return Ge},function(){}),Ue={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}},qe=(Be.prototype.interfaces_=function(){return[]},Be.prototype.getClass=function(){return Be},Be.isNorthern=function(t){return t===Be.NE||t===Be.NW},Be.isOpposite=function(t,e){return t!==e&&2==(t-e+4)%4},Be.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},Be.isInHalfPlane=function(t,e){return e===Be.SE?t===Be.SE||t===Be.SW:t===e||t===e+1},Be.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 _("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?Be.NE:Be.SE:e>=0?Be.NW:Be.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 _("Cannot compute the quadrant for two identical points "+n);return r.x>=n.x?r.y>=n.y?Be.NE:Be.SE:r.y>=n.y?Be.NW:Be.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(Be,Ue),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}}),ze=(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=Be.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},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 Re(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 Ce("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)===C.INTERIOR&&this._label.getLocation(e,Ne.RIGHT)===C.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,C.EXTERIOR),n=!this._label.isArea(1)||this._label.allPositionsEqual(1,C.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===C.EXTERIOR&&e===C.INTERIOR?1:t===C.INTERIOR&&e===C.EXTERIOR?-1:0},e}(qe)),je=function(){},Ve=(je.prototype.createNode=function(t){return new ke(t,null)},je.prototype.interfaces_=function(){return[]},je.prototype.getClass=function(){return je},function(){if(this._edges=new It,this._nodes=null,this._edgeEndList=new It,0===arguments.length)this._nodes=new Ge(new je);else if(1===arguments.length){var t=arguments[0];this._nodes=new Ge(t)}}),Xe=(Ve.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)}},Ve.prototype.find=function(t){return this._nodes.find(t)},Ve.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)}},Ve.prototype.getNodeIterator=function(){return this._nodes.iterator()},Ve.prototype.linkResultDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkResultDirectedEdges()},Ve.prototype.debugPrintln=function(t){V.out.println(t)},Ve.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)===C.BOUNDARY},Ve.prototype.linkAllDirectedEdges=function(){for(var t=this._nodes.iterator();t.hasNext();)t.next().getEdges().linkAllDirectedEdges()},Ve.prototype.matchInSameDirection=function(t,e,n,r){return!!t.equals(n)&&at.computeOrientation(t,e,r)===at.COLLINEAR&&Be.quadrant(t,e)===Be.quadrant(n,r)},Ve.prototype.getEdgeEnds=function(){return this._edgeEndList},Ve.prototype.debugPrint=function(t){V.out.print(t)},Ve.prototype.getEdgeIterator=function(){return this._edges.iterator()},Ve.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},Ve.prototype.insertEdge=function(t){this._edges.add(t)},Ve.prototype.findEdgeEnd=function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var n=e.next();if(n.getEdge()===t)return n}return null},Ve.prototype.addEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this._edges.add(n);var r=new ze(n,!0),i=new ze(n,!1);r.setSym(i),i.setSym(r),this.add(r),this.add(i)}},Ve.prototype.add=function(t){this._nodes.add(t),this._edgeEndList.add(t)},Ve.prototype.getNodes=function(){return this._nodes.values()},Ve.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},Ve.prototype.interfaces_=function(){return[]},Ve.prototype.getClass=function(){return Ve},Ve.linkResultDirectedEdges=function(t){for(var e=t.iterator();e.hasNext();)e.next().getEdges().linkResultDirectedEdges()},function(){this._geometryFactory=null,this._shellList=new It;var t=arguments[0];this._geometryFactory=t}),Ye=(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 It,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 Ce("unable to assign hole to a shell",r.getCoordinate(0));r.setShell(i)}}},Xe.prototype.buildMinimalEdgeRings=function(t,e,n){for(var r=new It,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 It,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(),l=u.getLinearRing(),c=l.getEnvelopeInternal();null!==o&&(s=o.getLinearRing().getEnvelopeInternal());var h=!1;c.contains(r)&&at.isPointInRing(i,l.getCoordinates())&&(h=!0),h&&(null===o||s.contains(c))&&(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];Ve.linkResultDirectedEdges(n);var r=this.buildMaximalEdgeRings(e),i=new It,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},function(){}),He=(Ye.prototype.getBounds=function(){},Ye.prototype.interfaces_=function(){return[]},Ye.prototype.getClass=function(){return Ye},function(){this._bounds=null,this._item=null;var t=arguments[0],e=arguments[1];this._bounds=t,this._item=e}),We=(He.prototype.getItem=function(){return this._item},He.prototype.getBounds=function(){return this._bounds},He.prototype.interfaces_=function(){return[Ye,e]},He.prototype.getClass=function(){return He},function(){this._size=null,this._items=null,this._size=0,this._items=new It,this._items.add(null)}),Je=(We.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},We.prototype.size=function(){return this._size},We.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)},We.prototype.clear=function(){this._size=0,this._items.clear()},We.prototype.isEmpty=function(){return 0===this._size},We.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)},We.prototype.interfaces_=function(){return[]},We.prototype.getClass=function(){return We},function(){}),Ke=(Je.prototype.visitItem=function(t){},Je.prototype.interfaces_=function(){return[]},Je.prototype.getClass=function(){return Je},function(){}),Ze=(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},function(){if(this._childBoundables=new It,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=(Ze.prototype.getLevel=function(){return this._level},Ze.prototype.size=function(){return this._childBoundables.size()},Ze.prototype.getChildBoundables=function(){return this._childBoundables},Ze.prototype.addChildBoundable=function(t){et.isTrue(null===this._bounds),this._childBoundables.add(t)},Ze.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Ze.prototype.getBounds=function(){return null===this._bounds&&(this._bounds=this.computeBounds()),this._bounds},Ze.prototype.interfaces_=function(){return[Ye,e]},Ze.prototype.getClass=function(){return Ze},$e.serialVersionUID.get=function(){return 0x5a1e55ec41369800},Object.defineProperties(Ze,$e),function(){}),tn=(Qe.reverseOrder=function(){return{compare:function(t,e){return e.compareTo(t)}}},Qe.min=function(t){return Qe.sort(t),t.get(0)},Qe.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])},Qe.singletonList=function(t){var e=new It;return e.add(t),e},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()}),en=(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 _("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 Ze},function t(){if(this._root=null,this._built=!1,this._itemBoundables=new It,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}},rn=(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 Ze?t+=this.size(n):n instanceof He&&(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 He&&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 It:t}if(1===arguments.length){for(var e=arguments[0],n=new It,r=e.getChildBoundables().iterator();r.hasNext();){var i=r.next();if(i instanceof Ze){var o=this.itemsTree(i);null!==o&&n.add(o)}else i instanceof He?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 He(t,e))},en.prototype.boundablesAtLevel=function(){if(1===arguments.length){var t=arguments[0],e=new It;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 Ze?this.boundablesAtLevel(n,s,i):(et.isTrue(s instanceof He),-1===n&&i.add(s))}return null}},en.prototype.query=function(){if(1===arguments.length){var t=arguments[0];this.build();var e=new It;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(M(arguments[2],Je)&&arguments[0]instanceof Object&&arguments[1]instanceof Ze)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 Ze?this.query(i,u,o):u instanceof He?o.visitItem(u.getItem()):et.shouldNeverReachHere())}else if(M(arguments[2],bt)&&arguments[0]instanceof Object&&arguments[1]instanceof Ze)for(var l=arguments[0],c=arguments[2],h=arguments[1].getChildBoundables(),p=0;p<h.size();p++){var f=h.get(p);this.getIntersectsOp().intersects(f.getBounds(),l)&&(f instanceof Ze?this.query(l,f,c):f instanceof He?c.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 Ze&&(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 Ze){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 It;n.add(this.createNode(e));var r=new It(t);Qe.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),function(){}),on=function(){},sn=(on.prototype.distance=function(t,e){},on.prototype.interfaces_=function(){return[]},on.prototype.getClass=function(){return on},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 It,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 It;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(M(arguments[2],Je)&&arguments[0]instanceof Object&&arguments[1]instanceof Ze){var i=arguments[0],o=arguments[1],s=arguments[2];t.prototype.query.call(this,i,o,s)}else if(M(arguments[2],bt)&&arguments[0]instanceof Object&&arguments[1]instanceof Ze){var a=arguments[0],u=arguments[1],l=arguments[2];t.prototype.query.call(this,a,u,l)}},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 It(t);Qe.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(M(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,v.POSITIVE_INFINITY)}}else if(2===arguments.length){if(arguments[0]instanceof n&&M(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],l=null,c=new We;for(c.add(a);!c.isEmpty()&&u>0;){var h=c.poll(),p=h.getDistance();if(p>=u)break;h.isLeaves()?(u=p,l=h):h.expandToQueue(c,u)}return[l.getBoundable(0).getItem(),l.getBoundable(1).getItem()]}}else if(3===arguments.length){var f=arguments[2],g=new He(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[I]},compare:function(e,r){return t.compareDoubles(n.centreX(e.getBounds()),n.centreX(r.getBounds()))}}},r.yComparator.get=function(){return{interfaces_:function(){return[I]},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 Y(n.getBounds()):t.expandToInclude(n.getBounds())}return t},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ze),un=function(){},ln=(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},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=(ln.prototype.getCoordinate=function(){return this.coord},ln.prototype.print=function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},ln.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)},ln.prototype.isEndPoint=function(t){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===t},ln.prototype.isInterior=function(){return this._isInterior},ln.prototype.interfaces_=function(){return[E]},ln.prototype.getClass=function(){return ln},function(){this._nodeMap=new h,this._edge=null;var t=arguments[0];this._edge=t}),hn=(cn.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()},cn.prototype.addCollapsedNodes=function(){var t=new It;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)}},cn.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},cn.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))}},cn.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))},cn.prototype.iterator=function(){return this._nodeMap.values().iterator()},cn.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}},cn.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)},cn.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}},cn.prototype.getEdge=function(){return this._edge},cn.prototype.addEndpoints=function(){var t=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0),this.add(this._edge.getCoordinate(t),t)},cn.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())},cn.prototype.add=function(t,e){var n=new ln(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)},cn.prototype.checkSplitEdgesCorrectness=function(t){var e=this._edge.getCoordinates(),n=t.get(0).getCoordinate(0);if(!n.equals2D(e[0]))throw new Q("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 Q("bad split edge end point at "+i)},cn.prototype.interfaces_=function(){return[]},cn.prototype.getClass=function(){return cn},function(){}),pn=(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 _("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 _("Cannot compute the octant for two identical points "+i);return hn.octant(s,a)}},function(){}),fn=(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},function(){}),gn=(fn.prototype.addIntersection=function(t,e){},fn.prototype.interfaces_=function(){return[pn]},fn.prototype.getClass=function(){return fn},function(){this._nodeList=new cn(this),this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e}),dn=(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 It;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)},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}},mn=(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?v.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=v.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 j))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||v.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=v.doubleToLongBits(this.p0.x);t^=31*v.doubleToLongBits(this.p0.y);var e=Math.trunc(t)^Math.trunc(t>>32),n=v.doubleToLongBits(this.p1.x);return n^=31*v.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),function(){this.tempEnv1=new Y,this.tempEnv2=new Y,this._overlapSeg1=new dn,this._overlapSeg2=new dn}),_n=(mn.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)}},mn.prototype.interfaces_=function(){return[]},mn.prototype.getClass=function(){return mn},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=(_n.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},_n.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)},_n.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},_n.prototype.computeOverlaps=function(t,e){this.computeOverlapsInternal(this._start,this._end,t,t._start,t._end,e)},_n.prototype.setId=function(t){this._id=t},_n.prototype.select=function(t,e){this.computeSelect(t,this._start,this._end,e)},_n.prototype.getEnvelope=function(){if(null===this._env){var t=this._pts[this._start],e=this._pts[this._end];this._env=new Y(t,e)}return this._env},_n.prototype.getEndIndex=function(){return this._end},_n.prototype.getStartIndex=function(){return this._start},_n.prototype.getContext=function(){return this._context},_n.prototype.getId=function(){return this._id},_n.prototype.computeOverlapsInternal=function(t,e,n,r,i,o){var s=this._pts[t],a=this._pts[e],u=n._pts[r],l=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,l),!o.tempEnv1.intersects(o.tempEnv2))return null;var c=Math.trunc((t+e)/2),h=Math.trunc((r+i)/2);t<c&&(r<h&&this.computeOverlapsInternal(t,c,n,r,h,o),h<i&&this.computeOverlapsInternal(t,c,n,h,i,o)),c<e&&(r<h&&this.computeOverlapsInternal(c,e,n,r,h,o),h<i&&this.computeOverlapsInternal(c,e,n,h,i,o))},_n.prototype.interfaces_=function(){return[]},_n.prototype.getClass=function(){return _n},function(){}),xn=(vn.prototype.interfaces_=function(){return[]},vn.prototype.getClass=function(){return vn},vn.getChainStartIndices=function(t){var e=0,n=new It;n.add(new A(e));do{var r=vn.findChainEnd(t,e);n.add(new A(r)),e=r}while(e<t.length-1);return vn.toIntArray(n)},vn.findChainEnd=function(t,e){for(var n=e;n<t.length-1&&t[n].equals2D(t[n+1]);)n++;if(n>=t.length-1)return t.length-1;for(var r=Be.quadrant(t[n],t[n+1]),i=e+1;i<t.length&&(t[i-1].equals2D(t[i])||Be.quadrant(t[i-1],t[i])===r);)i++;return i-1},vn.getChains=function(){if(1===arguments.length){var t=arguments[0];return vn.getChains(t,null)}if(2===arguments.length){for(var e=arguments[0],n=arguments[1],r=new It,i=vn.getChainStartIndices(e),o=0;o<i.length-1;o++){var s=new _n(e,i[o],i[o+1],n);r.add(s)}return r}},vn.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e},function(){}),En=(xn.prototype.computeNodes=function(t){},xn.prototype.getNodedSubstrings=function(){},xn.prototype.interfaces_=function(){return[]},xn.prototype.getClass=function(){return xn},function(){if(this._segInt=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.setSegmentIntersector(t)}}),bn=(En.prototype.setSegmentIntersector=function(t){this._segInt=t},En.prototype.interfaces_=function(){return[xn]},En.prototype.getClass=function(){return En},function(t){function e(e){e?t.call(this,e):t.call(this),this._monoChains=new It,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=vn.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 In(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 In},Object.defineProperties(e,n),e}(En)),In=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}(mn),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}},Ln=(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),function(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=at.COUNTERCLOCKWISE,this._inputLine=t||null}),Sn={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}},Cn=(Ln.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)},Ln.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]=Ln.DELETE,i=!0,r=!0),t=i?n:e,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e)}return r},Ln.prototype.isShallowConcavity=function(t,e,n,r){return at.computeOrientation(t,e,n)===this._angleOrientation&&at.distancePointLine(e,t,n)<r},Ln.prototype.isShallowSampled=function(t,e,n,r,i){var o=Math.trunc((r-n)/Ln.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},Ln.prototype.isConcave=function(t,e,n){return at.computeOrientation(t,e,n)===this._angleOrientation},Ln.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()},Ln.prototype.findNextNonDeletedIndex=function(t){for(var e=t+1;e<this._inputLine.length&&this._isDeleted[e]===Ln.DELETE;)e++;return e},Ln.prototype.isShallow=function(t,e,n,r){return at.distancePointLine(e,t,n)<r},Ln.prototype.collapseLine=function(){for(var t=new Nt,e=0;e<this._inputLine.length;e++)this._isDeleted[e]!==Ln.DELETE&&t.add(this._inputLine[e]);return t.toCoordinateArray()},Ln.prototype.interfaces_=function(){return[]},Ln.prototype.getClass=function(){return Ln},Ln.simplify=function(t,e){return new Ln(t).simplify(e)},Sn.INIT.get=function(){return 0},Sn.DELETE.get=function(){return 1},Sn.KEEP.get=function(){return 1},Sn.NUM_PTS_TO_CHECK.get=function(){return 10},Object.defineProperties(Ln,Sn),function(){this._ptList=null,this._precisionModel=null,this._minimimVertexDistance=0,this._ptList=new It}),Pn={COORDINATE_ARRAY_TYPE:{configurable:!0}},Mn=(Cn.prototype.getCoordinates=function(){return this._ptList.toArray(Cn.COORDINATE_ARRAY_TYPE)},Cn.prototype.setPrecisionModel=function(t){this._precisionModel=t},Cn.prototype.addPt=function(t){var e=new w(t);if(this._precisionModel.makePrecise(e),this.isRedundant(e))return null;this._ptList.add(e)},Cn.prototype.revere=function(){},Cn.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])},Cn.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},Cn.prototype.toString=function(){return(new me).createLineString(this.getCoordinates()).toString()},Cn.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)},Cn.prototype.setMinimumVertexDistance=function(t){this._minimimVertexDistance=t},Cn.prototype.interfaces_=function(){return[]},Cn.prototype.getClass=function(){return Cn},Pn.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)},Object.defineProperties(Cn,Pn),function(){}),Tn={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}},Rn=(Mn.prototype.interfaces_=function(){return[]},Mn.prototype.getClass=function(){return Mn},Mn.toDegrees=function(t){return 180*t/Math.PI},Mn.normalize=function(t){for(;t>Math.PI;)t-=Mn.PI_TIMES_2;for(;t<=-Math.PI;)t+=Mn.PI_TIMES_2;return t},Mn.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)}},Mn.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},Mn.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},Mn.interiorAngle=function(t,e,n){var r=Mn.angle(e,t),i=Mn.angle(e,n);return Math.abs(i-r)},Mn.normalizePositive=function(t){if(t<0){for(;t<0;)t+=Mn.PI_TIMES_2;t>=Mn.PI_TIMES_2&&(t=0)}else{for(;t>=Mn.PI_TIMES_2;)t-=Mn.PI_TIMES_2;t<0&&(t=0)}return t},Mn.angleBetween=function(t,e,n){var r=Mn.angle(e,t),i=Mn.angle(e,n);return Mn.diff(r,i)},Mn.diff=function(t,e){var n=null;return(n=t<e?e-t:t-e)>Math.PI&&(n=2*Math.PI-n),n},Mn.toRadians=function(t){return t*Math.PI/180},Mn.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?Mn.COUNTERCLOCKWISE:n<0?Mn.CLOCKWISE:Mn.NONE},Mn.angleBetweenOriented=function(t,e,n){var r=Mn.angle(e,t),i=Mn.angle(e,n)-r;return i<=-Math.PI?i+Mn.PI_TIMES_2:i>Math.PI?i-Mn.PI_TIMES_2:i},Tn.PI_TIMES_2.get=function(){return 2*Math.PI},Tn.PI_OVER_2.get=function(){return Math.PI/2},Tn.PI_OVER_4.get=function(){return Math.PI/4},Tn.COUNTERCLOCKWISE.get=function(){return at.COUNTERCLOCKWISE},Tn.CLOCKWISE.get=function(){return at.CLOCKWISE},Tn.NONE.get=function(){return at.COLLINEAR},Object.defineProperties(Mn,Tn),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)}),On={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}},An=(Rn.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)},Rn.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 l=new w(r.p1.x+u.x,r.p1.y+u.y),c=new w(i.p1.x+u.x,i.p1.y+u.y);this._segList.addPt(l),this._segList.addPt(c)}},Rn.prototype.getCoordinates=function(){return this._segList.getCoordinates()},Rn.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 j))throw t;o=new w(0,0),i=!1}i?this._segList.addPt(o):this.addLimitedMitreJoin(e,n,r,this._bufParams.getMitreLimit())},Rn.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,l=n.y-t.y,c=Math.atan2(l,u);r===at.CLOCKWISE?a<=c&&(a+=2*Math.PI):a>=c&&(a-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,a,c,r,i),this._segList.addPt(n)},Rn.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*Rn.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))},Rn.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()},Rn.prototype.addSegments=function(t,e){this._segList.addPts(t,e)},Rn.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)},Rn.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)},Rn.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)},Rn.prototype.addLimitedMitreJoin=function(t,e,n,r){var i=this._seg0.p1,o=Mn.angle(i,this._seg0.p0),s=Mn.angleBetweenOriented(this._seg0.p0,i,this._seg1.p1)/2,a=Mn.normalize(o+s),u=Mn.normalize(a+Math.PI),l=r*n,c=n-l*Math.abs(Math.sin(s)),h=i.x+l*Math.cos(u),p=i.y+l*Math.sin(u),f=new w(h,p),g=new dn(i,f),d=g.pointAlongOffset(1,c),y=g.pointAlongOffset(1,-c);this._side===Ne.LEFT?(this._segList.addPt(d),this._segList.addPt(y)):(this._segList.addPt(y),this._segList.addPt(d))},Rn.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,l=i*n*s/a;r.p0.x=t.p0.x-l,r.p0.y=t.p0.y+u,r.p1.x=t.p1.x-l,r.p1.y=t.p1.y+u},Rn.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,l=0,c=new w;l<s;){var h=e+o*l;c.x=t.x+i*Math.cos(h),c.y=t.y+i*Math.sin(h),this._segList.addPt(c),l+=u}},Rn.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*Rn.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)}},Rn.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()},Rn.prototype.addBevelJoin=function(t,e){this._segList.addPt(t.p1),this._segList.addPt(e.p0)},Rn.prototype.init=function(t){this._distance=t,this._maxCurveSegmentError=t*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Cn,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(t*Rn.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},Rn.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))},Rn.prototype.closeRing=function(){this._segList.closeRing()},Rn.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},Rn.prototype.interfaces_=function(){return[]},Rn.prototype.getClass=function(){return Rn},On.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return.001},On.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return.001},On.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},On.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(Rn,On),function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var t=arguments[0],e=arguments[1];this._precisionModel=t,this._bufParams=e}),Dn=(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&&Lt.reverse(o),o},An.prototype.computeSingleSidedBufferCurve=function(t,e,n){var r=this.simplifyTolerance(this._distance);if(e){n.addSegments(t,!0);var i=Ln.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=Ln.simplify(t,r),u=a.length-1;n.initSideSegments(a[0],a[1],Ne.LEFT),n.addFirstSegment();for(var l=2;l<=u;l++)n.addNextSegment(a[l],!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=Ln.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=Ln.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=Ln.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=Ln.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=Ln.simplify(t,r),u=a.length-1;n.initSideSegments(a[0],a[1],Ne.LEFT),n.addFirstSegment();for(var l=2;l<=u;l++)n.addNextSegment(a[l],!0)}n.addLastSegment()},An.prototype.getSegGen=function(t){return new Rn(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},function(){this._subgraphs=null,this._seg=new dn,this._cga=new at;var t=arguments[0];this._subgraphs=t}),Fn={DepthSegment:{configurable:!0}},kn=(Dn.prototype.findStabbedSegments=function(){if(1===arguments.length){for(var t=arguments[0],e=new It,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(M(arguments[2],bt)&&arguments[0]instanceof w&&arguments[1]instanceof ze){for(var o=arguments[0],s=arguments[1],a=arguments[2],u=s.getEdge().getCoordinates(),l=0;l<u.length-1;l++)if(this._seg.p0=u[l],this._seg.p1=u[l+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 c=s.getDepth(Ne.LEFT);this._seg.p0.equals(u[l])||(c=s.getDepth(Ne.RIGHT));var h=new kn(this._seg,c);a.add(h)}}else if(M(arguments[2],bt)&&arguments[0]instanceof w&&M(arguments[1],bt))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:Qe.min(e)._leftDepth},Dn.prototype.interfaces_=function(){return[]},Dn.prototype.getClass=function(){return Dn},Fn.DepthSegment.get=function(){return kn},Object.defineProperties(Dn,Fn),function(){this._upwardSeg=null,this._leftDepth=null;var t=arguments[0],e=arguments[1];this._upwardSeg=new dn(t),this._leftDepth=e}),Gn=(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},function(t,e,n){this.p0=t||null,this.p1=e||null,this.p2=n||null}),Bn=(Gn.prototype.area=function(){return Gn.area(this.p0,this.p1,this.p2)},Gn.prototype.signedArea=function(){return Gn.signedArea(this.p0,this.p1,this.p2)},Gn.prototype.interpolateZ=function(t){if(null===t)throw new _("Supplied point is null.");return Gn.interpolateZ(t,this.p0,this.p1,this.p2)},Gn.prototype.longestSideLength=function(){return Gn.longestSideLength(this.p0,this.p1,this.p2)},Gn.prototype.isAcute=function(){return Gn.isAcute(this.p0,this.p1,this.p2)},Gn.prototype.circumcentre=function(){return Gn.circumcentre(this.p0,this.p1,this.p2)},Gn.prototype.area3D=function(){return Gn.area3D(this.p0,this.p1,this.p2)},Gn.prototype.centroid=function(){return Gn.centroid(this.p0,this.p1,this.p2)},Gn.prototype.inCentre=function(){return Gn.inCentre(this.p0,this.p1,this.p2)},Gn.prototype.interfaces_=function(){return[]},Gn.prototype.getClass=function(){return Gn},Gn.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)},Gn.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2},Gn.det=function(t,e,n,r){return t*r-e*n},Gn.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,l=r.y-o,c=s*l-a*u,h=t.x-i,p=t.y-o,f=(l*h-a*p)/c,g=(-u*h+s*p)/c;return e.z+f*(n.z-e.z)+g*(r.z-e.z)},Gn.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},Gn.isAcute=function(t,e,n){return!!Mn.isAcute(t,e,n)&&!!Mn.isAcute(e,n,t)&&!!Mn.isAcute(n,t,e)},Gn.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,l=2*Gn.det(o,s,a,u),c=Gn.det(s,o*o+s*s,u,a*a+u*u),h=Gn.det(o,o*o+s*s,a,a*a+u*u);return new w(r-c/l,i+h/l)},Gn.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)},Gn.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)},Gn.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,l=i*u-o*a,c=o*s-r*u,h=r*a-i*s,p=l*l+c*c+h*h;return Math.sqrt(p)/2},Gn.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)},Gn.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)},function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new It;var t=arguments[0],e=arguments[1],n=arguments[2];this._inputGeom=t,this._distance=e,this._curveBuilder=n}),Un=(Bn.prototype.addPoint=function(t){if(this._distance<=0)return null;var e=t.getCoordinates(),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,C.EXTERIOR,C.INTERIOR)},Bn.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=Lt.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,C.EXTERIOR,C.INTERIOR);for(var o=0;o<t.getNumInteriorRing();o++){var s=t.getInteriorRingN(o),a=Lt.removeRepeatedPoints(s.getCoordinates());this._distance>0&&this.isErodedCompletely(s,-this._distance)||this.addPolygonRing(a,e,Ne.opposite(n),C.INTERIOR,C.EXTERIOR)}},Bn.prototype.isTriangleErodedCompletely=function(t,e){var n=new Gn(t[0],t[1],t[2]),r=n.inCentre();return at.distancePointLine(r,n.p0,n.p1)<Math.abs(e)},Bn.prototype.addLineString=function(t){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var e=Lt.removeRepeatedPoints(t.getCoordinates()),n=this._curveBuilder.getLineCurve(e,this._distance);this.addCurve(n,C.EXTERIOR,C.INTERIOR)},Bn.prototype.addCurve=function(t,e,n){if(null===t||t.length<2)return null;var r=new gn(t,new Re(0,C.BOUNDARY,e,n));this._curveList.add(r)},Bn.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList},Bn.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)},Bn.prototype.add=function(t){if(t.isEmpty())return null;t instanceof Qt?this.addPolygon(t):t instanceof Jt?this.addLineString(t):t instanceof Zt?this.addPoint(t):(t instanceof te||t instanceof jt||t instanceof ne||t instanceof zt)&&this.addCollection(t)},Bn.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},Bn.prototype.addCollection=function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);this.add(n)}},Bn.prototype.interfaces_=function(){return[]},Bn.prototype.getClass=function(){return Bn},function(){}),qn=(Un.prototype.locate=function(t){},Un.prototype.interfaces_=function(){return[]},Un.prototype.getClass=function(){return Un},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()}),zn=(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 zt?(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 zt)},function(){this._geom=null;var t=arguments[0];this._geom=t}),jn=(zn.prototype.locate=function(t){return zn.locate(t,this._geom)},zn.prototype.interfaces_=function(){return[Un]},zn.prototype.getClass=function(){return zn},zn.isPointInRing=function(t,e){return!!e.getEnvelopeInternal().intersects(t)&&at.isPointInRing(t,e.getCoordinates())},zn.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!zn.isPointInRing(t,n))return!1;for(var r=0;r<e.getNumInteriorRing();r++){var i=e.getInteriorRingN(r);if(zn.isPointInRing(t,i))return!1}return!0},zn.containsPoint=function(t,e){if(e instanceof Qt)return zn.containsPointInPolygon(t,e);if(e instanceof zt)for(var n=new qn(e);n.hasNext();){var r=n.next();if(r!==e&&zn.containsPoint(t,r))return!0}return!1},zn.locate=function(t,e){return e.isEmpty()?C.EXTERIOR:zn.containsPoint(t,e)?C.INTERIOR:C.EXTERIOR},function(){this._edgeMap=new h,this._edgeList=null,this._ptInAreaLocation=[C.NONE,C.NONE]}),Vn=(jn.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)},jn.prototype.propagateSideLabels=function(t){for(var e=C.NONE,n=this.iterator();n.hasNext();){var r=n.next().getLabel();r.isArea(t)&&r.getLocation(t,Ne.LEFT)!==C.NONE&&(e=r.getLocation(t,Ne.LEFT))}if(e===C.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)===C.NONE&&a.setLocation(t,Ne.ON,i),a.isArea(t)){var u=a.getLocation(t,Ne.LEFT),l=a.getLocation(t,Ne.RIGHT);if(l!==C.NONE){if(l!==i)throw new Ce("side location conflict",s.getCoordinate());u===C.NONE&&et.shouldNeverReachHere("found single null side (at "+s.getCoordinate()+")"),i=u}else et.isTrue(a.getLocation(t,Ne.LEFT)===C.NONE,"found single null side"),a.setLocation(t,Ne.RIGHT,i),a.setLocation(t,Ne.LEFT,i)}}},jn.prototype.getCoordinate=function(){var t=this.iterator();return t.hasNext()?t.next().getCoordinate():null},jn.prototype.print=function(t){V.out.println("EdgeEndStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();)e.next().print(t)},jn.prototype.isAreaLabelsConsistent=function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},jn.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!==C.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},jn.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},jn.prototype.iterator=function(){return this.getEdges().iterator()},jn.prototype.getEdges=function(){return null===this._edgeList&&(this._edgeList=new It(this._edgeMap.values())),this._edgeList},jn.prototype.getLocation=function(t,e,n){return this._ptInAreaLocation[t]===C.NONE&&(this._ptInAreaLocation[t]=zn.locate(e,n[t].getGeometry())),this._ptInAreaLocation[t]},jn.prototype.toString=function(){var t=new O;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()},jn.prototype.computeEdgeEndLabels=function(t){for(var e=this.iterator();e.hasNext();)e.next().computeLabel(t)},jn.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)===C.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 l=C.NONE;if(e[u])l=C.EXTERIOR;else{var c=s.getCoordinate();l=this.getLocation(u,c,t)}a.setAllLocationsIfNull(u,l)}},jn.prototype.getDegree=function(){return this._edgeMap.size()},jn.prototype.insertEdgeEnd=function(t,e){this._edgeMap.put(t,e),this._edgeList=null},jn.prototype.interfaces_=function(){return[]},jn.prototype.getClass=function(){return jn},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 Ce("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 Be.isNorthern(i)&&Be.isNorthern(o)?n:Be.isNorthern(i)||Be.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){V.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 It;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 Ce("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=C.NONE,e=this.iterator();e.hasNext();){var n=e.next(),r=n.getSym();if(!n.isLineEdge()){if(n.isInResult()){t=C.INTERIOR;break}if(r.isInResult()){t=C.EXTERIOR;break}}}if(t===C.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===C.INTERIOR):(s.isInResult()&&(i=C.EXTERIOR),a.isInResult()&&(i=C.INTERIOR))}},e.prototype.computeLabelling=function(e){t.prototype.computeLabelling.call(this,e),this._label=new Re(C.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!==C.INTERIOR&&o!==C.BOUNDARY||this._label.setLocation(i,C.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(jn)),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 Vn)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(je),Yn=function t(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=t.orientation(e)},Hn=(Yn.prototype.compareTo=function(t){var e=t;return Yn.compareOriented(this._pts,this._orientation,e._pts,e._orientation)},Yn.prototype.interfaces_=function(){return[E]},Yn.prototype.getClass=function(){return Yn},Yn.orientation=function(t){return 1===Lt.increasingDirection(t)},Yn.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,l=r?0:n.length-1;;){var c=t[u].compareTo(n[l]);if(0!==c)return c;var h=(u+=i)===s,p=(l+=o)===a;if(h&&!p)return-1;if(!h&&p)return 1;if(h&&p)return 0}},function(){this._edges=new It,this._ocaMap=new h}),Wn=(Hn.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(") ")},Hn.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())},Hn.prototype.findEdgeIndex=function(t){for(var e=0;e<this._edges.size();e++)if(this._edges.get(e).equals(t))return e;return-1},Hn.prototype.iterator=function(){return this._edges.iterator()},Hn.prototype.getEdges=function(){return this._edges},Hn.prototype.get=function(t){return this._edges.get(t)},Hn.prototype.findEqualEdge=function(t){var e=new Yn(t.getCoordinates());return this._ocaMap.get(e)},Hn.prototype.add=function(t){this._edges.add(t);var e=new Yn(t.getCoordinates());this._ocaMap.put(e,t)},Hn.prototype.interfaces_=function(){return[]},Hn.prototype.getClass=function(){return Hn},function(){}),Jn=(Wn.prototype.processIntersections=function(t,e,n,r){},Wn.prototype.isDone=function(){},Wn.prototype.interfaces_=function(){return[]},Wn.prototype.getClass=function(){return Wn},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}),Kn=(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[Wn]},Jn.prototype.getClass=function(){return Jn},Jn.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)},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}),Zn=(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},function(){this._nodeMap=new h,this.edge=null;var t=arguments[0];this.edge=t}),$n=(Zn.prototype.print=function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();)e.next().print(t)},Zn.prototype.iterator=function(){return this._nodeMap.values().iterator()},Zn.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}},Zn.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)},Zn.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 Re(this.edge._label))},Zn.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)},Zn.prototype.isIntersection=function(t){for(var e=this.iterator();e.hasNext();)if(e.next().coord.equals(t))return!0;return!1},Zn.prototype.interfaces_=function(){return[]},Zn.prototype.getClass=function(){return Zn},function(){}),Qn=($n.prototype.getChainStartIndices=function(t){var e=0,n=new It;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=Be.quadrant(t[e],t[e+1]),r=e+1;r<t.length&&Be.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},function(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new Y,this.env2=new Y;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new $n;this.startIndex=e.getChainStartIndices(this.pts)}),tr=(Qn.prototype.getCoordinates=function(){return this.pts},Qn.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},Qn.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},Qn.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],l=arguments[5],c=this.pts[i],h=this.pts[o],p=s.pts[a],f=s.pts[u];if(o-i==1&&u-a==1)return l.addIntersections(this.e,i,s.e,a),null;if(this.env1.init(c,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,l),d<u&&this.computeIntersectsForChain(i,g,s,d,u,l)),g<o&&(a<d&&this.computeIntersectsForChain(g,o,s,a,d,l),d<u&&this.computeIntersectsForChain(g,o,s,d,u,l))}},Qn.prototype.getStartIndexes=function(){return this.startIndex},Qn.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)},Qn.prototype.interfaces_=function(){return[]},Qn.prototype.getClass=function(){return Qn},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}},nr=(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?C.EXTERIOR:C.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!==C.EXTERIOR&&r!==C.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]===C.INTERIOR&&this._depth[i][o]++}},tr.prototype.interfaces_=function(){return[]},tr.prototype.getClass=function(){return tr},tr.depthAtLocation=function(t){return t===C.EXTERIOR?0:t===C.INTERIOR?1:tr.NULL_VALUE},er.NULL_VALUE.get=function(){return-1},Object.defineProperties(tr,er),function(t){function e(){if(t.call(this),this.pts=null,this._env=null,this.eiList=new Zn(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,Re.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 Qn(this)),this._mce},e.prototype.getEnvelope=function(){if(null===this._env){this._env=new Y;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 O;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 Hn,this._bufParams=t||null},ir=(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 Re(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 It,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 It,n=t.getNodes().iterator();n.hasNext();){var r=n.next();if(!r.isVisited()){var i=new Me;i.create(r),e.add(i)}}return Qe.sort(e,Qe.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 bn,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 Bn(t,e,r).getCurves();if(i.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(i,n),this._graph=new Ve(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 Re(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===C.INTERIOR&&n===C.EXTERIOR?1:e===C.EXTERIOR&&n===C.INTERIOR?-1:0},rr.convertSegStrings=function(t){for(var e=new me,n=new It;t.hasNext();){var r=t.next(),i=e.createLineString(r.getCoordinates());n.add(i)}return e.buildGeometry(n)},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()}}),or=(ir.prototype.rescale=function(){if(M(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])&&V.out.println(n)}},ir.prototype.scale=function(){if(M(arguments[0],xt)){for(var t=arguments[0],e=new It,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 Lt.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},function(){this._li=new it,this._segStrings=null;var t=arguments[0];this._segStrings=t}),sr={fact:{configurable:!0}},ar=(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 Q("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 l=0;l<a.length-1;l++)this.checkInteriorIntersections(i,u,o,l);else if(4===arguments.length){var c=arguments[0],h=arguments[1],p=arguments[2],f=arguments[3];if(c===p&&h===f)return null;var g=c.getCoordinates()[h],d=c.getCoordinates()[h+1],y=p.getCoordinates()[f],m=p.getCoordinates()[f+1];if(this._li.computeIntersection(g,d,y,m),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,g,d)||this.hasInteriorIntersection(this._li,y,m)))throw new Q("found non-noded intersection at "+g+"-"+d+" and "+y+"-"+m)}},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 Q("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 me},Object.defineProperties(or,sr),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 _("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}},lr=(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 Y(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),function(){this.tempEnv1=new Y,this.selectedSegment=new dn}),cr=(lr.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)}},lr.prototype.interfaces_=function(){return[]},lr.prototype.getClass=function(){return lr},function(){this._index=null;var t=arguments[0];this._index=t}),hr={HotPixelSnapAction:{configurable:!0}},pr=(cr.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()}},cr.prototype.interfaces_=function(){return[]},cr.prototype.getClass=function(){return cr},hr.HotPixelSnapAction.get=function(){return pr},Object.defineProperties(cr,hr),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}(lr)),fr=function(){this._li=null,this._interiorIntersections=null;var t=arguments[0];this._li=t,this._interiorIntersections=new It},gr=(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[Wn]},fr.prototype.getClass=function(){return fr},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()}),dr=(gr.prototype.checkCorrectness=function(t){var e=gn.getNodedSubstrings(t),n=new or(e);try{n.checkValid()}catch(t){if(!(t instanceof z))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(M(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 bn,this._pointSnapper=new cr(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},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}},mr=(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 Ce))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 Q))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 ct&&"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 ct&&"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=T.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),function(){this._pt=[new w,new w],this._distance=v.NaN,this._isNull=!0}),_r=(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.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},function(){}),vr=(_r.prototype.interfaces_=function(){return[]},_r.prototype.getClass=function(){return _r},_r.computeDistance=function(){if(arguments[2]instanceof mr&&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 mr&&arguments[0]instanceof Qt&&arguments[1]instanceof w){var s=arguments[0],a=arguments[1],u=arguments[2];_r.computeDistance(s.getExteriorRing(),a,u);for(var l=0;l<s.getNumInteriorRing();l++)_r.computeDistance(s.getInteriorRingN(l),a,u)}else if(arguments[2]instanceof mr&&arguments[0]instanceof ct&&arguments[1]instanceof w){var c=arguments[0],h=arguments[1],p=arguments[2];if(c instanceof Jt)_r.computeDistance(c,h,p);else if(c instanceof Qt)_r.computeDistance(c,h,p);else if(c instanceof zt)for(var f=c,g=0;g<f.getNumGeometries();g++){var d=f.getGeometryN(g);_r.computeDistance(d,h,p)}else p.setMinimum(c.getCoordinate(),h)}else if(arguments[2]instanceof mr&&arguments[0]instanceof dn&&arguments[1]instanceof w){var y=arguments[1],m=arguments[2],_=arguments[0].closestPoint(y);m.setMinimum(_,y)}},function(t){this._maxPtDist=new mr,this._inputGeom=t||null}),xr={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}},Er=(vr.prototype.computeMaxMidpointDistance=function(t){var e=new br(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},vr.prototype.computeMaxVertexDistance=function(t){var e=new Er(this._inputGeom);t.apply(e),this._maxPtDist.setMaximum(e.getMaxPointDistance())},vr.prototype.findDistance=function(t){return this.computeMaxVertexDistance(t),this.computeMaxMidpointDistance(t),this._maxPtDist.getDistance()},vr.prototype.getDistancePoints=function(){return this._maxPtDist},vr.prototype.interfaces_=function(){return[]},vr.prototype.getClass=function(){return vr},xr.MaxPointDistanceFilter.get=function(){return Er},xr.MaxMidpointDistanceFilter.get=function(){return br},Object.defineProperties(vr,xr),function(t){this._maxPtDist=new mr,this._minPtDist=new mr,this._geom=t||null}),br=(Er.prototype.filter=function(t){this._minPtDist.initialize(),_r.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},function(t){this._maxPtDist=new mr,this._minPtDist=new mr,this._geom=t||null}),Ir=(br.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(),_r.computeDistance(this._geom,i,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},br.prototype.isDone=function(){return!1},br.prototype.isGeometryChanged=function(){return!1},br.prototype.getMaxPointDistance=function(){return this._maxPtDist},br.prototype.interfaces_=function(){return[qt]},br.prototype.getClass=function(){return br},function(t){this._comps=t||null}),wr=(Ir.prototype.filter=function(t){t instanceof Qt&&this._comps.add(t)},Ir.prototype.interfaces_=function(){return[Ut]},Ir.prototype.getClass=function(){return Ir},Ir.getPolygons=function(){if(1===arguments.length){var t=arguments[0];return Ir.getPolygons(t,new It)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof Qt?n.add(e):e instanceof zt&&e.apply(new Ir(n)),n}},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}}),Nr=(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[lt]},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(M(arguments[0],xt)&&M(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 ct&&"boolean"==typeof arguments[1]){var i=arguments[0],o=arguments[1],s=new It;return i.apply(new wr(s,o)),s}if(arguments[0]instanceof ct&&M(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]&&M(arguments[0],xt)&&M(arguments[1],xt)){for(var l=arguments[1],c=arguments[2],h=arguments[0].iterator();h.hasNext();){var p=h.next();wr.getLines(p,l,c)}return l}if("boolean"==typeof arguments[2]&&arguments[0]instanceof ct&&M(arguments[1],xt)){var f=arguments[1],g=arguments[2];return arguments[0].apply(new wr(f,g)),f}}},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 _("Rule must be non-null");this._boundaryRule=t}}),Lr=(Nr.prototype.locateInternal=function(){if(arguments[0]instanceof w&&arguments[1]instanceof Qt){var t=arguments[0],e=arguments[1];if(e.isEmpty())return C.EXTERIOR;var n=e.getExteriorRing(),r=this.locateInPolygonRing(t,n);if(r===C.EXTERIOR)return C.EXTERIOR;if(r===C.BOUNDARY)return C.BOUNDARY;for(var i=0;i<e.getNumInteriorRing();i++){var o=e.getInteriorRingN(i),s=this.locateInPolygonRing(t,o);if(s===C.INTERIOR)return C.EXTERIOR;if(s===C.BOUNDARY)return C.BOUNDARY}return C.INTERIOR}if(arguments[0]instanceof w&&arguments[1]instanceof Jt){var a=arguments[0],u=arguments[1];if(!u.getEnvelopeInternal().intersects(a))return C.EXTERIOR;var l=u.getCoordinates();return u.isClosed()||!a.equals(l[0])&&!a.equals(l[l.length-1])?at.isOnLine(a,l)?C.INTERIOR:C.EXTERIOR:C.BOUNDARY}if(arguments[0]instanceof w&&arguments[1]instanceof Zt){var c=arguments[0];return arguments[1].getCoordinate().equals2D(c)?C.INTERIOR:C.EXTERIOR}},Nr.prototype.locateInPolygonRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?at.locatePointInRing(t,e.getCoordinates()):C.EXTERIOR},Nr.prototype.intersects=function(t,e){return this.locate(t,e)!==C.EXTERIOR},Nr.prototype.updateLocationInfo=function(t){t===C.INTERIOR&&(this._isIn=!0),t===C.BOUNDARY&&this._numBoundaries++},Nr.prototype.computeLocation=function(t,e){if(e instanceof Zt&&this.updateLocationInfo(this.locateInternal(t,e)),e instanceof Jt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof Qt)this.updateLocationInfo(this.locateInternal(t,e));else if(e instanceof jt)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 zt)for(var u=new qn(e);u.hasNext();){var l=u.next();l!==e&&this.computeLocation(t,l)}},Nr.prototype.locate=function(t,e){return e.isEmpty()?C.EXTERIOR:e instanceof Jt||e instanceof Qt?this.locateInternal(t,e):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(t,e),this._boundaryRule.isInBoundary(this._numBoundaries)?C.BOUNDARY:this._numBoundaries>0||this._isIn?C.INTERIOR:C.EXTERIOR)},Nr.prototype.interfaces_=function(){return[]},Nr.prototype.getClass=function(){return Nr},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}}),Sr={INSIDE_AREA:{configurable:!0}},Cr=(Lr.prototype.isInsideArea=function(){return this._segIndex===Lr.INSIDE_AREA},Lr.prototype.getCoordinate=function(){return this._pt},Lr.prototype.getGeometryComponent=function(){return this._component},Lr.prototype.getSegmentIndex=function(){return this._segIndex},Lr.prototype.interfaces_=function(){return[]},Lr.prototype.getClass=function(){return Lr},Sr.INSIDE_AREA.get=function(){return-1},Object.defineProperties(Lr,Sr),function(t){this._pts=t||null}),Pr=(Cr.prototype.filter=function(t){t instanceof Zt&&this._pts.add(t)},Cr.prototype.interfaces_=function(){return[Ut]},Cr.prototype.getClass=function(){return Cr},Cr.getPoints=function(){if(1===arguments.length){var t=arguments[0];return t instanceof Zt?Qe.singletonList(t):Cr.getPoints(t,new It)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof Zt?n.add(e):e instanceof zt&&e.apply(new Cr(n)),n}},function(){this._locations=null;var t=arguments[0];this._locations=t}),Mr=(Pr.prototype.filter=function(t){(t instanceof Zt||t instanceof Jt||t instanceof Qt)&&this._locations.add(new Lr(t,0,t.getCoordinate()))},Pr.prototype.interfaces_=function(){return[Ut]},Pr.prototype.getClass=function(){return Pr},Pr.getLocations=function(t){var e=new It;return t.apply(new Pr(e)),e},function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new Nr,this._minDistanceLocation=null,this._minDistance=v.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=(Mr.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=Ir.getPolygons(this._geom[e]);if(i.size()>0){var o=Pr.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&&M(arguments[0],bt)&&M(arguments[1],bt)){for(var s=arguments[0],a=arguments[1],u=arguments[2],l=0;l<s.size();l++)for(var c=s.get(l),h=0;h<a.size();h++)if(this.computeContainmentDistance(c,a.get(h),u),this._minDistance<=this._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof Lr&&arguments[1]instanceof Qt){var p=arguments[0],f=arguments[1],g=arguments[2],d=p.getCoordinate();if(C.EXTERIOR!==this._ptLocator.locate(d,f))return this._minDistance=0,g[0]=p,g[1]=new Lr(f,d),null}},Mr.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}},Mr.prototype.computeFacetDistance=function(){var t=new Array(2).fill(null),e=wr.getLines(this._geom[0]),n=wr.getLines(this._geom[1]),r=Cr.getPoints(this._geom[0]),i=Cr.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))))},Mr.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation},Mr.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])},Mr.prototype.nearestPoints=function(){return this.computeMinDistance(),[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()]},Mr.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 Zt){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 Lr(t,o,a),n[1]=new Lr(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],l=arguments[1],c=arguments[2];if(u.getEnvelopeInternal().distance(l.getEnvelopeInternal())>this._minDistance)return null;for(var h=u.getCoordinates(),p=l.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]),m=new dn(p[g],p[g+1]),_=y.closestPoints(m);c[0]=new Lr(u,f,_[0]),c[1]=new Lr(l,g,_[1])}if(this._minDistance<=this._terminateDistance)return null}}},Mr.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 Lr(i,0,i.getCoordinate()),n[1]=new Lr(s,0,s.getCoordinate())),this._minDistance<=this._terminateDistance)return null}},Mr.prototype.distance=function(){if(null===this._geom[0]||null===this._geom[1])throw new _("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)},Mr.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}},Mr.prototype.interfaces_=function(){return[]},Mr.prototype.getClass=function(){return Mr},Mr.distance=function(t,e){return new Mr(t,e).distance()},Mr.isWithinDistance=function(t,e,n){return new Mr(t,e,n).distance()<=n},Mr.nearestPoints=function(t,e){return new Mr(t,e).nearestPoints()},function(){this._pt=[new w,new w],this._distance=v.NaN,this._isNull=!0}),Rr=(Tr.prototype.getCoordinates=function(){return this._pt},Tr.prototype.getCoordinate=function(t){return this._pt[t]},Tr.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)}},Tr.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}},Tr.prototype.toString=function(){return $.toLineString(this._pt[0],this._pt[1])},Tr.prototype.getDistance=function(){return this._distance},Tr.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)}},Tr.prototype.interfaces_=function(){return[]},Tr.prototype.getClass=function(){return Tr},function(){}),Or=(Rr.prototype.interfaces_=function(){return[]},Rr.prototype.getClass=function(){return Rr},Rr.computeDistance=function(){if(arguments[2]instanceof Tr&&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 Tr&&arguments[0]instanceof Qt&&arguments[1]instanceof w){var a=arguments[0],u=arguments[1],l=arguments[2];Rr.computeDistance(a.getExteriorRing(),u,l);for(var c=0;c<a.getNumInteriorRing();c++)Rr.computeDistance(a.getInteriorRingN(c),u,l)}else if(arguments[2]instanceof Tr&&arguments[0]instanceof ct&&arguments[1]instanceof w){var h=arguments[0],p=arguments[1],f=arguments[2];if(h instanceof Jt)Rr.computeDistance(h,p,f);else if(h instanceof Qt)Rr.computeDistance(h,p,f);else if(h instanceof zt)for(var g=h,d=0;d<g.getNumGeometries();d++){var y=g.getGeometryN(d);Rr.computeDistance(y,p,f)}else f.setMinimum(h.getCoordinate(),p)}else if(arguments[2]instanceof Tr&&arguments[0]instanceof dn&&arguments[1]instanceof w){var m=arguments[1],_=arguments[2],v=arguments[0].closestPoint(m);_.setMinimum(v,m)}},function(){this._g0=null,this._g1=null,this._ptDist=new Tr,this._densifyFrac=0;var t=arguments[0],e=arguments[1];this._g0=t,this._g1=e}),Ar={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}},Dr=(Or.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()},Or.prototype.setDensifyFraction=function(t){if(t>1||t<=0)throw new _("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=t},Or.prototype.compute=function(t,e){this.computeOrientedDistance(t,e,this._ptDist),this.computeOrientedDistance(e,t,this._ptDist)},Or.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Or.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())}},Or.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Or.prototype.interfaces_=function(){return[]},Or.prototype.getClass=function(){return Or},Or.distance=function(){if(2===arguments.length)return new Or(arguments[0],arguments[1]).distance();if(3===arguments.length){var t=arguments[2],e=new Or(arguments[0],arguments[1]);return e.setDensifyFraction(t),e.distance()}},Ar.MaxPointDistanceFilter.get=function(){return Dr},Ar.MaxDensifiedByFractionDistanceFilter.get=function(){return Fr},Object.defineProperties(Or,Ar),function(){this._maxPtDist=new Tr,this._minPtDist=new Tr,this._euclideanDist=new Rr,this._geom=null;var t=arguments[0];this._geom=t}),Fr=(Dr.prototype.filter=function(t){this._minPtDist.initialize(),Rr.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},function(){this._maxPtDist=new Tr,this._minPtDist=new Tr,this._geom=null,this._numSubSegs=0;var t=arguments[0],e=arguments[1];this._geom=t,this._numSubSegs=Math.trunc(Math.round(1/e))}),kr=(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,l=new w(a,u);this._minPtDist.initialize(),Rr.computeDistance(this._geom,l,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},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}),Gr={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}},Br=(kr.prototype.checkMaximumDistance=function(t,e,n){var r=new Or(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&&V.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 Qt||this._input instanceof ne||this._input instanceof zt))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 Mr(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 It,n=new wr(e),r=Ir.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},Gr.VERBOSE.get=function(){return!1},Gr.MAX_DISTANCE_DIFF_FRAC.get=function(){return.012},Object.defineProperties(kr,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}},qr=(Br.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},Br.prototype.checkEnvelope=function(){if(this._distance<0)return null;var t=this._distance*Br.MAX_ENV_DIFF_FRAC;0===t&&(t=.001);var e=new Y(this._input.getEnvelopeInternal());e.expandBy(this._distance);var n=new Y(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")},Br.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")},Br.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")},Br.prototype.checkPolygonal=function(){this._result instanceof Qt||this._result instanceof ne||(this._isValid=!1),this._errorMsg="Result is not polygonal",this._errorIndicator=this._result,this.report("Polygonal")},Br.prototype.getErrorIndicator=function(){return this._errorIndicator},Br.prototype.getErrorLocation=function(){return this._errorLocation},Br.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"))},Br.prototype.report=function(t){if(!Br.VERBOSE)return null;V.out.println("Check "+t+": "+(this._isValid?"passed":"FAILED"))},Br.prototype.getErrorMessage=function(){return this._errorMsg},Br.prototype.interfaces_=function(){return[]},Br.prototype.getClass=function(){return Br},Br.isValidMsg=function(t,e,n){var r=new Br(t,e,n);return r.isValid()?null:r.getErrorMessage()},Br.isValid=function(t,e,n){return!!new Br(t,e,n).isValid()},Ur.VERBOSE.get=function(){return!1},Ur.MAX_ENV_DIFF_FRAC.get=function(){return.012},Object.defineProperties(Br,Ur),function(){this._pts=null,this._data=null;var t=arguments[0],e=arguments[1];this._pts=t,this._data=e}),zr=(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},function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new It,this._intersectionCount=0,this._keepIntersections=!0;var t=arguments[0];this._li=t,this._interiorIntersection=null}),jr=(zr.prototype.getInteriorIntersection=function(){return this._interiorIntersection},zr.prototype.setCheckEndSegmentsOnly=function(t){this._isCheckEndSegmentsOnly=t},zr.prototype.getIntersectionSegments=function(){return this._intSegments},zr.prototype.count=function(){return this._intersectionCount},zr.prototype.getIntersections=function(){return this._intersections},zr.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},zr.prototype.setKeepIntersections=function(t){this._keepIntersections=t},zr.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++)},zr.prototype.isEndSegment=function(t,e){return 0===e||e>=t.size()-2},zr.prototype.hasIntersection=function(){return null!==this._interiorIntersection},zr.prototype.isDone=function(){return!this._findAllIntersections&&null!==this._interiorIntersection},zr.prototype.interfaces_=function(){return[Wn]},zr.prototype.getClass=function(){return zr},zr.createAllIntersectionsFinder=function(t){var e=new zr(t);return e.setFindAllIntersections(!0),e},zr.createAnyIntersectionFinder=function(t){return new zr(t)},zr.createIntersectionCounter=function(t){var e=new zr(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e},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=(jr.prototype.execute=function(){if(null!==this._segInt)return null;this.checkInteriorIntersections()},jr.prototype.getIntersections=function(){return this._segInt.getIntersections()},jr.prototype.isValid=function(){return this.execute(),this._isValid},jr.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},jr.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new zr(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new bn;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},jr.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Ce(this.getErrorMessage(),this._segInt.getInteriorIntersection())},jr.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])},jr.prototype.interfaces_=function(){return[]},jr.prototype.getClass=function(){return jr},jr.computeIntersections=function(t){var e=new jr(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()},function t(){this._nv=null;var e=arguments[0];this._nv=new jr(t.toSegmentStrings(e))}),Xr=(Vr.prototype.checkValid=function(){this._nv.checkValid()},Vr.prototype.interfaces_=function(){return[]},Vr.prototype.getClass=function(){return Vr},Vr.toSegmentStrings=function(t){for(var e=new It,n=t.iterator();n.hasNext();){var r=n.next();e.add(new qr(r.getCoordinates(),r))}return e},Vr.checkValid=function(t){new Vr(t).checkValid()},function(t){this._mapOp=t}),Yr=(Xr.prototype.map=function(t){for(var e=new It,n=0;n<t.getNumGeometries();n++){var r=this._mapOp.map(t.getGeometryN(n));r.isEmpty()||e.add(r)}return t.getFactory().createGeometryCollection(me.toGeometryArray(e))},Xr.prototype.interfaces_=function(){return[]},Xr.prototype.getClass=function(){return Xr},Xr.map=function(t,e){return new Xr(e).map(t)},function(){this._op=null,this._geometryFactory=null,this._ptLocator=null,this._lineEdgesList=new It,this._resultLineList=new It;var t=arguments[0],e=arguments[1],n=arguments[2];this._op=t,this._geometryFactory=e,this._ptLocator=n}),Hr=(Yr.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)}},Yr.prototype.labelIsolatedLine=function(t,e){var n=this._ptLocator.locate(t.getCoordinate(),this._op.getArgGeometry(e));t.getLabel().setLocation(e,n)},Yr.prototype.build=function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this._resultLineList},Yr.prototype.collectLineEdge=function(t,e,n){var r=t.getLabel(),i=t.getEdge();t.isLineEdge()&&(t.isVisited()||!Li.isResultOfOp(r,e)||i.isCovered()||(n.add(i),t.setVisitedEdge(!0)))},Yr.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)}}},Yr.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))}},Yr.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)}},Yr.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(Li.isResultOfOp(r,e)&&e===Li.INTERSECTION&&(n.add(t.getEdge()),t.setVisitedEdge(!0))))},Yr.prototype.interfaces_=function(){return[]},Yr.prototype.getClass=function(){return Yr},function(){this._op=null,this._geometryFactory=null,this._resultPointList=new It;var t=arguments[0],e=arguments[1];this._op=t,this._geometryFactory=e}),Wr=(Hr.prototype.filterCoveredNodeToPoint=function(t){var e=t.getCoordinate();if(!this._op.isCoveredByLA(e)){var n=this._geometryFactory.createPoint(e);this._resultPointList.add(n)}},Hr.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!==Li.INTERSECTION)){var r=n.getLabel();Li.isResultOfOp(r,t)&&this.filterCoveredNodeToPoint(n)}}},Hr.prototype.build=function(t){return this.extractNonCoveredResultNodes(t),this._resultPointList},Hr.prototype.interfaces_=function(){return[]},Hr.prototype.getClass=function(){return Hr},function(){this._inputGeom=null,this._factory=null,this._pruneEmptyGeometry=!0,this._preserveGeometryCollectionType=!0,this._preserveCollections=!1,this._preserveType=!1}),Jr=(Wr.prototype.transformPoint=function(t,e){return this._factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},Wr.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 It,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 It;return null!==r&&a.add(r),a.addAll(i),this._factory.buildGeometry(a)},Wr.prototype.createCoordinateSequence=function(t){return this._factory.getCoordinateSequenceFactory().create(t)},Wr.prototype.getInputGeometry=function(){return this._inputGeom},Wr.prototype.transformMultiLineString=function(t,e){for(var n=new It,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)},Wr.prototype.transformCoordinates=function(t,e){return this.copy(t)},Wr.prototype.transformLineString=function(t,e){return this._factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))},Wr.prototype.transformMultiPoint=function(t,e){for(var n=new It,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)},Wr.prototype.transformMultiPolygon=function(t,e){for(var n=new It,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)},Wr.prototype.copy=function(t){return t.copy()},Wr.prototype.transformGeometryCollection=function(t,e){for(var n=new It,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(me.toGeometryArray(n)):this._factory.buildGeometry(n)},Wr.prototype.transform=function(t){if(this._inputGeom=t,this._factory=t.getFactory(),t instanceof Zt)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 jt)return this.transformMultiLineString(t,null);if(t instanceof Qt)return this.transformPolygon(t,null);if(t instanceof ne)return this.transformMultiPolygon(t,null);if(t instanceof zt)return this.transformGeometryCollection(t,null);throw new _("Unknown Geometry subtype: "+t.getClass().getName())},Wr.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)},Wr.prototype.interfaces_=function(){return[]},Wr.prototype.getClass=function(){return Wr},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}}),Kr=(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=v.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])},function(t){this._srcGeom=t||null}),Zr={SNAP_PRECISION_FACTOR:{configurable:!0}},$r=(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&&M(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=v.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)},Zr.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(Kr,Zr),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}(Wr)),Qr=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null},ti=(Qr.prototype.getCommon=function(){return v.longBitsToDouble(this._commonBits)},Qr.prototype.add=function(t){var e=v.doubleToLongBits(t);return this._isFirst?(this._commonBits=e,this._commonSignExp=Qr.signExpBits(this._commonBits),this._isFirst=!1,null):Qr.signExpBits(e)!==this._commonSignExp?(this._commonBits=0,null):(this._commonMantissaBitsCount=Qr.numCommonMostSigMantissaBits(this._commonBits,e),void(this._commonBits=Qr.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))))},Qr.prototype.toString=function(){if(1===arguments.length){var t=arguments[0],e=v.longBitsToDouble(t),n="0000000000000000000000000000000000000000000000000000000000000000"+v.toBinaryString(t),r=n.substring(n.length-64);return r.substring(0,1)+" "+r.substring(1,12)+"(exp) "+r.substring(12)+" [ "+e+" ]"}},Qr.prototype.interfaces_=function(){return[]},Qr.prototype.getClass=function(){return Qr},Qr.getBit=function(t,e){return 0!=(t&1<<e)?1:0},Qr.signExpBits=function(t){return t>>52},Qr.zeroLowerBits=function(t,e){return t&~((1<<e)-1)},Qr.numCommonMostSigMantissaBits=function(t,e){for(var n=0,r=52;r>=0;r--){if(Qr.getBit(t,r)!==Qr.getBit(e,r))return n;n++}return 52},function(){this._commonCoord=null,this._ccFilter=new ni}),ei={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}},ni=(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),function(){this._commonBitsX=new Qr,this._commonBitsY=new Qr}),ri=(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},function(){this.trans=null;var t=arguments[0];this.trans=t}),ii=(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},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()}),oi=(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=Li.overlayOp(e[0],e[1],t);return this.prepareResult(n)},ii.prototype.checkValid=function(t){t.isValid()||V.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,Li.UNION)},ii.intersection=function(t,e){return ii.overlayOp(t,e,Li.INTERSECTION)},ii.symDifference=function(t,e){return ii.overlayOp(t,e,Li.SYMDIFFERENCE)},ii.difference=function(t,e){return ii.overlayOp(t,e,Li.DIFFERENCE)},function(t,e){this._geom=new Array(2).fill(null),this._geom[0]=t,this._geom[1]=e}),si=(oi.prototype.getResultGeometry=function(t){var e=null,n=!1,r=null;try{e=Li.overlayOp(this._geom[0],this._geom[1],t),n=!0}catch(t){if(!(t instanceof Q))throw t;r=t}if(!n)try{e=ii.overlayOp(this._geom[0],this._geom[1],t)}catch(t){throw t instanceof Q?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,Li.UNION)},oi.intersection=function(t,e){return oi.overlayOp(t,e,Li.INTERSECTION)},oi.symDifference=function(t,e){return oi.overlayOp(t,e,Li.SYMDIFFERENCE)},oi.difference=function(t,e){return oi.overlayOp(t,e,Li.DIFFERENCE)},function(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e}),ai=(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},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}},li=(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),function(){}),ci=(li.prototype.interfaces_=function(){return[]},li.prototype.getClass=function(){return 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}),hi=(ci.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&1===this._li.getIntersectionNum()){if(ci.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},ci.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},ci.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},ci.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},ci.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},ci.prototype.hasProperIntersection=function(){return this._hasProper},ci.prototype.hasIntersection=function(){return this._hasIntersection},ci.prototype.isDone=function(){return this._isDone},ci.prototype.isBoundaryPoint=function(t,e){return!(null===e||!this.isBoundaryPointInternal(t,e[0])&&!this.isBoundaryPointInternal(t,e[1]))},ci.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},ci.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))))},ci.prototype.interfaces_=function(){return[]},ci.prototype.getClass=function(){return ci},ci.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)},function(t){function e(){t.call(this),this.events=new It,this.nOverlaps=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.prepareEvents=function(){Qe.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 ci&&M(arguments[0],bt)&&M(arguments[1],bt)){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]&&M(arguments[0],bt)&&arguments[1]instanceof ci){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}(li)),pi=function(){this._min=v.POSITIVE_INFINITY,this._max=v.NEGATIVE_INFINITY},fi={NodeComparator:{configurable:!0}},gi=(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),function(){}),di=(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[I]},gi.prototype.getClass=function(){return gi},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),mi=function(){this._leaves=new It,this._root=null,this._level=0},_i=(mi.prototype.buildTree=function(){Qe.sort(this._leaves,new pi.NodeComparator);for(var t=this._leaves,e=null,n=new It;;){if(this.buildLevel(t,n),1===n.size())return n.get(0);e=t,t=n,n=e}},mi.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))},mi.prototype.query=function(t,e,n){this.init(),this._root.query(t,e,n)},mi.prototype.buildRoot=function(){if(null!==this._root)return null;this._root=this.buildTree()},mi.prototype.printNode=function(t){V.out.println($.toLineString(new w(t._min,this._level),new w(t._max,this._level)))},mi.prototype.init=function(){if(null!==this._root)return null;this.buildRoot()},mi.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)}}},mi.prototype.interfaces_=function(){return[]},mi.prototype.getClass=function(){return mi},function(){this._items=new It}),vi=(_i.prototype.visitItem=function(t){this._items.add(t)},_i.prototype.getItems=function(){return this._items},_i.prototype.interfaces_=function(){return[Je]},_i.prototype.getClass=function(){return _i},function(){this._index=null;var t=arguments[0];if(!M(t,$t))throw new _("Argument must be Polygonal");this._index=new bi(t)}),xi={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}},Ei=(vi.prototype.locate=function(t){var e=new st(t),n=new Ei(e);return this._index.query(t.y,t.y,n),e.getLocation()},vi.prototype.interfaces_=function(){return[Un]},vi.prototype.getClass=function(){return vi},xi.SegmentVisitor.get=function(){return Ei},xi.IntervalIndexedGeometry.get=function(){return bi},Object.defineProperties(vi,xi),function(){this._counter=null;var t=arguments[0];this._counter=t}),bi=(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},function(){this._index=new mi;var t=arguments[0];this.init(t)}),Ii=(bi.prototype.init=function(t){for(var e=wr.getLines(t).iterator();e.hasNext();){var n=e.next().getCoordinates();this.addLine(n)}},bi.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)}},bi.prototype.query=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new _i;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)}},bi.prototype.interfaces_=function(){return[]},bi.prototype.getClass=function(){return 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;C.NONE,r.getLocation(t,Ne.ON)===C.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 ci(arguments[0],!0,!1);i.setIsDoneIfProperInt(r);var o=this.createEdgeSetIntersector(),s=this._parentGeom instanceof ee||this._parentGeom instanceof Qt||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 ci(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 Zt){var t=arguments[0].getCoordinate();this.insertPoint(this._argIndex,t,C.INTERIOR)}else if(arguments[0]instanceof w){var e=arguments[0];this.insertPoint(this._argIndex,e,C.INTERIOR)}},e.prototype.addPolygon=function(t){this.addPolygonRing(t.getExteriorRing(),C.EXTERIOR,C.INTERIOR);for(var e=0;e<t.getNumInteriorRing();e++){var n=t.getInteriorRingN(e);this.addPolygonRing(n,C.INTERIOR,C.EXTERIOR)}},e.prototype.addEdge=function(t){this.insertEdge(t);var e=t.getCoordinates();this.insertPoint(this._argIndex,e[0],C.BOUNDARY),this.insertPoint(this._argIndex,e[e.length-1],C.BOUNDARY)},e.prototype.addLineString=function(t){var e=Lt.removeRepeatedPoints(t.getCoordinates());if(e.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=e[0],null;var n=new nr(e,new Re(this._argIndex,C.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===C.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=Lt.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 Re(this._argIndex,C.BOUNDARY,i,o));this._lineEdgeMap.put(t,s),this.insertEdge(s),this.insertPoint(this._argIndex,r[0],C.BOUNDARY)},e.prototype.insertPoint=function(t,e,n){var r=this._nodes.addNode(e),i=r.getLabel();null===i?r._label=new Re(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 Qt)this.addPolygon(e);else if(e instanceof Jt)this.addLineString(e);else if(e instanceof Zt)this.addPoint(e);else if(e instanceof te)this.addCollection(e);else if(e instanceof jt)this.addCollection(e);else if(e instanceof ne)this.addCollection(e);else{if(!(e instanceof zt))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 M(this._parentGeom,$t)&&this._parentGeom.getNumGeometries()>50?(null===this._areaPtLocator&&(this._areaPtLocator=new vi(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)?C.BOUNDARY:C.INTERIOR},e}(Ve)),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 Ii(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 Ii(0,e,r),this._arg[1]=new Ii(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 Ii(0,i,s),this._arg[1]=new Ii(1,o,s)}},Ni=(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},function(){}),Li=(Ni.prototype.interfaces_=function(){return[]},Ni.prototype.getClass=function(){return Ni},Ni.map=function(){if(arguments[0]instanceof ct&&M(arguments[1],Ni.MapOp)){for(var t=arguments[0],e=arguments[1],n=new It,r=0;r<t.getNumGeometries();r++){var i=e.map(t.getGeometryN(r));null!==i&&n.add(i)}return t.getFactory().buildGeometry(n)}if(M(arguments[0],xt)&&M(arguments[1],Ni.MapOp)){for(var o=arguments[0],s=arguments[1],a=new It,u=o.iterator();u.hasNext();){var l=u.next(),c=s.map(l);null!==c&&a.add(c)}return a}},Ni.MapOp=function(){},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 Hn,this._resultPolyList=new It,this._resultLineList=new It,this._resultPointList=new It,this._graph=new Ve(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 Re(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 It;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)!==C.EXTERIOR)return!0}return!1},e.prototype.replaceCollapsedEdges=function(){for(var t=new It,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 It;this._arg[0].computeSplitEdges(e),this._arg[1].computeSplitEdges(e),this.insertUniqueEdges(e),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),Vr.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 Yr(this,this._geomFact,this._ptLocator);this._resultLineList=r.build(t);var i=new Hr(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=(Li.overlayOp=function(t,e,n){return new Li(t,e).getResultGeometry(n)},Li.intersection=function(t,e){if(t.isEmpty()||e.isEmpty())return Li.createEmptyResult(Li.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,Li.INTERSECTION)},Li.symDifference=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return Li.createEmptyResult(Li.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,Li.SYMDIFFERENCE)},Li.resultDimension=function(t,e,n){var r=e.getDimension(),i=n.getDimension(),o=-1;switch(t){case Li.INTERSECTION:o=Math.min(r,i);break;case Li.UNION:o=Math.max(r,i);break;case Li.DIFFERENCE:o=r;break;case Li.SYMDIFFERENCE:o=Math.max(r,i)}return o},Li.createEmptyResult=function(t,e,n,r){var i=null;switch(Li.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},Li.difference=function(t,e){return t.isEmpty()?Li.createEmptyResult(Li.DIFFERENCE,t,e,t.getFactory()):e.isEmpty()?t.copy():(t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),oi.overlayOp(t,e,Li.DIFFERENCE))},Li.isResultOfOp=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=t.getLocation(0),r=t.getLocation(1);return Li.isResultOfOp(n,r,e)}if(3===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2];switch(i===C.BOUNDARY&&(i=C.INTERIOR),o===C.BOUNDARY&&(o=C.INTERIOR),s){case Li.INTERSECTION:return i===C.INTERIOR&&o===C.INTERIOR;case Li.UNION:return i===C.INTERIOR||o===C.INTERIOR;case Li.DIFFERENCE:return i===C.INTERIOR&&o!==C.INTERIOR;case Li.SYMDIFFERENCE:return i===C.INTERIOR&&o!==C.INTERIOR||i!==C.INTERIOR&&o===C.INTERIOR}return!1}},Li.INTERSECTION=1,Li.UNION=2,Li.DIFFERENCE=3,Li.SYMDIFFERENCE=4,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=(Si.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},Si.prototype.getLocation=function(t){return this.isWithinToleranceOfBoundary(t)?C.BOUNDARY:this._ptLocator.locate(t,this._g)},Si.prototype.extractLinework=function(t){var e=new Ci;t.apply(e);var n=e.getLinework(),r=me.toLineStringArray(n);return t.getFactory().createMultiLineString(r)},Si.prototype.interfaces_=function(){return[]},Si.prototype.getClass=function(){return Si},function(){this._linework=null,this._linework=new It}),Pi=(Ci.prototype.getLinework=function(){return this._linework},Ci.prototype.filter=function(t){if(t instanceof Qt){var e=t;this._linework.add(e.getExteriorRing());for(var n=0;n<e.getNumInteriorRing();n++)this._linework.add(e.getInteriorRingN(n))}},Ci.prototype.interfaces_=function(){return[Ut]},Ci.prototype.getClass=function(){return Ci},function(){this._g=null,this._doLeft=!0,this._doRight=!0;var t=arguments[0];this._g=t}),Mi=(Pi.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)},Pi.prototype.setSidesToGenerate=function(t,e){this._doLeft=t,this._doRight=e},Pi.prototype.getPoints=function(t){for(var e=new It,n=wr.getLines(this._g).iterator();n.hasNext();){var r=n.next();this.extractPoints(r,t,e)}return e},Pi.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,l=(e.x+t.x)/2,c=(e.y+t.y)/2;if(this._doLeft){var h=new w(l-u,c+a);r.add(h)}if(this._doRight){var p=new w(l+u,c-a);r.add(p)}},Pi.prototype.interfaces_=function(){return[]},Pi.prototype.getClass=function(){return Pi},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 It;var e=arguments[0],n=arguments[1],r=arguments[2];this._boundaryDistanceTolerance=t.computeBoundaryDistanceTolerance(e,n),this._geom=[e,n,r],this._locFinder=[new Si(this._geom[0],this._boundaryDistanceTolerance),new Si(this._geom[1],this._boundaryDistanceTolerance),new Si(this._geom[2],this._boundaryDistanceTolerance)]}),Ti={TOLERANCE:{configurable:!0}},Ri=(Mi.prototype.reportResult=function(t,e,n){V.out.println("Overlay result invalid - A:"+C.toLocationSymbol(e[0])+" B:"+C.toLocationSymbol(e[1])+" expected:"+(n?"i":"e")+" actual:"+C.toLocationSymbol(e[2]))},Mi.prototype.isValid=function(t){return this.addTestPts(this._geom[0]),this.addTestPts(this._geom[1]),this.checkValid(t)},Mi.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),!!Mi.hasLocation(this._location,C.BOUNDARY)||this.isValidResult(r,this._location)}},Mi.prototype.addTestPts=function(t){var e=new Pi(t);this._testCoords.addAll(e.getPoints(5*this._boundaryDistanceTolerance))},Mi.prototype.isValidResult=function(t,e){var n=Li.isResultOfOp(e[0],e[1],t),r=!(n^e[2]===C.INTERIOR);return r||this.reportResult(t,e,n),r},Mi.prototype.getInvalidLocation=function(){return this._invalidLocation},Mi.prototype.interfaces_=function(){return[]},Mi.prototype.getClass=function(){return Mi},Mi.hasLocation=function(t,e){for(var n=0;n<3;n++)if(t[n]===e)return!0;return!1},Mi.computeBoundaryDistanceTolerance=function(t,e){return Math.min(Kr.computeSizeBasedSnapTolerance(t),Kr.computeSizeBasedSnapTolerance(e))},Mi.isValid=function(t,e,n,r){return new Mi(t,e,r).isValid(n)},Ti.TOLERANCE.get=function(){return 1e-6},Object.defineProperties(Mi,Ti),function t(e){this._geomFactory=null,this._skipEmpty=!1,this._inputGeoms=null,this._geomFactory=t.extractFactory(e),this._inputGeoms=e}),Oi=(Ri.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)}},Ri.prototype.combine=function(){for(var t=new It,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)},Ri.prototype.interfaces_=function(){return[]},Ri.prototype.getClass=function(){return Ri},Ri.combine=function(){if(1===arguments.length)return new Ri(arguments[0]).combine();if(2===arguments.length){var t=arguments[0],e=arguments[1];return new Ri(Ri.createList(t,e)).combine()}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];return new Ri(Ri.createList(n,r,i)).combine()}},Ri.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},Ri.createList=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new It;return n.add(t),n.add(e),n}if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2],s=new It;return s.add(r),s.add(i),s.add(o),s}},function(){this._inputPolys=null,this._geomFactory=null;var t=arguments[0];this._inputPolys=t,null===this._inputPolys&&(this._inputPolys=new It)}),Ai={STRTREE_NODE_CAPACITY:{configurable:!0}},Di=(Oi.prototype.reduceToGeometries=function(t){for(var e=new It,n=t.iterator();n.hasNext();){var r=n.next(),i=null;M(r,bt)?i=this.unionTree(r):r instanceof ct&&(i=r),e.add(i)}return e},Oi.prototype.extractByEnvelope=function(t,e,n){for(var r=new It,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)},Oi.prototype.unionOptimized=function(t,e){var n=t.getEnvelopeInternal(),r=e.getEnvelopeInternal();if(!n.intersects(r))return Ri.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)},Oi.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(Oi.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)},Oi.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=Oi.getGeometry(e,n);return this.unionSafe(i,null)}if(r-n==2)return this.unionSafe(Oi.getGeometry(e,n),Oi.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)}},Oi.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},Oi.prototype.unionSafe=function(t,e){return null===t&&null===e?null:null===t?e.copy():null===e?t.copy():this.unionOptimized(t,e)},Oi.prototype.unionActual=function(t,e){return Oi.restrictToPolygons(t.union(e))},Oi.prototype.unionTree=function(t){var e=this.reduceToGeometries(t);return this.binaryUnion(e)},Oi.prototype.unionUsingEnvelopeIntersection=function(t,e,n){var r=new It,i=this.extractByEnvelope(n,t,r),o=this.extractByEnvelope(n,e,r),s=this.unionActual(i,o);return r.add(s),Ri.combine(r)},Oi.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)}},Oi.prototype.interfaces_=function(){return[]},Oi.prototype.getClass=function(){return Oi},Oi.restrictToPolygons=function(t){if(M(t,$t))return t;var e=Ir.getPolygons(t);return 1===e.size()?e.get(0):t.getFactory().createMultiPolygon(me.toPolygonArray(e))},Oi.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)},Oi.union=function(t){return new Oi(t).union()},Ai.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(Oi,Ai),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 Li.createEmptyResult(Li.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,Li.UNION)},t.GeoJSONReader=Ie,t.GeoJSONWriter=we,t.OverlayOp=Li,t.UnionOp=Di,t.BufferOp=dr,Object.defineProperty(t,"__esModule",{value:!0})}(e)},61:(t,e,n)=>{var r=n(698).default;t.exports=function(){"use strict";t.exports=function(){return n},t.exports.__esModule=!0,t.exports.default=t.exports;var e,n={},i=Object.prototype,o=i.hasOwnProperty,s=Object.defineProperty||function(t,e,n){t[e]=n.value},a=(E="function"==typeof Symbol?Symbol:{}).iterator||"@@iterator",u=E.asyncIterator||"@@asyncIterator",l=E.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(e){c=function(t,e,n){return t[e]=n}}function h(t,n,r,i){var o,a,u,l;return n=n&&n.prototype instanceof _?n:_,n=Object.create(n.prototype),i=new C(i||[]),s(n,"_invoke",{value:(o=t,a=r,u=i,l=f,function(t,n){if(l===d)throw new Error("Generator is already running");if(l===y){if("throw"===t)throw n;return{value:e,done:!0}}for(u.method=t,u.arg=n;;){var r=u.delegate;if(r&&(r=function t(n,r){var i=r.method,o=n.iterator[i];return o===e?(r.delegate=null,"throw"===i&&n.iterator.return&&(r.method="return",r.arg=e,t(n,r),"throw"===r.method)||"return"!==i&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+i+"' method")),m):"throw"===(i=p(o,n.iterator,r.arg)).type?(r.method="throw",r.arg=i.arg,r.delegate=null,m):(o=i.arg)?o.done?(r[n.resultName]=o.value,r.next=n.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}(r,u),r)){if(r===m)continue;return r}if("next"===u.method)u.sent=u._sent=u.arg;else if("throw"===u.method){if(l===f)throw l=y,u.arg;u.dispatchException(u.arg)}else"return"===u.method&&u.abrupt("return",u.arg);if(l=d,"normal"===(r=p(o,a,u)).type){if(l=u.done?y:g,r.arg===m)continue;return{value:r.arg,done:u.done}}"throw"===r.type&&(l=y,u.method="throw",u.arg=r.arg)}})}),n}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}n.wrap=h;var f="suspendedStart",g="suspendedYield",d="executing",y="completed",m={};function _(){}function v(){}function x(){}var E,b,I=(c(E={},a,(function(){return this})),(b=(b=Object.getPrototypeOf)&&b(b(P([]))))&&b!==i&&o.call(b,a)&&(E=b),x.prototype=_.prototype=Object.create(E));function w(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function N(t,e){var n;s(this,"_invoke",{value:function(i,s){function a(){return new e((function(n,a){!function n(i,s,a,u){var l;if("throw"!==(i=p(t[i],t,s)).type)return(s=(l=i.arg).value)&&"object"==r(s)&&o.call(s,"__await")?e.resolve(s.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,u)}));u(i.arg)}(i,s,n,a)}))}return n=n?n.then(a,a):a()}})}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function P(t){if(t||""===t){var n,i=t[a];if(i)return i.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return n=-1,(i=function r(){for(;++n<t.length;)if(o.call(t,n))return r.value=t[n],r.done=!1,r;return r.value=e,r.done=!0,r}).next=i}throw new TypeError(r(t)+" is not iterable")}return s(I,"constructor",{value:v.prototype=x,configurable:!0}),s(x,"constructor",{value:v,configurable:!0}),v.displayName=c(x,l,"GeneratorFunction"),n.isGeneratorFunction=function(t){return!!(t="function"==typeof t&&t.constructor)&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,c(t,l,"GeneratorFunction")),t.prototype=Object.create(I),t},n.awrap=function(t){return{__await:t}},w(N.prototype),c(N.prototype,u,(function(){return this})),n.AsyncIterator=N,n.async=function(t,e,r,i,o){void 0===o&&(o=Promise);var s=new N(h(t,e,r,i),o);return n.isGeneratorFunction(e)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},w(I),c(I,l,"Generator"),c(I,a,(function(){return this})),c(I,"toString",(function(){return"[object Generator]"})),n.keys=function(t){var e,n=Object(t),r=[];for(e in n)r.push(e);return r.reverse(),function t(){for(;r.length;){var e=r.pop();if(e in n)return t.value=e,t.done=!1,t}return t.done=!0,t}},n.values=P,C.prototype={constructor:C,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(S),!t)for(var n in this)"t"===n.charAt(0)&&o.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function r(r,i){return a.type="throw",a.arg=t,n.next=r,i&&(n.method="next",n.arg=e),!!i}for(var i=this.tryEntries.length-1;0<=i;--i){var s=this.tryEntries[i],a=s.completion;if("root"===s.tryLoc)return r("end");if(s.tryLoc<=this.prev){var u=o.call(s,"catchLoc"),l=o.call(s,"finallyLoc");if(u&&l){if(this.prev<s.catchLoc)return r(s.catchLoc,!0);if(this.prev<s.finallyLoc)return r(s.finallyLoc)}else if(u){if(this.prev<s.catchLoc)return r(s.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return r(s.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}var s=(i=i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc?null:i)?i.completion:{};return s.type=t,s.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),S(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n,r,i=this.tryEntries[e];if(i.tryLoc===t)return"throw"===(n=i.completion).type&&(r=n.arg,S(i)),r}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:P(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),m}},n},t.exports.__esModule=!0,t.exports.default=t.exports},698:t=>{function e(n){return t.exports=e="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.exports.__esModule=!0,t.exports.default=t.exports,e(n)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},687:(t,e,n)=>{n=n(61)(),t.exports=n;try{regeneratorRuntime=n}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}}},n={},t.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},t.d=(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},t.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r={},(()=>{"use strict";function e(t,e,n,r,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void n(t)}a.done?e(u):Promise.resolve(u).then(r,i)}function n(t){return function(){var n=this,r=arguments;return new Promise((function(i,o){var s=t.apply(n,r);function a(t){e(s,i,o,a,u,"next",t)}function u(t){e(s,i,o,a,u,"throw",t)}a(void 0)}))}}function i(t,e){if(null==t)return{};for(var n,r={},i=Object.keys(t),o=0;o<i.length;o++)n=i[o],0<=e.indexOf(n)||(r[n]=t[n]);return r}function o(){return(o=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n,r=arguments[e];for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}t.r(r),t.d(r,{MapLayer:()=>mr,RegisterMapBoxMethod:()=>function(t,e){if(t&&t.Map&&!t.Map.prototype.MapTooltip){Er=t;var r,s,u=((d=(window.mapboxgl=Er).Map.prototype._setupPainter)&&-1===d.toString().indexOf("webgl2")&&(r=d,Er.Map.prototype._setupPainter=function(){var t=this._canvas.getContext;this._canvas.getContext=function(e,n){return t.apply(this,["webgl2",n])||t.apply(this,["webgl",n])||t.apply(this,["experimental-webgl",n])},r.apply(this),this._canvas.getContext=t}),t.Map),h=function(t,e){var r=t.prototype.setStyle,s=t.prototype.addControl;return{initData:function(){var t;this[Cr]||(this[Cr]={},this.style[Cr]={},Ar(this,{source:t=Array.isArray(e)&&0<e.length&&e.every((function(t){return"string"==typeof t}))?e:[],defaultSources:t,layerSource:{layers:[],sources:[]},customLayer:[],images:{},layerIndex:[],showHeader:!1,bounds:null,cameraOptions:{},measure:{line:0,circle:0,polygon:0},mapLayer:[]}),Ar(this.style,{layerObject:{}}))},clearData:function(){var t=Dr(this,"defaultSources");Ar(this,{source:t,defaultSources:t,layerSource:{layers:[],sources:[]},customLayer:[],images:{},layerIndex:[],showHeader:!1,bounds:null,cameraOptions:{},measure:{line:0,circle:0,polygon:0},mapLayer:[]})},setPaint:function(t,e){Mr(this,t,e,"setPaintProperty")},setLayout:function(t,e){Mr(this,t,e,"setLayoutProperty")},customStyle:function(t){if(t&&"object"==typeof t)for(var e in t){var n,r=t[e];"string"==typeof r?Pr(this,e,r):Array.isArray(r)&&(Ir(r[0])||Array.isArray(r[0]))&&(n=null,"number"!=typeof r[1]&&!Array.isArray(r[1])||(n=r[1]),Pr(this,e,r[0],n))}},getAllLayerAndSource:function(t,e){void 0===e&&(e=!0),null==t&&(t=Dr(this,"source"));for(var n,r=this.getStyle(),i=r.layers,o=r.sources,s={layers:[],sources:[]},a=function(e){return t.includes(e)},u=0;u<i.length;u++)"background"===i[u].type||a(i[u].source)||(n=i[u].id,this.getLayer(n)&&(s.layers.push(l(i[u])),e||this.removeLayer(n)));for(var c=Object.keys(o),h=0;h<c.length;h++){var p=c[h];a(p)||this.isSourceLoaded(p)&&(s.sources.push({name:p,source:l(o[p])}),e||this.removeSource(p))}return s},removeAllCustomLayer:function(){var t=this,e=Dr(this,"customLayer");e.forEach((function(e){t.getLayer(e.layer.id)&&t.removeLayer(e.layer.id)})),e.length=0},removeAllLayerAndSource:function(t){return null==t&&(t=Dr(this,"source")),this.removeAllCustomLayer(),this.getAllLayerAndSource(t,!1)},removeEvents:function(t){var e=this;void 0===t&&(t=["click","mousemove","mouseout"]),Array.isArray(t)&&t.forEach((function(t){t in e._listeners&&(e._listeners[t]=[])}))},removePopup:function(t){t&&"string"==typeof t?["tooltip","popup"].includes(t)&&this._popups.forEach((function(e){e.options.type===t&&e.remove()})):this._popups.forEach((function(t){t.remove()}))},findCustomLayer:function(t,e){null==e&&(e=Dr(this,"source"));for(var n=this.getStyle().layers,r=[],i=0;i<n.length;i++)"background"===n[i].type||e.includes(n[i].source)||r.push(n[i]);if(t){if("string"==typeof t)return r.filter((function(e){return e.type===t}));if(Array.isArray(t)&&0<t.length)return r.filter((function(e){return t.includes(e.type)}))}return r},MapTooltip:function(t,e){return t=new C(this,t,e),Tr(this,t),t},MapPopup:function(t,e){return t=new M(this,t,e),Tr(this,t),t},addLayer:function(t,e){void 0===this._layers&&(this._layers=[],this._sortLayers=[]),t.id&&this._layers.push(t),"zIndex"in t&&this._sortLayers.push(t),this._lazyInitEmptyStyle();var n=Dr(this,"layerIndex"),r=Dr(this,"customLayer");return"custom"===t.type&&r.push({layer:t,beforeId:e}),e?-1!==(r=n.findIndex((function(t){return t.id===e})))&&n.splice(r,0,{type:t.type,id:t.id}):n.push({type:t.type,id:t.id}),this.style.addLayer(t,e),"zIndex"in t&&(r=this._sortLayers.sort((function(t,e){return t.zIndex-e.zIndex})),this.orderLayers(r.map((function(t){return t.id})))),this.fire("layerdata",o({},t,{add:!0})),this._update(!0)},removeLayer:function(t){void 0===this._layers&&(this._layers=[],this._sortLayers=[]);var e=this.style.getLayer(t),n=(this._layers=this._layers.filter((function(e){return e.id!==t})),this._sortLayers=this._sortLayers.filter((function(e){return e.id!==t})),Dr(this,"customLayer")),r=Dr(this,"layerIndex"),i=n.findIndex((function(e){return e.layer.id===t}));return-1!==i&&n.splice(i,1),n=r.findIndex((function(e){return e.id===t})),-1!==n&&r.splice(n,1),this.style.removeLayer(t),this.fire("layerdata",o({},e,{add:!1})),this._update(!0)},moveLayer:function(t,e){var n,r=Dr(this,"layerIndex"),i=r.findIndex((function(e){return e.id===t})),o=r.findIndex((function(t){return t.id===e}));return-1!==i&&-1!==o&&(n=r.splice(i,1)[0],o=Math.max(0,Math.min(o,r.length)),r.splice(o,0,n)),this.style.moveLayer(t,e),this._update(!0)},MapLine:function(){var t=new R(this);return Tr(this,t),t},MapCustom:function(){var t=new O(this);return Tr(this,t),t},fitBoundsGeoJson:function(t,e,n){t&&(t=[[(t=rt(t)).bbox[0],t.bbox[1]],[t.bbox[2],t.bbox[3]]],this.fitBoundsPosition(t,e,n))},fitBoundsPosition:function(t,e,n){var r,s,a,u;Array.isArray(t)&&0!==(null==t?void 0:t.length)&&(r=void 0===(r=(e=null!=e?e:{}).padding)?40:r,s=void 0===(s=e.animate)||s,a=void 0===(a=e.maxZoom)?15:a,u=void 0===(u=e.essential)||u,e=i(e,_r),this.fitBounds(t,o({linear:!1,padding:r,animate:s,essential:u,maxZoom:a},e),n))},getInvertMask:function(t,e){var n;if(c(t)&&0!==(t=null!=(t=t.features[0].geometry.coordinates)?t:[]).length)return n=[],t.forEach((function(t){n.push(t[0])})),e=(t=null!=e?e:{}).id,t=void 0===(t=t.layerConfig)?{paint:{"fill-color":"rgba(0,0,0,0.8)"},layout:{visibility:"visible"}}:t,o({id:void 0===e?"mask":e,type:"fill",source:{type:"geojson",data:{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-180,90],[180,90],[180,-90],[-180,-90]]].concat(n)}}}},t)},fitMap:function(){for(var t={},e=!1,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];var s=void 0===(s=r[0])?null:s,a=void 0===(a=r[1])?null:a,u=Dr(this,"bounds"),l=Dr(this,"cameraOptions");s?c(s)?(e=!1,u=s,a&&!c(a)&&"object"==typeof a&&(l=a)):"object"==typeof s&&(e=!0,t=s):u&&(e=!0),e&&u&&this.fitBoundsGeoJson(u,o({},l,t))},loadImages:function(t){var e=this;return new Promise((function(n){var r={};if(t&&0!==Object.keys(t).length)for(var o in t){var s,a,u=t[o];"string"==typeof u?e.loadImage(u,l(o)):"object"==typeof u&&(u.url?(s=u.url,a=i(u,vr),e.loadImage(s,l(o,a))):u.layer&&u.layer.render&&"function"==typeof u.layer.render&&l(o,u.config||{})(null,u.layer))}else n(r);function l(e,i){return function(o,s){r[e]={data:i,url:o?null:s},Object.keys(r).length===Object.keys(t).length&&n(r)}}}))},loadAddImages:function(t){var e=this;return new Promise((function(n){e.loadImages(t).then((function(t){for(var r in t){var i=t[r],s=o({},null==i?void 0:i.data,{type:"custom"});e.hasImage(r)||e.addImage(r,i.url,s)}n()}))}))},MapCircle:function(){var t=new ct(this);return Tr(this,t),t},MapEvent:function(t){return t=new ht(this,t),Tr(this,t),t},MapMoreCustom:function(){var t=new gt(this);return Tr(this,t),t},removeLayerSource:function(t){function e(t){n.getSource(t)&&(n.removeLayer(t),n.removeSource(t))}var n=this,r=t.name,i=null!=(i=t.sources)?i:[];t=null!=(t=t.layers)?t:[],Array.isArray(r)&&0<r.length?r.forEach((function(t){e(t)})):"string"==typeof r&&e(r),0<(null==i?void 0:i.length)&&0<(null==t?void 0:t.length)&&(t.forEach((function(t){n.getLayer(t)&&n.removeLayer(t)})),i.forEach((function(t){n.getSource(t)&&n.removeSource(t)})))},removeLayerEvent:function(t,e){if(void 0===e&&(e=!0),"object"==typeof t&&null!=t)if(t.destroy&&"function"==typeof t.destroy)t.destroy();else for(var n in t)t[n]&&t[n].destroy&&"function"==typeof t[n].destroy&&(t[n].destroy(),e)&&(t[n]=null)},MapMarker:function(t){return t=new mt(this,t),Tr(this,t),t},findCustomIcon:function(){var t,e=this.style.imageManager.images,n={};for(t in e)"custom"===e[t].type&&(n[t]=e[t]);return n},getCustomLayer:function(){var t=this,e=Dr(this,"customLayer"),n=[];return e.map((function(e){t.getLayer(e.layer.id)&&n.push(e.layer)})),n},setStyle:function(t,e,n){var i,o,s,a,u,l,c=this;return null!=e&&e.save&&(s=(o=null!=e?e:{}).source,o=void 0!==(o=o.custom)&&o,s=null!=(i=s=void 0===s?[]:s)?i:[],Dr(this,"images"),a=Dr(this,"layerSource"),u=Dr(this,"customLayer"),l=this.findCustomIcon(),Array.isArray(s)&&0!==s.length?o||(s=Array.from(new Set([].concat(s,["composite","mapbox://mapbox.satellite"])))):s=["composite","mapbox://mapbox.satellite"],a=this.getAllLayerAndSource(s),this.once("style.load",(function(r){var i,o=[];for(i in l)o.push(i),c.style.imageManager.images[i]=l[i];var s=[];a.sources.map((function(t){var e=a.layers.filter((function(e){return e.source===t.name}));s.push({name:t.name,source:t.source,layer:e})})),null!=e&&e.log&&console.log(s),s.map((function(t){c.getSource(t.name)||c.addSource(t.name,t.source),t.layer.map((function(t){c.getLayer(t.id)||c.addLayer(t)}))})),u.forEach((function(t){c.getLayer(t.layer.id)||c.addLayer(t.layer,t.beforeId)})),n&&"function"==typeof n&&n({style:t,images:o,layerSource:a})}))),r.call(this,t,e)},getLayerIndex:function(t){var e=Dr(this,"layerIndex");if(t){var n=e.findIndex((function(e){return e.id===t}));if(-1!==n)return n}return 0===e.length?0:e.length-1},getLayerId:function(t,e){void 0===e&&(e=0);var n=Dr(this,"layerIndex");return t+=e,e=Number(t),isNaN(e)||t<0&&t>=n.length?"":null!=(n=null==n||null==(e=n[t])?void 0:e.id)?n:void 0},getMinLayerId:function(){var t=Dr(this,"layerIndex");return null!=(t=null==t||null==(t=t[0])?void 0:t.id)?t:void 0},getMaxLayerId:function(){var t=Dr(this,"layerIndex");return null!=(t=null==t||null==(t=t[t.length-1])?void 0:t.id)?t:void 0},getAllLayerId:function(){return Dr(this,"layerIndex").map((function(t){return t.id}))},getAllLayer:function(){return Dr(this,"layerIndex")},getLineLayer:function(){return Dr(this,"layerIndex").map((function(t,e){return"line"!==t.type?null:{index:e,id:t.id}})).filter(Boolean)},AnimateLine:function(t,e){return t=new _t(this,t,e),Tr(this,t),t},addHeader:function(t,e){var n,r=Dr(this,"showHeader");e&&"function"==typeof e&&!r&&(n=this._requestManager.transformRequest,this._requestManager.transformRequest=function(i,s){return s=n.call(this,i,s),(i=e(i))&&"boolean"==typeof i?(r=!0,o({headers:t},s)):s})},getTileByPosition:function(t,e){var n,r;return t&&Array.isArray(t)&&2<=t.length&&t.every((function(t){return"number"==typeof t}))?(n=(t=Er.MercatorCoordinate.fromLngLat({lng:t[0],lat:t[1]})).x,t=t.y,e=null!=(r=e)?r:this.getZoom(),r=Math.floor(e),e=Math.pow(2,r),[Math.floor(n*e),Math.floor(t*e),r]):[]},getPositionByTile:function(t){var e,n,r,i;return!(t&&Array.isArray(t)&&3===t.length&&t.every((function(t){return"number"==typeof t})))||(i=t[0],e=t[1],t=Math.floor(t[2]),t=Math.pow(2,t),i<0)||e<0||t<=i||t<=e?[]:(n=I(e/t),r=b(i/t),i=b((i+1)/t),[r,I((e+1)/t),i,n])},getTilesByBounds:function(t,e){var n=void 0===(n=(e=null!=(e=e=void 0===e?{}:e)?e:{}).expand)?0:n,r=(e=void 0!==(e=e.reversal)&&e,t=null!=(i=t)?i:this.getZoom(),Math.floor(t)),i=this.getBounds().toArray(),o=(t=this.getTileByPosition(i[0],r))[0],s=t[1],a=(t=this.getTileByPosition(i[1],r))[0],u=t[1];if(u-=n="number"!=typeof n||n<0||2<n?0:n,a+=n,s+=n,!(E(o-=n)&&E(a)&&E(u)&&E(s)))return[];var l=[];if(e)for(var c=u;c<=s;c++)for(var h=o;h<=a;h++)l.push([h,c,r]);else for(var p=o;p<=a;p++)for(var f=u;f<=s;f++)l.push([p,f,r]);var g=Math.pow(2,r);return l.forEach((function(t){t[0]<0&&(t[0]=t[0]+g)})),l.filter((function(t){return 0<=t[1]}))},loadSpriteGraph:function(t){var e=this;return new Promise(function(){var r=n(a().mark((function r(i){var o,s,u,l;return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(t)return o=[],"object"==typeof t&&t.image&&t.json?o=[t]:Array.isArray(t)&&t.every((function(t){return"object"==typeof t&&t.image&&t.json}))&&(o=t),s={},u=function(){var t=n(a().mark((function t(){var e,n,r,i,u,l,c,h,p,f,g,d,y,m,_,v,x;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=0;case 1:if(e<o.length){if(n=o[e].image,r=o[e].json,i={},"string"==typeof r)return t.next=8,fetch(r).then((function(t){return t.json()}));t.next=12}else t.next=20;break;case 8:u=t.sent,i="object"==typeof u?u:{},t.next=13;break;case 12:"object"==typeof r&&(i=r);case 13:return t.next=15,function(){return Et.apply(this,arguments)}(n);case 15:for(c in l=t.sent,i)v=i[c],h=v.width,p=v.height,f=v.x,g=v.y,d=v.sdf,y=v.pixelRatio,m=v.stretchX,_=v.stretchY,v=v.content,x=new vt({width:h,height:p}),vt.copy(l,x,{x:f,y:g},{x:0,y:0},{width:h,height:p}),s[c]={data:x,pixelRatio:y,sdf:d,stretchX:m,stretchY:_,content:v};case 17:e++,t.next=1;break;case 20:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),r.next=7,u();r.next=9;break;case 7:for(l in s)e.style.addImage(l,s[l]);i();case 9:case"end":return r.stop()}}),r)})));return function(t){return r.apply(this,arguments)}}())},MapClusterMarker:function(t){return t=new It(this,t),Tr(this,t),t},MapSourceEvent:function(t,e){return t=new Nt(this,t,e),Tr(this,t),t},TileByGeoJson:function(t){return t=new kt(this,t),Tr(this,t),t},MapMenu:function(t){return t=new zt(this,t),Tr(this,t),t},MapMeasure:function(t){return t=new ne(this,t,Cr),Tr(this,t),t},addControl:function(t,e){return this.initData(),s.call(this,t,e)},MapTileClusterCustom:function(t){return t=new oe(this,t),Tr(this,t),t},updateGlyphs:function(t){this.style.updateGlyphs(t)},orderLayers:function(t){void 0===t&&(t=[]);var e=this.style._layers,n=Object.keys(e).map((function(t){return e[t]})),r=[],i=[];return t.forEach((function(t){var e;t&&(e=n.find((function(e){return e.id===t})))&&r.push(e)})),n.forEach((function(t){r.find((function(e){return e.id===t.id}))||i.push(t)})),t=i.concat(r),this.style._checkLoaded(),this.style._changed=!0,this.style._order=t.map((function(t){return t.id})),this.style._layerOrderChanged=!0,t},MapPositionImage:function(){var t=new se(this);return Tr(this,t),t},MapLabelByGeoJson:function(){var t=new er(this);return Tr(this,t),t},MapImageByGeoJson:function(t){return t=new pr(this,t),Tr(this,t),t},getMapLayer:function(){return Rr(this)},clearMapLayer:function(t,e){Or(this,t,e=void 0===e||e)}}}(u,e);for(s in new Event("layerdata"),h)u.prototype[s]=h[s];var p,f=Er.Style,g=function(t){var e=t.prototype.addImage,n=t.prototype.updateImage,r=t.prototype._loadSprite,o=t.prototype.queryRenderedFeatures,s=t.prototype.addLayer,a=t.prototype.removeLayer;return{addImage:function(t,n){return n.type="custom",e.call(this,t,n),this},updateImage:function(t,e){e.type="custom",n.call(this,t,e)},_loadSprite:function(t,e){var n,i=this;void 0===e&&(e=!1),r.call(this,t),e&&(n=this._availableImages.length,this.map.on("data",(function t(e){if(i.map&&i._availableImages){var r=i._availableImages.length;if("style"===e.dataType&&r!==n&&n<r){for(var o=i._availableImages.slice(n),s=0;s<o.length;s++)i.imageManager&&i.imageManager.images&&i.imageManager.images[o[s]]&&(i.imageManager.images[o[s]].type="custom");i.map.off("data",t)}}else i.map&&i.map.off("data",t)})))},loadSprite:function(t){this._loadSprite(t,!0)},addLayer:function(t,e){var n=void 0===(n=t.interactive)||n,r=(null!=this&&null!=(r=this[Cr])&&r.layerObject||Ar(this,{layerObject:{}}),this),i=["layerObject",t.id];if(r&&r[Cr]&&Array.isArray(i)&&0!==i.length){for(var o=r[Cr],a=0;a<i.length-1;a++){var u=i[a];o[u]||(o[u]={}),o=o[u]}o[i[i.length-1]]=n}s.call(this,t,e)},removeLayer:function(t){!function(t,e){if(t&&t[Cr]&&Array.isArray(e)&&0!==e.length)try{for(var n=t[Cr],r=0;r<e.length-1;r++){if(!n||!n[e[r]])return;n=n[e[r]]}var i=e[e.length-1];n&&i in n&&delete n[i]}catch(t){console.warn("Error deleting property:",t)}}(this,["layerObject",t]),a.call(this,t)},queryRenderedFeatures:function(t,e,n){var r=void 0===(r=(e=null!=e?e:{}).interactive)||r,s=(e=i(e,xr),o.call(this,t,e,n));if(r){if(0<s.length)for(var a,u=null==(t=this[Cr])?void 0:t.layerObject,l=0;l<s.length;l++)u&&s[l].layer&&s[l].layer.id?(a=u[s[l].layer.id],s[l].layer.interactive=null==a||a):s[l].layer.interactive=!0;return s.filter((function(t){return t.layer.interactive}))}return s},updateGlyphs:function(t){this.glyphManager.setURL(t)}}}(f);for(p in g)f.prototype[p]=g[p];var d,y=(d=Er.Popup).prototype.setDOMContent;d.prototype._closeClick=function(){},d.prototype.setDOMContent=function(t){return t=y.call(this,t),this._closeButton&&this._closeButton.addEventListener("click",this._closeClick),t}}},RegisterMapBoxModel:()=>function(t,e){if(Er&&t&&e){(br=t).GLTFLoader=e,window.THREE=br;var n,r=Er.Map,i={initGLTF:function(t,e,n){return new T(t,e,n)}};for(n in i)r.prototype[n]=i[n]}},RegisterMapClass:()=>function(t,e){var n;t&&(n=(e=null!=e?e:{}).tooltipClass,e=e.popupClass,t.tooltipClass=null!=n?n:"commonTooltip",t.popupClass=null!=e?e:"commonPopup")},convertPolygonToLinePolygon:()=>function(t,e){if(c(t)){var n=t.features.filter((function(t){return"Polygon"===t.geometry.type||"MultiPolygon"===t.geometry.type})),r=(n=[].concat(n.map((function(t){return le(t)})),t.features.filter((function(t){return"LineString"===t.geometry.type||"MultiLineString"===t.geometry.type}))),[]);if(n.forEach((function(t){t=Dn(t,e,{units:"meters"}),r.push.apply(r,t.features)})),0<r.length)return{type:"FeatureCollection",features:r}}return null},deepClone:()=>l,gcj02ToWgs84:()=>Rt,generateUUID:()=>L,getAPNGSymbol:()=>function(t){var e,n=void 0===(e=(t=null!=t?t:{}).width)?50:e,r=void 0===(e=t.height)?50:e,i=void 0===(e=t.duration)?null:e,o=void 0===(e=t.url)?"":e;return new Promise((function(t){fetch(o).then((function(t){return t.arrayBuffer()})).then((function(e){var o;e=yr()(e),!(0,dr.isNotAPNG)(e)&&0<(null==(o=e.frames)?void 0:o.length)?(i="number"==typeof i?i:e.playTime/e.frames.length,o=e.frames.map((function(t){return URL.createObjectURL(t.imageData)})),Promise.all(o.map((function(t){var e=new Image;return e.src=t,new Promise((function(t){e.onload=function(){var i;((i=document.createElement("canvas")).width=n,i.height=r,i=i.getContext("2d")).drawImage(e,0,0,n,r),t(i.getImageData(0,0,n,r).data)}}))}))).then((function(e){e={urls:e,width:n,height:r,data:new Uint8Array(n*r*4),onAdd:function(t){this.map=t,(t=document.createElement("canvas")).width=this.width,t.height=this.height,this.canvas=t,this.context=t.getContext("2d"),this.index=0,this.duration=i,this.dataNow=performance.now()},render:function(){var t=this.urls[this.index];return performance.now()-this.dataNow>this.duration&&(this.index++,this.index>=this.urls.length&&(this.index=0),this.dataNow=performance.now()),this.data=t,this.map.triggerRepaint(),!0}},t(e)})).catch((function(e){t(null)}))):t(null)}))}))},getArrayDepth:()=>m,getGifSymbol:()=>function(t){var e,n=void 0===(e=(t=null!=t?t:{}).width)?50:e,r=void 0===(e=t.height)?50:e,i=void 0===(e=t.duration)?null:e,o=void 0===(e=t.url)?"":e;return new Promise((function(t){var e,s,a;o&&("gif"===(a=(s=o).split("/"))[a.length-1].split(".").pop().toLowerCase()||s.startsWith("data:image/gif"))?(a=document.createElement("div"),(s=document.createElement("img")).setAttribute("rel:animated_src",o),s.setAttribute("rel:auto_play","0"),a.appendChild(s),(e=new(gr())({gif:s})).load((function(){var o=[];i="number"==typeof i?i:e.get_duration_ms()/e.get_length();for(var s,a=1;a<=e.get_length();a++){e.move_to(a);var u=((u=e.get_canvas().getContext("2d")).drawImage(e.get_canvas(),0,0,n,r),u.getImageData(0,0,n,r).data);o.push(u)}0<o.length?(s={urls:o,width:n,height:r,data:new Uint8Array(n*r*4),onAdd:function(t){this.map=t,(t=document.createElement("canvas")).width=this.width,t.height=this.height,this.canvas=t,this.context=t.getContext("2d"),this.index=0,this.duration=i,this.dataNow=performance.now()},render:function(){var t=this.urls[this.index];return performance.now()-this.dataNow>this.duration&&(this.index++,this.index>=this.urls.length&&(this.index=0),this.dataNow=performance.now()),this.data=t,this.map.triggerRepaint(),!0}},t(s)):t(null)}))):t(null)}))},getPositionType:()=>d,getSymbolRipple:()=>function(t){var e,n=void 0===(e=(t=null!=t?t:{}).size)?30:e,r=void 0===(e=t.duration)?1e3:e,i=void 0===(e=t.color)?"#ff0000":e,o=t.custom,s=_(i,!0),a=!1;return o&&"function"==typeof o&&(a=!0),{width:n,height:n,data:new Uint8Array(n*n*4),onAdd:function(t){this.map=t,(t=document.createElement("canvas")).width=this.width,t.height=this.height,this.context=t.getContext("2d")},render:function(){var t,e,u,l=this.context;return a?l=o({width:this.width,height:this.height,duration:r,color:i,context:l}):(t=performance.now()%r/r,e=n/2*.2,u=n/2*t,l.clearRect(0,0,this.width,this.height),l.beginPath(),l.arc(this.width/2,this.height/2,u,0,2*Math.PI),l.strokeStyle="rgba("+s[0]+","+s[1]+","+s[2]+","+(1-t+.1)+")",l.lineWidth=2,l.stroke(),l.fillStyle="rgba("+s[0]+","+s[1]+","+s[2]+","+(1-t)+")",l.fill(),l.beginPath(),l.arc(this.width/2,this.height/2,e,0,2*Math.PI),l.fillStyle="rgba("+s[0]+","+s[1]+","+s[2]+","+(1-t)+")",l.lineWidth=2+4*(1-t),l.fill()),this.data=l.getImageData(0,0,this.width,this.height).data,this.map.triggerRepaint(),!0}}},hexToRgba:()=>_,invertMask:()=>function(t,e){if(c(t)){var n=(e&&Array.isArray(e)&&"Polygon"===d(e)||(e=[[[-180,90],[180,90],[180,-90],[-180,-90],[-180,90]]]),t.features.filter((function(t){return"Polygon"===t.geometry.type||"MultiPolygon"===t.geometry.type})));if(0===n.length)return null;if(1===n)return{type:"FeatureCollection",features:n};for(var r=n[0],i=0;i<n.slice(1).length;i++)r=Qn(r,n[i+1]);return{type:"FeatureCollection",features:[$n(r,G(e))]}}},isClosedGraph:()=>y,isGeoJSON:()=>c,isNumber:()=>x,isValidNumber:()=>E,judgePointInPolygon:()=>tr,judgeSizeLngLat:()=>p,latFromMercatorY:()=>I,lngFromMercatorX:()=>b,mergeGeoJson:()=>function(){for(var t={type:"FeatureCollection",features:[]},e=[],n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];for(var o=0;o<r.length;o++)Array.isArray(r[o])?e.push.apply(e,r[o]):r[o]&&"object"==typeof r[o]&&e.push(r[o]);for(var s,a=0;a<e.length;a++){var u=e[a];c(u)&&(u=u.features,(s=t.features).push.apply(s,u))}return t},object2Geojson:()=>function(t,e,n){var r=l(t);if(r&&"Object"===u(r)&&(r=[r]),!Array.isArray(r))return null;t={type:"FeatureCollection"};for(var i=[],o=function(t){var o=r[t],s=function(t,e){if(e)if("string"==typeof e){var n=e.split(".").filter(Boolean);if(1!==n.length)return g(t,n);if(n=t[n[0]])return[f(n)]}else if(Array.isArray(e)){if(2===e.length)return[[t[e[0]],t[e[1]]].filter(Boolean)];if(3===e.length&&e[2])return g(t,n=e[2].split(".").filter(Boolean),[e[0],e[1]])}return[]}(o,e);0<s.length&&s.map((function(e){var s=d(e),a=!1;(a=!(!s||!("type"===s||0<e.length||"Feature"===s||"GeometryCollection"===s))||a)&&("GeometryCollection"===s?(null!=(a=e.geometries)?a:[]).forEach((function(e){var o={type:"Feature"};o.geometry=e,n&&n.key&&"string"==typeof n.key&&(n.alias&&"string"==typeof n.alias?o[n.alias]=r[t][n.key]:o[n.key]=r[t][n.key]),i.push(o)})):(a={type:"Feature"},"Feature"!==s?(a.properties=o,a.geometry="type"===s?e:{type:s,coordinates:e}):a=e,n&&n.key&&"string"==typeof n.key&&(n.alias&&"string"==typeof n.alias?a[n.alias]=r[t][n.key]:a[n.key]=r[t][n.key]),i.push(a)))}))},s=0;s<r.length;s++)o(s);return t.features=i,t},outOfChina:()=>Tt,parseValue:()=>N,performChunk:()=>function(t,e,n){var r,i,o=[];"number"==typeof t?o=new Array(t):Array.isArray(t)&&(o=t),0!==o.length&&"function"==typeof e&&(!(r="function"==typeof n?n:null)&&globalThis.requestIdleCallback&&(r=function(t){requestIdleCallback((function(e){t((function(){return 0<e.timeRemaining()}))}))}),i=0,function t(){i!==o.length&&r((function(n){for(var r=Date.now();n(Date.now()-r)&&i<o.length;){var s=o[i];e(s,i),i++}t()}))}())},pointNearOnLine:()=>function(t,e){return Array.isArray(t)&&Array.isArray(e)?(e=B(e),t=k(t),Un(e,t,{units:"miles"}).geometry.coordinates):null},polygonCenter:()=>function(t){var e;return c(t)?(e={type:"FeatureCollection",features:[]},t.features.filter((function(t){return"Polygon"===t.geometry.type||"MultiPolygon"===t.geometry.type})).forEach((function(t){a=et(n=t),a=Jn(a,(a[2]-a[0])/100,{units:"degrees"}),r=0,i=null,s=le(n),a.features.forEach((function(t){var e;Ot(t,n)&&(e="FeatureCollection"===s.type?Math.min.apply(Math,s.features.map((function(e){return Vn(t,e,{units:"degrees"})}))):Vn(t,s,{units:"degrees"}),r<e)&&(r=e,i=t)}));var n,r,i,s,a=(i||Zt(n)).geometry.coordinates;e.features.push({type:"Feature",geometry:{type:"Point",coordinates:a},properties:o({},t.properties)})})),e):null},resversalGeojson:()=>v,reversalGeojson:()=>function(t,e){return void 0===e&&(e=!0),v(t,e=!0)},reversalLngLat:()=>h,transformGeojson:()=>function(t,e){return c(t)&&"function"==typeof e?((t=l(t)).features.forEach((function(t){var n=t.geometry;t.geometry.coordinates=w(n.coordinates,e)})),t):null},transformLngLat:()=>w,wgs84ToGcj02:()=>function(t,e){var n,r,i,o,s;return Tt(t=+t,e=+e)?[t,e]:(n=Pt(t-105,e-35),r=Mt(t-105,e-35),i=e/180*Lt,o=Math.sin(i),o=1-Ct*o*o,s=Math.sqrt(o),n=180*n/(St*(1-Ct)/(o*s)*Lt),[t+(r=180*r/(St/s*Math.cos(i)*Lt)),e+n])}});var s=t(687),a=t.n(s),u=function(t){var e=typeof t;return"object"!=e?e:Object.prototype.toString.call(t).replace(/^\[object (\S+)\]$/,"$1")},l=function t(e){var n,r=u(e);if("Array"===r)n=[];else{if("Object"!==r)return e;n={}}if("Array"===r)for(var i=0,o=e.length;i<o;i++)n.push(t(e[i]));else if("Object"===r)for(var s in e)n[s]=t(e[s]);return n};function c(t){return"object"==typeof t&&null!==t&&"FeatureCollection"===t.type&&Array.isArray(t.features)}function h(t,e){return void 0===e&&(e=!0),t&&("string"==typeof t&&(t=JSON.parse(t)),Array.isArray(t))?x(t[0])?p(t,e):function t(e){for(var n=[],r=0;r<e.length;r++){var i=e[r];x(i[0])?n.push(p(i)):n.push(t(i))}return n}(t):[]}function p(t,e){void 0===e&&(e=!0);var n=Number(t[0]);return t=Number(t[1]),e&&n<t?[t,n]:[n,t]}function f(t){try{return"string"==typeof t?JSON.parse(t):t}catch(e){return t}}function g(t,e,n){var r=[],i=2===(n=void 0===n?[]:n).length;return function t(e,o){var s;e&&o.length&&(s=o.shift(),e.hasOwnProperty(s))&&(e=N(e[s]),Array.isArray(e)?0!==o.length||i?e.forEach((function(e){i?r.push([e[n[0]],e[n[1]]]):t(e,l(o))})):e&&(s=f(e),r.push(s)):"object"==typeof e?0===o.length?r.push(i?[e[n[0]],e[n[1]]]:e):t(e,o):0===o.length&&e&&(s=f(e),r.push(s)))}(t,e),r}function d(t){if(Array.isArray(t)){var e=m(t=t.filter(Boolean));if(0!==e)switch(e){case 1:return"Point";case 2:return"LineString";case 3:return y(t.map((function(t){return[t[0],t[t.length-1]]})))?"Polygon":"MultiLineString";case 4:return"MultiPolygon";default:return null}}else if(t&&"object"==typeof t){if(["Point","LineString","Polygon","MultiLineString","MultiPolygon"].includes(t.type))return"type";if("Feature"===t.type)return"Feature";if("GeometryCollection"===t.type)return"GeometryCollection"}return null}function y(t){if(0===t.length)return!1;function e(t,e,n){return void 0===n&&(n=1e-9),Math.abs(t[0]-e[0])<n&&Math.abs(t[1]-e[1])<n}for(var n=0;n<t.length-1;n++)if(!e(t[n][1],t[n+1][0]))return!1;return e(t[0][0],t[t.length-1][1])}function m(t){return Array.isArray(t)?Array.isArray(t[0])?1+m(t[0]):1:0}function _(t,e){void 0===e&&(e=!1);var n,r,i=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,n,r){return e+e+n+n+r+r}));return(i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(i))?(n=parseInt(i[1],16),r=parseInt(i[2],16),i=parseInt(i[3],16),e?[n,r,i,1]:"rgba("+n+","+r+","+i+",1)"):t}function v(t,e){if(void 0===e&&(e=!0),c(t)){for(var n={type:"FeatureCollection",features:[]},r=t.features,i=0;i<r.length;i++){var s,a=r[i],u={};for(s in a)"geometry"!==s&&"properties"!==s&&"type"!==s&&(u[s]=a[s]);var l=a.geometry.coordinates,f=a.geometry.type,g={type:f,coordinates:null};g.coordinates=("Point"===f?p:h)(l,e),n.features.push(o({type:"Feature",geometry:g,properties:a.properties},u))}return n}return null}function x(t){return"number"==typeof t||!("string"!=typeof t||!t||t.includes(" ")||isNaN(Number(t)))}function E(t){return isFinite(t)&&!isNaN(t)}function b(t){return 360*t-180}function I(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}function w(t,e){return t&&"function"==typeof e&&("string"==typeof t&&(t=JSON.parse(t)),Array.isArray(t))?x(t[0])?e(t):function t(e,n){for(var r=[],i=0;i<e.length;i++){var o=e[i];x(o[0])?r.push(n(o)):r.push(t(o,n))}return r}(t,e):[]}function N(t){try{return"string"==typeof t?JSON.parse(t):t}catch(e){return t}}function L(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))}var S=["customName"],C=function(){function t(t,e,r){var s=this,u=(this._mouseEnter=function(){var t=n(a().mark((function t(e){var n,r,i,o,u,l,c,h,p,f;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("Map"!==e.originalEvent.target.ariaLabel)return t.abrupt("return");t.next=2;break;case 2:if(r=e.point,i=e.lngLat,o=s.map.queryRenderedFeatures(r),c=null!=(c=o[0])?c:{},u=c.properties,l=c.geometry,c.source,c=c.layer,s.layerName.includes(c.id)){t.next=8;break}return null!=(c=s.popup)&&c.remove(),t.abrupt("return");case 8:if(s._mouseEnterProcessed)return t.abrupt("return");t.next=10;break;case 10:if(s._mouseEnterProcessed=!0,c=l.coordinates,h=[i.lng,i.lat],"mouseenter"===s.mouseType&&(h=s._getPosition(c)),!(0<(null==(n=h)?void 0:n.length))){t.next=20;break}for(f in p={},u)if("string"==typeof u[f]&&isNaN(Number(u[f])))try{p[f]=JSON.parse(u[f])}catch(t){p[f]=u[f]}else p[f]=u[f];return t.next=19,s._setHTML(p,h,i,l,r,o);case 19:s._mouseInOut&&"function"==typeof s._mouseInOut&&s._mouseInOut(!0,o,e);case 20:setTimeout((function(){s._mouseEnterProcessed=!1}),0);case 21:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this._mouseLeave=function(t){var e;s._mouseLeaveProcessed||(s._mouseLeaveProcessed=!0,s.popup.remove(),e=t.point,t.lngLat,e=s.map.queryRenderedFeatures(e),s._mouseInOut&&"function"==typeof s._mouseInOut&&s._mouseInOut(!0,e,t),setTimeout((function(){s._mouseLeaveProcessed=!1}),0))},this.map=t,"string"==typeof e?this.layerName=[e]:Array.isArray(e)&&(this.layerName=e),t=null!=(e=t.tooltipClass)?e:"commonTooltip",void 0!==(u=(e=null!=r?r:{}).customName)&&u);e=i(e,S),u=u?"":t+" ",this.className=u,null!=r&&r.className&&(u+=r.className),u=u.split(" ").filter(Boolean).join(" "),this.fullName=u,this.allMove=null!=(t=null==r?void 0:r.allMove)&&t,this.popup=new mapboxgl.Popup(o({},e,{className:u,closeButton:null!=(t=null==r?void 0:r.closeButton)&&t,closeOnClick:null!=(e=null==r?void 0:r.closeOnClick)&&e,anchor:null!=(u=null==r?void 0:r.anchor)?u:"left",type:"tooltip"}))}var e=t.prototype;return e.show=function(t,e){var n=this;"function"==typeof(this.htmlCallBack=t)&&(this.mouseType="mouseenter","move"===e&&(this.mouseType="mousemove"),0<(null==(t=this.layerName)?void 0:t.length))&&this.layerName.forEach((function(t){n.map.on(n.allMove?"mousemove":n.mouseType,t,n._mouseEnter).on("mouseleave",t,n._mouseLeave)}))},e.setClassName=function(t,e){var n=this;void 0===e&&(e=!1),this.popup&&"string"==typeof t&&t!==this.oldClassName&&(Array.from(this.popup._classList).map((function(t){t&&t.replaceAll(" ","")&&n.popup.addClassName(t)})),(e?this.fullName+" "+t:this.className+" "+t).split(" ").filter(Boolean).map((function(t){n.popup.addClassName(t)})),this.oldClassName=t)},e.destroy=function(){var t,e=this;null!=(t=this.popup)&&t.remove(),null!=(t=this.layerName)&&t.forEach((function(t){e.map.off(e.allMove?"mousemove":e.mouseType,t,e._mouseEnter).off("mouseleave",t,e._mouseLeave)}))},e._setHTML=function(){var t=n(a().mark((function t(e,n,r,i,o,s){var u,l,c=this;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.htmlCallBack(e,n,{lngLat:r,geometry:i,point:o,features:s,feature:s[0]});case 2:u=t.sent,l=function(t){c.popup.setLngLat(n).setHTML(t).addTo(c.map)},"object"==typeof u?u.hasOwnProperty("nodeType")?l(u):u.hasOwnProperty("show")&&"boolean"==typeof u.show?u.show&&l(u.data):l(""):"string"!=typeof u&&"number"!=typeof u||l(u);case 5:case"end":return t.stop()}}),t,this)})));return function(e,n,r,i,o,s){return t.apply(this,arguments)}}(),e.mouseInOut=function(t){t&&"function"==typeof t&&(this._mouseInOut=t)},e.showPosition=function(t,e){var n=this,r=this.map.project(t),i=this.map.queryRenderedFeatures(r),o=null!=(o=i.filter((function(t){return n.layerName.includes(t.layer.id)}))[0])?o:{},s=void 0===(a=o.properties)?{}:a,a=o.geometry;if(o=o.layer,this.layerName.includes((void 0===o?{}:o).id)){o=void 0===(o=(null!=a?a:{}).coordinates)?[]:o;var u=Array.isArray(t)?t:[t.lng,t.lat];if(0<(null==(o=u="mouseenter"===this.mouseType?this._getPosition(o):u)?void 0:o.length)){var l,c={};for(l in s)if("string"==typeof s[l]&&isNaN(Number(s[l])))try{c[l]=JSON.parse(s[l])}catch(t){c[l]=s[l]}else c[l]=s[l];o=e&&"object"==typeof e?e:c,this._setHTML(o,u,t,a,r,i)}}else null!=(e=this.popup)&&e.remove()},e._getPosition=function(t){return function t(e){return Array.isArray(e[0])?t(e[0]):e}(t)},t}(),P=["destroyComponent","customClick","popupClose","closeOther","noCloseLayerName","customName","offset","closeClick"],M=function(){function t(t,e,r){var s=this,u=(this._closeOtherPopup=function(){var t;s.closeOther&&null!=(t=s.map)&&null!=(t=t._popups)&&t.forEach((function(t){var e;"popup"===t.options.type&&(Array.isArray(s.noCloseLayerName)&&0<s.noCloseLayerName.length?(e=t.options.sourceName.join("|"),new RegExp(e).test(s.noCloseLayerName)&&null!=t&&null!=(e=t._onClose)&&e.call(t)):null!=t&&null!=(e=t._onClose)&&e.call(t))}))},this._click=function(){var t=n(a().mark((function t(e){var n,r,i,o,u,l,c,h,p,f,g,d,y,m;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("Map"!==e.originalEvent.target.ariaLabel)return t.abrupt("return");t.next=2;break;case 2:if(s._closeOtherPopup(),n=e.point,r=e.lngLat,i=s.map.queryRenderedFeatures(n),c=null!=(c=i[0])?c:{},o=c.properties,u=c.geometry,c.source,c=c.layer,s.layerName.includes(c.id)){t.next=8;break}return t.abrupt("return");case 8:if(s.customClick){t.next=30;break}for(p in h={},o)if("string"==typeof o[p]&&isNaN(Number(o[p])))try{h[p]=JSON.parse(o[p])}catch(t){h[p]=o[p]}else h[p]=o[p];return f=u.coordinates,g=u.type,t.next=14,null==(c=s.componentCallBack)?void 0:c.call(s,{properties:h,lngLat:r,coordinates:f,point:n,features:i,feature:i[0]});case 14:if(t.t1=l=t.sent,t.t0=null!==t.t1,!t.t0){t.next=18;break}t.t0=void 0!==l;case 18:t.t0?(t.t2=l,t.next=23):t.next=22;break;case 22:t.t2={};case 23:y=t.t2,d=y.component,y=y.instance,m=r,"Point"===g&&(m=f),s.vueInstance=y,d&&(s.popup.setOffset(s.offset),s.popup.setLngLat(m).setDOMContent(d).addTo(s.map));case 30:"function"!=typeof s.callBack||s._clickProcessed||(s._clickProcessed=!0,s.callBack({lngLat:r,properties:o,geometry:u,point:n}),setTimeout((function(){s._clickProcessed=!1}),0));case 31:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.map=t,this.popup=null,"string"==typeof e?this.layerName=[e]:Array.isArray(e)&&(this.layerName=e),void 0!==(l=(e=r||{}).destroyComponent)&&l),l=void 0!==(l=e.customClick)&&l,c=void 0!==(c=e.popupClose)&&c,h=void 0===(h=e.closeOther)||h,p=void 0===(p=e.noCloseLayerName)?[]:p,f=void 0!==(f=e.customName)&&f,g=void 0===(g=e.offset)?[0,0]:g,d=e.closeClick;e=i(e,P),t=null!=(t=t.popupClass)?t:"commonPopup",f=f?"":t+" ",this.className=f,null!=r&&r.className&&(f+=r.className),f=f.split(" ").filter(Boolean).join(" "),this.fullName=f,this.noCloseLayerName=p,this.noCloseLayerName=[],this.customClick=l,this.popupCloseSign=c,this.closeOther=h,this.offset=g="number"==typeof g?[g,g]:g,this.vueInstance=null,this.closeCallback=null,this.customClick||(this.popup=new mapboxgl.Popup(o({},e,{offset:g,className:f,closeButton:null!=(t=null==e?void 0:e.closeButton)&&t,closeOnClick:null!=(r=null==e?void 0:e.closeOnClick)&&r,anchor:null!=(p=null==e?void 0:e.anchor)?p:"bottom",focusAfterOpen:null!=(l=null==e?void 0:e.focusAfterOpen)&&l,type:"popup",sourceName:this.layerName})),d&&"function"==typeof d&&(this.popup._closeClick=d),null!=(c=this.popup)&&c.on("close",(function(t){"function"==typeof s.closeCallback&&s.closeCallback(t),s.popupCloseSign&&null!=(t=s.vueInstance)&&t.popupClose&&"function"==typeof s.vueInstance.popupClose&&s.vueInstance.popupClose(),s.vueInstance&&u&&null!=(t=s.vueInstance)&&t.$destroy()})))}var e=t.prototype;return e.show=function(t,e){var n=this;this.componentCallBack=t,this.callBack=e,0<(null==(t=this.layerName)?void 0:t.length)&&this.layerName.forEach((function(t){n.map.on("click",t,n._click)}))},e.setClassName=function(t,e){var n=this;void 0===e&&(e=!1),this.popup&&"string"==typeof t&&t!==this.oldClassName&&(Array.from(this.popup._classList).map((function(t){n.popup.removeClassName(t)})),(e?this.fullName+" "+t:this.className+" "+t).split(" ").filter(Boolean).map((function(t){t&&t.replaceAll(" ","")&&n.popup.addClassName(t)})),this.oldClassName=t)},e.showPosition=function(t,e,n,r){t&&(this._closeOtherPopup(),(n=(null!=n?n:{}).offset)&&this.popup.setOffset(n),this.popup.setLngLat(t).setDOMContent(e).addTo(this.map),r)&&"function"==typeof r&&r()},e.close=function(){var t;null!=(t=this.popup)&&t._onClose()},e.closeBack=function(t){this.closeCallback=t},e.destroy=function(){var t,e=this;null!=(t=this.popup)&&t.remove(),null!=(t=this.layerName)&&t.forEach((function(t){e.map.off("click",t,e._click)}))},t}(),T=function(){function t(t,e,n){var r=this,i=(this.clickEvent=function(t){var e=new THREE.Vector2,n=r.map.getCanvas();e.x=(t.clientX-n.getBoundingClientRect().left)/n.offsetWidth*2-1,e.y=-(t.clientY-n.getBoundingClientRect().top)/n.offsetHeight*2+1,t=(new THREE.Matrix4).getInverse(r.camera.projectionMatrix),n=(new THREE.Vector3).applyMatrix4(t),e=new THREE.Vector3(e.x,e.y,1).applyMatrix4(t).clone().sub(n).normalize(),(t=new THREE.Raycaster).set(n,e),n=t.intersectObjects(r.scene.children,!0),r.callback&&0<n.length&&(e=n[0],t=r.findProperties(e.object),r.callback(t))},this.findProperties=function(t){var e={},n=null;return"Scene"!==t.type&&(n=(t.lngLat?(e=t.properties,t):(e=(t=r.findProperties(t.parent)).properties,t)).lngLat),{properties:e,lngLat:n}},this.id="3d-"+t,this.type="custom",this.renderingMode="3d","function"==typeof n&&(this.callback=n),t=e.lngLat,n=e.url,void 0===(i=e.scale)?1:i),o=void 0===(o=e.height)?0:o,s=void 0===(s=e.rotate)?[Math.PI/2,0,0]:s,a=void 0===(a=e.properties)?{}:a,u=void 0===(u=e.AmbientLight)?{show:!0,color:16777215,intensity:.5}:u,l=void 0===(l=e.DirectionalLight)?[]:l,c=void 0===(c=e.PointLight)?[]:c;e=void 0!==(e=e.click)&&e,this.lngLat=t,this.url=n,this.scale=i,this.height=o,this.rotate=s,this.properties=a,this.AmbientLight=u,this.DirectionalLight=l,this.PointLight=c,this.click=e,this.modelAsMercatorCoordinate=mapboxgl.MercatorCoordinate.fromLngLat(t,o),this.modelTransform={translateX:this.modelAsMercatorCoordinate.x,translateY:this.modelAsMercatorCoordinate.y,translateZ:this.modelAsMercatorCoordinate.z,rotateX:s[0],rotateY:s[1],rotateZ:s[2],scale:i*this.modelAsMercatorCoordinate.meterInMercatorCoordinateUnits()}}var e=t.prototype;return e.onAdd=function(t,e){var n,r,i=this;this.map=t,t=this.map.getCanvas(),this.camera=new THREE.PerspectiveCamera(50,t.innerWidth/t.innerHeight,.1,1e4),this.scene=new THREE.Scene,this.AmbientLight&&this.AmbientLight.show&&(r=this.AmbientLight.color||16777215,n=this.AmbientLight.intensity||.5,r=new THREE.AmbientLight(r,n),this.scene.add(r)),this.DirectionalLight&&Array.isArray(this.DirectionalLight)&&this.DirectionalLight.forEach((function(t){var e=t.color||16777215,n=t.intensity||1;t=t.position||[0,0,0],(e=new THREE.DirectionalLight(e,n)).position.set(t[0],t[1],t[2]).normalize(),i.scene.add(e)})),this.PointLight&&Array.isArray(this.PointLight)&&this.PointLight.forEach((function(t){var e=t.color||16777215,n=t.intensity||1,r=t.distance||0,o=t.decay||2;t=t.position||[0,0,0],(e=new THREE.PointLight(e,n,r,o)).position.set(t[0],t[1],t[2]).normalize(),i.scene.add(e)})),(new THREE.GLTFLoader).load(this.url,(function(t){for(var e=0;e<t.scene.children.length;e++)t.scene.children[e].properties=i.properties,t.scene.children[e].lngLat=i.lngLat;i.scene.add(t.scene)})),this.renderer=new THREE.WebGLRenderer({canvas:t,context:e,antialias:!0}),this.renderer.autoClear=!1,this.click&&this.renderer.domElement.addEventListener("click",this.clickEvent)},e.render=function(t,e){var n=(new THREE.Matrix4).makeRotationAxis(new THREE.Vector3(1,0,0),this.modelTransform.rotateX),r=(new THREE.Matrix4).makeRotationAxis(new THREE.Vector3(0,1,0),this.modelTransform.rotateY),i=(new THREE.Matrix4).makeRotationAxis(new THREE.Vector3(0,0,1),this.modelTransform.rotateZ),o=(new THREE.Matrix4).fromArray(e);n=(new THREE.Matrix4).makeTranslation(this.modelTransform.translateX,this.modelTransform.translateY,this.modelTransform.translateZ).scale(new THREE.Vector3(this.modelTransform.scale,-this.modelTransform.scale,this.modelTransform.scale)).multiply(n).multiply(r).multiply(i),this.camera.projectionMatrix.elements=e,this.camera.projectionMatrix=o.multiply(n),this.renderer.state.reset(),this.renderer.render(this.scene,this.camera),this.map.triggerRepaint()},e.onRemove=function(){this.click&&this.renderer.domElement.removeEventListener("click",this.clickEvent),this.renderer&&(this.renderer.dispose(),this.renderer=null),this.scene&&(this.scene.clear(),this.scene=null)},t}(),R=function(){function t(t){this.map=t,this.sourceName=[],this.sourceType="geojson"}var e=t.prototype;return e.draw=function(t,e,n){if(t&&this.map)return"vector"===t.type?(this.sourceName=[e],this.sourceType="vector",this._clearSource(),this._addSourceLayer(e,t,n),this.sourceName):"FeatureCollection"===t.type||Array.isArray(t.features)?(this.sourceName=[e],this._clearSource(),this._addSourceLayer(e,t,n),n.lineConfig?[].concat(this.sourceName,[this.lineName]):this.sourceName):void 0},e.destroy=function(){this._clearSource()},e.visible=function(t){var e,n=this;"boolean"==typeof t&&null!=(e=this.sourceName)&&e.forEach((function(e){n.map.getLayer(e)&&n.map.setLayoutProperty(e,"visibility",t?"visible":"none")}))},e._addSourceLayer=function(t,e,n){"vector"===this.sourceType?this.map.addSource(t,o({},e,n.sourceConfig)):this.map.addSource(t,o({type:"geojson",data:e},n.sourceConfig)),(e=n.beforeId||null)&&!this.map.getLayer(e)&&(e=null),this.map.addLayer(o({id:t,type:"line",source:t},n.layerConfig),e),n.lineConfig&&(this.lineName=t+"-highlight",this.map.addLayer(o({id:this.lineName,type:"line",source:t},n.lineConfig)))},e._clearSource=function(){var t,e=this;null!=(t=this.sourceName)&&t.forEach((function(t){var n;(null==(n=e.map)?void 0:n.getSource(t))&&(e.map.getLayer(t)&&e.map.removeLayer(t),e.lineName&&e.map.getLayer(t+"-highlight")&&e.map.removeLayer(t+"-highlight"),e.map.removeSource(t))}))},t}(),O=function(){function t(t){this.map=t,this.sourceName=[],this.type="symbol",this.sourceType="geojson"}var e=t.prototype;return e.draw=function(t,e,n){if(t&&this.map){if("vector"===t.type)return this.sourceType="vector",this._addSourceLayer(e,t,n),this.sourceName=[e],this.sourceName;var r;if("FeatureCollection"===t.type||Array.isArray(t.features)){this.type=null!=(r=n.type)?r:"symbol";var i=n.sliceNum;if(!i||i<1e3)this.sourceName=[e],this._clearSource(),this._addSourceLayer(e,t,n);else{this._clearSource();for(var o=0,s=0;s<t.features.length;s+=i){var a={type:"FeatureCollection",features:[]},u=t.features.slice(s,i);a.features=[].concat(u),u=e+"-"+o,this.sourceName.push(u),this._addSourceLayer(u,a,n),o++}}return this.sourceName}}},e.destroy=function(){this._clearSource()},e.visible=function(t){var e,n=this;"boolean"==typeof t&&null!=(e=this.sourceName)&&e.forEach((function(e){n.map.getLayer(e)&&n.map.setLayoutProperty(e,"visibility",t?"visible":"none")}))},e._clearSource=function(){var t,e=this;null!=(t=this.sourceName)&&t.forEach((function(t){var n;(null==(n=e.map)?void 0:n.getSource(t))&&(e.map.getLayer(t)&&e.map.removeLayer(t),e.map.removeSource(t))}))},e._addSourceLayer=function(t,e,n){"vector"===this.sourceType?this.map.addSource(t,o({},e,n.sourceConfig)):this.map.addSource(t,o({type:"geojson",data:e},n.sourceConfig)),(e=n.beforeId||null)&&!this.map.getLayer(e)&&(e=null),this.map.addLayer(o({id:t,type:this.type,source:t},n.layerConfig),e)},t}(),A=6371008.8,D={centimeters:100*A,centimetres:100*A,degrees:A/111325,feet:3.28084*A,inches:39.37*A,kilometers:A/1e3,kilometres:A/1e3,meters:A,metres:A,miles:A/1609.344,millimeters:1e3*A,millimetres:1e3*A,nauticalmiles:A/1852,radians:1,yards:1.0936*A};function F(t,e,n){var r={type:"Feature"};return 0!==(n=void 0===n?{}:n).id&&!n.id||(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=e||{},r.geometry=t,r}function k(t,e,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(H(t[0])&&H(t[1]))return F({type:"Point",coordinates:t},e,n);throw new Error("coordinates must contain numbers")}function G(t,e,n){void 0===n&&(n={});for(var r=0,i=t;r<i.length;r++){var o=i[r];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<o[o.length-1].length;s++)if(o[o.length-1][s]!==o[0][s])throw new Error("First and last Position are not equivalent.")}return F({type:"Polygon",coordinates:t},e,n)}function B(t,e,n){if(void 0===n&&(n={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");return F({type:"LineString",coordinates:t},e,n)}function U(t,e){var n={type:"FeatureCollection"};return(e=void 0===e?{}:e).id&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.features=t,n}function q(t,e,n){return F({type:"MultiPolygon",coordinates:t},e,n=void 0===n?{}:n)}function z(t,e){var n=D[e=void 0===e?"kilometers":e];if(n)return t*n;throw new Error(e+" units is invalid")}function j(t,e){var n=D[e=void 0===e?"kilometers":e];if(n)return t/n;throw new Error(e+" units is invalid")}function V(t){return t%(2*Math.PI)*180/Math.PI}function X(t){return t%360*Math.PI/180}function Y(t,e,n){if(void 0===e&&(e="kilometers"),void 0===n&&(n="kilometers"),0<=t)return z(j(t,e),n);throw new Error("length must be a positive number")}function H(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function W(t){return t&&t.constructor===Object}function J(t,e,n){if(null!==t)for(var r,i,o,s=0,a=t.type,u="FeatureCollection"===a,l="Feature"===a,c=u?t.features.length:1,h=0;h<c;h++)for(var p,f,g=(f=!!(p=u?t.features[h].geometry:l?t.geometry:t)&&"GeometryCollection"===p.type)?p.geometries.length:1,d=0;d<g;d++){var y=0,m=0,_=f?p.geometries[d]:p;if(null!==_){var v=_.coordinates,x=_.type,E=!n||"Polygon"!==x&&"MultiPolygon"!==x?0:1;switch(x){case null:break;case"Point":if(!1===e(v,s,h,y,m))return!1;s++,y++;break;case"LineString":case"MultiPoint":for(r=0;r<v.length;r++){if(!1===e(v[r],s,h,y,m))return!1;s++,"MultiPoint"===x&&y++}"LineString"===x&&y++;break;case"Polygon":case"MultiLineString":for(r=0;r<v.length;r++){for(i=0;i<v[r].length-E;i++){if(!1===e(v[r][i],s,h,y,m))return!1;s++}"MultiLineString"===x&&y++,"Polygon"===x&&m++}"Polygon"===x&&y++;break;case"MultiPolygon":for(r=0;r<v.length;r++){for(i=m=0;i<v[r].length;i++){for(o=0;o<v[r][i].length-E;o++){if(!1===e(v[r][i][o],s,h,y,m))return!1;s++}m++}y++}break;case"GeometryCollection":for(r=0;r<_.geometries.length;r++)if(!1===J(_.geometries[r],e,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}function K(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var n=0;n<t.features.length&&!1!==e(t.features[n],n);n++);}function Z(t,e){for(var n,r,i,o,s,a,u,l,c,h=0,p="FeatureCollection"===t.type,f="Feature"===t.type,g=p?t.features.length:1,d=0;d<g;d++){for(s=p?t.features[d].geometry:f?t.geometry:t,u=p?t.features[d].properties:f?t.properties:{},l=p?t.features[d].bbox:f?t.bbox:void 0,c=p?t.features[d].id:f?t.id:void 0,o=(a=!!s&&"GeometryCollection"===s.type)?s.geometries.length:1,r=0;r<o;r++)if(null===(i=a?s.geometries[r]:s)){if(!1===e(null,h,u,l,c))return}else switch(i.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===e(i,h,u,l,c))return;break;case"GeometryCollection":for(n=0;n<i.geometries.length;n++)if(!1===e(i.geometries[n],h,u,l,c))return;break;default:throw new Error("Unknown Geometry Type")}h++}}function $(t,e){Z(t,(function(t,n,r,i,o){var s,a=null===t?null:t.type;switch(a){case null:case"Point":case"LineString":case"Polygon":return!1!==e(F(t,r,{bbox:i,id:o}),n,0)&&void 0}switch(a){case"MultiPoint":s="Point";break;case"MultiLineString":s="LineString";break;case"MultiPolygon":s="Polygon"}for(var u=0;u<t.coordinates.length;u++){var l=t.coordinates[u];if(!1===e(F({type:s,coordinates:l},r),n,u))return!1}}))}function Q(t,e){$(t,(function(t,n,r){var i=0;if(t.geometry){var o,s,a,u,l=t.geometry.type;if("Point"!==l&&"MultiPoint"!==l)return u=a=s=0,!1!==J(t,(function(l,c,h,p,f){if(void 0===o||s<n||a<p||u<f)o=l,s=n,a=p,u=f,i=0;else{if(p=B([o,l],t.properties),!1===e(p,n,r,f,i))return!1;i++,o=l}}))&&void 0}}))}function tt(t){var e=[1/0,1/0,-1/0,-1/0];return J(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 et=tt.default=tt;function nt(t,e){void 0===e&&(e={});var n=Number(t[0]),r=Number(t[1]),i=Number(t[2]),o=Number(t[3]);if(6===t.length)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");var s=[n,r];return G([[s,[i,r],[i,o],[n,o],s]],e.properties,{bbox:t,id:e.id})}const rt=function(t){return nt(et(t))};function it(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)&&2<=t.length&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function ot(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 st(t,e,n){if(!t)throw new Error("No feature passed");if(!n)throw new Error(".featureOf() requires a name");if(!t||"Feature"!==t.type||!t.geometry)throw new Error("Invalid input to "+n+", Feature with geometry required");if(!t.geometry||t.geometry.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.geometry.type)}function at(t){return"Feature"===t.type?t.geometry:t}function ut(t,e,n,r){void 0===r&&(r={});var i=X((t=it(t))[0]),o=(t=X(t[1]),n=X(n),e=j(e,r.units),Math.asin(Math.sin(t)*Math.cos(e)+Math.cos(t)*Math.sin(e)*Math.cos(n)));return k([V(i+Math.atan2(Math.sin(n)*Math.sin(e)*Math.cos(t),Math.cos(e)-Math.sin(t)*Math.sin(o))),V(o)],r.properties)}const lt=function(t,e,n){for(var r=(n=void 0===n?{}:n).steps||64,i=n.properties||(!Array.isArray(t)&&"Feature"===t.type&&t.properties?t.properties:{}),o=[],s=0;s<r;s++)o.push(ut(t,e,-360*s/r,n).geometry.coordinates);return o.push(o[0]),G([o],i)};var ct=function(){function t(t){this.map=t,this.sourceName=[],this.lineName=""}var e=t.prototype;return e.draw=function(t,e,n){if(t){this.sourceName=[e];var r,i=null!=n?n:{},o=void 0===(r=i.radius)?0:r,s=void 0===(r=i.steps)?64:r,a=i.endRadius,u=[];if("object"==typeof t){if("FeatureCollection"!==t.type&&!Array.isArray(t.features))return;for(var l=t.features,c=0;c<l.length;c++){var h,p,f,g,d,y=l[c].geometry.coordinates;"number"==typeof y[0]&&"number"==typeof y[1]&&(y[0]<y[1]&&(h=[y[1],y[0]],y[0]=h[0],y[1]=h[1]),h=!1,p=0<(p=(h="string"==typeof o||h)?l[c].properties[o]:o)?p:0,f={steps:s,units:"kilometers",properties:l[c].properties},g=lt(y,p,f),a?(d=!1,d=0<(d=(d="string"==typeof a||d)?l[c].properties[a]:a)?d:0,y=lt(y,a,f),u.push(p===d?g:p<d?this._getRingJson(y.geometry.coordinates[0],g.geometry.coordinates[0],g.properties):this._getRingJson(g.geometry.coordinates[0],y.geometry.coordinates[0],g.properties))):u.push(g))}}return this._addSourceLayer(e,{type:"FeatureCollection",features:u},n),n.lineConfig?[].concat(this.sourceName,[this.lineName]):this.sourceName}},e._getRingJson=function(t,e,n){return{type:"Feature",geometry:{coordinates:[t,e],type:"Polygon"},properties:n}},e._addSourceLayer=function(t,e,n){this.lineName=t+"-line",n.lineConfig&&null!=(r=this.map)&&r.getLayer(this.lineName)&&this.map.removeLayer(this.lineName),null!=(r=this.map)&&r.getLayer(t)&&this.map.removeLayer(t),null!=(r=this.map)&&r.getSource(t)&&this.map.removeSource(t),this.map.addSource(t,o({type:"geojson",data:e},n.sourceConfig));var r=(null!=n?n:{}).beforeId;r&&!this.map.getLayer(r)&&(r=null),this.map.addLayer(o({id:t,type:"fill",source:t},n.layerConfig),r),n.lineConfig&&this.map.addLayer(o({id:this.lineName,type:"line",source:t},n.lineConfig),r)},e.destroy=function(){this._clearSource()},e.visible=function(t){var e,n=this;"boolean"==typeof t&&(null!=(e=this.sourceName)&&e.forEach((function(e){n.map.getLayer(e)&&n.map.setLayoutProperty(e,"visibility",t?"visible":"none")})),this.lineName)&&this.map.getLayer(this.lineName)&&this.map.setLayoutProperty(this.lineName,"visibility",t?"visible":"none")},e._clearSource=function(){var t,e=this;null!=(t=this.sourceName)&&t.forEach((function(t){e.map.getSource(t)&&(e.map.getLayer(t)&&e.map.removeLayer(t),e.lineName&&e.map.getLayer(t+"-line")&&e.map.removeLayer(t+"-line"),e.map.removeSource(t))}))},t}(),ht=function(){function t(t,e){this.map=t,this.name=[],"string"==typeof e?this.name=[e]:Array.isArray(e)&&e.every((function(t){return"string"==typeof t}))&&(this.name=e),this.event=[]}var e=t.prototype;return e.add=function(t){var e,n=this;if(0===(null==(e=this.event)?void 0:e.length)&&t&&"object"==typeof t){var r,i=function(e){var r,i;n.event.push(e),0<(null==(i=n.name)?void 0:i.length)?null!=(i=n.name)&&i.forEach((function(r){function i(n){var r;"Map"===(null==n||null==(r=n.originalEvent)||null==(r=r.target)?void 0:r.ariaLabel)&&t[e](n)}var o;n[e]=i,null!=(o=n.map)&&o.on(e,r,i)})):(n[e]=i=function(n){var r;"Map"===(null==n||null==(r=n.originalEvent)||null==(r=r.target)?void 0:r.ariaLabel)&&t[e](n)},null!=(r=n.map)&&r.on(e,i))};for(r in t)i(r)}},e.destroy=function(t){var e,n=this;t&&Array.isArray(t)&&t.every((function(t){return"string"==typeof t}))?null!=(e=this.name)&&e.forEach((function(e){t.forEach((function(t){var r,i;n.event.includes(t)&&(i=n[t],null!=(r=n.map))&&r.off(t,e,i)}))})):0<(null==(e=this.name)?void 0:e.length)?null!=(e=this.name)&&e.forEach((function(t){n.event.forEach((function(e){var r,i=n[e];null!=(r=n.map)&&r.off(e,t,i)}))})):this.event.forEach((function(t){var e,r=n[t];null!=(e=n.map)&&e.off(t,r)}))},t}(),pt=["id","type"],ft=["id","type","beforeId"],gt=function(){function t(t){this.map=t,this.sourceName=[]}var e=t.prototype;return e.draw=function(t,e){var n,r,s,a,u,l=this;return c(t)||"vector"===t.type?(n=(s=null!=(s=e.sourceConfig)?s:{}).id,r=void 0===(r=s.type)?"geojson":r,s=i(s,pt),a=n,e=null!=(e=e.layerConfig)?e:{},u=[],Array.isArray(e)?u=e:"object"==typeof e&&u.push(e),u.forEach((function(t){var e;(t=t.id)&&null!=(e=l.map)&&e.getLayer(t)&&l.map.removeLayer(t)})),null!=(e=this.map)&&e.getSource(a)&&this.map.removeSource(a),"vector"===t.type?this.map.addSource(n,o({},s,t)):this.map.addSource(n,o({type:r,data:t},s)),u.forEach((function(t){var e=t.id,n=t.type,r=t.beforeId;t=i(t,ft),r&&!l.map.getLayer(r)&&(r=null),l.map.addLayer(o({id:e,type:n,source:a},t),r)})),this.sourceName=[a].concat(u.map((function(t){return t.id}))).filter(Boolean),this.sourceName=Array.from(new Set(this.sourceName)),this.sourceName):[]},e.destroy=function(){var t,e,n=this;0<(null==(e=this.sourceName)?void 0:e.length)&&(1===this.sourceName.length?this.map.getSource(this.sourceName[0])&&(this.map.removeLayer(this.sourceName[0]),this.map.removeSource(this.sourceName[0])):(t=(e=this.sourceName)[0],e=e.slice(1),this.map.getSource(t)&&(this.map.getLayer(t)&&this.map.removeLayer(t),e.forEach((function(t){n.map.removeLayer(t)})),this.map.removeSource(t))))},e.visible=function(t){var e,n=this;"boolean"==typeof t&&null!=(e=this.sourceName)&&e.forEach((function(e){n.map.getLayer(e)&&n.map.setLayoutProperty(e,"visibility",t?"visible":"none")}))},t}();function dt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var yt,mt=function(){function t(t,e){this.map=t,this.markers=[],this.options=e,this.properties=[]}var e=t.prototype;return e.draw=function(t,e){if(c(t))for(var n,r=null!=(n=this.options)?n:{},i=0,s=function(t,e){var n,r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=function(t,e){var n;if(t)return"string"==typeof t?dt(t,e):"Map"===(n="Object"===(n=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?dt(t,e):void 0}(t)))return r&&(t=r),n=0,function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(t.features);!(l=s()).done;){var a,u,l=l.value;"Point"===l.geometry.type&&(a=r,e&&"function"==typeof e&&1===(null==(u=e({lngLat:l.geometry.coordinates,properties:l.properties,index:i}))?void 0:u.nodeType)&&(a=o({},a,{element:u})),u=new mapboxgl.Marker(a).setLngLat(l.geometry.coordinates).addTo(this.map),this.markers.push(u),this.properties.push(l.properties),i++)}},e.addEvent=function(t){var e=this;if(t&&"object"==typeof t)for(var n=0;n<this.markers.length;n++)!function(n){["dragstart","drag","dragend"].forEach((function(r){t[r]&&"function"==typeof t[r]&&e.markers[n].on(r,(function(i){t[r](o({},i,{properties:e.properties[n]}))}))}))}(n)},e.destroy=function(){for(var t=0;t<this.markers.length;t++)this.markers[t].remove();this.markers=[]},e.visible=function(t){var e;"boolean"==typeof t&&null!=(e=this.markers)&&e.forEach((function(e){e.getElement().style.display=t?"block":"none"}))},t}(),_t=function(){function t(t,e,n){var r;n=null!=(r=n)?r:{},this.map=t,this.name=e,this.dash=Array.isArray(n.dash)?n.dash:[[0,4,3],[.5,4,2.5],[1,4,2],[1.5,4,1.5],[2,4,1],[2.5,4,.5],[3,4,0],[0,.5,3,3.5],[0,1,3,3],[0,1.5,3,2.5],[0,2,3,2],[0,2.5,3,1.5],[0,3,3,1],[0,3.5,3,.5]],this.step=null!=(r=n.step)?r:50,this.animateId=null}var e=t.prototype;return e.animate=function(){var t,e=this;this.name&&this.map.getLayer(this.name)&&function n(r){(r=parseInt(r/e.step%e.dash.length))!==t&&(e.map.setPaintProperty(e.name,"line-dasharray",e.dash[t]),t=r),e.animateId=requestAnimationFrame(n)}(t=0)},e.destroy=function(){this.animateId&&(cancelAnimationFrame(this.animateId),this.animateId=null)},t}(),vt=(s={},function(){function t(t,e){this.width=void 0,this.height=void 0,this.data=void 0;var n=this,r=t.width;if(t=t.height,e){if(e instanceof Uint8ClampedArray)e=new Uint8Array(e.buffer);else if(e.length!==r*t*4)throw new RangeError("mismatched image size")}else e=new Uint8Array(r*t*4);n.width=r,n.height=t,n.data=e}var e=t.prototype;return e.resize=function(e){var n,r,i;n=this,r=(e=new t(e)).width,i=e.height,r===n.width&&i===n.height||(xt(n,e,{x:0,y:0},{x:0,y:0},{width:Math.min(n.width,r),height:Math.min(n.height,i)},4),n.width=r,n.height=i,n.data=e.data)},e.replace=function(t,e){e?this.data.set(t):t instanceof Uint8ClampedArray?this.data=new Uint8Array(t.buffer):this.data=t},e.clone=function(){return new t({width:this.width,height:this.height},new Uint8Array(this.data))},t.copy=function(t,e,n,r,i){xt(t,e,n,r,i,4)},t}());function xt(t,e,n,r,i,o){if(0!==i.width&&0!==i.height){if(i.width>t.width||i.height>t.height||n.x>t.width-i.width||n.y>t.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>e.width||i.height>e.height||r.x>e.width-i.width||r.y>e.height-i.height)throw new RangeError("out of range destination coordinates for image copy");var s=t.data,a=e.data;if(s===a)throw new RangeError("image is the same");for(var u=0;u<i.height;u++)for(var l=((n.y+u)*t.width+n.x)*o,c=((r.y+u)*e.width+r.x)*o,h=0;h<i.width*o;h++)a[c+h]=s[l+h]}}function Et(){return(Et=n(a().mark((function t(e,n){var r;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return void 0===n&&(n=0),t.next=3,new Promise((function(t){var r=new Image;r.src=e,r.crossOrigin="Anonymous",r.onload=function(){var e=r.width,i=r.height,o=(yt=yt||window.document.createElement("canvas")).getContext("2d",{willReadFrequently:!0});if(!o)throw new Error("failed to create canvas 2d context");(e>yt.width||i>yt.height)&&(yt.width=e,yt.height=i),o.clearRect(-n,-n,e+2*n,i+2*n),o.drawImage(r,0,0,e,i),t(o.getImageData(-n,-n,e+2*n,i+2*n))}}));case 3:return r=t.sent,t.abrupt("return",r);case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function bt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}Rn=vt,void 0===fr&&(fr={}),(sn="RGBAImage")?s[sn]?console.error(sn+" is already registered."):(Object.defineProperty(Rn,"_classRegistryKey",{value:sn,writeable:!1}),s[sn]={klass:Rn,omit:fr.omit||[]}):console.error("Can't register a class without a name.");var It=function(){function t(t,e){this.map=t,this.options=null!=e?e:{key:"id"},this.markers={},this.mapEvent=null}var e=t.prototype;return e.draw=function(t,e){var n=this,r={};this.mapEvent=function(){if(n.map.getSource(t)&&n.map.isSourceLoaded(t)){for(var i,s={},a=function(t,e){var n,r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=function(t,e){var n;if(t)return"string"==typeof t?bt(t,e):"Map"===(n="Object"===(n=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?bt(t,e):void 0}(t)))return r&&(t=r),n=0,function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(n.map.querySourceFeatures(t));!(h=a()).done;){var u,l,c,h,p=(h=h.value).geometry.coordinates;(h=h.properties).cluster||(u=h[n.options.key],(c=n.markers[u])?(l=c.getLngLat().toArray())[0]===p[0]&&l[1]===p[1]||c.setLngLat(p):(l=null,l="function"==typeof e?e({properties:h,lngLat:p}):document.createElement("div"),c=n.markers[u]=new mapboxgl.Marker(o({},n.options,{element:l})).setLngLat(p)),s[u]=c,r[u])||c.addTo(n.map)}for(i in r)s[i]||r[i].remove();r=s}},this.map.on("render",this.mapEvent)},e.destroy=function(){for(var t in this.markers)null!=(t=this.markers[t])&&t.remove();this.markers={},this.mapEvent&&this.map.off("render",this.mapEvent)},e.visible=function(t){if("boolean"==typeof t)for(var e in this.markers)this.markers[e]&&this.markers.hasOwnProperty(e)&&(this.markers[e].getElement().style.display=t?"block":"none")},t}(),wt=["once"],Nt=function(){function t(t,e,n){this.map=t,this.options=null!=n?n:{},this.sourceName=e,n=void 0===(e=(t=(this.mapEvent=null)!=n?n:{}).once)||e,e=i(t,wt),this.once=n,this.other=e}var e=t.prototype;return e.open=function(t){var e=this;this.sourceName&&(this.mapEvent=function(){var n;e.map.getSource(e.sourceName)&&e.map.isSourceLoaded(e.sourceName)&&"function"==typeof t&&(n=e.map.querySourceFeatures(e.sourceName,e.other),t(n),e.once)&&e.destroy()},this.map.on("render",this.mapEvent))},e.destroy=function(){var t;null!=(t=this.map)&&t.off("render",this.mapEvent),this.mapEvent=null},t}(),Lt=Math.PI,St=6378245,Ct=.006693421622965943;function Pt(t,e){var n=2*(t=+t)-100+3*(e=+e)+.2*e*e+.1*t*e+.2*Math.sqrt(Math.abs(t));return(n+=2*(20*Math.sin(6*t*Lt)+20*Math.sin(2*t*Lt))/3)+2*(20*Math.sin(e*Lt)+40*Math.sin(e/3*Lt))/3+2*(160*Math.sin(e/12*Lt)+320*Math.sin(e*Lt/30))/3}function Mt(t,e){return e=300+(t=+t)+2*(e=+e)+.1*t*t+.1*t*e+.1*Math.sqrt(Math.abs(t)),(e+=2*(20*Math.sin(6*t*Lt)+20*Math.sin(2*t*Lt))/3)+2*(20*Math.sin(t*Lt)+40*Math.sin(t/3*Lt))/3+2*(150*Math.sin(t/12*Lt)+300*Math.sin(t/30*Lt))/3}function Tt(t,e){return e=+e,!(73.66<(t=+t)&&t<135.05&&3.86<e&&e<53.55)}function Rt(t,e){var n,r,i,o,s;return Tt(t,e)?[t,e]:(o=Pt(t-105,e-35),s=Mt(t-105,e-35),n=e/180*Lt,r=Math.sin(n),r=1-Ct*r*r,i=Math.sqrt(r),o=180*o/(St*(1-Ct)/(r*i)*Lt),[2*t-(t+(s=180*s/(St/i*Math.cos(n)*Lt))),2*e-(e+o)])}function Ot(t,e,n){if(void 0===n&&(n={}),!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var r=it(t),i=(t=at(e)).type,o=(e=e.bbox,t.coordinates);if(e&&0==(t=r,e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]))return!1;"Polygon"===i&&(o=[o]);for(var s=!1,a=0;a<o.length&&!s;a++)if(At(r,o[a][0],n.ignoreBoundary)){for(var u=!1,l=1;l<o[a].length&&!u;)At(r,o[a][l],!n.ignoreBoundary)&&(u=!0),l++;u||(s=!0)}return s}function At(t,e,n){for(var r=!1,i=0,o=(e=e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]?e.slice(0,e.length-1):e).length-1;i<e.length;o=i++){var s=e[i][0],a=e[i][1],u=e[o][0],l=e[o][1];if(t[1]*(s-u)+a*(u-t[0])+l*(t[0]-s)==0&&(s-t[0])*(u-t[0])<=0&&(a-t[1])*(l-t[1])<=0)return!n;a>t[1]!=l>t[1]&&t[0]<(u-s)*(t[1]-a)/(l-a)+s&&(r=!r)}return r}function Dt(t,e){var n,r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=function(t,e){var n;if(t)return"string"==typeof t?Ft(t,e):"Map"===(n="Object"===(n=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ft(t,e):void 0}(t))||e&&t&&"number"==typeof t.length)return r&&(t=r),n=0,function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ft(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var kt=function(){function t(t,e){this.map=t,this.options=null!=e?e:{}}var e=t.prototype;return e.draw=function(t,e,n,r){var i;t&&e&&c(t)&&n&&(this.id=n,i=rt(t).bbox,this.destroy(),this.map.addLayer(function(t,e,n){function r(t){if("FeatureCollection"===b.type){for(var e=0;e<b.features.length;e++)if(Ot(t,b.features[e]))return!0;return!1}if("Feature"===b.type)return Ot(t,b.geometry)}var i,s=n.bbox,a=n.isGCJ,u=n.replaceUrl,l=null!=(i=n.isJudgement)&&i,c=n.filter,h=n.coordTransform,p=n.judgementBox,f=n.judgementPoint,g=null!=(i=n.maxZoom)?i:18,d=null!=(i=n.minZoom)?i:0,y=null==(i=n.judgeBound)||i,m=null==(i=n.isPrecision)||i,_=null!=(i=n.expand)?i:0,v=null==(i=n.minShow)||i,x=null==(i=n.maxShow)||i,E=null!=(i=n.textureType)?i:"NEAREST",b=null!=(i=n.json)?i:{},I=null!=(i=n.gradualLoad)&&i,w=null==(i=n.isThrottle)||i,N=null!=(i=n.fetchOptions)?i:{},L=document.createElement("canvas"),S=0;return{id:t,type:"custom",onAdd:function(t,e){var n=this,r=(this.map=t,this.tileCache={},this.gridCache={},this.coordCache={},this.showTiles=[],t=e.createShader(e.VERTEX_SHADER),e.shaderSource(t,"\nuniform mat4 u_matrix;\nattribute vec3 a_pos;\nattribute vec2 a_uv;\nvarying vec2 v_uv;\nvoid main() {\n v_uv = a_uv;\n gl_Position = u_matrix * vec4(a_pos, 1.0);\n}"),e.compileShader(t),e.createShader(e.FRAGMENT_SHADER)),i=(e.shaderSource(r,"\nprecision mediump float;\nvarying vec2 v_uv;\nuniform sampler2D u_sampler;\nvoid main() {\n gl_FragColor = texture2D(u_sampler, v_uv);\n}"),e.compileShader(r),this.program=e.createProgram(),e.attachShader(this.program,t),e.attachShader(this.program,r),e.linkProgram(this.program),null);this.map.on("move",(function(t){w?i||(n.updateLayer(e),i=setTimeout((function(){i=null}),100)):n.updateLayer(e)})),this.updateLayer(e)},updateLayer:function(t){var e=this.map.getZoom(),n=e;if(m&&(e+=1.4),n<d){if(e=d,!v)return void(this.showTiles=[])}else g<e&&n<g&&(e=g);if(g<e&&g<n){if(!x)return void(this.showTiles=[]);e=g}this.drawLayer(e,t)},drawLayer:function(t,e){for(var n=this,r=parseInt(t),i=(t=[(t=this.map.getBounds().toArray())[0][0],t[0][1],t[1][0],t[1][1]],Math.min(t[2],s[2])),o=Math.min(t[3],s[3]),a=Math.max(t[0],s[0]),u=(t=Math.max(t[1],s[1]),a=this.map.getTileByPosition([a,t],r),t=this.map.getTileByPosition([i,o],r),i=a[0]-_,t[0]+_),l=t[1]-_,c=a[1]+_,h=[],p=(o=this.map.getTileByPosition([s[0],s[1]],r),t=this.map.getTileByPosition([s[2],s[3]],r),o[0]),f=t[0],g=o[1],d=t[1],y=i;y<=u;y++)for(var m,v=l;v<=c;v++)p<=y&&y<=f&&g<=v&&v<=d&&(h.push(m={x:y,y:v,z:r}),this.addGridCache(m,0,0),y===u&&this.addGridCache(m,1,0),v===c&&this.addGridCache(m,0,1),y===u)&&v===c&&this.addGridCache(m,1,1);a=this.map.getCenter();var x=this.map.getTileByPosition([a.lng,a.lat],r);if(h.sort((function(t,e){return n.tileDistance(t,x)-n.tileDistance(e,x)})),o=this.showTiles||[],this.showTiles=[],I&&0<o.length){var E=o[0].xyz?o[0].xyz.z:r;if(2<=Math.abs(r-E))for(var b in this.tileCache)(b=this.tileCache[b]).abortController&&!b.isLoad&&b.xyz&&(E<b.xyz.z&&b.xyz.z<r||r<b.xyz.z&&b.xyz.z<E)&&b.abortController.abort()}for(var w=0,N=h;w<N.length;w++){var L,S=N[w];this.tileCache[this.createTileKey(S)]?this.showTiles.push(this.tileCache[this.createTileKey(S)]):(L=this.createTile(e,S),this.showTiles.push(L),this.tileCache[this.createTileKey(S)]=L)}I?!(t=this.showTiles.every((function(t){return void 0!==t.isLoad})))&&0<o.length?(i=o.filter((function(t){return t.isLoad})),this.showTiles=[].concat(i,this.showTiles)):t&&this._cleanupOldTiles(h):setTimeout((function(){n._cleanupOldTiles(h)}),0)},_cleanupOldTiles:function(t){var e,n=this,r={},i=(t.forEach((function(t){r[n.createTileKey(t)]=!0})),Date.now()),o=0;for(e in this.tileCache)o++;if(1e3<o)for(var s=Object.entries(this.tileCache).sort((function(t,e){return(t[1].timestamp||0)-(e[1].timestamp||0)})),a=Math.min(o-1e3+50,o),u=0;u<a;u++){var l,c=s[u][0];r[c]||((l=this.tileCache[c]).abortController&&!l.isLoad&&l.abortController.abort(),delete this.tileCache[c])}else for(var h in this.tileCache){var p=this.tileCache[h];(!r[h]||p.timestamp&&3e5<i-p.timestamp)&&(p.abortController&&!p.isLoad&&p.abortController.abort(),delete this.tileCache[h])}},tileDistance:function(t,e){return Math.sqrt(Math.pow(t.x-e[0],2)+Math.pow(t.y-e[1],2))},addGridCache:function(t,e,n){var r,i=this.createTileKey(t.x+e,t.y+n,t.z);this.gridCache[i]||(n=(e=this.map.getPositionByTile([t.x+e,t.y+n,t.z]))[0],t=e[1],r=e[2],e=e[3],void 0!==t&&void 0!==e&&void 0!==r&&void 0!==n&&(a?(this.coordCache[t="gcj:"+n+","+e]||(r=Rt(n,e),this.coordCache[t]=[r[0],r[1]]),r=this.coordCache[t],this.gridCache[i]={lng:r[0],lat:r[1]}):h&&"function"==typeof h?(this.coordCache[t="custom:"+n+","+e]||(r=h(n,e),Array.isArray(r)&&2===r.length?this.coordCache[t]=[r[0],r[1]]:this.coordCache[t]="object"==typeof r?[r.lng,r.lat]:[n,e]),r=this.coordCache[t],this.gridCache[i]={lng:r[0],lat:r[1]}):this.gridCache[i]={lng:n,lat:e}))},createTileKey:function(t,e,n){return t instanceof Object?t.z+"/"+t.x+"/"+t.y:n+"/"+t+"/"+e},createTile:function(t,n){var i,s,a,h,p,g=this,d=Array.isArray(e)?(_=e.length,v=e[S],_<=++S&&(S=0),u&&"function"==typeof u?u(v,n):v.replace("{z}",n.z).replace("{x}",n.x).replace("{y}",n.y)):u&&"function"==typeof u?u(e,n):e.replace("{z}",n.z).replace("{x}",n.x).replace("{y}",n.y),m={xyz:n,timestamp:Date.now(),abortController:new AbortController},_=this.gridCache[this.createTileKey(n)],v=this.gridCache[this.createTileKey(n.x+1,n.y,n.z)],x=this.gridCache[this.createTileKey(n.x,n.y+1,n.z)];return n=this.gridCache[this.createTileKey(n.x+1,n.y+1,n.z)],x&&v&&x&&n&&(x=this.getBufferData(x,n,v,_),i=_.lat,s=_.lng,v=n.lat,_=n.lng,a=(_-s)/256,h=(i-v)/256,p=!!y&&this.getAllIn(s,v,_,i),m.aPos=t.getAttribLocation(this.program,"a_pos"),m.aUv=t.getAttribLocation(this.program,"a_uv"),m.uSamplerLoc=t.getUniformLocation(this.program,"u_sampler"),m.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,m.texture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array([0,0,0,0])),fetch(d,o({signal:m.abortController.signal,mode:"cors"},N)).then((function(t){if(t.ok)return t.blob();throw new Error("Network response was not ok")})).then((function(t){return createImageBitmap(t)})).then((function(e){L.width=e.width,L.height=e.height;var n=L.getContext("2d"),o=(n.imageSmoothingEnabled=!0,n.imageSmoothingQuality="high",n.drawImage(e,0,0),c&&"function"==typeof c);if((l||o)&&(!p||o)){for(var u,d,y,_=n.getImageData(0,0,L.width,L.height),v=_.data.length,x=0;x<v;x+=4)p||(u=(y=Math.floor(x/4))%256,y=Math.floor(y/256),d=r([u=s+u*a,y=i-y*h]),f&&"function"==typeof f&&(d=null==(u=f(u,y))||u),_.data[x+3]=d?255:0),o&&(y=c([_.data[x],_.data[x+1],_.data[x+2],_.data[x+3]]),Array.isArray(y))&&4===y.length&&(_.data[x]=y[0],_.data[x+1]=y[1],_.data[x+2]=y[2],_.data[x+3]=y[3]);n.putImageData(_,0,0)}t.bindTexture(t.TEXTURE_2D,m.texture),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,!0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,L),t.generateMipmap(t.TEXTURE_2D),m.isLoad=!0,g.map.triggerRepaint()})).catch((function(t){"AbortError"!==t.name&&(console.warn("Failed to load image:",t),m.isLoad=!0,g.map.triggerRepaint())})),m.buffer=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,m.buffer),t.bufferData(t.ARRAY_BUFFER,x,t.STATIC_DRAW)),m},getBufferData:function(t,e,n,r){var i=this.map.queryTerrainElevation&&this.map.queryTerrainElevation(new mapboxgl.LngLat(t.lng,t.lat))||0,o=this.map.queryTerrainElevation&&this.map.queryTerrainElevation(new mapboxgl.LngLat(e.lng,e.lat))||0,s=this.map.queryTerrainElevation&&this.map.queryTerrainElevation(new mapboxgl.LngLat(n.lng,n.lat))||0,a=this.map.queryTerrainElevation&&this.map.queryTerrainElevation(new mapboxgl.LngLat(r.lng,r.lat))||0;return t=mapboxgl.MercatorCoordinate.fromLngLat(t,i),i=mapboxgl.MercatorCoordinate.fromLngLat(e,o),e=mapboxgl.MercatorCoordinate.fromLngLat(n,s),o=mapboxgl.MercatorCoordinate.fromLngLat(r,a),new Float32Array([t.x,t.y,t.z,0,0,i.x,i.y,i.z,1,0,e.x,e.y,e.z,1,1,t.x,t.y,t.z,0,0,e.x,e.y,e.z,1,1,o.x,o.y,o.z,0,1])},getAllIn:function(t,e,n,i){var o;return p&&"function"==typeof p?null==(o=p(t,e,n,i))||o:[[t,i],[t,e],[n,e],[n,i],[(t+n)/2,i],[n,(e+i)/2],[(t+n)/2,e],[t,(e+i)/2],[(t+n)/2,(e+i)/2]].every(r)},render:function(t,e){t.useProgram(this.program),t.uniformMatrix4fv(t.getUniformLocation(this.program,"u_matrix"),!1,e);for(var n=Dt(this.showTiles);!(i=n()).done;){var r,i=i.value;i.isLoad&&i.texture&&(t.bindTexture(t.TEXTURE_2D,i.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),r=["NEAREST","LINEAR"].includes(E)?t[E]:t.NEAREST,t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,r),t.bindBuffer(t.ARRAY_BUFFER,i.buffer),t.enableVertexAttribArray(i.aPos),t.enableVertexAttribArray(i.aUv),t.vertexAttribPointer(i.aPos,3,t.FLOAT,!1,20,0),t.vertexAttribPointer(i.aUv,2,t.FLOAT,!1,20,12),t.enable(t.BLEND),t.blendFunc(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA),t.blendEquation(t.FUNC_ADD),t.drawArrays(t.TRIANGLES,0,6))}},onRemove:function(t,e){if(this.map.off("move",this.updateLayer),this.showTiles)for(var n=Dt(this.showTiles);!(r=n()).done;){var r=r.value;r.texture&&e.deleteTexture(r.texture),r.buffer&&e.deleteBuffer(r.buffer)}if(this.tileCache={},this.gridCache={},this.coordCache={},this.showTiles=[],this.program){for(var i=Dt(e.getAttachedShaders(this.program));!(o=i()).done;){var o=o.value;e.detachShader(this.program,o),e.deleteShader(o)}e.deleteProgram(this.program),this.program=null}L&&(L.width=0,L.height=0,L=null)}}}(n,e,o({},this.options,{bbox:i,isGCJ:null!=(n=this.options.isGCJ)&&n,json:t})),r))},e.destroy=function(){this.map.getLayer(this.id)&&this.map.removeLayer(this.id),this.map.getSource(this.id)&&this.map.removeSource(this.id)},e.visible=function(t){this.id&&this.map.getLayer(this.id)&&this.map.setLayoutProperty(this.id,"visibility",t?"visible":"none")},t}();function Gt(t){return(Gt="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 Bt(t){return t=function(t,e){if("object"!==Gt(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0===n)return String(t);if("object"!==Gt(n=n.call(t,"string")))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(t),"symbol"===Gt(t)?t:String(t)}function Ut(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,Bt(r.key),r)}}function qt(t,e,n){e&&Ut(t.prototype,e),n&&Ut(t,n),Object.defineProperty(t,"prototype",{writable:!1})}var zt=function(){function t(t,e){this.map=t,this._contextMenu=null,this._moveMenu=null,this._context=null,e=(t=(this._position=null)!=e?e:{}).move,t=void 0===(t=t.className)?"mapMenu":t,this._move=void 0!==e&&e,this._className=t}var e=t.prototype;return e.init=function(t,e){var n,r=this;this.map&&!this._context&&((n=document.createElement("div")).className=this._className,n.style.display="none",n.style.position="absolute",this.map.getCanvas().offsetParent.appendChild(n),t instanceof Element?n.appendChild(t):"string"==typeof t&&(n.innerHTML=t),this._context=n,this._contextMenu=function(t){var n;r._position=t.lngLat,e&&"function"==typeof e?(n=r.map.queryRenderedFeatures(t.point),"boolean"==typeof(n=void 0===(n=(null!=(n=e(o({},t,{features:n})))?n:{}).show)||n)&&(r.visible(n),r.updateXY(t.point))):(r.visible(!0),r.updateXY(t.point))},this.map.on("contextmenu",this._contextMenu),this._move)&&(this._moveMenu=function(t){var e;r._context&&"none"!==r._context.style.display&&r._position&&(e=r.map.project([r._position.lng,r._position.lat]),r.updateXY(e))},this.map.on("move",this._moveMenu),window.addEventListener("resize",this._moveMenu))},e.visible=function(t){this._context&&(this._context.style.display=t?"block":"none")},e.updateXY=function(t){var e,n,r,i,o;this._context&&t&&(e=isNaN(Number(t.x))?0:Number(t.x),t=isNaN(Number(t.y))?0:Number(t.y),this._move||(n=(r=this._context).offsetWidth,r=r.offsetHeight,(o=(i=this.map.getCanvas()).offsetWidth)<e+n&&(e=o-n),(o=i.offsetHeight)<t+r&&(t=o-r)),this._context.style.top=t+"px",this._context.style.left=e+"px")},e.destroy=function(){this.map&&(this.map.off("contextmenu",this._contextMenu),this._contextMenu=null,this._context&&(this._context.remove(),this._context=null),this._move)&&(this.map.off("move",this._moveMenu),window.removeEventListener("resize",this._moveMenu),this._moveMenu=null)},qt(t,[{key:"show",get:function(){var t;return null!=(t=this._context&&"none"!==this._context.style.display)&&t}}]),t}();const jt=function(t,e,n){void 0===n&&(n={}),t=it(t);var r=X((e=it(e))[1]-t[1]),i=X(e[0]-t[0]);return t=X(t[1]),e=X(e[1]),r=Math.pow(Math.sin(r/2),2)+Math.pow(Math.sin(i/2),2)*Math.cos(t)*Math.cos(e),z(2*Math.atan2(Math.sqrt(r),Math.sqrt(1-r)),n.units)};function Vt(t,e){return void 0===e&&(e={}),r=0,n=function(t,n){return n=n.geometry.coordinates,t+jt(n[0],n[1],e)},Q(t,(function(t,e,i,o,s){r=n(r,t)})),r;var n,r}function Xt(t,e,n){var r,i;return!0===(n=void 0===n?{}:n).final?(Xt(e,t)+180)%360:(n=it(t),t=it(e),e=X(n[0]),r=X(t[0]),n=X(n[1]),t=X(t[1]),i=Math.sin(r-e)*Math.cos(t),n=Math.cos(n)*Math.sin(t)-Math.sin(n)*Math.cos(t)*Math.cos(r-e),V(Math.atan2(i,n)))}const Yt=function(t,e){return ut(t,jt(t,e)/2,Xt(t,e))};var Ht=6378137;function Wt(t){var e=0;if(t&&0<t.length){e+=Math.abs(Jt(t[0]));for(var n=1;n<t.length;n++)e-=Math.abs(Jt(t[n]))}return e}function Jt(t){var e,n,r,i,o,s,a=0,u=t.length;if(2<u){for(s=0;s<u;s++)o=s===u-2?(r=u-2,i=u-1,0):s===u-1?(r=u-1,i=0,1):(i=(r=s)+1,s+2),e=t[r],n=t[i],a+=(Kt(t[o][0])-Kt(e[0]))*Math.sin(Kt(n[1]));a=a*Ht*Ht/2}return a}function Kt(t){return t*Math.PI/180}const Zt=function(t,e){void 0===e&&(e={});var n=0,r=0,i=0;return J(t,(function(t){n+=t[0],r+=t[1],i++}),!0),k([n/i,r/i],e.properties)};function $t(t){return(t%=360)<0&&(t+=360),t}function Qt(t){return(t%=360)<0&&(t+=360),t}const te=function(t,e,n,r,i){if(!W(i=i||{}))throw new Error("options is invalid");var o,s,a=i.properties;if(!t)throw new Error("center is required");if(null==n)throw new Error("bearing1 is required");if(null==r)throw new Error("bearing2 is required");if(!e)throw new Error("radius is required");if("object"!=typeof i)throw new Error("options must be an object");return Qt(n)===Qt(r)?lt(t,e,i):(o=ot(t),t=function(t,e,n,r,i){var o=(i=void 0===i?{}:i).steps||64,s=(n=$t(n),r=$t(r),Array.isArray(t)||"Feature"!==t.type?{}:t.properties);if(n===r)return B(lt(t,e,i).geometry.coordinates[0],s);for(var a=n,u=n<r?r:r+360,l=a,c=[],h=0;l<u;)c.push(ut(t,e,l,i).geometry.coordinates),l=a+360*++h/o;return u<l&&c.push(ut(t,e,u,i).geometry.coordinates),B(c,s)}(t,e,n,r,i),s=[[o]],J(t,(function(t){s[0].push(t)})),s[0].push(o),G(s,a))};var ee="zh_measure_",ne=function(){function t(t,e,n){var r=this,i=(this._click=function(t){var e,n=t.originalEvent.target.ariaLabel;r.isOpen&&"measure"!==n&&(r.isDraw||(r.isDraw=!0,r.positions.push(r.currentPosition),r.texts.push(r.currentText)),e=t.lngLat.toArray(),n=function(){r.currentPosition.push(e),r._drawPoint(),r._drawLine(),r._measureDistance(e)},0<r.currentPosition.length?"line"===r.type||"polygon"===r.type?(t=r.currentPosition[r.currentPosition.length-1],e[0]!==t[0]||e[1]!==t[1]?n():"polygon"===r.type?2<r.currentPosition.length?(r._createTextRemove(r.index),t=[].concat(r.currentPosition,[r.currentPosition[0]]),r._updateLine(t,r.index),t=Zt(G([t])),r._measureArea(t.geometry.coordinates),r._callback()):1===r.currentPosition.length&&(r._removeMarker(r.index),r._removePoint(r.index),r._removeLine(r.index),r._callback()):(r._createTextRemove(r.index),1===r.currentPosition.length&&(r._removeMarker(r.index),r._removePoint(r.index),r._removeLine(r.index)),r._callback())):"sector"===r.type&&(t=r.currentPosition[r.currentPosition.length-1],e[0]===t[0]&&e[1]===t[1]||1!==r.currentPosition.length||n()):n())},this._move=function(t){r.isOpen&&(t=t.lngLat.toArray(),r.isDraw&&0<r.currentPosition.length&&("line"===r.type?r._drawMoveLine(t):"circle"===r.type?(r._drawCircle(t),r._drawMoveLine(t)):"polygon"===r.type?(1<r.currentPosition.length&&r._drawPolygon(t),r._drawMoveLine(t)):"rect"===r.type?(r._drawRect(t),r._drawMoveLine(t)):"sector"===r.type&&(1<r.currentPosition.length?r._drawSector(t):r._drawMoveLine(t))),r._drawMovePoint(t))},this._dblclick=function(t){if(r.isOpen&&r.isDraw&&("circle"===r.type&&(e=t.lngLat.toArray(),!(n=r.currentPosition[0])||n[0]===e[0]&&n[1]===e[1]?(r._removeMarker(r.index),r._removePoint(r.index),r._removeLine(r.index),r._removeCircle(r.index)):(r.currentPosition.push(e),r._drawPoint(),r._drawCircle(e,!1),r._drawLine(),n=Yt(k(e),k(r.currentPosition[0])),r._measureDistance(e),r._measureArea(n.geometry.coordinates),r._createTextRemove(r.index),r._callback())),!("polygon"===r.type&&0<r.currentPosition.length&&r.currentPosition.length<3))){if("rect"===r.type&&(e=t.lngLat.toArray(),!(n=r.currentPosition[0])||n[0]===e[0]&&n[1]===e[1]?(r._removeMarker(r.index),r._removePoint(r.index),r._removeLine(r.index),r._removeRect(r.index)):(r.currentPosition.push(e),r._drawPoint(),r._drawRect(e,!1),n=Yt(k(e),k(r.currentPosition[0])),r._measureDistance(e),r._measureArea(n.geometry.coordinates),r._createTextRemove(r.index),r._callback())),"sector"===r.type){var e=t.lngLat.toArray(),n=r.currentPosition[r.currentPosition.length-1];if(2!==r.currentPosition.length||e[0]===n[0]&&e[1]===n[1]){if(1!==r.currentPosition.length)return;r._removeMarker(r.index),r._removePoint(r.index),r._removeLine(r.index),r._removeSector(r.index)}else r._drawSector(e,!1),t=Zt(r.map.getSource(r.moveSectorName)._data),r._measureArea(t.geometry.coordinates),r._createTextRemove(r.index),r._callback()}null!=(n=r.moveLineLayers[r.index])&&n.destroy(),r.moveLineLayers.splice(r.index,1),r._removeMoveMarker(),r.isDraw=!1,r.currentPosition=[],r.currentText=[],r.index++}},this.map=t,t=null!=(t=(e=null!=(t=e)?t:{}).point)?t:{},null!=(i=e.pointMove)?i:{}),o=null!=(o=e.fixed)?o:[2,2],s=(this.calcAll=null==(u=e.calcAll)||u,"number"==typeof o?this.fixed=[o,o]:Array.isArray(o)&&o.every((function(t){return"number"==typeof t}))?this.fixed=o:this.fixed=[2,2],this.dash=null==(u=e.dash)||u,this.type=null!=(o=e.type)?o:"line",["line","circle","polygon","rect","sector"].includes(this.type)||(this.type="line"),this.units={line:["km","m"],circle:["km²","m²"],polygon:["km²","m²"],rect:["km²","m²"],sector:["km²","m²"]},e.units);if(s)for(var a in this.units)s[a]&&Array.isArray(s[a])&&s[a].every((function(t){return"string"==typeof t}))&&(this.units[a][0]=s[a][0],this.units[a][1]=s[a][1]);this.className=null!=(u=e.className)?u:"",this.pointMoveProps={color:null!=(o=i.color)?o:"#ffffff",radius:null!=(u=i.radius)?u:10,opacity:null!=(o=i.opacity)?o:.01,strokeWidth:null!=(u=i.strokeWidth)?u:2,strokeColor:null!=(o=i.strokeColor)?o:"#ffffff",strokeOpacity:null!=(u=i.strokeOpacity)?u:.01},this.pointProps={color:null!=(o=t.color)?o:"rgb(255,255,255)",radius:null!=(i=t.radius)?i:4,strokeWidth:null!=(u=t.strokeWidth)?u:2,strokeColor:null!=(o=t.strokeColor)?o:"#00ccff"};var u=null!=(i=e.line)?i:{};this.lineProps={color:null!=(t=u.color)?t:"#00ccff",width:null!=(o=u.width)?o:2,dasharray:null!=(i=u.dasharray)?i:[5,5]},o=null!=(t=e.fill)?t:{},this.fillProps={color:null!=(u=o.color)?u:"rgba(0,230,255,0.1)"},this._custom=n,this.isOpen=!1,this.moveMarker=null,this._init()}var e=t.prototype;return e._init=function(){var t;this.positions=[],this.currentPosition=[],this.index=null!=(t=null==(t=this.map[this._custom])||null==(t=t.measure)?void 0:t[this.type])?t:0,this.isDraw=!1,this.pointLayers=[],this.movepointLayers=[],this.lineLayers=[],this.moveLineLayers=[],this.moveCircleLayers=[],this.movePolygonLayers=[],this.moveRectLayers=[],this.moveSectorLayers=[],this.texts=[],this.currentText=[]},e.draw=function(t){t&&"function"==typeof t&&(this.callback=t),this.isOpen||(this.isOpen=!0,this.map.on("click",this._click),this.map.on("mousemove",this._move),this.map.on("dblclick",this._dblclick))},e._callback=function(){this.callback&&"function"==typeof this.callback&&this.callback()},e._drawPoint=function(){var t,e=this,n=U(this.currentPosition.map((function(t,n){return k(t,{pointIndex:n,lineIndex:e.index})})));this.pointLayer?this.map.getSource(this.pointName).setData(n):((t=this.map.MapCustom()).draw(n,this.pointName,{layerConfig:{type:"circle",paint:{"circle-color":this.pointProps.color,"circle-radius":this.pointProps.radius,"circle-stroke-width":this.pointProps.strokeWidth,"circle-stroke-color":this.pointProps.strokeColor}}}),this.pointLayers.push(t))},e._drawMovePoint=function(t){var e;t={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:t},properties:{pointIndex:0,lineIndex:this.index}}]},this.movePointLayer?this.map.getSource(this.movePointName).setData(t):((e=this.map.MapCustom()).draw(t,this.movePointName,{layerConfig:{type:"circle",paint:{"circle-opacity":this.pointMoveProps.opacity,"circle-color":this.pointMoveProps.color,"circle-radius":this.pointMoveProps.radius,"circle-stroke-width":this.pointMoveProps.strokeWidth,"circle-stroke-color":this.pointMoveProps.strokeColor,"circle-stroke-opacity":this.pointMoveProps.strokeOpacity}}}),this.movepointLayers.push(e))},e._drawLine=function(){var t,e=U([B(1<this.currentPosition.length?this.currentPosition:[this.currentPosition[0],this.currentPosition[0]],{lineIndex:this.index})]);this.lineLayer?(this.map.getSource(this.lineName).setData(e),this.map.moveLayer(this.lineName,this.pointName)):((t=this.map.MapLine()).draw(e,this.lineName,{layerConfig:{paint:{"line-color":this.lineProps.color,"line-width":this.lineProps.width}},beforeId:this.pointName}),this.lineLayers.push(t))},e._drawMoveLine=function(t){var e=U([B([this.currentPosition[this.currentPosition.length-1],t],{lineIndex:this.index})]),n=("polygon"===this.type&&1<this.currentPosition.length&&(e=U([B([this.currentPosition[0],t,this.currentPosition[this.currentPosition.length-1]],{lineIndex:this.index})])),this.moveLineLayer?this.map.getSource(this.moveLineName).setData(e):((n=this.map.MapLine()).draw(e,this.moveLineName,{layerConfig:{paint:{"line-color":this.lineProps.color,"line-width":this.lineProps.width,"line-dasharray":this.dash?this.lineProps.dasharray:[]}},beforeId:this.pointName}),this.moveLineLayers.push(n)),U([B([].concat(this.currentPosition,[t]))]));this._drawMoveMarker(this.calcAll?n:e,t)},e._drawMoveMarker=function(t,e){t=this._calcLength(t),this.moveMarker?(this.moveMarker.getElement().children[0].innerHTML=t,this.moveMarker.setLngLat(e)):(this.moveMarker=this._createMoveText(t),this.moveMarker.setLngLat(e).addTo(this.map))},e._removeMoveMarker=function(){this.moveMarker&&(this.moveMarker.remove(),this.moveMarker=null)},e._drawCircle=function(t,e){void 0===e&&(e=!0);var n,r=this.currentPosition[0],i=U([k(r,{circleIndex:this.index})]);t=Vt(U([B([r,t],{circleIndex:this.index})]),{units:"kilometers"}),this.moveCircleLayer?(n={steps:64,units:"kilometers",properties:{circleIndex:this.index}},r=U([lt(r,t,n)]),this.map.getSource(this.moveCircleName).setData(r),e||this.map.setPaintProperty(this.moveCircleLayer.lineName,"line-dasharray",[])):((n=this.map.MapCircle()).draw(i,this.moveCircleName,{endRadius:t,layerConfig:{paint:{"fill-color":this.fillProps.color}},lineConfig:{paint:{"line-color":this.lineProps.color,"line-width":this.lineProps.width,"line-dasharray":this.dash?this.lineProps.dasharray:[]}},beforeId:this.pointName}),this.moveCircleLayers.push(n))},e._drawPolygon=function(t){var e;t=U([G([[].concat(this.currentPosition,[t,this.currentPosition[0]])],{polygonIndex:this.index})]),this.movePolygonLayer?this.map.getSource(this.movePolygonName).setData(t):((e=this.map.MapMoreCustom()).draw(t,{sourceConfig:{id:this.movePolygonName,type:"geojson",data:t},layerConfig:[{id:this.movePolygonName,type:"fill",paint:{"fill-color":this.fillProps.color},beforeId:this.moveLineName}]}),this.movePolygonLayers.push(e))},e._drawRect=function(t,e){void 0===e&&(e=!0),t=U([nt(et(B([this.currentPosition[0],t])),{properties:{rectIndex:this.index}})]),this.moveRectLayer?(this.map.getSource(this.moveRectName).setData(t),e||this.map.setPaintProperty(this.moveRectName+"-line","line-dasharray",[])):((e=this.map.MapMoreCustom()).draw(t,{sourceConfig:{id:this.moveRectName,type:"geojson",data:t},layerConfig:[{id:this.moveRectName,type:"fill",paint:{"fill-color":this.fillProps.color},beforeId:this.pointName},{id:this.moveRectName+"-line",type:"line",paint:{"line-color":this.lineProps.color,"line-width":this.lineProps.width,"line-dasharray":this.dash?this.lineProps.dasharray:[]},beforeId:this.pointName}]}),this.moveRectLayers.push(e))},e._drawSector=function(t,e){void 0===e&&(e=!0);var n=Vt(B(this.currentPosition,{units:"kilometers"})),r=Xt(this.currentPosition[0],this.currentPosition[1]);t=Xt(this.currentPosition[0],t),n=U([te(this.currentPosition[0],n,r,t,{units:"kilometers",properties:{sectorIndex:this.index}})]),this.moveSectorLayer?(this.map.getSource(this.moveSectorName).setData(n),e||this.map.setPaintProperty(this.moveSectorName+"-line","line-dasharray",[])):((r=this.map.MapMoreCustom()).draw(n,{sourceConfig:{id:this.moveSectorName,type:"geojson",data:n},layerConfig:[{id:this.moveSectorName,type:"fill",paint:{"fill-color":this.fillProps.color},beforeId:this.pointName},{id:this.moveSectorName+"-line",type:"line",paint:{"line-color":this.lineProps.color,"line-width":this.lineProps.width,"line-dasharray":this.dash?this.lineProps.dasharray:[]},beforeId:this.pointName}]}),this.moveSectorLayers.push(r))},e._removeRect=function(t){var e=this.moveRectLayers[t];e&&(e.destroy(),this.moveRectLayers[t]=null)},e._removeSector=function(t){var e=this.moveSectorLayers[t];e&&(e.destroy(),this.moveSectorLayers[t]=null)},e._createText=function(t,e,n){var r,i=this,o=(void 0===t&&(t="起点"),void 0===n&&(n=!0),document.createElement("div"));return((o.style.background="#ffffff",o.style.cursor="default",o.style.padding="0 5px",o.style.borderRadius="3px",o.style.display="flex",o.style.alignItems="center",o.className=this.className?this.className+" measure-box":"measure-box",o.ariaLabel="measure",r=document.createElement("span")).className="measure-text",r.innerHTML=t,r.ariaLabel="measure",o.appendChild(r),n&&((t=document.createElement("span")).className="measure-close",t.style.paddingLeft="5px",t.innerHTML="x",t.ariaLabel="measure",t.addEventListener("click",(function(t){i.isDraw||(t=t.target.parentNode._marker)&&i._removeGroup(t)})),o.appendChild(t)),r=new mapboxgl.Marker({element:o,offset:[10,0],anchor:"left"})).pointIndex=e,r.lineIndex=this.index,r.showBtn=n,this.currentText.push(r),o._marker=r},e._createMoveText=function(t){var e=document.createElement("div"),n=(e.style.background="#ffffff",e.style.cursor="default",e.style.padding="0 5px",e.style.borderRadius="3px",e.style.display="flex",e.style.alignItems="center",e.className=this.className?this.className+" measure-box":"measure-box",e.ariaLabel="measure",document.createElement("span"));return n.className="measure-text",n.innerHTML=t,n.ariaLabel="measure",e.appendChild(n),new mapboxgl.Marker({element:e,offset:[10,0],anchor:"left"})},e._createTextRemove=function(t){for(var e=this,n=document.createElement("div"),r=(n.className="measure-remove",n.style.width="15px",n.style.height="14px",n.style.marginLeft="5px",n.ariaLabel="measure",n.style.backgroundImage='url(\'data:image/svg+xml;utf8,%3Csvg xmlns="http://www.w3.org/2000/svg" width="20" height="20">%3Cpath d="M10,3.4 c-0.8,0-1.5,0.5-1.8,1.2H5l-1,1v1h12v-1l-1-1h-3.2C11.5,3.9,10.8,3.4,10,3.4z M5,8v7c0,1,1,2,2,2h6c1,0,2-1,2-2V8h-2v5.5h-1.5V8h-3 v5.5H7V8H5z"/>%3C/svg>\')',n.style.backgroundSize="100% 100%",n.addEventListener("click",(function(t){e.isDraw||(t=t.target.parentNode._marker)&&e._removeGroupLine(t)})),this.texts[t]),i=null,o=r.length-1;0<=o;o--)if(r[o].showBtn){i=o;break}(null!==i?r[i]:r[r.length-1]).getElement().appendChild(n)},e._measureDistance=function(t){var e="起点",n=(1<this.currentPosition.length&&(n=U([B(this.currentPosition,{lineIndex:this.index})]),e=this._calcLength(n)),this._createText(e,this.currentPosition.length-1,"circle"!==this.type&&"rect"!==this.type&&"sector"!==this.type));return n.setLngLat(t).addTo(this.map),n},e._measureArea=function(t){var e,n,r;["circle","polygon","rect","sector"].includes(this.type)&&(n=null,"circle"===this.type?(r=Vt(U([B(this.currentPosition)]),{units:"kilometers"}),e={steps:64,units:"kilometers",properties:{circleIndex:this.index}},n=lt(this.currentPosition[0],r,e)):"polygon"===this.type?n=G([[].concat(this.currentPosition,[this.currentPosition[0]])]):"rect"===this.type?n=nt(et(B(this.currentPosition)),{properties:{rectIndex:this.index}}):"sector"===this.type&&(n=this.map.getSource(this.moveSectorName)._data.features[0]),null!==n)&&(r=this._calcArea(n),this._createText(r,this.currentPosition.length,!1).setLngLat(t).addTo(this.map))},e._calcLength=function(t){return 1e3<(t=Vt(t,{units:"meters"}))?Number((t/1e3).toFixed(this.fixed[0]))+this.units.line[0]:Number(t.toFixed(this.fixed[1]))+this.units.line[1]},e._calcArea=function(t){return t=function(t){return e=function(t,e){return t+function(t){var e,n=0;switch(t.type){case"Polygon":return Wt(t.coordinates);case"MultiPolygon":for(e=0;e<t.coordinates.length;e++)n+=Wt(t.coordinates[e]);return n;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}(e)},n=0,Z(t,(function(t,r,i,o,s){n=e(n,t)})),n;var e,n}(t),1e6<t?Number((t/1e6).toFixed(this.fixed[0]))+this.units[this.type][0]:Number(t.toFixed(this.fixed[1]))+this.units[this.type][1]},e._removeGroup=function(t){var e,n,r,i=t.lineIndex,o=t.pointIndex;t.remove(),this.texts[i].splice(o,1),this.positions[i].splice(o,1),t=this.positions[i],this._updateLine(t,i),this._updatePoint(t,i),this._updateText(t,i),"polygon"===this.type?(this._updatePolygon(t,i),r=[].concat(t,[t[0]]),this._updateLine(r,i),t.length<3?(this._removeMarker(i),this._removePoint(i),this._removeLine(i)):t.length===o&&this._createTextRemove(i),2<t.length&&(r=G([r]),e=Zt(r),0<(n=this.texts[i]).length)&&(n=n[n.length-1],r=this._calcArea(r),this._updateMarkerText(n,r),n.setLngLat(e.geometry.coordinates).addTo(this.map))):"line"===this.type&&(t.length<2?this._removeMarker(i):t.length===o&&this._createTextRemove(i))},e._removeGroupLine=function(t){t=t.lineIndex,this._removeMarker(t),this._removePoint(t),this._removeLine(t),"circle"===this.type?this._removeCircle(t):"polygon"===this.type?this._removePolygon(t):"rect"===this.type?this._removeRect(t):"sector"===this.type&&this._removeSector(t)},e._removeMarker=function(t){this.texts[t].forEach((function(t){t.remove()})),this.texts[t]=[]},e._updateLine=function(t,e){var n=ee+"_"+this.type+"_"+e+"_line";t.length<2?this._removeLine(e):(t=U([B(t,{lineIndex:e})]),this.map.getSource(n).setData(t))},e._updatePolygon=function(t,e){var n=ee+"_"+this.type+"_"+e+"_polygon_move";t.length<3?this._removePolygon(e):(e=U([G([[].concat(t,[t[0]])])]),this.map.getSource(n).setData(e))},e._removePolygon=function(t){var e=this.movePolygonLayers[t];e&&(e.destroy(),this.movePolygonLayers[t]=null)},e._removeLine=function(t){var e=this.lineLayers[t];e&&(e.destroy(),this.lineLayers[t]=null),this.currentPosition=[]},e._removeCircle=function(t){var e=this.moveCircleLayers[t];e&&(e.destroy(),this.moveCircleLayers[t]=null)},e._updatePoint=function(t,e){var n=ee+"_"+this.type+"_"+e+"_point";t.length<2?this._removePoint(e):(t=U(t.map((function(t,n){return k(t,{pointIndex:n,lineIndex:e})}))),this.map.getSource(n).setData(t))},e._removePoint=function(t){var e=this.pointLayers[t];e&&(e.destroy(),this.pointLayers[t]=null)},e._updateText=function(t,e){var n=this,r=this.texts[e];t.forEach((function(e,i){var o,s="起点";0!==i&&(o=U([B(t.slice(0,i+1))]),s=n._calcLength(o)),r[i]&&(r[i].pointIndex=i,n._updateMarkerText(r[i],s))}))},e._updateMarkerText=function(t,e){t.getElement().children[0].innerHTML=e},e.off=function(){this.isDraw||(this.map.off("click",this._click),this.map.off("mousemove",this._move),this.map.off("dblclick",this._dblclick))},e.remove=function(){this.isDraw||(this.pointLayers.forEach((function(t){null!=t&&t.destroy()})),this.movepointLayers.forEach((function(t){null!=t&&t.destroy()})),this.lineLayers.forEach((function(t){null!=t&&t.destroy()})),this.moveLineLayers.forEach((function(t){null!=t&&t.destroy()})),this.texts.forEach((function(t){null!=t&&t.forEach((function(t){t.remove()}))})),this.moveCircleLayers.forEach((function(t){null!=t&&t.destroy()})),this.movePolygonLayers.forEach((function(t){null!=t&&t.destroy()})),this.moveRectLayers.forEach((function(t){null!=t&&t.destroy()})),this.moveSectorLayers.forEach((function(t){null!=t&&t.destroy()})),this._removeMoveMarker(),this._init())},e.visible=function(t){"boolean"!=typeof t||this.isDraw||(this.pointLayers.forEach((function(e){null!=e&&e.visible(t)})),this.movepointLayers.forEach((function(e){null!=e&&e.visible(t)})),this.lineLayers.forEach((function(e){null!=e&&e.visible(t)})),this.moveLineLayers.forEach((function(e){null!=e&&e.visible(t)})),this.texts.forEach((function(e){null!=e&&e.forEach((function(e){e.getElement().style.display=t?"flex":"none"}))})),this.moveCircleLayers.forEach((function(e){null!=e&&e.visible(t)})),this.movePolygonLayers.forEach((function(e){null!=e&&e.visible(t)})),this.moveRectLayers.forEach((function(e){null!=e&&e.visible(t)})),this.moveSectorLayers.forEach((function(e){null!=e&&e.visible(t)})))},e.destroy=function(){this.isOpen=!1,this.isDraw=!1,this.remove(),this.off()},qt(t,[{key:"pointName",get:function(){return ee+"_"+this.type+"_"+this.index+"_point"}},{key:"movePointName",get:function(){return ee+"_"+this.type+"_"+this.index+"_point_move"}},{key:"lineName",get:function(){return ee+"_"+this.type+"_"+this.index+"_line"}},{key:"moveLineName",get:function(){return ee+"_"+this.type+"_"+this.index+"_line_move"}},{key:"moveCircleName",get:function(){return ee+"_"+this.type+"_"+this.index+"_circle_move"}},{key:"movePolygonName",get:function(){return ee+"_"+this.type+"_"+this.index+"_polygon_move"}},{key:"moveRectName",get:function(){return ee+"_"+this.type+"_"+this.index+"_rect_move"}},{key:"moveSectorName",get:function(){return ee+"_"+this.type+"_"+this.index+"_sector_move"}},{key:"pointLayer",get:function(){return this.pointLayers[this.index]}},{key:"movePointLayer",get:function(){return this.movepointLayers[this.index]}},{key:"lineLayer",get:function(){return this.lineLayers[this.index]}},{key:"moveLineLayer",get:function(){return this.moveLineLayers[this.index]}},{key:"moveCircleLayer",get:function(){return this.moveCircleLayers[this.index]}},{key:"movePolygonLayer",get:function(){return this.movePolygonLayers[this.index]}},{key:"moveRectLayer",get:function(){return this.moveRectLayers[this.index]}},{key:"moveSectorLayer",get:function(){return this.moveSectorLayers[this.index]}}]),t}(),re=["id"],ie=["id","type","beforeId","source-layer"],oe=function(){function t(t,e){void 0===e&&(e={}),this.map=t,this.sourceName=[],this.layerName=[],this.type="symbol",this.custom=null!=(e=null==(t=e)?void 0:t.custom)&&e,this.isInit=!1,this.callback=null,this.mapEvent=null}var e=t.prototype;return e.draw=function(t,e,n){if(t&&this.map)return this.callback=n,"vector"===t.type?(this.type=null!=(n=e.type)?n:"symbol",this._addSourceLayer(t,e),{source:this.sourceName,layer:this.layerName}):void 0},e.destroy=function(){this._clearSource(),this.mapEvent&&this.map.off("render",this.mapEvent)},e.visible=function(t){var e,n=this;"boolean"==typeof t&&null!=(e=this.layerName)&&e.filter((function(t){return!t.includes("__copy")})).forEach((function(e){n.map.getLayer(e)&&n.map.setLayoutProperty(e,"visibility",t?"visible":"none")}))},e._addSourceLayer=function(t,e){var n,r,s=this,a=(this.sourceName=[],this.layerName=[],r=null!=(r=e.sourceConfig)?r:{}).id,u=i(r,re),c=a,h=(this.map.addSource(c,o({},t,u)),this.sourceName.push(c),(r=e.beforeId||null)&&this.map.getLayer(r),a=l(e.layerConfig),[]);Array.isArray(a)?h=a:"object"==typeof a&&h.push(a),0<h.length&&(t=h[0],r={id:c+"__copy",type:"circle",source:c,"source-layer":t["source-layer"],paint:{"circle-radius":1,"circle-opacity":0},interactive:!1},this.map.addLayer(r),this.layerName.push(c+"__copy"),n={sourceLayer:t["source-layer"]},this.mapEvent=function(t){var e,r=s.map.getSource(c);r&&r.loaded()&&s.map.isSourceLoaded(c)&&(r={type:"FeatureCollection",features:s.map.querySourceFeatures(c,n)},s.custom?s.callback&&"function"==typeof s.callback&&s.callback(r):(e=c+"__geojson",s.isInit?s.map.getSource(e)&&s.map.getSource(e).setData(r):(s.map.addSource(e,o({type:"geojson",data:r},u)),s.sourceName.push(e),h.forEach((function(t){var n=(t=l(t)).id,r=t.type,a=t.beforeId;t["source-layer"],t=i(t,ie),a&&!s.map.getLayer(a)&&(a=null),s.map.addLayer(o({id:n,type:r},t,{source:e}),a),s.layerName.push(n)})),s.isInit=!0)))},this.map.on("render",this.mapEvent))},e._clearSource=function(){var t,e=this;null!=(t=this.layerName)&&t.forEach((function(t){var n;(null==(n=e.map)?void 0:n.getLayer(t))&&e.map.removeLayer(t)})),null!=(t=this.sourceName)&&t.forEach((function(t){var n;(null==(n=e.map)?void 0:n.getSource(t))&&e.map.removeSource(t)}))},t}(),se=function(){function t(t){this.map=t}var e=t.prototype;return e.draw=function(t){var e,n,r,i,o,s,a,u,l;this.options=t,this.layer=(e=(t=this.options).id,n=t.url,r=t.crossOrigin,i=void 0===r?"":r,r=void 0===(r=t.position)?[]:r,t=t.altitude,o=void 0===t?0:t,s=r[0],a=r[1],u=r[2],l=r[3],{id:e,type:"custom",onAdd:function(t,e){var r=this,c=e.createShader(e.VERTEX_SHADER),h=(e.shaderSource(c,"\nuniform mat4 u_matrix;\nattribute vec3 a_pos;\nattribute vec2 a_uv;\nvarying vec2 v_uv;\nvoid main() {\n v_uv = a_uv;\n gl_Position = u_matrix * vec4(a_pos, 1.0);\n}"),e.compileShader(c),e.createShader(e.FRAGMENT_SHADER)),p=(e.shaderSource(h,"\nprecision mediump float;\nvarying vec2 v_uv;\nuniform sampler2D u_sampler;\nvoid main() {\n gl_FragColor = texture2D(u_sampler, v_uv);\n}"),e.compileShader(h),this.program=e.createProgram(),e.attachShader(this.program,c),e.attachShader(this.program,h),e.linkProgram(this.program),this.aPos=e.getAttribLocation(this.program,"a_pos"),this.aUv=e.getAttribLocation(this.program,"a_uv"),this.uSamplerLoc=e.getUniformLocation(this.program,"u_sampler"),c=mapboxgl.MercatorCoordinate.fromLngLat({lng:s,lat:a},o),h=mapboxgl.MercatorCoordinate.fromLngLat({lng:u,lat:a},o),mapboxgl.MercatorCoordinate.fromLngLat({lng:u,lat:l},o)),f=mapboxgl.MercatorCoordinate.fromLngLat({lng:s,lat:l},o),g=new Image;g.crossOrigin=i,g.src=n,this.texture=e.createTexture(),g.onload=function(){e.bindTexture(e.TEXTURE_2D,r.texture),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!0),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,g)},this.buffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,this.buffer),e.bufferData(e.ARRAY_BUFFER,new Float32Array([c.x,c.y,c.z,0,0,h.x,h.y,h.z,1,0,p.x,p.y,p.z,1,1,c.x,c.y,c.z,0,0,p.x,p.y,p.z,1,1,f.x,f.y,f.z,0,1]),e.STATIC_DRAW)},render:function(t,e){t.useProgram(this.program),t.uniformMatrix4fv(t.getUniformLocation(this.program,"u_matrix"),!1,e),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.bindBuffer(t.ARRAY_BUFFER,this.buffer),t.enableVertexAttribArray(this.aPos),t.enableVertexAttribArray(this.aUv),t.vertexAttribPointer(this.aPos,3,t.FLOAT,!1,20,0),t.vertexAttribPointer(this.aUv,2,t.FLOAT,!1,20,12),t.enable(t.BLEND),t.blendFunc(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA),t.drawArrays(t.TRIANGLES,0,6)}}),this.map.addLayer(this.layer)},e.visible=function(t){t?this.map.addLayer(this.layer):this.map.removeLayer(this.options.id)},e.destroy=function(){this.map.getLayer(this.options.id)&&this.map.removeLayer(this.options.id)},t}();function ae(t,e,n={}){var r={type:"Feature"};return 0!==n.id&&!n.id||(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=e||{},r.geometry=t,r}function ue(t){return"Feature"===t.type?t.geometry:t}function le(t,e={}){var n,r=ue(t);switch(e.properties||"Feature"!==t.type||(e.properties=t.properties),r.type){case"Polygon":return[i,n={}]=[r,e],ce(o=(o=ue(i)).coordinates,n=n.properties||("Feature"===i.type?i.properties:{}));case"MultiPolygon":{var[i,o={}]=[r,e];const t=ue(i).coordinates,n=o.properties||("Feature"===i.type?i.properties:{}),s=[];return t.forEach((t=>{s.push(ce(t,n))})),function(t,e={}){var n={type:"FeatureCollection"};return e.id&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.features=t,n}(s)}default:throw new Error("invalid poly")}}function ce(t,e){return 1<t.length?function(t,e,n={}){return ae({type:"MultiLineString",coordinates:t},e,n)}(t,e):function(t,e,n={}){if(t.length<2)throw new Error("coordinates must be an array of two or more positions");return ae({type:"LineString",coordinates:t},e,n)}(t[0],e)}Math.PI;const he=function(t,e){return void 0===e&&(e={}),k([((t=et(t))[0]+t[2])/2,(t[1]+t[3])/2],e.properties,e)};var pe=t(675);function fe(){return new ge}function ge(){this.reset()}ge.prototype={constructor:ge,reset:function(){this.s=this.t=0},add:function(t){ye(de,t,this.t),ye(this,de.s,this.s),this.s?this.t+=de.t:this.s=de.t},valueOf:function(){return this.s}};var de=new ge;function ye(t,e,n){var r=t.s=e+n,i=r-e;t.t=e-(r-i)+(n-i)}var me=1e-6,_e=Math.PI,ve=_e/2,xe=_e/4,Ee=2*_e,be=180/_e,Ie=_e/180,we=Math.abs,Ne=Math.atan,Le=Math.atan2,Se=Math.cos,Ce=(Math.ceil,Math.exp,Math.floor,Math.log,Math.pow,Math.sin),Pe=(Math.sign,Math.sqrt);function Me(t){return 1<t?0:t<-1?_e:Math.acos(t)}function Te(t){return 1<t?ve:t<-1?-ve:Math.asin(t)}function Re(){}function Oe(t,e){t&&De.hasOwnProperty(t.type)&&De[t.type](t,e)}Math.tan;var Ae={Feature:function(t,e){Oe(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)Oe(n[r].geometry,e)}},De={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){Fe(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)Fe(n[r],e,0)},Polygon:function(t,e){ke(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)ke(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)Oe(n[r],e)}};function Fe(t,e,n){var r,i=-1,o=t.length-n;for(e.lineStart();++i<o;)r=t[i],e.point(r[0],r[1],r[2]);e.lineEnd()}function ke(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)Fe(t[n],e,1);e.polygonEnd()}function Ge(t){return[Le(t[1],t[0]),Te(t[2])]}function Be(t){var e=t[0],n=(t=t[1],Se(t));return[n*Se(e),n*Ce(e),Ce(t)]}function Ue(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function qe(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function ze(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function je(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Ve(t){var e=Pe(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function Xe(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,r){return(n=e.invert(n,r))&&t.invert(n[0],n[1])}),n}function Ye(t,e){return[_e<t?t-Ee:t<-_e?t+Ee:t,e]}function He(t,e,n){return(t%=Ee)?e||n?Xe(Je(t),Ke(e,n)):Je(t):e||n?Ke(e,n):Ye}function We(t){return function(e,n){return[_e<(e+=t)?e-Ee:e<-_e?e+Ee:e,n]}}function Je(t){var e=We(t);return e.invert=We(-t),e}function Ke(t,e){var n=Se(t),r=Ce(t),i=Se(e),o=Ce(e);function s(t,e){var s=Se(e),a=Se(t)*s;return t=Ce(t)*s,s=Ce(e),[Le(t*i-(e=s*n+a*r)*o,a*n-s*r),Te(e*i+t*o)]}return s.invert=function(t,e){var s=Se(e),a=Se(t)*s;return t=Ce(t)*s,s=Ce(e),[Le(t*i+s*o,a*n+(e=s*i-t*o)*r),Te(e*n-a*r)]},s}function Ze(t,e){return(e=Be(e))[0]-=t,Ve(e),t=Me(-e[1]),((-e[2]<0?-t:t)+Ee-me)%Ee}function $e(){var t,e=[];return{point:function(e,n){t.push([e,n])},lineStart:function(){e.push(t=[])},lineEnd:Re,rejoin:function(){1<e.length&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Qe(t,e){return we(t[0]-e[0])<me&&we(t[1]-e[1])<me}function tn(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function en(t,e,n,r,i){var o,s,a=[],u=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],s=t[e];if(Qe(r,s)){for(i.lineStart(),o=0;o<e;++o)i.point((r=t[o])[0],r[1]);i.lineEnd()}else a.push(n=new tn(r,t,null,!0)),u.push(n.o=new tn(r,null,n,!1)),a.push(n=new tn(s,t,null,!1)),u.push(n.o=new tn(s,null,n,!0))}})),a.length){for(u.sort(e),nn(a),nn(u),o=0,s=u.length;o<s;++o)u[o].e=n=!n;for(var l,c,h=a[0];;){for(var p=h,f=!0;p.v;)if((p=p.n)===h)return;l=p.z,i.lineStart();do{if(p.v=p.o.v=!0,p.e){if(f)for(o=0,s=l.length;o<s;++o)i.point((c=l[o])[0],c[1]);else r(p.x,p.n.x,1,i);p=p.n}else{if(f)for(l=p.p.z,o=l.length-1;0<=o;--o)i.point((c=l[o])[0],c[1]);else r(p.x,p.p.x,-1,i);p=p.p}}while(l=(p=p.o).z,f=!f,!p.v);i.lineEnd()}}}function nn(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r<e;)i.n=n=t[r],n.p=i,i=n;i.n=n=t[0],n.p=i}}function rn(t,e){return t<e?-1:e<t?1:e<=t?0:NaN}fe(),fe(),fe(),Ye.invert=Ye,1===(s=rn).length&&(on=s,s=function(t,e){return rn(on(t),e)});var on,sn=Array.prototype;function an(t){for(var e,n,r,i=t.length,o=-1,s=0;++o<i;)s+=t[o].length;for(n=new Array(s);0<=--i;)for(e=(r=t[i]).length;0<=--e;)n[--s]=r[e];return n}sn.slice,sn.map,Math.sqrt(50),Math.sqrt(10),Math.sqrt(2);var un=1e9,ln=-un;function cn(t,e,n,r){function i(i,o){return t<=i&&i<=n&&e<=o&&o<=r}function o(i,o,a,l){var c=0,h=0;if(null==i||(c=s(i,a))!==(h=s(o,a))||u(i,o)<0^0<a)for(;l.point(0===c||3===c?t:n,1<c?r:e),(c=(c+a+4)%4)!==h;);else l.point(o[0],o[1])}function s(r,i){return we(r[0]-t)<me?0<i?0:3:we(r[0]-n)<me?0<i?2:1:we(r[1]-e)<me?0<i?1:0:0<i?3:2}function a(t,e){return u(t.x,e.x)}function u(t,e){var n=s(t,1),r=s(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(s){var u,l,c,h,p,f,g,d,y,m,_,v=s,x=$e(),E={point:b,lineStart:function(){E.point=I,l&&l.push(c=[]),m=!0,y=!1,g=d=NaN},lineEnd:function(){u&&(I(h,p),f&&y&&x.rejoin(),u.push(x.result())),E.point=b,y&&v.lineEnd()},polygonStart:function(){v=x,u=[],l=[],_=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=l.length;n<i;++n)for(var o,s,a=l[n],u=1,c=a.length,h=a[0],p=h[0],f=h[1];u<c;++u)o=p,s=f,p=(h=a[u])[0],f=h[1],s<=r?r<f&&(f-s)*(t-o)<(p-o)*(r-s)&&++e:f<=r&&(p-o)*(r-s)<(f-s)*(t-o)&&--e;return e}(),n=_&&e,i=(u=an(u)).length;(n||i)&&(s.polygonStart(),n&&(s.lineStart(),o(null,null,1,s),s.lineEnd()),i&&en(u,a,e,o,s),s.polygonEnd()),v=s,u=l=c=null}};function b(t,e){i(t,e)&&v.point(t,e)}function I(o,s){var a,u,x=i(o,s);l&&c.push([o,s]),m?(h=o,p=s,m=!1,(f=x)&&(v.lineStart(),v.point(o,s))):x&&y?v.point(o,s):function(t,e,n,r,i,o){var s=t[0],a=t[1],u=0,l=1,c=e[0]-s,h=e[1]-a;if(n-=s,c||!(0<n)){if(n/=c,c<0){if(n<u)return;n<l&&(l=n)}else if(0<c){if(l<n)return;u<n&&(u=n)}if(n=i-s,c||!(n<0)){if(n/=c,c<0){if(l<n)return;u<n&&(u=n)}else if(0<c){if(n<u)return;n<l&&(l=n)}if(n=r-a,h||!(0<n)){if(n/=h,h<0){if(n<u)return;n<l&&(l=n)}else if(0<h){if(l<n)return;u<n&&(u=n)}if(n=o-a,h||!(n<0)){if(n/=h,h<0){if(l<n)return;u<n&&(u=n)}else if(0<h){if(n<u)return;n<l&&(l=n)}return 0<u&&(t[0]=s+u*c,t[1]=a+u*h),l<1&&(e[0]=s+l*c,e[1]=a+l*h),1}}}}}(a=[g=Math.max(ln,Math.min(un,g)),d=Math.max(ln,Math.min(un,d))],u=[o=Math.max(ln,Math.min(un,o)),s=Math.max(ln,Math.min(un,s))],t,e,n,r)?(y||(v.lineStart(),v.point(a[0],a[1])),v.point(u[0],u[1]),x||v.lineEnd(),_=!1):x&&(v.lineStart(),v.point(o,s),_=!1),g=o,d=s,y=x}return E}}var hn=fe();fe(),fe(),fe();var pn=1/0,fn=pn,gn=-pn,dn=gn;const yn={point:function(t,e){t<pn&&(pn=t),gn<t&&(gn=t),e<fn&&(fn=e),dn<e&&(dn=e)},lineStart:Re,lineEnd:Re,polygonStart:Re,polygonEnd:Re,result:function(){var t=[[pn,fn],[gn,dn]];return gn=dn=-(fn=pn=1/0),t}};function mn(t,e,n,r){return function(i,o){var s,a,u,l=e(o),c=i.invert(r[0],r[1]),h=$e(),p=e(h),f=!1,g={point:d,lineStart:m,lineEnd:_,polygonStart:function(){g.point=v,g.lineStart=x,g.lineEnd=E,a=[],s=[]},polygonEnd:function(){g.point=d,g.lineStart=m,g.lineEnd=_,a=an(a);var t=function(t,e){var n=e[0],r=e[1],i=[Ce(n),-Se(n),0],o=0,s=0;hn.reset();for(var a=0,u=t.length;a<u;++a)if(c=(l=t[a]).length)for(var l,c,h=l[c-1],p=h[0],f=h[1]/2+xe,g=Ce(f),d=Se(f),y=0;y<c;++y,p=_,g=x,d=v,h=m){var m=l[y],_=m[0],v=m[1]/2+xe,x=Ce(v),E=(v=Se(v),_-p),b=0<=E?1:-1,I=b*E,w=_e<I,N=g*x;hn.add(Le(N*b*Ce(I),d*v+N*Se(I))),o+=w?E+b*Ee:E,w^n<=p^n<=_&&(Ve(N=qe(Be(h),Be(m))),Ve(I=qe(i,N)),(b=(w^0<=E?-1:1)*Te(I[2]))<r||r===b&&(N[0]||N[1]))&&(s+=w^0<=E?1:-1)}return(o<-me||o<me&&hn<-me)^1&s}(s,c);a.length?(f||(o.polygonStart(),f=!0),en(a,vn,t,n,o)):t&&(f||(o.polygonStart(),f=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),f&&(o.polygonEnd(),f=!1),a=s=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function d(e,n){var r=i(e,n);t(e=r[0],n=r[1])&&o.point(e,n)}function y(t,e){t=i(t,e),l.point(t[0],t[1])}function m(){g.point=y,l.lineStart()}function _(){g.point=d,l.lineEnd()}function v(t,e){u.push([t,e]),t=i(t,e),p.point(t[0],t[1])}function x(){p.lineStart(),u=[]}function E(){v(u[0][0],u[0][1]),p.lineEnd();var t,e,n,r,i=p.clean(),l=h.result(),c=l.length;if(u.pop(),s.push(u),u=null,c)if(1&i){if(0<(e=(n=l[0]).length-1)){for(f||(o.polygonStart(),f=!0),o.lineStart(),t=0;t<e;++t)o.point((r=n[t])[0],r[1]);o.lineEnd()}}else 1<c&&2&i&&l.push(l.pop().concat(l.shift())),a.push(l.filter(_n))}return g}}function _n(t){return 1<t.length}function vn(t,e){return((t=t.x)[0]<0?t[1]-ve-me:ve-t[1])-((e=e.x)[0]<0?e[1]-ve-me:ve-e[1])}fe();const xn=mn((function(){return 1}),(function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,s){var a,u,l,c,h,p=0<o?_e:-_e,f=we(o-n);we(f-_e)<me?(t.point(n,r=0<(r+s)/2?ve:-ve),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(p,r),t.point(o,r),e=0):i!==p&&_e<=f&&(we(n-i)<me&&(n-=i*me),we(o-p)<me&&(o-=p*me),f=r,l=s,h=Ce((a=n)-(u=o)),r=we(h)>me?Ne((Ce(f)*(c=Se(l))*Ce(u)-Ce(l)*(u=Se(f))*Ce(a))/(u*c*h)):(f+l)/2,t.point(i,r),t.lineEnd(),t.lineStart(),t.point(p,r),e=0),t.point(n=o,r=s),i=p},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}}),(function(t,e,n,r){var i;null==t?(i=n*ve,r.point(-_e,i),r.point(0,i),r.point(_e,i),r.point(_e,0),r.point(_e,-i),r.point(0,-i),r.point(-_e,-i),r.point(-_e,0),r.point(-_e,i)):we(t[0]-e[0])>me?(i=n*(t=t[0]<e[0]?_e:-_e)/2,r.point(-t,i),r.point(0,i),r.point(t,i)):r.point(e[0],e[1])}),[-_e,-ve]);function En(t,e){var n=Se(t),r=0<n,i=we(n)>me;function o(t,e){return Se(t)*Se(e)>n}function s(t,e,r){var i,o,s,a,u,l,c,h=[1,0,0],p=qe(Be(t),Be(e)),f=Ue(p,p),g=p[0],d=f-g*g;return d?(i=qe(h,p),ze(h=je(h,n*f/d),je(p,-n*g/d)),(d=(p=Ue(h,f=i))*p-(g=Ue(f,f))*(Ue(h,h)-1))<0?void 0:(ze(d=je(f,(-p-(i=Pe(d)))/g),h),d=Ge(d),r?(o=t[0],s=e[0],a=t[1],e=e[1],s<o&&(c=o,o=s,s=c),!(l=we((u=s-o)-_e)<me)&&e<a&&(c=a,a=e,e=c),(l||u<me?l?0<a+e^d[1]<(we(d[0]-o)<me?a:e):a<=d[1]&&d[1]<=e:_e<u^(o<=d[0]&&d[0]<=s))?(ze(c=je(f,(-p+i)/g),h),[d,Ge(c)]):void 0):d)):!r&&t}function a(e,n){var i=r?t:_e-t,o=0;return e<-i?o|=1:i<e&&(o|=2),n<-i?o|=4:i<n&&(o|=8),o}return mn(o,(function(t){var e,n,u,l,c;return{lineStart:function(){l=u=!1,c=1},point:function(h,p){var f,g=[h,p],d=o(h,p);h=r?d?0:a(h,p):d?a(h+(h<0?_e:-_e),p):0,!e&&(l=u=d)&&t.lineStart(),d===u||(f=s(e,g))&&!Qe(e,f)&&!Qe(g,f)||(g[0]+=me,g[1]+=me,d=o(g[0],g[1])),d!==u?(c=0,d?(t.lineStart(),f=s(g,e),t.point(f[0],f[1])):(f=s(e,g),t.point(f[0],f[1]),t.lineEnd()),e=f):i&&e&&r^d&&(h&n||!(p=s(g,e,!0))||(c=0,r?(t.lineStart(),t.point(p[0][0],p[0][1]),t.point(p[1][0],p[1][1]),t.lineEnd()):(t.point(p[1][0],p[1][1]),t.lineEnd(),t.lineStart(),t.point(p[0][0],p[0][1])))),!d||e&&Qe(e,g)||t.point(g[0],g[1]),e=g,u=d,n=h},lineEnd:function(){u&&t.lineEnd(),e=null},clean:function(){return c|(l&&u)<<1}}}),(function(n,r,i,o){!function(t,e,n,r,i,o){if(n){var s=Se(e),a=Ce(e),u=r*n;null==i?(i=e+r*Ee,o=e-u/2):(i=Ze(s,i),o=Ze(s,o),(0<r?i<o:o<i)&&(i+=r*Ee));for(var l,c=i;0<r?o<c:c<o;c-=u)l=Ge([s,-a*Se(c),-a*Ce(c)]),t.point(l[0],l[1])}}(o,t,e,i,n,r)}),r?[0,-t]:[-_e,t-_e])}function bn(t){return t}function In(t){return function(e){var n,r=new wn;for(n in t)r[n]=t[n];return r.stream=e,r}}function wn(){}function Nn(t,e,n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],o=t.clipExtent&&t.clipExtent(),s=(t.scale(150).translate([0,0]),null!=o&&t.clipExtent(null),function(t,e){t&&Ae.hasOwnProperty(t.type)?Ae[t.type](t,e):Oe(t,e)}(n,t.stream(yn)),n=yn.result(),Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])));return r=+e[0][0]+(r-s*(n[1][0]+n[0][0]))/2,e=+e[0][1]+(i-s*(n[1][1]+n[0][1]))/2,null!=o&&t.clipExtent(o),t.scale(150*s).translate([r,e])}wn.prototype={constructor:wn,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var Ln=16,Sn=Se(30*Ie);function Cn(t,e){return+e?(r=t,i=e,function(t){var e,n,i,s,a,u,l,c,h,p,f,g,d={point:y,lineStart:m,lineEnd:v,polygonStart:function(){t.polygonStart(),d.lineStart=x},polygonEnd:function(){t.polygonEnd(),d.lineStart=m}};function y(e,n){e=r(e,n),t.point(e[0],e[1])}function m(){c=NaN,d.point=_,t.lineStart()}function _(e,n){var i=Be([e,n]);n=r(e,n),o(c,h,l,p,f,g,c=n[0],h=n[1],l=e,p=i[0],f=i[1],g=i[2],Ln,t),t.point(c,h)}function v(){d.point=y,t.lineEnd()}function x(){m(),d.point=E,d.lineEnd=b}function E(t,r){_(e=t,r),n=c,i=h,s=p,a=f,u=g,d.point=_}function b(){o(c,h,l,p,f,g,n,i,e,s,a,u,Ln,t),d.lineEnd=v,v()}return d}):(n=t,In({point:function(t,e){t=n(t,e),this.stream.point(t[0],t[1])}}));var n,r,i;function o(t,e,n,s,a,u,l,c,h,p,f,g,d,y){var m,_,v,x,E,b,I,w,N,L,S=l-t,C=c-e,P=S*S+C*C;4*i<P&&d--&&(v=u+g,I=Te(v/=x=Pe((m=s+p)*m+(_=a+f)*_+v*v)),E=we(we(v)-1)<me||we(n-h)<me?(n+h)/2:Le(_,m),b=(I=r(E,I))[0],I=I[1],i<(L=C*(w=b-t)-S*(N=I-e))*L/P||.3<we((S*w+C*N)/P-.5)||s*p+a*f+u*g<Sn)&&(o(t,e,n,s,a,u,b,I,E,m/=x,_/=x,v,d,y),y.point(b,I),o(b,I,E,m,_,v,l,c,h,p,f,g,d,y))}}var Pn=In({point:function(t,e){this.stream.point(t*Ie,e*Ie)}});function Mn(t){return function(e,n){var r=Se(e),i=Se(n);return[(r=t(r*i))*i*Ce(e),r*Ce(n)]}}function Tn(t){return function(e,n){var r=Pe(e*e+n*n),i=t(r),o=Ce(i);return i=Se(i),[Le(e*o,r*i),Te(r&&n*o/r)]}}var Rn=Mn((function(t){return Pe(2/(1+t))}));Rn.invert=Tn((function(t){return 2*Te(t/2)}));var On=Mn((function(t){return(t=Me(t))&&t/Ce(t)}));function An(t,e,n,r){var i,o,s=t.properties||{},a="Feature"===t.type?t.geometry:t;return"GeometryCollection"===a.type?(i=[],Z(t,(function(t){(t=An(t,e,n,r))&&i.push(t)})),U(i)):(t=function(t){return t=[-(t=he(t).geometry.coordinates)[0],-t[1]],function(t){return s=function(){return t},m=150,_=480,v=250,w=I=b=E=x=0,N=null,L=xn,S=null,C=bn,M=Cn(r,P=.5),e.stream=function(t){return d&&y===t?d:d=Pn(L(c,M(C(y=t))))},e.clipAngle=function(t){return arguments.length?(L=+t?En(N=t*Ie,6*Ie):(N=null,xn),o()):N*be},e.clipExtent=function(t){return arguments.length?(C=null==t?(S=p=f=g=null,bn):cn(S=+t[0][0],p=+t[0][1],f=+t[1][0],g=+t[1][1]),o()):null==S?null:[[S,p],[f,g]]},e.scale=function(t){return arguments.length?(m=+t,i()):m},e.translate=function(t){return arguments.length?(_=+t[0],v=+t[1],i()):[_,v]},e.center=function(t){return arguments.length?(x=t[0]%360*Ie,E=t[1]%360*Ie,i()):[x*be,E*be]},e.rotate=function(t){return arguments.length?(b=t[0]%360*Ie,I=t[1]%360*Ie,w=2<t.length?t[2]%360*Ie:0,i()):[b*be,I*be,w*be]},e.precision=function(t){return arguments.length?(M=Cn(r,P=t*t),o()):Pe(P)},e.fitExtent=function(t,n){return Nn(e,t,n)},e.fitSize=function(t,n){return Nn(e,[[0,0],t],n)},function(){return a=s.apply(this,arguments),e.invert=a.invert&&n,i()}();function e(t){return[(t=h(t[0]*Ie,t[1]*Ie))[0]*m+u,l-t[1]*m]}function n(t){return(t=h.invert((t[0]-u)/m,(l-t[1])/m))&&[t[0]*be,t[1]*be]}function r(t,e){return[(t=a(t,e))[0]*m+u,l-t[1]*m]}function i(){h=Xe(c=He(b,I,w),a);var t=a(x,E);return u=_-t[0]*m,l=v+t[1]*m,o()}function o(){return d=y=null,e}var s,a,u,l,c,h,p,f,g,d,y,m,_,v,x,E,b,I,w,N,L,S,C,P,M}(On).scale(79.4188).clipAngle(179.999).rotate(t).scale(A)}(a),a={type:a.type,coordinates:function t(e,n){return"object"!=typeof e[0]?n(e):e.map((function(e){return t(e,n)}))}(a.coordinates,t)},a=(new pe.GeoJSONReader).read(a),o=z(j(e,n),"meters"),a=pe.BufferOp.bufferOp(a,o,r),function t(e){return Array.isArray(e[0])?t(e[0]):isNaN(e[0])}((a=(new pe.GeoJSONWriter).write(a)).coordinates)?void 0:F({type:a.type,coordinates:function t(e,n){return"object"!=typeof e[0]?n.invert(e):e.map((function(e){return t(e,n)}))}(a.coordinates,t)},s))}On.invert=Tn((function(t){return t})),Tn(Ne),Tn(Te),Tn((function(t){return 2*Ne(t)}));const Dn=function(t,e,n){var r=(n=n||{}).units||"kilometers",i=n.steps||8;if(!t)throw new Error("geojson is required");if("object"!=typeof n)throw new Error("options must be an object");if("number"!=typeof i)throw new Error("steps must be an number");if(void 0===e)throw new Error("radius is required");if(i<=0)throw new Error("steps must be greater than 0");var o=[];switch(t.type){case"GeometryCollection":return Z(t,(function(t){(t=An(t,e,r,i))&&o.push(t)})),U(o);case"FeatureCollection":return K(t,(function(t){(t=An(t,e,r,i))&&K(t,(function(t){t&&o.push(t)}))})),U(o)}return An(t,e,r,i)},Fn=function(t){var e;if(t)return e=[],$(t,(function(t){var n=t,r=e,i=[],o=n.geometry;if(null!==o){switch(o.type){case"Polygon":i=ot(o);break;case"LineString":i=[ot(o)]}i.forEach((function(t){var e,i;e=n.properties,i=[],t.reduce((function(t,n){var r,o,s,a=B([t,n],e);return a.bbox=(r=n,o=t[0],t=t[1],[o<(s=r[0])?o:s,t<(r=r[1])?t:r,s<o?o:s,r<t?t:r]),i.push(a),n})),i.forEach((function(t){t.id=r.length,r.push(t)}))}))}})),U(e);throw new Error("geojson is required")};var kn=t(787);function Gn(t,e){if(t=ot(t),e=ot(e),2!==t.length)throw new Error("<intersects> line1 must only contain 2 coordinates");if(2!==e.length)throw new Error("<intersects> line2 must only contain 2 coordinates");var n=t[0][0],r=t[0][1],i=t[1][0],o=(t=t[1][1],e[0][0]),s=e[0][1],a=e[1][0],u=((e=e[1][1])-s)*(i-n)-(a-o)*(t-r);return a=(a-o)*(r-s)-(e-s)*(n-o),e=(i-n)*(r-s)-(t-r)*(n-o),0!=u&&(s=e/u,0<=(o=a/u))&&o<=1&&0<=s&&s<=1?k([n+o*(i-n),r+o*(t-r)]):null}const Bn=function(t,e){var n,r,i={},o=[];return"LineString"===t.type&&(t=F(t)),"LineString"===e.type&&(e=F(e)),"Feature"===t.type&&"Feature"===e.type&&null!==t.geometry&&null!==e.geometry&&"LineString"===t.geometry.type&&"LineString"===e.geometry.type&&2===t.geometry.coordinates.length&&2===e.geometry.coordinates.length?(n=Gn(t,e))&&o.push(n):((r=kn()).load(Fn(e)),K(Fn(t),(function(t){K(r.search(t),(function(e){var n;(e=Gn(t,e))&&(n=ot(e).join(","),i[n]||(i[n]=!0,o.push(e)))}))}))),U(o)},Un=function(t,e,n){void 0===n&&(n={});var r=k([1/0,1/0],{dist:1/0}),i=0;return $(t,(function(t){for(var o=ot(t),s=0;s<o.length-1;s++){var a=k(o[s]),u=(a.properties.dist=jt(e,a,n),k(o[s+1])),l=(u.properties.dist=jt(e,u,n),jt(a,u,n)),c=Math.max(a.properties.dist,u.properties.dist),h=Xt(a,u),p=ut(e,c,h+90,n);c=ut(e,c,h-90,n),h=Bn(B([p.geometry.coordinates,c.geometry.coordinates]),B([a.geometry.coordinates,u.geometry.coordinates])),p=null,0<h.features.length&&((p=h.features[0]).properties.dist=jt(e,p,n),p.properties.location=i+jt(a,p,n)),a.properties.dist<r.properties.dist&&((r=a).properties.index=s,r.properties.location=i),u.properties.dist<r.properties.dist&&((r=u).properties.index=s+1,r.properties.location=i+l),p&&p.properties.dist<r.properties.dist&&((r=p).properties.index=s),i+=l}})),r},qn=function(t,e,n){return void 0===n&&(n={}),t=it(t),(e=it(e))[0]+=180<e[0]-t[0]?-360:180<t[0]-e[0]?360:0,Y(function(t,e,n){n=n=void 0===n?A:Number(n);var r=t[1]*Math.PI/180,i=e[1]*Math.PI/180,o=i-r;return(e=Math.abs(e[0]-t[0])*Math.PI/180)>Math.PI&&(e-=2*Math.PI),t=Math.log(Math.tan(i/2+Math.PI/4)/Math.tan(r/2+Math.PI/4)),i=1e-11<Math.abs(t)?o/t:Math.cos(r),Math.sqrt(o*o+i*i*e*e)*n}(t,e),"meters",n.units)};function zn(t,e){return t[0]*e[0]+t[1]*e[1]}function jn(t,e,n){return("planar"===n.method?qn:jt)(t,e,n)}const Vn=function(t,e,n){if((n=void 0===n?{}:n).method||(n.method="geodesic"),n.units||(n.units="kilometers"),!t)throw new Error("pt is required");if(Array.isArray(t)?t=k(t):"Point"===t.type?t=F(t):st(t,"Point","point"),!e)throw new Error("line is required");Array.isArray(e)?e=B(e):"LineString"===e.type?e=F(e):st(e,"LineString","line");var r=1/0,i=t.geometry.coordinates;return Q(e,(function(t){var e=t.geometry.coordinates[0];t=t.geometry.coordinates[1],e=function(t,e,n,r){var i=[n[0]-e[0],n[1]-e[1]],o=zn([t[0]-e[0],t[1]-e[1]],i);if(o<=0)return jn(t,e,{method:r.method,units:"degrees"});var s=zn(i,i);return s<=o?jn(t,n,{method:r.method,units:"degrees"}):(n=o/s,jn(t,o=[e[0]+n*i[0],e[1]+n*i[1]],{method:r.method,units:"degrees"}))}(i,e,t,n),e<r&&(r=e)})),Y(r,"degrees",n.units)},Xn=function(t,e,n){void 0===n&&(n={});for(var r=it(t),i=ot(e),o=0;o<i.length-1;o++){var s=!1;if(n.ignoreEndVertices&&(0===o&&(s="start"),o===i.length-2&&(s="end"),0===o)&&o+1===i.length-1&&(s="both"),function(t,e,n,r,i){var o=n[0],s=n[1],a=t[0],u=(t=t[1],e[0]),l=u-a,c=(e=e[1])-t,h=(h=n[0]-a)*c-(n=n[1]-t)*l;if(null!==i){if(Math.abs(h)>i)return}else if(0!=h)return;return r?"start"===r?Math.abs(l)>=Math.abs(c)?0<l?a<o&&o<=u:u<=o&&o<a:0<c?t<s&&s<=e:e<=s&&s<t:"end"===r?Math.abs(l)>=Math.abs(c)?0<l?a<=o&&o<u:u<o&&o<=a:0<c?t<=s&&s<e:e<s&&s<=t:"both"===r?Math.abs(l)>=Math.abs(c)?0<l?a<o&&o<u:u<o&&o<a:0<c?t<s&&s<e:e<s&&s<t:void 0:Math.abs(l)>=Math.abs(c)?0<l?a<=o&&o<=u:u<=o&&o<=a:0<c?t<=s&&s<=e:e<=s&&s<=t}(i[o],i[o+1],r,s,void 0===n.epsilon?null:n.epsilon))return!0}return!1};function Yn(t,e){return!(t[0]>e[0]||t[2]<e[2]||t[1]>e[1]||t[3]<e[3])}function Hn(t,e){return t[0]===e[0]&&t[1]===e[1]}const Wn=function(t,e){var n=at(t),r=at(e),i=n.type,o=r.type;switch(i){case"Point":switch(o){case"MultiPoint":var s,a=n,u=r,l=!1;for(s=0;s<u.coordinates.length;s++)if(Hn(u.coordinates[s],a.coordinates)){l=!0;break}return l;case"LineString":return Xn(n,r,{ignoreEndVertices:!0});case"Polygon":case"MultiPolygon":return Ot(n,r,{ignoreBoundary:!0});default:throw new Error("feature2 "+o+" geometry not supported")}case"MultiPoint":switch(o){case"MultiPoint":for(var c=n,h=r,p=0;p<c.coordinates.length;p++){for(var f=!1,g=0;g<h.coordinates.length;g++)Hn(c.coordinates[p],h.coordinates[g])&&(f=!0);if(!f)return!1}return!0;case"LineString":for(var d=n,y=r,m=!1,_=0;_<d.coordinates.length;_++){if(!Xn(d.coordinates[_],y))return!1;m=m||Xn(d.coordinates[_],y,{ignoreEndVertices:!0})}return m;case"Polygon":case"MultiPolygon":for(var v=n,x=r,E=!0,b=!1,I=0;I<v.coordinates.length;I++){if(!(b=Ot(v.coordinates[1],x))){E=!1;break}b=Ot(v.coordinates[1],x,{ignoreBoundary:!0})}return E&&b;default:throw new Error("feature2 "+o+" geometry not supported")}case"LineString":switch(o){case"LineString":for(var w=n,N=r,L=0;L<w.coordinates.length;L++)if(!Xn(w.coordinates[L],N))return!1;return!0;case"Polygon":case"MultiPolygon":var S=n,C=r;if(!Yn(et(C),et(S)))return!1;for(var P,M=!1,T=0;T<S.coordinates.length-1;T++){if(!Ot(S.coordinates[T],C))return!1;(M=M||Ot(S.coordinates[T],C,{ignoreBoundary:!0}))||(P=function(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]}(S.coordinates[T],S.coordinates[T+1]),M=Ot(P,C,{ignoreBoundary:!0}))}return M;default:throw new Error("feature2 "+o+" geometry not supported")}case"Polygon":switch(o){case"Polygon":case"MultiPolygon":var R=n,O=r,A=et(R);if(!Yn(et(O),A))return!1;for(var D=0;D<R.coordinates[0].length;D++)if(!Ot(R.coordinates[0][D],O))return!1;return!0;default:throw new Error("feature2 "+o+" geometry not supported")}default:throw new Error("feature1 "+i+" geometry not supported")}},Jn=function(t,e,n){(n=void 0===n?{}:n).mask&&!n.units&&(n.units="kilometers");for(var r=[],i=t[0],o=t[1],s=t[2],a=t[3],u=e/jt([i,o],[s,o],n)*(s-i),l=e/jt([i,o],[i,a],n)*(a-o),c=(t=s-i,e=a-o,Math.floor(t/u)),h=(e-Math.floor(e/l)*l)/2,p=i+(t-c*u)/2;p<=s;){for(var f=o+h;f<=a;){var g=k([p,f],n.properties);(!n.mask||Wn(g,n.mask))&&r.push(g),f+=l}p+=u}return U(r)};var Kn=t(676);function Zn(t){return q(t)}const $n=function(t,e){var n=G(e&&e.geometry.coordinates||[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]);return("FeatureCollection"===t.type?Zn(2===(e=t).features.length?Kn.union(e.features[0].geometry.coordinates,e.features[1].geometry.coordinates):Kn.union.apply(Kn,e.features.map((function(t){return t.geometry.coordinates})))):Zn(Kn.union(t.geometry.coordinates))).geometry.coordinates.forEach((function(t){n.geometry.coordinates.push(t[0])})),n},Qn=function(t,e,n){return void 0===n&&(n={}),t=at(t),e=at(e),0===(t=Kn.union(t.coordinates,e.coordinates)).length?null:1===t.length?G(t[0],n.properties):q(t,n.properties)};function tr(t,e){if("FeatureCollection"===e.type){for(var n=0;n<e.features.length;n++)if(Ot(t,e.features[n]))return!0;return!1}if("Feature"===e.type)return Ot(t,e.geometry)}var er=function(){function t(t){if(!t)throw new Error("Map instance is required");this.map=t}var e=t.prototype;return e.draw=function(t,e,n){var r,i=this;if(c(t)&&e)try{n=n||{},this.options=n;var s,a,u=(r=this.map).querySourceFeatures.apply(r,[e].concat(n)).filter((function(e){return tr(e.geometry.coordinates,t)})),l=this.map.style._layers,h=[],p=[];for(s in l)!Object.prototype.hasOwnProperty.call(l,s)||(a=l[s]).source!==e||n.sourceLayer&&n.sourceLayer!==a.sourceLayer||(h.push(a.id),p.push(this.map.getLayer(a.id)));var f={type:"FeatureCollection",features:u.map((function(t){return{id:t.id,type:t.type,geometry:t.geometry,properties:t.properties}}))};this.sourceName=e+"_copy",this.layerName=[],this.map.addSource(this.sourceName,{type:"geojson",data:f}),p.forEach((function(t){var n=t.id+"_copy";delete(t=o({},t,{source:e+"_copy","source-layer":void 0,id:n}))["source-layer"],i.layerName.push(n),i.map.addLayer(t)})),(this.originLayerName=h).forEach((function(t){i.map.setLayoutProperty(t,"visibility","none")}))}catch(n){throw console.error("Error in MapLabelByGeoJson.draw:",n),n}},e.update=function(t){var e,n,r,i,o=this;try{c(t)&&this.sourceName&&(r=this.sourceName.replace("_copy",""),i={type:"FeatureCollection",features:(e=this.map).querySourceFeatures.apply(e,[r].concat(this.options)).filter((function(e){return tr(e.geometry.coordinates,t)})).map((function(t){return{id:t.id,type:t.type,geometry:t.geometry,properties:t.properties}}))},this.map.getSource(this.sourceName).setData(i),0<(null==(n=this.layerName)?void 0:n.length))&&this.layerName.forEach((function(t){o.map.setLayoutProperty(t,"visibility","visible")}))}catch(e){throw console.error("Error in MapLabelByGeoJson.update:",e),e}},e.visible=function(t){var e,n=this;try{0<(null==(e=this.layerName)?void 0:e.length)&&this.layerName.forEach((function(e){n.map.setLayoutProperty(e,"visibility",t?"visible":"none")}))}catch(e){throw console.error("Error in MapLabelByGeoJson.visible:",e),e}},e.visibleOrigin=function(t){var e,n=this;try{0<(null==(e=this.originLayerName)?void 0:e.length)&&this.originLayerName.forEach((function(e){n.map.setLayoutProperty(e,"visibility",t?"visible":"none")}))}catch(e){throw console.error("Error in MapLabelByGeoJson.visibleOrigin:",e),e}},e.destroy=function(){var t,e=this;try{0<(null==(t=this.layerName)?void 0:t.length)&&(this.layerName.forEach((function(t){e.map.removeLayer(t)})),this.layerName=[]),this.sourceName&&(this.map.removeSource(this.sourceName),this.sourceName=null)}catch(t){throw console.error("Error in MapLabelByGeoJson.destroy:",t),t}},t}();function nr(t,e){var n=X(t[1]),r=X(e[1]);return(e=X(e[0]-t[0]))>Math.PI&&(e-=2*Math.PI),e<-Math.PI&&(e+=2*Math.PI),t=Math.log(Math.tan(r/2+Math.PI/4)/Math.tan(n/2+Math.PI/4)),(V(Math.atan2(e,t))+360)%360}const rr=function(t,e,n){return 180<(n=(n=void 0===n?{}:n).final?nr(it(e),it(t)):nr(it(t),it(e)))?-(360-n):n},ir=function(t,e,n,r){void 0===r&&(r={});var i,o,s,a,u=e<0;return e=Y(Math.abs(e),r.units,"meters"),u&&(e=-Math.abs(e)),t=u=it(t),e/=i=void 0===i?A:Number(i),i=t[0]*Math.PI/180,t=X(t[1]),n=X(n),s=t+(o=e*Math.cos(n)),Math.abs(s)>Math.PI/2&&(s=0<s?Math.PI-s:-Math.PI-s),a=Math.log(Math.tan(s/2+Math.PI/4)/Math.tan(t/2+Math.PI/4)),o=1e-11<Math.abs(a)?o/a:Math.cos(t),(t=[(180*(i+(a=e*Math.sin(n)/o))/Math.PI+540)%360-180,180*s/Math.PI])[0]+=180<t[0]-u[0]?-360:180<u[0]-t[0]?360:0,k(t,r.properties)};function or(t){var e={type:"Feature"};return Object.keys(t).forEach((function(n){switch(n){case"type":case"properties":case"geometry":return;default:e[n]=t[n]}})),e.properties=function t(e){var n={};return e?(Object.keys(e).forEach((function(r){var i=e[r];"object"==typeof i?null===i?n[r]=null:Array.isArray(i)?n[r]=i.map((function(t){return t})):n[r]=t(i):n[r]=i})),n):n}(t.properties),e.geometry=sr(t.geometry),e}function sr(t){var e={type:t.type};return t.bbox&&(e.bbox=t.bbox),"GeometryCollection"===t.type?e.geometries=t.geometries.map(sr):e.coordinates=function t(e){return"object"!=typeof e[0]?e.slice():e.map((function(e){return t(e)}))}(t.coordinates),e}const ar=function(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return or(t);case"FeatureCollection":return e=t,n={type:"FeatureCollection"},Object.keys(e).forEach((function(t){switch(t){case"type":case"features":return;default:n[t]=e[t]}})),n.features=e.features.map(or),n;case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return sr(t);default:throw new Error("unknown GeoJSON type")}var e,n};function ur(t,e,n){var r="Point"===("FeatureCollection"===(r=t).type?"FeatureCollection":"GeometryCollection"===r.type?"GeometryCollection":("Feature"===r.type&&null!==r.geometry?r.geometry:r).type);return n=function(t,e){if(null==e&&(e="centroid"),Array.isArray(e)||"object"==typeof e)return it(e);var n=t.bbox||et(t),r=n[0],i=n[1],o=n[2],s=n[3];switch(e){case"sw":case"southwest":case"westsouth":case"bottomleft":return k([r,i]);case"se":case"southeast":case"eastsouth":case"bottomright":return k([o,i]);case"nw":case"northwest":case"westnorth":case"topleft":return k([r,s]);case"ne":case"northeast":case"eastnorth":case"topright":return k([o,s]);case"center":return he(t);case void 0:case null:case"centroid":return Zt(t);default:throw new Error("invalid origin")}}(t,n),1===e||r||J(t,(function(t){var r=qn(n,t),i=rr(n,t);r=ot(ir(n,r*=e,i)),t[0]=r[0],t[1]=r[1],3===t.length&&(t[2]*=e)})),t}var lr=["beforeId","rotation","pivot","factor","origin","distance","direction"];function cr(t,e){var n,r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=function(t,e){var n;if(t)return"string"==typeof t?hr(t,e):"Map"===(n="Object"===(n=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?hr(t,e):void 0}(t))||e&&t&&"number"==typeof t.length)return r&&(t=r),n=0,function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function hr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var pr=function(){function t(t,e){this.map=t,this.addedSources=new Map,this.addedLayers=new Set,this.visibleFeatures=new Set,this.sourceConfig=null!=(t=null==e?void 0:e.sourceConfig)?t:{}}var e=t.prototype;return e.draw=function(t,e,n){c(t)&&e&&n&&"function"==typeof n&&(t=l(t).features,this.key=e,this.callback=n,this.features=t.filter((function(t){return"Polygon"===t.geometry.type})),this._updateVisibleImages=this._updateVisibleImages.bind(this),this._updateVisibleImages(),this.map.on("move",this._updateVisibleImages))},e._getVisibleFeatures=function(){var t=this,e=this.map.getBounds(),n=[];return this.features.forEach((function(r,i){var o,s,a,u,l;r.geometry&&r.geometry.coordinates&&r.geometry.coordinates[0]&&((o=r.geometry.coordinates[0]).length<3||(a=s=1/0,l=u=-1/0,o.forEach((function(t){s=Math.min(s,t[0]),u=Math.max(u,t[0]),a=Math.min(a,t[1]),l=Math.max(l,t[1])})),t._boundsIntersect(e,{getWest:function(){return s},getEast:function(){return u},getSouth:function(){return a},getNorth:function(){return l}})&&n.push({feature:r,index:i})))})),n},e._boundsIntersect=function(t,e){return!(t.getWest()>e.getEast()||t.getEast()<e.getWest()||t.getSouth()>e.getNorth()||t.getNorth()<e.getSouth())},e._updateVisibleImages=function(){var t=this,e=this._getVisibleFeatures(),n=new Set;e.forEach((function(e){var r=e.feature,i=e=e.index;n.add(i),t.visibleFeatures.has(i)||(t._addImageFeature(r,e),t.visibleFeatures.add(i))}));for(var r=cr(this.visibleFeatures);!(i=r()).done;){var i=i.value;n.has(i)||(this._removeImageFeature(i),this.visibleFeatures.delete(i))}},e._addImageFeature=function(t,e){if(t&&t.properties){var n="image-source-"+e,r="image-layer-"+e,s=this.callback(t),a=void 0===(a=(p=s||{}).rotation)?0:a,u=p.pivot,l=void 0===(l=p.factor)?1:l,c=p.origin,h=void 0===(h=p.distance)?0:h,p=void 0===(p=p.direction)?0:p,f=(s&&Object.prototype.hasOwnProperty.call(s,this.key)?s:t.properties)[this.key];u=u&&Array.isArray(u)&&2===u.length?u:null,c=c&&Array.isArray(c)&&2===c.length?c:null;try{var g,d,y,m,_=t;0===h&&0===p||(_=function(t,e,n,r){if(!W(r=r||{}))throw new Error("options is invalid");var i=r.units,o=r.zTranslation;if(r=r.mutate,!t)throw new Error("geojson is required");if(null==e||isNaN(e))throw new Error("distance is required");if(o&&"number"!=typeof o&&isNaN(o))throw new Error("zTranslation is not a number");if(o=void 0!==o?o:0,0!==e||0!==o){if(null==n||isNaN(n))throw new Error("direction is required");e<0&&(e=-e,n+=180),J(t=!1!==r&&void 0!==r?t:ar(t),(function(t){var r=ot(ir(t,e,n,{units:i}));t[0]=r[0],t[1]=r[1],o&&3===t.length&&(t[2]+=o)}))}return t}(_,h,p,{units:"meters"})),0!==a&&(_=function(t,e,n){if(!W(n=n||{}))throw new Error("options is invalid");var r=n.pivot;if(n=n.mutate,!t)throw new Error("geojson is required");if(null==e||isNaN(e))throw new Error("angle is required");return 0!==e&&(r=r||Zt(t),J(t=!1!==n&&void 0!==n?t:ar(t),(function(t){var n=rr(r,t)+e,i=qn(r,t);i=ot(ir(r,i,n)),t[0]=i[0],t[1]=i[1]}))),t}(_,a,{pivot:u})),(_=1!==l?function(t,e,n){if(!W(n=n||{}))throw new Error("options is invalid");var r=n.origin;if(n=n.mutate,!t)throw new Error("geojson required");if("number"!=typeof e||0===e)throw new Error("invalid factor");var i=Array.isArray(r)||"object"==typeof r;return"FeatureCollection"!==(t=!0!==n?ar(t):t).type||i?ur(t,e,r):(K(t,(function(n,i){t.features[i]=ur(n,e,r)})),t)}(_,l,{origin:c}):_).geometry&&_.geometry.coordinates&&_.geometry.coordinates[0]?(g=_.geometry.coordinates[0].slice(0,4),this.addedSources.has(e)||(d=o({},this.sourceConfig,{type:"image",coordinates:g}),"string"==typeof f?d.url=f:f instanceof HTMLImageElement?d.url=f.src:(f instanceof ImageData||"object"==typeof f&&f.data&&f.width&&f.height,d.url=f),this.map.addSource(n,d),this.addedSources.set(e,n)),this.addedLayers.has(r)||(s&&"object"==typeof s?(y=s.beforeId,s.rotation,s.pivot,s.factor,s.origin,s.distance,s.direction,m=i(s,lr),Object.prototype.hasOwnProperty.call(m,this.key)&&delete m[this.key],this.map.addLayer(o({},m,{id:r,type:"raster",source:n}),y)):this.map.addLayer({id:r,type:"raster",source:n,paint:{"raster-opacity":1}}),this.addedLayers.add(r))):console.warn("Transformed feature has invalid geometry")}catch(t){console.error("Error processing image feature:",t)}}else console.warn("Invalid feature provided to _addImageFeature")},e._removeImageFeature=function(t){var e="image-source-"+t,n="image-layer-"+t;this.addedLayers.has(n)&&this.map.getLayer(n)&&(this.map.removeLayer(n),this.addedLayers.delete(n)),this.addedSources.has(t)&&this.map.getSource(e)&&(this.map.removeSource(e),this.addedSources.delete(t))},e.visible=function(t){var e=this;this.addedLayers.forEach((function(n){e.map.setLayoutProperty(n,"visibility",t?"visible":"none")}))},e.destroy=function(){var t;if(0<(null==(t=this.features)?void 0:t.length)&&this.key&&this.callback){this.map.off("move",this._updateVisibleImages);for(var e=cr(this.visibleFeatures);!(n=e()).done;){var n=n.value;this._removeImageFeature(n)}this.visibleFeatures.clear(),this.addedSources.clear(),this.addedLayers.clear()}},t}(),fr=t(481),gr=t.n(fr),dr=t(630),yr=t.n(dr),mr=function(){function t(e,n,r){if((this instanceof t?this.constructor:void 0)!==t)throw new Error("MapLayer is a constructor and should be called with the new keyword");this._type="MapLayer";var i={layer:null,tooltip:null,popup:null};return n&&"object"==typeof n&&(i=o({},i,n)),this.name=null===e||""===e||void 0===e?L():e,this.layers=i,this.prop=null!=r?r:{},new Proxy(this,{deleteProperty:function(t,e){return(t!==this||"layers"!==e&&"name"!==e)&&(delete t[e],!0)},set:function(t,e,n){return(t!==this||"layers"!==e&&"name"!==e)&&(t[e]=n,!0)}})}var e=t.prototype;return e.addLayer=function(t){if(t&&"object"==typeof t)for(var e in t)this.layers[e]=t[e]},e.addProp=function(t){if(t&&"object"==typeof t)for(var e in t)this.prop[e]=t[e]},t}(),_r=["padding","animate","maxZoom","essential"],vr=["url"],xr=["interactive"],Er=null,br=null,Ir=function(t){return/^#([0-9a-fA-F]{3}){1,2}$/.test(t)},wr=["line-color","line-opacity"],Nr=["fill-color","fill-opacity"],Lr=["background-color","background-opacity"],Sr=["text-color","text-opacity"],Cr="zh_custom",Pr=function(t,e,n,r){if(n&&(Ir(n)||Array.isArray(n))){var i=t.getLayer(e);if(i){var o=[];switch(i.type){case"line":o=wr;break;case"fill":o=Nr;break;case"background":o=Lr;break;case"symbol":o=Sr}0<o.length&&(t.setPaintProperty(e,o[0],n),null!==r)&&t.setPaintProperty(e,o[1],r)}}},Mr=function(t,e,n,r){if(e&&n&&"string"==typeof e&&t.getLayer(e)&&"object"==typeof n)for(var i in n)null!==n[i]&&void 0!==n[i]&&t[r](e,i,n[i])},Tr=function(t,e){var n;null!=(n=t[Cr])&&n.mapLayer||(t[Cr].mapLayer=[]),t[Cr].mapLayer.push(e)},Rr=function(t){var e;return null!=(e=t[Cr])&&e.mapLayer||(t[Cr].mapLayer=[]),t[Cr].mapLayer},Or=function(t,e,n){var r,i,o;void 0===n&&(n=!0),null!=(r=t[Cr])&&r.mapLayer||(t[Cr].mapLayer=[]),e?(i=[],"string"==typeof e?i=[e]:Array.isArray(e)&&(i=e.filter((function(t){return"string"==typeof t}))),o=[],t[Cr].mapLayer.forEach((function(t){var e=t&&"MapLayer"===t._type;n?e&&i.includes(t.name)?t.destroy&&"function"==typeof t.destroy&&t.destroy():o.push(t):e&&i.includes(t.name)?o.push(t):e&&i.includes(t.name)||t&&t.destroy&&"function"==typeof t.destroy&&t.destroy()})),t[Cr].mapLayer=o):(t[Cr].mapLayer.forEach((function(t){t&&t.destroy&&"function"==typeof t.destroy&&t.destroy()})),t[Cr].mapLayer=[])};function Ar(t,e){if(t&&(void 0!==t[Cr]&&null!==t[Cr]||(t[Cr]={}),e)&&"object"==typeof e&&0<Object.keys(e).length){var n,r=l(e);for(n in r)t[Cr][n]=r[n]}}function Dr(t,e){if(!t||!t[Cr])return null;var n=[];if("string"==typeof e?n=e.split(".").filter(Boolean):Array.isArray(e)&&(n=e),0===n.length)return null;try{return n.reduce((function(t,e){return t&&void 0!==t[e]?t[e]:null}),t[Cr])}catch(t){return console.warn("Error getting property:",t),null}}})(),r;function t(r){var i=n[r];return void 0!==i||(i=n[r]={exports:{}},e[r].call(i.exports,i,i.exports,t)),i.exports}var e,n,r}));