function RegionParser$parsePolygon(n){for(var f=/([^\s,]+)\s*,\s*([^\s,]+)(?:\s*,\s*([^\s,]+))?/g,e=0,t,u=[],i,r;(t=f.exec(n))!==null;){i=0;r=0;try{i=parseFloat(t[1]);r=parseFloat(t[2]);u.push({order:e++,x:i,y:r})}catch(o){}}return u}function RegionParser$getPolygon(n){for(var i="",t=0;t<n.length;t++)t>0&&(i+=" "),i+=n[t].x+","+n[t].y;return i}function initLeaflet(n,t,i){var o={center:L.latLng(30,0),minZoom:2,maxZoom:18,zoom:1,maxNativeZoom:undefined,zoomSnap:.2,maxBounds:[[-90,-540],[90,540]]},f,r,e,u;return t=$.extend(o,t),t.deepZoom&&(t.maxNativeZoom=t.maxZoom,t.maxZoom=32),f=window.BackgroundMapOptions||{mode:"LeicaOsmServer",server:$("#TileServer").val()||"/localMapServer/{z}/{x}/{y}.png",attribution:'&copy; <a href="http://osm.org/copyright" target="_blank">OpenStreetMap<\/a> contributors',attributionLink:""},i=$.extend(f,i),L.Icon.Default.imagePath=window.rootDir+"Content/Leaflet/images/",r=L.map(n,t),e=setBaseMap(r,t,i),$(".leaflet-control-attribution > a:not([target])").each(function(){$(this).attr("target","_blank")}),t.hideCoordinates||(t.coordinatePosition||(t.coordinatePosition="bottomleft"),u=L.control.coordinates({customLabelFcn:function(n,t){var i=L.Util.template(t.labelTemplateLng,{x:toDMS(n.lng,!1,t.decimals)}),r=L.Util.template(t.labelTemplateLat,{y:toDMS(n.lat,!0,t.decimals)});return r+" "+i},position:t.coordinatePosition,decimals:3,decimalSeperator:".",labelTemplateLat:"Lat: {y}",labelTemplateLng:"Lon: {x}",enableUserInput:!1,useDMS:!0,useLatLngOrder:!0}),r.coordinatesControl=u,u.addTo(r)),t.showFullscreen&&r.addControl(new L.Control.FullScreen),t.showScale&&r.addControl(new L.Control.GraphicScale({position:t.scalePosition||"bottomright",fill:"hollow"})),r.addControl(new L.Control.Scale({position:t.scalePosition||"bottomright",imperial:!1})),function(n){var t,i=function(){var i=n.getContainer(),r;t&&L.DomUtil.removeClass(i,t);r=n.getZoom();t="leaflet-zoom-"+Math.floor(r);L.DomUtil.addClass(i,t)};n.on("zoomend",i);i()}(r),$(document).trigger("leaflet.init",{element:n,leaflet:r,basemap:e,options:t}),r.getContainer().leaflet=r,r}function setBaseMap(n,t,i,r){requestAuthHeader=undefined;r!=undefined&&n.eachLayer(function(t){n.removeLayer(t)});var u,f=i.attribution;return i.attributionLink&&(f=$("<a><\/a>").attr("href",i.attributionLink).html(i.attribution).prop("outerHTML")),i.username&&i.password&&(requestAuthHeader="Basic "+btoa(window.BackgroundMapOptions.username+":"+window.BackgroundMapOptions.password)),u=i.mode==="CustomWmsServer"?L.tileLayer.wms(i.server,{attribution:f,maxZoom:t.maxZoom,maxNativeZoom:t.maxNativeZoom,layers:i.layer,format:"image/png"}):L.tileLayer(i.server,{attribution:f,maxZoom:t.maxZoom,maxNativeZoom:t.maxNativeZoom}),u.addTo(n),n.getContainer().leaflet=n,u}function localizeLeaflet(){leafletLocalized||(leafletLocalized=!0,L.drawLocal.draw.toolbar.actions.title=LocalizationMapDrawCancelTitle,L.drawLocal.draw.toolbar.actions.text=LocalizationMapDrawCancelText,L.drawLocal.draw.toolbar.buttons.polygon=LocalizationMapDrawPolygon,L.drawLocal.draw.toolbar.buttons.rectangle=LocalizationMapDrawRectangle,L.drawLocal.draw.handlers.polygon.tooltip.start=LocalizationMapDrawPolygonTooltipStart,L.drawLocal.draw.handlers.polygon.tooltip.cont=LocalizationMapDrawPolygonTooltipCont,L.drawLocal.draw.handlers.polygon.tooltip.end=LocalizationMapDrawPolygonTooltipEnd,L.drawLocal.draw.handlers.rectangle.tooltip.start=LocalizationMapDrawRectangleTooltipStart,L.drawLocal.edit.toolbar.actions.save.title=LocalizationMapDrawSaveTitle,L.drawLocal.edit.toolbar.actions.save.text=LocalizationMapDrawSaveText,L.drawLocal.edit.toolbar.actions.cancel.title=LocalizationMapDrawCancelTitle,L.drawLocal.edit.toolbar.actions.cancel.text=LocalizationMapDrawCancelText,L.drawLocal.edit.toolbar.buttons.edit=LocalizationMapDrawEditLayers,L.drawLocal.edit.toolbar.buttons.remove=LocalizationMapDrawDeleteLayers,L.drawLocal.edit.handlers.edit.tooltip.text=LocalizationMapDrawHandlesText,L.drawLocal.edit.handlers.edit.tooltip.subtext=LocalizationMapDrawHandlesSubText,L.drawLocal.edit.handlers.remove.tooltip.text=LocalizationMapDrawRemoveTooltip)}function initLeafletDraw(n,t,i,r){localizeLeaflet();var u=new L.Control.Draw({edit:{featureGroup:t},draw:{polyline:!1,polygon:{showArea:!0,metric:!0,showMeasurement:!1,allowIntersection:!1},circle:!1,rectangle:!1,circlemarker:!1,marker:!1}});n.on("draw:created",function(n){t.clearLayers();n.layerType=="polygon"||n.layerType=="rectangle"?(i(n.layer),t.addLayer(n.layer),r()):t.removeLayer(n.layer)});n.on("draw:edited",function(){r()});n.on("draw:deleted",function(n){n.layers.getLayers().length!=0&&i(null);r()});n.addControl(u)}function loadRegionPolygon(n,t,i){var u=RegionParser$parsePolygon(i),f,r,e,o;if(u.length>0){for(f=[],r=0;r<u.length-1;r++)f.push(L.latLng(u[r].y,u[r].x));return e=L.polygon(f),e.addTo(t),o=L.latLngBounds(f),setTimeout(function(){n.fitBounds(o,{padding:[10,10]})},250),e}return null}function saveRegionPolygon(n,t){var i,r;n==null?t.val(""):(i=n.getLatLngs()[0],i.length>0&&i.push(i[0]),r=i.map(function(n){return{x:n.lng,y:n.lat}}),t.val(RegionParser$getPolygon(r)))}function loadMapOriginFromStorage(n){console.assert(window.mapOriginDefault,"mapOriginDefault should be set on window");console.assert("number"==typeof window.mapOriginDefault.lastUpdate,"lastUpdate should be set on mapOriginDefault");var i=window.mapOriginDefault,t=JSON.parse(window.localStorage[n]||null);return t&&t.lastUpdate>i.lastUpdate?(t.ignoreAutoZoom=!0,t):i}function saveMapOriginToStorage(n,t){t.lastUpdate=(new Date).getTime();window.localStorage[n]=JSON.stringify(t)}function projectLatLng(n){for(var t=0;t<leafletProjections.length;t++)if(leafletProjections[t].area.contains(n))return leafletProjections[t].project(n);return n}function toNmeaGga(n,t){var f=new Date,i=[],e,r,o,u;for(i.push("$GPGGA"),e=function(n,t,i){var r;n<0?(r=i,n=-n):r=t;var f=Math.floor(n)|0,o=f.pad(2),s=n-f,e=s*60,u=e.toFixed(5);return e<10&&(u="0"+u),o+u+","+r},i.push(f.getUTCHours().pad(2)+f.getUTCMinutes().pad(2)+f.getUTCSeconds().pad(2)),i.push(e(n,"N","S")),i.push(e(t,"E","W")),i.push(4),i.push(8..pad(2)),i.push(1.1.toFixed(1)),i.push(473.274.toFixed(3)),i.push("M"),i.push(3.3.toFixed(1)),i.push("M"),i.push(4.4.toFixed(1)),i.push(1..pad(4)),r=i.join(","),o=r.charCodeAt(1),u=2;u<r.length;u++)o^=r.charCodeAt(u);return r+"*"+o.toString(16)}var requestAuthHeader,leafletProjections,siteMapIcon;!function(n){"use strict";function f(n,t){var i=(65535&n)+(65535&t);return(n>>16)+(t>>16)+(i>>16)<<16|65535&i}function e(n,t,i,r,u,e){return f(function(n,t){return n<<t|n>>>32-t}(f(f(t,n),f(r,e)),u),i)}function t(n,t,i,r,u,f,o){return e(t&i|~t&r,n,t,u,f,o)}function i(n,t,i,r,u,f,o){return e(t&r|i&~r,n,t,u,f,o)}function r(n,t,i,r,u,f,o){return e(t^i^r,n,t,u,f,o)}function u(n,t,i,r,u,f,o){return e(i^(t|~r),n,t,u,f,o)}function o(n,e){var s,a,v,y,p;n[e>>5]|=128<<e%32;n[14+(e+64>>>9<<4)]=e;var h=1732584193,o=-271733879,c=-1732584194,l=271733878;for(s=0;s<n.length;s+=16)o=u(o=u(o=u(o=u(o=r(o=r(o=r(o=r(o=i(o=i(o=i(o=i(o=t(o=t(o=t(o=t(v=o,c=t(y=c,l=t(p=l,h=t(a=h,o,c,l,n[s],7,-680876936),o,c,n[s+1],12,-389564586),h,o,n[s+2],17,606105819),l,h,n[s+3],22,-1044525330),c=t(c,l=t(l,h=t(h,o,c,l,n[s+4],7,-176418897),o,c,n[s+5],12,1200080426),h,o,n[s+6],17,-1473231341),l,h,n[s+7],22,-45705983),c=t(c,l=t(l,h=t(h,o,c,l,n[s+8],7,1770035416),o,c,n[s+9],12,-1958414417),h,o,n[s+10],17,-42063),l,h,n[s+11],22,-1990404162),c=t(c,l=t(l,h=t(h,o,c,l,n[s+12],7,1804603682),o,c,n[s+13],12,-40341101),h,o,n[s+14],17,-1502002290),l,h,n[s+15],22,1236535329),c=i(c,l=i(l,h=i(h,o,c,l,n[s+1],5,-165796510),o,c,n[s+6],9,-1069501632),h,o,n[s+11],14,643717713),l,h,n[s],20,-373897302),c=i(c,l=i(l,h=i(h,o,c,l,n[s+5],5,-701558691),o,c,n[s+10],9,38016083),h,o,n[s+15],14,-660478335),l,h,n[s+4],20,-405537848),c=i(c,l=i(l,h=i(h,o,c,l,n[s+9],5,568446438),o,c,n[s+14],9,-1019803690),h,o,n[s+3],14,-187363961),l,h,n[s+8],20,1163531501),c=i(c,l=i(l,h=i(h,o,c,l,n[s+13],5,-1444681467),o,c,n[s+2],9,-51403784),h,o,n[s+7],14,1735328473),l,h,n[s+12],20,-1926607734),c=r(c,l=r(l,h=r(h,o,c,l,n[s+5],4,-378558),o,c,n[s+8],11,-2022574463),h,o,n[s+11],16,1839030562),l,h,n[s+14],23,-35309556),c=r(c,l=r(l,h=r(h,o,c,l,n[s+1],4,-1530992060),o,c,n[s+4],11,1272893353),h,o,n[s+7],16,-155497632),l,h,n[s+10],23,-1094730640),c=r(c,l=r(l,h=r(h,o,c,l,n[s+13],4,681279174),o,c,n[s],11,-358537222),h,o,n[s+3],16,-722521979),l,h,n[s+6],23,76029189),c=r(c,l=r(l,h=r(h,o,c,l,n[s+9],4,-640364487),o,c,n[s+12],11,-421815835),h,o,n[s+15],16,530742520),l,h,n[s+2],23,-995338651),c=u(c,l=u(l,h=u(h,o,c,l,n[s],6,-198630844),o,c,n[s+7],10,1126891415),h,o,n[s+14],15,-1416354905),l,h,n[s+5],21,-57434055),c=u(c,l=u(l,h=u(h,o,c,l,n[s+12],6,1700485571),o,c,n[s+3],10,-1894986606),h,o,n[s+10],15,-1051523),l,h,n[s+1],21,-2054922799),c=u(c,l=u(l,h=u(h,o,c,l,n[s+8],6,1873313359),o,c,n[s+15],10,-30611744),h,o,n[s+6],15,-1560198380),l,h,n[s+13],21,1309151649),c=u(c,l=u(l,h=u(h,o,c,l,n[s+4],6,-145523070),o,c,n[s+11],10,-1120210379),h,o,n[s+2],15,718787259),l,h,n[s+9],21,-343485551),h=f(h,a),o=f(o,v),c=f(c,y),l=f(l,p);return[h,o,c,l]}function l(n){for(var i="",r=32*n.length,t=0;t<r;t+=8)i+=String.fromCharCode(n[t>>5]>>>t%32&255);return i}function s(n){var t,i=[],r;for(i[(n.length>>2)-1]=void 0,t=0;t<i.length;t+=1)i[t]=0;for(r=8*n.length,t=0;t<r;t+=8)i[t>>5]|=(255&n.charCodeAt(t/8))<<t%32;return i}function a(n){for(var i,r="0123456789abcdef",u="",t=0;t<n.length;t+=1)i=n.charCodeAt(t),u+=r.charAt(i>>>4&15)+r.charAt(15&i);return u}function h(n){return unescape(encodeURIComponent(n))}function v(n){return function(n){return l(o(s(n),8*n.length))}(h(n))}function y(n,t){return function(n,t){var i,e,r=s(n),u=[],f=[];for(u[15]=f[15]=void 0,16<r.length&&(r=o(r,8*n.length)),i=0;i<16;i+=1)u[i]=909522486^r[i],f[i]=1549556828^r[i];return e=o(u.concat(s(t)),512+8*t.length),l(o(f.concat(e),640))}(h(n),h(t))}function c(n,t,i){return t?i?y(t,n):function(n,t){return a(y(n,t))}(t,n):i?v(n):function(n){return a(v(n))}(n)}"function"==typeof define&&define.amd?define(function(){return c}):"object"==typeof module&&module.exports?module.exports=c:n.md5=c}(this);!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(n.L={})}(this,function(n){"use strict";function s(n){for(var i,r,t=1,u=arguments.length;t<u;t++){r=arguments[t];for(i in r)n[i]=r[i]}return n}function c(n,t){var i=Array.prototype.slice,r;return n.bind?n.bind.apply(n,i.call(arguments,1)):(r=i.call(arguments,2),function(){return n.apply(t,r.length?r.concat(i.call(arguments)):arguments)})}function o(n){return n._leaflet_id=n._leaflet_id||++nh,n._leaflet_id}function uf(n,t,i){var u,r,f,e;return e=function(){u=!1;r&&(f.apply(i,r),r=!1)},f=function(){u?r=arguments:(n.apply(i,arguments),setTimeout(e,t),u=!0)}}function hr(n,t,i){var f=t[1],r=t[0],u=f-r;return n===f&&i?n:((n-r)%u+u)%u+r}function d(){return!1}function ht(n,t){var i=Math.pow(10,t||5);return Math.round(n*i)/i}function ff(n){return n.trim?n.trim():n.replace(/^\s+|\s+$/g,"")}function yi(n){return ff(n).split(/\s+/)}function a(n,t){n.hasOwnProperty("options")||(n.options=n.options?au(n.options):{});for(var i in t)n.options[i]=t[i];return n.options}function ts(n,t,i){var u=[];for(var r in n)u.push(encodeURIComponent(i?r.toUpperCase():r)+"="+encodeURIComponent(n[r]));return(t&&-1!==t.indexOf("?")?"&":"?")+u.join("&")}function is(n,t){return n.replace(yc,function(n,i){var r=t[i];if(void 0===r)throw new Error("No value provided for variable "+n);return"function"==typeof r&&(r=r(t)),r})}function rs(n,t){for(var i=0;i<n.length;i++)if(n[i]===t)return i;return-1}function ef(n){return window["webkit"+n]||window["moz"+n]||window["ms"+n]}function us(n){var t=+new Date,i=Math.max(0,16-(t-ih));return ih=t+i,window.setTimeout(n,i)}function g(n,t,i){if(!i||ue!==us)return ue.call(window,c(n,t));n.call(t)}function ct(n){n&&rh.call(window,n)}function pt(){}function tc(n){if(L&&L.Mixin){n=at(n)?n:[n];for(var t=0;t<n.length;t++)n[t]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",(new Error).stack)}}function t(n,t,i){this.x=i?Math.round(n):n;this.y=i?Math.round(t):t}function r(n,i,r){return n instanceof t?n:at(n)?new t(n[0],n[1]):void 0===n||null===n?n:"object"==typeof n&&"x"in n&&"y"in n?new t(n.x,n.y):new t(n,i,r)}function v(n,t){if(n)for(var r=t?[n,t]:n,i=0,u=r.length;i<u;i++)this.extend(r[i])}function ii(n,t){return!n||n instanceof v?n:new v(n,t)}function nt(n,t){if(n)for(var r=t?[n,t]:n,i=0,u=r.length;i<u;i++)this.extend(r[i])}function k(n,t){return n instanceof nt?n:new nt(n,t)}function h(n,t,i){if(isNaN(n)||isNaN(t))throw new Error("Invalid LatLng object: ("+n+", "+t+")");this.lat=+n;this.lng=+t;void 0!==i&&(this.alt=+i)}function y(n,t,i){return n instanceof h?n:at(n)&&"object"!=typeof n[0]?3===n.length?new h(n[0],n[1],n[2]):2===n.length?new h(n[0],n[1]):null:void 0===n||null===n?n:"object"==typeof n&&"lat"in n?new h(n.lat,"lng"in n?n.lng:n.lon,n.alt):void 0===t?null:new h(n,t,i)}function of(n,t,i,r){if(at(n))return this._a=n[0],this._b=n[1],this._c=n[2],void(this._d=n[3]);this._a=n;this._b=t;this._c=i;this._d=r}function cr(n,t,i,r){return new of(n,t,i,r)}function fs(n){return document.createElementNS("http://www.w3.org/2000/svg",n)}function es(n,t){for(var i,o,s,u,f="",r=0,e=n.length;r<e;r++){for(i=0,o=(s=n[r]).length;i<o;i++)u=s[i],f+=(i?"L":"M")+u.x+" "+u.y;f+=t?pu?"z":"x":""}return f||"M0 0"}function wt(n){return navigator.userAgent.toLowerCase().indexOf(n)>=0}function ic(n,t,i,r){return"touchstart"===t?uc(n,i,r):"touchmove"===t?oc(n,i,r):"touchend"===t&&sc(n,i,r),this}function rc(n,t,i){var r=n["_leaflet_"+t+i];return"touchstart"===t?n.removeEventListener(pe,r,!1):"touchmove"===t?n.removeEventListener(we,r,!1):"touchend"===t&&(n.removeEventListener(be,r,!1),n.removeEventListener(ke,r,!1)),this}function uc(n,t,i){var r=c(function(n){if("mouse"!==n.pointerType&&n.pointerType!==n.MSPOINTER_TYPE_MOUSE&&n.pointerType!==n.MSPOINTER_TYPE_MOUSE){if(!(nl.indexOf(n.target.tagName)<0))return;rt(n)}sf(n,t)});n["_leaflet_touchstart"+i]=r;n.addEventListener(pe,r,!1);lh||(document.documentElement.addEventListener(pe,fc,!0),document.documentElement.addEventListener(we,ec,!0),document.documentElement.addEventListener(be,os,!0),document.documentElement.addEventListener(ke,os,!0),lh=!0)}function fc(n){nr[n.pointerId]=n;de++}function ec(n){nr[n.pointerId]&&(nr[n.pointerId]=n)}function os(n){delete nr[n.pointerId];de--}function sf(n,t){n.touches=[];for(var i in nr)n.touches.push(nr[i]);n.changedTouches=[n];t(n)}function oc(n,t,i){var r=function(n){(n.pointerType!==n.MSPOINTER_TYPE_MOUSE&&"mouse"!==n.pointerType||0!==n.buttons)&&sf(n,t)};n["_leaflet_touchmove"+i]=r;n.addEventListener(we,r,!1)}function sc(n,t,i){var r=function(n){sf(n,t)};n["_leaflet_touchend"+i]=r;n.addEventListener(be,r,!1);n.addEventListener(ke,r,!1)}function ss(n,t,i){function f(n){var i,t,f;if(vt){if(!wr||"mouse"===n.pointerType)return;i=de}else i=n.touches.length;i>1||(t=Date.now(),f=t-(u||t),r=n.touches?n.touches[0]:n,o=f>0&&f<=s,u=t)}function e(n){if(o&&!r.cancelBubble){if(vt){if(!wr||"mouse"===n.pointerType)return;var i,f,e={};for(f in r)i=r[f],e[f]=i&&i.bind?i.bind(r):i;r=e}r.type="dblclick";t(r);u=null}}var u,r,o=!1,s=250;return n[tr+bu+i]=f,n[tr+ku+i]=e,n[tr+"dblclick"+i]=t,n.addEventListener(bu,f,!1),n.addEventListener(ku,e,!1),n.addEventListener("dblclick",t,!1),this}function hs(n,t){var i=n[tr+bu+t],r=n[tr+ku+t],u=n[tr+"dblclick"+t];return n.removeEventListener(bu,i,!1),n.removeEventListener(ku,r,!1),wr||n.removeEventListener("dblclick",u,!1),this}function i(n,t,i,r){var f,u,e;if("object"==typeof t)for(f in t)ru(n,f,t[f],i);else for(u=0,e=(t=yi(t)).length;u<e;u++)ru(n,t[u],i,r);return this}function w(n,t,i,r){var f,u,o,e;if("object"==typeof t)for(f in t)hf(n,f,t[f],i);else if(t)for(u=0,o=(t=yi(t)).length;u<o;u++)hf(n,t[u],i,r);else{for(e in n[ot])hf(n,e,n[ot][e]);delete n[ot]}return this}function ru(n,t,i,r){var f=t+o(i)+(r?"_"+o(r):""),u,e;if(n[ot]&&n[ot][f])return this;u=function(t){return i.call(r||n,t||window.event)};e=u;vt&&0===t.indexOf("touch")?ic(n,t,u,f):!et||"dblclick"!==t||!ss||vt&&yu?"addEventListener"in n?"mousewheel"===t?n.addEventListener("onwheel"in n?"wheel":"mousewheel",u,!1):"mouseenter"===t||"mouseleave"===t?(u=function(t){t=t||window.event;uu(n,t)&&e(t)},n.addEventListener("mouseenter"===t?"mouseover":"mouseout",u,!1)):("click"===t&&br&&(u=function(n){hc(n,e)}),n.addEventListener(t,u,!1)):"attachEvent"in n&&n.attachEvent("on"+t,u):ss(n,u,f);n[ot]=n[ot]||{};n[ot][f]=u}function hf(n,t,i,r){var u=t+o(i)+(r?"_"+o(r):""),f=n[ot]&&n[ot][u];if(!f)return this;vt&&0===t.indexOf("touch")?rc(n,t,u):et&&"dblclick"===t&&hs?hs(n,u):"removeEventListener"in n?"mousewheel"===t?n.removeEventListener("onwheel"in n?"wheel":"mousewheel",f,!1):n.removeEventListener("mouseenter"===t?"mouseover":"mouseleave"===t?"mouseout":t,f,!1):"detachEvent"in n&&n.detachEvent("on"+t,f);n[ot][u]=null}function oi(n){return n.stopPropagation?n.stopPropagation():n.originalEvent?n.originalEvent._stopped=!0:n.cancelBubble=!0,af(n),this}function cf(n){return ru(n,"mousewheel",oi),this}function lr(n){return i(n,"mousedown touchstart dblclick",oi),ru(n,"click",lf),this}function rt(n){return n.preventDefault?n.preventDefault():n.returnValue=!1,this}function lt(n){return rt(n),oi(n),this}function cs(n,i){if(!i)return new t(n.clientX,n.clientY);var r=i.getBoundingClientRect();return new t(n.clientX-r.left-i.clientLeft,n.clientY-r.top-i.clientTop)}function ls(n){return wr?n.wheelDeltaY/2:n.deltaY&&0===n.deltaMode?-n.deltaY/tl:n.deltaY&&1===n.deltaMode?20*-n.deltaY:n.deltaY&&2===n.deltaMode?60*-n.deltaY:n.deltaX||n.deltaZ?0:n.wheelDelta?(n.wheelDeltaY||n.wheelDelta)/2:n.detail&&Math.abs(n.detail)<32765?20*-n.detail:n.detail?n.detail/-32765*60:0}function lf(n){ge[n.type]=!0}function af(n){var t=ge[n.type];return ge[n.type]=!1,t}function uu(n,t){var i=t.relatedTarget;if(!i)return!0;try{for(;i&&i!==n;)i=i.parentNode}catch(n){return!1}return i!==n}function hc(n,t){var r=n.timeStamp||n.originalEvent&&n.originalEvent.timeStamp,i=ee&&r-ee;i&&i>100&&i<500||n.target._simulatedClick&&!n._simulated?lt(n):(ee=r,t(n))}function as(n){return"string"==typeof n?document.getElementById(n):n}function ar(n,t){var i=n.style[t]||n.currentStyle&&n.currentStyle[t],r;return(!i||"auto"===i)&&document.defaultView&&(r=document.defaultView.getComputedStyle(n,null),i=r?r[t]:null),"auto"===i?null:i}function f(n,t,i){var r=document.createElement(n);return r.className=t||"",i&&i.appendChild(r),r}function l(n){var t=n.parentNode;t&&t.removeChild(n)}function vf(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function pi(n){var t=n.parentNode;t.lastChild!==n&&t.appendChild(n)}function wi(n){var t=n.parentNode;t.firstChild!==n&&t.insertBefore(n,t.firstChild)}function yf(n,t){if(void 0!==n.classList)return n.classList.contains(t);var i=fu(n);return i.length>0&&new RegExp("(^|\\s)"+t+"(\\s|$)").test(i)}function e(n,t){var r;if(void 0!==n.classList)for(var u=yi(t),i=0,f=u.length;i<f;i++)n.classList.add(u[i]);else yf(n,t)||(r=fu(n),pf(n,(r?r+" ":"")+t))}function p(n,t){void 0!==n.classList?n.classList.remove(t):pf(n,ff((" "+fu(n)+" ").replace(" "+t+" "," ")))}function pf(n,t){void 0===n.className.baseVal?n.className=t:n.className.baseVal=t}function fu(n){return void 0===n.className.baseVal?n.className:n.className.baseVal}function ut(n,t){"opacity"in n.style?n.style.opacity=t:"filter"in n.style&&cc(n,t)}function cc(n,t){var i=!1,r="DXImageTransform.Microsoft.Alpha";try{i=n.filters.item(r)}catch(n){if(1===t)return}t=Math.round(100*t);i?(i.Enabled=100!==t,i.Opacity=t):n.style.filter+=" progid:"+r+"(opacity="+t+")"}function eu(n){for(var i=document.documentElement.style,t=0;t<n.length;t++)if(n[t]in i)return n[t];return!1}function si(n,i,r){var u=i||new t(0,0);n.style[no]=(ve?"translate("+u.x+"px,"+u.y+"px)":"translate3d("+u.x+"px,"+u.y+"px,0)")+(r?" scale("+r+")":"")}function b(n,t){n._leaflet_pos=t;ft?si(n,t):(n.style.left=t.x+"px",n.style.top=t.y+"px")}function hi(n){return n._leaflet_pos||new t(0,0)}function wf(){i(window,"dragstart",rt)}function bf(){w(window,"dragstart",rt)}function kf(n){for(;-1===n.tabIndex;)n=n.parentNode;n.style&&(ou(),du=n,to=n.style.outline,n.style.outline="none",i(window,"keydown",ou))}function ou(){du&&(du.style.outline=to,du=void 0,to=void 0,w(window,"keydown",ou))}function vs(n,t){if(!t||!n.length)return n.slice();var i=t*t;return n=ac(n,i),n=lc(n,i)}function ys(n,t,i){return Math.sqrt(vr(n,t,i,!0))}function lc(n,t){var r=n.length,u=new(typeof Uint8Array!=void 0+""?Uint8Array:Array)(r),i,f;for(u[0]=u[r-1]=1,df(n,u,t,0,r-1),f=[],i=0;i<r;i++)u[i]&&f.push(n[i]);return f}function df(n,t,i,r,u){for(var e,s,o=0,f=r+1;f<=u-1;f++)(s=vr(n[f],n[r],n[u],!0))>o&&(e=f,o=s);o>i&&(t[e]=1,df(n,t,i,r,e),df(n,t,i,e,u))}function ac(n,t){for(var r=[n[0]],i=1,u=0,f=n.length;i<f;i++)vc(n[i],n[u])>t&&(r.push(n[i]),u=i);return u<f-1&&r.push(n[f-1]),r}function ps(n,t,i,r,u){var h,o,s,f=r?yh:ci(n,i),e=ci(t,i);for(yh=e;;){if(!(f|e))return[n,t];if(f&e)return!1;s=ci(o=su(n,t,h=f||e,i,u),i);h===f?(n=o,f=s):(t=o,e=s)}}function su(n,i,r,u,f){var e,o,s=i.x-n.x,h=i.y-n.y,c=u.min,l=u.max;return 8&r?(e=n.x+s*(l.y-n.y)/h,o=l.y):4&r?(e=n.x+s*(c.y-n.y)/h,o=c.y):2&r?(e=l.x,o=n.y+h*(l.x-n.x)/s):1&r&&(e=c.x,o=n.y+h*(c.x-n.x)/s),new t(e,o,f)}function ci(n,t){var i=0;return n.x<t.min.x?i|=1:n.x>t.max.x&&(i|=2),n.y<t.min.y?i|=4:n.y>t.max.y&&(i|=8),i}function vc(n,t){var i=t.x-n.x,r=t.y-n.y;return i*i+r*r}function vr(n,i,r,u){var h,o=i.x,s=i.y,f=r.x-o,e=r.y-s,c=f*f+e*e;return c>0&&((h=((n.x-o)*f+(n.y-s)*e)/c)>1?(o=r.x,s=r.y):h>0&&(o+=f*h,s+=e*h)),f=n.x-o,e=n.y-s,u?f*f+e*e:new t(o,s)}function bt(n){return!at(n[0])||"object"!=typeof n[0][0]&&void 0!==n[0][0]}function ws(n){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),bt(n)}function bs(n,t,i){for(var e,l,h,o,s,u,f,a=[1,4,2,8],r=0,c=n.length;r<c;r++)n[r]._code=ci(n[r],t);for(h=0;h<4;h++){for(u=a[h],e=[],r=0,l=(c=n.length)-1;r<c;l=r++)o=n[r],s=n[l],o._code&u?s._code&u||((f=su(s,o,u,t,i))._code=ci(f,t),e.push(f)):(s._code&u&&((f=su(s,o,u,t,i))._code=ci(f,t),e.push(f)),e.push(o));n=e}return n}function gf(n,t){var u,e,i,o,r="Feature"===n.type?n.geometry:n,f=r?r.coordinates:null,s=[],h=t&&t.pointToLayer,c=t&&t.coordsToLatLng||ne,l;if(!f&&!r)return null;switch(r.type){case"Point":return u=c(f),h?h(n,u):new tu(u);case"MultiPoint":for(i=0,o=f.length;i<o;i++)u=c(f[i]),s.push(h?h(n,u):new tu(u));return new ai(s);case"LineString":case"MultiLineString":return e=hu(f,"LineString"===r.type?0:1,c),new gt(e,t);case"Polygon":case"MultiPolygon":return e=hu(f,"Polygon"===r.type?1:2,c),new fr(e,t);case"GeometryCollection":for(i=0,o=r.geometries.length;i<o;i++)l=gf({geometry:r.geometries[i],type:"Feature",properties:n.properties},t),l&&s.push(l);return new ai(s);default:throw new Error("Invalid GeoJSON object.");}}function ne(n){return new h(n[1],n[0],n[2])}function hu(n,t,i){for(var u,f=[],r=0,e=n.length;r<e;r++)u=t?hu(n[r],t-1,i):(i||ne)(n[r]),f.push(u);return f}function te(n,t){return t="number"==typeof t?t:6,void 0!==n.alt?[ht(n.lng,t),ht(n.lat,t),ht(n.alt,t)]:[ht(n.lng,t),ht(n.lat,t)]}function cu(n,t,i,r){for(var u=[],f=0,e=n.length;f<e;f++)u.push(t?cu(n[f],t-1,i,r):te(n[f],r));return!t&&i&&u.push(u[0]),u}function bi(n,t){return n.feature?s({},n.feature,{geometry:t}):lu(t)}function lu(n){return"Feature"===n.type||"FeatureCollection"===n.type?n:{type:"Feature",properties:{},geometry:n}}function ks(n,t){return new ni(n,t)}function ds(n,t){return new or(n,t)}function ie(n){return ch?new ao(n):null}function re(n){return pu||wu?new sr(n):null}var gs=Object.freeze,tt,ki,ir,io,gu,ro,nf,it,vi,co,vo,yo,po,wo,bo,ko,go,ns,nc;Object.freeze=function(n){return n};var au=Object.create||function(){function n(){}return function(t){return n.prototype=t,new n}}(),nh=0,yc=/\{ *([\w_\-]+) *\}/g,at=Array.isArray||function(n){return"[object Array]"===Object.prototype.toString.call(n)},th="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=",ih=0,ue=window.requestAnimationFrame||ef("RequestAnimationFrame")||us,rh=window.cancelAnimationFrame||ef("CancelAnimationFrame")||ef("CancelRequestAnimationFrame")||function(n){window.clearTimeout(n)},pc=(Object.freeze||Object)({freeze:gs,extend:s,create:au,bind:c,lastId:nh,stamp:o,throttle:uf,wrapNum:hr,falseFn:d,formatNum:ht,trim:ff,splitWords:yi,setOptions:a,getParamString:ts,template:is,isArray:at,indexOf:rs,emptyImageUrl:th,requestFn:ue,cancelFn:rh,requestAnimFrame:g,cancelAnimFrame:ct});pt.extend=function(n){var i=function(){this.initialize&&this.initialize.apply(this,arguments);this.callInitHooks()},u=i.__super__=this.prototype,t=au(u),r;t.constructor=i;i.prototype=t;for(r in this)this.hasOwnProperty(r)&&"prototype"!==r&&"__super__"!==r&&(i[r]=this[r]);return n.statics&&(s(i,n.statics),delete n.statics),n.includes&&(tc(n.includes),s.apply(null,[t].concat(n.includes)),delete n.includes),t.options&&(n.options=s(au(t.options),n.options)),s(t,n),t._initHooks=[],t.callInitHooks=function(){if(!this._initHooksCalled){u.callInitHooks&&u.callInitHooks.call(this);this._initHooksCalled=!0;for(var n=0,i=t._initHooks.length;n<i;n++)t._initHooks[n].call(this)}},i};pt.include=function(n){return s(this.prototype,n),this};pt.mergeOptions=function(n){return s(this.prototype.options,n),this};pt.addInitHook=function(n){var t=Array.prototype.slice.call(arguments,1),i="function"==typeof n?n:function(){this[n].apply(this,t)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i),this};tt={on:function(n,t,i){var u,r,f;if("object"==typeof n)for(u in n)this._on(u,n[u],t);else for(r=0,f=(n=yi(n)).length;r<f;r++)this._on(n[r],t,i);return this},off:function(n,t,i){var u,r,f;if(n)if("object"==typeof n)for(u in n)this._off(u,n[u],t);else for(r=0,f=(n=yi(n)).length;r<f;r++)this._off(n[r],t,i);else delete this._events;return this},_on:function(n,t,i){var r;this._events=this._events||{};r=this._events[n];r||(r=[],this._events[n]=r);i===this&&(i=void 0);for(var e={fn:t,ctx:i},u=r,f=0,o=u.length;f<o;f++)if(u[f].fn===t&&u[f].ctx===i)return;u.push(e)},_off:function(n,t,i){var r,u,f,e;if(this._events&&(r=this._events[n]))if(t){if(i===this&&(i=void 0),r)for(u=0,f=r.length;u<f;u++)if(e=r[u],e.ctx===i&&e.fn===t)return e.fn=d,this._firingCount&&(this._events[n]=r=r.slice()),void r.splice(u,1)}else{for(u=0,f=r.length;u<f;u++)r[u].fn=d;delete this._events[n]}},fire:function(n,t,i){var f,r,u,o,e;if(!this.listens(n,i))return this;if(f=s({},t,{type:n,target:this}),this._events&&(r=this._events[n],r)){for(this._firingCount=this._firingCount+1||1,u=0,o=r.length;u<o;u++)e=r[u],e.fn.call(e.ctx||this,f);this._firingCount--}return i&&this._propagateEvent(f),this},listens:function(n,t){var i=this._events&&this._events[n],r;if(i&&i.length)return!0;if(t)for(r in this._eventParents)if(this._eventParents[r].listens(n,t))return!0;return!1},once:function(n,t,i){var r,u;if("object"==typeof n){for(r in n)this.once(r,n[r],t);return this}u=c(function(){this.off(n,t,i).off(n,u,i)},this);return this.on(n,t,i).on(n,u,i)},addEventParent:function(n){return this._eventParents=this._eventParents||{},this._eventParents[o(n)]=n,this},removeEventParent:function(n){return this._eventParents&&delete this._eventParents[o(n)],this},_propagateEvent:function(n){for(var t in this._eventParents)this._eventParents[t].fire(n.type,s({layer:n.target},n),!0)}};tt.addEventListener=tt.on;tt.removeEventListener=tt.clearAllEventListeners=tt.off;tt.addOneTimeEventListener=tt.once;tt.fireEvent=tt.fire;tt.hasEventListeners=tt.listens;ki=pt.extend(tt);t.prototype={clone:function(){return new t(this.x,this.y)},add:function(n){return this.clone()._add(r(n))},_add:function(n){return this.x+=n.x,this.y+=n.y,this},subtract:function(n){return this.clone()._subtract(r(n))},_subtract:function(n){return this.x-=n.x,this.y-=n.y,this},divideBy:function(n){return this.clone()._divideBy(n)},_divideBy:function(n){return this.x/=n,this.y/=n,this},multiplyBy:function(n){return this.clone()._multiplyBy(n)},_multiplyBy:function(n){return this.x*=n,this.y*=n,this},scaleBy:function(n){return new t(this.x*n.x,this.y*n.y)},unscaleBy:function(n){return new t(this.x/n.x,this.y/n.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},distanceTo:function(n){var t=(n=r(n)).x-this.x,i=n.y-this.y;return Math.sqrt(t*t+i*i)},equals:function(n){return(n=r(n)).x===this.x&&n.y===this.y},contains:function(n){return n=r(n),Math.abs(n.x)<=Math.abs(this.x)&&Math.abs(n.y)<=Math.abs(this.y)},toString:function(){return"Point("+ht(this.x)+", "+ht(this.y)+")"}};v.prototype={extend:function(n){return n=r(n),this.min||this.max?(this.min.x=Math.min(n.x,this.min.x),this.max.x=Math.max(n.x,this.max.x),this.min.y=Math.min(n.y,this.min.y),this.max.y=Math.max(n.y,this.max.y)):(this.min=n.clone(),this.max=n.clone()),this},getCenter:function(n){return new t((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,n)},getBottomLeft:function(){return new t(this.min.x,this.max.y)},getTopRight:function(){return new t(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(n){var i,u;return(n="number"==typeof n[0]||n instanceof t?r(n):ii(n))instanceof v?(i=n.min,u=n.max):i=u=n,i.x>=this.min.x&&u.x<=this.max.x&&i.y>=this.min.y&&u.y<=this.max.y},intersects:function(n){n=ii(n);var t=this.min,i=this.max,r=n.min,u=n.max,f=u.x>=t.x&&r.x<=i.x,e=u.y>=t.y&&r.y<=i.y;return f&&e},overlaps:function(n){n=ii(n);var t=this.min,i=this.max,r=n.min,u=n.max,f=u.x>t.x&&r.x<i.x,e=u.y>t.y&&r.y<i.y;return f&&e},isValid:function(){return!(!this.min||!this.max)}};nt.prototype={extend:function(n){var t,i,r=this._southWest,u=this._northEast;if(n instanceof h)t=n,i=n;else{if(!(n instanceof nt))return n?this.extend(y(n)||k(n)):this;if(t=n._southWest,i=n._northEast,!t||!i)return this}return r||u?(r.lat=Math.min(t.lat,r.lat),r.lng=Math.min(t.lng,r.lng),u.lat=Math.max(i.lat,u.lat),u.lng=Math.max(i.lng,u.lng)):(this._southWest=new h(t.lat,t.lng),this._northEast=new h(i.lat,i.lng)),this},pad:function(n){var t=this._southWest,i=this._northEast,r=Math.abs(t.lat-i.lat)*n,u=Math.abs(t.lng-i.lng)*n;return new nt(new h(t.lat-r,t.lng-u),new h(i.lat+r,i.lng+u))},getCenter:function(){return new h((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new h(this.getNorth(),this.getWest())},getSouthEast:function(){return new h(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(n){n="number"==typeof n[0]||n instanceof h||"lat"in n?y(n):k(n);var t,i,r=this._southWest,u=this._northEast;return n instanceof nt?(t=n.getSouthWest(),i=n.getNorthEast()):t=i=n,t.lat>=r.lat&&i.lat<=u.lat&&t.lng>=r.lng&&i.lng<=u.lng},intersects:function(n){n=k(n);var t=this._southWest,i=this._northEast,r=n.getSouthWest(),u=n.getNorthEast(),f=u.lat>=t.lat&&r.lat<=i.lat,e=u.lng>=t.lng&&r.lng<=i.lng;return f&&e},overlaps:function(n){n=k(n);var t=this._southWest,i=this._northEast,r=n.getSouthWest(),u=n.getNorthEast(),f=u.lat>t.lat&&r.lat<i.lat,e=u.lng>t.lng&&r.lng<i.lng;return f&&e},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(n,t){return!!n&&(n=k(n),this._southWest.equals(n.getSouthWest(),t)&&this._northEast.equals(n.getNorthEast(),t))},isValid:function(){return!(!this._southWest||!this._northEast)}};h.prototype={equals:function(n,t){return!!n&&(n=y(n),Math.max(Math.abs(this.lat-n.lat),Math.abs(this.lng-n.lng))<=(void 0===t?1e-9:t))},toString:function(n){return"LatLng("+ht(this.lat,n)+", "+ht(this.lng,n)+")"},distanceTo:function(n){return ri.distance(this,y(n))},wrap:function(){return ri.wrapLatLng(this)},toBounds:function(n){var t=180*n/40075017,i=t/Math.cos(Math.PI/180*this.lat);return k([this.lat-t,this.lng-i],[this.lat+t,this.lng+i])},clone:function(){return new h(this.lat,this.lng,this.alt)}};var kt={latLngToPoint:function(n,t){var i=this.projection.project(n),r=this.scale(t);return this.transformation._transform(i,r)},pointToLatLng:function(n,t){var i=this.scale(t),r=this.transformation.untransform(n,i);return this.projection.unproject(r)},project:function(n){return this.projection.project(n)},unproject:function(n){return this.projection.unproject(n)},scale:function(n){return 256*Math.pow(2,n)},zoom:function(n){return Math.log(n/256)/Math.LN2},getProjectedBounds:function(n){if(this.infinite)return null;var t=this.projection.bounds,i=this.scale(n);return new v(this.transformation.transform(t.min,i),this.transformation.transform(t.max,i))},infinite:!1,wrapLatLng:function(n){var t=this.wrapLng?hr(n.lng,this.wrapLng,!0):n.lng;return new h(this.wrapLat?hr(n.lat,this.wrapLat,!0):n.lat,t,n.alt)},wrapLatLngBounds:function(n){var t=n.getCenter(),e=this.wrapLatLng(t),i=t.lat-e.lat,r=t.lng-e.lng,u,f;return 0===i&&0===r?n:(u=n.getSouthWest(),f=n.getNorthEast(),new nt(new h(u.lat-i,u.lng-r),new h(f.lat-i,f.lng-r)))}},ri=s({},kt,{wrapLng:[-180,180],R:6371e3,distance:function(n,t){var i=Math.PI/180,r=n.lat*i,u=t.lat*i,f=Math.sin(r)*Math.sin(u)+Math.cos(r)*Math.cos(u)*Math.cos((t.lng-n.lng)*i);return this.R*Math.acos(Math.min(f,1))}}),fe={R:6378137,MAX_LATITUDE:85.0511287798,project:function(n){var i=Math.PI/180,r=this.MAX_LATITUDE,f=Math.max(Math.min(r,n.lat),-r),u=Math.sin(f*i);return new t(this.R*n.lng*i,this.R*Math.log((1+u)/(1-u))/2)},unproject:function(n){var t=180/Math.PI;return new h((2*Math.atan(Math.exp(n.y/this.R))-Math.PI/2)*t,n.x*t/this.R)},bounds:function(){var n=6378137*Math.PI;return new v([-n,-n],[n,n])}()};of.prototype={transform:function(n,t){return this._transform(n.clone(),t)},_transform:function(n,t){return t=t||1,n.x=t*(this._a*n.x+this._b),n.y=t*(this._c*n.y+this._d),n},untransform:function(n,i){return i=i||1,new t((n.x/i-this._b)/this._a,(n.y/i-this._d)/this._c)}};var ee,yr,pr,oe,se=s({},ri,{code:"EPSG:3857",projection:fe,transformation:function(){var n=.5/(Math.PI*fe.R);return cr(n,.5,-n,.5)}()}),wc=s({},se,{code:"EPSG:900913"}),he=document.documentElement.style,vu="ActiveXObject"in window,di=vu&&!document.addEventListener,wr="msLaunchUri"in navigator&&!("documentMode"in document),ce=wt("webkit"),br=wt("android"),kr=wt("android 2")||wt("android 3"),le=!!window.opera,yu=wt("chrome"),ae=wt("gecko")&&!ce&&!le&&!vu,uh=!yu&&wt("safari"),fh=wt("phantom"),eh="OTransition"in he,oh=0===navigator.platform.indexOf("Win"),ve=vu&&"transition"in he,ye="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!kr,sh="MozPerspective"in he,ft=!window.L_DISABLE_3D&&(ve||ye||sh)&&!eh&&!fh,gi="undefined"!=typeof orientation||wt("mobile"),bc=gi&&ce,kc=gi&&ye,ui=!window.PointerEvent&&window.MSPointerEvent,vt=!(!window.PointerEvent&&!ui),et=!window.L_NO_TOUCH&&(vt||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch),hh=gi&&le,dc=gi&&ae,fi=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,ch=!!document.createElement("canvas").getContext,pu=!(!document.createElementNS||!fs("svg").createSVGRect),wu=!pu&&function(){var t,n;try{return t=document.createElement("div"),t.innerHTML='<v:shape adj="1"/>',n=t.firstChild,n.style.behavior="url(#default#VML)",n&&"object"==typeof n.adj}catch(t){return!1}}(),gc=(Object.freeze||Object)({ie:vu,ielt9:di,edge:wr,webkit:ce,android:br,android23:kr,opera:le,chrome:yu,gecko:ae,safari:uh,phantom:fh,opera12:eh,win:oh,ie3d:ve,webkit3d:ye,gecko3d:sh,any3d:ft,mobile:gi,mobileWebkit:bc,mobileWebkit3d:kc,msPointer:ui,pointer:vt,touch:et,mobileOpera:hh,mobileGecko:dc,retina:fi,canvas:ch,svg:pu,vml:wu}),pe=ui?"MSPointerDown":"pointerdown",we=ui?"MSPointerMove":"pointermove",be=ui?"MSPointerUp":"pointerup",ke=ui?"MSPointerCancel":"pointercancel",nl=["INPUT","SELECT","OPTION"],nr={},lh=!1,de=0,bu=ui?"MSPointerDown":vt?"pointerdown":"touchstart",ku=ui?"MSPointerUp":vt?"pointerup":"touchend",tr="_leaflet_",ot="_leaflet_events",tl=oh&&yu?2*window.devicePixelRatio:ae?window.devicePixelRatio:1,ge={},il=(Object.freeze||Object)({on:i,off:w,stopPropagation:oi,disableScrollPropagation:cf,disableClickPropagation:lr,preventDefault:rt,stop:lt,getMousePosition:cs,getWheelDelta:ls,fakeStop:lf,skipped:af,isExternalTarget:uu,addListener:i,removeListener:w}),no=eu(["transform","WebkitTransform","OTransform","MozTransform","msTransform"]),dr=eu(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),ah="webkitTransition"===dr||"OTransition"===dr?dr+"End":"transitionend";"onselectstart"in document?(yr=function(){i(window,"selectstart",rt)},pr=function(){w(window,"selectstart",rt)}):(ir=eu(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]),yr=function(){if(ir){var n=document.documentElement.style;oe=n[ir];n[ir]="none"}},pr=function(){ir&&(document.documentElement.style[ir]=oe,oe=void 0)});var du,to,rl=(Object.freeze||Object)({TRANSFORM:no,TRANSITION:dr,TRANSITION_END:ah,get:as,getStyle:ar,create:f,remove:l,empty:vf,toFront:pi,toBack:wi,hasClass:yf,addClass:e,removeClass:p,setClass:pf,getClass:fu,setOpacity:ut,testProp:eu,setTransform:si,setPosition:b,getPosition:hi,disableTextSelection:yr,enableTextSelection:pr,disableImageDrag:wf,enableImageDrag:bf,preventOutline:kf,restoreOutline:ou}),vh=ki.extend({run:function(n,t,i,r){this.stop();this._el=n;this._inProgress=!0;this._duration=i||.25;this._easeOutPower=1/Math.max(r||.5,.2);this._startPos=hi(n);this._offset=t.subtract(this._startPos);this._startTime=+new Date;this.fire("start");this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=g(this._animate,this);this._step()},_step:function(n){var t=+new Date-this._startTime,i=1e3*this._duration;t<i?this._runFrame(this._easeOut(t/i),n):(this._runFrame(1),this._complete())},_runFrame:function(n,t){var i=this._startPos.add(this._offset.multiplyBy(n));t&&i._round();b(this._el,i);this.fire("step")},_complete:function(){ct(this._animId);this._inProgress=!1;this.fire("end")},_easeOut:function(n){return 1-Math.pow(1-n,this._easeOutPower)}}),u=ki.extend({options:{crs:se,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(n,t){t=a(this,t);this._initContainer(n);this._initLayout();this._onResize=c(this._onResize,this);this._initEvents();t.maxBounds&&this.setMaxBounds(t.maxBounds);void 0!==t.zoom&&(this._zoom=this._limitZoom(t.zoom));t.center&&void 0!==t.zoom&&this.setView(y(t.center),t.zoom,{reset:!0});this._handlers=[];this._layers={};this._zoomBoundLayers={};this._sizeChanged=!0;this.callInitHooks();this._zoomAnimated=dr&&ft&&!hh&&this.options.zoomAnimation;this._zoomAnimated&&(this._createAnimProxy(),i(this._proxy,ah,this._catchTransitionEnd,this));this._addLayers(this.options.layers)},setView:function(n,t,i){return t=void 0===t?this._zoom:this._limitZoom(t),n=this._limitCenter(y(n),t,this.options.maxBounds),i=i||{},this._stop(),this._loaded&&!i.reset&&!0!==i&&(void 0!==i.animate&&(i.zoom=s({animate:i.animate},i.zoom),i.pan=s({animate:i.animate,duration:i.duration},i.pan)),this._zoom!==t?this._tryAnimatedZoom&&this._tryAnimatedZoom(n,t,i.zoom):this._tryAnimatedPan(n,i.pan))?(clearTimeout(this._sizeTimer),this):(this._resetView(n,t),this)},setZoom:function(n,t){return this._loaded?this.setView(this.getCenter(),n,{zoom:t}):(this._zoom=n,this)},zoomIn:function(n,t){return n=n||(ft?this.options.zoomDelta:1),this.setZoom(this._zoom+n,t)},zoomOut:function(n,t){return n=n||(ft?this.options.zoomDelta:1),this.setZoom(this._zoom-n,t)},setZoomAround:function(n,i,r){var f=this.getZoomScale(i),u=this.getSize().divideBy(2),e=(n instanceof t?n:this.latLngToContainerPoint(n)).subtract(u).multiplyBy(1-1/f),o=this.containerPointToLatLng(u.add(e));return this.setView(o,i,{zoom:r})},_getBoundsCenterZoom:function(n,t){t=t||{};n=n.getBounds?n.getBounds():k(n);var u=r(t.paddingTopLeft||t.padding||[0,0]),f=r(t.paddingBottomRight||t.padding||[0,0]),i=this.getBoundsZoom(n,!1,u.add(f));if((i="number"==typeof t.maxZoom?Math.min(t.maxZoom,i):i)===1/0)return{center:n.getCenter(),zoom:i};var e=f.subtract(u).divideBy(2),o=this.project(n.getSouthWest(),i),s=this.project(n.getNorthEast(),i);return{center:this.unproject(o.add(s).divideBy(2).add(e),i),zoom:i}},fitBounds:function(n,t){if(!(n=k(n)).isValid())throw new Error("Bounds are not valid.");var i=this._getBoundsCenterZoom(n,t);return this.setView(i.center,i.zoom,t)},fitWorld:function(n){return this.fitBounds([[-90,-180],[90,180]],n)},panTo:function(n,t){return this.setView(n,this._zoom,{pan:t})},panBy:function(n,t){if(n=r(n).round(),t=t||{},!n.x&&!n.y)return this.fire("moveend");if(!0!==t.animate&&!this.getSize().contains(n))return this._resetView(this.unproject(this.project(this.getCenter()).add(n)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new vh,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),t.noMoveStart||this.fire("movestart"),!1!==t.animate){e(this._mapPane,"leaflet-pan-anim");var i=this._getMapPanePos().subtract(n).round();this._panAnim.run(this._mapPane,i,t.duration||.25,t.easeLinearity)}else this._rawPanBy(n),this.fire("move").fire("moveend");return this},flyTo:function(n,t,i){function a(n){var t=(l*l-r*r+(n?-1:1)*h*h*s*s)/(2*(n?l:r)*h*s),i=Math.sqrt(t*t+1)-t;return i<1e-9?-18:Math.log(i)}function v(n){return(Math.exp(n)-Math.exp(-n))/2}function e(n){return(Math.exp(n)+Math.exp(-n))/2}function d(n){return v(n)/e(n)}function nt(n){return r*(e(u)/e(u+f*n))}function tt(n){return r*(e(u)*d(u+f*n)-v(u))/h}function it(n){return 1-Math.pow(1-n,1.5)}function p(){var i=(Date.now()-rt)/ut,u=it(i)*k;i<=1?(this._flyToFrame=g(p,this),this._move(this.unproject(c.add(w.subtract(c).multiplyBy(tt(u)/s)),o),this.getScaleZoom(r/nt(u),o),{flyTo:!0})):this._move(n,t)._moveEnd(!0)}if(!1===(i=i||{}).animate||!ft)return this.setView(n,t,i);this._stop();var c=this.project(this.getCenter()),w=this.project(n),b=this.getSize(),o=this._zoom;n=y(n);t=void 0===t?o:t;var r=Math.max(b.x,b.y),l=r*this.getZoomScale(o,t),s=w.distanceTo(c)||1,f=1.42,h=f*f,u=a(0),rt=Date.now(),k=(a(1)-u)/f,ut=i.duration?1e3*i.duration:1e3*k*.8;return this._moveStart(!0),p.call(this),this},flyToBounds:function(n,t){var i=this._getBoundsCenterZoom(n,t);return this.flyTo(i.center,i.zoom,t)},setMaxBounds:function(n){return(n=k(n)).isValid()?(this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this.options.maxBounds=n,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this.off("moveend",this._panInsideMaxBounds))},setMinZoom:function(n){return this.options.minZoom=n,this._loaded&&this.getZoom()<this.options.minZoom?this.setZoom(n):this},setMaxZoom:function(n){return this.options.maxZoom=n,this._loaded&&this.getZoom()>this.options.maxZoom?this.setZoom(n):this},panInsideBounds:function(n,t){this._enforcingBounds=!0;var i=this.getCenter(),r=this._limitCenter(i,this._zoom,k(n));return i.equals(r)||this.panTo(r,t),this._enforcingBounds=!1,this},invalidateSize:function(n){var i;if(!this._loaded)return this;n=s({animate:!1,pan:!0},!0===n?{animate:!0}:n);i=this.getSize();this._sizeChanged=!0;this._lastCenter=null;var r=this.getSize(),u=i.divideBy(2).round(),f=r.divideBy(2).round(),t=u.subtract(f);return t.x||t.y?(n.animate&&n.pan?this.panBy(t):(n.pan&&this._rawPanBy(t),this.fire("move"),n.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(c(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:i,newSize:r})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(n){if(n=this._locateOptions=s({timeout:1e4,watch:!1},n),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var t=c(this._handleGeolocationResponse,this),i=c(this._handleGeolocationError,this);return n.watch?this._locationWatchId=navigator.geolocation.watchPosition(t,i,n):navigator.geolocation.getCurrentPosition(t,i,n),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(n){var t=n.code,i=n.message||(1===t?"permission denied":2===t?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld();this.fire("locationerror",{code:t,message:"Geolocation error: "+i+"."})},_handleGeolocationResponse:function(n){var i=new h(n.coords.latitude,n.coords.longitude),e=i.toBounds(n.coords.accuracy),r=this._locateOptions,u,f,t;r.setView&&(u=this.getBoundsZoom(e),this.setView(i,r.maxZoom?Math.min(u,r.maxZoom):u));f={latlng:i,bounds:e,timestamp:n.timestamp};for(t in n.coords)"number"==typeof n.coords[t]&&(f[t]=n.coords[t]);this.fire("locationfound",f)},addHandler:function(n,t){if(!t)return this;var i=this[n]=new t(this);return this._handlers.push(i),this.options[n]&&i.enable(),this},remove:function(){if(this._initEvents(!0),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id;delete this._containerId}catch(n){this._container._leaflet_id=void 0;this._containerId=void 0}l(this._mapPane);this._clearControlPos&&this._clearControlPos();this._clearHandlers();this._loaded&&this.fire("unload");for(var n in this._layers)this._layers[n].remove();for(n in this._panes)l(this._panes[n]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(n,t){var i=f("div","leaflet-pane"+(n?" leaflet-"+n.replace("Pane","")+"-pane":""),t||this._mapPane);return n&&(this._panes[n]=i),i},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var n=this.getPixelBounds();return new nt(this.unproject(n.getBottomLeft()),this.unproject(n.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(n,t,i){n=k(n);i=r(i||[0,0]);var u=this.getZoom()||0,c=this.getMinZoom(),l=this.getMaxZoom(),a=n.getNorthWest(),v=n.getSouthEast(),e=this.getSize().subtract(i),o=ii(this.project(v,u),this.project(a,u)).getSize(),f=ft?this.options.zoomSnap:1,s=e.x/o.x,h=e.y/o.y,y=t?Math.max(s,h):Math.min(s,h);return u=this.getScaleZoom(y,u),f&&(u=Math.round(u/(f/100))*(f/100),u=t?Math.ceil(u/f)*f:Math.floor(u/f)*f),Math.max(c,Math.min(l,u))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new t(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(n,t){var i=this._getTopLeftPoint(n,t);return new v(i,i.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(n){return this.options.crs.getProjectedBounds(void 0===n?this.getZoom():n)},getPane:function(n){return"string"==typeof n?this._panes[n]:n},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(n,t){var i=this.options.crs;return t=void 0===t?this._zoom:t,i.scale(n)/i.scale(t)},getScaleZoom:function(n,t){var r=this.options.crs,i;return t=void 0===t?this._zoom:t,i=r.zoom(n*r.scale(t)),isNaN(i)?1/0:i},project:function(n,t){return t=void 0===t?this._zoom:t,this.options.crs.latLngToPoint(y(n),t)},unproject:function(n,t){return t=void 0===t?this._zoom:t,this.options.crs.pointToLatLng(r(n),t)},layerPointToLatLng:function(n){var t=r(n).add(this.getPixelOrigin());return this.unproject(t)},latLngToLayerPoint:function(n){return this.project(y(n))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(n){return this.options.crs.wrapLatLng(y(n))},wrapLatLngBounds:function(n){return this.options.crs.wrapLatLngBounds(k(n))},distance:function(n,t){return this.options.crs.distance(y(n),y(t))},containerPointToLayerPoint:function(n){return r(n).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(n){return r(n).add(this._getMapPanePos())},containerPointToLatLng:function(n){var t=this.containerPointToLayerPoint(r(n));return this.layerPointToLatLng(t)},latLngToContainerPoint:function(n){return this.layerPointToContainerPoint(this.latLngToLayerPoint(y(n)))},mouseEventToContainerPoint:function(n){return cs(n,this._container)},mouseEventToLayerPoint:function(n){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(n))},mouseEventToLatLng:function(n){return this.layerPointToLatLng(this.mouseEventToLayerPoint(n))},_initContainer:function(n){var t=this._container=as(n);if(!t)throw new Error("Map container not found.");if(t._leaflet_id)throw new Error("Map container is already initialized.");i(t,"scroll",this._onScroll,this);this._containerId=o(t)},_initLayout:function(){var t=this._container,n;this._fadeAnimated=this.options.fadeAnimation&&ft;e(t,"leaflet-container"+(et?" leaflet-touch":"")+(fi?" leaflet-retina":"")+(di?" leaflet-oldie":"")+(uh?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));n=ar(t,"position");"absolute"!==n&&"relative"!==n&&"fixed"!==n&&(t.style.position="relative");this._initPanes();this._initControlPos&&this._initControlPos()},_initPanes:function(){var n=this._panes={};this._paneRenderers={};this._mapPane=this.createPane("mapPane",this._container);b(this._mapPane,new t(0,0));this.createPane("tilePane");this.createPane("shadowPane");this.createPane("overlayPane");this.createPane("markerPane");this.createPane("tooltipPane");this.createPane("popupPane");this.options.markerZoomAnimation||(e(n.markerPane,"leaflet-zoom-hide"),e(n.shadowPane,"leaflet-zoom-hide"))},_resetView:function(n,i){var u,r;b(this._mapPane,new t(0,0));u=!this._loaded;this._loaded=!0;i=this._limitZoom(i);this.fire("viewprereset");r=this._zoom!==i;this._moveStart(r)._move(n,i)._moveEnd(r);this.fire("viewreset");u&&this.fire("load")},_moveStart:function(n){return n&&this.fire("zoomstart"),this.fire("movestart")},_move:function(n,t,i){void 0===t&&(t=this._zoom);var r=this._zoom!==t;return this._zoom=t,this._lastCenter=n,this._pixelOrigin=this._getNewPixelOrigin(n),(r||i&&i.pinch)&&this.fire("zoom",i),this.fire("move",i)},_moveEnd:function(n){return n&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return ct(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(n){b(this._mapPane,this._getMapPanePos().subtract(n))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.");},_initEvents:function(n){this._targets={};this._targets[o(this._container)]=this;var t=n?w:i;t(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress",this._handleDOMEvent,this);this.options.trackResize&&t(window,"resize",this._onResize,this);ft&&this.options.transform3DLimit&&(n?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){ct(this._resizeRequest);this._resizeRequest=g(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0;this._container.scrollLeft=0},_onMoveEnd:function(){var n=this._getMapPanePos();Math.max(Math.abs(n.x),Math.abs(n.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(n,t){for(var r,u=[],f="mouseout"===t||"mouseover"===t,i=n.target||n.srcElement,e=!1;i;){if((r=this._targets[o(i)])&&("click"===t||"preclick"===t)&&!n._simulated&&this._draggableMoved(r)){e=!0;break}if(r&&r.listens(t,!0)){if(f&&!uu(i,n))break;if(u.push(r),f)break}if(i===this._container)break;i=i.parentNode}return u.length||e||f||!uu(i,n)||(u=[this]),u},_handleDOMEvent:function(n){if(this._loaded&&!af(n)){var t=n.type;"mousedown"!==t&&"keypress"!==t||kf(n.target||n.srcElement);this._fireDOMEvent(n,t)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(n,t,i){var e,u,r,o,f;if("click"===n.type&&(e=s({},n),e.type="preclick",this._fireDOMEvent(e,e.type,i)),!n._stopped&&(i=(i||[]).concat(this._findEventTargets(n,t))).length)for(u=i[0],"contextmenu"===t&&u.listens(t,!0)&&rt(n),r={originalEvent:n},"keypress"!==n.type&&(o=u.options&&"icon"in u.options,r.containerPoint=o?this.latLngToContainerPoint(u.getLatLng()):this.mouseEventToContainerPoint(n),r.layerPoint=this.containerPointToLayerPoint(r.containerPoint),r.latlng=o?u.getLatLng():this.layerPointToLatLng(r.layerPoint)),f=0;f<i.length;f++)if(i[f].fire(t,r,!0),r.originalEvent._stopped||!1===i[f].options.bubblingMouseEvents&&-1!==rs(this._mouseEvents,t))return},_draggableMoved:function(n){return(n=n.dragging&&n.dragging.enabled()?n:this).dragging&&n.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var n=0,t=this._handlers.length;n<t;n++)this._handlers[n].disable()},whenReady:function(n,t){return this._loaded?n.call(t||this,{target:this}):this.on("load",n,t),this},_getMapPanePos:function(){return hi(this._mapPane)||new t(0,0)},_moved:function(){var n=this._getMapPanePos();return n&&!n.equals([0,0])},_getTopLeftPoint:function(n,t){return(n&&void 0!==t?this._getNewPixelOrigin(n,t):this.getPixelOrigin()).subtract(this._getMapPanePos())},_getNewPixelOrigin:function(n,t){var i=this.getSize()._divideBy(2);return this.project(n,t)._subtract(i)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(n,t,i){var r=this._getNewPixelOrigin(i,t);return this.project(n,t)._subtract(r)},_latLngBoundsToNewLayerBounds:function(n,t,i){var r=this._getNewPixelOrigin(i,t);return ii([this.project(n.getSouthWest(),t)._subtract(r),this.project(n.getNorthWest(),t)._subtract(r),this.project(n.getSouthEast(),t)._subtract(r),this.project(n.getNorthEast(),t)._subtract(r)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(n){return this.latLngToLayerPoint(n).subtract(this._getCenterLayerPoint())},_limitCenter:function(n,t,i){if(!i)return n;var r=this.project(n,t),u=this.getSize().divideBy(2),e=new v(r.subtract(u),r.add(u)),f=this._getBoundsOffset(e,i,t);return f.round().equals([0,0])?n:this.unproject(r.add(f),t)},_limitOffset:function(n,t){if(!t)return n;var i=this.getPixelBounds(),r=new v(i.min.add(n),i.max.add(n));return n.add(this._getBoundsOffset(r,t))},_getBoundsOffset:function(n,i,r){var u=ii(this.project(i.getNorthEast(),r),this.project(i.getSouthWest(),r)),f=u.min.subtract(n.min),e=u.max.subtract(n.max);return new t(this._rebound(f.x,-e.x),this._rebound(f.y,-e.y))},_rebound:function(n,t){return n+t>0?Math.round(n-t)/2:Math.max(0,Math.ceil(n))-Math.max(0,Math.floor(t))},_limitZoom:function(n){var i=this.getMinZoom(),r=this.getMaxZoom(),t=ft?this.options.zoomSnap:1;return t&&(n=Math.round(n/t)*t),Math.max(i,Math.min(r,n))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){p(this._mapPane,"leaflet-pan-anim");this.fire("moveend")},_tryAnimatedPan:function(n,t){var i=this._getCenterOffset(n)._floor();return!(!0!==(t&&t.animate)&&!this.getSize().contains(i))&&(this.panBy(i,t),!0)},_createAnimProxy:function(){var n=this._proxy=f("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(n);this.on("zoomanim",function(n){var t=no,i=this._proxy.style[t];si(this._proxy,this.project(n.center,n.zoom),this.getZoomScale(n.zoom,1));i===this._proxy.style[t]&&this._animatingZoom&&this._onZoomTransitionEnd()},this);this.on("load moveend",function(){var t=this.getCenter(),n=this.getZoom();si(this._proxy,this.project(t,n),this.getZoomScale(n,1))},this);this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){l(this._proxy);delete this._proxy},_catchTransitionEnd:function(n){this._animatingZoom&&n.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(n,t,i){if(this._animatingZoom)return!0;if(i=i||{},!this._zoomAnimated||!1===i.animate||this._nothingToAnimate()||Math.abs(t-this._zoom)>this.options.zoomAnimationThreshold)return!1;var r=this.getZoomScale(t),u=this._getCenterOffset(n)._divideBy(1-1/r);return!(!0!==i.animate&&!this.getSize().contains(u))&&(g(function(){this._moveStart(!0)._animateZoom(n,t,!0)},this),!0)},_animateZoom:function(n,t,i,r){i&&(this._animatingZoom=!0,this._animateToCenter=n,this._animateToZoom=t,e(this._mapPane,"leaflet-zoom-anim"));this.fire("zoomanim",{center:n,zoom:t,noUpdate:r});setTimeout(c(this._onZoomTransitionEnd,this),250)},_onZoomTransitionEnd:function(){this._animatingZoom&&(p(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom),g(function(){this._moveEnd(!0)},this))}}),st=pt.extend({options:{position:"topright"},initialize:function(n){a(this,n)},getPosition:function(){return this.options.position},setPosition:function(n){var t=this._map;return t&&t.removeControl(this),this.options.position=n,t&&t.addControl(this),this},getContainer:function(){return this._container},addTo:function(n){this.remove();this._map=n;var t=this._container=this.onAdd(n),r=this.getPosition(),i=n._controlCorners[r];return e(t,"leaflet-control"),-1!==r.indexOf("bottom")?i.insertBefore(t,i.firstChild):i.appendChild(t),this},remove:function(){return this._map?(l(this._container),this.onRemove&&this.onRemove(this._map),this._map=null,this):this},_refocusOnMap:function(n){this._map&&n&&n.screenX>0&&n.screenY>0&&this._map.getContainer().focus()}}),gr=function(n){return new st(n)};u.include({addControl:function(n){return n.addTo(this),this},removeControl:function(n){return n.remove(),this},_initControlPos:function(){function n(n,u){var e=t+n+" "+t+u;i[n+u]=f("div",e,r)}var i=this._controlCorners={},t="leaflet-",r=this._controlContainer=f("div",t+"control-container",this._container);n("top","left");n("top","right");n("bottom","left");n("bottom","right")},_clearControlPos:function(){for(var n in this._controlCorners)l(this._controlCorners[n]);l(this._controlContainer);delete this._controlCorners;delete this._controlContainer}});io=st.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(n,t,i,r){return i<r?-1:r<i?1:0}},initialize:function(n,t,i){a(this,i);this._layerControlInputs=[];this._layers=[];this._lastZIndex=0;this._handlingClick=!1;for(var r in n)this._addLayer(n[r],r);for(r in t)this._addLayer(t[r],r,!0)},onAdd:function(n){this._initLayout();this._update();this._map=n;n.on("zoomend",this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(n){return st.prototype.addTo.call(this,n),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var n=0;n<this._layers.length;n++)this._layers[n].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(n,t){return this._addLayer(n,t),this._map?this._update():this},addOverlay:function(n,t){return this._addLayer(n,t,!0),this._map?this._update():this},removeLayer:function(n){n.off("add remove",this._onLayerChange,this);var t=this._getLayer(o(n));return t&&this._layers.splice(this._layers.indexOf(t),1),this._map?this._update():this},expand:function(){e(this._container,"leaflet-control-layers-expanded");this._form.style.height=null;var n=this._map.getSize().y-(this._container.offsetTop+50);return n<this._form.clientHeight?(e(this._form,"leaflet-control-layers-scrollbar"),this._form.style.height=n+"px"):p(this._form,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return p(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var n="leaflet-control-layers",t=this._container=f("div",n),e=this.options.collapsed,u,r;t.setAttribute("aria-haspopup",!0);lr(t);cf(t);u=this._form=f("form",n+"-list");e&&(this._map.on("click",this.collapse,this),br||i(t,{mouseenter:this.expand,mouseleave:this.collapse},this));r=this._layersLink=f("a",n+"-toggle",t);r.href="#";r.title="Layers";et?(i(r,"click",lt),i(r,"click",this.expand,this)):i(r,"focus",this.expand,this);e||this.expand();this._baseLayersList=f("div",n+"-base",u);this._separator=f("div",n+"-separator",u);this._overlaysList=f("div",n+"-overlays",u);t.appendChild(u)},_getLayer:function(n){for(var t=0;t<this._layers.length;t++)if(this._layers[t]&&o(this._layers[t].layer)===n)return this._layers[t]},_addLayer:function(n,t,i){this._map&&n.on("add remove",this._onLayerChange,this);this._layers.push({layer:n,name:t,overlay:i});this.options.sortLayers&&this._layers.sort(c(function(n,t){return this.options.sortFunction(n.layer,t.layer,n.name,t.name)},this));this.options.autoZIndex&&n.setZIndex&&(this._lastZIndex++,n.setZIndex(this._lastZIndex));this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;vf(this._baseLayersList);vf(this._overlaysList);this._layerControlInputs=[];for(var n,r,t,u=0,i=0;i<this._layers.length;i++)t=this._layers[i],this._addItem(t),r=r||t.overlay,n=n||!t.overlay,u+=t.overlay?0:1;return this.options.hideSingleBase&&(n=n&&u>1,this._baseLayersList.style.display=n?"":"none"),this._separator.style.display=r&&n?"":"none",this},_onLayerChange:function(n){this._handlingClick||this._update();var t=this._getLayer(o(n.target)),i=t.overlay?"add"===n.type?"overlayadd":"overlayremove":"add"===n.type?"baselayerchange":null;i&&this._map.fire(i,t)},_createRadioElement:function(n,t){var r='<input type="radio" class="leaflet-control-layers-selector" name="'+n+'"'+(t?' checked="checked"':"")+"/>",i=document.createElement("div");return i.innerHTML=r,i.firstChild},_addItem:function(n){var t,u=document.createElement("label"),e=this._map.hasLayer(n.layer),f,r;return n.overlay?((t=document.createElement("input")).type="checkbox",t.className="leaflet-control-layers-selector",t.defaultChecked=e):t=this._createRadioElement("leaflet-base-layers",e),this._layerControlInputs.push(t),t.layerId=o(n.layer),i(t,"click",this._onInputClick,this),f=document.createElement("span"),f.innerHTML=" "+n.name,r=document.createElement("div"),u.appendChild(r),r.appendChild(t),r.appendChild(f),(n.overlay?this._overlaysList:this._baseLayersList).appendChild(u),this._checkDisabledLayers(),u},_onInputClick:function(){var t,u,f=this._layerControlInputs,i=[],r=[],n;for(this._handlingClick=!0,n=f.length-1;n>=0;n--)t=f[n],u=this._getLayer(t.layerId).layer,t.checked?i.push(u):t.checked||r.push(u);for(n=0;n<r.length;n++)this._map.hasLayer(r[n])&&this._map.removeLayer(r[n]);for(n=0;n<i.length;n++)this._map.hasLayer(i[n])||this._map.addLayer(i[n]);this._handlingClick=!1;this._refocusOnMap()},_checkDisabledLayers:function(){for(var t,n,r=this._layerControlInputs,u=this._map.getZoom(),i=r.length-1;i>=0;i--)t=r[i],n=this._getLayer(t.layerId).layer,t.disabled=void 0!==n.options.minZoom&&u<n.options.minZoom||void 0!==n.options.maxZoom&&u>n.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expand:function(){return this.expand()},_collapse:function(){return this.collapse()}});gu=st.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"&#x2212;",zoomOutTitle:"Zoom out"},onAdd:function(n){var i="leaflet-control-zoom",r=f("div",i+" leaflet-bar"),t=this.options;return this._zoomInButton=this._createButton(t.zoomInText,t.zoomInTitle,i+"-in",r,this._zoomIn),this._zoomOutButton=this._createButton(t.zoomOutText,t.zoomOutTitle,i+"-out",r,this._zoomOut),this._updateDisabled(),n.on("zoomend zoomlevelschange",this._updateDisabled,this),r},onRemove:function(n){n.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(n){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(n.shiftKey?3:1))},_zoomOut:function(n){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(n.shiftKey?3:1))},_createButton:function(n,t,r,u,e){var o=f("a",r,u);return o.innerHTML=n,o.href="#",o.title=t,o.setAttribute("role","button"),o.setAttribute("aria-label",t),lr(o),i(o,"click",lt),i(o,"click",e,this),i(o,"click",this._refocusOnMap,this),o},_updateDisabled:function(){var n=this._map,t="leaflet-disabled";p(this._zoomInButton,t);p(this._zoomOutButton,t);(this._disabled||n._zoom===n.getMinZoom())&&e(this._zoomOutButton,t);(this._disabled||n._zoom===n.getMaxZoom())&&e(this._zoomInButton,t)}});u.mergeOptions({zoomControl:!0});u.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new gu,this.addControl(this.zoomControl))});ro=st.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(n){var t=f("div","leaflet-control-scale"),i=this.options;return this._addScales(i,"leaflet-control-scale-line",t),n.on(i.updateWhenIdle?"moveend":"move",this._update,this),n.whenReady(this._update,this),t},onRemove:function(n){n.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(n,t,i){n.metric&&(this._mScale=f("div",t,i));n.imperial&&(this._iScale=f("div",t,i))},_update:function(){var n=this._map,t=n.getSize().y/2,i=n.distance(n.containerPointToLatLng([0,t]),n.containerPointToLatLng([this.options.maxWidth,t]));this._updateScales(i)},_updateScales:function(n){this.options.metric&&n&&this._updateMetric(n);this.options.imperial&&n&&this._updateImperial(n)},_updateMetric:function(n){var t=this._getRoundNum(n),i=t<1e3?t+" m":t/1e3+" km";this._updateScale(this._mScale,i,t/n)},_updateImperial:function(n){var i,r,u,t=3.2808399*n;t>5280?(i=t/5280,r=this._getRoundNum(i),this._updateScale(this._iScale,r+" mi",r/i)):(u=this._getRoundNum(t),this._updateScale(this._iScale,u+" ft",u/t))},_updateScale:function(n,t,i){n.style.width=Math.round(this.options.maxWidth*i)+"px";n.innerHTML=t},_getRoundNum:function(n){var i=Math.pow(10,(Math.floor(n)+"").length-1),t=n/i;return t=t>=10?10:t>=5?5:t>=3?3:t>=2?2:1,i*t}});nf=st.extend({options:{position:"bottomright",prefix:'<a href="http://leafletjs.com" title="A JS library for interactive maps">Leaflet<\/a>'},initialize:function(n){a(this,n);this._attributions={}},onAdd:function(n){n.attributionControl=this;this._container=f("div","leaflet-control-attribution");lr(this._container);for(var t in n._layers)n._layers[t].getAttribution&&this.addAttribution(n._layers[t].getAttribution());return this._update(),this._container},setPrefix:function(n){return this.options.prefix=n,this._update(),this},addAttribution:function(n){return n?(this._attributions[n]||(this._attributions[n]=0),this._attributions[n]++,this._update(),this):this},removeAttribution:function(n){return n?(this._attributions[n]&&(this._attributions[n]--,this._update()),this):this},_update:function(){var n,i,t;if(this._map){n=[];for(i in this._attributions)this._attributions[i]&&n.push(i);t=[];this.options.prefix&&t.push(this.options.prefix);n.length&&t.push(n.join(", "));this._container.innerHTML=t.join(" | ")}}});u.mergeOptions({attributionControl:!0});u.addInitHook(function(){this.options.attributionControl&&(new nf).addTo(this)});st.Layers=io;st.Zoom=gu;st.Scale=ro;st.Attribution=nf;gr.layers=function(n,t,i){return new io(n,t,i)};gr.zoom=function(n){return new gu(n)};gr.scale=function(n){return new ro(n)};gr.attribution=function(n){return new nf(n)};var yh,dt=pt.extend({initialize:function(n){this._map=n},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}}),ul={Events:tt},ph=et?"touchstart mousedown":"mousedown",wh={mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},uo={mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"},li=ki.extend({options:{clickTolerance:3},initialize:function(n,t,i,r){a(this,r);this._element=n;this._dragStartTarget=t||n;this._preventOutline=i},enable:function(){this._enabled||(i(this._dragStartTarget,ph,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(li._dragging===this&&this.finishDrag(),w(this._dragStartTarget,ph,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(n){if(!n._simulated&&this._enabled&&(this._moved=!1,!yf(this._element,"leaflet-zoom-anim")&&!(li._dragging||n.shiftKey||1!==n.which&&1!==n.button&&!n.touches||(li._dragging=this,this._preventOutline&&kf(this._element),wf(),yr(),this._moving)))){this.fire("down");var r=n.touches?n.touches[0]:n;this._startPoint=new t(r.clientX,r.clientY);i(document,uo[n.type],this._onMove,this);i(document,wh[n.type],this._onUp,this)}},_onMove:function(n){if(!n._simulated&&this._enabled)if(n.touches&&n.touches.length>1)this._moved=!0;else{var r=n.touches&&1===n.touches.length?n.touches[0]:n,i=new t(r.clientX,r.clientY).subtract(this._startPoint);(i.x||i.y)&&(Math.abs(i.x)+Math.abs(i.y)<this.options.clickTolerance||(rt(n),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=hi(this._element).subtract(i),e(document.body,"leaflet-dragging"),this._lastTarget=n.target||n.srcElement,window.SVGElementInstance&&this._lastTarget instanceof SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),e(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(i),this._moving=!0,ct(this._animRequest),this._lastEvent=n,this._animRequest=g(this._updatePosition,this,!0)))}},_updatePosition:function(){var n={originalEvent:this._lastEvent};this.fire("predrag",n);b(this._element,this._newPos);this.fire("drag",n)},_onUp:function(n){!n._simulated&&this._enabled&&this.finishDrag()},finishDrag:function(){p(document.body,"leaflet-dragging");this._lastTarget&&(p(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null);for(var n in uo)w(document,uo[n],this._onMove,this),w(document,wh[n],this._onUp,this);bf();pr();this._moved&&this._moving&&(ct(this._animRequest),this.fire("dragend",{distance:this._newPos.distanceTo(this._startPos)}));this._moving=!1;li._dragging=!1}}),fl=(Object.freeze||Object)({simplify:vs,pointToSegmentDistance:ys,closestPointOnSegment:function(n,t,i){return vr(n,t,i)},clipSegment:ps,_getEdgeIntersection:su,_getBitCode:ci,_sqClosestPointOnSegment:vr,isFlat:bt,_flat:ws}),el=(Object.freeze||Object)({clipPolygon:bs}),fo={project:function(n){return new t(n.lng,n.lat)},unproject:function(n){return new h(n.y,n.x)},bounds:new v([-180,-90],[180,90])},eo={R:6378137,R_MINOR:6356752.3142451793,bounds:new v([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(n){var u=Math.PI/180,r=this.R,i=n.lat*u,f=this.R_MINOR/r,e=Math.sqrt(1-f*f),o=e*Math.sin(i),s=Math.tan(Math.PI/4-i/2)/Math.pow((1-o)/(1+o),e/2);return i=-r*Math.log(Math.max(s,1e-10)),new t(n.lng*u*r,i)},unproject:function(n){for(var t,u=180/Math.PI,r=this.R,f=this.R_MINOR/r,e=Math.sqrt(1-f*f),o=Math.exp(-n.y/r),i=Math.PI/2-2*Math.atan(o),s=0,c=.1;s<15&&Math.abs(c)>1e-7;s++)t=e*Math.sin(i),t=Math.pow((1-t)/(1+t),e/2),i+=c=Math.PI/2-2*Math.atan(o*t)-i;return new h(i*u,n.x*u/r)}},ol=(Object.freeze||Object)({LonLat:fo,Mercator:eo,SphericalMercator:fe}),sl=s({},ri,{code:"EPSG:3395",projection:eo,transformation:function(){var n=.5/(Math.PI*eo.R);return cr(n,.5,-n,.5)}()}),bh=s({},ri,{code:"EPSG:4326",projection:fo,transformation:cr(1/180,1,-1/180,.5)}),hl=s({},kt,{projection:fo,transformation:cr(1,0,-1,0),scale:function(n){return Math.pow(2,n)},zoom:function(n){return Math.log(n)/Math.LN2},distance:function(n,t){var i=t.lng-n.lng,r=t.lat-n.lat;return Math.sqrt(i*i+r*r)},infinite:!0});kt.Earth=ri;kt.EPSG3395=sl;kt.EPSG3857=se;kt.EPSG900913=wc;kt.EPSG4326=bh;kt.Simple=hl;it=ki.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(n){return n.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(n){return n&&n.removeLayer(this),this},getPane:function(n){return this._map.getPane(n?this.options[n]||n:this.options.pane)},addInteractiveTarget:function(n){return this._map._targets[o(n)]=this,this},removeInteractiveTarget:function(n){return delete this._map._targets[o(n)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(n){var t=n.target,i;t.hasLayer(this)&&((this._map=t,this._zoomAnimated=t._zoomAnimated,this.getEvents)&&(i=this.getEvents(),t.on(i,this),this.once("remove",function(){t.off(i,this)},this)),this.onAdd(t),this.getAttribution&&t.attributionControl&&t.attributionControl.addAttribution(this.getAttribution()),this.fire("add"),t.fire("layeradd",{layer:this}))}});u.include({addLayer:function(n){if(!n._layerAdd)throw new Error("The provided object is not a Layer.");var t=o(n);return this._layers[t]?this:(this._layers[t]=n,n._mapToAdd=this,n.beforeAdd&&n.beforeAdd(this),this.whenReady(n._layerAdd,n),this)},removeLayer:function(n){var t=o(n);return this._layers[t]?(this._loaded&&n.onRemove(this),n.getAttribution&&this.attributionControl&&this.attributionControl.removeAttribution(n.getAttribution()),delete this._layers[t],this._loaded&&(this.fire("layerremove",{layer:n}),n.fire("remove")),n._map=n._mapToAdd=null,this):this},hasLayer:function(n){return!!n&&o(n)in this._layers},eachLayer:function(n,t){for(var i in this._layers)n.call(t,this._layers[i]);return this},_addLayers:function(n){for(var t=0,i=(n=n?at(n)?n:[n]:[]).length;t<i;t++)this.addLayer(n[t])},_addZoomLimit:function(n){!isNaN(n.options.maxZoom)&&isNaN(n.options.minZoom)||(this._zoomBoundLayers[o(n)]=n,this._updateZoomLevels())},_removeZoomLimit:function(n){var t=o(n);this._zoomBoundLayers[t]&&(delete this._zoomBoundLayers[t],this._updateZoomLevels())},_updateZoomLevels:function(){var n=1/0,t=-1/0,u=this._getZoomSpan(),r,i;for(r in this._zoomBoundLayers)i=this._zoomBoundLayers[r].options,n=void 0===i.minZoom?n:Math.min(n,i.minZoom),t=void 0===i.maxZoom?t:Math.max(t,i.maxZoom);this._layersMaxZoom=t===-1/0?void 0:t;this._layersMinZoom=n===1/0?void 0:n;u!==this._getZoomSpan()&&this.fire("zoomlevelschange");void 0===this.options.maxZoom&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom);void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var rr=it.extend({initialize:function(n){this._layers={};var t,i;if(n)for(t=0,i=n.length;t<i;t++)this.addLayer(n[t])},addLayer:function(n){var t=this.getLayerId(n);return this._layers[t]=n,this._map&&this._map.addLayer(n),this},removeLayer:function(n){var t=n in this._layers?n:this.getLayerId(n);return this._map&&this._layers[t]&&this._map.removeLayer(this._layers[t]),delete this._layers[t],this},hasLayer:function(n){return!!n&&(n in this._layers||this.getLayerId(n)in this._layers)},clearLayers:function(){for(var n in this._layers)this.removeLayer(this._layers[n]);return this},invoke:function(n){var i,t,r=Array.prototype.slice.call(arguments,1);for(i in this._layers)(t=this._layers[i])[n]&&t[n].apply(t,r);return this},onAdd:function(n){for(var t in this._layers)n.addLayer(this._layers[t])},onRemove:function(n){for(var t in this._layers)n.removeLayer(this._layers[t])},eachLayer:function(n,t){for(var i in this._layers)n.call(t,this._layers[i]);return this},getLayer:function(n){return this._layers[n]},getLayers:function(){var n=[];for(var t in this._layers)n.push(this._layers[t]);return n},setZIndex:function(n){return this.invoke("setZIndex",n)},getLayerId:function(n){return o(n)}}),ai=rr.extend({addLayer:function(n){return this.hasLayer(n)?this:(n.addEventParent(this),rr.prototype.addLayer.call(this,n),this.fire("layeradd",{layer:n}))},removeLayer:function(n){return this.hasLayer(n)?(n in this._layers&&(n=this._layers[n]),n.removeEventParent(this),rr.prototype.removeLayer.call(this,n),this.fire("layerremove",{layer:n})):this},setStyle:function(n){return this.invoke("setStyle",n)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new nt,i,n;for(i in this._layers)n=this._layers[i],t.extend(n.getBounds?n.getBounds():n.getLatLng());return t}}),ur=pt.extend({initialize:function(n){a(this,n)},createIcon:function(n){return this._createIcon("icon",n)},createShadow:function(n){return this._createIcon("shadow",n)},_createIcon:function(n,t){var r=this._getIconUrl(n),i;if(!r){if("icon"===n)throw new Error("iconUrl not set in Icon options (see the docs).");return null}return i=this._createImg(r,t&&"IMG"===t.tagName?t:null),this._setIconStyles(i,n),i},_setIconStyles:function(n,t){var f=this.options,u=f[t+"Size"],i,e;"number"==typeof u&&(u=[u,u]);i=r(u);e=r("shadow"===t&&f.shadowAnchor||f.iconAnchor||i&&i.divideBy(2,!0));n.className="leaflet-marker-"+t+" "+(f.className||"");e&&(n.style.marginLeft=-e.x+"px",n.style.marginTop=-e.y+"px");i&&(n.style.width=i.x+"px",n.style.height=i.y+"px")},_createImg:function(n,t){return t=t||document.createElement("img"),t.src=n,t},_getIconUrl:function(n){return fi&&this.options[n+"RetinaUrl"]||this.options[n+"Url"]}}),nu=ur.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(n){return nu.imagePath||(nu.imagePath=this._detectIconPath()),(this.options.imagePath||nu.imagePath)+ur.prototype._getIconUrl.call(this,n)},_detectIconPath:function(){var t=f("div","leaflet-default-icon-path",document.body),n=ar(t,"background-image")||ar(t,"backgroundImage");return document.body.removeChild(t),n=null===n||0!==n.indexOf("url")?"":n.replace(/^url\([\"\']?/,"").replace(/marker-icon\.png[\"\']?\)$/,"")}}),kh=dt.extend({initialize:function(n){this._marker=n},addHooks:function(){var n=this._marker._icon;this._draggable||(this._draggable=new li(n,n,!0));this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this).enable();e(n,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this).disable();this._marker._icon&&p(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng();this._marker.closePopup().fire("movestart").fire("dragstart")},_onDrag:function(n){var t=this._marker,i=t._shadow,r=hi(t._icon),u=t._map.layerPointToLatLng(r);i&&b(i,r);t._latlng=u;n.latlng=u;n.oldLatLng=this._oldLatLng;t.fire("move",n).fire("drag",n)},_onDragEnd:function(n){delete this._oldLatLng;this._marker.fire("moveend").fire("dragend",n)}}),tu=it.extend({options:{icon:new nu,interactive:!0,draggable:!1,keyboard:!0,title:"",alt:"",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",bubblingMouseEvents:!1},initialize:function(n,t){a(this,t);this._latlng=y(n)},onAdd:function(n){this._zoomAnimated=this._zoomAnimated&&n.options.markerZoomAnimation;this._zoomAnimated&&n.on("zoomanim",this._animateZoom,this);this._initIcon();this.update()},onRemove:function(n){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks());delete this.dragging;this._zoomAnimated&&n.off("zoomanim",this._animateZoom,this);this._removeIcon();this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(n){var t=this._latlng;return this._latlng=y(n),this.update(),this.fire("move",{oldLatLng:t,latlng:this._latlng})},setZIndexOffset:function(n){return this.options.zIndexOffset=n,this.update()},setIcon:function(n){return this.options.icon=n,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon){var n=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(n)}return this},_initIcon:function(){var n=this.options,u="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),i=n.icon.createIcon(this._icon),f=!1,t,r;i!==this._icon&&(this._icon&&this._removeIcon(),f=!0,n.title&&(i.title=n.title),n.alt&&(i.alt=n.alt));e(i,u);n.keyboard&&(i.tabIndex="0");this._icon=i;n.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex});t=n.icon.createShadow(this._shadow);r=!1;t!==this._shadow&&(this._removeShadow(),r=!0);t&&(e(t,u),t.alt="");this._shadow=t;n.opacity<1&&this._updateOpacity();f&&this.getPane().appendChild(this._icon);this._initInteraction();t&&r&&this.getPane("shadowPane").appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex});l(this._icon);this.removeInteractiveTarget(this._icon);this._icon=null},_removeShadow:function(){this._shadow&&l(this._shadow);this._shadow=null},_setPos:function(n){b(this._icon,n);this._shadow&&b(this._shadow,n);this._zIndex=n.y+this.options.zIndexOffset;this._resetZIndex()},_updateZIndex:function(n){this._icon.style.zIndex=this._zIndex+n},_animateZoom:function(n){var t=this._map._latLngToNewLayerPoint(this._latlng,n.zoom,n.center).round();this._setPos(t)},_initInteraction:function(){if(this.options.interactive&&(e(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),kh)){var n=this.options.draggable;this.dragging&&(n=this.dragging.enabled(),this.dragging.disable());this.dragging=new kh(this);n&&this.dragging.enable()}},setOpacity:function(n){return this.options.opacity=n,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var n=this.options.opacity;ut(this._icon,n);this._shadow&&ut(this._shadow,n)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor||[0,0]},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor||[0,0]}}),ei=it.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(n){this._renderer=n.getRenderer(this)},onAdd:function(){this._renderer._initPath(this);this._reset();this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(n){return a(this,n),this._renderer&&this._renderer._updateStyle(this),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project();this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(et?10:0)}}),tf=ei.extend({options:{fill:!0,radius:10},initialize:function(n,t){a(this,t);this._latlng=y(n);this._radius=this.options.radius},setLatLng:function(n){return this._latlng=y(n),this.redraw(),this.fire("move",{latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(n){return this.options.radius=this._radius=n,this.redraw()},getRadius:function(){return this._radius},setStyle:function(n){var t=n&&n.radius||this._radius;return ei.prototype.setStyle.call(this,n),this.setRadius(t),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng);this._updateBounds()},_updateBounds:function(){var n=this._radius,r=this._radiusY||n,t=this._clickTolerance(),i=[n+t,r+t];this._pxBounds=new v(this._point.subtract(i),this._point.add(i))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(n){return n.distanceTo(this._point)<=this._radius+this._clickTolerance()}}),oo=tf.extend({initialize:function(n,t,i){if("number"==typeof t&&(t=s({},i,{radius:t})),a(this,t),this._latlng=y(n),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(n){return this._mRadius=n,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var n=[this._radius,this._radiusY||this._radius];return new nt(this._map.layerPointToLatLng(this._point.subtract(n)),this._map.layerPointToLatLng(this._point.add(n)))},setStyle:ei.prototype.setStyle,_project:function(){var e=this._latlng.lng,i=this._latlng.lat,n=this._map,o=n.options.crs,c;if(o.distance===ri.distance){var t=Math.PI/180,u=this._mRadius/ri.R/t,h=n.project([i+u,e]),l=n.project([i-u,e]),f=h.add(l).divideBy(2),s=n.unproject(f).lat,r=Math.acos((Math.cos(u*t)-Math.sin(i*t)*Math.sin(s*t))/(Math.cos(i*t)*Math.cos(s*t)))/t;(isNaN(r)||0===r)&&(r=u/Math.cos(Math.PI/180*i));this._point=f.subtract(n.getPixelOrigin());this._radius=isNaN(r)?0:Math.max(Math.round(f.x-n.project([s,e-r]).x),1);this._radiusY=Math.max(Math.round(f.y-h.y),1)}else c=o.unproject(o.project(this._latlng).subtract([this._mRadius,0])),this._point=n.latLngToLayerPoint(this._latlng),this._radius=this._point.x-n.latLngToLayerPoint(c).x;this._updateBounds()}}),gt=ei.extend({options:{smoothFactor:1,noClip:!1},initialize:function(n,t){a(this,t);this._setLatLngs(n)},getLatLngs:function(){return this._latlngs},setLatLngs:function(n){return this._setLatLngs(n),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(n){for(var e,o,s,r=1/0,t=null,h=vr,u=0,c=this._parts.length;u<c;u++)for(var f=this._parts[u],i=1,l=f.length;i<l;i++)e=h(n,o=f[i-1],s=f[i],!0),e<r&&(r=e,t=h(n,o,s));return t&&(t.distance=Math.sqrt(r)),t},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var n,r,f,e,u,t,o,i=this._rings[0],s=i.length;if(!s)return null;for(n=0,r=0;n<s-1;n++)r+=i[n].distanceTo(i[n+1])/2;if(0===r)return this._map.layerPointToLatLng(i[0]);for(n=0,e=0;n<s-1;n++)if(u=i[n],t=i[n+1],f=u.distanceTo(t),(e+=f)>r)return o=(e-r)/f,this._map.layerPointToLatLng([t.x-o*(t.x-u.x),t.y-o*(t.y-u.y)])},getBounds:function(){return this._bounds},addLatLng:function(n,t){return t=t||this._defaultShape(),n=y(n),t.push(n),this._bounds.extend(n),this.redraw()},_setLatLngs:function(n){this._bounds=new nt;this._latlngs=this._convertLatLngs(n)},_defaultShape:function(){return bt(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(n){for(var i=[],r=bt(n),t=0,u=n.length;t<u;t++)r?(i[t]=y(n[t]),this._bounds.extend(i[t])):i[t]=this._convertLatLngs(n[t]);return i},_project:function(){var n=new v,i,r;this._rings=[];this._projectLatlngs(this._latlngs,this._rings,n);i=this._clickTolerance();r=new t(i,i);this._bounds.isValid()&&n.isValid()&&(n.min._subtract(r),n.max._add(r),this._pxBounds=n)},_projectLatlngs:function(n,t,i){var r,u,e=n[0]instanceof h,f=n.length;if(e){for(u=[],r=0;r<f;r++)u[r]=this._map.latLngToLayerPoint(n[r]),i.extend(u[r]);t.push(u)}else for(r=0;r<f;r++)this._projectLatlngs(n[r],t,i)},_clipPoints:function(){var o=this._renderer._bounds,r,n,t,s,e,u,f,i;if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(o))if(this.options.noClip)this._parts=this._rings;else for(i=this._parts,r=0,t=0,s=this._rings.length;r<s;r++)for(n=0,e=(f=this._rings[r]).length;n<e-1;n++)(u=ps(f[n],f[n+1],o,n,!0))&&(i[t]=i[t]||[],i[t].push(u[0]),u[1]===f[n+1]&&n!==e-2||(i[t].push(u[1]),t++))},_simplifyPoints:function(){for(var t=this._parts,i=this.options.smoothFactor,n=0,r=t.length;n<r;n++)t[n]=vs(t[n],i)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(n,t){var r,i,u,e,o,f,s=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(n))return!1;for(r=0,e=this._parts.length;r<e;r++)for(i=0,u=(o=(f=this._parts[r]).length)-1;i<o;u=i++)if((t||0!==i)&&ys(n,f[u],f[i])<=s)return!0;return!1}});gt._flat=ws;var fr=gt.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var r,e,n,t,u,i,o,s,c,f=this._rings[0],h=f.length;if(!h)return null;for(i=o=s=0,r=0,e=h-1;r<h;e=r++)n=f[r],t=f[e],u=n.y*t.x-t.y*n.x,o+=(n.x+t.x)*u,s+=(n.y+t.y)*u,i+=3*u;return c=0===i?f[0]:[o/i,s/i],this._map.layerPointToLatLng(c)},_convertLatLngs:function(n){var t=gt.prototype._convertLatLngs.call(this,n),i=t.length;return i>=2&&t[0]instanceof h&&t[0].equals(t[i-1])&&t.pop(),t},_setLatLngs:function(n){gt.prototype._setLatLngs.call(this,n);bt(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return bt(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var n=this._renderer._bounds,r=this.options.weight,u=new t(r,r),f,i,e;if(n=new v(n.min.subtract(u),n.max.add(u)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(n))if(this.options.noClip)this._parts=this._rings;else for(i=0,e=this._rings.length;i<e;i++)(f=bs(this._rings[i],n,!0)).length&&this._parts.push(f)},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(n){var f,t,i,r,u,e,s,h,o=!1;if(!this._pxBounds.contains(n))return!1;for(r=0,s=this._parts.length;r<s;r++)for(u=0,e=(h=(f=this._parts[r]).length)-1;u<h;e=u++)t=f[u],i=f[e],t.y>n.y!=i.y>n.y&&n.x<(i.x-t.x)*(n.y-t.y)/(i.y-t.y)+t.x&&(o=!o);return o||gt.prototype._containsPoint.call(this,n,!0)}}),ni=ai.extend({initialize:function(n,t){a(this,t);this._layers={};n&&this.addData(n)},addData:function(n){var u,e,r,f=at(n)?n:n.features,i,t;if(f){for(u=0,e=f.length;u<e;u++)((r=f[u]).geometries||r.geometry||r.features||r.coordinates)&&this.addData(r);return this}return(i=this.options,i.filter&&!i.filter(n))?this:(t=gf(n,i),t?(t.feature=lu(n),t.defaultOptions=t.options,this.resetStyle(t),i.onEachFeature&&i.onEachFeature(n,t),this.addLayer(t)):this)},resetStyle:function(n){return n.options=s({},n.defaultOptions),this._setLayerStyle(n,this.options.style),this},setStyle:function(n){return this.eachLayer(function(t){this._setLayerStyle(t,n)},this)},_setLayerStyle:function(n,t){"function"==typeof t&&(t=t(n.feature));n.setStyle&&n.setStyle(t)}}),so={toGeoJSON:function(n){return bi(this,{type:"Point",coordinates:te(this.getLatLng(),n)})}};tu.include(so);oo.include(so);tf.include(so);gt.include({toGeoJSON:function(n){var t=!bt(this._latlngs),i=cu(this._latlngs,t?1:0,!1,n);return bi(this,{type:(t?"Multi":"")+"LineString",coordinates:i})}});fr.include({toGeoJSON:function(n){var t=!bt(this._latlngs),r=t&&!bt(this._latlngs[0]),i=cu(this._latlngs,r?2:t?1:0,!0,n);return t||(i=[i]),bi(this,{type:(r?"Multi":"")+"Polygon",coordinates:i})}});rr.include({toMultiPoint:function(n){var t=[];return this.eachLayer(function(i){t.push(i.toGeoJSON(n).geometry.coordinates)}),bi(this,{type:"MultiPoint",coordinates:t})},toGeoJSON:function(n){var r=this.feature&&this.feature.geometry&&this.feature.geometry.type,i,t;return"MultiPoint"===r?this.toMultiPoint(n):(i="GeometryCollection"===r,t=[],this.eachLayer(function(r){var f,u;r.toGeoJSON&&(f=r.toGeoJSON(n),i?t.push(f.geometry):(u=lu(f),"FeatureCollection"===u.type?t.push.apply(t,u.features):t.push(u)))}),i?bi(this,{geometries:t,type:"GeometryCollection"}):{type:"FeatureCollection",features:t})}});var cl=ks,ho=it.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(n,t,i){this._url=n;this._bounds=k(t);a(this,i)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity());this.options.interactive&&(e(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image));this.getPane().appendChild(this._image);this._reset()},onRemove:function(){l(this._image);this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(n){return this.options.opacity=n,this._image&&this._updateOpacity(),this},setStyle:function(n){return n.opacity&&this.setOpacity(n.opacity),this},bringToFront:function(){return this._map&&pi(this._image),this},bringToBack:function(){return this._map&&wi(this._image),this},setUrl:function(n){return this._url=n,this._image&&(this._image.src=n),this},setBounds:function(n){return this._bounds=k(n),this._map&&this._reset(),this},getEvents:function(){var n={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(n.zoomanim=this._animateZoom),n},setZIndex:function(n){return this.options.zIndex=n,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var n=this._image=f("img","leaflet-image-layer "+(this._zoomAnimated?"leaflet-zoom-animated":"")+(this.options.className||""));n.onselectstart=d;n.onmousemove=d;n.onload=c(this.fire,this,"load");n.onerror=c(this._overlayOnError,this,"error");this.options.crossOrigin&&(n.crossOrigin="");this.options.zIndex&&this._updateZIndex();n.src=this._url;n.alt=this.options.alt},_animateZoom:function(n){var t=this._map.getZoomScale(n.zoom),i=this._map._latLngBoundsToNewLayerBounds(this._bounds,n.zoom,n.center).min;si(this._image,i,t)},_reset:function(){var n=this._image,t=new v(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),i=t.getSize();b(n,t.min);n.style.width=i.x+"px";n.style.height=i.y+"px"},_updateOpacity:function(){ut(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var n=this.options.errorOverlayUrl;n&&this._url!==n&&(this._url=n,this._image.src=n)}}),dh=ho.extend({options:{autoplay:!0,loop:!0},_initImage:function(){var r="VIDEO"===this._url.tagName,n=this._image=r?this._url:f("video"),t,i;if(n.class=n.class||"",n.class+="leaflet-image-layer "+(this._zoomAnimated?"leaflet-zoom-animated":""),n.onselectstart=d,n.onmousemove=d,n.onloadeddata=c(this.fire,this,"load"),!r)for(at(this._url)||(this._url=[this._url]),n.autoplay=!!this.options.autoplay,n.loop=!!this.options.loop,t=0;t<this._url.length;t++)i=f("source"),i.src=this._url[t],n.appendChild(i)}}),ti=it.extend({options:{offset:[0,7],className:"",pane:"popupPane"},initialize:function(n,t){a(this,n);this._source=t},onAdd:function(n){this._zoomAnimated=n._zoomAnimated;this._container||this._initLayout();n._fadeAnimated&&ut(this._container,0);clearTimeout(this._removeTimeout);this.getPane().appendChild(this._container);this.update();n._fadeAnimated&&ut(this._container,1);this.bringToFront()},onRemove:function(n){n._fadeAnimated?(ut(this._container,0),this._removeTimeout=setTimeout(c(l,void 0,this._container),200)):l(this._container)},getLatLng:function(){return this._latlng},setLatLng:function(n){return this._latlng=y(n),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(n){return this._content=n,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var n={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(n.zoomanim=this._animateZoom),n},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&pi(this._container),this},bringToBack:function(){return this._map&&wi(this._container),this},_updateContent:function(){if(this._content){var n=this._contentNode,t="function"==typeof this._content?this._content(this._source||this):this._content;if("string"==typeof t)n.innerHTML=t;else{for(;n.hasChildNodes();)n.removeChild(n.firstChild);n.appendChild(t)}this.fire("contentupdate")}},_updatePosition:function(){var u,f;if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),n=r(this.options.offset),i=this._getAnchor();this._zoomAnimated?b(this._container,t.add(i)):n=n.add(t).add(i);u=this._containerBottom=-n.y;f=this._containerLeft=-Math.round(this._containerWidth/2)+n.x;this._container.style.bottom=u+"px";this._container.style.left=f+"px"}},_getAnchor:function(){return[0,0]}}),er=ti.extend({options:{maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,className:""},openOn:function(n){return n.openPopup(this),this},onAdd:function(n){ti.prototype.onAdd.call(this,n);n.fire("popupopen",{popup:this});this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof ei||this._source.on("preclick",oi))},onRemove:function(n){ti.prototype.onRemove.call(this,n);n.fire("popupclose",{popup:this});this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof ei||this._source.off("preclick",oi))},getEvents:function(){var n=ti.prototype.getEvents.call(this);return(void 0!==this.options.closeOnClick?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(n.preclick=this._close),this.options.keepInView&&(n.moveend=this._adjustPan),n},_close:function(){this._map&&this._map.closePopup(this)},_initLayout:function(){var n="leaflet-popup",r=this._container=f("div",n+" "+(this.options.className||"")+" leaflet-zoom-animated"),u=this._wrapper=f("div",n+"-content-wrapper",r),t;(this._contentNode=f("div",n+"-content",u),lr(u),cf(this._contentNode),i(u,"contextmenu",oi),this._tipContainer=f("div",n+"-tip-container",r),this._tip=f("div",n+"-tip",this._tipContainer),this.options.closeButton)&&(t=this._closeButton=f("a",n+"-close-button",r),t.href="#close",t.innerHTML="&#215;",i(t,"click",this._onCloseButtonClick,this))},_updateLayout:function(){var i=this._contentNode,n=i.style,t,u,r;n.width="";n.whiteSpace="nowrap";t=i.offsetWidth;t=Math.min(t,this.options.maxWidth);t=Math.max(t,this.options.minWidth);n.width=t+1+"px";n.whiteSpace="";n.height="";u=i.offsetHeight;r=this.options.maxHeight;r&&u>r?(n.height=r+"px",e(i,"leaflet-popup-scrolled")):p(i,"leaflet-popup-scrolled");this._containerWidth=this._container.offsetWidth},_animateZoom:function(n){var t=this._map._latLngToNewLayerPoint(this._latlng,n.zoom,n.center),i=this._getAnchor();b(this._container,t.add(i))},_adjustPan:function(){if(!(!this.options.autoPan||this._map._panAnim&&this._map._panAnim._inProgress)){var s=this._map,v=parseInt(ar(this._container,"marginBottom"),10)||0,h=this._container.offsetHeight+v,c=this._containerWidth,l=new t(this._containerLeft,-h-this._containerBottom);l._add(hi(this._container));var n=s.layerPointToContainerPoint(l),a=r(this.options.autoPanPadding),f=r(this.options.autoPanPaddingTopLeft||a),e=r(this.options.autoPanPaddingBottomRight||a),o=s.getSize(),i=0,u=0;n.x+c+e.x>o.x&&(i=n.x+c-o.x+e.x);n.x-i-f.x<0&&(i=n.x-f.x);n.y+h+e.y>o.y&&(u=n.y+h-o.y+e.y);n.y-u-f.y<0&&(u=n.y-f.y);(i||u)&&s.fire("autopanstart").panBy([i,u])}},_onCloseButtonClick:function(n){this._close();lt(n)},_getAnchor:function(){return r(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}});u.mergeOptions({closePopupOnClick:!0});u.include({openPopup:function(n,t,i){return n instanceof er||(n=new er(i).setContent(n)),t&&n.setLatLng(t),this.hasLayer(n)?this:(this._popup&&this._popup.options.autoClose&&this.closePopup(),this._popup=n,this.addLayer(n))},closePopup:function(n){return n&&n!==this._popup||(n=this._popup,this._popup=null),n&&this.removeLayer(n),this}});it.include({bindPopup:function(n,t){return n instanceof er?(a(n,t),this._popup=n,n._source=this):(this._popup&&!t||(this._popup=new er(t,this)),this._popup.setContent(n)),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(n,t){if(n instanceof it||(t=n,n=this),n instanceof ai)for(var i in this._layers){n=this._layers[i];break}return t||(t=n.getCenter?n.getCenter():n.getLatLng()),this._popup&&this._map&&(this._popup._source=n,this._popup.update(),this._map.openPopup(this._popup,t)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(n){return this._popup&&(this._popup._map?this.closePopup():this.openPopup(n)),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(n){return this._popup&&this._popup.setContent(n),this},getPopup:function(){return this._popup},_openPopup:function(n){var t=n.layer||n.target;this._popup&&this._map&&(lt(n),t instanceof ei?this.openPopup(n.layer||n.target,n.latlng):this._map.hasLayer(this._popup)&&this._popup._source===t?this.closePopup():this.openPopup(t,n.latlng))},_movePopup:function(n){this._popup.setLatLng(n.latlng)},_onKeyPress:function(n){13===n.originalEvent.keyCode&&this._openPopup(n)}});vi=ti.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,interactive:!1,opacity:.9},onAdd:function(n){ti.prototype.onAdd.call(this,n);this.setOpacity(this.options.opacity);n.fire("tooltipopen",{tooltip:this});this._source&&this._source.fire("tooltipopen",{tooltip:this},!0)},onRemove:function(n){ti.prototype.onRemove.call(this,n);n.fire("tooltipclose",{tooltip:this});this._source&&this._source.fire("tooltipclose",{tooltip:this},!0)},getEvents:function(){var n=ti.prototype.getEvents.call(this);return et&&!this.options.permanent&&(n.preclick=this._close),n},_close:function(){this._map&&this._map.closeTooltip(this)},_initLayout:function(){var n="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=f("div",n)},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(n){var h=this._map,i=this._container,c=h.latLngToContainerPoint(h.getCenter()),l=h.layerPointToContainerPoint(n),u=this.options.direction,o=i.offsetWidth,s=i.offsetHeight,t=r(this.options.offset),f=this._getAnchor();"top"===u?n=n.add(r(-o/2+t.x,-s+t.y+f.y,!0)):"bottom"===u?n=n.subtract(r(o/2-t.x,-t.y,!0)):"center"===u?n=n.subtract(r(o/2+t.x,s/2-f.y+t.y,!0)):"right"===u||"auto"===u&&l.x<c.x?(u="right",n=n.add(r(t.x+f.x,f.y-s/2+t.y,!0))):(u="left",n=n.subtract(r(o+f.x-t.x,s/2-f.y-t.y,!0)));p(i,"leaflet-tooltip-right");p(i,"leaflet-tooltip-left");p(i,"leaflet-tooltip-top");p(i,"leaflet-tooltip-bottom");e(i,"leaflet-tooltip-"+u);b(i,n)},_updatePosition:function(){var n=this._map.latLngToLayerPoint(this._latlng);this._setPosition(n)},setOpacity:function(n){this.options.opacity=n;this._container&&ut(this._container,n)},_animateZoom:function(n){var t=this._map._latLngToNewLayerPoint(this._latlng,n.zoom,n.center);this._setPosition(t)},_getAnchor:function(){return r(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}});u.include({openTooltip:function(n,t,i){return n instanceof vi||(n=new vi(i).setContent(n)),t&&n.setLatLng(t),this.hasLayer(n)?this:this.addLayer(n)},closeTooltip:function(n){return n&&this.removeLayer(n),this}});it.include({bindTooltip:function(n,t){return n instanceof vi?(a(n,t),this._tooltip=n,n._source=this):(this._tooltip&&!t||(this._tooltip=new vi(t,this)),this._tooltip.setContent(n)),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(n){if(n||!this._tooltipHandlersAdded){var i=n?"off":"on",t={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?t.add=this._openTooltip:(t.mouseover=this._openTooltip,t.mouseout=this.closeTooltip,this._tooltip.options.sticky&&(t.mousemove=this._moveTooltip),et&&(t.click=this._openTooltip));this[i](t);this._tooltipHandlersAdded=!n}},openTooltip:function(n,t){if(n instanceof it||(t=n,n=this),n instanceof ai)for(var i in this._layers){n=this._layers[i];break}return t||(t=n.getCenter?n.getCenter():n.getLatLng()),this._tooltip&&this._map&&(this._tooltip._source=n,this._tooltip.update(),this._map.openTooltip(this._tooltip,t),this._tooltip.options.interactive&&this._tooltip._container&&(e(this._tooltip._container,"leaflet-clickable"),this.addInteractiveTarget(this._tooltip._container))),this},closeTooltip:function(){return this._tooltip&&(this._tooltip._close(),this._tooltip.options.interactive&&this._tooltip._container&&(p(this._tooltip._container,"leaflet-clickable"),this.removeInteractiveTarget(this._tooltip._container))),this},toggleTooltip:function(n){return this._tooltip&&(this._tooltip._map?this.closeTooltip():this.openTooltip(n)),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(n){return this._tooltip&&this._tooltip.setContent(n),this},getTooltip:function(){return this._tooltip},_openTooltip:function(n){var t=n.layer||n.target;this._tooltip&&this._map&&this.openTooltip(t,this._tooltip.options.sticky?n.latlng:void 0)},_moveTooltip:function(n){var t,i,r=n.latlng;this._tooltip.options.sticky&&n.originalEvent&&(t=this._map.mouseEventToContainerPoint(n.originalEvent),i=this._map.containerPointToLayerPoint(t),r=this._map.layerPointToLatLng(i));this._tooltip.setLatLng(r)}});co=ur.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(n){var t=n&&"DIV"===n.tagName?n:document.createElement("div"),i=this.options,u;return(t.innerHTML=!1!==i.html?i.html:"",i.bgPos)&&(u=r(i.bgPos),t.style.backgroundPosition=-u.x+"px "+-u.y+"px"),this._setIconStyles(t,"icon"),t},createShadow:function(){return null}});ur.Default=nu;var lo=it.extend({options:{tileSize:256,opacity:1,updateWhenIdle:gi,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(n){a(this,n)},onAdd:function(){this._initContainer();this._levels={};this._tiles={};this._resetView();this._update()},beforeAdd:function(n){n._addZoomLimit(this)},onRemove:function(n){this._removeAllTiles();l(this._container);n._removeZoomLimit(this);this._container=null;this._tileZoom=null},bringToFront:function(){return this._map&&(pi(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(wi(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(n){return this.options.opacity=n,this._updateOpacity(),this},setZIndex:function(n){return this.options.zIndex=n,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){return this._map&&(this._removeAllTiles(),this._update()),this},getEvents:function(){var n={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=uf(this._onMoveEnd,this.options.updateInterval,this)),n.move=this._onMove),this._zoomAnimated&&(n.zoomanim=this._animateZoom),n},createTile:function(){return document.createElement("div")},getTileSize:function(){var n=this.options.tileSize;return n instanceof t?n:new t(n,n)},_updateZIndex:function(){this._container&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(n){for(var r,u=this.getPane().children,t=-n(-1/0,1/0),i=0,f=u.length;i<f;i++)r=u[i].style.zIndex,u[i]!==this._container&&r&&(t=n(t,+r));isFinite(t)&&(this.options.zIndex=t+n(-1,1),this._updateZIndex())},_updateOpacity:function(){var u,n,t;if(this._map&&!di){ut(this._container,this.options.opacity);var f=+new Date,i=!1,r=!1;for(u in this._tiles)n=this._tiles[u],n.current&&n.loaded&&(t=Math.min(1,(f-n.loaded)/200),ut(n.el,t),t<1?i=!0:(n.active?r=!0:this._onOpaqueTile(n),n.active=!0));r&&!this._noPrune&&this._pruneTiles();i&&(ct(this._fadeFrame),this._fadeFrame=g(this._updateOpacity,this))}},_onOpaqueTile:d,_initContainer:function(){this._container||(this._container=f("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var i=this._tileZoom,u=this.options.maxZoom,t,n,r;if(void 0!==i){for(t in this._levels)this._levels[t].el.children.length||t===i?(this._levels[t].el.style.zIndex=u-Math.abs(i-t),this._onUpdateLevel(t)):(l(this._levels[t].el),this._removeTilesAtZoom(t),this._onRemoveLevel(t),delete this._levels[t]);return n=this._levels[i],r=this._map,n||((n=this._levels[i]={}).el=f("div","leaflet-tile-container leaflet-zoom-animated",this._container),n.el.style.zIndex=u,n.origin=r.project(r.unproject(r.getPixelOrigin()),i).round(),n.zoom=i,this._setZoomTransform(n,r.getCenter(),r.getZoom()),n.el.offsetWidth,this._onCreateLevel(n)),this._level=n,n}},_onUpdateLevel:d,_onRemoveLevel:d,_onCreateLevel:d,_pruneTiles:function(){var t,i,r,n;if(this._map)if(r=this._map.getZoom(),r>this.options.maxZoom||r<this.options.minZoom)this._removeAllTiles();else{for(t in this._tiles)(i=this._tiles[t]).retain=i.current;for(t in this._tiles)(i=this._tiles[t]).current&&!i.active&&(n=i.coords,this._retainParent(n.x,n.y,n.z,n.z-5)||this._retainChildren(n.x,n.y,n.z,n.z+2));for(t in this._tiles)this._tiles[t].retain||this._removeTile(t)}},_removeTilesAtZoom:function(n){for(var t in this._tiles)this._tiles[t].coords.z===n&&this._removeTile(t)},_removeAllTiles:function(){for(var n in this._tiles)this._removeTile(n)},_invalidateAll:function(){for(var n in this._levels)l(this._levels[n].el),this._onRemoveLevel(n),delete this._levels[n];this._removeAllTiles();this._tileZoom=null},_retainParent:function(n,i,r,u){var o=Math.floor(n/2),s=Math.floor(i/2),e=r-1,h=new t(+o,+s),c,f;return h.z=+e,c=this._tileCoordsToKey(h),f=this._tiles[c],f&&f.active?(f.retain=!0,!0):(f&&f.loaded&&(f.retain=!0),e>u&&this._retainParent(o,s,e,u))},_retainChildren:function(n,i,r,u){for(var o,s,h,f,e=2*n;e<2*n+2;e++)for(o=2*i;o<2*i+2;o++)s=new t(e,o),s.z=r+1,h=this._tileCoordsToKey(s),f=this._tiles[h],f&&f.active?f.retain=!0:(f&&f.loaded&&(f.retain=!0),r+1<u&&this._retainChildren(e,o,r+1,u))},_resetView:function(n){var t=n&&(n.pinch||n.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),t,t)},_animateZoom:function(n){this._setView(n.center,n.zoom,!0,n.noUpdate)},_clampZoom:function(n){var t=this.options;return void 0!==t.minNativeZoom&&n<t.minNativeZoom?t.minNativeZoom:void 0!==t.maxNativeZoom&&t.maxNativeZoom<n?t.maxNativeZoom:n},_setView:function(n,t,i,r){var u=this._clampZoom(Math.round(t)),f;(void 0!==this.options.maxZoom&&u>this.options.maxZoom||void 0!==this.options.minZoom&&u<this.options.minZoom)&&(u=void 0);f=this.options.updateWhenZooming&&u!==this._tileZoom;r&&!f||(this._tileZoom=u,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),void 0!==u&&this._update(n),i||this._pruneTiles(),this._noPrune=!!i);this._setZoomTransforms(n,t)},_setZoomTransforms:function(n,t){for(var i in this._levels)this._setZoomTransform(this._levels[i],n,t)},_setZoomTransform:function(n,t,i){var r=this._map.getZoomScale(i,n.zoom),u=n.origin.multiplyBy(r).subtract(this._map._getNewPixelOrigin(t,i)).round();ft?si(n.el,u,r):b(n.el,u)},_resetGrid:function(){var t=this._map,n=t.options.crs,i=this._tileSize=this.getTileSize(),r=this._tileZoom,u=this._map.getPixelWorldBounds(this._tileZoom);u&&(this._globalTileRange=this._pxBoundsToTileRange(u));this._wrapX=n.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,n.wrapLng[0]],r).x/i.x),Math.ceil(t.project([0,n.wrapLng[1]],r).x/i.y)];this._wrapY=n.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([n.wrapLat[0],0],r).y/i.x),Math.ceil(t.project([n.wrapLat[1],0],r).y/i.y)]},_onMoveEnd:function(){this._map&&!this._map._animatingZoom&&this._update()},_getTiledPixelBounds:function(n){var t=this._map,u=t._animatingZoom?Math.max(t._animateToZoom,t.getZoom()):t.getZoom(),f=t.getZoomScale(u,this._tileZoom),i=t.project(n,this._tileZoom).floor(),r=t.getSize().divideBy(2*f);return new v(i.subtract(r),i.add(r))},_update:function(n){var h=this._map,c,l,o,s,r,f,a;if(h&&(c=this._clampZoom(h.getZoom()),void 0===n&&(n=h.getCenter()),void 0!==this._tileZoom)){var p=this._getTiledPixelBounds(n),i=this._pxBoundsToTileRange(p),y=i.getCenter(),u=[],e=this.options.keepBuffer,w=new v(i.getBottomLeft().subtract([e,-e]),i.getTopRight().add([e,-e]));if(!(isFinite(i.min.x)&&isFinite(i.min.y)&&isFinite(i.max.x)&&isFinite(i.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(l in this._tiles)o=this._tiles[l].coords,o.z===this._tileZoom&&w.contains(new t(o.x,o.y))||(this._tiles[l].current=!1);if(Math.abs(c-this._tileZoom)>1)this._setView(n,c);else{for(s=i.min.y;s<=i.max.y;s++)for(r=i.min.x;r<=i.max.x;r++)f=new t(r,s),f.z=this._tileZoom,this._isValidTile(f)&&(this._tiles[this._tileCoordsToKey(f)]||u.push(f));if(u.sort(function(n,t){return n.distanceTo(y)-t.distanceTo(y)}),0!==u.length){for(this._loading||(this._loading=!0,this.fire("loading")),a=document.createDocumentFragment(),r=0;r<u.length;r++)this._addTile(u[r],a);this._level.el.appendChild(a)}}}},_isValidTile:function(n){var i=this._map.options.crs,t,r;return!i.infinite&&(t=this._globalTileRange,!i.wrapLng&&(n.x<t.min.x||n.x>t.max.x)||!i.wrapLat&&(n.y<t.min.y||n.y>t.max.y))?!1:this.options.bounds?(r=this._tileCoordsToBounds(n),k(this.options.bounds).overlaps(r)):!0},_keyToBounds:function(n){return this._tileCoordsToBounds(this._keyToTileCoords(n))},_tileCoordsToBounds:function(n){var t=this._map,i=this.getTileSize(),r=n.scaleBy(i),f=r.add(i),u=new nt(t.unproject(r,n.z),t.unproject(f,n.z));return this.options.noWrap||t.wrapLatLngBounds(u),u},_tileCoordsToKey:function(n){return n.x+":"+n.y+":"+n.z},_keyToTileCoords:function(n){var i=n.split(":"),r=new t(+i[0],+i[1]);return r.z=+i[2],r},_removeTile:function(n){var t=this._tiles[n];t&&(l(t.el),delete this._tiles[n],this.fire("tileunload",{tile:t.el,coords:this._keyToTileCoords(n)}))},_initTile:function(n){e(n,"leaflet-tile");var t=this.getTileSize();n.style.width=t.x+"px";n.style.height=t.y+"px";n.onselectstart=d;n.onmousemove=d;di&&this.options.opacity<1&&ut(n,this.options.opacity);br&&!kr&&(n.style.WebkitBackfaceVisibility="hidden")},_addTile:function(n,t){var r=this._getTilePos(n),u=this._tileCoordsToKey(n),i=this.createTile(this._wrapCoords(n),c(this._tileReady,this,n));this._initTile(i);this.createTile.length<2&&g(c(this._tileReady,this,n,null,i));b(i,r);this._tiles[u]={el:i,coords:n,current:!0};t.appendChild(i);this.fire("tileloadstart",{tile:i,coords:n})},_tileReady:function(n,t,i){if(this._map){t&&this.fire("tileerror",{error:t,tile:i,coords:n});var r=this._tileCoordsToKey(n);(i=this._tiles[r])&&(i.loaded=+new Date,this._map._fadeAnimated?(ut(i.el,0),ct(this._fadeFrame),this._fadeFrame=g(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),t||(e(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:n})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),di||!this._map._fadeAnimated?g(this._pruneTiles,this):setTimeout(c(this._pruneTiles,this),250)))}},_getTilePos:function(n){return n.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(n){var i=new t(this._wrapX?hr(n.x,this._wrapX):n.x,this._wrapY?hr(n.y,this._wrapY):n.y);return i.z=n.z,i},_pxBoundsToTileRange:function(n){var t=this.getTileSize();return new v(n.min.unscaleBy(t).floor(),n.max.unscaleBy(t).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var n in this._tiles)if(!this._tiles[n].loaded)return!1;return!0}}),or=lo.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1},initialize:function(n,t){this._url=n;(t=a(this,t)).detectRetina&&fi&&t.maxZoom>0&&(t.tileSize=Math.floor(t.tileSize/2),t.zoomReverse?(t.zoomOffset--,t.minZoom++):(t.zoomOffset++,t.maxZoom--),t.minZoom=Math.max(0,t.minZoom));"string"==typeof t.subdomains&&(t.subdomains=t.subdomains.split(""));br||this.on("tileunload",this._onTileRemove)},setUrl:function(n,t){return this._url=n,t||this.redraw(),this},createTile:function(n,t){var r=document.createElement("img");return i(r,"load",c(this._tileOnLoad,this,t,r)),i(r,"error",c(this._tileOnError,this,t,r)),this.options.crossOrigin&&(r.crossOrigin=""),r.alt="",r.setAttribute("role","presentation"),r.src=this.getTileUrl(n),r},getTileUrl:function(n){var t={r:fi?"@2x":"",s:this._getSubdomain(n),x:n.x,y:n.y,z:this._getZoomForUrl()},i;return this._map&&!this._map.options.crs.infinite&&(i=this._globalTileRange.max.y-n.y,this.options.tms&&(t.y=i),t["-y"]=i),is(this._url,s(t,this.options))},_tileOnLoad:function(n,t){di?setTimeout(c(n,this,null,t),0):n(null,t)},_tileOnError:function(n,t,i){var r=this.options.errorTileUrl;r&&t.src!==r&&(t.src=r);n(i,t)},_onTileRemove:function(n){n.tile.onload=null},_getZoomForUrl:function(){var n=this._tileZoom,t=this.options.maxZoom,i=this.options.zoomReverse,r=this.options.zoomOffset;return i&&(n=t-n),n+r},_getSubdomain:function(n){var t=Math.abs(n.x+n.y)%this.options.subdomains.length;return this.options.subdomains[t]},_abortLoading:function(){var t,n;for(t in this._tiles)this._tiles[t].coords.z!==this._tileZoom&&((n=this._tiles[t].el).onload=d,n.onerror=d,n.complete||(n.src=th,l(n)))}}),gh=or.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(n,t){var i,r;this._url=n;i=s({},this.defaultWmsParams);for(r in t)r in this.options||(i[r]=t[r]);t=a(this,t);i.width=i.height=t.tileSize*(t.detectRetina&&fi?2:1);this.wmsParams=i},onAdd:function(n){this._crs=this.options.crs||n.options.crs;this._wmsVersion=parseFloat(this.wmsParams.version);var t=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[t]=this._crs.code;or.prototype.onAdd.call(this,n)},getTileUrl:function(n){var r=this._tileCoordsToBounds(n),t=this._crs.project(r.getNorthWest()),i=this._crs.project(r.getSouthEast()),f=(this._wmsVersion>=1.3&&this._crs===bh?[i.y,t.x,t.y,i.x]:[t.x,i.y,i.x,t.y]).join(","),u=or.prototype.getTileUrl.call(this,n);return u+ts(this.wmsParams,u,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+f},setParams:function(n,t){return s(this.wmsParams,n),t||this.redraw(),this}});or.WMS=gh;ds.wms=function(n,t){return new gh(n,t)};var yt=it.extend({options:{padding:.1},initialize:function(n){a(this,n);o(this);this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),this._zoomAnimated&&e(this._container,"leaflet-zoom-animated"));this.getPane().appendChild(this._container);this._update();this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this);this._destroyContainer()},getEvents:function(){var n={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(n.zoomanim=this._onAnimZoom),n},_onAnimZoom:function(n){this._updateTransform(n.center,n.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(n,t){var i=this._map.getZoomScale(t,this._zoom),f=hi(this._container),r=this._map.getSize().multiplyBy(.5+this.options.padding),e=this._map.project(this._center,t),o=this._map.project(n,t).subtract(e),u=r.multiplyBy(-i).add(f).add(r).subtract(o);ft?si(this._container,u,i):b(this._container,u)},_reset:function(){this._update();this._updateTransform(this._center,this._zoom);for(var n in this._layers)this._layers[n]._reset()},_onZoomEnd:function(){for(var n in this._layers)this._layers[n]._project()},_updatePaths:function(){for(var n in this._layers)this._layers[n]._update()},_update:function(){var n=this.options.padding,t=this._map.getSize(),i=this._map.containerPointToLayerPoint(t.multiplyBy(-n)).round();this._bounds=new v(i,i.add(t.multiplyBy(1+2*n)).round());this._center=this._map.getCenter();this._zoom=this._map.getZoom()}}),ao=yt.extend({getEvents:function(){var n=yt.prototype.getEvents.call(this);return n.viewprereset=this._onViewPreReset,n},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){yt.prototype.onAdd.call(this);this._draw()},_initContainer:function(){var n=this._container=document.createElement("canvas");i(n,"mousemove",uf(this._onMouseMove,32,this),this);i(n,"click dblclick mousedown mouseup contextmenu",this._onClick,this);i(n,"mouseout",this._handleMouseOut,this);this._ctx=n.getContext("2d")},_destroyContainer:function(){delete this._ctx;l(this._container);w(this._container);delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){this._redrawBounds=null;for(var n in this._layers)this._layers[n]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){this._drawnLayers={};yt.prototype._update.call(this);var t=this._bounds,n=this._container,i=t.getSize(),r=fi?2:1;b(n,t.min);n.width=r*i.x;n.height=r*i.y;n.style.width=i.x+"px";n.style.height=i.y+"px";fi&&this._ctx.scale(2,2);this._ctx.translate(-t.min.x,-t.min.y);this.fire("update")}},_reset:function(){yt.prototype._reset.call(this);this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(n){this._updateDashArray(n);this._layers[o(n)]=n;var t=n._order={layer:n,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=t);this._drawLast=t;this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(n){this._requestRedraw(n)},_removePath:function(n){var r=n._order,t=r.next,i=r.prev;t?t.prev=i:this._drawLast=i;i?i.next=t:this._drawFirst=t;delete n._order;delete this._layers[L.stamp(n)];this._requestRedraw(n)},_updatePath:function(n){this._extendRedrawBounds(n);n._project();n._update();this._requestRedraw(n)},_updateStyle:function(n){this._updateDashArray(n);this._requestRedraw(n)},_updateDashArray:function(n){if(n.options.dashArray){for(var i=n.options.dashArray.split(","),r=[],t=0;t<i.length;t++)r.push(Number(i[t]));n.options._dashArray=r}},_requestRedraw:function(n){this._map&&(this._extendRedrawBounds(n),this._redrawRequest=this._redrawRequest||g(this._redraw,this))},_extendRedrawBounds:function(n){if(n._pxBounds){var t=(n.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new v;this._redrawBounds.extend(n._pxBounds.min.subtract([t,t]));this._redrawBounds.extend(n._pxBounds.max.add([t,t]))}},_redraw:function(){this._redrawRequest=null;this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil());this._clear();this._draw();this._redrawBounds=null},_clear:function(){var n=this._redrawBounds,t;n?(t=n.getSize(),this._ctx.clearRect(n.min.x,n.min.y,t.x,t.y)):this._ctx.clearRect(0,0,this._container.width,this._container.height)},_draw:function(){var i,n=this._redrawBounds,r,t;for((this._ctx.save(),n)&&(r=n.getSize(),this._ctx.beginPath(),this._ctx.rect(n.min.x,n.min.y,r.x,r.y),this._ctx.clip()),this._drawing=!0,t=this._drawFirst;t;t=t.next)i=t.layer,(!n||i._pxBounds&&i._pxBounds.intersects(n))&&i._updatePath();this._drawing=!1;this._ctx.restore()},_updatePoly:function(n,t){if(this._drawing){var i,r,o,f,e=n._parts,s=e.length,u=this._ctx;if(s){for(this._drawnLayers[n._leaflet_id]=n,u.beginPath(),i=0;i<s;i++){for(r=0,o=e[i].length;r<o;r++)f=e[i][r],u[r?"lineTo":"moveTo"](f.x,f.y);t&&u.closePath()}this._fillStroke(u,n)}}},_updateCircle:function(n){if(this._drawing&&!n._empty()){var u=n._point,t=this._ctx,r=n._radius,i=(n._radiusY||r)/r;this._drawnLayers[n._leaflet_id]=n;1!==i&&(t.save(),t.scale(1,i));t.beginPath();t.arc(u.x,u.y/i,r,0,2*Math.PI,!1);1!==i&&t.restore();this._fillStroke(t,n)}},_fillStroke:function(n,t){var i=t.options;i.fill&&(n.globalAlpha=i.fillOpacity,n.fillStyle=i.fillColor||i.color,n.fill(i.fillRule||"evenodd"));i.stroke&&0!==i.weight&&(n.setLineDash&&n.setLineDash(t.options&&t.options._dashArray||[]),n.globalAlpha=i.opacity,n.lineWidth=i.weight,n.strokeStyle=i.color,n.lineCap=i.lineCap,n.lineJoin=i.lineJoin,n.stroke())},_onClick:function(n){for(var t,r,u=this._map.mouseEventToLayerPoint(n),i=this._drawFirst;i;i=i.next)(t=i.layer).options.interactive&&t._containsPoint(u)&&!this._map._draggableMoved(t)&&(r=t);r&&(lf(n),this._fireEvent([r],n))},_onMouseMove:function(n){if(this._map&&!this._map.dragging.moving()&&!this._map._animatingZoom){var t=this._map.mouseEventToLayerPoint(n);this._handleMouseHover(n,t)}},_handleMouseOut:function(n){var t=this._hoveredLayer;t&&(p(this._container,"leaflet-interactive"),this._fireEvent([t],n,"mouseout"),this._hoveredLayer=null)},_handleMouseHover:function(n,t){for(var u,i,r=this._drawFirst;r;r=r.next)(u=r.layer).options.interactive&&u._containsPoint(t)&&(i=u);i!==this._hoveredLayer&&(this._handleMouseOut(n),i&&(e(this._container,"leaflet-interactive"),this._fireEvent([i],n,"mouseover"),this._hoveredLayer=i));this._hoveredLayer&&this._fireEvent([this._hoveredLayer],n)},_fireEvent:function(n,t,i){this._map._fireDOMEvent(t,i||t.type,n)},_bringToFront:function(n){var t=n._order,i=t.next,r=t.prev;i&&(i.prev=r,r?r.next=i:i&&(this._drawFirst=i),t.prev=this._drawLast,this._drawLast.next=t,t.next=null,this._drawLast=t,this._requestRedraw(n))},_bringToBack:function(n){var t=n._order,r=t.next,i=t.prev;i&&(i.next=r,r?r.prev=i:i&&(this._drawLast=i),t.prev=null,t.next=this._drawFirst,this._drawFirst.prev=t,this._drawFirst=t,this._requestRedraw(n))}}),iu=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(n){return document.createElement("<lvml:"+n+' class="lvml">')}}catch(n){return function(n){return document.createElement("<"+n+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),ll={_initContainer:function(){this._container=f("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(yt.prototype._update.call(this),this.fire("update"))},_initPath:function(n){var t=n._container=iu("shape");e(t,"leaflet-vml-shape "+(this.options.className||""));t.coordsize="1 1";n._path=iu("path");t.appendChild(n._path);this._updateStyle(n);this._layers[o(n)]=n},_addPath:function(n){var t=n._container;this._container.appendChild(t);n.options.interactive&&n.addInteractiveTarget(t)},_removePath:function(n){var t=n._container;l(t);n.removeInteractiveTarget(t);delete this._layers[o(n)]},_updateStyle:function(n){var i=n._stroke,r=n._fill,t=n.options,u=n._container;u.stroked=!!t.stroke;u.filled=!!t.fill;t.stroke?(i||(i=n._stroke=iu("stroke")),u.appendChild(i),i.weight=t.weight+"px",i.color=t.color,i.opacity=t.opacity,i.dashStyle=t.dashArray?at(t.dashArray)?t.dashArray.join(" "):t.dashArray.replace(/( *, *)/g," "):"",i.endcap=t.lineCap.replace("butt","flat"),i.joinstyle=t.lineJoin):i&&(u.removeChild(i),n._stroke=null);t.fill?(r||(r=n._fill=iu("fill")),u.appendChild(r),r.color=t.fillColor||t.color,r.opacity=t.fillOpacity):r&&(u.removeChild(r),n._fill=null)},_updateCircle:function(n){var t=n._point.round(),i=Math.round(n._radius),r=Math.round(n._radiusY||i);this._setPath(n,n._empty()?"M0 0":"AL "+t.x+","+t.y+" "+i+","+r+" 0,23592600")},_setPath:function(n,t){n._path.v=t},_bringToFront:function(n){pi(n._container)},_bringToBack:function(n){wi(n._container)}},rf=wu?iu:fs,sr=yt.extend({getEvents:function(){var n=yt.prototype.getEvents.call(this);return n.zoomstart=this._onZoomStart,n},_initContainer:function(){this._container=rf("svg");this._container.setAttribute("pointer-events","none");this._rootGroup=rf("g");this._container.appendChild(this._rootGroup)},_destroyContainer:function(){l(this._container);w(this._container);delete this._container;delete this._rootGroup},_onZoomStart:function(){this._update()},_update:function(){if(!this._map._animatingZoom||!this._bounds){yt.prototype._update.call(this);var t=this._bounds,n=t.getSize(),i=this._container;this._svgSize&&this._svgSize.equals(n)||(this._svgSize=n,i.setAttribute("width",n.x),i.setAttribute("height",n.y));b(i,t.min);i.setAttribute("viewBox",[t.min.x,t.min.y,n.x,n.y].join(" "));this.fire("update")}},_initPath:function(n){var t=n._path=rf("path");n.options.className&&e(t,n.options.className);n.options.interactive&&e(t,"leaflet-interactive");this._updateStyle(n);this._layers[o(n)]=n},_addPath:function(n){this._rootGroup||this._initContainer();this._rootGroup.appendChild(n._path);n.addInteractiveTarget(n._path)},_removePath:function(n){l(n._path);n.removeInteractiveTarget(n._path);delete this._layers[o(n)]},_updatePath:function(n){n._project();n._update()},_updateStyle:function(n){var t=n._path,i=n.options;t&&(i.stroke?(t.setAttribute("stroke",i.color),t.setAttribute("stroke-opacity",i.opacity),t.setAttribute("stroke-width",i.weight),t.setAttribute("stroke-linecap",i.lineCap),t.setAttribute("stroke-linejoin",i.lineJoin),i.dashArray?t.setAttribute("stroke-dasharray",i.dashArray):t.removeAttribute("stroke-dasharray"),i.dashOffset?t.setAttribute("stroke-dashoffset",i.dashOffset):t.removeAttribute("stroke-dashoffset")):t.setAttribute("stroke","none"),i.fill?(t.setAttribute("fill",i.fillColor||i.color),t.setAttribute("fill-opacity",i.fillOpacity),t.setAttribute("fill-rule",i.fillRule||"evenodd")):t.setAttribute("fill","none"))},_updatePoly:function(n,t){this._setPath(n,es(n._parts,t))},_updateCircle:function(n){var i=n._point,t=n._radius,r="a"+t+","+(n._radiusY||t)+" 0 1,0 ",u=n._empty()?"M0 0":"M"+(i.x-t)+","+i.y+r+2*t+",0 "+r+2*-t+",0 ";this._setPath(n,u)},_setPath:function(n,t){n._path.setAttribute("d",t)},_bringToFront:function(n){pi(n._path)},_bringToBack:function(n){wi(n._path)}});wu&&sr.include(ll);u.include({getRenderer:function(n){var t=n.options.renderer||this._getPaneRenderer(n.options.pane)||this.options.renderer||this._renderer;return t||(t=this._renderer=this.options.preferCanvas&&ie()||re()),this.hasLayer(t)||this.addLayer(t),t},_getPaneRenderer:function(n){if("overlayPane"===n||void 0===n)return!1;var t=this._paneRenderers[n];return void 0===t&&(t=sr&&re({pane:n})||ao&&ie({pane:n}),this._paneRenderers[n]=t),t}});vo=fr.extend({initialize:function(n,t){fr.prototype.initialize.call(this,this._boundsToLatLngs(n),t)},setBounds:function(n){return this.setLatLngs(this._boundsToLatLngs(n))},_boundsToLatLngs:function(n){return n=k(n),[n.getSouthWest(),n.getNorthWest(),n.getNorthEast(),n.getSouthEast()]}});sr.create=rf;sr.pointsToPath=es;ni.geometryToLayer=gf;ni.coordsToLatLng=ne;ni.coordsToLatLngs=hu;ni.latLngToCoords=te;ni.latLngsToCoords=cu;ni.getFeature=bi;ni.asFeature=lu;u.mergeOptions({boxZoom:!0});yo=dt.extend({initialize:function(n){this._map=n;this._container=n._container;this._pane=n._panes.overlayPane;this._resetStateTimeout=0;n.on("unload",this._destroy,this)},addHooks:function(){i(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){w(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){l(this._pane);delete this._pane},_resetState:function(){this._resetStateTimeout=0;this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(n){if(!n.shiftKey||1!==n.which&&1!==n.button)return!1;this._clearDeferredResetState();this._resetState();yr();wf();this._startPoint=this._map.mouseEventToContainerPoint(n);i(document,{contextmenu:lt,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(n){this._moved||(this._moved=!0,this._box=f("div","leaflet-zoom-box",this._container),e(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart"));this._point=this._map.mouseEventToContainerPoint(n);var t=new v(this._point,this._startPoint),i=t.getSize();b(this._box,t.min);this._box.style.width=i.x+"px";this._box.style.height=i.y+"px"},_finish:function(){this._moved&&(l(this._box),p(this._container,"leaflet-crosshair"));pr();bf();w(document,{contextmenu:lt,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(n){if((1===n.which||1===n.button)&&(this._finish(),this._moved)){this._clearDeferredResetState();this._resetStateTimeout=setTimeout(c(this._resetState,this),0);var t=new nt(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(t).fire("boxzoomend",{boxZoomBounds:t})}},_onKeyDown:function(n){27===n.keyCode&&this._finish()}});u.addInitHook("addHandler","boxZoom",yo);u.mergeOptions({doubleClickZoom:!0});po=dt.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(n){var t=this._map,i=t.getZoom(),r=t.options.zoomDelta,u=n.originalEvent.shiftKey?i-r:i+r;"center"===t.options.doubleClickZoom?t.setZoom(u):t.setZoomAround(n.containerPoint,u)}});u.addInitHook("addHandler","doubleClickZoom",po);u.mergeOptions({dragging:!0,inertia:!kr,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});wo=dt.extend({addHooks:function(){if(!this._draggable){var n=this._map;this._draggable=new li(n._mapPane,n._container);this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this);this._draggable.on("predrag",this._onPreDragLimit,this);n.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),n.on("zoomend",this._onZoomEnd,this),n.whenReady(this._onZoomEnd,this))}e(this._map._container,"leaflet-grab leaflet-touch-drag");this._draggable.enable();this._positions=[];this._times=[]},removeHooks:function(){p(this._map._container,"leaflet-grab");p(this._map._container,"leaflet-touch-drag");this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var n=this._map,t;(n._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity)?(t=k(this._map.options.maxBounds),this._offsetLimit=ii(this._map.latLngToContainerPoint(t.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(t.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))):this._offsetLimit=null;n.fire("movestart").fire("dragstart");n.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(n){if(this._map.options.inertia){var t=this._lastTime=+new Date,i=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(i);this._times.push(t);t-this._times[0]>50&&(this._positions.shift(),this._times.shift())}this._map.fire("move",n).fire("drag",n)},_onZoomEnd:function(){var n=this._map.getSize().divideBy(2),t=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=t.subtract(n).x;this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(n,t){return n-(n-t)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var n=this._draggable._newPos.subtract(this._draggable._startPos),t=this._offsetLimit;n.x<t.min.x&&(n.x=this._viscousLimit(n.x,t.min.x));n.y<t.min.y&&(n.y=this._viscousLimit(n.y,t.min.y));n.x>t.max.x&&(n.x=this._viscousLimit(n.x,t.max.x));n.y>t.max.y&&(n.y=this._viscousLimit(n.y,t.max.y));this._draggable._newPos=this._draggable._startPos.add(n)}},_onPreDragWrap:function(){var i=this._worldWidth,t=Math.round(i/2),n=this._initialWorldOffset,r=this._draggable._newPos.x,u=(r-t+n)%i+t-n,f=(r+t+n)%i-t-n,e=Math.abs(u+n)<Math.abs(f+n)?u:f;this._draggable._absPos=this._draggable._newPos.clone();this._draggable._newPos.x=e},_onDragEnd:function(n){var t=this._map,r=t.options,h=!r.inertia||this._times.length<2;if(t.fire("dragend",n),h)t.fire("moveend");else{var c=this._lastPos.subtract(this._positions[0]),l=(this._lastTime-this._times[0])/1e3,u=r.easeLinearity,f=c.multiplyBy(u/l),e=f.distanceTo([0,0]),o=Math.min(r.inertiaMaxSpeed,e),a=f.multiplyBy(o/e),s=o/(r.inertiaDeceleration*u),i=a.multiplyBy(-s/2).round();i.x||i.y?(i=t._limitOffset(i,t.options.maxBounds),g(function(){t.panBy(i,{duration:s,easeLinearity:u,noMoveStart:!0,animate:!0})})):t.fire("moveend")}}});u.addInitHook("addHandler","dragging",wo);u.mergeOptions({keyboard:!0,keyboardPanDelta:80});bo=dt.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(n){this._map=n;this._setPanDelta(n.options.keyboardPanDelta);this._setZoomDelta(n.options.zoomDelta)},addHooks:function(){var n=this._map._container;n.tabIndex<=0&&(n.tabIndex="0");i(n,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this);this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks();w(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this);this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var n=document.body,t=document.documentElement,i=n.scrollTop||t.scrollTop,r=n.scrollLeft||t.scrollLeft;this._map._container.focus();window.scrollTo(r,i)}},_onFocus:function(){this._focused=!0;this._map.fire("focus")},_onBlur:function(){this._focused=!1;this._map.fire("blur")},_setPanDelta:function(n){for(var u=this._panKeys={},r=this.keyCodes,t=0,i=r.left.length;t<i;t++)u[r.left[t]]=[-1*n,0];for(t=0,i=r.right.length;t<i;t++)u[r.right[t]]=[n,0];for(t=0,i=r.down.length;t<i;t++)u[r.down[t]]=[0,n];for(t=0,i=r.up.length;t<i;t++)u[r.up[t]]=[0,-1*n]},_setZoomDelta:function(n){for(var u=this._zoomKeys={},r=this.keyCodes,t=0,i=r.zoomIn.length;t<i;t++)u[r.zoomIn[t]]=n;for(t=0,i=r.zoomOut.length;t<i;t++)u[r.zoomOut[t]]=-n},_addHooks:function(){i(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){w(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(n){if(!(n.altKey||n.ctrlKey||n.metaKey)){var u,i=n.keyCode,t=this._map;if(i in this._panKeys){if(t._panAnim&&t._panAnim._inProgress)return;u=this._panKeys[i];n.shiftKey&&(u=r(u).multiplyBy(3));t.panBy(u);t.options.maxBounds&&t.panInsideBounds(t.options.maxBounds)}else if(i in this._zoomKeys)t.setZoom(t.getZoom()+(n.shiftKey?3:1)*this._zoomKeys[i]);else{if(27!==i||!t._popup)return;t.closePopup()}lt(n)}}});u.addInitHook("addHandler","keyboard",bo);u.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});ko=dt.extend({addHooks:function(){i(this._map._container,"mousewheel",this._onWheelScroll,this);this._delta=0},removeHooks:function(){w(this._map._container,"mousewheel",this._onWheelScroll,this)},_onWheelScroll:function(n){var i=ls(n),r=this._map.options.wheelDebounceTime,t;this._delta+=i;this._lastMousePos=this._map.mouseEventToContainerPoint(n);this._startTime||(this._startTime=+new Date);t=Math.max(r-(+new Date-this._startTime),0);clearTimeout(this._timer);this._timer=setTimeout(c(this._performZoom,this),t);lt(n)},_performZoom:function(){var n=this._map,t=n.getZoom(),i=this._map.options.zoomSnap||0;n._stop();var e=this._delta/(4*this._map.options.wheelPxPerZoomLevel),u=4*Math.log(2/(1+Math.exp(-Math.abs(e))))/Math.LN2,f=i?Math.ceil(u/i)*i:u,r=n._limitZoom(t+(this._delta>0?f:-f))-t;this._delta=0;this._startTime=null;r&&("center"===n.options.scrollWheelZoom?n.setZoom(t+r):n.setZoomAround(this._lastMousePos,t+r))}});u.addInitHook("addHandler","scrollWheelZoom",ko);u.mergeOptions({tap:!0,tapTolerance:15});go=dt.extend({addHooks:function(){i(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){w(this._map._container,"touchstart",this._onDown,this)},_onDown:function(n){if(n.touches){if(rt(n),this._fireClick=!0,n.touches.length>1)return this._fireClick=!1,void clearTimeout(this._holdTimeout);var r=n.touches[0],u=r.target;this._startPos=this._newPos=new t(r.clientX,r.clientY);u.tagName&&"a"===u.tagName.toLowerCase()&&e(u,"leaflet-active");this._holdTimeout=setTimeout(c(function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",r))},this),1e3);this._simulateEvent("mousedown",r);i(document,{touchmove:this._onMove,touchend:this._onUp},this)}},_onUp:function(n){if(clearTimeout(this._holdTimeout),w(document,{touchmove:this._onMove,touchend:this._onUp},this),this._fireClick&&n&&n.changedTouches){var i=n.changedTouches[0],t=i.target;t&&t.tagName&&"a"===t.tagName.toLowerCase()&&p(t,"leaflet-active");this._simulateEvent("mouseup",i);this._isTapValid()&&this._simulateEvent("click",i)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(n){var i=n.touches[0];this._newPos=new t(i.clientX,i.clientY);this._simulateEvent("mousemove",i)},_simulateEvent:function(n,t){var i=document.createEvent("MouseEvents");i._simulated=!0;t.target._simulatedClick=!0;i.initMouseEvent(n,!0,!0,window,1,t.screenX,t.screenY,t.clientX,t.clientY,!1,!1,!1,!1,0,null);t.target.dispatchEvent(i)}});et&&!vt&&u.addInitHook("addHandler","tap",go);u.mergeOptions({touchZoom:et&&!kr,bounceAtZoomLimits:!0});ns=dt.extend({addHooks:function(){e(this._map._container,"leaflet-touch-zoom");i(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){p(this._map._container,"leaflet-touch-zoom");w(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(n){var t=this._map,r,u;!n.touches||2!==n.touches.length||t._animatingZoom||this._zooming||(r=t.mouseEventToContainerPoint(n.touches[0]),u=t.mouseEventToContainerPoint(n.touches[1]),this._centerPoint=t.getSize()._divideBy(2),this._startLatLng=t.containerPointToLatLng(this._centerPoint),"center"!==t.options.touchZoom&&(this._pinchStartLatLng=t.containerPointToLatLng(r.add(u)._divideBy(2))),this._startDist=r.distanceTo(u),this._startZoom=t.getZoom(),this._moved=!1,this._zooming=!0,t._stop(),i(document,"touchmove",this._onTouchMove,this),i(document,"touchend",this._onTouchEnd,this),rt(n))},_onTouchMove:function(n){var r,e;if(n.touches&&2===n.touches.length&&this._zooming){var t=this._map,u=t.mouseEventToContainerPoint(n.touches[0]),f=t.mouseEventToContainerPoint(n.touches[1]),i=u.distanceTo(f)/this._startDist;if(this._zoom=t.getScaleZoom(i,this._startZoom),!t.options.bounceAtZoomLimits&&(this._zoom<t.getMinZoom()&&i<1||this._zoom>t.getMaxZoom()&&i>1)&&(this._zoom=t._limitZoom(this._zoom)),"center"===t.options.touchZoom){if(this._center=this._startLatLng,1===i)return}else{if(r=u._add(f)._divideBy(2)._subtract(this._centerPoint),1===i&&0===r.x&&0===r.y)return;this._center=t.unproject(t.project(this._pinchStartLatLng,this._zoom).subtract(r),this._zoom)}this._moved||(t._moveStart(!0),this._moved=!0);ct(this._animRequest);e=c(t._move,t,this._center,this._zoom,{pinch:!0,round:!1});this._animRequest=g(e,this,!0);rt(n)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,ct(this._animRequest),w(document,"touchmove",this._onTouchMove),w(document,"touchend",this._onTouchEnd),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))):this._zooming=!1}});u.addInitHook("addHandler","touchZoom",ns);u.BoxZoom=yo;u.DoubleClickZoom=po;u.Drag=wo;u.Keyboard=bo;u.ScrollWheelZoom=ko;u.Tap=go;u.TouchZoom=ns;nc=window.L;window.L=n;Object.freeze=gs;n.version="1.2.0";n.noConflict=function(){return window.L=nc,this};n.Control=st;n.control=gr;n.Browser=gc;n.Evented=ki;n.Mixin=ul;n.Util=pc;n.Class=pt;n.Handler=dt;n.extend=s;n.bind=c;n.stamp=o;n.setOptions=a;n.DomEvent=il;n.DomUtil=rl;n.PosAnimation=vh;n.Draggable=li;n.LineUtil=fl;n.PolyUtil=el;n.Point=t;n.point=r;n.Bounds=v;n.bounds=ii;n.Transformation=of;n.transformation=cr;n.Projection=ol;n.LatLng=h;n.latLng=y;n.LatLngBounds=nt;n.latLngBounds=k;n.CRS=kt;n.GeoJSON=ni;n.geoJSON=ks;n.geoJson=cl;n.Layer=it;n.LayerGroup=rr;n.layerGroup=function(n){return new rr(n)};n.FeatureGroup=ai;n.featureGroup=function(n){return new ai(n)};n.ImageOverlay=ho;n.imageOverlay=function(n,t,i){return new ho(n,t,i)};n.VideoOverlay=dh;n.videoOverlay=function(n,t,i){return new dh(n,t,i)};n.DivOverlay=ti;n.Popup=er;n.popup=function(n,t){return new er(n,t)};n.Tooltip=vi;n.tooltip=function(n,t){return new vi(n,t)};n.Icon=ur;n.icon=function(n){return new ur(n)};n.DivIcon=co;n.divIcon=function(n){return new co(n)};n.Marker=tu;n.marker=function(n,t){return new tu(n,t)};n.TileLayer=or;n.tileLayer=ds;n.GridLayer=lo;n.gridLayer=function(n){return new lo(n)};n.SVG=sr;n.svg=re;n.Renderer=yt;n.Canvas=ao;n.canvas=ie;n.Path=ei;n.CircleMarker=tf;n.circleMarker=function(n,t){return new tf(n,t)};n.Circle=oo;n.circle=function(n,t,i){return new oo(n,t,i)};n.Polyline=gt;n.polyline=function(n,t){return new gt(n,t)};n.Polygon=fr;n.polygon=function(n,t){return new fr(n,t)};n.Rectangle=vo;n.rectangle=function(n,t){return new vo(n,t)};n.Map=u;n.map=function(n,t){return new u(n,t)}});!function(n,t){function i(n,t){for(;(n=n.parentElement)&&!n.classList.contains(t););return n}L.drawVersion="0.4.11";L.Draw={};L.drawLocal={draw:{toolbar:{actions:{title:"Cancel drawing",text:"Cancel"},finish:{title:"Finish drawing",text:"Finish"},undo:{title:"Delete last point drawn",text:"Delete last point"},buttons:{polyline:"Draw a polyline",polygon:"Draw a polygon",rectangle:"Draw a rectangle",circle:"Draw a circle",marker:"Draw a marker",circlemarker:"Draw a circlemarker"}},handlers:{circle:{tooltip:{start:"Click and drag to draw circle."},radius:"Radius"},circlemarker:{tooltip:{start:"Click map to place circle marker."}},marker:{tooltip:{start:"Click map to place marker."}},polygon:{tooltip:{start:"Click to start drawing shape.",cont:"Click to continue drawing shape.",end:"Click first point to close this shape."}},polyline:{error:"<strong>Error:<\/strong> shape edges cannot cross!",tooltip:{start:"Click to start drawing line.",cont:"Click to continue drawing line.",end:"Click last point to finish line."}},rectangle:{tooltip:{start:"Click and drag to draw rectangle."}},simpleshape:{tooltip:{end:"Release mouse to finish drawing."}}}},edit:{toolbar:{actions:{save:{title:"Save changes",text:"Save"},cancel:{title:"Cancel editing, discards all changes",text:"Cancel"},clearAll:{title:"Clear all layers",text:"Clear All"}},buttons:{edit:"Edit layers",editDisabled:"No layers to edit",remove:"Delete layers",removeDisabled:"No layers to delete"}},handlers:{edit:{tooltip:{text:"Drag handles or markers to edit features.",subtext:"Click cancel to undo changes."}},remove:{tooltip:{text:"Click on a feature to remove."}}}}};L.Draw.Event={};L.Draw.Event.CREATED="draw:created";L.Draw.Event.EDITED="draw:edited";L.Draw.Event.DELETED="draw:deleted";L.Draw.Event.DRAWSTART="draw:drawstart";L.Draw.Event.DRAWSTOP="draw:drawstop";L.Draw.Event.DRAWVERTEX="draw:drawvertex";L.Draw.Event.EDITSTART="draw:editstart";L.Draw.Event.EDITMOVE="draw:editmove";L.Draw.Event.EDITRESIZE="draw:editresize";L.Draw.Event.EDITVERTEX="draw:editvertex";L.Draw.Event.EDITSTOP="draw:editstop";L.Draw.Event.DELETESTART="draw:deletestart";L.Draw.Event.DELETESTOP="draw:deletestop";L.Draw=L.Draw||{};L.Draw.Feature=L.Handler.extend({includes:L.Mixin.Events,initialize:function(n,t){this._map=n;this._container=n._container;this._overlayPane=n._panes.overlayPane;this._popupPane=n._panes.popupPane;t&&t.shapeOptions&&(t.shapeOptions=L.Util.extend({},this.options.shapeOptions,t.shapeOptions));L.setOptions(this,t)},enable:function(){this._enabled||(L.Handler.prototype.enable.call(this),this.fire("enabled",{handler:this.type}),this._map.fire(L.Draw.Event.DRAWSTART,{layerType:this.type}))},disable:function(){this._enabled&&(L.Handler.prototype.disable.call(this),this._map.fire(L.Draw.Event.DRAWSTOP,{layerType:this.type}),this.fire("disabled",{handler:this.type}))},addHooks:function(){var n=this._map;n&&(L.DomUtil.disableTextSelection(),n.getContainer().focus(),this._tooltip=new L.Draw.Tooltip(this._map),L.DomEvent.on(this._container,"keyup",this._cancelDrawing,this))},removeHooks:function(){this._map&&(L.DomUtil.enableTextSelection(),this._tooltip.dispose(),this._tooltip=null,L.DomEvent.off(this._container,"keyup",this._cancelDrawing,this))},setOptions:function(n){L.setOptions(this,n)},_fireCreatedEvent:function(n){this._map.fire(L.Draw.Event.CREATED,{layer:n,layerType:this.type})},_cancelDrawing:function(n){27===n.keyCode&&(this._map.fire("draw:canceled",{layerType:this.type}),this.disable())}});L.Draw.Polyline=L.Draw.Feature.extend({statics:{TYPE:"polyline"},Poly:L.Polyline,options:{allowIntersection:!0,repeatMode:!1,drawError:{color:"#b00b00",timeout:2500},icon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon"}),touchIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:"leaflet-div-icon leaflet-editing-icon leaflet-touch-icon"}),guidelineDistance:20,maxGuideLineLength:4e3,shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!1,clickable:!0},metric:!0,feet:!0,nautic:!1,showLength:!0,zIndexOffset:2e3,factor:1},initialize:function(n,t){L.Browser.touch&&(this.options.icon=this.options.touchIcon);this.options.drawError.message=L.drawLocal.draw.handlers.polyline.error;t&&t.drawError&&(t.drawError=L.Util.extend({},this.options.drawError,t.drawError));this.type=L.Draw.Polyline.TYPE;L.Draw.Feature.prototype.initialize.call(this,n,t)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this);this._map&&(this._markers=[],this._markerGroup=new L.LayerGroup,this._map.addLayer(this._markerGroup),this._poly=new L.Polyline([],this.options.shapeOptions),this._tooltip.updateContent(this._getTooltipText()),this._mouseMarker||(this._mouseMarker=L.marker(this._map.getCenter(),{icon:L.divIcon({className:"leaflet-mouse-marker",iconAnchor:[20,20],iconSize:[40,40]}),opacity:0,zIndexOffset:this.options.zIndexOffset})),this._mouseMarker.on("mouseout",this._onMouseOut,this).on("mousemove",this._onMouseMove,this).on("mousedown",this._onMouseDown,this).on("mouseup",this._onMouseUp,this).addTo(this._map),this._map.on("mouseup",this._onMouseUp,this).on("mousemove",this._onMouseMove,this).on("zoomlevelschange",this._onZoomEnd,this).on("touchstart",this._onTouch,this).on("zoomend",this._onZoomEnd,this))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this);this._clearHideErrorTimeout();this._cleanUpShape();this._map.removeLayer(this._markerGroup);delete this._markerGroup;delete this._markers;this._map.removeLayer(this._poly);delete this._poly;this._mouseMarker.off("mousedown",this._onMouseDown,this).off("mouseout",this._onMouseOut,this).off("mouseup",this._onMouseUp,this).off("mousemove",this._onMouseMove,this);this._map.removeLayer(this._mouseMarker);delete this._mouseMarker;this._clearGuides();this._map.off("mouseup",this._onMouseUp,this).off("mousemove",this._onMouseMove,this).off("zoomlevelschange",this._onZoomEnd,this).off("zoomend",this._onZoomEnd,this).off("touchstart",this._onTouch,this).off("click",this._onTouch,this)},deleteLastVertex:function(){if(!(this._markers.length<=1)){var i=this._markers.pop(),n=this._poly,t=n.getLatLngs(),r=t.splice(-1,1)[0];this._poly.setLatLngs(t);this._markerGroup.removeLayer(i);n.getLatLngs().length<2&&this._map.removeLayer(n);this._vertexChanged(r,!1)}},addVertex:function(n){if(this._markers.length>=2&&!this.options.allowIntersection&&this._poly.newLatLngIntersects(n))return void this._showErrorTooltip();this._errorShown&&this._hideErrorTooltip();this._markers.push(this._createMarker(n));this._poly.addLatLng(n);2===this._poly.getLatLngs().length&&this._map.addLayer(this._poly);this._vertexChanged(n,!0)},completeShape:function(){this._markers.length<=1||(this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable())},_finishShape:function(){var n=this._poly._defaultShape?this._poly._defaultShape():this._poly.getLatLngs(),t=this._poly.newLatLngIntersects(n[n.length-1]);if(!this.options.allowIntersection&&t||!this._shapeIsValid())return void this._showErrorTooltip();this._fireCreatedEvent();this.disable();this.options.repeatMode&&this.enable()},_shapeIsValid:function(){return!0},_onZoomEnd:function(){null!==this._markers&&this._updateGuide()},_onMouseMove:function(n){var i=this._map.mouseEventToLayerPoint(n.originalEvent),t=this._map.layerPointToLatLng(i);this._currentLatLng=t;this._updateTooltip(t);this._updateGuide(i);this._mouseMarker.setLatLng(t);L.DomEvent.preventDefault(n.originalEvent)},_vertexChanged:function(n,t){this._map.fire(L.Draw.Event.DRAWVERTEX,{layers:this._markerGroup});this._updateFinishHandler();this._updateRunningMeasure(n,t);this._clearGuides();this._updateTooltip()},_onMouseDown:function(n){if(!this._clickHandled&&!this._touchHandled&&!this._disableMarkers){this._onMouseMove(n);this._clickHandled=!0;this._disableNewMarkers();var t=n.originalEvent,i=t.clientX,r=t.clientY;this._startPoint.call(this,i,r)}},_startPoint:function(n,t){this._mouseDownOrigin=L.point(n,t)},_onMouseUp:function(n){var t=n.originalEvent,i=t.clientX,r=t.clientY;this._endPoint.call(this,i,r,n);this._clickHandled=null},_endPoint:function(t,i,r){if(this._mouseDownOrigin){var u=L.point(t,i).distanceTo(this._mouseDownOrigin);this._calculateFinishDistance(r.latlng)<10&&L.Browser.touch?this._finishShape():Math.abs(u)<9*(n.devicePixelRatio||1)&&this.addVertex(r.latlng);this._enableNewMarkers()}this._mouseDownOrigin=null},_onTouch:function(n){var i,r,t=n.originalEvent;!t.touches||!t.touches[0]||this._clickHandled||this._touchHandled||this._disableMarkers||(i=t.touches[0].clientX,r=t.touches[0].clientY,this._disableNewMarkers(),this._touchHandled=!0,this._startPoint.call(this,i,r),this._endPoint.call(this,i,r,n),this._touchHandled=null);this._clickHandled=null},_onMouseOut:function(){this._tooltip&&this._tooltip._onMouseOut.call(this._tooltip)},_calculateFinishDistance:function(n){var t,i;if(this._markers.length>0){if(this.type===L.Draw.Polyline.TYPE)i=this._markers[this._markers.length-1];else{if(this.type!==L.Draw.Polygon.TYPE)return 1/0;i=this._markers[0]}var r=this._map.latLngToContainerPoint(i.getLatLng()),u=new L.Marker(n,{icon:this.options.icon,zIndexOffset:2*this.options.zIndexOffset}),f=this._map.latLngToContainerPoint(u.getLatLng());t=r.distanceTo(f)}else t=1/0;return t},_updateFinishHandler:function(){var n=this._markers.length;n>1&&this._markers[n-1].on("click",this._finishShape,this);n>2&&this._markers[n-2].off("click",this._finishShape,this)},_createMarker:function(n){var t=new L.Marker(n,{icon:this.options.icon,zIndexOffset:2*this.options.zIndexOffset});return this._markerGroup.addLayer(t),t},_updateGuide:function(n){var t=this._markers?this._markers.length:0;t>0&&(n=n||this._map.latLngToLayerPoint(this._currentLatLng),this._clearGuides(),this._drawGuide(this._map.latLngToLayerPoint(this._markers[t-1].getLatLng()),n))},_updateTooltip:function(n){var t=this._getTooltipText();n&&this._tooltip.updatePosition(n);this._errorShown||this._tooltip.updateContent(t)},_drawGuide:function(n,t){var i,e,u,r=Math.floor(Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))),s=this.options.guidelineDistance,o=this.options.maxGuideLineLength,f=r>o?r-o:s;for(this._guidesContainer||(this._guidesContainer=L.DomUtil.create("div","leaflet-draw-guides",this._overlayPane));f<r;f+=this.options.guidelineDistance)i=f/r,e={x:Math.floor(n.x*(1-i)+i*t.x),y:Math.floor(n.y*(1-i)+i*t.y)},u=L.DomUtil.create("div","leaflet-draw-guide-dash",this._guidesContainer),u.style.backgroundColor=this._errorShown?this.options.drawError.color:this.options.shapeOptions.color,L.DomUtil.setPosition(u,e)},_updateGuideColor:function(n){if(this._guidesContainer)for(var t=0,i=this._guidesContainer.childNodes.length;t<i;t++)this._guidesContainer.childNodes[t].style.backgroundColor=n},_clearGuides:function(){if(this._guidesContainer)for(;this._guidesContainer.firstChild;)this._guidesContainer.removeChild(this._guidesContainer.firstChild)},_getTooltipText:function(){var n,t,i=this.options.showLength;return L.Browser.touch&&(i=!1),0===this._markers.length?n={text:L.drawLocal.draw.handlers.polyline.tooltip.start}:(t=i?this._getMeasurementString():"",n=1===this._markers.length?{text:L.drawLocal.draw.handlers.polyline.tooltip.cont,subtext:t}:{text:L.drawLocal.draw.handlers.polyline.tooltip.end,subtext:t}),n},_updateRunningMeasure:function(n,t){var i,r,u=this._markers.length;1===this._markers.length?this._measurementRunningTotal=0:(i=u-(t?2:1),r=this._map.distance(n,this._markers[i].getLatLng())*(this.options.factor||1),this._measurementRunningTotal+=r*(t?1:-1))},_getMeasurementString:function(){var n,t=this._currentLatLng,i=this._markers[this._markers.length-1].getLatLng();return n=i&&t?this._measurementRunningTotal+this._map.distance(t,i)*(this.options.factor||1):this._measurementRunningTotal||0,L.GeometryUtil.readableDistance(n,this.options.metric,this.options.feet,this.options.nautic,this.options.precision)},_showErrorTooltip:function(){this._errorShown=!0;this._tooltip.showAsError().updateContent({text:this.options.drawError.message});this._updateGuideColor(this.options.drawError.color);this._poly.setStyle({color:this.options.drawError.color});this._clearHideErrorTimeout();this._hideErrorTimeout=setTimeout(L.Util.bind(this._hideErrorTooltip,this),this.options.drawError.timeout)},_hideErrorTooltip:function(){this._errorShown=!1;this._clearHideErrorTimeout();this._tooltip.removeError().updateContent(this._getTooltipText());this._updateGuideColor(this.options.shapeOptions.color);this._poly.setStyle({color:this.options.shapeOptions.color})},_clearHideErrorTimeout:function(){this._hideErrorTimeout&&(clearTimeout(this._hideErrorTimeout),this._hideErrorTimeout=null)},_disableNewMarkers:function(){this._disableMarkers=!0},_enableNewMarkers:function(){setTimeout(function(){this._disableMarkers=!1}.bind(this),50)},_cleanUpShape:function(){this._markers.length>1&&this._markers[this._markers.length-1].off("click",this._finishShape,this)},_fireCreatedEvent:function(){var n=new this.Poly(this._poly.getLatLngs(),this.options.shapeOptions);L.Draw.Feature.prototype._fireCreatedEvent.call(this,n)}});L.Draw.Polygon=L.Draw.Polyline.extend({statics:{TYPE:"polygon"},Poly:L.Polygon,options:{showArea:!1,showLength:!1,shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},metric:!0,feet:!0,nautic:!1,precision:{}},initialize:function(n,t){L.Draw.Polyline.prototype.initialize.call(this,n,t);this.type=L.Draw.Polygon.TYPE},_updateFinishHandler:function(){var n=this._markers.length;1===n&&this._markers[0].on("click",this._finishShape,this);n>2&&(this._markers[n-1].on("dblclick",this._finishShape,this),n>3&&this._markers[n-2].off("dblclick",this._finishShape,this))},_getTooltipText:function(){var n,t;return 0===this._markers.length?n=L.drawLocal.draw.handlers.polygon.tooltip.start:this._markers.length<3?(n=L.drawLocal.draw.handlers.polygon.tooltip.cont,t=this._getMeasurementString()):(n=L.drawLocal.draw.handlers.polygon.tooltip.end,t=this._getMeasurementString()),{text:n,subtext:t}},_getMeasurementString:function(){var n=this._area,t="";return n||this.options.showLength?(this.options.showLength&&(t=L.Draw.Polyline.prototype._getMeasurementString.call(this)),n&&(t+="<br>"+L.GeometryUtil.readableArea(n,this.options.metric,this.options.precision)),t):null},_shapeIsValid:function(){return this._markers.length>=3},_vertexChanged:function(n,t){var i;!this.options.allowIntersection&&this.options.showArea&&(i=this._poly.getLatLngs(),this._area=L.GeometryUtil.geodesicArea(i));L.Draw.Polyline.prototype._vertexChanged.call(this,n,t)},_cleanUpShape:function(){var n=this._markers.length;n>0&&(this._markers[0].off("click",this._finishShape,this),n>2&&this._markers[n-1].off("dblclick",this._finishShape,this))}});L.SimpleShape={};L.Draw.SimpleShape=L.Draw.Feature.extend({options:{repeatMode:!1},initialize:function(n,t){this._endLabelText=L.drawLocal.draw.handlers.simpleshape.tooltip.end;L.Draw.Feature.prototype.initialize.call(this,n,t)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this);this._map&&(this._mapDraggable=this._map.dragging.enabled(),this._mapDraggable&&this._map.dragging.disable(),this._container.style.cursor="crosshair",this._tooltip.updateContent({text:this._initialLabelText}),this._map.on("mousedown",this._onMouseDown,this).on("mousemove",this._onMouseMove,this).on("touchstart",this._onMouseDown,this).on("touchmove",this._onMouseMove,this))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this);this._map&&(this._mapDraggable&&this._map.dragging.enable(),this._container.style.cursor="",this._map.off("mousedown",this._onMouseDown,this).off("mousemove",this._onMouseMove,this).off("touchstart",this._onMouseDown,this).off("touchmove",this._onMouseMove,this),L.DomEvent.off(t,"mouseup",this._onMouseUp,this),L.DomEvent.off(t,"touchend",this._onMouseUp,this),this._shape&&(this._map.removeLayer(this._shape),delete this._shape));this._isDrawing=!1},_getTooltipText:function(){return{text:this._endLabelText}},_onMouseDown:function(n){this._isDrawing=!0;this._startLatLng=n.latlng;L.DomEvent.on(t,"mouseup",this._onMouseUp,this).on(t,"touchend",this._onMouseUp,this).preventDefault(n.originalEvent)},_onMouseMove:function(n){var t=n.latlng;this._tooltip.updatePosition(t);this._isDrawing&&(this._tooltip.updateContent(this._getTooltipText()),this._drawShape(t))},_onMouseUp:function(){this._shape&&this._fireCreatedEvent();this.disable();this.options.repeatMode&&this.enable()}});L.Draw.Rectangle=L.Draw.SimpleShape.extend({statics:{TYPE:"rectangle"},options:{shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,showArea:!0,clickable:!0},metric:!0},initialize:function(n,t){this.type=L.Draw.Rectangle.TYPE;this._initialLabelText=L.drawLocal.draw.handlers.rectangle.tooltip.start;L.Draw.SimpleShape.prototype.initialize.call(this,n,t)},disable:function(){this._enabled&&(this._isCurrentlyTwoClickDrawing=!1,L.Draw.SimpleShape.prototype.disable.call(this))},_onMouseUp:function(n){if(!this._shape&&!this._isCurrentlyTwoClickDrawing)return void(this._isCurrentlyTwoClickDrawing=!0);this._isCurrentlyTwoClickDrawing&&!i(n.target,"leaflet-pane")||L.Draw.SimpleShape.prototype._onMouseUp.call(this)},_drawShape:function(n){this._shape?this._shape.setBounds(new L.LatLngBounds(this._startLatLng,n)):(this._shape=new L.Rectangle(new L.LatLngBounds(this._startLatLng,n),this.options.shapeOptions),this._map.addLayer(this._shape))},_fireCreatedEvent:function(){var n=new L.Rectangle(this._shape.getBounds(),this.options.shapeOptions);L.Draw.SimpleShape.prototype._fireCreatedEvent.call(this,n)},_getTooltipText:function(){var n,t,i,r=L.Draw.SimpleShape.prototype._getTooltipText.call(this),u=this._shape,f=this.options.showArea;return u&&(n=this._shape._defaultShape?this._shape._defaultShape():this._shape.getLatLngs(),t=L.GeometryUtil.geodesicArea(n),i=f?L.GeometryUtil.readableArea(t,this.options.metric):""),{text:r.text,subtext:i}}});L.Draw.Marker=L.Draw.Feature.extend({statics:{TYPE:"marker"},options:{icon:new L.Icon.Default,repeatMode:!1,zIndexOffset:2e3},initialize:function(n,t){this.type=L.Draw.Marker.TYPE;this._initialLabelText=L.drawLocal.draw.handlers.marker.tooltip.start;L.Draw.Feature.prototype.initialize.call(this,n,t)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this);this._map&&(this._tooltip.updateContent({text:this._initialLabelText}),this._mouseMarker||(this._mouseMarker=L.marker(this._map.getCenter(),{icon:L.divIcon({className:"leaflet-mouse-marker",iconAnchor:[20,20],iconSize:[40,40]}),opacity:0,zIndexOffset:this.options.zIndexOffset})),this._mouseMarker.on("click",this._onClick,this).addTo(this._map),this._map.on("mousemove",this._onMouseMove,this),this._map.on("click",this._onTouch,this))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this);this._map&&(this._marker&&(this._marker.off("click",this._onClick,this),this._map.off("click",this._onClick,this).off("click",this._onTouch,this).removeLayer(this._marker),delete this._marker),this._mouseMarker.off("click",this._onClick,this),this._map.removeLayer(this._mouseMarker),delete this._mouseMarker,this._map.off("mousemove",this._onMouseMove,this))},_onMouseMove:function(n){var t=n.latlng;this._tooltip.updatePosition(t);this._mouseMarker.setLatLng(t);this._marker?(t=this._mouseMarker.getLatLng(),this._marker.setLatLng(t)):(this._marker=this._createMarker(t),this._marker.on("click",this._onClick,this),this._map.on("click",this._onClick,this).addLayer(this._marker))},_createMarker:function(n){return new L.Marker(n,{icon:this.options.icon,zIndexOffset:this.options.zIndexOffset})},_onClick:function(){this._fireCreatedEvent();this.disable();this.options.repeatMode&&this.enable()},_onTouch:function(n){this._onMouseMove(n);this._onClick()},_fireCreatedEvent:function(){var n=new L.Marker.Touch(this._marker.getLatLng(),{icon:this.options.icon});L.Draw.Feature.prototype._fireCreatedEvent.call(this,n)}});L.Draw.CircleMarker=L.Draw.Marker.extend({statics:{TYPE:"circlemarker"},options:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0,zIndexOffset:2e3},initialize:function(n,t){this.type=L.Draw.CircleMarker.TYPE;this._initialLabelText=L.drawLocal.draw.handlers.circlemarker.tooltip.start;L.Draw.Feature.prototype.initialize.call(this,n,t)},_fireCreatedEvent:function(){var n=new L.CircleMarker(this._marker.getLatLng(),this.options);L.Draw.Feature.prototype._fireCreatedEvent.call(this,n)},_createMarker:function(n){return new L.CircleMarker(n,this.options)}});L.Draw.Circle=L.Draw.SimpleShape.extend({statics:{TYPE:"circle"},options:{shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},showRadius:!0,metric:!0,feet:!0,nautic:!1},initialize:function(n,t){this.type=L.Draw.Circle.TYPE;this._initialLabelText=L.drawLocal.draw.handlers.circle.tooltip.start;L.Draw.SimpleShape.prototype.initialize.call(this,n,t)},_drawShape:function(n){var t=this._map.distance(this._startLatLng,n);this._shape?this._shape.setRadius(t):(this._shape=new L.Circle(this._startLatLng,t,this.options.shapeOptions),this._map.addLayer(this._shape))},_fireCreatedEvent:function(){var n=new L.Circle(this._startLatLng,this._shape.getRadius(),this.options.shapeOptions);L.Draw.SimpleShape.prototype._fireCreatedEvent.call(this,n)},_onMouseMove:function(n){var i,r=n.latlng,u=this.options.showRadius,f=this.options.metric,t;(this._tooltip.updatePosition(r),this._isDrawing)&&(this._drawShape(r),i=this._shape.getRadius().toFixed(1),t="",u&&(t=L.drawLocal.draw.handlers.circle.radius+": "+L.GeometryUtil.readableDistance(i,f,this.options.feet,this.options.nautic)),this._tooltip.updateContent({text:this._endLabelText,subtext:t}))}});L.Edit=L.Edit||{};L.Edit.Marker=L.Handler.extend({initialize:function(n,t){this._marker=n;L.setOptions(this,t)},addHooks:function(){var n=this._marker;n.dragging.enable();n.on("dragend",this._onDragEnd,n);this._toggleMarkerHighlight()},removeHooks:function(){var n=this._marker;n.dragging.disable();n.off("dragend",this._onDragEnd,n);this._toggleMarkerHighlight()},_onDragEnd:function(n){var t=n.target;t.edited=!0;this._map.fire(L.Draw.Event.EDITMOVE,{layer:t})},_toggleMarkerHighlight:function(){var n=this._marker._icon;n&&(n.style.display="none",L.DomUtil.hasClass(n,"leaflet-edit-marker-selected")?(L.DomUtil.removeClass(n,"leaflet-edit-marker-selected"),this._offsetMarker(n,-4)):(L.DomUtil.addClass(n,"leaflet-edit-marker-selected"),this._offsetMarker(n,4)),n.style.display="")},_offsetMarker:function(n,t){var i=parseInt(n.style.marginTop,10)-t,r=parseInt(n.style.marginLeft,10)-t;n.style.marginTop=i+"px";n.style.marginLeft=r+"px"}});L.Marker.addInitHook(function(){L.Edit.Marker&&(this.editing=new L.Edit.Marker(this),this.options.editable&&this.editing.enable())});L.Edit=L.Edit||{};L.Edit.Poly=L.Handler.extend({options:{},initialize:function(n,t){this.latlngs=[n._latlngs];n._holes&&(this.latlngs=this.latlngs.concat(n._holes));this._poly=n;L.setOptions(this,t);this._poly.on("revert-edited",this._updateLatLngs,this)},_defaultShape:function(){return L.Polyline._flat?L.Polyline._flat(this._poly._latlngs)?this._poly._latlngs:this._poly._latlngs[0]:this._poly._latlngs},_eachVertexHandler:function(n){for(var t=0;t<this._verticesHandlers.length;t++)n(this._verticesHandlers[t])},addHooks:function(){this._initHandlers();this._eachVertexHandler(function(n){n.addHooks()})},removeHooks:function(){this._eachVertexHandler(function(n){n.removeHooks()})},updateMarkers:function(){this._eachVertexHandler(function(n){n.updateMarkers()})},_initHandlers:function(){this._verticesHandlers=[];for(var n=0;n<this.latlngs.length;n++)this._verticesHandlers.push(new L.Edit.PolyVerticesEdit(this._poly,this.latlngs[n],this.options))},_updateLatLngs:function(n){this.latlngs=[n.layer._latlngs];n.layer._holes&&(this.latlngs=this.latlngs.concat(n.layer._holes))}});L.Edit.PolyVerticesEdit=L.Handler.extend({options:{icon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon"}),touchIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:"leaflet-div-icon leaflet-editing-icon leaflet-touch-icon"}),drawError:{color:"#b00b00",timeout:1e3}},initialize:function(n,t,i){L.Browser.touch&&(this.options.icon=this.options.touchIcon);this._poly=n;i&&i.drawError&&(i.drawError=L.Util.extend({},this.options.drawError,i.drawError));this._latlngs=t;L.setOptions(this,i)},_defaultShape:function(){return L.Polyline._flat?L.Polyline._flat(this._latlngs)?this._latlngs:this._latlngs[0]:this._latlngs},addHooks:function(){var n=this._poly;n instanceof L.Polygon||(n.options.fill=!1,n.options.editing&&(n.options.editing.fill=!1));n.setStyle(n.options.editing);this._poly._map&&(this._map=this._poly._map,this._markerGroup||this._initMarkers(),this._poly._map.addLayer(this._markerGroup))},removeHooks:function(){var n=this._poly;n.setStyle(n.options.original);n._map&&(n._map.removeLayer(this._markerGroup),delete this._markerGroup,delete this._markers)},updateMarkers:function(){this._markerGroup.clearLayers();this._initMarkers()},_initMarkers:function(){var n,i,t,r,u,f,e;for(this._markerGroup||(this._markerGroup=new L.LayerGroup),this._markers=[],u=this._defaultShape(),n=0,t=u.length;n<t;n++)r=this._createMarker(u[n],n),r.on("click",this._onMarkerClick,this),this._markers.push(r);for(n=0,i=t-1;n<t;i=n++)(0!==n||L.Polygon&&this._poly instanceof L.Polygon)&&(f=this._markers[i],e=this._markers[n],this._createMiddleMarker(f,e),this._updatePrevNext(f,e))},_createMarker:function(n,t){var i=new L.Marker.Touch(n,{draggable:!0,icon:this.options.icon});return i._origLatLng=n,i._index=t,i.on("dragstart",this._onMarkerDragStart,this).on("drag",this._onMarkerDrag,this).on("dragend",this._fireEdit,this).on("touchmove",this._onTouchMove,this).on("touchend",this._fireEdit,this).on("MSPointerMove",this._onTouchMove,this).on("MSPointerUp",this._fireEdit,this),this._markerGroup.addLayer(i),i},_onMarkerDragStart:function(){this._poly.fire("editstart")},_spliceLatLngs:function(){var n=this._defaultShape(),t=[].splice.apply(n,arguments);return this._poly._convertLatLngs(n,!0),this._poly.redraw(),t},_removeMarker:function(n){var t=n._index;this._markerGroup.removeLayer(n);this._markers.splice(t,1);this._spliceLatLngs(t,1);this._updateIndexes(t,-1);n.off("dragstart",this._onMarkerDragStart,this).off("drag",this._onMarkerDrag,this).off("dragend",this._fireEdit,this).off("touchmove",this._onMarkerDrag,this).off("touchend",this._fireEdit,this).off("click",this._onMarkerClick,this).off("MSPointerMove",this._onTouchMove,this).off("MSPointerUp",this._fireEdit,this)},_fireEdit:function(){this._poly.edited=!0;this._poly.fire("edit");this._poly._map.fire(L.Draw.Event.EDITVERTEX,{layers:this._markerGroup,poly:this._poly})},_onMarkerDrag:function(n){var t=n.target,i=this._poly,r,u;(L.extend(t._origLatLng,t._latlng),t._middleLeft&&t._middleLeft.setLatLng(this._getMiddleLatLng(t._prev,t)),t._middleRight&&t._middleRight.setLatLng(this._getMiddleLatLng(t,t._next)),i.options.poly)&&(r=i._map._editTooltip,!i.options.poly.allowIntersection&&i.intersects()&&(u=i.options.color,i.setStyle({color:this.options.drawError.color}),0!==L.version.indexOf("0.7")&&t.dragging._draggable._onUp(n),this._onMarkerClick(n),r&&r.updateContent({text:L.drawLocal.draw.handlers.polyline.error}),setTimeout(function(){i.setStyle({color:u});r&&r.updateContent({text:L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.edit.handlers.edit.tooltip.subtext})},1e3)));this._poly.redraw();this._poly.fire("editdrag")},_onMarkerClick:function(n){var i=L.Polygon&&this._poly instanceof L.Polygon?4:3,t=n.target;this._defaultShape().length<i||(this._removeMarker(t),this._updatePrevNext(t._prev,t._next),t._middleLeft&&this._markerGroup.removeLayer(t._middleLeft),t._middleRight&&this._markerGroup.removeLayer(t._middleRight),t._prev&&t._next?this._createMiddleMarker(t._prev,t._next):t._prev?t._next||(t._prev._middleRight=null):t._next._middleLeft=null,this._fireEdit())},_onTouchMove:function(n){var i=this._map.mouseEventToLayerPoint(n.originalEvent.touches[0]),r=this._map.layerPointToLatLng(i),t=n.target;L.extend(t._origLatLng,r);t._middleLeft&&t._middleLeft.setLatLng(this._getMiddleLatLng(t._prev,t));t._middleRight&&t._middleRight.setLatLng(this._getMiddleLatLng(t,t._next));this._poly.redraw();this.updateMarkers()},_updateIndexes:function(n,t){this._markerGroup.eachLayer(function(i){i._index>n&&(i._index+=t)})},_createMiddleMarker:function(n,t){var e,r,u,f=this._getMiddleLatLng(n,t),i=this._createMarker(f);i.setOpacity(.6);n._middleRight=t._middleLeft=i;r=function(){i.off("touchmove",r,this);var u=t._index;i._index=u;i.off("click",e,this).on("click",this._onMarkerClick,this);f.lat=i.getLatLng().lat;f.lng=i.getLatLng().lng;this._spliceLatLngs(u,0,f);this._markers.splice(u,0,i);i.setOpacity(1);this._updateIndexes(u,1);t._index++;this._updatePrevNext(n,i);this._updatePrevNext(i,t);this._poly.fire("editstart")};u=function(){i.off("dragstart",r,this);i.off("dragend",u,this);i.off("touchmove",r,this);this._createMiddleMarker(n,i);this._createMiddleMarker(i,t)};e=function(){r.call(this);u.call(this);this._fireEdit()};i.on("click",e,this).on("dragstart",r,this).on("dragend",u,this).on("touchmove",r,this);this._markerGroup.addLayer(i)},_updatePrevNext:function(n,t){n&&(n._next=t);t&&(t._prev=n)},_getMiddleLatLng:function(n,t){var i=this._poly._map,r=i.project(n.getLatLng()),u=i.project(t.getLatLng());return i.unproject(r._add(u)._divideBy(2))}});L.Polyline.addInitHook(function(){this.editing||(L.Edit.Poly&&(this.editing=new L.Edit.Poly(this,this.options.poly),this.options.editable&&this.editing.enable()),this.on("add",function(){this.editing&&this.editing.enabled()&&this.editing.addHooks()}),this.on("remove",function(){this.editing&&this.editing.enabled()&&this.editing.removeHooks()}))});L.Edit=L.Edit||{};L.Edit.SimpleShape=L.Handler.extend({options:{moveIcon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon leaflet-edit-move"}),resizeIcon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon leaflet-edit-resize"}),touchMoveIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:"leaflet-div-icon leaflet-editing-icon leaflet-edit-move leaflet-touch-icon"}),touchResizeIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:"leaflet-div-icon leaflet-editing-icon leaflet-edit-resize leaflet-touch-icon"})},initialize:function(n,t){L.Browser.touch&&(this.options.moveIcon=this.options.touchMoveIcon,this.options.resizeIcon=this.options.touchResizeIcon);this._shape=n;L.Util.setOptions(this,t)},addHooks:function(){var n=this._shape;this._shape._map&&(this._map=this._shape._map,n.setStyle(n.options.editing),n._map&&(this._map=n._map,this._markerGroup||this._initMarkers(),this._map.addLayer(this._markerGroup)))},removeHooks:function(){var t=this._shape,n,i;if(t.setStyle(t.options.original),t._map){for(this._unbindMarker(this._moveMarker),n=0,i=this._resizeMarkers.length;n<i;n++)this._unbindMarker(this._resizeMarkers[n]);this._resizeMarkers=null;this._map.removeLayer(this._markerGroup);delete this._markerGroup}this._map=null},updateMarkers:function(){this._markerGroup.clearLayers();this._initMarkers()},_initMarkers:function(){this._markerGroup||(this._markerGroup=new L.LayerGroup);this._createMoveMarker();this._createResizeMarker()},_createMoveMarker:function(){},_createResizeMarker:function(){},_createMarker:function(n,t){var i=new L.Marker.Touch(n,{draggable:!0,icon:t,zIndexOffset:10});return this._bindMarker(i),this._markerGroup.addLayer(i),i},_bindMarker:function(n){n.on("dragstart",this._onMarkerDragStart,this).on("drag",this._onMarkerDrag,this).on("dragend",this._onMarkerDragEnd,this).on("touchstart",this._onTouchStart,this).on("touchmove",this._onTouchMove,this).on("MSPointerMove",this._onTouchMove,this).on("touchend",this._onTouchEnd,this).on("MSPointerUp",this._onTouchEnd,this)},_unbindMarker:function(n){n.off("dragstart",this._onMarkerDragStart,this).off("drag",this._onMarkerDrag,this).off("dragend",this._onMarkerDragEnd,this).off("touchstart",this._onTouchStart,this).off("touchmove",this._onTouchMove,this).off("MSPointerMove",this._onTouchMove,this).off("touchend",this._onTouchEnd,this).off("MSPointerUp",this._onTouchEnd,this)},_onMarkerDragStart:function(n){n.target.setOpacity(0);this._shape.fire("editstart")},_fireEdit:function(){this._shape.edited=!0;this._shape.fire("edit")},_onMarkerDrag:function(n){var t=n.target,i=t.getLatLng();t===this._moveMarker?this._move(i):this._resize(i);this._shape.redraw();this._shape.fire("editdrag")},_onMarkerDragEnd:function(n){n.target.setOpacity(1);this._fireEdit()},_onTouchStart:function(n){if(L.Edit.SimpleShape.prototype._onMarkerDragStart.call(this,n),"function"==typeof this._getCorners){var r=this._getCorners(),t=n.target,i=t._cornerIndex;t.setOpacity(0);this._oppositeCorner=r[(i+2)%4];this._toggleCornerMarkers(0,i)}this._shape.fire("editstart")},_onTouchMove:function(n){var i=this._map.mouseEventToLayerPoint(n.originalEvent.touches[0]),t=this._map.layerPointToLatLng(i);return n.target===this._moveMarker?this._move(t):this._resize(t),this._shape.redraw(),!1},_onTouchEnd:function(n){n.target.setOpacity(1);this.updateMarkers();this._fireEdit()},_move:function(){},_resize:function(){}});L.Edit=L.Edit||{};L.Edit.Rectangle=L.Edit.SimpleShape.extend({_createMoveMarker:function(){var n=this._shape.getBounds(),t=n.getCenter();this._moveMarker=this._createMarker(t,this.options.moveIcon)},_createResizeMarker:function(){var t=this._getCorners(),n,i;for(this._resizeMarkers=[],n=0,i=t.length;n<i;n++)this._resizeMarkers.push(this._createMarker(t[n],this.options.resizeIcon)),this._resizeMarkers[n]._cornerIndex=n},_onMarkerDragStart:function(n){L.Edit.SimpleShape.prototype._onMarkerDragStart.call(this,n);var i=this._getCorners(),r=n.target,t=r._cornerIndex;this._oppositeCorner=i[(t+2)%4];this._toggleCornerMarkers(0,t)},_onMarkerDragEnd:function(n){var t,i,r=n.target;r===this._moveMarker&&(t=this._shape.getBounds(),i=t.getCenter(),r.setLatLng(i));this._toggleCornerMarkers(1);this._repositionCornerMarkers();L.Edit.SimpleShape.prototype._onMarkerDragEnd.call(this,n)},_move:function(n){for(var i,r=this._shape._defaultShape?this._shape._defaultShape():this._shape.getLatLngs(),e=this._shape.getBounds(),u=e.getCenter(),f=[],t=0,o=r.length;t<o;t++)i=[r[t].lat-u.lat,r[t].lng-u.lng],f.push([n.lat+i[0],n.lng+i[1]]);this._shape.setLatLngs(f);this._repositionCornerMarkers();this._map.fire(L.Draw.Event.EDITMOVE,{layer:this._shape})},_resize:function(n){var t;this._shape.setBounds(L.latLngBounds(n,this._oppositeCorner));t=this._shape.getBounds();this._moveMarker.setLatLng(t.getCenter());this._map.fire(L.Draw.Event.EDITRESIZE,{layer:this._shape})},_getCorners:function(){var n=this._shape.getBounds();return[n.getNorthWest(),n.getNorthEast(),n.getSouthEast(),n.getSouthWest()]},_toggleCornerMarkers:function(n){for(var t=0,i=this._resizeMarkers.length;t<i;t++)this._resizeMarkers[t].setOpacity(n)},_repositionCornerMarkers:function(){for(var t=this._getCorners(),n=0,i=this._resizeMarkers.length;n<i;n++)this._resizeMarkers[n].setLatLng(t[n])}});L.Rectangle.addInitHook(function(){L.Edit.Rectangle&&(this.editing=new L.Edit.Rectangle(this),this.options.editable&&this.editing.enable())});L.Edit=L.Edit||{};L.Edit.CircleMarker=L.Edit.SimpleShape.extend({_createMoveMarker:function(){var n=this._shape.getLatLng();this._moveMarker=this._createMarker(n,this.options.moveIcon)},_createResizeMarker:function(){this._resizeMarkers=[]},_move:function(n){if(this._resizeMarkers.length){var t=this._getResizeMarkerPoint(n);this._resizeMarkers[0].setLatLng(t)}this._shape.setLatLng(n);this._map.fire(L.Draw.Event.EDITMOVE,{layer:this._shape})}});L.CircleMarker.addInitHook(function(){L.Edit.CircleMarker&&(this.editing=new L.Edit.CircleMarker(this),this.options.editable&&this.editing.enable());this.on("add",function(){this.editing&&this.editing.enabled()&&this.editing.addHooks()});this.on("remove",function(){this.editing&&this.editing.enabled()&&this.editing.removeHooks()})});L.Edit=L.Edit||{};L.Edit.Circle=L.Edit.CircleMarker.extend({_createResizeMarker:function(){var n=this._shape.getLatLng(),t=this._getResizeMarkerPoint(n);this._resizeMarkers=[];this._resizeMarkers.push(this._createMarker(t,this.options.resizeIcon))},_getResizeMarkerPoint:function(n){var t=this._shape._radius*Math.cos(Math.PI/4),i=this._map.project(n);return this._map.unproject([i.x+t,i.y-t])},_resize:function(n){var t=this._moveMarker.getLatLng(),i=this._map.distance(t,n);this._shape.setRadius(i);this._map.fire(L.Draw.Event.EDITRESIZE,{layer:this._shape})}});L.Circle.addInitHook(function(){L.Edit.Circle&&(this.editing=new L.Edit.Circle(this),this.options.editable&&this.editing.enable());this.on("add",function(){this.editing&&this.editing.enabled()&&this.editing.addHooks()});this.on("remove",function(){this.editing&&this.editing.enabled()&&this.editing.removeHooks()})});L.Map.mergeOptions({touchExtend:!0});L.Map.TouchExtend=L.Handler.extend({initialize:function(n){this._map=n;this._container=n._container;this._pane=n._panes.overlayPane},addHooks:function(){L.DomEvent.on(this._container,"touchstart",this._onTouchStart,this);L.DomEvent.on(this._container,"touchend",this._onTouchEnd,this);L.DomEvent.on(this._container,"touchmove",this._onTouchMove,this);this._detectIE()?(L.DomEvent.on(this._container,"MSPointerDown",this._onTouchStart,this),L.DomEvent.on(this._container,"MSPointerUp",this._onTouchEnd,this),L.DomEvent.on(this._container,"MSPointerMove",this._onTouchMove,this),L.DomEvent.on(this._container,"MSPointerCancel",this._onTouchCancel,this)):(L.DomEvent.on(this._container,"touchcancel",this._onTouchCancel,this),L.DomEvent.on(this._container,"touchleave",this._onTouchLeave,this))},removeHooks:function(){L.DomEvent.off(this._container,"touchstart",this._onTouchStart);L.DomEvent.off(this._container,"touchend",this._onTouchEnd);L.DomEvent.off(this._container,"touchmove",this._onTouchMove);this._detectIE()?(L.DomEvent.off(this._container,"MSPointerDowm",this._onTouchStart),L.DomEvent.off(this._container,"MSPointerUp",this._onTouchEnd),L.DomEvent.off(this._container,"MSPointerMove",this._onTouchMove),L.DomEvent.off(this._container,"MSPointerCancel",this._onTouchCancel)):(L.DomEvent.off(this._container,"touchcancel",this._onTouchCancel),L.DomEvent.off(this._container,"touchleave",this._onTouchLeave))},_touchEvent:function(n,t){var i={};if(void 0!==n.touches){if(!n.touches.length)return;i=n.touches[0]}else{if("touch"!==n.pointerType)return;if(i=n,!this._filterClick(n))return}var u=this._map.mouseEventToContainerPoint(i),r=this._map.mouseEventToLayerPoint(i),f=this._map.layerPointToLatLng(r);this._map.fire(t,{latlng:f,layerPoint:r,containerPoint:u,pageX:i.pageX,pageY:i.pageY,originalEvent:n})},_filterClick:function(n){var i=n.timeStamp||n.originalEvent.timeStamp,t=L.DomEvent._lastClick&&i-L.DomEvent._lastClick;return t&&t>100&&t<500||n.target._simulatedClick&&!n._simulated?(L.DomEvent.stop(n),!1):(L.DomEvent._lastClick=i,!0)},_onTouchStart:function(n){this._map._loaded&&this._touchEvent(n,"touchstart")},_onTouchEnd:function(n){this._map._loaded&&this._touchEvent(n,"touchend")},_onTouchCancel:function(n){if(this._map._loaded){var t="touchcancel";this._detectIE()&&(t="pointercancel");this._touchEvent(n,t)}},_onTouchLeave:function(n){this._map._loaded&&this._touchEvent(n,"touchleave")},_onTouchMove:function(n){this._map._loaded&&this._touchEvent(n,"touchmove")},_detectIE:function(){var t=n.navigator.userAgent,r=t.indexOf("MSIE "),u,i;return r>0?parseInt(t.substring(r+5,t.indexOf(".",r)),10):t.indexOf("Trident/")>0?(u=t.indexOf("rv:"),parseInt(t.substring(u+3,t.indexOf(".",u)),10)):(i=t.indexOf("Edge/"),i>0&&parseInt(t.substring(i+5,t.indexOf(".",i)),10))}});L.Map.addInitHook("addHandler","touchExtend",L.Map.TouchExtend);L.Marker.Touch=L.Marker.extend({_initInteraction:function(){return this.addInteractiveTarget?L.Marker.prototype._initInteraction.apply(this):this._initInteractionLegacy()},_initInteractionLegacy:function(){var n,t,i;if(this.options.clickable){for(n=this._icon,t=["dblclick","mousedown","mouseover","mouseout","contextmenu","touchstart","touchend","touchmove"],this._detectIE?t.concat(["MSPointerDown","MSPointerUp","MSPointerMove","MSPointerCancel"]):t.concat(["touchcancel"]),L.DomUtil.addClass(n,"leaflet-clickable"),L.DomEvent.on(n,"click",this._onMouseClick,this),L.DomEvent.on(n,"keypress",this._onKeyPress,this),i=0;i<t.length;i++)L.DomEvent.on(n,t[i],this._fireMouseEvent,this);L.Handler.MarkerDrag&&(this.dragging=new L.Handler.MarkerDrag(this),this.options.draggable&&this.dragging.enable())}},_detectIE:function(){var t=n.navigator.userAgent,r=t.indexOf("MSIE "),u,i;return r>0?parseInt(t.substring(r+5,t.indexOf(".",r)),10):t.indexOf("Trident/")>0?(u=t.indexOf("rv:"),parseInt(t.substring(u+3,t.indexOf(".",u)),10)):(i=t.indexOf("Edge/"),i>0&&parseInt(t.substring(i+5,t.indexOf(".",i)),10))}});L.LatLngUtil={cloneLatLngs:function(n){for(var i=[],t=0,r=n.length;t<r;t++)Array.isArray(n[t])?i.push(L.LatLngUtil.cloneLatLngs(n[t])):i.push(this.cloneLatLng(n[t]));return i},cloneLatLng:function(n){return L.latLng(n.lat,n.lng)}},function(){var n={km:2,ha:2,m:0,mi:2,ac:2,yd:0,ft:0,nm:2};L.GeometryUtil=L.extend(L.GeometryUtil||{},{geodesicArea:function(n){var r,u,f=n.length,i=0,e=Math.PI/180,t;if(f>2){for(t=0;t<f;t++)r=n[t],u=n[(t+1)%f],i+=(u.lng-r.lng)*e*(2+Math.sin(r.lat*e)+Math.sin(u.lat*e));i=40680631590769*i/2}return Math.abs(i)},formattedNumber:function(n,t){var i=parseFloat(n).toFixed(t),o=L.drawLocal.format&&L.drawLocal.format.numeric,u=o&&o.delimiters,e=u&&u.thousands,f=u&&u.decimal,r;return(e||f)&&(r=i.split("."),i=e?r[0].replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+e):r[0],f=f||".",r.length>1&&(i=i+f+r[1])),i},readableArea:function(t,i,r){var f,u,r=L.Util.extend({},n,r);return i?(u=["ha","m"],type=typeof i,"string"===type?u=[i]:"boolean"!==type&&(u=i),f=t>=1e6&&-1!==u.indexOf("km")?L.GeometryUtil.formattedNumber(1e-6*t,r.km)+" km²":t>=1e4&&-1!==u.indexOf("ha")?L.GeometryUtil.formattedNumber(.0001*t,r.ha)+" ha":L.GeometryUtil.formattedNumber(t,r.m)+" m²"):(t/=.836127,f=t>=3097600?L.GeometryUtil.formattedNumber(t/3097600,r.mi)+" mi²":t>=4840?L.GeometryUtil.formattedNumber(t/4840,r.ac)+" acres":L.GeometryUtil.formattedNumber(t,r.yd)+" yd²"),f},readableDistance:function(t,i,r,u,f){var e,f=L.Util.extend({},n,f);switch(i?"string"==typeof i?i:"metric":r?"feet":u?"nauticalMile":"yards"){case"metric":e=t>1e3?L.GeometryUtil.formattedNumber(t/1e3,f.km)+" km":L.GeometryUtil.formattedNumber(t,f.m)+" m";break;case"feet":t*=3.28083;e=L.GeometryUtil.formattedNumber(t,f.ft)+" ft";break;case"nauticalMile":t*=.53996;e=L.GeometryUtil.formattedNumber(t/1e3,f.nm)+" nm";break;case"yards":default:t*=1.09361;e=t>1760?L.GeometryUtil.formattedNumber(t/1760,f.mi)+" miles":L.GeometryUtil.formattedNumber(t,f.yd)+" yd"}return e}})}();L.Util.extend(L.LineUtil,{segmentsIntersect:function(n,t,i,r){return this._checkCounterclockwise(n,i,r)!==this._checkCounterclockwise(t,i,r)&&this._checkCounterclockwise(n,t,i)!==this._checkCounterclockwise(n,t,r)},_checkCounterclockwise:function(n,t,i){return(i.y-n.y)*(t.x-n.x)>(t.y-n.y)*(i.x-n.x)}});L.Polyline.include({intersects:function(){var n,i,r,t=this._getProjectedPoints(),u=t?t.length:0;if(this._tooFewPointsForIntersection())return!1;for(n=u-1;n>=3;n--)if(i=t[n-1],r=t[n],this._lineSegmentsIntersectsRange(i,r,n-2))return!0;return!1},newLatLngIntersects:function(n,t){return!!this._map&&this.newPointIntersects(this._map.latLngToLayerPoint(n),t)},newPointIntersects:function(n,t){var i=this._getProjectedPoints(),r=i?i.length:0,u=i?i[r-1]:null,f=r-2;return!this._tooFewPointsForIntersection(1)&&this._lineSegmentsIntersectsRange(u,n,f,t?1:0)},_tooFewPointsForIntersection:function(n){var t=this._getProjectedPoints(),i=t?t.length:0;return i+=n||0,!t||i<=3},_lineSegmentsIntersectsRange:function(n,t,i,r){var f,e,o=this._getProjectedPoints(),u;for(r=r||0,u=i;u>r;u--)if(f=o[u-1],e=o[u],L.LineUtil.segmentsIntersect(n,t,f,e))return!0;return!1},_getProjectedPoints:function(){if(!this._defaultShape)return this._originalPoints;for(var t=[],i=this._defaultShape(),n=0;n<i.length;n++)t.push(this._map.latLngToLayerPoint(i[n]));return t}});L.Polygon.include({intersects:function(){var n,i,r,u,t=this._getProjectedPoints();return!this._tooFewPointsForIntersection()&&(!!L.Polyline.prototype.intersects.call(this)||(n=t.length,i=t[0],r=t[n-1],u=n-2,this._lineSegmentsIntersectsRange(r,i,u,1)))}});L.Control.Draw=L.Control.extend({options:{position:"topleft",draw:{},edit:!1},initialize:function(n){if(L.version<"0.7")throw new Error("Leaflet.draw 0.2.3+ requires Leaflet 0.7.0+. Download latest from https://github.com/Leaflet/Leaflet/");L.Control.prototype.initialize.call(this,n);var t;this._toolbars={};L.DrawToolbar&&this.options.draw&&(t=new L.DrawToolbar(this.options.draw),this._toolbars[L.DrawToolbar.TYPE]=t,this._toolbars[L.DrawToolbar.TYPE].on("enable",this._toolbarEnabled,this));L.EditToolbar&&this.options.edit&&(t=new L.EditToolbar(this.options.edit),this._toolbars[L.EditToolbar.TYPE]=t,this._toolbars[L.EditToolbar.TYPE].on("enable",this._toolbarEnabled,this));L.toolbar=this},onAdd:function(n){var t,i=L.DomUtil.create("div","leaflet-draw"),r=!1;for(var u in this._toolbars)this._toolbars.hasOwnProperty(u)&&(t=this._toolbars[u].addToolbar(n))&&(r||(L.DomUtil.hasClass(t,"leaflet-draw-toolbar-top")||L.DomUtil.addClass(t.childNodes[0],"leaflet-draw-toolbar-top"),r=!0),i.appendChild(t));return i},onRemove:function(){for(var n in this._toolbars)this._toolbars.hasOwnProperty(n)&&this._toolbars[n].removeToolbar()},setDrawingOptions:function(n){for(var t in this._toolbars)this._toolbars[t]instanceof L.DrawToolbar&&this._toolbars[t].setOptions(n)},_toolbarEnabled:function(n){var i=n.target;for(var t in this._toolbars)this._toolbars[t]!==i&&this._toolbars[t].disable()}});L.Map.mergeOptions({drawControlTooltips:!0,drawControl:!1});L.Map.addInitHook(function(){this.options.drawControl&&(this.drawControl=new L.Control.Draw,this.addControl(this.drawControl))});L.Toolbar=L.Class.extend({includes:[L.Mixin.Events],initialize:function(n){L.setOptions(this,n);this._modes={};this._actionButtons=[];this._activeMode=null},enabled:function(){return null!==this._activeMode},disable:function(){this.enabled()&&this._activeMode.handler.disable()},addToolbar:function(n){var t,r=L.DomUtil.create("div","leaflet-draw-section"),u=0,f=this._toolbarClass||"",i=this.getModeHandlers(n);for(this._toolbarContainer=L.DomUtil.create("div","leaflet-draw-toolbar leaflet-bar"),this._map=n,t=0;t<i.length;t++)i[t].enabled&&this._initModeHandler(i[t].handler,this._toolbarContainer,u++,f,i[t].title);if(u)return this._lastButtonIndex=--u,this._actionsContainer=L.DomUtil.create("ul","leaflet-draw-actions"),r.appendChild(this._toolbarContainer),r.appendChild(this._actionsContainer),r},removeToolbar:function(){var n,t,i;for(n in this._modes)this._modes.hasOwnProperty(n)&&(this._disposeButton(this._modes[n].button,this._modes[n].handler.enable,this._modes[n].handler),this._modes[n].handler.disable(),this._modes[n].handler.off("enabled",this._handlerActivated,this).off("disabled",this._handlerDeactivated,this));for(this._modes={},t=0,i=this._actionButtons.length;t<i;t++)this._disposeButton(this._actionButtons[t].button,this._actionButtons[t].callback,this);this._actionButtons=[];this._actionsContainer=null},_initModeHandler:function(n,t,i,r,u){var f=n.type;this._modes[f]={};this._modes[f].handler=n;this._modes[f].button=this._createButton({type:f,title:u,className:r+"-"+f,container:t,callback:this._modes[f].handler.enable,context:this._modes[f].handler});this._modes[f].buttonIndex=i;this._modes[f].handler.on("enabled",this._handlerActivated,this).on("disabled",this._handlerDeactivated,this)},_detectIOS:function(){return/iPad|iPhone|iPod/.test(navigator.userAgent)&&!n.MSStream},_createButton:function(n){var t=L.DomUtil.create("a",n.className||"",n.container),i=L.DomUtil.create("span","sr-only",n.container),r;return t.href="#",t.appendChild(i),n.title&&(t.title=n.title,i.innerHTML=n.title),n.text&&(t.innerHTML=n.text,i.innerHTML=n.text),r=this._detectIOS()?"touchstart":"click",L.DomEvent.on(t,"click",L.DomEvent.stopPropagation).on(t,"mousedown",L.DomEvent.stopPropagation).on(t,"dblclick",L.DomEvent.stopPropagation).on(t,"touchstart",L.DomEvent.stopPropagation).on(t,"click",L.DomEvent.preventDefault).on(t,r,n.callback,n.context),t},_disposeButton:function(n,t){var i=this._detectIOS()?"touchstart":"click";L.DomEvent.off(n,"click",L.DomEvent.stopPropagation).off(n,"mousedown",L.DomEvent.stopPropagation).off(n,"dblclick",L.DomEvent.stopPropagation).off(n,"touchstart",L.DomEvent.stopPropagation).off(n,"click",L.DomEvent.preventDefault).off(n,i,t)},_handlerActivated:function(n){this.disable();this._activeMode=this._modes[n.handler];L.DomUtil.addClass(this._activeMode.button,"leaflet-draw-toolbar-button-enabled");this._showActionsToolbar();this.fire("enable")},_handlerDeactivated:function(){this._hideActionsToolbar();L.DomUtil.removeClass(this._activeMode.button,"leaflet-draw-toolbar-button-enabled");this._activeMode=null;this.fire("disable")},_createActions:function(n){for(var f,o,u=this._actionsContainer,i=this.getActions(n),s=i.length,t,r=0,e=this._actionButtons.length;r<e;r++)this._disposeButton(this._actionButtons[r].button,this._actionButtons[r].callback);for(this._actionButtons=[];u.firstChild;)u.removeChild(u.firstChild);for(t=0;t<s;t++)"enabled"in i[t]&&!i[t].enabled||(f=L.DomUtil.create("li","",u),o=this._createButton({title:i[t].title,text:i[t].text,container:f,callback:i[t].callback,context:i[t].context}),this._actionButtons.push({button:o,callback:i[t].callback}))},_showActionsToolbar:function(){var n=this._activeMode.buttonIndex,t=this._lastButtonIndex,i=this._activeMode.button.offsetTop-1;this._createActions(this._activeMode.handler);this._actionsContainer.style.top=i+"px";0===n&&(L.DomUtil.addClass(this._toolbarContainer,"leaflet-draw-toolbar-notop"),L.DomUtil.addClass(this._actionsContainer,"leaflet-draw-actions-top"));n===t&&(L.DomUtil.addClass(this._toolbarContainer,"leaflet-draw-toolbar-nobottom"),L.DomUtil.addClass(this._actionsContainer,"leaflet-draw-actions-bottom"));this._actionsContainer.style.display="block"},_hideActionsToolbar:function(){this._actionsContainer.style.display="none";L.DomUtil.removeClass(this._toolbarContainer,"leaflet-draw-toolbar-notop");L.DomUtil.removeClass(this._toolbarContainer,"leaflet-draw-toolbar-nobottom");L.DomUtil.removeClass(this._actionsContainer,"leaflet-draw-actions-top");L.DomUtil.removeClass(this._actionsContainer,"leaflet-draw-actions-bottom")}});L.Draw=L.Draw||{};L.Draw.Tooltip=L.Class.extend({initialize:function(n){this._map=n;this._popupPane=n._panes.popupPane;this._visible=!1;this._container=n.options.drawControlTooltips?L.DomUtil.create("div","leaflet-draw-tooltip",this._popupPane):null;this._singleLineLabel=!1;this._map.on("mouseout",this._onMouseOut,this)},dispose:function(){this._map.off("mouseout",this._onMouseOut,this);this._container&&(this._popupPane.removeChild(this._container),this._container=null)},updateContent:function(n){return this._container?(n.subtext=n.subtext||"",0!==n.subtext.length||this._singleLineLabel?n.subtext.length>0&&this._singleLineLabel&&(L.DomUtil.removeClass(this._container,"leaflet-draw-tooltip-single"),this._singleLineLabel=!1):(L.DomUtil.addClass(this._container,"leaflet-draw-tooltip-single"),this._singleLineLabel=!0),this._container.innerHTML=(n.subtext.length>0?'<span class="leaflet-draw-tooltip-subtext">'+n.subtext+"<\/span><br />":"")+"<span>"+n.text+"<\/span>",n.text||n.subtext?(this._visible=!0,this._container.style.visibility="inherit"):(this._visible=!1,this._container.style.visibility="hidden"),this):this},updatePosition:function(n){var i=this._map.latLngToLayerPoint(n),t=this._container;return this._container&&(this._visible&&(t.style.visibility="inherit"),L.DomUtil.setPosition(t,i)),this},showAsError:function(){return this._container&&L.DomUtil.addClass(this._container,"leaflet-error-draw-tooltip"),this},removeError:function(){return this._container&&L.DomUtil.removeClass(this._container,"leaflet-error-draw-tooltip"),this},_onMouseOut:function(){this._container&&(this._container.style.visibility="hidden")}});L.DrawToolbar=L.Toolbar.extend({statics:{TYPE:"draw"},options:{polyline:{},polygon:{},rectangle:{},circle:{},marker:{},circlemarker:{}},initialize:function(n){for(var t in this.options)this.options.hasOwnProperty(t)&&n[t]&&(n[t]=L.extend({},this.options[t],n[t]));this._toolbarClass="leaflet-draw-draw";L.Toolbar.prototype.initialize.call(this,n)},getModeHandlers:function(n){return[{enabled:this.options.polyline,handler:new L.Draw.Polyline(n,this.options.polyline),title:L.drawLocal.draw.toolbar.buttons.polyline},{enabled:this.options.polygon,handler:new L.Draw.Polygon(n,this.options.polygon),title:L.drawLocal.draw.toolbar.buttons.polygon},{enabled:this.options.rectangle,handler:new L.Draw.Rectangle(n,this.options.rectangle),title:L.drawLocal.draw.toolbar.buttons.rectangle},{enabled:this.options.circle,handler:new L.Draw.Circle(n,this.options.circle),title:L.drawLocal.draw.toolbar.buttons.circle},{enabled:this.options.marker,handler:new L.Draw.Marker(n,this.options.marker),title:L.drawLocal.draw.toolbar.buttons.marker},{enabled:this.options.circlemarker,handler:new L.Draw.CircleMarker(n,this.options.circlemarker),title:L.drawLocal.draw.toolbar.buttons.circlemarker}]},getActions:function(n){return[{enabled:n.completeShape,title:L.drawLocal.draw.toolbar.finish.title,text:L.drawLocal.draw.toolbar.finish.text,callback:n.completeShape,context:n},{enabled:n.deleteLastVertex,title:L.drawLocal.draw.toolbar.undo.title,text:L.drawLocal.draw.toolbar.undo.text,callback:n.deleteLastVertex,context:n},{title:L.drawLocal.draw.toolbar.actions.title,text:L.drawLocal.draw.toolbar.actions.text,callback:this.disable,context:this}]},setOptions:function(n){L.setOptions(this,n);for(var t in this._modes)this._modes.hasOwnProperty(t)&&n.hasOwnProperty(t)&&this._modes[t].handler.setOptions(n[t])}});L.EditToolbar=L.Toolbar.extend({statics:{TYPE:"edit"},options:{edit:{selectedPathOptions:{dashArray:"10, 10",fill:!0,fillColor:"#fe57a1",fillOpacity:.1,maintainColor:!1}},remove:{},poly:null,featureGroup:null},initialize:function(n){n.edit&&(void 0===n.edit.selectedPathOptions&&(n.edit.selectedPathOptions=this.options.edit.selectedPathOptions),n.edit.selectedPathOptions=L.extend({},this.options.edit.selectedPathOptions,n.edit.selectedPathOptions));n.remove&&(n.remove=L.extend({},this.options.remove,n.remove));n.poly&&(n.poly=L.extend({},this.options.poly,n.poly));this._toolbarClass="leaflet-draw-edit";L.Toolbar.prototype.initialize.call(this,n);this._selectedFeatureCount=0},getModeHandlers:function(n){var t=this.options.featureGroup;return[{enabled:this.options.edit,handler:new L.EditToolbar.Edit(n,{featureGroup:t,selectedPathOptions:this.options.edit.selectedPathOptions,poly:this.options.poly}),title:L.drawLocal.edit.toolbar.buttons.edit},{enabled:this.options.remove,handler:new L.EditToolbar.Delete(n,{featureGroup:t}),title:L.drawLocal.edit.toolbar.buttons.remove}]},getActions:function(n){var t=[{title:L.drawLocal.edit.toolbar.actions.save.title,text:L.drawLocal.edit.toolbar.actions.save.text,callback:this._save,context:this},{title:L.drawLocal.edit.toolbar.actions.cancel.title,text:L.drawLocal.edit.toolbar.actions.cancel.text,callback:this.disable,context:this}];return n.removeAllLayers&&t.push({title:L.drawLocal.edit.toolbar.actions.clearAll.title,text:L.drawLocal.edit.toolbar.actions.clearAll.text,callback:this._clearAllLayers,context:this}),t},addToolbar:function(n){var t=L.Toolbar.prototype.addToolbar.call(this,n);return this._checkDisabled(),this.options.featureGroup.on("layeradd layerremove",this._checkDisabled,this),t},removeToolbar:function(){this.options.featureGroup.off("layeradd layerremove",this._checkDisabled,this);L.Toolbar.prototype.removeToolbar.call(this)},disable:function(){this.enabled()&&(this._activeMode.handler.revertLayers(),L.Toolbar.prototype.disable.call(this))},_save:function(){this._activeMode.handler.save();this._activeMode&&this._activeMode.handler.disable()},_clearAllLayers:function(){this._activeMode.handler.removeAllLayers();this._activeMode&&this._activeMode.handler.disable()},_checkDisabled:function(){var n,i=this.options.featureGroup,t=0!==i.getLayers().length;this.options.edit&&(n=this._modes[L.EditToolbar.Edit.TYPE].button,t?L.DomUtil.removeClass(n,"leaflet-disabled"):L.DomUtil.addClass(n,"leaflet-disabled"),n.setAttribute("title",t?L.drawLocal.edit.toolbar.buttons.edit:L.drawLocal.edit.toolbar.buttons.editDisabled));this.options.remove&&(n=this._modes[L.EditToolbar.Delete.TYPE].button,t?L.DomUtil.removeClass(n,"leaflet-disabled"):L.DomUtil.addClass(n,"leaflet-disabled"),n.setAttribute("title",t?L.drawLocal.edit.toolbar.buttons.remove:L.drawLocal.edit.toolbar.buttons.removeDisabled))}});L.EditToolbar.Edit=L.Handler.extend({statics:{TYPE:"edit"},includes:L.Mixin.Events,initialize:function(n,t){if(L.Handler.prototype.initialize.call(this,n),L.setOptions(this,t),this._featureGroup=t.featureGroup,!(this._featureGroup instanceof L.FeatureGroup))throw new Error("options.featureGroup must be a L.FeatureGroup");this._uneditedLayerProps={};this.type=L.EditToolbar.Edit.TYPE},enable:function(){!this._enabled&&this._hasAvailableLayers()&&(this.fire("enabled",{handler:this.type}),this._map.fire(L.Draw.Event.EDITSTART,{handler:this.type}),L.Handler.prototype.enable.call(this),this._featureGroup.on("layeradd",this._enableLayerEdit,this).on("layerremove",this._disableLayerEdit,this))},disable:function(){this._enabled&&(this._featureGroup.off("layeradd",this._enableLayerEdit,this).off("layerremove",this._disableLayerEdit,this),L.Handler.prototype.disable.call(this),this._map.fire(L.Draw.Event.EDITSTOP,{handler:this.type}),this.fire("disabled",{handler:this.type}))},addHooks:function(){var n=this._map;n&&(n.getContainer().focus(),this._featureGroup.eachLayer(this._enableLayerEdit,this),this._tooltip=new L.Draw.Tooltip(this._map),this._tooltip.updateContent({text:L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.edit.handlers.edit.tooltip.subtext}),n._editTooltip=this._tooltip,this._updateTooltip(),this._map.on("mousemove",this._onMouseMove,this).on("touchmove",this._onMouseMove,this).on("MSPointerMove",this._onMouseMove,this).on(L.Draw.Event.EDITVERTEX,this._updateTooltip,this))},removeHooks:function(){this._map&&(this._featureGroup.eachLayer(this._disableLayerEdit,this),this._uneditedLayerProps={},this._tooltip.dispose(),this._tooltip=null,this._map.off("mousemove",this._onMouseMove,this).off("touchmove",this._onMouseMove,this).off("MSPointerMove",this._onMouseMove,this).off(L.Draw.Event.EDITVERTEX,this._updateTooltip,this))},revertLayers:function(){this._featureGroup.eachLayer(function(n){this._revertLayer(n)},this)},save:function(){var n=new L.LayerGroup;this._featureGroup.eachLayer(function(t){t.edited&&(n.addLayer(t),t.edited=!1)});this._map.fire(L.Draw.Event.EDITED,{layers:n})},_backupLayer:function(n){var t=L.Util.stamp(n);this._uneditedLayerProps[t]||(n instanceof L.Polyline||n instanceof L.Polygon||n instanceof L.Rectangle?this._uneditedLayerProps[t]={latlngs:L.LatLngUtil.cloneLatLngs(n.getLatLngs())}:n instanceof L.Circle?this._uneditedLayerProps[t]={latlng:L.LatLngUtil.cloneLatLng(n.getLatLng()),radius:n.getRadius()}:(n instanceof L.Marker||n instanceof L.CircleMarker)&&(this._uneditedLayerProps[t]={latlng:L.LatLngUtil.cloneLatLng(n.getLatLng())}))},_getTooltipText:function(){return{text:L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.edit.handlers.edit.tooltip.subtext}},_updateTooltip:function(){this._tooltip.updateContent(this._getTooltipText())},_revertLayer:function(n){var t=L.Util.stamp(n);n.edited=!1;this._uneditedLayerProps.hasOwnProperty(t)&&(n instanceof L.Polyline||n instanceof L.Polygon||n instanceof L.Rectangle?n.setLatLngs(this._uneditedLayerProps[t].latlngs):n instanceof L.Circle?(n.setLatLng(this._uneditedLayerProps[t].latlng),n.setRadius(this._uneditedLayerProps[t].radius)):(n instanceof L.Marker||n instanceof L.CircleMarker)&&n.setLatLng(this._uneditedLayerProps[t].latlng),n.fire("revert-edited",{layer:n}))},_enableLayerEdit:function(n){var i,r,t=n.layer||n.target||n;this._backupLayer(t);this.options.poly&&(r=L.Util.extend({},this.options.poly),t.options.poly=r);this.options.selectedPathOptions&&(i=L.Util.extend({},this.options.selectedPathOptions),i.maintainColor&&(i.color=t.options.color,i.fillColor=t.options.fillColor),t.options.original=L.extend({},t.options),t.options.editing=i);t instanceof L.Marker?(t.editing&&t.editing.enable(),t.dragging.enable(),t.on("dragend",this._onMarkerDragEnd).on("touchmove",this._onTouchMove,this).on("MSPointerMove",this._onTouchMove,this).on("touchend",this._onMarkerDragEnd,this).on("MSPointerUp",this._onMarkerDragEnd,this)):t.editing.enable()},_disableLayerEdit:function(n){var t=n.layer||n.target||n;t.edited=!1;t.editing&&t.editing.disable();delete t.options.editing;delete t.options.original;this._selectedPathOptions&&(t instanceof L.Marker?this._toggleMarkerHighlight(t):(t.setStyle(t.options.previousOptions),delete t.options.previousOptions));t instanceof L.Marker?(t.dragging.disable(),t.off("dragend",this._onMarkerDragEnd,this).off("touchmove",this._onTouchMove,this).off("MSPointerMove",this._onTouchMove,this).off("touchend",this._onMarkerDragEnd,this).off("MSPointerUp",this._onMarkerDragEnd,this)):t.editing.disable()},_onMouseMove:function(n){this._tooltip.updatePosition(n.latlng)},_onMarkerDragEnd:function(n){var t=n.target;t.edited=!0;this._map.fire(L.Draw.Event.EDITMOVE,{layer:t})},_onTouchMove:function(n){var t=n.originalEvent.changedTouches[0],i=this._map.mouseEventToLayerPoint(t),r=this._map.layerPointToLatLng(i);n.target.setLatLng(r)},_hasAvailableLayers:function(){return 0!==this._featureGroup.getLayers().length}});L.EditToolbar.Delete=L.Handler.extend({statics:{TYPE:"remove"},includes:L.Mixin.Events,initialize:function(n,t){if(L.Handler.prototype.initialize.call(this,n),L.Util.setOptions(this,t),this._deletableLayers=this.options.featureGroup,!(this._deletableLayers instanceof L.FeatureGroup))throw new Error("options.featureGroup must be a L.FeatureGroup");this.type=L.EditToolbar.Delete.TYPE},enable:function(){!this._enabled&&this._hasAvailableLayers()&&(this.fire("enabled",{handler:this.type}),this._map.fire(L.Draw.Event.DELETESTART,{handler:this.type}),L.Handler.prototype.enable.call(this),this._deletableLayers.on("layeradd",this._enableLayerDelete,this).on("layerremove",this._disableLayerDelete,this))},disable:function(){this._enabled&&(this._deletableLayers.off("layeradd",this._enableLayerDelete,this).off("layerremove",this._disableLayerDelete,this),L.Handler.prototype.disable.call(this),this._map.fire(L.Draw.Event.DELETESTOP,{handler:this.type}),this.fire("disabled",{handler:this.type}))},addHooks:function(){var n=this._map;n&&(n.getContainer().focus(),this._deletableLayers.eachLayer(this._enableLayerDelete,this),this._deletedLayers=new L.LayerGroup,this._tooltip=new L.Draw.Tooltip(this._map),this._tooltip.updateContent({text:L.drawLocal.edit.handlers.remove.tooltip.text}),this._map.on("mousemove",this._onMouseMove,this))},removeHooks:function(){this._map&&(this._deletableLayers.eachLayer(this._disableLayerDelete,this),this._deletedLayers=null,this._tooltip.dispose(),this._tooltip=null,this._map.off("mousemove",this._onMouseMove,this))},revertLayers:function(){this._deletedLayers.eachLayer(function(n){this._deletableLayers.addLayer(n);n.fire("revert-deleted",{layer:n})},this)},save:function(){this._map.fire(L.Draw.Event.DELETED,{layers:this._deletedLayers})},removeAllLayers:function(){this._deletableLayers.eachLayer(function(n){this._removeLayer({layer:n})},this);this.save()},_enableLayerDelete:function(n){(n.layer||n.target||n).on("click",this._removeLayer,this)},_disableLayerDelete:function(n){var t=n.layer||n.target||n;t.off("click",this._removeLayer,this);this._deletedLayers.removeLayer(t)},_removeLayer:function(n){var t=n.layer||n.target||n;this._deletableLayers.removeLayer(t);this._deletedLayers.addLayer(t);t.fire("deleted")},_onMouseMove:function(n){this._tooltip.updatePosition(n.latlng)},_hasAvailableLayers:function(){return 0!==this._deletableLayers.getLayers().length}})}(window,document);L.Control.Coordinates=L.Control.extend({options:{position:"bottomright",decimals:4,decimalSeperator:".",labelTemplateLat:"Lat: {y}",labelTemplateLng:"Lng: {x}",labelFormatterLat:undefined,labelFormatterLng:undefined,enableUserInput:!0,useDMS:!1,useLatLngOrder:!1,centerUserCoordinates:!1,markerType:L.marker,markerProps:{}},onAdd:function(n){var r,u;this._map=n;var i=this._container=L.DomUtil.create("div","leaflet-control-coordinates"),t=this.options;this._labelcontainer=L.DomUtil.create("div","uiElement label",i);this._label=L.DomUtil.create("span","labelFirst",this._labelcontainer);this._inputcontainer=L.DomUtil.create("div","uiElement input uiHidden",i);t.useLatLngOrder?(u=L.DomUtil.create("span","",this._inputcontainer),this._inputY=this._createInput("inputY",this._inputcontainer),r=L.DomUtil.create("span","",this._inputcontainer),this._inputX=this._createInput("inputX",this._inputcontainer)):(r=L.DomUtil.create("span","",this._inputcontainer),this._inputX=this._createInput("inputX",this._inputcontainer),u=L.DomUtil.create("span","",this._inputcontainer),this._inputY=this._createInput("inputY",this._inputcontainer));r.innerHTML=t.labelTemplateLng.replace("{x}","");u.innerHTML=t.labelTemplateLat.replace("{y}","");L.DomEvent.on(this._inputX,"keyup",this._handleKeypress,this);L.DomEvent.on(this._inputY,"keyup",this._handleKeypress,this);n.on("mousemove",this._update,this);n.on("dragstart",this.collapse,this);return n.whenReady(this._update,this),this._showsCoordinates=!0,t.enableUserInput&&L.DomEvent.addListener(this._container,"click",this._switchUI,this),i},_createInput:function(n,t){var i=L.DomUtil.create("input",n,t);return i.type="text",L.DomEvent.disableClickPropagation(i),i},_clearMarker:function(){this._map.removeLayer(this._marker)},_handleKeypress:function(n){switch(n.keyCode){case 27:this.collapse();break;case 13:this._handleSubmit();this.collapse();break;default:this._handleSubmit()}},_handleSubmit:function(){var i=L.NumberFormatter.createValidNumber(this._inputX.value,this.options.decimalSeperator),r=L.NumberFormatter.createValidNumber(this._inputY.value,this.options.decimalSeperator),n,t;if(i!==undefined&&r!==undefined){if(n=this._marker,!n){n=this._marker=this._createNewMarker();n.on("click",this._clearMarker,this)}t=new L.LatLng(r,i);n.setLatLng(t);n.addTo(this._map);this.options.centerUserCoordinates&&this._map.setView(t,this._map.getZoom())}},expand:function(){this._showsCoordinates=!1;this._map.off("mousemove",this._update,this);L.DomEvent.addListener(this._container,"mousemove",L.DomEvent.stop);L.DomEvent.removeListener(this._container,"click",this._switchUI,this);L.DomUtil.addClass(this._labelcontainer,"uiHidden");L.DomUtil.removeClass(this._inputcontainer,"uiHidden")},_createCoordinateLabel:function(n){var t=this.options,i,r;return t.customLabelFcn?t.customLabelFcn(n,t):(i=t.labelLng?t.labelFormatterLng(n.lng):L.Util.template(t.labelTemplateLng,{x:this._getNumber(n.lng,t)}),r=t.labelFormatterLat?t.labelFormatterLat(n.lat):L.Util.template(t.labelTemplateLat,{y:this._getNumber(n.lat,t)}),t.useLatLngOrder)?r+" "+i:i+" "+r},_getNumber:function(n,t){return t.useDMS?L.NumberFormatter.toDMS(n):L.NumberFormatter.round(n,t.decimals,t.decimalSeperator)},collapse:function(){var e,t,u,i,f,n,r;if(!this._showsCoordinates){this._map.on("mousemove",this._update,this);if(this._showsCoordinates=!0,e=this.options,L.DomEvent.addListener(this._container,"click",this._switchUI,this),L.DomEvent.removeListener(this._container,"mousemove",L.DomEvent.stop),L.DomUtil.addClass(this._inputcontainer,"uiHidden"),L.DomUtil.removeClass(this._labelcontainer,"uiHidden"),this._marker){t=this._createNewMarker();u=this._marker.getLatLng();t.setLatLng(u);i=L.DomUtil.create("div","");f=L.DomUtil.create("div","",i);f.innerHTML=this._ordinateLabel(u);n=L.DomUtil.create("a","",i);n.innerHTML="Remove";n.href="#";r=L.DomEvent.stopPropagation;L.DomEvent.on(n,"click",r).on(n,"mousedown",r).on(n,"dblclick",r).on(n,"click",L.DomEvent.preventDefault).on(n,"click",function(){this._map.removeLayer(t)},this);t.bindPopup(i);t.addTo(this._map);this._map.removeLayer(this._marker);this._marker=null}}},_switchUI:function(n){L.DomEvent.stop(n);L.DomEvent.stopPropagation(n);L.DomEvent.preventDefault(n);this._showsCoordinates?this.expand():this.collapse()},onRemove:function(n){n.off("mousemove",this._update,this)},_update:function(n){var t=n.latlng,i=this.options;t&&(t=t.wrap(),this._currentPos=t,this._inputY.value=L.NumberFormatter.round(t.lat,i.decimals,i.decimalSeperator),this._inputX.value=L.NumberFormatter.round(t.lng,i.decimals,i.decimalSeperator),this._label.innerHTML=this._createCoordinateLabel(t))},_createNewMarker:function(){return this.options.markerType(null,this.options.markerProps)}});L.control.coordinates=function(n){return new L.Control.Coordinates(n)};L.Map.mergeOptions({coordinateControl:!1});L.Map.addInitHook(function(){this.options.coordinateControl&&(this.coordinateControl=new L.Control.Coordinates,this.addControl(this.coordinateControl))});L.NumberFormatter={round:function(n,t,i){var u=L.Util.formatNum(n,t)+"",r=u.split("."),f;if(r[1]){for(f=t-r[1].length;f>0;f--)r[1]+="0";u=r.join(i||".")}return u},toDMS:function(n){var r=Math.floor(Math.abs(n)),f=(Math.abs(n)-r)*60,t=Math.floor(f),e=(f-t)*60,i=Math.round(e),u;return i==60&&(t++,i="00"),t==60&&(r++,t="00"),i<10&&(i="0"+i),t<10&&(t="0"+t),u="",n<0&&(u="-"),""+u+r+"&deg; "+t+"' "+i+"''"},createValidNumber:function(n,t){var r,i;if(n&&n.length>0){r=n.split(t||".");try{return(i=Number(r.join(".")),isNaN(i))?undefined:i}catch(u){return undefined}}return undefined}},function(){var n,i,t,r;if(L.Control.FullScreen=L.Control.extend({options:{position:"topleft",title:"Full Screen",titleCancel:"Exit Full Screen",forceSeparateButton:!1,forcePseudoFullscreen:!1,fullscreenElement:!1},onAdd:function(n){var i="leaflet-control-zoom-fullscreen",t,r="";t=n.zoomControl&&!this.options.forceSeparateButton?n.zoomControl._container:L.DomUtil.create("div","leaflet-bar");this.options.content?r=this.options.content:i+=" fullscreen-icon";this._createButton(this.options.title,i,r,t,this.toggleFullScreen,this);this._map.on("enterFullscreen exitFullscreen",this._toggleTitle,this);return t},_createButton:function(t,i,r,u,f,e){return this.link=L.DomUtil.create("a",i,u),this.link.href="#",this.link.title=t,this.link.innerHTML=r,L.DomEvent.addListener(this.link,"click",L.DomEvent.stopPropagation).addListener(this.link,"click",L.DomEvent.preventDefault).addListener(this.link,"click",f,e),L.DomEvent.addListener(u,n.fullScreenEventName,L.DomEvent.stopPropagation).addListener(u,n.fullScreenEventName,L.DomEvent.preventDefault).addListener(u,n.fullScreenEventName,this._handleFullscreenChange,e),L.DomEvent.addListener(document,n.fullScreenEventName,L.DomEvent.stopPropagation).addListener(document,n.fullScreenEventName,L.DomEvent.preventDefault).addListener(document,n.fullScreenEventName,this._handleFullscreenChange,e),this.link},toggleFullScreen:function(){var t=this._map;t._exitFired=!1;t._isFullscreen?(n.supportsFullScreen&&!this.options.forcePseudoFullscreen?n.cancelFullScreen():L.DomUtil.removeClass(this.options.fullscreenElement?this.options.fullscreenElement:t._container,"leaflet-pseudo-fullscreen"),t.fire("exitFullscreen"),t._exitFired=!0,t._isFullscreen=!1):(n.supportsFullScreen&&!this.options.forcePseudoFullscreen?n.requestFullScreen(this.options.fullscreenElement?this.options.fullscreenElement:t._container):L.DomUtil.addClass(this.options.fullscreenElement?this.options.fullscreenElement:t._container,"leaflet-pseudo-fullscreen"),t.fire("enterFullscreen"),t._isFullscreen=!0)},_toggleTitle:function(){this.link.title=this._map._isFullscreen?this.options.title:this.options.titleCancel},_handleFullscreenChange:function(){var t=this._map;t.invalidateSize();n.isFullScreen()||t._exitFired||(t.fire("exitFullscreen"),t._exitFired=!0,t._isFullscreen=!1)}}),L.Map.addInitHook(function(){this.options.fullscreenControl&&(this.fullscreenControl=L.control.fullscreen(this.options.fullscreenControlOptions),this.addControl(this.fullscreenControl))}),L.control.fullscreen=function(n){return new L.Control.FullScreen(n)},n={supportsFullScreen:!1,isFullScreen:function(){return!1},requestFullScreen:function(){},cancelFullScreen:function(){},fullScreenEventName:"",prefix:""},i="webkit moz o ms khtml".split(" "),typeof document.exitFullscreen!="undefined")n.supportsFullScreen=!0;else{for(t=0,r=i.length;t<r;t++)if(n.prefix=i[t],typeof document[n.prefix+"CancelFullScreen"]!="undefined"){n.supportsFullScreen=!0;break}typeof document.msExitFullscreen!="undefined"&&(n.prefix="ms",n.supportsFullScreen=!0)}n.supportsFullScreen&&(n.fullScreenEventName=n.prefix==="ms"?"MSFullscreenChange":n.prefix+"fullscreenchange",n.isFullScreen=function(){switch(this.prefix){case"":return document.fullscreen;case"webkit":return document.webkitIsFullScreen;case"ms":return document.msFullscreenElement;default:return document[this.prefix+"FullScreen"]}},n.requestFullScreen=function(n){switch(this.prefix){case"":return n.requestFullscreen();case"ms":return n.msRequestFullscreen();default:return n[this.prefix+"RequestFullScreen"]()}},n.cancelFullScreen=function(){switch(this.prefix){case"":return document.exitFullscreen();case"ms":return document.msExitFullscreen();default:return document[this.prefix+"CancelFullScreen"]()}});typeof jQuery!="undefined"&&(jQuery.fn.requestFullScreen=function(){return this.each(function(){var t=jQuery(this);n.supportsFullScreen&&n.requestFullScreen(t)})});window.fullScreenApi=n}();L.Control.GraphicScale=L.Control.extend({options:{position:"bottomleft",updateWhenIdle:!1,minUnitWidth:30,maxUnitsWidth:240,fill:!1,showSubunits:!1,doubleLine:!1,labelPlacement:"auto"},onAdd:function(n){this._map=n;this._possibleUnitsNum=[3,5,2,4];this._possibleUnitsNumLen=this._possibleUnitsNum.length;this._possibleDivisions=[1,.5,.25,.2];this._possibleDivisionsLen=this._possibleDivisions.length;this._possibleDivisionsSub={1:{num:2},.5:{num:5},.25:{num:5},.2:{num:2}};this._scaleInner=this._buildScale();this._scale=this._addScale(this._scaleInner);this._setStyle(this.options);n.on(this.options.updateWhenIdle?"moveend":"move",this._update,this);return n.whenReady(this._update,this),this._scale},onRemove:function(n){n.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScale:function(n){var t=L.DomUtil.create("div");return t.className="leaflet-control-graphicscale",t.appendChild(n),t},_setStyle:function(n){var t=["leaflet-control-graphicscale-inner"];n.fill&&n.fill!=="nofill"&&(t.push("filled"),t.push("filled-"+n.fill));n.showSubunits&&t.push("showsubunits");n.doubleLine&&t.push("double");t.push("labelPlacement-"+n.labelPlacement);this._scaleInner.className=t.join(" ")},_buildScale:function(){var t=document.createElement("div"),f,e,n,i,r,u;for(t.className="leaflet-control-graphicscale-inner",f=L.DomUtil.create("div","subunits",t),e=L.DomUtil.create("div","units",t),this._units=[],this._unitsLbls=[],this._subunits=[],n=0;n<5;n++)i=this._buildDivision(n%2==0),e.appendChild(i),this._units.push(i),r=this._buildDivisionLbl(),i.appendChild(r),this._unitsLbls.push(r),u=this._buildDivision(n%2==1),f.appendChild(u),this._subunits.unshift(u);return this._zeroLbl=L.DomUtil.create("div","label zeroLabel"),this._zeroLbl.innerHTML="0",this._units[0].appendChild(this._zeroLbl),this._subunitsLbl=L.DomUtil.create("div","label subunitsLabel"),this._subunitsLbl.innerHTML="?",this._subunits[4].appendChild(this._subunitsLbl),t},_buildDivision:function(n){var t=L.DomUtil.create("div","division"),r=L.DomUtil.create("div","line"),i;return t.appendChild(r),i=L.DomUtil.create("div","line2"),t.appendChild(i),n&&r.appendChild(L.DomUtil.create("div","fill")),n||i.appendChild(L.DomUtil.create("div","fill")),t},_buildDivisionLbl:function(){return L.DomUtil.create("div","label divisionLabel")},_update:function(){var n=this._map.getBounds(),t=n.getCenter().lat,i=6378137*Math.PI*Math.cos(t*Math.PI/180),r=i*(n.getNorthEast().lng-n.getSouthWest().lng)/180,u=this._map.getSize();u.x>0&&this._updateScale(r,this.options)},_updateScale:function(n,t){var i=this._getBestScale(n,t.minUnitWidth,t.maxUnitsWidth);this._render(i)},_getBestScale:function(n,t,i){var f=this._getPossibleUnits(n,t,this._map.getSize().x),u=this._getPossibleScales(f,i),r;return u.sort(function(n,t){return t.score-n.score}),r=u[0],r.subunits=this._getSubunits(r),r},_getSubunits:function(n){var i=this._possibleDivisionsSub[n.unit.unitDivision],t={},r=n.unit.unitDivision/i.num;return t.subunitDivision=r,t.subunitMeters=r*(n.unit.unitMeters/n.unit.unitDivision),t.subunitPx=r*(n.unit.unitPx/n.unit.unitDivision),{subunit:t,numSubunits:i.num,total:i.num*t.subunitMeters}},_getPossibleScales:function(n,t){for(var i,a,o,h,f=[],c=Number.POSITIVE_INFINITY,l,e=0;e<this._possibleUnitsNumLen;e++)for(i=this._possibleUnitsNum[e],a=(this._possibleUnitsNumLen-e)*.5,o=0;o<n.length;o++){var r=n[o],u=r.unitPx*i,s={unit:r,totalWidthPx:u,numUnits:i,score:0},v=1-(t-u)/t;v*=3;h=r.unitScore+a+v;(r.unitDivision===.25&&i===3||r.unitDivision===.5&&i===3||r.unitDivision===.25&&i===5)&&(h-=2);s.score=h;u<t&&f.push(s);u<c&&(c=u,l=s)}return f.length||f.push(l),f},_getPossibleUnits:function(n,t,i){for(var r,e,o,h=(Math.floor(n)+"").length,s,u=[],f=h;f>0;f--)for(s=Math.pow(10,f),r=0;r<this._possibleDivisionsLen;r++){if(e=s*this._possibleDivisions[r],o=i*(e/n),o<t)return u;u.push({unitMeters:e,unitPx:o,unitDivision:this._possibleDivisions[r],unitScore:this._possibleDivisionsLen-r})}return u},_render:function(n){this._renderPart(n.unit.unitPx,n.unit.unitMeters,n.numUnits,this._units,this._unitsLbls);this._renderPart(n.subunits.subunit.subunitPx,n.subunits.subunit.subunitMeters,n.subunits.numSubunits,this._subunits);var t=this._getDisplayUnit(n.subunits.total);this._subunitsLbl.innerHTML=""+t.amount+t.unit},_renderPart:function(n,t,i,r,u){for(var e,s,o,h,c=this._getDisplayUnit(t),f=0;f<this._units.length;f++)(e=r[f],f<i?(e.style.width=n+"px",e.className="division"):(e.style.width=0,e.className="division hidden"),u)&&(s=u[f],o=["label","divisionLabel"],f<i&&(h=((f+1)*c.amount).toFixed(2),f===i-1?(h+=c.unit,o.push("labelLast")):o.push("labelSub"),s.innerHTML=h),s.className=o.join(" "))},_getDisplayUnit:function(n){console.log(n);var t=n<1e3?"m":"km";return{unit:t,amount:t==="km"?n/1e3:n}}});L.Map.mergeOptions({graphicScaleControl:!1});L.Map.addInitHook(function(){this.options.graphicScaleControl&&(this.graphicScaleControl=new L.Control.GraphicScale,this.addControl(this.graphicScaleControl))});L.control.graphicScale=function(n){return new L.Control.GraphicScale(n)};!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(n.turf={})}(this,function(n){"use strict";function fu(n,t,i){var u,f,r;if(i=i||{},!v(i))throw new Error("options is invalid");if(u=i.bbox,f=i.id,void 0===n)throw new Error("geometry is required");if(t&&t.constructor!==Object)throw new Error("properties must be an Object");return u&&yy(u),f&&wk(f),r={type:"Feature"},f&&(r.id=f),u&&(r.bbox=u),r.properties=t||{},r.geometry=n,r}function vft(n,t,i){var u,r;if(i=i||{},!v(i))throw new Error("options is invalid");if(u=i.bbox,!n)throw new Error("type is required");if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");u&&yy(u);switch(n){case"Point":r=wi(t).geometry;break;case"LineString":r=ur(t).geometry;break;case"Polygon":r=st(t).geometry;break;case"MultiPoint":r=yk(t).geometry;break;case"MultiLineString":r=fa(t).geometry;break;case"MultiPolygon":r=ay(t).geometry;break;default:throw new Error(n+" is invalid");}return u&&(r.bbox=u),r}function wi(n,t,i){if(!n)throw new Error("coordinates is required");if(!Array.isArray(n))throw new Error("coordinates must be an Array");if(n.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!gi(n[0])||!gi(n[1]))throw new Error("coordinates must contain numbers");return fu({type:"Point",coordinates:n},t,i)}function yft(n,t,i){if(!n)throw new Error("coordinates is required");if(!Array.isArray(n))throw new Error("coordinates must be an Array");return d(n.map(function(n){return wi(n,t)}),i)}function st(n,t,i){var f,r,u;if(!n)throw new Error("coordinates is required");for(f=0;f<n.length;f++){if(r=n[f],r.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(u=0;u<r[r.length-1].length;u++){if(0===f&&0===u&&!gi(r[0][0])||!gi(r[0][1]))throw new Error("coordinates must contain numbers");if(r[r.length-1][u]!==r[0][u])throw new Error("First and last Position are not equivalent.");}}return fu({type:"Polygon",coordinates:n},t,i)}function pft(n,t,i){if(!n)throw new Error("coordinates is required");if(!Array.isArray(n))throw new Error("coordinates must be an Array");return d(n.map(function(n){return st(n,t)}),i)}function ur(n,t,i){if(!n)throw new Error("coordinates is required");if(n.length<2)throw new Error("coordinates must be an array of two or more positions");if(!gi(n[0][1])||!gi(n[0][1]))throw new Error("coordinates must contain numbers");return fu({type:"LineString",coordinates:n},t,i)}function wft(n,t,i){if(!n)throw new Error("coordinates is required");if(!Array.isArray(n))throw new Error("coordinates must be an Array");return d(n.map(function(n){return ur(n,t)}),i)}function d(n,t){var i,r,u;if(t=t||{},!v(t))throw new Error("options is invalid");if(i=t.bbox,r=t.id,!n)throw new Error("No features passed");if(!Array.isArray(n))throw new Error("features must be an Array");return i&&yy(i),r&&wk(r),u={type:"FeatureCollection"},r&&(u.id=r),i&&(u.bbox=i),u.features=n,u}function fa(n,t,i){if(!n)throw new Error("coordinates is required");return fu({type:"MultiLineString",coordinates:n},t,i)}function yk(n,t,i){if(!n)throw new Error("coordinates is required");return fu({type:"MultiPoint",coordinates:n},t,i)}function ay(n,t,i){if(!n)throw new Error("coordinates is required");return fu({type:"MultiPolygon",coordinates:n},t,i)}function ntt(n,t,i){if(!n)throw new Error("geometries is required");if(!Array.isArray(n))throw new Error("geometries must be an Array");return fu({type:"GeometryCollection",geometries:n},t,i)}function bft(n,t){if(void 0===n||null===n||isNaN(n))throw new Error("num is required");if(t&&!(t>=0))throw new Error("precision must be a positive number");var i=Math.pow(10,t||0);return Math.round(n*i)/i}function vy(n,t){if(void 0===n||null===n)throw new Error("radians is required");if(t&&"string"!=typeof t)throw new Error("units must be a string");var i=sg[t||"kilometers"];if(!i)throw new Error(t+" units is invalid");return n*i}function ev(n,t){if(void 0===n||null===n)throw new Error("distance is required");if(t&&"string"!=typeof t)throw new Error("units must be a string");var i=sg[t||"kilometers"];if(!i)throw new Error(t+" units is invalid");return n/i}function pk(n,t){return oa(ev(n,t))}function ea(n){if(null===n||void 0===n)throw new Error("bearing is required");var t=n%360;return t<0&&(t+=360),t}function oa(n){if(null===n||void 0===n)throw new Error("radians is required");return 180*(n%(2*Math.PI))/Math.PI}function yu(n){if(null===n||void 0===n)throw new Error("degrees is required");return n%360*Math.PI/180}function ov(n,t,i){if(null===n||void 0===n)throw new Error("length is required");if(!(n>=0))throw new Error("length must be a positive number");return vy(ev(n,t),i||"kilometers")}function kft(n,t,i){var r,u;if(null===n||void 0===n)throw new Error("area is required");if(!(n>=0))throw new Error("area must be a positive number");if(r=hg[t||"meters"],!r)throw new Error("invalid original units");if(u=hg[i||"kilometers"],!u)throw new Error("invalid final units");return n/r*u}function gi(n){return!isNaN(n)&&null!==n&&!Array.isArray(n)}function v(n){return!!n&&n.constructor===Object}function yy(n){if(!n)throw new Error("bbox is required");if(!Array.isArray(n))throw new Error("bbox must be an Array");if(4!==n.length&&6!==n.length)throw new Error("bbox must be an Array of 4 or 6 numbers");n.forEach(function(n){if(!gi(n))throw new Error("bbox must only contain numbers");})}function wk(n){if(!n)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof n))throw new Error("id must be a number or a string");}function pu(n,t,i){var y,f,h,e;if(null!==n)for(var r,o,v,l,w,u,a,b,p=0,s=0,k=n.type,d="FeatureCollection"===k,g="Feature"===k,nt=d?n.features.length:1,c=0;c<nt;c++)for(w=(b=!!(a=d?n.features[c].geometry:g?n.geometry:n)&&"GeometryCollection"===a.type)?a.geometries.length:1,y=0;y<w;y++)if(f=0,h=0,null!==(l=b?a.geometries[y]:a)){u=l.coordinates;e=l.type;switch(p=!i||"Polygon"!==e&&"MultiPolygon"!==e?0:1,e){case null:break;case"Point":t(u,s,c,f,h);s++;f++;break;case"LineString":case"MultiPoint":for(r=0;r<u.length;r++)t(u[r],s,c,f,h),s++,"MultiPoint"===e&&f++;"LineString"===e&&f++;break;case"Polygon":case"MultiLineString":for(r=0;r<u.length;r++){for(o=0;o<u[r].length-p;o++)t(u[r][o],s,c,f,h),s++;"MultiLineString"===e&&f++;"Polygon"===e&&h++}"Polygon"===e&&f++;break;case"MultiPolygon":for(r=0;r<u.length;r++){for("MultiPolygon"===e&&(h=0),o=0;o<u[r].length;o++){for(v=0;v<u[r][o].length-p;v++)t(u[r][o][v],s,c,f,h),s++;h++}f++}break;case"GeometryCollection":for(r=0;r<l.geometries.length;r++)pu(l.geometries[r],t,i);break;default:throw new Error("Unknown Geometry Type");}}}function bk(n,t,i,r){var u=i;return pu(n,function(n,r,f,e,o){u=0===r&&void 0===i?n:t(u,n,r,f,e,o)},r),u}function ttt(n,t){var i;switch(n.type){case"FeatureCollection":for(i=0;i<n.features.length;i++)t(n.features[i].properties,i);break;case"Feature":t(n.properties,0)}}function dft(n,t,i){var r=i;return ttt(n,function(n,u){r=0===u&&void 0===i?n:t(r,n,u)}),r}function nr(n,t){if("Feature"===n.type)t(n,0);else if("FeatureCollection"===n.type)for(var i=0;i<n.features.length;i++)t(n.features[i],i)}function itt(n,t,i){var r=i;return nr(n,function(n,u){r=0===u&&void 0===i?n:t(r,n,u)}),r}function ec(n){var t=[];return pu(n,function(n){t.push(n)}),t}function nh(n,t){for(var e,o,u,v,r,y,s,h,c,l=0,f="FeatureCollection"===n.type,a="Feature"===n.type,p=f?n.features.length:1,i=0;i<p;i++){for(r=f?n.features[i].geometry:a?n.geometry:n,s=f?n.features[i].properties:a?n.properties:{},h=f?n.features[i].bbox:a?n.bbox:void 0,c=f?n.features[i].id:a?n.id:void 0,v=(y=!!r&&"GeometryCollection"===r.type)?r.geometries.length:1,o=0;o<v;o++)if(null!==(u=y?r.geometries[o]:r))switch(u.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":t(u,l,s,h,c);break;case"GeometryCollection":for(e=0;e<u.geometries.length;e++)t(u.geometries[e],l,s,h,c);break;default:throw new Error("Unknown Geometry Type");}else t(null,l,s,h,c);l++}}function rtt(n,t,i){var r=i;return nh(n,function(n,u,f,e,o){r=0===u&&void 0===i?n:t(r,n,u,f,e,o)}),r}function su(n,t){nh(n,function(n,i,r,u,f){var o=null===n?null:n.type,e;switch(o){case null:case"Point":case"LineString":case"Polygon":return void t(fu(n,r,{bbox:u,id:f}),i,0)}switch(o){case"MultiPoint":e="Point";break;case"MultiLineString":e="LineString";break;case"MultiPolygon":e="Polygon"}n.coordinates.forEach(function(n,u){t(fu({type:e,coordinates:n},r),i,u)})})}function gft(n,t,i){var r=i;return su(n,function(n,u,f){r=0===u&&0===f&&void 0===i?n:t(r,n,u,f)}),r}function ol(n,t){su(n,function(n,i,r){var f=0,u;n.geometry&&(u=n.geometry.type,"Point"!==u&&"MultiPoint"!==u&&bk(n,function(u,e,o,s,h,c){var l=ur([u,e],n.properties);return t(l,i,r,c,f),f++,e}))})}function utt(n,t,i){var r=i,u=!1;return ol(n,function(n,f,e,o,s){r=!1===u&&void 0===i?n:t(r,n,f,e,o,s);u=!0}),r}function ftt(n,t){if(!n)throw new Error("geojson is required");su(n,function(n,i,r){var e,f,u;if(null!==n.geometry){e=n.geometry.type;f=n.geometry.coordinates;switch(e){case"LineString":t(n,i,r,0,0);break;case"Polygon":for(u=0;u<f.length;u++)t(ur(f[u],n.properties),i,r,u)}}})}function ett(n,t,i){var r=i;return ftt(n,function(n,u,f,e){r=0===u&&void 0===i?n:t(r,n,u,f,e)}),r}function hu(n){var t=[1/0,1/0,-1/0,-1/0];return pu(n,function(n){t[0]>n[0]&&(t[0]=n[0]);t[1]>n[1]&&(t[1]=n[1]);t[2]<n[0]&&(t[2]=n[0]);t[3]<n[1]&&(t[3]=n[1])}),t}function cr(n){if(!n)throw new Error("obj is required");var t=p(n);if(t.length>1&&gi(t[0])&&gi(t[1]))return t;throw new Error("Coordinate is not a valid Point");}function p(n){if(!n)throw new Error("obj is required");var t;if(n.length?t=n:n.coordinates?t=n.coordinates:n.geometry&&n.geometry.coordinates&&(t=n.geometry.coordinates),t)return kk(t),t;throw new Error("No valid coordinates");}function kk(n){if(n.length>1&&gi(n[0])&&gi(n[1]))return!0;if(Array.isArray(n[0])&&n[0].length)return kk(n[0]);throw new Error("coordinates must only contain numbers");}function net(n,t,i){if(!t||!i)throw new Error("type and name required");if(!n||n.type!==t)throw new Error("Invalid input to "+i+": must be a "+t+", given "+n.type);}function yw(n,t,i){if(!n)throw new Error("No feature passed");if(!i)throw new Error(".featureOf() requires a name");if(!n||"Feature"!==n.type||!n.geometry)throw new Error("Invalid input to "+i+", Feature with geometry required");if(!n.geometry||n.geometry.type!==t)throw new Error("Invalid input to "+i+": must be a "+t+", given "+n.geometry.type);}function ah(n,t,i){var u,r;if(!n)throw new Error("No featureCollection passed");if(!i)throw new Error(".collectionOf() requires a name");if(!n||"FeatureCollection"!==n.type)throw new Error("Invalid input to "+i+", FeatureCollection required");for(u=0;u<n.features.length;u++){if(r=n.features[u],!r||"Feature"!==r.type||!r.geometry)throw new Error("Invalid input to "+i+", Feature with geometry required");if(!r.geometry||r.geometry.type!==t)throw new Error("Invalid input to "+i+": must be a "+t+", given "+r.geometry.type);}}function no(n){if(!n)throw new Error("geojson is required");if(void 0!==n.geometry)return n.geometry;if(n.coordinates||n.geometries)return n;throw new Error("geojson must be a valid Feature or Geometry Object");}function tet(){throw new Error("invariant.getGeomType has been deprecated in v5.0 in favor of invariant.getType");}function fr(n,t){if(!n)throw new Error((t||"geojson")+" is required");if(n.geometry&&n.geometry.type)return n.geometry.type;if(n.type)return n.type;throw new Error((t||"geojson")+" is invalid");}function wyt(n,t,i){var e,u,f,r,o;for(i=i||{},e=Object.keys(fat),u=0;u<e.length;u++)f=e[u],r=i[f],r=void 0!==r&&null!==r?r:fat[f],cg[f]=r;return cg.verbose&&console.log("MarchingSquaresJS-isoContours: computing isocontour for "+t),o=function(n){var t=[],i=0;return n.rows,n.cols,n.cells.forEach(function(r,u){r.forEach(function(r,f){var e,h,s;if(void 0!==r&&!function(n){return 5===n.cval||10===n.cval}(r)&&!iet(r)){if(e=function(n,t,i){var e,o,u,w=n.length,c=[],v=[0,0,1,1,0,0,0,0,-1,0,1,1,-1,0,-1,0],y=[0,-1,0,0,1,1,1,1,0,-1,0,0,0,-1,0,0],p=["none","bottom","right","right","top","top","top","top","left","bottom","right","right","left","bottom","left","none"],f=(n[t][i],n[t][i]),r=f.cval,s=ott(f,u=["none","left","bottom","left","right","none","bottom","left","top","top","none","top","right","right","bottom","none"][r]);c.push([i+s[0],t+s[1]]);s=ott(f,u=p[r]);c.push([i+s[0],t+s[1]]);ret(f);for(var l=i+v[r],h=t+y[r],a=r;l>=0&&h>=0&&h<w&&(l!=i||h!=t)&&void 0!==(f=n[h][l]);){if(0===(r=f.cval)||15===r)return{path:c,info:"mergeable"};u=p[r];e=v[r];o=y[r];5!==r&&10!==r||(5===r?f.flipped?-1===y[a]?(u="left",e=-1,o=0):(u="right",e=1,o=0):-1===v[a]&&(u="bottom",e=0,o=-1):10===r&&(f.flipped?-1===v[a]?(u="top",e=0,o=1):(u="bottom",e=0,o=-1):1===y[a]&&(u="left",e=-1,o=0)));s=ott(f,u);c.push([l+s[0],h+s[1]]);ret(f);l+=e;h+=o;a=r}return{path:c,info:"closed"}}(n.cells,u,f),h=!1,"mergeable"===e.info)for(var c=e.path[e.path.length-1][0],l=e.path[e.path.length-1][1],o=i-1;o>=0;o--)if(Math.abs(t[o][0][0]-c)<=1e-7&&Math.abs(t[o][0][1]-l)<=1e-7){for(s=e.path.length-2;s>=0;--s)t[o].unshift(e.path[s]);h=!0;break}h||(t[i++]=e.path)}})}),t}(function(n,t){for(var a,v,p,o,s,h,c,w=n.length-1,b=n[0].length-1,y={rows:w,cols:b,cells:[]},l=0;l<w;++l)for(y.cells[l]=[],a=0;a<b;++a){var i=0,r=n[l+1][a],u=n[l+1][a+1],f=n[l][a+1],e=n[l][a];isNaN(r)||isNaN(u)||isNaN(f)||isNaN(e)||(i|=r>=t?8:0,i|=u>=t?4:0,i|=f>=t?2:0,v=!1,(5==(i|=e>=t?1:0)||10===i)&&(p=(r+u+f+e)/4,5===i&&p<t?(i=10,v=!0):10===i&&p<t&&(i=5,v=!0)),0!==i&&15!==i&&(o=s=h=c=.5,1===i?(h=1-er(t,r,e),s=1-er(t,f,e)):2===i?(s=er(t,e,f),c=1-er(t,u,f)):3===i?(h=1-er(t,r,e),c=1-er(t,u,f)):4===i?(o=er(t,r,u),c=er(t,f,u)):5===i?(o=er(t,r,u),c=er(t,f,u),s=1-er(t,f,e),h=1-er(t,r,e)):6===i?(s=er(t,e,f),o=er(t,r,u)):7===i?(h=1-er(t,r,e),o=er(t,r,u)):8===i?(h=er(t,e,r),o=1-er(t,u,r)):9===i?(s=1-er(t,f,e),o=1-er(t,u,r)):10===i?(o=1-er(t,u,r),c=1-er(t,u,f),s=er(t,e,f),h=er(t,e,r)):11===i?(o=1-er(t,u,r),c=1-er(t,u,f)):12===i?(h=er(t,e,r),c=er(t,f,u)):13===i?(s=1-er(t,f,e),c=er(t,f,u)):14===i?(h=er(t,e,r),s=er(t,e,f)):console.log("MarchingSquaresJS-isoContours: Illegal cval detected: "+i),y.cells[l][a]={cval:i,flipped:v,top:o,right:c,bottom:s,left:h}))}return y}(n,t)),"function"==typeof cg.successCallback&&cg.successCallback(o),o}function er(n,t,i){return(n-t)/(i-t)}function iet(n){return 0===n.cval||15===n.cval}function ret(n){iet(n)||5===n.cval||10===n.cval||(n.cval=15)}function ott(n,t){return"top"===t?[n.top,1]:"bottom"===t?[n.bottom,0]:"right"===t?[1,n.right]:"left"===t?[0,n.left]:void 0}function byt(n,t){var u;if(t=t||{},!v(t))throw new Error("options is invalid");var e=t.zProperty||"elevation",c=t.flip,l=t.flags;ah(n,"Point","input must contain Points");for(var o=function(n,t){var i={};return nr(n,function(n){var t=p(n)[1];i[t]||(i[t]=[]);i[t].push(n)}),Object.keys(i).map(function(n){var t=i[n];return t.sort(function(n,t){return p(n)[0]-p(t)[0]})}).sort(function(n,i){return t?p(n[0])[1]-p(i[0])[1]:p(i[0])[1]-p(n[0])[1]})}(n,c),s=[],i=0;i<o.length;i++){for(var h=o[i],f=[],r=0;r<h.length;r++)u=h[r],u.properties[e]?f.push(u.properties[e]):f.push(0),!0===l&&(u.properties.matrixPosition=[i,r]);s.push(f)}return s}function uet(n,t,i,r,u){for(i=i||0,r=r||n.length-1,u=u||function(n,t){return n<t?-1:n>t?1:0};r>i;){if(r-i>600){var e=r-i+1,c=t-i+1,l=Math.log(e),s=.5*Math.exp(2*l/3),a=.5*Math.sqrt(l*s*(e-s)/e)*(c-e/2<0?-1:1);uet(n,t,Math.max(i,Math.floor(t-c*s/e+a)),Math.min(r,Math.floor(t+(e-c)*s/e+a)),u)}var h=n[t],o=i,f=r;for(pw(n,i,t),u(n[r],h)>0&&pw(n,i,r);o<f;){for(pw(n,o,f),o++,f--;u(n[o],h)<0;)o++;for(;u(n[f],h)>0;)f--}0===u(n[i],h)?pw(n,i,f):pw(n,++f,r);f<=t&&(i=f+1);t<=f&&(r=f-1)}}function pw(n,t,i){var r=n[t];n[t]=n[i];n[i]=r}function dk(n,t){if(!(this instanceof dk))return new dk(n,t);this._maxEntries=Math.max(4,n||9);this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries));t&&this._initFormat(t);this.clear()}function py(n,t){ww(n,0,n.children.length,t,n)}function ww(n,t,i,r,u){u||(u=wy(null));u.minX=1/0;u.minY=1/0;u.maxX=-1/0;u.maxY=-1/0;for(var f,e=t;e<i;e++)f=n.children[e],bw(u,n.leaf?r(f):f);return u}function bw(n,t){return n.minX=Math.min(n.minX,t.minX),n.minY=Math.min(n.minY,t.minY),n.maxX=Math.max(n.maxX,t.maxX),n.maxY=Math.max(n.maxY,t.maxY),n}function fet(n,t){return n.minX-t.minX}function eet(n,t){return n.minY-t.minY}function stt(n){return(n.maxX-n.minX)*(n.maxY-n.minY)}function gk(n){return n.maxX-n.minX+(n.maxY-n.minY)}function htt(n,t){return n.minX<=t.minX&&n.minY<=t.minY&&t.maxX<=n.maxX&&t.maxY<=n.maxY}function nd(n,t){return t.minX<=n.maxX&&t.minY<=n.maxY&&t.maxX>=n.minX&&t.maxY>=n.minY}function wy(n){return{children:n,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function oet(n,t,i,r,u){for(var f,e=[t,i];e.length;)(i=e.pop())-(t=e.pop())<=r||(f=t+Math.ceil((i-t)/r/2)*r,vwt(n,f,t,i,u),e.push(t,f,f,i))}function sl(n,t){return t={exports:{}},n(t,t.exports),t.exports}function kw(n,t){if(!(this instanceof kw))return new kw(n,t);if(this.data=n||[],this.length=this.data.length,this.compare=t||function(n,t){return n<t?-1:n>t?1:0},this.length>0)for(var i=(this.length>>1)-1;i>=0;i--)this._down(i)}function set(n,t,i){var u,o,p,w,v,h;t=Math.max(0,void 0===t?2:t);i=i||0;for(var s,y=function(n){for(var i,s,r,h,c,u=n[0],f=n[0],e=n[0],o=n[0],t=0;t<n.length;t++)i=n[t],i[0]<u[0]&&(u=i),i[0]>e[0]&&(e=i),i[1]<f[1]&&(f=i),i[1]>o[1]&&(o=i);for(s=[u,f,e,o],r=s.slice(),t=0;t<n.length;t++)gwt(n[t],s)||r.push(n[t]);for(h=kwt(r),c=[],t=0;t<h.length;t++)c.push(r[h[t]]);return c}(n),c=ep(16,["[0]","[1]","[0]","[1]"]).load(n),f=[],e=0;e<y.length;e++)u=y[e],c.remove(u),s=aet(u,s),f.push(s);for(o=ep(16),e=0;e<f.length;e++)o.insert(ctt(f[e]));for(p=t*t,w=i*i;f.length;){var r=f.shift(),l=r.p,a=r.next.p,b=ltt(l,a);b<w||(v=b/p,(u=function(n,t,i,r,u,f,e){for(var s=new hat(null,kyt),o=n.data,c,l,a;o;){for(c=0;c<o.children.length;c++)l=o.children[c],a=o.leaf?att(l,i,r):function(n,t,i){var r,u,f,e;return het(n,i)||het(t,i)?0:(r=td(n[0],n[1],t[0],t[1],i.minX,i.minY,i.maxX,i.minY),0===r)?0:(u=td(n[0],n[1],t[0],t[1],i.minX,i.minY,i.minX,i.maxY),0===u)?0:(f=td(n[0],n[1],t[0],t[1],i.maxX,i.minY,i.maxX,i.maxY),0===f)?0:(e=td(n[0],n[1],t[0],t[1],i.minX,i.maxY,i.maxX,i.maxY),0===e?0:Math.min(r,u,f,e))}(i,r,l),a>f||s.push({node:l,dist:a});for(;s.length&&!s.peek().node.children;){var v=s.pop(),h=v.node,y=att(h,t,i),p=att(h,r,u);if(v.dist<y&&v.dist<p&&cet(i,h,e)&&cet(r,h,e))return h}(o=s.pop())&&(o=o.node)}return null}(c,r.prev.p,l,a,r.next.next.p,v,o))&&Math.min(ltt(u,l),ltt(u,a))<=v&&(f.push(r),f.push(aet(u,r)),c.remove(u),o.remove(r),o.insert(ctt(r)),o.insert(ctt(r.next))))}r=s;h=[];do h.push(r.p),r=r.next;while(r!==s);return h.push(r.p),h}function kyt(n,t){return n.dist-t.dist}function het(n,t){return n[0]>=t.minX&&n[0]<=t.maxX&&n[1]>=t.minY&&n[1]<=t.maxY}function cet(n,t,i){for(var f=Math.min(n[0],t[0]),e=Math.min(n[1],t[1]),o=Math.max(n[0],t[0]),s=Math.max(n[1],t[1]),u=i.search({minX:f,minY:e,maxX:o,maxY:s}),r=0;r<u.length;r++)if(function(n,t,i,r){return n!==r&&t!==i&&ag(n,t,i)>0!=ag(n,t,r)>0&&ag(i,r,n)>0!=ag(i,r,t)>0}(u[r].p,u[r].next.p,n,t))return!1;return!0}function ctt(n){var t=n.p,i=n.next.p;return n.minX=Math.min(t[0],i[0]),n.minY=Math.min(t[1],i[1]),n.maxX=Math.max(t[0],i[0]),n.maxY=Math.max(t[1],i[1]),n}function aet(n,t){var i={p:n,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return t?(i.next=t.next,i.prev=t,t.next.prev=i,t.next=i):(i.prev=i,i.next=i),i}function ltt(n,t){var i=n[0]-t[0],r=n[1]-t[1];return i*i+r*r}function att(n,t,i){var f=t[0],e=t[1],r=i[0]-f,u=i[1]-e,o;return(0!==r||0!==u)&&(o=((n[0]-f)*r+(n[1]-e)*u)/(r*r+u*u),o>1?(f=i[0],e=i[1]):o>0&&(f+=r*o,e+=u*o)),r=n[0]-f,u=n[1]-e,r*r+u*u}function td(n,t,i,r,u,f,e,o){var p,s,k,h,d=i-n,g=r-t,nt=e-u,tt=o-f,ft=n-u,et=t-f,v=d*d+g*g,c=d*nt+g*tt,w=nt*nt+tt*tt,l=d*ft+g*et,b=nt*ft+tt*et,it=v*w-c*c,a=it,y=it,rt,ut;return 0===it?(s=0,a=1,h=b,y=w):(h=v*b-c*l,(s=c*b-w*l)<0?(s=0,h=b,y=w):s>a&&(s=a,h=b+c,y=w)),h<0?(h=0,-l<0?s=0:-l>v?s=a:(s=-l,a=v)):h>y&&(h=y,-l+c<0?s=0:-l+c>v?s=a:(s=-l+c,a=v)),p=0===s?0:s/a,rt=(1-(k=0===h?0:h/y))*u+k*e-((1-p)*n+p*i),ut=(1-k)*f+k*o-((1-p)*t+p*r),rt*rt+ut*ut}function vet(n,t){var u,i,r;if(t=t||{},!v(t))throw new Error("options is invalid");return(u=t.concavity||1/0,i=[],pu(n,function(n){i.push([n[0],n[1]])}),!i.length)?null:(r=cat(i,u),r.length>3?st([r]):null)}function pr(n,t,i){var s,u,f,e,o;if("object"!=typeof(i=i||{}))throw new Error("options is invalid");if(s=i.ignoreBoundary,!n)throw new Error("point is required");if(!t)throw new Error("polygon is required");var h=cr(n),r=p(t),l=t.geometry?t.geometry.type:t.type,c=t.bbox;if(c&&!1===function(n,t){return t[0]<=n[0]&&t[1]<=n[1]&&t[2]>=n[0]&&t[3]>=n[1]}(h,c))return!1;for("Polygon"===l&&(r=[r]),u=0,f=!1;u<r.length&&!f;u++)if(yet(h,r[u][0],s)){for(e=!1,o=1;o<r[u].length&&!e;)yet(h,r[u][o],!s)&&(e=!0),o++;e||(f=!0)}return f}function yet(n,t,i){var h=!1,r,e;for(t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]&&(t=t.slice(0,t.length-1)),r=0,e=t.length-1;r<t.length;e=r++){var u=t[r][0],f=t[r][1],o=t[e][0],s=t[e][1];if(n[1]*(u-o)+f*(o-n[0])+s*(n[0]-u)==0&&(u-n[0])*(o-n[0])<=0&&(f-n[1])*(s-n[1])<=0)return!i;f>n[1]!=s>n[1]&&n[0]<(o-u)*(n[1]-f)/(s-f)+u&&(h=!h)}return h}function vtt(n,t){var i=[];return nh(t,function(t){nr(n,function(n){pr(n,t)&&i.push(n)})}),d(i)}function pet(n,t){if("FeatureCollection"!==n.type)throw new Error("points must be a FeatureCollection");var i=!1;return d(function(n){if(n.length<3)return[];n.sort(dyt);for(var l,e,a,w,b,k,i=n.length-1,d=n[i].x,g=n[0].x,s=n[i].y,v=s;i--;)n[i].y<s&&(s=n[i].y),n[i].y>v&&(v=n[i].y);var t,f=g-d,h=v-s,c=f>h?f:h,y=.5*(g+d),p=.5*(v+s),r=[new wet({x:y-20*c,y:p-c,__sentinel:!0},{x:y,y:p+20*c,__sentinel:!0},{x:y+20*c,y:p-c,__sentinel:!0})],u=[],o=[];for(i=n.length;i--;){for(o.length=0,t=r.length;t--;)(f=n[i].x-r[t].x)>0&&f*f>r[t].r?(u.push(r[t]),r.splice(t,1)):(h=n[i].y-r[t].y,f*f+h*h>r[t].r||(o.push(r[t].a,r[t].b,r[t].b,r[t].c,r[t].c,r[t].a),r.splice(t,1)));for(gyt(o),t=o.length;t;)e=o[--t],l=o[--t],a=n[i],w=e.x-l.x,b=e.y-l.y,k=2*(w*(a.y-e.y)-b*(a.x-e.x)),Math.abs(k)>1e-12&&r.push(new wet(l,e,a))}for(Array.prototype.push.apply(u,r),i=u.length;i--;)(u[i].a.__sentinel||u[i].b.__sentinel||u[i].c.__sentinel)&&u.splice(i,1);return u}(n.features.map(function(n){var r={x:n.geometry.coordinates[0],y:n.geometry.coordinates[1]};return t?r.z=n.properties[t]:3===n.geometry.coordinates.length&&(i=!0,r.z=n.geometry.coordinates[2]),r})).map(function(n){var t=[n.a.x,n.a.y],r=[n.b.x,n.b.y],u=[n.c.x,n.c.y],f={};return i?(t.push(n.a.z),r.push(n.b.z),u.push(n.c.z)):f={a:n.a.z,b:n.b.z,c:n.c.z},st([[t,r,u,t]],f)}))}function wet(n,t,i){this.a=n;this.b=t;this.c=i;var r,u,f=t.x-n.x,e=t.y-n.y,o=i.x-n.x,s=i.y-n.y,h=f*(n.x+t.x)+e*(n.y+t.y),c=o*(n.x+i.x)+s*(n.y+i.y),l=2*(f*(i.y-t.y)-e*(i.x-t.x));this.x=(s*h-e*c)/l;this.y=(f*c-o*h)/l;r=this.x-n.x;u=this.y-n.y;this.r=r*r+u*u}function dyt(n,t){return t.x-n.x}function gyt(n){var r,u,i,f,e,t=n.length;n:for(;t;)for(u=n[--t],r=n[--t],i=t;i;)if(e=n[--i],f=n[--i],r===f&&u===e||r===e&&u===f){n.splice(t,2);n.splice(i,2);t-=2;continue n}}function tr(n,t,i){if(i=i||{},!v(i))throw new Error("options is invalid");var e=i.units,r=cr(n),u=cr(t),o=yu(u[1]-r[1]),s=yu(u[0]-r[0]),h=yu(r[1]),c=yu(u[1]),f=Math.pow(Math.sin(o/2),2)+Math.pow(Math.sin(s/2),2)*Math.cos(h)*Math.cos(c);return vy(2*Math.atan2(Math.sqrt(f),Math.sqrt(1-f)),e)}function kf(n){if(!n)throw new Error("geojson is required");switch(n.type){case"Feature":return bet(n);case"FeatureCollection":return function(n){var t={type:"FeatureCollection"};return Object.keys(n).forEach(function(i){switch(i){case"type":case"features":return;default:t[i]=n[i]}}),t.features=n.features.map(function(n){return bet(n)}),t}(n);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return ytt(n);default:throw new Error("unknown GeoJSON type");}}function bet(n){var t={type:"Feature"};return Object.keys(n).forEach(function(i){switch(i){case"type":case"properties":case"geometry":return;default:t[i]=n[i]}}),t.properties=ket(n.properties),t.geometry=ytt(n.geometry),t}function ket(n){var t={};return n?(Object.keys(n).forEach(function(i){var r=n[i];t[i]="object"==typeof r?null===r?null:r.length?r.map(function(n){return n}):ket(r):r}),t):t}function ytt(n){var t={type:n.type};return n.bbox&&(t.bbox=n.bbox),"GeometryCollection"===n.type?(t.geometries=n.geometries.map(function(n){return ytt(n)}),t):(t.coordinates=det(n.coordinates),t)}function det(n){return"object"!=typeof n[0]?n.slice():n.map(function(n){return det(n)})}function get(n,t){function o(n,t){t.length&&t.pop();for(var r=h[n<0?~n:n],i=0,u=r.length;i<u;++i)t.push(e(r[i],i));n<0&&rbt(t,u)}function r(n){return e(n)}function i(n){for(var t=[],i=0,r=n.length;i<r;++i)o(n[i],t);return t.length<2&&t.push(t[0]),t}function s(n){for(var t=i(n);t.length<4;)t.push(t[0]);return t}function u(n){return n.map(s)}function f(n){var t,e=n.type;switch(e){case"GeometryCollection":return{type:e,geometries:n.geometries.map(f)};case"Point":t=r(n.coordinates);break;case"MultiPoint":t=n.coordinates.map(r);break;case"LineString":t=i(n.arcs);break;case"MultiLineString":t=n.arcs.map(i);break;case"Polygon":t=u(n.arcs);break;case"MultiPolygon":t=n.arcs.map(u);break;default:return null}return{type:e,coordinates:t}}var e=ibt(n.transform),h=n.arcs;return f(t)}function npt(n,t){function u(n){switch(n.type){case"GeometryCollection":n.geometries.forEach(u);break;case"Polygon":f(n.arcs);break;case"MultiPolygon":n.arcs.forEach(f)}}function f(n){n.forEach(function(t){t.forEach(function(t){(i[t=t<0?~t:t]||(i[t]=[])).push(n)})});r.push(n)}function e(t){return function(n){for(var i,r=-1,u=n.length,t=n[u-1],f=0;++r<u;)i=t,t=n[r],f+=i[0]*t[1]-i[1]*t[0];return Math.abs(f)}(get(n,{type:"Polygon",arcs:[t]}).coordinates[0])}var i={},r=[],o=[];return t.forEach(u),r.forEach(function(n){if(!n._){var t=[],r=[n];for(n._=1,o.push(t);n=r.pop();)t.push(n),n.forEach(function(n){n.forEach(function(n){i[n<0?~n:n].forEach(function(n){n._||(n._=1,r.push(n))})})})}}),r.forEach(function(n){delete n._}),{type:"MultiPolygon",arcs:o.map(function(t){var o,r=[],s,h,u,f;if(t.forEach(function(n){n.forEach(function(n){n.forEach(function(n){i[n<0?~n:n].length<2&&r.push(n)})})}),r=ubt(n,r),(o=r.length)>1)for(u=1,f=e(r[0]);u<o;++u)(s=e(r[u]))>f&&(h=r[0],r[0]=r[u],r[u]=h,f=s);return r})}}function ptt(n,t,i){for(var r,u=t+(i---t>>1);t<u;++t,--i)r=n[t],n[t]=n[i],n[i]=r}function tpt(n){return null==n?{type:null}:("FeatureCollection"===n.type?function(n){var t={type:"GeometryCollection",geometries:n.features.map(not)};return null!=n.bbox&&(t.bbox=n.bbox),t}:"Feature"===n.type?not:wtt)(n)}function not(n){var i,t=wtt(n.geometry);null!=n.id&&(t.id=n.id);null!=n.bbox&&(t.bbox=n.bbox);for(i in n.properties){t.properties=n.properties;break}return t}function wtt(n){if(null==n)return{type:null};var t="GeometryCollection"===n.type?{type:"GeometryCollection",geometries:n.geometries.map(wtt)}:"Point"===n.type||"MultiPoint"===n.type?{type:n.type,coordinates:n.coordinates}:{type:n.type,arcs:n.coordinates};return null!=n.bbox&&(t.bbox=n.bbox),t}function ipt(n){var r,t=n[0],i=n[1];return i<t&&(r=t,t=i,i=r),t+31*i}function rpt(n,t){var i,r=n[0],u=n[1],f=t[0],e=t[1];return u<r&&(i=r,r=u,u=i),e<f&&(i=f,f=e,e=i),r===f&&u===e}function upt(n,t){var r,i,u;if(t=t||{},!v(t))throw new Error("options is invalid");if(r=t.mutate,"FeatureCollection"!==fr(n))throw new Error("geojson must be a FeatureCollection");if(!n.features.length)throw new Error("geojson is empty");return!1!==r&&void 0!==r||(n=kf(n)),i=[],u=ett(n,function(n,t){var r=function(n,t){var u,i=n.geometry.coordinates,r=t.geometry.coordinates,f=id(i[0]),e=id(i[i.length-1]),o=id(r[0]),s=id(r[r.length-1]);if(f===s)u=r.concat(i.slice(1));else if(o===e)u=i.concat(r.slice(1));else if(f===o)u=i.slice(1).reverse().concat(r);else{if(e!==s)return null;u=i.concat(r.reverse().slice(1))}return ur(u)}(n,t);return r||(i.push(n),t)}),u&&i.push(u),i.length?1===i.length?i[0]:fa(i.map(function(n){return n.coordinates})):null}function id(n){return n[0].toString()+","+n[1].toString()}function fpt(n,t){var r,i;if(t=t||{},!v(t))throw new Error("options is invalid");if(r=t.mutate,"FeatureCollection"!==fr(n))throw new Error("geojson must be a FeatureCollection");if(!n.features.length)throw new Error("geojson is empty");if(!1!==r&&void 0!==r||(n=kf(n)),i=function(n){var i={},t;return su(n,function(n){i[n.geometry.type]=!0}),t=Object.keys(i),1===t.length?t[0]:null}(n),!i)throw new Error("geojson must be homogenous");switch(i){case"LineString":return upt(n,t);case"Polygon":return function(n,t){var i,r,u;if(t=t||{},!v(t))throw new Error("options is invalid");if(i=t.mutate,"FeatureCollection"!==fr(n))throw new Error("geojson must be a FeatureCollection");if(!n.features.length)throw new Error("geojson is empty");return!1!==i&&void 0!==i||(n=kf(n)),r=[],su(n,function(n){r.push(n.geometry)}),u=hbt({geoms:ntt(r).geometry}),fbt(u,u.objects.geoms.geometries)}(n,t);default:throw new Error(i+" is not supported");}}function hl(n,t){var f="object"==typeof t?t.mutate:t,r,i,u;if(!n)throw new Error("geojson is required");r=fr(n);i=[];switch(r){case"LineString":i=btt(n);break;case"MultiLineString":case"Polygon":p(n).forEach(function(n){i.push(btt(n))});break;case"MultiPolygon":p(n).forEach(function(n){var t=[];n.forEach(function(n){t.push(btt(n))});i.push(t)});break;case"Point":return n;case"MultiPoint":u={};p(n).forEach(function(n){var t=n.join("-");u.hasOwnProperty(t)||(i.push(n),u[t]=!0)});break;default:throw new Error(r+" geometry not supported");}return n.coordinates?!0===f?(n.coordinates=i,n):{type:r,coordinates:i}:!0===f?(n.geometry.coordinates=i,n):fu({type:r,coordinates:i},n.properties,n.bbox,n.id)}function btt(n){var t=p(n),f,u,e,r,o,i;if(2===t.length&&!function(n,t){return n[0]===t[0]&&n[1]===t[1]}(t[0],t[1]))return t;for(r=[],o=t.length-1,r.push(t[0]),i=1;i<o;i++)f=t[i-1],u=t[i],function(n,t,i){var r=i[0],u=i[1],f=n[0],e=n[1],o=t[0],s=t[1],h=o-f,c=s-e;return(r-f)*c-(u-e)*h==0&&(Math.abs(h)>=Math.abs(c)?h>0?f<=r&&r<=o:o<=r&&r<=f:c>0?e<=u&&u<=s:s<=u&&u<=e)}(f,e=t[i+1],u)||r.push(u);return r.push(e),r}function ept(n,t){var i=n.x-t.x,r=n.y-t.y;return i*i+r*r}function opt(n,t,i){var f=t.x,e=t.y,r=i.x-f,u=i.y-e,o;return(0!==r||0!==u)&&(o=((n.x-f)*r+(n.y-e)*u)/(r*r+u*u),o>1?(f=i.x,e=i.y):o>0&&(f+=r*o,e+=u*o)),r=n.x-f,u=n.y-e,r*r+u*u}function ktt(n,t,i,r,u){for(var f,s,o=r,e=t+1;e<i;e++)s=opt(n[e],n[t],n[i]),s>o&&(f=e,o=s);o>r&&(f-t>1&&ktt(n,t,f,r,u),u.push(n[f]),i-f>1&&ktt(n,f,i,r,u))}function dtt(n,t,i){if(n.length<=2)return n;var r=void 0!==t?t*t:1;return n=i?n:function(n,t){for(var i,r=n[0],u=[r],f=1,e=n.length;f<e;f++)ept(i=n[f],r)>t&&(u.push(i),r=i);return r!==i&&u.push(i),u}(n,r),n=function(n,t){var r=n.length-1,i=[n[0]];return ktt(n,0,r,t,i),i.push(n[r]),i}(n,r)}function tot(n,t,i){return dtt(n.map(function(n){return{x:n[0],y:n[1],z:n[2]}}),t,i).map(function(n){return n.z?[n.x,n.y,n.z]:[n.x,n.y]})}function iot(n,t,i){return n.map(function(n){var u=n.map(function(n){return{x:n[0],y:n[1]}}),r;if(u.length<4)throw new Error("invalid polygon");for(r=dtt(u,t,i).map(function(n){return[n.x,n.y]});!function(n){return!(n.length<3||3===n.length&&n[2][0]===n[0][0]&&n[2][1]===n[0][1])}(r);)r=dtt(u,t-=.01*t,i).map(function(n){return[n.x,n.y]});return r[r.length-1][0]===r[0][0]&&r[r.length-1][1]===r[0][1]||r.push(r[0]),r})}function rot(n,t){var r,u,f;if(t=t||{},!v(t))throw new Error("options is invalid");if(r=t.resolution||1e4,u=t.sharpness||.85,!n)throw new Error("line is required");if(!gi(r))throw new Error("resolution must be an number");if(!gi(u))throw new Error("sharpness must be an number");for(var e=[],o=new yg({points:no(n).coordinates.map(function(n){return{x:n[0],y:n[1]}}),duration:r,sharpness:u}),i=0;i<o.duration;i+=10)f=o.pos(i),Math.floor(i/100)%2==0&&e.push([f.x,f.y]);return ur(e,n.properties)}function gtt(n){var t;yy(n);var i=Number(n[0]),r=Number(n[1]),u=Number(n[2]),f=Number(n[3]);if(6===n.length)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");return t=[i,r],st([[t,[u,r],[u,f],[i,f],t]])}function uot(n){return gtt(hu(n))}function fot(n){var t=n[0],i=n[1],r=n[2],u=n[3],f,e;return tr(n.slice(0,2),[r,i])>=tr(n.slice(0,2),[t,u])?(f=(i+u)/2,[t,f-(r-t)/2,r,f+(r-t)/2]):(e=(t+r)/2,[e-(u-i)/2,i,e+(u-i)/2,u])}function oc(n,t,i,r){if(r=r||{},!v(r))throw new Error("options is invalid");var h=r.units,c=r.properties,e=cr(n),l=yu(e[0]),u=yu(e[1]),o=yu(i),f=ev(t,h),s=Math.asin(Math.sin(u)*Math.cos(f)+Math.cos(u)*Math.sin(f)*Math.cos(o));return wi([oa(l+Math.atan2(Math.sin(o)*Math.sin(f)*Math.cos(u),Math.cos(f)-Math.sin(u)*Math.sin(s))),oa(s)],c)}function nit(n,t,i){var r=(i=i||{}).steps||64,e=i.properties,u,f;if(!n)throw new Error("center is required");if(!t)throw new Error("radius is required");if("object"!=typeof i)throw new Error("options must be an object");if("number"!=typeof r)throw new Error("steps must be a number");for(r=r||64,e=e||n.properties||{},u=[],f=0;f<r;f++)u.push(oc(n,t,-360*f/r,i).geometry.coordinates);return u.push(u[0]),st([u],e)}function sc(n,t,i){if(i=i||{},!v(i))throw new Error("options is invalid");if(!0===i.final)return function(n,t){var i=sc(t,n);return(i+180)%360}(n,t);var u=cr(n),f=cr(t),e=yu(u[0]),o=yu(f[0]),s=yu(u[1]),r=yu(f[1]),h=Math.sin(o-e)*Math.cos(r),c=Math.cos(s)*Math.sin(r)-Math.sin(s)*Math.cos(r)*Math.cos(o-e);return oa(Math.atan2(h,c))}function rd(n,t){var r,i;if(t=t||{},!v(t))throw new Error("options is invalid");if(r=t.properties,!n)throw new Error("geojson is required");return i=hu(n),wi([(i[0]+i[2])/2,(i[1]+i[3])/2],r)}function sv(n,t){var r=0,u=0,i=0;return pu(n,function(n){r+=n[0];u+=n[1];i++},!0),wi([r/i,u/i],t)}function eot(n,t){var r,c,l;switch(fr(n)){case"Point":return n;case"Polygon":r=[];pu(n,function(n){r.push(n)});for(var a,v,f,e,o,y,s,p=sv(n,t),u=p.geometry.coordinates,w=0,b=0,h=0,k=r.map(function(n){return[n[0]-u[0],n[1]-u[1]]}),i=0;i<r.length-1;i++)f=(a=k[i])[0],o=a[1],e=(v=k[i+1])[0],h+=s=f*(y=v[1])-e*o,w+=(f+e)*s,b+=(o+y)*s;return 0===h?p:(c=1/(6*.5*h),wi([u[0]+c*w,u[1]+c*b],t));default:return l=vet(n),l?eot(l,t):sv(n,t)}}function tit(n){var t=[];return"FeatureCollection"===n.type?nr(n,function(n){pu(n,function(i){t.push(wi(i,n.properties))})}):pu(n,function(i){t.push(wi(i,n.properties))}),d(t)}function ud(n,t,i){var r,u,h,c,f,e,l,o;i=i||2;var v=t&&t.length,y=v?t[0]*i:n.length,s=oot(n,0,y,i,!0),a=[];if(!s)return a;if(v&&(s=function(n,t,i,r){for(var s,h,f,e=[],u=0,o=t.length;u<o;u++)s=t[u]*r,h=u<o-1?t[u+1]*r:n.length,(f=oot(n,s,h,r,!1))===f.next&&(f.steiner=!0),e.push(function(n){var t=n,i=n;do t.x<i.x&&(i=t),t=t.next;while(t!==n);return i}(f));for(e.sort(spt),u=0;u<e.length;u++)!function(n,t){if(t=function(n,t){var r,i=t,f=n.x,u=n.y,e=-1/0,o;do{if(u<=i.y&&u>=i.next.y&&i.next.y!==i.y&&(o=i.x+(u-i.y)*(i.next.x-i.x)/(i.next.y-i.y),o<=f&&o>e)){if(e=o,o===f){if(u===i.y)return i;if(u===i.next.y)return i.next}r=i.x<i.next.x?i:i.next}i=i.next}while(i!==t);if(!r)return null;if(f===e)return r.prev;var s,a=r,l=r.x,h=r.y,c=1/0;for(i=r.next;i!==a;)f>=i.x&&i.x>=l&&f!==i.x&&fd(u<h?f:e,u,l,h,u<h?e:f,u,i.x,i.y)&&((s=Math.abs(u-i.y)/(f-i.x))<c||s===c&&i.x>r.x)&&nb(i,n)&&(r=i,c=s),i=i.next;return r}(n,t)){var i=hot(t,n);dw(i,i.next)}}(e[u],i),i=dw(i,i.next);return i}(n,t,s,i)),n.length>80*i){for(r=h=n[0],u=c=n[1],o=i;o<y;o+=i)f=n[o],e=n[o+1],f<r&&(r=f),e<u&&(u=e),f>h&&(h=f),e>c&&(c=e);l=0!==(l=Math.max(h-r,c-u))?1/l:0}return gw(s,a,i,r,u,l),a}function oot(n,t,i,r,u){var f,e;if(u===uit(n,t,i,r)>0)for(f=t;f<i;f+=r)e=cot(f,n[f],n[f+1],e);else for(f=i-r;f>=t;f-=r)e=cot(f,n[f],n[f+1],e);return e&&hv(e,e.next)&&(tb(e),e=e.next),e}function dw(n,t){if(!n)return n;t||(t=n);var r,i=n;do if(r=!1,i.steiner||!hv(i,i.next)&&0!==to(i.prev,i,i.next))i=i.next;else{if(tb(i),(i=t=i.prev)===i.next)break;r=!0}while(r||i!==t);return t}function gw(n,t,i,r,u,f,e){if(n){!e&&f&&function(n,t,i,r){var u=n;do null===u.z&&(u.z=iit(u.x,u.y,t,i,r)),u.prevZ=u.prev,u.nextZ=u.next,u=u.next;while(u!==n);u.prevZ.nextZ=null;u.prevZ=null,function(n){var o,i,t,r,u,s,f,e,h=1;do{for(i=n,n=null,u=null,s=0;i;){for(s++,t=i,f=0,o=0;o<h&&(f++,t=t.nextZ);o++);for(e=h;f>0||e>0&&t;)0!==f&&(0===e||!t||i.z<=t.z)?(r=i,i=i.nextZ,f--):(r=t,t=t.nextZ,e--),u?u.nextZ=r:n=r,r.prevZ=u,u=r;i=t}u.nextZ=null;h*=2}while(s>1)}(u)}(n,r,u,f);for(var s,o,h=n;n.prev!==n.next;)if(s=n.prev,o=n.next,f?function(n,t,i,r){var e=n.prev,o=n,f=n.next;if(to(e,o,f)>=0)return!1;for(var s=e.x<o.x?e.x<f.x?e.x:f.x:o.x<f.x?o.x:f.x,h=e.y<o.y?e.y<f.y?e.y:f.y:o.y<f.y?o.y:f.y,c=e.x>o.x?e.x>f.x?e.x:f.x:o.x>f.x?o.x:f.x,l=e.y>o.y?e.y>f.y?e.y:f.y:o.y>f.y?o.y:f.y,a=iit(s,h,t,i,r),v=iit(c,l,t,i,r),u=n.nextZ;u&&u.z<=v;){if(u!==n.prev&&u!==n.next&&fd(e.x,e.y,o.x,o.y,f.x,f.y,u.x,u.y)&&to(u.prev,u,u.next)>=0)return!1;u=u.nextZ}for(u=n.prevZ;u&&u.z>=a;){if(u!==n.prev&&u!==n.next&&fd(e.x,e.y,o.x,o.y,f.x,f.y,u.x,u.y)&&to(u.prev,u,u.next)>=0)return!1;u=u.prevZ}return!0}(n,r,u,f):function(n){var i=n.prev,r=n,u=n.next,t;if(to(i,r,u)>=0)return!1;for(t=n.next.next;t!==n.prev;){if(fd(i.x,i.y,r.x,r.y,u.x,u.y,t.x,t.y)&&to(t.prev,t,t.next)>=0)return!1;t=t.next}return!0}(n))t.push(s.i/i),t.push(n.i/i),t.push(o.i/i),tb(n),n=o.next,h=o.next;else if((n=o)===h){e?1===e?gw(n=function(n,t,i){var r=n,f,u;do f=r.prev,u=r.next.next,!hv(f,u)&&sot(f,r,r.next,u)&&nb(f,u)&&nb(u,f)&&(t.push(f.i/i),t.push(r.i/i),t.push(u.i/i),tb(r),tb(r.next),r=n=u),r=r.next;while(r!==n);return r}(n,t,i),t,i,r,u,f,2):2===e&&function(n,t,i,r,u,f){var e=n,o,s;do{for(o=e.next.next;o!==e.prev;){if(e.i!==o.i&&function(n,t){return n.next.i!==t.i&&n.prev.i!==t.i&&!function(n,t){var i=n;do{if(i.i!==n.i&&i.next.i!==n.i&&i.i!==t.i&&i.next.i!==t.i&&sot(i,i.next,n,t))return!0;i=i.next}while(i!==n);return!1}(n,t)&&nb(n,t)&&nb(t,n)&&function(n,t){var i=n,r=!1,f=(n.x+t.x)/2,u=(n.y+t.y)/2;do i.y>u!=i.next.y>u&&i.next.y!==i.y&&f<(i.next.x-i.x)*(u-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next;while(i!==n);return r}(n,t)}(e,o))return s=hot(e,o),e=dw(e,e.next),s=dw(s,s.next),gw(e,t,i,r,u,f),void gw(s,t,i,r,u,f);o=o.next}e=e.next}while(e!==n)}(n,t,i,r,u,f):gw(dw(n),t,i,r,u,f,1);break}}}function spt(n,t){return n.x-t.x}function iit(n,t,i,r,u){return n=32767*(n-i)*u,t=32767*(t-r)*u,n=16711935&(n|n<<8),n=252645135&(n|n<<4),n=858993459&(n|n<<2),n=1431655765&(n|n<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),n|t<<1}function fd(n,t,i,r,u,f,e,o){return(u-e)*(t-o)-(n-e)*(f-o)>=0&&(n-e)*(r-o)-(i-e)*(t-o)>=0&&(i-e)*(f-o)-(u-e)*(r-o)>=0}function to(n,t,i){return(t.y-n.y)*(i.x-t.x)-(t.x-n.x)*(i.y-t.y)}function hv(n,t){return n.x===t.x&&n.y===t.y}function sot(n,t,i,r){return!!(hv(n,t)&&hv(i,r)||hv(n,r)&&hv(i,t))||to(n,t,i)>0!=to(n,t,r)>0&&to(i,r,n)>0!=to(i,r,t)>0}function nb(n,t){return to(n.prev,n,n.next)<0?to(n,t,n.next)>=0&&to(n,n.prev,t)>=0:to(n,t,n.prev)<0||to(n,n.next,t)<0}function hot(n,t){var r=new rit(n.i,n.x,n.y),i=new rit(t.i,t.x,t.y),u=n.next,f=t.prev;return n.next=t,t.prev=n,r.next=u,u.prev=r,i.next=r,r.prev=i,f.next=i,i.prev=f,i}function cot(n,t,i,r){var u=new rit(n,t,i);return r?(u.next=r.next,u.prev=r,r.next.prev=u,r.next=u):(u.prev=u,u.next=u),u}function tb(n){n.next.prev=n.prev;n.prev.next=n.next;n.prevZ&&(n.prevZ.nextZ=n.nextZ);n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function rit(n,t,i){this.i=n;this.x=t;this.y=i;this.prev=null;this.next=null;this.z=null;this.prevZ=null;this.nextZ=null;this.steiner=!1}function uit(n,t,i,r){for(var e=0,u=t,f=i-r;u<i;u+=r)e+=(n[f]-n[u])*(n[u+1]+n[f+1]),f=u;return e}function lot(n){var i=function(n){for(var i,r,f=n[0][0].length,u={vertices:[],holes:[],dimensions:f},e=0,t=0;t<n.length;t++){for(i=0;i<n[t].length;i++)for(r=0;r<f;r++)u.vertices.push(n[t][i][r]);t>0&&(e+=n[t-1].length,u.holes.push(e))}return u}(n),f=brt(i.vertices,i.holes,2),e=[],r=[],t,u;for(f.forEach(function(n,t){var u=f[t];r.push([i.vertices[2*u],i.vertices[2*u+1]])}),t=0;t<r.length;t+=3)u=r.slice(t,t+3),u.push(r[t]),e.push(st([u]));return e}function fit(n,t){if(!n)throw new Error("targetPoint is required");if(!t)throw new Error("points is required");var i,r=1/0;return nr(t,function(t,u){var f=tr(n,t);f<r&&((i=kf(t)).properties.featureIndex=u,i.properties.distanceToPoint=f,r=f)}),i}function hpt(n,t,i,r,u){aot(n,t,i||0,r||n.length-1,u||function(n,t){return n<t?-1:n>t?1:0})}function aot(n,t,i,r,u){for(;r>i;){if(r-i>600){var e=r-i+1,c=t-i+1,l=Math.log(e),s=.5*Math.exp(2*l/3),a=.5*Math.sqrt(l*s*(e-s)/e)*(c-e/2<0?-1:1);aot(n,t,Math.max(i,Math.floor(t-c*s/e+a)),Math.min(r,Math.floor(t+(e-c)*s/e+a)),u)}var h=n[t],o=i,f=r;for(ib(n,i,t),u(n[r],h)>0&&ib(n,i,r);o<f;){for(ib(n,o,f),o++,f--;u(n[o],h)<0;)o++;for(;u(n[f],h)>0;)f--}0===u(n[i],h)?ib(n,i,f):ib(n,++f,r);f<=t&&(i=f+1);t<=f&&(r=f-1)}}function ib(n,t,i){var r=n[t];n[t]=n[i];n[i]=r}function us(n,t){if(!(this instanceof us))return new us(n,t);this._maxEntries=Math.max(4,n||9);this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries));t&&this._initFormat(t);this.clear()}function by(n,t){rb(n,0,n.children.length,t,n)}function rb(n,t,i,r,u){u||(u=ky(null));u.minX=1/0;u.minY=1/0;u.maxX=-1/0;u.maxY=-1/0;for(var f,e=t;e<i;e++)f=n.children[e],ub(u,n.leaf?r(f):f);return u}function ub(n,t){return n.minX=Math.min(n.minX,t.minX),n.minY=Math.min(n.minY,t.minY),n.maxX=Math.max(n.maxX,t.maxX),n.maxY=Math.max(n.maxY,t.maxY),n}function vot(n,t){return n.minX-t.minX}function yot(n,t){return n.minY-t.minY}function eit(n){return(n.maxX-n.minX)*(n.maxY-n.minY)}function ed(n){return n.maxX-n.minX+(n.maxY-n.minY)}function oit(n,t){return n.minX<=t.minX&&n.minY<=t.minY&&t.maxX<=n.maxX&&t.maxY<=n.maxY}function od(n,t){return t.minX<=n.maxX&&t.minY<=n.maxY&&t.maxX>=n.minX&&t.maxY>=n.minY}function ky(n){return{children:n,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function pot(n,t,i,r,u){for(var e,f=[t,i];f.length;)(i=f.pop())-(t=f.pop())<=r||(hpt(n,e=t+Math.ceil((i-t)/r/2)*r,t,i,u),f.push(t,e,e,i))}function fb(n){var t=us(n);return t.insert=function(n){if(Array.isArray(n)){var t=n;(n=sit(t)).bbox=t}else n.bbox=n.bbox?n.bbox:hit(n);return us.prototype.insert.call(this,n)},t.load=function(n){var t=[];return Array.isArray(n)?n.forEach(function(n){var i=sit(n);i.bbox=n;t.push(i)}):nr(n,function(n){n.bbox=n.bbox?n.bbox:hit(n);t.push(n)}),us.prototype.load.call(this,t)},t.remove=function(n){if(Array.isArray(n)){var t=n;(n=sit(t)).bbox=t}return us.prototype.remove.call(this,n)},t.clear=function(){return us.prototype.clear.call(this)},t.search=function(n){return{type:"FeatureCollection",features:us.prototype.search.call(this,this.toBBox(n))}},t.collides=function(n){return us.prototype.collides.call(this,this.toBBox(n))},t.all=function(){return{type:"FeatureCollection",features:us.prototype.all.call(this)}},t.toJSON=function(){return us.prototype.toJSON.call(this)},t.fromJSON=function(n){return us.prototype.fromJSON.call(this,n)},t.toBBox=function(n){var t;return t=n.bbox?n.bbox:Array.isArray(n)&&4===n.length?n:hit(n),{minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]}},t}function sit(n){var t=[n[0],n[1]],i=[n[0],n[3]],r=[n[2],n[3]];return{type:"Feature",bbox:n,properties:{},geometry:{type:"Polygon",coordinates:[[t,[n[2],n[1]],r,i,t]]}}}function hit(n){var t=[1/0,1/0,-1/0,-1/0];return pu(n,function(n){t[0]>n[0]&&(t[0]=n[0]);t[1]>n[1]&&(t[1]=n[1]);t[2]<n[0]&&(t[2]=n[0]);t[3]<n[1]&&(t[3]=n[1])}),t}function cv(n){if(!n)throw new Error("geojson is required");var t=[];return su(n,function(n){!function(n,t){var i=[],r=n.geometry;switch(r.type){case"Polygon":i=p(r);break;case"LineString":i=[p(r)]}i.forEach(function(i){var r=function(n,t){var i=[];return n.reduce(function(n,r){var u=ur([n,r],t);return u.bbox=function(n,t){var i=n[0],r=n[1],u=t[0],f=t[1];return[i<u?i:u,r<f?r:f,i>u?i:u,r>f?r:f]}(n,r),i.push(u),r}),i}(i,n.properties);r.forEach(function(n){n.id=t.length;t.push(n)})})}(n,t)}),d(t)}function cl(n,t){var f={},i=[],r,u;return("LineString"===n.type&&(n=fu(n)),"LineString"===t.type&&(t=fu(t)),"Feature"===n.type&&"Feature"===t.type&&"LineString"===n.geometry.type&&"LineString"===t.geometry.type&&2===n.geometry.coordinates.length&&2===t.geometry.coordinates.length)?(r=wot(n,t),r&&i.push(r),d(i)):(u=fb(),u.load(cv(t)),nr(cv(n),function(n){nr(u.search(n),function(t){var r=wot(n,t),u;r&&(u=p(r).join(","),f[u]||(f[u]=!0,i.push(r)))})}),d(i))}function wot(n,t){var u=p(n),f=p(t),e,a;if(2!==u.length)throw new Error("<intersects> line1 must only contain 2 coordinates");if(2!==f.length)throw new Error("<intersects> line2 must only contain 2 coordinates");var i=u[0][0],r=u[0][1],h=u[1][0],c=u[1][1],o=f[0][0],s=f[0][1],v=f[1][0],y=f[1][1],l=(y-s)*(h-i)-(v-o)*(c-r),w=(v-o)*(r-s)-(y-s)*(i-o),b=(h-i)*(r-s)-(c-r)*(i-o);return 0===l?null:(e=w/l,a=b/l,e>=0&&e<=1&&a>=0&&a<=1)?wi([i+e*(h-i),r+e*(c-r)]):null}function ll(n,t,i){var f,r,u;if(i=i||{},!v(i))throw new Error("options is invalid");if(f=n.geometry?n.geometry.type:n.type,"LineString"!==f&&"MultiLineString"!==f)throw new Error("lines must be LineString or MultiLineString");return r=wi([1/0,1/0],{dist:1/0}),u=0,su(n,function(n){for(var f,e,h=p(n),o=0;o<h.length-1;o++){f=wi(h[o]);f.properties.dist=tr(t,f,i);e=wi(h[o+1]);e.properties.dist=tr(t,e,i);var c=tr(f,e,i),l=Math.max(f.properties.dist,e.properties.dist),a=sc(f,e),y=oc(t,l,a+90,i),w=oc(t,l,a-90,i),v=cl(ur([y.geometry.coordinates,w.geometry.coordinates]),ur([f.geometry.coordinates,e.geometry.coordinates])),s=null;v.features.length>0&&((s=v.features[0]).properties.dist=tr(t,s,i),s.properties.location=u+tr(f,s,i));f.properties.dist<r.properties.dist&&((r=f).properties.index=o,r.properties.location=u);e.properties.dist<r.properties.dist&&((r=e).properties.index=o+1,r.properties.location=u+c);s&&s.properties.dist<r.properties.dist&&((r=s).properties.index=o);u+=c}}),r}function sa(n,t,i){var u,r;if(i=i||{},!v(i))throw new Error("options is invalid");if(u=i.final,!n)throw new Error("start point is required");if(!t)throw new Error("end point is required");return(r=u?bot(cr(t),cr(n)):bot(cr(n),cr(t)))>180?-(360-r):r}function bot(n,t){var u=yu(n[1]),f=yu(t[1]),i=yu(t[0]-n[0]),r;return i>Math.PI&&(i-=2*Math.PI),i<-Math.PI&&(i+=2*Math.PI),r=Math.log(Math.tan(f/2+Math.PI/4)/Math.tan(u/2+Math.PI/4)),(oa(Math.atan2(i,r))+360)%360}function sd(n,t,i){var f,u,r;if(i=i||{},!v(i))throw new Error("options is invalid");if(f=i.units,!n)throw new Error("from point is required");if(!t)throw new Error("to point is required");return u=cr(n),r=cr(t),r[0]+=r[0]-u[0]>180?-360:u[0]-r[0]>180?360:0,ov(function(n,t,i){var h=i=void 0===i?tf:Number(i),u=n[1]*Math.PI/180,s=t[1]*Math.PI/180,f=s-u,r=Math.abs(t[0]-n[0])*Math.PI/180,e,o;return r>Math.PI&&(r-=2*Math.PI),e=Math.log(Math.tan(s/2+Math.PI/4)/Math.tan(u/2+Math.PI/4)),o=Math.abs(e)>1e-11?f/e:Math.cos(u),Math.sqrt(f*f+o*o*r*r)*h}(u,r),"meters",f)}function ha(n,t){return kot(n,"mercator",t)}function hd(n,t){return kot(n,"wgs84",t)}function kot(n,t,i){if(i=i||{},!v(i))throw new Error("options is invalid");var r=i.mutate;if(!n)throw new Error("geojson is required");return Array.isArray(n)&&gi(n[0])?n="mercator"===t?dot(n):got(n):(!0!==r&&(n=kf(n)),pu(n,function(n){var i="mercator"===t?dot(n):got(n);n[0]=i[0];n[1]=i[1]})),n}function dot(n){var r=Math.PI/180,i=20037508.342789244,t=[6378137*(Math.abs(n[0])<=180?n[0]:n[0]-360*function(n){return n<0?-1:n>0?1:0}(n[0]))*r,6378137*Math.log(Math.tan(.25*Math.PI+.5*n[1]*r))];return t[0]>i&&(t[0]=i),t[0]<-i&&(t[0]=-i),t[1]>i&&(t[1]=i),t[1]<-i&&(t[1]=-i),t}function got(n){var t=180/Math.PI;return[n[0]*t/6378137,(.5*Math.PI-2*Math.atan(Math.exp(-n[1]/6378137)))*t]}function nst(n,t,i){if(i=i||{},!v(i))throw new Error("options is invalid");if(!n)throw new Error("pt is required");if(Array.isArray(n)?n=wi(n):"Point"===n.type?n=fu(n):yw(n,"Point","point"),!t)throw new Error("line is required");Array.isArray(t)?t=ur(t):"LineString"===t.type?t=fu(t):yw(t,"LineString","line");var r=1/0,u=n.geometry.coordinates;return ol(t,function(n){var f=n.geometry.coordinates[0],e=n.geometry.coordinates[1],t=function(n,t,i,r){var u=r.mercator,e=!0!==u?tr(t,n,r):tst(t,n,r),h=ea(!0!==u?sc(t,n):sa(t,n)),o=ea(!0!==u?sc(t,i):sa(t,i)),s=Math.abs(h-o);if(s>90)return e;var c=(o+180)%360,l=ea(!0!==u?sc(i,n):sa(i,n)),f=Math.abs(l-c);return f>180&&(f=Math.abs(f-360)),f>90?!0!==u?tr(n,i,r):tst(n,i,r):!0!==u?e*Math.sin(yu(s)):function(n,t,i,r){var u=0;(Math.abs(n[0])>=180||Math.abs(t[0])>=180||Math.abs(i[0])>=180)&&(u=n[0]>0||t[0]>0||i[0]>0?-180:180);var e=wi(i),o=ha([n[0]+u,n[1]]),s=ha([t[0]+u,t[1]]),h=ha([i[0]+u,i[1]]),f=hd(function(n,t,i){var f=n[0],e=n[1],s=t[0],h=t[1],c=i[0],l=i[1],r=s-f,u=h-e,o=((c-f)*r+(l-e)*u)/(r*r+u*u);return[f+o*r,e+o*u]}(o,s,h));return 0!==u&&(f[0]-=u),sd(e,f,r)}(t,i,n,r)}(u,f,e,i);r>t&&(r=t)}),r}function tst(n,t,i){var o=i.units,r=0;Math.abs(n[0])>=180&&(r=n[0]>0?-180:180);Math.abs(t[0])>=180&&(r=t[0]>0?-180:180);var u=ha([n[0]+r,n[1]]),f=ha([t[0]+r,t[1]]),e=function(n){return n*n},s=e(u[0]-f[0])+e(u[1]-f[1]);return ov(Math.sqrt(s),"meters",o)}function ist(n){for(var i,t,e,l,h,o,c,s=function(n){return"FeatureCollection"!==n.type?"Feature"!==n.type?d([fu(n)]):d([n]):n}(n),r=rd(s),u=!1,f=0;!u&&f<s.features.length;){if(t=s.features[f].geometry,e=!1,"Point"===t.type)r.geometry.coordinates[0]===t.coordinates[0]&&r.geometry.coordinates[1]===t.coordinates[1]&&(u=!0);else if("MultiPoint"===t.type)for(l=!1,i=0;!l&&i<t.coordinates.length;)r.geometry.coordinates[0]===t.coordinates[i][0]&&r.geometry.coordinates[1]===t.coordinates[i][1]&&(u=!0,l=!0),i++;else if("LineString"===t.type)for(i=0;!e&&i<t.coordinates.length-1;)rst(r.geometry.coordinates[0],r.geometry.coordinates[1],t.coordinates[i][0],t.coordinates[i][1],t.coordinates[i+1][0],t.coordinates[i+1][1])&&(e=!0,u=!0),i++;else if("MultiLineString"===t.type)for(h=0;h<t.coordinates.length;){for(e=!1,i=0,o=t.coordinates[h];!e&&i<o.length-1;)rst(r.geometry.coordinates[0],r.geometry.coordinates[1],o[i][0],o[i][1],o[i+1][0],o[i+1][1])&&(e=!0,u=!0),i++;h++}else"Polygon"!==t.type&&"MultiPolygon"!==t.type||pr(r,t)&&(u=!0);f++}if(u)return r;for(c=d([]),f=0;f<s.features.length;f++)c.features=c.features.concat(tit(s.features[f]).features);return wi(fit(r,c).geometry.coordinates)}function rst(n,t,i,r,u,f){return Math.sqrt((u-i)*(u-i)+(f-r)*(f-r))===Math.sqrt((n-i)*(n-i)+(t-r)*(t-r))+Math.sqrt((u-n)*(u-n)+(f-t)*(f-t))}function eb(n){return rtt(n,function(n,t){return n+ust(t)},0)}function ust(n){var t,i=0;switch(n.type){case"Polygon":return fst(n.coordinates);case"MultiPolygon":for(t=0;t<n.coordinates.length;t++)i+=fst(n.coordinates[t]);return i;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0;case"GeometryCollection":for(t=0;t<n.geometries.length;t++)i+=ust(n.geometries[t]);return i}}function fst(n){var i=0,t;if(n&&n.length>0)for(i+=Math.abs(est(n[0])),t=1;t<n.length;t++)i-=Math.abs(est(n[t]));return i}function est(n){var o,s,r,u,f,t,e=0,i=n.length;if(i>2){for(t=0;t<i;t++)t===i-2?(r=i-2,u=i-1,f=0):t===i-1?(r=i-1,u=0,f=1):(r=t,u=t+1,f=t+2),o=n[r],s=n[u],e+=(cit(n[f][0])-cit(o[0]))*Math.sin(cit(s[1]));e=e*yat*yat/2}return e}function cit(n){return n*Math.PI/180}function lit(n,t){if(t=t||{},!v(t))throw new Error("options is invalid");if(!n)throw new Error("geojson is required");return utt(n,function(n,i){var r=i.geometry.coordinates;return n+tr(r[0],r[1],t)},0)}function ost(n,t,i,r){var u,e,s,h,c,o,f;if(r=r||{},!v(r))throw new Error("options is invalid");if(e=[],"Feature"===n.type)u=n.geometry.coordinates;else{if("LineString"!==n.type)throw new Error("input must be a LineString Feature or Geometry");u=n.coordinates}for(o=0,f=0;f<u.length&&!(t>=o&&f===u.length-1);f++){if(o>t&&0===e.length){if(!(s=t-o))return e.push(u[f]),ur(e);h=sc(u[f],u[f-1])-180;c=oc(u[f],s,h,r);e.push(c.geometry.coordinates)}if(o>=i)return(s=i-o)?(h=sc(u[f],u[f-1])-180,c=oc(u[f],s,h,r),e.push(c.geometry.coordinates),ur(e)):(e.push(u[f]),ur(e));if(o>=t&&e.push(u[f]),f===u.length-1)return ur(e);o+=tr(u[f],u[f+1],r)}return ur(u[u.length-1])}function so(n,t,i){var e=(i=i||{}).ignoreEndVertices,f;if(!v(i))throw new Error("invalid options");if(!n)throw new Error("pt is required");if(!t)throw new Error("line is required");for(var o=cr(n),u=p(t),r=0;r<u.length-1;r++)if(f=!1,e&&(0===r&&(f="start"),r===u.length-2&&(f="end"),0===r&&r+1===u.length-1&&(f="both")),function(n,t,i,r){var u=i[0],f=i[1],e=n[0],o=n[1],s=t[0],h=t[1],a=i[0]-e,v=i[1]-o,c=s-e,l=h-o;return a*l-v*c!=0?!1:r?"start"===r?Math.abs(c)>=Math.abs(l)?c>0?e<u&&u<=s:s<=u&&u<e:l>0?o<f&&f<=h:h<=f&&f<o:"end"===r?Math.abs(c)>=Math.abs(l)?c>0?e<=u&&u<s:s<u&&u<=e:l>0?o<=f&&f<h:h<f&&f<=o:"both"===r?Math.abs(c)>=Math.abs(l)?c>0?e<u&&u<s:s<u&&u<e:l>0?o<f&&f<h:h<f&&f<o:void 0:Math.abs(c)>=Math.abs(l)?c>0?e<=u&&u<=s:s<=u&&u<=e:l>0?o<=f&&f<=h:h<=f&&f<=o}(u[r],u[r+1],o,f))return!0;return!1}function sst(n,t){var f=fr(n),u=fr(t),i=no(n),r=no(t);switch(f){case"Point":switch(u){case"MultiPoint":return function(n,t){for(var r=!1,i=0;i<t.coordinates.length;i++)if(cst(t.coordinates[i],n.coordinates)){r=!0;break}return r}(i,r);case"LineString":return so(i,r,{ignoreEndVertices:!0});case"Polygon":return pr(i,r,{ignoreBoundary:!0});default:throw new Error("feature2 "+u+" geometry not supported");}case"MultiPoint":switch(u){case"MultiPoint":return function(n,t){for(var u,r,i=0;i<n.coordinates.length;i++){for(u=!1,r=0;r<t.coordinates.length;r++)cst(n.coordinates[i],t.coordinates[r])&&(u=!0);if(!u)return!1}return!0}(i,r);case"LineString":return function(n,t){for(var r=!1,i=0;i<n.coordinates.length;i++){if(!so(n.coordinates[i],t))return!1;r||(r=so(n.coordinates[i],t,{ignoreEndVertices:!0}))}return r}(i,r);case"Polygon":return function(n,t){for(var i,r=!0,u=0;u<n.coordinates.length;u++){if(i=pr(n.coordinates[1],t),!i){r=!1;break}i=pr(n.coordinates[1],t,{ignoreBoundary:!0})}return r&&i}(i,r);default:throw new Error("feature2 "+u+" geometry not supported");}case"LineString":switch(u){case"LineString":return function(n,t){for(var i=0;i<n.coordinates.length;i++)if(!so(n.coordinates[i],t))return!1;return!0}(i,r);case"Polygon":return function(n,t){var f=hu(t),e=hu(n),r,i,u;if(!hst(f,e))return!1;for(r=!1,i=0;i<n.coordinates.length-1;i++){if(!pr(n.coordinates[i],t))return!1;(r||(r=pr(n.coordinates[i],t,{ignoreBoundary:!0})),r)||(u=function(n,t){return[(n[0]+t[0])/2,(n[1]+t[1])/2]}(n.coordinates[i],n.coordinates[i+1]),r=pr(u,t,{ignoreBoundary:!0}))}return r}(i,r);default:throw new Error("feature2 "+u+" geometry not supported");}case"Polygon":switch(u){case"Polygon":return function(n,t){var r=hu(n),i;if(!hst(hu(t),r))return!1;for(i=0;i<n.coordinates[0].length;i++)if(!pr(n.coordinates[0][i],t))return!1;return!0}(i,r);default:throw new Error("feature2 "+u+" geometry not supported");}default:throw new Error("feature1 "+f+" geometry not supported");}}function hst(n,t){return!(n[0]>t[0])&&!(n[2]<t[2])&&!(n[1]>t[1])&&!(n[3]<t[3])}function cst(n,t){return n[0]===t[0]&&n[1]===t[1]}function lst(n,t,i){var s,h;if(i=i||{},!v(i))throw new Error("options is invalid");var f=i.mask,b=i.properties,c=[];if(null===t||void 0===t)throw new Error("cellSide is required");if(!gi(t))throw new Error("cellSide is invalid");if(!n)throw new Error("bbox is required");if(!Array.isArray(n))throw new Error("bbox must be array");if(4!==n.length)throw new Error("bbox must contain 4 numbers");if(f&&-1===["Polygon","MultiPolygon"].indexOf(fr(f)))throw new Error("options.mask must be a (Multi)Polygon");for(var r=n[0],u=n[1],e=n[2],o=n[3],l=t/tr([r,u],[e,u],i)*(e-r),a=t/tr([r,u],[r,o],i)*(o-u),p=e-r,w=o-u,k=Math.floor(p/l),g=(w-Math.floor(w/a)*a)/2,y=r+(p-k*l)/2;y<=e;){for(s=u+g;s<=o;)h=wi([y,s],b),f?sst(h,f)&&c.push(h):c.push(h),s+=a;y+=l}return d(c)}function dy(n,t){var f;if(t=t||{},!v(t))throw new Error("options is invalid");var i=t.precision,r=t.coordinates,u=t.mutate;if(i=void 0===i||null===i||isNaN(i)?6:i,r=void 0===r||null===r||isNaN(r)?3:r,!n)throw new Error("<geojson> is required");if("number"!=typeof i)throw new Error("<precision> must be a number");if("number"!=typeof r)throw new Error("<coordinates> must be a number");return!1!==u&&void 0!==u||(n=JSON.parse(JSON.stringify(n))),f=Math.pow(10,i),pu(n,function(n){!function(n,t,i){n.length>i&&n.splice(i,n.length);for(var r=0;r<n.length;r++)n[r]=Math.round(n[r]*t)/t}(n,f,r)}),n}function ob(n,t){if(!n||!t||n.length!==t.length)return!1;for(var i=0,r=n.length;i<r;i++)if(n[i]instanceof Array&&t[i]instanceof Array){if(!ob(n[i],t[i]))return!1}else if(n[i]!==t[i])return!1;return!0}function cd(n,t){if(void 0===t&&(t=!0),3!=n.length)throw new Error("This function requires an array of three points [x,y]");return(n[1][0]-n[0][0])*(n[2][1]-n[0][1])-(n[1][1]-n[0][1])*(n[2][0]-n[0][0])>=0==t}function sb(n,t){if(!n||!t||n.length!=t.length)return!1;for(var i=0,r=n.length;i<r;i++)if(n[i]instanceof Array&&t[i]instanceof Array){if(!sb(n[i],t[i]))return!1}else if(n[i]!=t[i])return!1;return!0}function ast(n,t){var i=[],r=fb();return su(t,function(t){var f,u;(i.forEach(function(n,t){n.id=t}),i.length)?(f=r.search(t),f.features.length&&(u=vst(t,f),i=i.filter(function(n){return n.id!==u.id}),r.remove(u),nr(ait(u,t),function(n){i.push(n);r.insert(n)}))):((i=ait(n,t).features).forEach(function(n){n.bbox||(n.bbox=fot(hu(n)))}),r.load(d(i)))}),d(i)}function ait(n,t){var i=[],o=p(n)[0],h=p(n)[n.geometry.coordinates.length-1],r,u,f,s,e;return vit(o,cr(t))||vit(h,cr(t))?d([n]):(r=fb(),u=cv(n),r.load(u),f=r.search(t),!f.features.length)?d([n]):(s=vst(t,f),e=itt(u,function(n,r,u){var e=p(r)[1],f=cr(t);return u===s.id?(n.push(f),i.push(ur(n)),vit(f,e)?[f]:[f,e]):(n.push(e),n)},[o]),e.length>1&&i.push(ur(e)),d(i))}function vst(n,t){if(!t.features.length)throw new Error("lines must contain features");if(1===t.features.length)return t.features[0];var i,r=1/0;return nr(t,function(t){var u=ll(t,n).properties.dist;u<r&&(i=t,r=u)}),i}function vit(n,t){return n[0]===t[0]&&n[1]===t[1]}function yst(n,t,i,r,u){var f,s;if(u=u||{},!v(u))throw new Error("options is invalid");if(f=u.steps,s=u.units,!n)throw new Error("center is required");if(!t)throw new Error("radius is required");if(void 0===i||null===i)throw new Error("bearing1 is required");if(void 0===r||null===r)throw new Error("bearing2 is required");if("object"!=typeof u)throw new Error("options must be an object");f=f||64;var h=pst(i),e=pst(r),a=n.properties;if(h===e)return ur(nit(n,t,u).geometry.coordinates[0],a);for(var y=h,c=h<e?e:e+360,o=y,l=[],p=0;o<c;)l.push(oc(n,t,o,s).geometry.coordinates),o=y+360*++p/f;return o>c&&l.push(oc(n,t,c,s).geometry.coordinates),ur(l,a)}function pst(n){var t=n%360;return t<0&&(t+=360),t}function ld(n,t){var u;if(t=t||{},!v(t))throw new Error("options is invalid");var i=t.properties,f=fr(n),r=p(n);if(i=i||n.properties||{},!r.length)throw new Error("polygon must contain coordinates");switch(f){case"Polygon":return wst(r,i);case"MultiPolygon":return u=[],r.forEach(function(n){u.push(wst(n,i))}),d(u);default:throw new Error("geom "+f+" not supported");}}function wst(n,t){return n.length>1?fa(n,t):ur(n[0],t)}function bst(n,t){var u;if(t=t||{},!v(t))throw new Error("options is invalid");var f=t.properties,i=t.autoComplete,r=t.orderCoords;if(!n)throw new Error("lines is required");i=void 0===i||i;r=void 0===r||r;switch(fr(n)){case"FeatureCollection":case"GeometryCollection":return u=[],(n.features?n.features:n.geometries).forEach(function(n){u.push(p(kst(n,{},i,r)))}),ay(u,f)}return kst(n,f,i,r)}function kst(n,t,i,r){var u,e,f,o;if(t=t||n.properties||{},u=p(n),e=fr(n),!u.length)throw new Error("line must contain coordinates");switch(e){case"LineString":return i&&(u=dst(u)),st([u],t);case"MultiLineString":return f=[],o=0,u.forEach(function(n){if(i&&(n=dst(n)),r){var t=function(n){var t=n[0],i=n[1],r=n[2],u=n[3];return Math.abs(t-r)*Math.abs(i-u)}(hu(ur(n)));t>o?(f.unshift(n),o=t):f.push(n)}else f.push(n)}),st(f,t);default:throw new Error("geometry type "+e+" is not supported");}}function dst(n){var t=n[0],r=t[0],u=t[1],i=n[n.length-1],f=i[0],e=i[1];return r===f&&u===e||n.push(t),n}function ad(n,t,i){var r,s,f,e,h,c=n.length,o=gy(n[0],t),u=[];for(i||(i=[]),r=1;r<c;r++){for(s=n[r-1],e=h=gy(f=n[r],t);;){if(!(o|e)){u.push(s);e!==h?(u.push(f),r<c-1&&(i.push(u),u=[])):r===c-1&&u.push(f);break}if(o&e)break;o?o=gy(s=yit(s,f,o,t),t):e=gy(f=yit(s,f,e,t),t)}o=h}return u.length&&i.push(u),i}function yit(n,t,i,r){return 8&i?[n[0]+(t[0]-n[0])*(r[3]-n[1])/(t[1]-n[1]),r[3]]:4&i?[n[0]+(t[0]-n[0])*(r[1]-n[1])/(t[1]-n[1]),r[1]]:2&i?[r[2],n[1]+(t[1]-n[1])*(r[2]-n[0])/(t[0]-n[0])]:1&i?[r[0],n[1]+(t[1]-n[1])*(r[0]-n[0])/(t[0]-n[0])]:null}function gy(n,t){var i=0;return n[0]<t[0]?i|=1:n[0]>t[2]&&(i|=2),n[1]<t[1]?i|=4:n[1]>t[3]&&(i|=8),i}function gst(n,t){for(var i,u=[],r=0;r<n.length;r++)i=drt.polygon(n[r],t),i.length>0&&(i[0][0]===i[i.length-1][0]&&i[0][1]===i[i.length-1][1]||i.push(i[0]),i.length>=4&&u.push(i));return u}function nht(n){return"[object Arguments]"===Object.prototype.toString.call(n)}function lv(n,t,i){return i||(i={}),n===t||(n instanceof Date&&t instanceof Date?n.getTime()===t.getTime():!n||!t||"object"!=typeof n&&"object"!=typeof t?(i.strict,n===t):function(n,t,i){var r,e,u,f;if(tht(n)||tht(t)||n.prototype!==t.prototype)return!1;if(nht(n))return!!nht(t)&&(n=dat.call(n),t=dat.call(t),lv(n,t,i));if(iht(n)){if(!iht(t)||n.length!==t.length)return!1;for(r=0;r<n.length;r++)if(n[r]!==t[r])return!1;return!0}try{u=Object.keys(n);f=Object.keys(t)}catch(n){return!1}if(u.length!==f.length)return!1;for(u.sort(),f.sort(),r=u.length-1;r>=0;r--)if(u[r]!==f[r])return!1;for(r=u.length-1;r>=0;r--)if(e=u[r],!lv(n[e],t[e],i))return!1;return typeof n==typeof t}(n,t,i))}function tht(n){return null===n||void 0===n}function iht(n){return!(!n||"object"!=typeof n||"number"!=typeof n.length)&&"function"==typeof n.copy&&"function"==typeof n.slice&&!(n.length>0&&"number"!=typeof n[0])}function rht(n,t,i){var r;if(i=i||{},!v(i))throw new Error("options is invalid");var u=i.tolerance||0,f=[],e=fb();return e.load(cv(n)),ol(t,function(n){var t=!1;nr(e.search(n),function(i){if(!1===t){var f=p(n).sort(),e=p(i).sort();lv(f,e)?(t=!0,r=r?pit(r,n):n):(0===u?so(f[0],i)&&so(f[1],i):ll(i,f[0]).properties.dist<=u&&ll(i,f[1]).properties.dist<=u)?(t=!0,r=r?pit(r,n):n):(0===u?so(e[0],n)&&so(e[1],n):ll(n,e[0]).properties.dist<=u&&ll(n,e[1]).properties.dist<=u)&&(r=r?pit(r,i):i)}});!1===t&&r&&(f.push(r),r=void 0)}),r&&f.push(r),d(f)}function pit(n,t){var i=p(t),u=p(n),f=u[0],e=u[u.length-1],r=n.geometry.coordinates;return lv(i[0],f)?r.unshift(i[1]):lv(i[0],e)?r.push(i[1]):lv(i[1],f)?r.unshift(i[0]):lv(i[1],e)&&r.push(i[0]),n}function uht(n){var t=n%360;return t<0&&(t+=360),t}function np(n,t,i,r){var e,o;if(r=r||{},!v(r))throw new Error("options is invalid");if(e=r.units,o=r.properties,!n)throw new Error("origin is required");if(void 0===t||null===t)throw new Error("distance is required");if(void 0===i||null===i)throw new Error("bearing is required");if(!(t>=0))throw new Error("distance must be greater than 0");var s=ov(t,e,"meters"),f=cr(n),u=function(n,t,i,r){r=void 0===r?tf:Number(r);var e=t/r,c=n[0]*Math.PI/180,f=yu(n[1]),o=yu(i),s=e*Math.cos(o),u=f+s;Math.abs(u)>Math.PI/2&&(u=u>0?Math.PI-u:-Math.PI-u);var h=Math.log(Math.tan(u/2+Math.PI/4)/Math.tan(f/2+Math.PI/4)),l=Math.abs(h)>1e-11?s/h:Math.cos(f),a=e*Math.sin(o)/l;return[(180*(c+a)/Math.PI+540)%360-180,180*u/Math.PI]}(f,s,i);return u[0]+=u[0]-f[0]>180?-360:f[0]-u[0]>180?360:0,wi(u,o)}function fht(n,t,i,r,u,f){for(var o,s,e=0;e<n.length;e++)o=n[e],s=n[e+1],e===n.length-1&&(s=n[0]),r=hb(o,s,t),i<=0&&r>0?function(n,t,i){return hb(n,t,i)<0}(t,o,u)||(u=o):i>0&&r<=0&&(function(n,t,i){return hb(n,t,i)>0}(t,o,f)||(f=o)),i=r;return[u,f]}function hb(n,t,i){return(t[0]-n[0])*(i[1]-n[1])-(i[0]-n[0])*(t[1]-n[1])}function vd(n){var f;if(!n)throw new Error("line is required");if(f=n.geometry?n.geometry.type:n.type,!Array.isArray(n)&&"LineString"!==f)throw new Error("geometry must be a LineString");for(var t,i,r=p(n),e=0,u=1;u<r.length;)t=i||r[0],e+=((i=r[u])[0]-t[0])*(i[1]+t[1]),u++;return e>0}function yd(n,t){switch("Feature"===n.type?n.geometry.type:n.type){case"GeometryCollection":return nh(n,function(n){yd(n,t)}),n;case"LineString":return eht(p(n),t),n;case"Polygon":return oht(p(n),t),n;case"MultiLineString":return p(n).forEach(function(n){eht(n,t)}),n;case"MultiPolygon":return p(n).forEach(function(n){oht(n,t)}),n;case"Point":case"MultiPoint":return n}}function eht(n,t){vd(n)===t&&n.reverse()}function oht(n,t){vd(n[0])!==t&&n[0].reverse();for(var i=1;i<n.length;i++)vd(n[i])===t&&n[i].reverse()}function cpt(n,t){var u;if(t=t||{},!v(t))throw new Error("options is invalid");var e=t.zProperty||"elevation",c=t.flip,l=t.flags;ah(n,"Point","input must contain Points");for(var o=function(n,t){var i={};return nr(n,function(n){var t=p(n)[1];i[t]||(i[t]=[]);i[t].push(n)}),Object.keys(i).map(function(n){var t=i[n];return t.sort(function(n,t){return p(n)[0]-p(t)[0]})}).sort(function(n,i){return t?p(n[0])[1]-p(i[0])[1]:p(i[0])[1]-p(n[0])[1]})}(n,c),s=[],i=0;i<o.length;i++){for(var h=o[i],f=[],r=0;r<h.length;r++)u=h[r],u.properties[e]?f.push(u.properties[e]):f.push(0),!0===l&&(u.properties.matrixPosition=[i,r]);s.push(f)}return s}function lpt(n,i,r,u){var a,e,o,f,l,v;for(u=u||{},a=Object.keys(gat),e=0;e<a.length;e++)o=a[e],f=u[o],f=void 0!==f&&null!==f?f:gat[o],vv[o]=f;return vv.verbose&&console.log("MarchingSquaresJS-isoBands: computing isobands for ["+i+":"+(i+r)+"]"),v=function(n,i,r){for(var et,st,ut,ht,v,p,it,b,k,rt,d,tt,a,ct=n.length-1,lt=n[0].length-1,ot={rows:ct,cols:lt,cells:[]},f=i+Math.abs(r),ft=0;ft<ct;++ft)for(ot.cells[ft]=[],et=0;et<lt;++et){var u=0,e=n[ft+1][et],o=n[ft+1][et+1],s=n[ft][et+1],l=n[ft][et];isNaN(e)||isNaN(o)||isNaN(s)||isNaN(l)||(u|=e<i?0:e>f?128:64,u|=o<i?0:o>f?32:16,u|=s<i?0:s>f?8:4,st=+(u|=l<i?0:l>f?2:1),ut=0,(17===u||18===u||33===u||34===u||38===u||68===u||72===u||98===u||102===u||132===u||136===u||137===u||152===u||153===u)&&(ht=(e+o+s+l)/4,ut=ht>f?2:ht<i?0:1,34===u?1===ut?u=35:0===ut&&(u=136):136===u?1===ut?(u=35,ut=4):0===ut&&(u=34):17===u?1===ut?(u=155,ut=4):0===ut&&(u=153):68===u?1===ut?(u=103,ut=4):0===ut&&(u=102):153===u?1===ut&&(u=155):102===u?1===ut&&(u=103):152===u?ut<2&&(u=156,ut=1):137===u?ut<2&&(u=139,ut=1):98===u?ut<2&&(u=99,ut=1):38===u?ut<2&&(u=39,ut=1):18===u?ut>0?(u=156,ut=4):u=152:33===u?ut>0?(u=139,ut=4):u=137:72===u?ut>0?(u=99,ut=4):u=98:132===u&&(ut>0?(u=39,ut=4):u=38)),0!=u&&170!=u&&(v=p=it=b=k=rt=d=tt=.5,a=[],1===u?(it=1-t(i,s,l),tt=1-t(i,e,l),a.push(y[u])):169===u?(it=t(f,l,s),tt=t(f,l,e),a.push(y[u])):4===u?(rt=1-t(i,o,s),b=t(i,l,s),a.push(h[u])):166===u?(rt=t(f,s,o),b=1-t(f,s,l),a.push(h[u])):16===u?(k=t(i,s,o),p=t(i,e,o),a.push(c[u])):154===u?(k=1-t(f,o,s),p=1-t(f,o,e),a.push(c[u])):64===u?(d=t(i,l,e),v=1-t(i,o,e),a.push(g[u])):106===u?(d=1-t(f,e,l),v=t(f,e,o),a.push(g[u])):168===u?(b=t(f,l,s),it=t(i,l,s),tt=t(i,l,e),d=t(f,l,e),a.push(w[u]),a.push(y[u])):2===u?(b=1-t(i,s,l),it=1-t(f,s,l),tt=1-t(f,e,l),d=1-t(i,e,l),a.push(w[u]),a.push(y[u])):162===u?(k=t(f,s,o),rt=t(i,s,o),b=1-t(i,s,l),it=1-t(f,s,l),a.push(w[u]),a.push(y[u])):8===u?(k=1-t(i,o,s),rt=1-t(f,o,s),b=t(f,l,s),it=t(i,l,s),a.push(c[u]),a.push(h[u])):138===u?(k=1-t(i,o,s),rt=1-t(f,o,s),v=1-t(f,o,e),p=1-t(i,o,e),a.push(c[u]),a.push(h[u])):32===u?(k=t(f,s,o),rt=t(i,s,o),v=t(i,e,o),p=t(f,e,o),a.push(c[u]),a.push(h[u])):42===u?(tt=1-t(f,e,l),d=1-t(i,e,l),v=t(i,e,o),p=t(f,e,o),a.push(nt[u]),a.push(g[u])):128===u&&(tt=t(i,l,e),d=t(f,l,e),v=1-t(f,o,e),p=1-t(i,o,e),a.push(nt[u]),a.push(g[u])),5===u?(rt=1-t(i,o,s),tt=1-t(i,e,l),a.push(h[u])):165===u?(rt=t(f,s,o),tt=t(f,l,e),a.push(h[u])):20===u?(b=t(i,l,s),p=t(i,e,o),a.push(w[u])):150===u?(b=1-t(f,s,l),p=1-t(f,o,e),a.push(w[u])):80===u?(k=t(i,s,o),d=t(i,l,e),a.push(c[u])):90===u?(k=1-t(f,o,s),d=1-t(f,e,l),a.push(c[u])):65===u?(it=1-t(i,s,l),v=1-t(i,o,e),a.push(y[u])):105===u?(it=t(f,l,s),v=t(f,e,o),a.push(y[u])):160===u?(k=t(f,s,o),rt=t(i,s,o),tt=t(i,l,e),d=t(f,l,e),a.push(c[u]),a.push(h[u])):10===u?(k=1-t(i,o,s),rt=1-t(f,o,s),tt=1-t(f,e,l),d=1-t(i,e,l),a.push(c[u]),a.push(h[u])):130===u?(b=1-t(i,s,l),it=1-t(f,s,l),v=1-t(f,o,e),p=1-t(i,o,e),a.push(w[u]),a.push(y[u])):40===u?(b=t(f,l,s),it=t(i,l,s),v=t(i,e,o),p=t(f,e,o),a.push(w[u]),a.push(y[u])):101===u?(rt=t(f,s,o),v=t(f,e,o),a.push(h[u])):69===u?(rt=1-t(i,o,s),v=1-t(i,o,e),a.push(h[u])):149===u?(tt=t(f,l,e),p=1-t(f,o,e),a.push(nt[u])):21===u?(tt=1-t(i,e,l),p=t(i,e,o),a.push(nt[u])):86===u?(b=1-t(f,s,l),d=1-t(f,e,l),a.push(w[u])):84===u?(b=t(i,l,s),d=t(i,l,e),a.push(w[u])):89===u?(k=1-t(f,o,s),it=t(f,l,s),a.push(y[u])):81===u?(k=t(i,s,o),it=1-t(i,s,l),a.push(y[u])):96===u?(k=t(f,s,o),rt=t(i,s,o),d=t(i,l,e),v=t(f,e,o),a.push(c[u]),a.push(h[u])):74===u?(k=1-t(i,o,s),rt=1-t(f,o,s),d=1-t(f,e,l),v=1-t(i,o,e),a.push(c[u]),a.push(h[u])):24===u?(k=1-t(f,o,s),b=t(f,l,s),it=t(i,l,s),p=t(i,e,o),a.push(c[u]),a.push(y[u])):146===u?(k=t(i,s,o),b=1-t(i,s,l),it=1-t(f,s,l),p=1-t(f,o,e),a.push(c[u]),a.push(y[u])):6===u?(rt=1-t(i,o,s),b=1-t(f,s,l),tt=1-t(f,e,l),d=1-t(i,e,l),a.push(h[u]),a.push(w[u])):164===u?(rt=t(f,s,o),b=t(i,l,s),tt=t(i,l,e),d=t(f,l,e),a.push(h[u]),a.push(w[u])):129===u?(it=1-t(i,s,l),tt=t(f,l,e),v=1-t(f,o,e),p=1-t(i,o,e),a.push(y[u]),a.push(nt[u])):41===u?(it=t(f,l,s),tt=1-t(i,e,l),v=t(i,e,o),p=t(f,e,o),a.push(y[u]),a.push(nt[u])):66===u?(b=1-t(i,s,l),it=1-t(f,s,l),d=1-t(f,e,l),v=1-t(i,o,e),a.push(w[u]),a.push(y[u])):104===u?(b=t(f,l,s),it=t(i,l,s),d=t(i,l,e),v=t(f,e,o),a.push(y[u]),a.push(ai[u])):144===u?(k=t(i,s,o),tt=t(i,l,e),d=t(f,l,e),p=1-t(f,o,e),a.push(c[u]),a.push(g[u])):26===u?(k=1-t(f,o,s),tt=1-t(f,e,l),d=1-t(i,e,l),p=t(i,e,o),a.push(c[u]),a.push(g[u])):36===u?(rt=t(f,s,o),b=t(i,l,s),v=t(i,e,o),p=t(f,e,o),a.push(h[u]),a.push(w[u])):134===u?(rt=1-t(i,o,s),b=1-t(f,s,l),v=1-t(f,o,e),p=1-t(i,o,e),a.push(h[u]),a.push(w[u])):9===u?(k=1-t(i,o,s),rt=1-t(f,o,s),it=t(f,l,s),tt=1-t(i,e,l),a.push(c[u]),a.push(h[u])):161===u?(k=t(f,s,o),rt=t(i,s,o),it=1-t(i,s,l),tt=t(f,l,e),a.push(c[u]),a.push(h[u])):37===u?(rt=t(f,s,o),tt=1-t(i,e,l),v=t(i,e,o),p=t(f,e,o),a.push(h[u]),a.push(nt[u])):133===u?(rt=1-t(i,o,s),tt=t(f,l,e),v=1-t(f,o,e),p=1-t(i,o,e),a.push(h[u]),a.push(nt[u])):148===u?(b=t(i,l,s),tt=t(i,l,e),d=t(f,l,e),p=1-t(f,o,e),a.push(w[u]),a.push(g[u])):22===u?(b=1-t(f,s,l),tt=1-t(f,e,l),d=1-t(i,e,l),p=t(i,e,o),a.push(w[u]),a.push(g[u])):82===u?(k=t(i,s,o),b=1-t(i,s,l),it=1-t(f,s,l),d=1-t(f,e,l),a.push(c[u]),a.push(y[u])):88===u?(k=1-t(f,o,s),b=t(f,l,s),it=t(i,l,s),d=t(i,l,e),a.push(c[u]),a.push(y[u])):73===u?(k=1-t(i,o,s),rt=1-t(f,o,s),it=t(f,l,s),v=1-t(i,o,e),a.push(c[u]),a.push(h[u])):97===u?(k=t(f,s,o),rt=t(i,s,o),it=1-t(i,s,l),v=t(f,e,o),a.push(c[u]),a.push(h[u])):145===u?(k=t(i,s,o),it=1-t(i,s,l),tt=t(f,l,e),p=1-t(f,o,e),a.push(c[u]),a.push(nt[u])):25===u?(k=1-t(f,o,s),it=t(f,l,s),tt=1-t(i,e,l),p=t(i,e,o),a.push(c[u]),a.push(nt[u])):70===u?(rt=1-t(i,o,s),b=1-t(f,s,l),d=1-t(f,e,l),v=1-t(i,o,e),a.push(h[u]),a.push(w[u])):100===u?(rt=t(f,s,o),b=t(i,l,s),d=t(i,l,e),v=t(f,e,o),a.push(h[u]),a.push(w[u])):34===u?(0===ut?(k=1-t(i,o,s),rt=1-t(f,o,s),b=t(f,l,s),it=t(i,l,s),tt=t(i,l,e),d=t(f,l,e),v=1-t(f,o,e),p=1-t(i,o,e)):(k=t(f,s,o),rt=t(i,s,o),b=1-t(i,s,l),it=1-t(f,s,l),tt=1-t(f,e,l),d=1-t(i,e,l),v=t(i,e,o),p=t(f,e,o)),a.push(c[u]),a.push(h[u]),a.push(nt[u]),a.push(g[u])):35===u?(4===ut?(k=1-t(i,o,s),rt=1-t(f,o,s),b=t(f,l,s),it=t(i,l,s),tt=t(i,l,e),d=t(f,l,e),v=1-t(f,o,e),p=1-t(i,o,e)):(k=t(f,s,o),rt=t(i,s,o),b=1-t(i,s,l),it=1-t(f,s,l),tt=1-t(f,e,l),d=1-t(i,e,l),v=t(i,e,o),p=t(f,e,o)),a.push(c[u]),a.push(h[u]),a.push(y[u]),a.push(g[u])):136===u?(0===ut?(k=t(f,s,o),rt=t(i,s,o),b=1-t(i,s,l),it=1-t(f,s,l),tt=1-t(f,e,l),d=1-t(i,e,l),v=t(i,e,o),p=t(f,e,o)):(k=1-t(i,o,s),rt=1-t(f,o,s),b=t(f,l,s),it=t(i,l,s),tt=t(i,l,e),d=t(f,l,e),v=1-t(f,o,e),p=1-t(i,o,e)),a.push(c[u]),a.push(h[u]),a.push(nt[u]),a.push(g[u])):153===u?(0===ut?(k=t(i,s,o),it=1-t(i,s,l),tt=1-t(i,e,l),p=t(i,e,o)):(k=1-t(f,o,s),it=t(f,l,s),tt=t(f,l,e),p=1-t(f,o,e)),a.push(c[u]),a.push(y[u])):102===u?(0===ut?(rt=1-t(i,o,s),b=t(i,l,s),d=t(i,l,e),v=1-t(i,o,e)):(rt=t(f,s,o),b=1-t(f,s,l),d=1-t(f,e,l),v=t(f,e,o)),a.push(h[u]),a.push(g[u])):155===u?(4===ut?(k=t(i,s,o),it=1-t(i,s,l),tt=1-t(i,e,l),p=t(i,e,o)):(k=1-t(f,o,s),it=t(f,l,s),tt=t(f,l,e),p=1-t(f,o,e)),a.push(c[u]),a.push(nt[u])):103===u?(4===ut?(rt=1-t(i,o,s),b=t(i,l,s),d=t(i,l,e),v=1-t(i,o,e)):(rt=t(f,s,o),b=1-t(f,s,l),d=1-t(f,e,l),v=t(f,e,o)),a.push(h[u]),a.push(w[u])):152===u?(0===ut?(k=t(i,s,o),b=1-t(i,s,l),it=1-t(f,s,l),tt=1-t(f,e,l),d=1-t(i,e,l),p=t(i,e,o)):(k=1-t(f,o,s),b=t(f,l,s),it=t(i,l,s),tt=t(i,l,e),d=t(f,l,e),p=1-t(f,o,e)),a.push(c[u]),a.push(w[u]),a.push(y[u])):156===u?(4===ut?(k=t(i,s,o),b=1-t(i,s,l),it=1-t(f,s,l),tt=1-t(f,e,l),d=1-t(i,e,l),p=t(i,e,o)):(k=1-t(f,o,s),b=t(f,l,s),it=t(i,l,s),tt=t(i,l,e),d=t(f,l,e),p=1-t(f,o,e)),a.push(c[u]),a.push(y[u]),a.push(g[u])):137===u?(0===ut?(k=t(f,s,o),rt=t(i,s,o),it=1-t(i,s,l),tt=1-t(i,e,l),v=t(i,e,o),p=t(f,e,o)):(k=1-t(i,o,s),rt=1-t(f,o,s),it=t(f,l,s),tt=t(f,l,e),v=1-t(f,o,e),p=1-t(i,o,e)),a.push(c[u]),a.push(h[u]),a.push(y[u])):139===u?(4===ut?(k=t(f,s,o),rt=t(i,s,o),it=1-t(i,s,l),tt=1-t(i,e,l),v=t(i,e,o),p=t(f,e,o)):(k=1-t(i,o,s),rt=1-t(f,o,s),it=t(f,l,s),tt=t(f,l,e),v=1-t(f,o,e),p=1-t(i,o,e)),a.push(c[u]),a.push(h[u]),a.push(nt[u])):98===u?(0===ut?(k=1-t(i,o,s),rt=1-t(f,o,s),b=t(f,l,s),it=t(i,l,s),d=t(i,l,e),v=1-t(i,o,e)):(k=t(f,s,o),rt=t(i,s,o),b=1-t(i,s,l),it=1-t(f,s,l),d=1-t(f,e,l),v=t(f,e,o)),a.push(c[u]),a.push(h[u]),a.push(g[u])):99===u?(4===ut?(k=1-t(i,o,s),rt=1-t(f,o,s),b=t(f,l,s),it=t(i,l,s),d=t(i,l,e),v=1-t(i,o,e)):(k=t(f,s,o),rt=t(i,s,o),b=1-t(i,s,l),it=1-t(f,s,l),d=1-t(f,e,l),v=t(f,e,o)),a.push(c[u]),a.push(h[u]),a.push(y[u])):38===u?(0===ut?(rt=1-t(i,o,s),b=t(i,l,s),tt=t(i,l,e),d=t(f,l,e),v=1-t(f,o,e),p=1-t(i,o,e)):(rt=t(f,s,o),b=1-t(f,s,l),tt=1-t(f,e,l),d=1-t(i,e,l),v=t(i,e,o),p=t(f,e,o)),a.push(h[u]),a.push(nt[u]),a.push(g[u])):39===u?(4===ut?(rt=1-t(i,o,s),b=t(i,l,s),tt=t(i,l,e),d=t(f,l,e),v=1-t(f,o,e),p=1-t(i,o,e)):(rt=t(f,s,o),b=1-t(f,s,l),tt=1-t(f,e,l),d=1-t(i,e,l),v=t(i,e,o),p=t(f,e,o)),a.push(h[u]),a.push(w[u]),a.push(g[u])):85===u&&(k=1,rt=0,b=1,it=0,tt=0,d=1,v=0,p=1),(v<0||v>1||p<0||p>1||k<0||k>1||b<0||b>1||tt<0||tt>1||d<0||d>1)&&console.log("MarchingSquaresJS-isoBands: "+u+" "+st+" "+e+","+o+","+s+","+l+" "+ut+" "+v+" "+p+" "+k+" "+rt+" "+b+" "+it+" "+tt+" "+d),ot.cells[ft][et]={cval:u,cval_real:st,flipped:ut,topleft:v,topright:p,righttop:k,rightbottom:rt,bottomright:b,bottomleft:it,leftbottom:tt,lefttop:d,edges:a}))}return ot}(n,i,r),vv.polygons?(vv.verbose&&console.log("MarchingSquaresJS-isoBands: returning single polygons for each grid cell"),l=function(n){var t=[],i=0;return n.cells.forEach(function(n,r){n.forEach(function(n,u){if(void 0!==n){var f=s[n.cval](n);"object"==typeof f&&wit(f)?"object"==typeof f[0]&&wit(f[0])?"object"==typeof f[0][0]&&wit(f[0][0])?f.forEach(function(n){n.forEach(function(n){n[0]+=u;n[1]+=r});t[i++]=n}):(f.forEach(function(n){n[0]+=u;n[1]+=r}),t[i++]=f):console.log("MarchingSquaresJS-isoBands: bandcell polygon with malformed coordinates"):console.log("MarchingSquaresJS-isoBands: bandcell polygon with null coordinates")}})}),t}(v)):(vv.verbose&&console.log("MarchingSquaresJS-isoBands: returning polygon paths for entire data grid"),l=function(n){for(var u,o,l=[],a=n.rows,v=n.cols,s=[],e=0;e<a;e++)for(u=0;u<v;u++)if(void 0!==n.cells[e][u]&&n.cells[e][u].edges.length>0){var p=n.cells[e][u],f=function(n){if(n.edges.length>0){var i=n.edges[n.edges.length-1],t=n.cval_real;switch(i){case 0:return t&ph?{p:[1,n.righttop],x:-1,y:0,o:1}:{p:[n.topleft,1],x:0,y:-1,o:0};case 1:return t&sf?{p:[n.topleft,1],x:0,y:-1,o:0}:{p:[1,n.rightbottom],x:-1,y:0,o:0};case 2:return t&sf?{p:[n.bottomright,0],x:0,y:1,o:1}:{p:[n.topleft,1],x:0,y:-1,o:0};case 3:return t&gf?{p:[n.topleft,1],x:0,y:-1,o:0}:{p:[n.bottomleft,0],x:0,y:1,o:0};case 4:return t&ph?{p:[1,n.righttop],x:-1,y:0,o:1}:{p:[n.topright,1],x:0,y:-1,o:1};case 5:return t&sf?{p:[n.topright,1],x:0,y:-1,o:1}:{p:[1,n.rightbottom],x:-1,y:0,o:0};case 6:return t&sf?{p:[n.bottomright,0],x:0,y:1,o:1}:{p:[n.topright,1],x:0,y:-1,o:1};case 7:return t&gf?{p:[n.topright,1],x:0,y:-1,o:1}:{p:[n.bottomleft,0],x:0,y:1,o:0};case 8:return t&sf?{p:[n.bottomright,0],x:0,y:1,o:1}:{p:[1,n.righttop],x:-1,y:0,o:1};case 9:return t&gf?{p:[1,n.righttop],x:-1,y:0,o:1}:{p:[n.bottomleft,0],x:0,y:1,o:0};case 10:return t&gf?{p:[0,n.leftbottom],x:1,y:0,o:0}:{p:[1,n.righttop],x:-1,y:0,o:1};case 11:return t&ee?{p:[1,n.righttop],x:-1,y:0,o:1}:{p:[0,n.lefttop],x:1,y:0,o:1};case 12:return t&sf?{p:[n.bottomright,0],x:0,y:1,o:1}:{p:[1,n.rightbottom],x:-1,y:0,o:0};case 13:return t&gf?{p:[1,n.rightbottom],x:-1,y:0,o:0}:{p:[n.bottomleft,0],x:0,y:1,o:0};case 14:return t&gf?{p:[0,n.leftbottom],x:1,y:0,o:0}:{p:[1,n.rightbottom],x:-1,y:0,o:0};case 15:return t&ee?{p:[1,n.rightbottom],x:-1,y:0,o:0}:{p:[0,n.lefttop],x:1,y:0,o:1};case 16:return t&sf?{p:[n.bottomright,0],x:0,y:1,o:1}:{p:[0,n.leftbottom],x:1,y:0,o:0};case 17:return t&ee?{p:[n.bottomright,0],x:0,y:1,o:1}:{p:[0,n.lefttop],x:1,y:0,o:1};case 18:return t&gf?{p:[0,n.leftbottom],x:1,y:0,o:0}:{p:[n.bottomleft,0],x:0,y:1,o:0};case 19:return t&ee?{p:[n.bottomleft,0],x:0,y:1,o:0}:{p:[0,n.lefttop],x:1,y:0,o:1};case 20:return t&ee?{p:[n.topleft,1],x:0,y:-1,o:0}:{p:[0,n.leftbottom],x:1,y:0,o:0};case 21:return t&ph?{p:[0,n.leftbottom],x:1,y:0,o:0}:{p:[n.topright,1],x:0,y:-1,o:1};case 22:return t&ee?{p:[n.topleft,1],x:0,y:-1,o:0}:{p:[0,n.lefttop],x:1,y:0,o:1};case 23:return t&ph?{p:[0,n.lefttop],x:1,y:0,o:1}:{p:[n.topright,1],x:0,y:-1,o:1};default:console.log("MarchingSquaresJS-isoBands: edge index out of range!");console.log(n)}}return null}(p),r=null,t=u,i=e;null!==f&&s.push([f.p[0]+t,f.p[1]+i]);do{if(null===(r=function(n,t,i,r){var s,l,f,e,o,u=n.cval;switch(t){case-1:switch(r){case 0:s=h[u];f=kt[u];e=dt[u];o=gt[u];break;default:s=c[u];f=pt[u];e=wt[u];o=bt[u]}break;case 1:switch(r){case 0:s=nt[u];f=hi[u];e=ci[u];o=li[u];break;default:s=g[u];f=ei[u];e=oi[u];o=si[u]}break;default:switch(i){case-1:switch(r){case 0:s=ai[u];f=ht[u];e=ct[u];o=lt[u];break;default:s=vi[u];f=at[u];e=vt[u];o=yt[u]}break;case 1:switch(r){case 0:s=y[u];f=ni[u];e=ti[u];o=ii[u];break;default:s=w[u];f=ri[u];e=ui[u];o=fi[u]}}}if(l=n.edges.indexOf(s),void 0===n.edges[l])return null;!function(n,t){delete n.edges[t];for(var i=t+1;i<n.edges.length;i++)n.edges[i-1]=n.edges[i];n.edges.pop()}(n,l);switch(u=n.cval_real,s){case 0:u&ph?(t=n.topleft,i=1):(t=1,i=n.righttop);break;case 1:u&sf?(t=1,i=n.rightbottom):(t=n.topleft,i=1);break;case 2:u&sf?(t=n.topleft,i=1):(t=n.bottomright,i=0);break;case 3:u&gf?(t=n.bottomleft,i=0):(t=n.topleft,i=1);break;case 4:u&ph?(t=n.topright,i=1):(t=1,i=n.righttop);break;case 5:u&sf?(t=1,i=n.rightbottom):(t=n.topright,i=1);break;case 6:u&sf?(t=n.topright,i=1):(t=n.bottomright,i=0);break;case 7:u&gf?(t=n.bottomleft,i=0):(t=n.topright,i=1);break;case 8:u&sf?(t=1,i=n.righttop):(t=n.bottomright,i=0);break;case 9:u&gf?(t=n.bottomleft,i=0):(t=1,i=n.righttop);break;case 10:u&gf?(t=1,i=n.righttop):(t=0,i=n.leftbottom);break;case 11:u&ee?(t=0,i=n.lefttop):(t=1,i=n.righttop);break;case 12:u&sf?(t=1,i=n.rightbottom):(t=n.bottomright,i=0);break;case 13:u&gf?(t=n.bottomleft,i=0):(t=1,i=n.rightbottom);break;case 14:u&gf?(t=1,i=n.rightbottom):(t=0,i=n.leftbottom);break;case 15:u&ee?(t=0,i=n.lefttop):(t=1,i=n.rightbottom);break;case 16:u&sf?(t=0,i=n.leftbottom):(t=n.bottomright,i=0);break;case 17:u&ee?(t=0,i=n.lefttop):(t=n.bottomright,i=0);break;case 18:u&gf?(t=n.bottomleft,i=0):(t=0,i=n.leftbottom);break;case 19:u&ee?(t=0,i=n.lefttop):(t=n.bottomleft,i=0);break;case 20:u&ee?(t=0,i=n.leftbottom):(t=n.topleft,i=1);break;case 21:u&ph?(t=n.topright,i=1):(t=0,i=n.leftbottom);break;case 22:u&ee?(t=0,i=n.lefttop):(t=n.topleft,i=1);break;case 23:u&ph?(t=n.topright,i=1):(t=0,i=n.lefttop);break;default:return console.log("MarchingSquaresJS-isoBands: edge index out of range!"),console.log(n),null}return void 0!==t&&void 0!==i&&void 0!==f&&void 0!==e&&void 0!==o||(console.log("MarchingSquaresJS-isoBands: undefined value!"),console.log(n),console.log(t+" "+i+" "+f+" "+e+" "+o)),{p:[t,i],x:f,y:e,o:o}}(n.cells[i][t],f.x,f.y,f.o)))break;if(s.push([r.p[0]+t,r.p[1]+i]),t+=r.x,i+=r.y,f=r,i<0||i>=a||t<0||t>=v||void 0===n.cells[i][t]){if(t-=r.x,i-=r.y,o=function(n,t,i,r,u,f){for(var h=n.cells[i][t],c=h.cval_real,o=t+r,e=i+u,s=[],l=!1;!l;){if(void 0===n.cells[e]||void 0===n.cells[e][o])if(e-=u,o-=r,h=n.cells[e][o],c=h.cval_real,-1===u)if(0===f)if(c&gf)s.push([o,e]),r=-1,u=0,f=0;else{if(!(c&sf)){s.push([o+h.bottomright,e]);r=0;u=1;f=1;l=!0;break}s.push([o+1,e]);r=1;u=0;f=0}else{if(!(c&gf)){if(c&sf){s.push([o+h.bottomright,e]);r=0;u=1;f=1;l=!0;break}s.push([o+h.bottomleft,e]);r=0;u=1;f=0;l=!0;break}s.push([o,e]);r=-1;u=0;f=0}else if(1===u)if(0===f){if(!(c&ph)){if(c&ee){s.push([o+h.topleft,e+1]);r=0;u=-1;f=0;l=!0;break}s.push([o+h.topright,e+1]);r=0;u=-1;f=1;l=!0;break}s.push([o+1,e+1]);r=1;u=0;f=1}else s.push([o+1,e+1]),r=1,u=0,f=1;else if(-1===r)if(0===f){if(!(c&ee)){if(c&gf){s.push([o,e+h.leftbottom]);r=1;u=0;f=0;l=!0;break}s.push([o,e+h.lefttop]);r=1;u=0;f=1;l=!0;break}s.push([o,e+1]);r=0;u=1;f=0}else{if(!(c&ee)){console.log("MarchingSquaresJS-isoBands: wtf");break}s.push([o,e+1]);r=0;u=1;f=0}else{if(1!==r){console.log("MarchingSquaresJS-isoBands: we came from nowhere!");break}if(0===f){if(!(c&sf)){s.push([o+1,e+h.rightbottom]);r=-1;u=0;f=0;l=!0;break}s.push([o+1,e]);r=0;u=-1;f=1}else{if(!(c&sf)){if(c&ph){s.push([o+1,e+h.righttop]);r=-1;u=0;f=1;break}s.push([o+1,e+h.rightbottom]);r=-1;u=0;f=0;l=!0;break}s.push([o+1,e]);r=0;u=-1;f=1}}else if(h=n.cells[e][o],c=h.cval_real,-1===r)if(0===f)if(void 0!==n.cells[e-1]&&void 0!==n.cells[e-1][o])r=0,u=-1,f=1;else{if(!(c&gf)){s.push([o+h.bottomright,e]);r=0;u=1;f=1;l=!0;break}s.push([o,e])}else{if(!(c&ee)){console.log("MarchingSquaresJS-isoBands: found entry from top at "+o+","+e);break}console.log("MarchingSquaresJS-isoBands: proceeding in x-direction!")}else if(1===r){if(0===f){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==n.cells[e+1]&&void 0!==n.cells[e+1][o])r=0,u=1,f=0;else{if(!(c&ph)){s.push([o+h.topleft,e+1]);r=0;u=-1;f=0;l=!0;break}s.push([o+1,e+1]);r=1;u=0;f=1}}else if(-1===u){if(1!==f){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==n.cells[e][o+1])r=1,u=0,f=1;else{if(!(c&sf)){s.push([o+1,e+h.righttop]);r=-1;u=0;f=1;l=!0;break}s.push([o+1,e]);r=0;u=-1;f=1}}else{if(1!==u){console.log("MarchingSquaresJS-isoBands: where did we came from???");break}if(0!==f){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==n.cells[e][o-1])r=-1,u=0,f=0;else{if(!(c&ee)){s.push([o,e+h.leftbottom]);r=1;u=0;f=0;l=!0;break}s.push([o,e+1]);r=0;u=1;f=0}}if(o+=r,e+=u,o===t&&e===i)break}return{path:s,i:o,j:e,x:r,y:u,o:f}}(n,t,i,r.x,r.y,r.o),null===o)break;o.path.forEach(function(n){s.push(n)});t=o.i;i=o.j;f=o}}while(void 0!==n.cells[i][t]&&n.cells[i][t].edges.length>0);l.push(s);s=[];n.cells[e][u].edges.length>0&&u--}return l}(v)),"function"==typeof vv.successCallback&&vv.successCallback(l),l}function t(n,t,i){return(n-t)/(i-t)}function wit(n){return n.constructor.toString().indexOf("Array")>-1}function sht(n,t,i){if(i=i||{},!v(i))throw new Error("options is invalid");var r=i.pivot,u=i.mutate;if(!n)throw new Error("geojson is required");if(void 0===t||null===t||isNaN(t))throw new Error("angle is required");return 0===t?n:(r||(r=sv(n)),!1!==u&&void 0!==u||(n=kf(n)),pu(n,function(n){var u=sa(r,n)+t,f=sd(r,n),i=p(np(r,f,u));n[0]=i[0];n[1]=i[1]}),n)}function hht(n,t,i){var r,u,f;if(i=i||{},!v(i))throw new Error("options is invalid");if(r=i.origin,u=i.mutate,!n)throw new Error("geojson required");if("number"!=typeof t||0===t)throw new Error("invalid factor");return f=Array.isArray(r)||"object"==typeof r,!0!==u&&(n=kf(n)),"FeatureCollection"!==n.type||f?cht(n,t,r):(nr(n,function(i,u){n.features[u]=cht(i,t,r)}),n)}function cht(n,t,i){var r="Point"===fr(n);return i=function(n,t){if(void 0!==t&&null!==t||(t="centroid"),Array.isArray(t)||"object"==typeof t)return cr(t);var i=n.bbox?n.bbox:hu(n),r=i[0],u=i[1],f=i[2],e=i[3];switch(t){case"sw":case"southwest":case"westsouth":case"bottomleft":return wi([r,u]);case"se":case"southeast":case"eastsouth":case"bottomright":return wi([f,u]);case"nw":case"northwest":case"westnorth":case"topleft":return wi([r,e]);case"ne":case"northeast":case"eastnorth":case"topright":return wi([f,e]);case"center":return rd(n);case void 0:case null:case"centroid":return sv(n);default:throw new Error("invalid origin");}}(n,i),1===t||r?n:(pu(n,function(n){var u=sd(i,n),f=sa(i,n),r=p(np(i,u*t,f));n[0]=r[0];n[1]=r[1];3===n.length&&(n[2]*=t)}),n)}function pd(n){var t=n[0],i=n[1];return[i[0]-t[0],i[1]-t[1]]}function bit(n,t){return n[0]*t[1]-t[0]*n[1]}function apt(n,t){return!function(n,t){return 0===bit(pd(n),pd(t))}(n,t)&&function(n,t){var i=n[0],r=pd(n),f=t[0],u=pd(t),e=bit(r,u);return function(n,t){return[n[0]+t[0],n[1]+t[1]]}(i,function(n,t){return[n*t[0],n*t[1]]}(bit(function(n,t){return[n[0]-t[0],n[1]-t[1]]}(f,i),u)/e,r))}(n,t)}function lht(n,t,i){var f=[],e=pk(t,i),u=p(n),r=[];return u.forEach(function(n,t){var i,o,s;t!==u.length-1&&(i=function(n,t,i){var r=Math.sqrt((n[0]-t[0])*(n[0]-t[0])+(n[1]-t[1])*(n[1]-t[1])),u=n[0]+i*(t[1]-n[1])/r,f=t[0]+i*(t[1]-n[1])/r,e=n[1]+i*(n[0]-t[0])/r,o=t[1]+i*(n[0]-t[0])/r;return[[u,e],[f,o]]}(n,u[t+1],e),(f.push(i),t>0)&&(o=f[t-1],s=apt(i,o),!1!==s&&(o[1]=s,i[0]=s),r.push(o[0]),t===u.length-2&&(r.push(i[0]),r.push(i[1]))),2===u.length&&(r.push(i[0]),r.push(i[1])))}),ur(r,n.properties)}function kit(n,t,i){var r=t[0]-n[0],u=t[1]-n[1],f=i[0]-t[0],e=i[1]-t[1];return Math.sign(r*e-f*u)}function aht(n,t){return t.geometry.coordinates[0].every(function(t){return pr(wi(t),n)})}function vht(n,t){for(var i=0;i<n.coordinates.length-1;i++)if(function(n,t,i){var f=i[0]-n[0],e=i[1]-n[1],r=t[0]-n[0],u=t[1]-n[1];return f*u-e*r!=0?!1:Math.abs(r)>=Math.abs(u)?r>0?n[0]<=i[0]&&i[0]<=t[0]:t[0]<=i[0]&&i[0]<=n[0]:u>0?n[1]<=i[1]&&i[1]<=t[1]:t[1]<=i[1]&&i[1]<=n[1]}(n.coordinates[i],n.coordinates[i+1],t.coordinates))return!0;return!1}function yht(n,t){return cl(t,ld(n)).features.length>0}function pht(n,t){return!(n[0]>t[0])&&!(n[2]<t[2])&&!(n[1]>t[1])&&!(n[3]<t[3])}function dit(n,t){return n[0]===t[0]&&n[1]===t[1]}function wht(n,t){for(var i,e,r=!1,u=!1,o=n.coordinates.length,f=0;f<o&&!r&&!u;){for(i=0;i<t.coordinates.length-1;i++)e=!0,0!==i&&i!==t.coordinates.length-2||(e=!1),dht(t.coordinates[i],t.coordinates[i+1],n.coordinates[f],e)?r=!0:u=!0;f++}return r&&u}function bht(n,t){return cl(n,ld(t)).features.length>0}function kht(n,t){for(var u=!1,i=!1,f=n.coordinates[0].length,r=0;r<f&&u&&i;)pr(wi(n.coordinates[0][r]),t)?u=!0:i=!0,r++;return i&&i}function dht(n,t,i,r){var e=i[0]-n[0],o=i[1]-n[1],u=t[0]-n[0],f=t[1]-n[1];return 0==e*f-o*u&&(r?Math.abs(u)>=Math.abs(f)?u>0?n[0]<=i[0]&&i[0]<=t[0]:t[0]<=i[0]&&i[0]<=n[0]:f>0?n[1]<=i[1]&&i[1]<=t[1]:t[1]<=i[1]&&i[1]<=n[1]:Math.abs(u)>=Math.abs(f)?u>0?n[0]<i[0]&&i[0]<t[0]:t[0]<i[0]&&i[0]<n[0]:f>0?n[1]<i[1]&&i[1]<t[1]:t[1]<i[1]&&i[1]<n[1])}function ght(n){return n.coordinates.map(function(t){return{type:n.type.replace("Multi",""),coordinates:t}})}function nct(n,t){return n.hasOwnProperty("coordinates")?n.coordinates.length===t.coordinates.length:n.length===t.length}function vpt(n,t){return vbt(n,t,{strict:!0})}function tct(n,t){var r,i,u,f;if(!n)throw new Error("feature1 is required");if(!t)throw new Error("feature2 is required");if(r=fr(n),r!==fr(t))throw new Error("features must be of the same type");if("Point"===r)throw new Error("Point geometry not supported");if(new nvt({precision:6}).compare(n,t))return!1;i=0;switch(r){case"MultiPoint":u=ec(n);f=ec(t);u.forEach(function(n){f.forEach(function(t){n[0]===t[0]&&n[1]===t[1]&&i++})});break;case"LineString":case"MultiLineString":ol(n,function(n){ol(t,function(t){rht(n,t).features.length&&i++})});break;case"Polygon":case"MultiPolygon":ol(n,function(n){ol(t,function(t){cl(n,t).features.length&&i++})})}return i>0}function ict(n,t,i){i=i||[];for(var r=0;r<n;r++)i[r]=t;return i}function rct(n,t){if(n.geometry&&n.geometry.type)return n.geometry.type;if(n.type)return n.type;throw new Error("Invalid GeoJSON object for "+t);}function uct(n){for(var t=n,i=[];t.parent;)i.unshift(t),t=t.parent;return i}function tp(n,t){var i,r,u,f;for(t=t||{},this.nodes=[],this.diagonal=!!t.diagonal,this.grid=[],i=0;i<n.length;i++)for(this.grid[i]=[],r=0,u=n[i];r<u.length;r++)f=new wd(i,r,u[r]),this.grid[i][r]=f,this.nodes.push(f);this.init()}function wd(n,t,i){this.x=n;this.y=t;this.weight=i}function fct(n){this.content=[];this.scoreFunction=n}function ypt(n){return n[0]}function ppt(n){return n[1]}function bd(){this._=null}function kd(n){n.U=n.C=n.L=n.R=n.P=n.N=null}function cb(n,t){var i=t,r=t.R,u=i.U;u?u.L===i?u.L=r:u.R=r:n._=r;r.U=u;i.U=r;i.R=r.L;i.R&&(i.R.U=i);r.L=i}function lb(n,t){var i=t,r=t.L,u=i.U;u?u.L===i?u.L=r:u.R=r:n._=r;r.U=u;i.U=r;i.L=r.R;i.L&&(i.L.U=i);r.R=i}function ect(n){for(;n.L;)n=n.L;return n}function ab(n,t,i,r){var u=[null,null],f=pe.push(u)-1;return u.left=n,u.right=t,i&&dd(u,n,t,i),r&&dd(u,t,n,r),fs[n.index].halfedges.push(f),fs[t.index].halfedges.push(f),u}function vb(n,t,i){var r=[t,i];return r.left=n,r}function dd(n,t,i,r){n[0]||n[1]?n.left===i?n[1]=r:n[0]=r:(n[0]=r,n.left=t,n.right=i)}function wpt(n,t,i,r,u){var f,a=n[0],v=n[1],c=a[0],l=a[1],e=0,o=1,s=v[0]-c,h=v[1]-l;if(f=t-c,s||!(f>0)){if(f/=s,s<0){if(f<e)return;f<o&&(o=f)}else if(s>0){if(f>o)return;f>e&&(e=f)}if(f=r-c,s||!(f<0)){if(f/=s,s<0){if(f>o)return;f>e&&(e=f)}else if(s>0){if(f<e)return;f<o&&(o=f)}if(f=i-l,h||!(f>0)){if(f/=h,h<0){if(f<e)return;f<o&&(o=f)}else if(h>0){if(f>o)return;f>e&&(e=f)}if(f=u-l,h||!(f<0)){if(f/=h,h<0){if(f>o)return;f>e&&(e=f)}else if(h>0){if(f<e)return;f<o&&(o=f)}return!(e>0||o<1)||(e>0&&(n[0]=[c+e*s,l+e*h]),o<1&&(n[1]=[c+o*s,l+o*h]),!0)}}}}}function bpt(n,t,i,r,u){var s=n[1];if(s)return!0;var e,o,f=n[0],y=n.left,p=n.right,c=y[0],l=y[1],a=p[0],v=p[1],h=(c+a)/2,w=(l+v)/2;if(v===l){if(h<t||h>=r)return;if(c>a){if(f){if(f[1]>=u)return}else f=[h,i];s=[h,u]}else{if(f){if(f[1]<i)return}else f=[h,u];s=[h,i]}}else if(e=(c-a)/(v-l),o=w-e*h,e<-1||e>1)if(c>a){if(f){if(f[1]>=u)return}else f=[(i-o)/e,i];s=[(u-o)/e,u]}else{if(f){if(f[1]<i)return}else f=[(u-o)/e,u];s=[(i-o)/e,i]}else if(l<v){if(f){if(f[0]>=r)return}else f=[t,e*t+o];s=[r,e*r+o]}else{if(f){if(f[0]<t)return}else f=[r,e*r+o];s=[t,e*t+o]}return n[0]=f,n[1]=s,!0}function kpt(n,t){var u=n.site,i=t.left,r=t.right;return u===r&&(r=i,i=u),r?Math.atan2(r[1]-i[1],r[0]-i[0]):(u===i?(i=t[1],r=t[0]):(i=t[0],r=t[1]),Math.atan2(i[0]-r[0],r[1]-i[1]))}function oct(n,t){return t[+(t.left!==n.site)]}function dpt(n,t){return t[+(t.left===n.site)]}function ip(n){var w=n.P,b=n.N,r,t;if(w&&b){var s=w.site,h=n.site,c=b.site;if(s!==c){var l=h[0],a=h[1],u=s[0]-l,f=s[1]-a,e=c[0]-l,o=c[1]-a,v=2*(u*o-f*e);if(!(v>=-ikt)){var k=u*u+f*f,d=e*e+o*o,y=(o*k-f*d)/v,p=(u*d-e*k)/v,i=uvt.pop()||new function(){kd(this);this.x=this.y=this.arc=this.site=this.cy=null};for(i.arc=n,i.site=h,i.x=y+l,i.y=(i.cy=p+a)+Math.sqrt(y*y+p*p),n.circle=i,r=null,t=gb._;t;)if(i.y<t.y||i.y===t.y&&i.x<=t.x){if(!t.L){r=t.P;break}t=t.L}else{if(!t.R){r=t;break}t=t.R}gb.insert(r,i);r||(cut=i)}}}}function rp(n){var t=n.circle;t&&(t.P||(cut=t.N),gb.remove(t),uvt.push(t),kd(t),n.circle=null)}function sct(n){var t=fvt.pop()||new function(){kd(this);this.edge=this.site=this.circle=null};return t.site=n,t}function git(n){rp(n);op.remove(n);fvt.push(n);kd(n)}function gpt(n){var c=n.circle,f=c.x,e=c.cy,l=[f,e],o=n.P,s=n.N,r=[n],i,t,u,h;for(git(n),i=o;i.circle&&Math.abs(f-i.circle.x)<lr&&Math.abs(e-i.circle.cy)<lr;)o=i.P,r.unshift(i),git(i),i=o;for(r.unshift(i),rp(i),t=s;t.circle&&Math.abs(f-t.circle.x)<lr&&Math.abs(e-t.circle.cy)<lr;)s=t.N,r.push(t),git(t),t=s;for(r.push(t),rp(t),h=r.length,u=1;u<h;++u)t=r[u],i=r[u-1],dd(t.edge,i.site,t.site,l);i=r[0];(t=r[h-1]).edge=ab(i.site,t.site,null,l);ip(i);ip(t)}function nwt(n){for(var u,t,i,y,p,w=n[0],b=n[1],r=op._;r;)if((y=hct(r,b)-w)>lr)r=r.L;else{if(!((p=w-function(n,t){var r=n.N,i;return r?hct(r,t):(i=n.site,i[1]===t?i[0]:1/0)}(r,b))>lr)){y>-lr?(t=r.P,i=r):p>-lr?(t=r,i=r.N):t=i=r;break}if(!r.R){t=r;break}r=r.R}if(!function(n){fs[n.index]={site:n,halfedges:[]}}(n),u=sct(n),op.insert(t,u),t||i){if(t===i)return rp(t),i=sct(t.site),op.insert(u,i),u.edge=i.edge=ab(t.site,u.site),ip(t),void ip(i);if(i){rp(t);rp(i);var f=t.site,l=f[0],a=f[1],e=n[0]-l,o=n[1]-a,s=i.site,h=s[0]-l,c=s[1]-a,k=2*(e*c-o*h),d=e*e+o*o,g=h*h+c*c,v=[(c*d-o*g)/k+l,(e*g-h*d)/k+a];dd(i.edge,f,s,v);u.edge=ab(f,n,null,v);i.edge=ab(n,s,null,v);ip(t);ip(i)}else u.edge=ab(t.site,u.site)}}function hct(n,t){var r=n.site,u=r[0],l=r[1],f=l-t,e;if(!f)return u;if(e=n.P,!e)return-1/0;var o=(r=e.site)[0],a=r[1],i=a-t;if(!i)return o;var s=o-u,h=1/f-1/i,c=s/i;return h?(-c+Math.sqrt(c*c-2*h*(s*s/(-2*i)-a+i/2+l-f/2)))/h+u:(u+o)/2}function twt(n,t,i){return(n[0]-i[0])*(t[1]-n[1])-(n[0]-t[0])*(i[1]-n[1])}function iwt(n,t){return t[1]-n[1]||t[0]-n[0]}function nrt(n,t){var u,f,r,i=n.sort(iwt).pop();for(pe=[],fs=new Array(n.length),op=new bd,gb=new bd;;)if(r=cut,i&&(!r||i[1]<r.y||i[1]===r.y&&i[0]<r.x))i[0]===u&&i[1]===f||(nwt(i),u=i[0],f=i[1]),i=n.pop();else{if(!r)break;gpt(r.arc)}if(function(){for(var e,r,n,t,f,i,u=0,o=fs.length;u<o;++u)if((e=fs[u])&&(t=(r=e.halfedges).length)){for(f=new Array(t),i=new Array(t),n=0;n<t;++n)f[n]=n,i[n]=kpt(e,pe[r[n]]);for(f.sort(function(n,t){return i[t]-i[n]}),n=0;n<t;++n)i[n]=r[f[n]];for(n=0;n<t;++n)r[n]=i[n]}}(),t){var e=+t[0][0],o=+t[0][1],s=+t[1][0],h=+t[1][1];!function(n,t,i,r){for(var u,f=pe.length;f--;)bpt(u=pe[f],n,t,i,r)&&wpt(u,n,t,i,r)&&(Math.abs(u[0][0]-u[1][0])>lr||Math.abs(u[0][1]-u[1][1])>lr)||delete pe[f]}(e,o,s,h),function(n,t,i,r){for(var f,o,e,s,y,k,c,l,p,a,v,w=fs.length,h=!0,d,g,nt,b,u=0;u<w;++u)if(f=fs[u]){for(o=f.site,e=(s=f.halfedges).length;e--;)pe[s[e]]||s.splice(e,1);for(e=0,y=s.length;e<y;)a=(p=dpt(f,pe[s[e]]))[0],v=p[1],c=(k=oct(f,pe[s[++e%y]]))[0],l=k[1],(Math.abs(a-c)>lr||Math.abs(v-l)>lr)&&(s.splice(e,0,pe.push(vb(o,p,Math.abs(a-n)<lr&&r-v>lr?[n,Math.abs(c-n)<lr?l:r]:Math.abs(v-r)<lr&&i-a>lr?[Math.abs(l-r)<lr?c:i,r]:Math.abs(a-i)<lr&&v-t>lr?[i,Math.abs(c-i)<lr?l:t]:Math.abs(v-t)<lr&&a-n>lr?[Math.abs(l-t)<lr?c:n,t]:null))-1),++y);y&&(h=!1)}if(h){for(b=1/0,u=0,h=null;u<w;++u)(f=fs[u])&&(nt=(d=(o=f.site)[0]-n)*d+(g=o[1]-t)*g)<b&&(b=nt,h=f);if(h){var tt=[n,t],it=[n,r],rt=[i,r],ut=[i,t];h.halfedges.push(pe.push(vb(o=h.site,tt,it))-1,pe.push(vb(o,it,rt))-1,pe.push(vb(o,rt,ut))-1,pe.push(vb(o,ut,tt))-1)}}for(u=0;u<w;++u)(f=fs[u])&&(f.halfedges.length||delete fs[u])}(e,o,s,h)}this.edges=pe;this.cells=fs;op=gb=pe=fs=null}function rwt(n){return(n=n.slice()).push(n[0]),st([n])}function cct(n,t,i,r){var a=(r=r||{}).steps||64,s=r.units||"kilometers",y=r.angle||0,k=r.pivot||n,p=r.properties||n.properties||{},h,c,u,l,w,b;if(!n)throw new Error("center is required");if(!t)throw new Error("xSemiAxis is required");if(!i)throw new Error("ySemiAxis is required");if(!v(r))throw new Error("options must be an object");if(!gi(a))throw new Error("steps must be a number");if(!gi(y))throw new Error("angle must be a number");for(h=cr(n),"degrees"===s?c=yu(y):(t=np(n,t,90,{units:s}),i=np(n,i,0,{units:s}),t=cr(t)[0]-h[0],i=cr(i)[1]-h[1]),u=[],l=0;l<a;l+=1){var f=-360*l/a,e=t*i/Math.sqrt(Math.pow(i,2)+Math.pow(t,2)*Math.pow(lct(f),2)),o=t*i/Math.sqrt(Math.pow(t,2)+Math.pow(i,2)/Math.pow(lct(f),2));(f<-90&&f>=-270&&(e=-e),f<-180&&f>=-360&&(o=-o),"degrees"===s)&&(w=e*Math.cos(c)+o*Math.sin(c),b=o*Math.cos(c)-e*Math.sin(c),e=w,o=b);u.push([e+h[0],o+h[1]])}return u.push(u[0]),"degrees"===s?st([u],p):sht(st([u],p),y,{pivot:k})}function lct(n){var t=n*Math.PI/180;return Math.tan(t)}function trt(n,t){var r,u;if(t=t||{},!v(t))throw new Error("options is invalid");if(r=t.properties,u=t.weight,!n)throw new Error("geojson is required");var f=0,e=0,i=0;return nh(n,function(n,t,r){var o=r[u];if(o=void 0===o||null===o?1:o,!gi(o))throw new Error("weight value must be a number for feature index "+t);(o=Number(o))>0&&pu(n,function(n){f+=n[0]*o;e+=n[1]*o;i+=o})}),wi([f/i,e/i],r)}function act(n,t,i,r){var s=i.properties.tolerance||.001,h=0,c=0,e=0,o=0,u,f;if(nr(i,function(t){var f=t.properties.weight,i=void 0===f||null===f?1:f,r,u;if(i=Number(i),!gi(i))throw new Error("weight value must be a number");i>0&&(o+=1,r=i*tr(t,n),0===r&&(r=1),u=i/r,h+=t.geometry.coordinates[0]*u,c+=t.geometry.coordinates[1]*u,e+=u)}),o<1)throw new Error("no features to measure");return u=h/e,f=c/e,1===o||0===r||Math.abs(u-t[0])<s&&Math.abs(f-t[1])<s?wi([u,f],{medianCandidates:i.properties.medianCandidates}):(i.properties.medianCandidates.push([u,f]),act([u,f],n,i,r-1))}function vct(n,t){return{x:n[0]-t[0],y:n[1]-t[1]}}function yb(n){if(v(n)&&(n=n.bbox),n&&!Array.isArray(n))throw new Error("bbox is invalid");return n?function(n){return[Math.random()*(n[2]-n[0])+n[0],Math.random()*(n[3]-n[1])+n[1]]}(n):[360*bct(),180*bct()]}function yct(n,t){var u,i,r;if(t=t||{},!v(t))throw new Error("options is invalid");for(u=t.bbox,void 0!==n&&null!==n||(n=1),i=[],r=0;r<n;r++)i.push(wi(yb(u)));return d(i)}function pct(n,t){var e,o,i,r;if(t=t||{},!v(t))throw new Error("options is invalid");var s=t.bbox,f=t.num_vertices,u=t.max_radial_length;for(void 0!==n&&null!==n||(n=1),gi(f)||(f=10),gi(u)||(u=10),e=[],o=0;o<n;o++)i=[],r=Array.apply(null,new Array(f+1)).map(Math.random),r.forEach(function(n,t,i){i[t]=t>0?n+i[t-1]:n}),r.forEach(function(n){n=2*n*Math.PI/r[r.length-1];var t=Math.random();i.push([t*u*Math.sin(n),t*u*Math.cos(n)])}),i[i.length-1]=i[0],i=i.map(function(n){return function(t){return[t[0]+n[0],t[1]+n[1]]}}(yb(s))),e.push(st([i]));return d(e)}function wct(n,t){var o,s,r,i,h,c;if(t=t||{},!v(t))throw new Error("options is invalid");var l=t.bbox,u=t.num_vertices,f=t.max_length,e=t.max_rotation;for(void 0!==n&&null!==n||(n=1),(!gi(u)||u<2)&&(u=10),gi(f)||(f=.0001),gi(e)||(e=Math.PI/8),o=[],s=0;s<n;s++){for(r=[yb(l)],i=0;i<u-1;i++)h=(0===i?2*Math.random()*Math.PI:Math.tan((r[i][1]-r[i-1][1])/(r[i][0]-r[i-1][0])))+(Math.random()-.5)*e*2,c=Math.random()*f,r.push([r[i][0]+c*Math.cos(h),r[i][1]+c*Math.sin(h)]);o.push(ur(r))}return d(o)}function bct(){return Math.random()-.5}function kct(n,t){if(!n)throw new Error("geojson is required");if("FeatureCollection"!==n.type)throw new Error("geojson must be a FeatureCollection");if(void 0===t||null===t)throw new Error("filter is required");var i=[];return nr(n,function(n){gd(n.properties,t)&&i.push(n)}),d(i)}function irt(n,t,i){if(!n)throw new Error("geojson is required");if("FeatureCollection"!==n.type)throw new Error("geojson must be a FeatureCollection");if(void 0===t||null===t)throw new Error("property is required");for(var f=rrt(n,t),e=Object.keys(f),r=0;r<e.length;r++){for(var o=e[r],s=f[o],h=[],u=0;u<s.length;u++)h.push(n.features[s[u]]);i(d(h),o,r)}}function dct(n,t,i,r){var u=r;return irt(n,t,function(n,t,f){u=0===f&&void 0===r?n:i(u,n,t,f)}),u}function rrt(n,t){var i={};return nr(n,function(n,r){var f=n.properties||{},u;f.hasOwnProperty(t)&&(u=f[t],i.hasOwnProperty(u)?i[u].push(r):i[u]=[r])}),i}function gd(n,t){var r,i;if(void 0===n)return!1;if(r=typeof t,"number"===r||"string"===r)return n.hasOwnProperty(t);if(Array.isArray(t)){for(i=0;i<t.length;i++)if(!gd(n,t[i]))return!1;return!0}return urt(n,t)}function urt(n,t){for(var u,r=Object.keys(t),i=0;i<r.length;i++)if(u=r[i],n[u]!==t[u])return!1;return!0}function gct(n,t){var u,i,r;if(!t)return{};if(!t.length)return{};for(u={},i=0;i<t.length;i++)r=t[i],n.hasOwnProperty(r)&&(u[r]=n[r]);return u}function ho(){}function pb(n){this.message=n||""}function ng(n){this.message=n||""}function frt(){}function nlt(n){return null===n?yc:n.color}function sr(n){return null===n?null:n.parent}function hc(n,t){null!==n&&(n.color=t)}function ert(n){return null===n?null:n.left}function tlt(n){return null===n?null:n.right}function df(){this.root_=null;this.size_=0}function ilt(){}function vh(){this.array_=[];arguments[0]instanceof eu&&this.addAll(arguments[0])}function uwt(){}function ort(n){this.message=n||""}function yh(){this.array_=[]}function rlt(n){switch(n.type){case"Polygon":return eb(n)>1?n:null;case"MultiPolygon":var t=[];if(su(n,function(n){eb(n)>1&&t.push(n.geometry.coordinates)}),t.length)return{type:"MultiPolygon",coordinates:t}}}function tg(){this.reset()}function ult(n,t,i){var r=n.s=t+i,u=r-t,f=r-u;n.t=t-f+(i-u)}function wb(n){return n>1?rs:n<-1?-rs:Math.asin(n)}function bb(){}function ig(n,t){n&&ryt.hasOwnProperty(n.type)&&ryt[n.type](n,t)}function srt(n,t,i){var r,u=-1,f=n.length-i;for(t.lineStart();++u<f;)r=n[u],t.point(r[0],r[1],r[2]);t.lineEnd()}function flt(n,t){var i=-1,r=n.length;for(t.polygonStart();++i<r;)srt(n[i],t,1);t.polygonEnd()}function hrt(n){return[lk(n[1],n[0]),wb(n[2])]}function up(n){var t=n[0],i=n[1],r=of(i);return[r*of(t),r*bf(t),bf(i)]}function rg(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function ug(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function crt(n,t){n[0]+=t[0];n[1]+=t[1];n[2]+=t[2]}function fg(n,t){return[n[0]*t,n[1]*t,n[2]*t]}function lrt(n){var t=wn(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t;n[1]/=t;n[2]/=t}function art(n,t){return[n>rr?n-el:n<-rr?n+el:n,t]}function elt(n,t,i){return(n%=el)?t||i?uyt(slt(n),hlt(t,i)):slt(n):t||i?hlt(t,i):art}function olt(n){return function(t,i){return t+=n,[t>rr?t-el:t<-rr?t+el:t,i]}}function slt(n){var t=olt(n);return t.invert=olt(-n),t}function hlt(n,t){function e(n,t){var e=of(t),o=of(n)*e,s=bf(n)*e,h=bf(t),c=h*i+o*r;return[lk(s*u-c*f,o*i-h*r),wb(c*u+s*f)]}var i=of(n),r=bf(n),u=of(t),f=bf(t);return e.invert=function(n,t){var e=of(t),o=of(n)*e,s=bf(n)*e,h=bf(t),c=h*u-s*f;return[lk(s*u+h*f,o*i+c*r),wb(c*i-o*r)]},e}function clt(n,t){(t=up(t))[0]-=n;lrt(t);var i=function(n){return n>1?0:n<-1?rr:Math.acos(n)}(-t[1]);return((-t[2]<0?-i:i)+el-tu)%el}function eg(n,t,i,r){this.x=n;this.z=t;this.o=i;this.e=r;this.v=!1;this.n=this.p=null}function llt(n){if(r=n.length){for(var r,t,u=0,i=n[0];++u<r;)i.n=t=n[u],t.p=i,i=t;i.n=t=n[0];t.p=i}}function fwt(n,t,i,r){function f(u,f){return n<=u&&u<=i&&t<=f&&f<=r}function e(f,e,s,h){var c=0,l=0;if(null==f||(c=u(f,s))!==(l=u(e,s))||o(f,e)<0^s>0){do h.point(0===c||3===c?n:i,c>1?r:t);while((c=(c+s+4)%4)!==l)}else h.point(e[0],e[1])}function u(r,u){return fe(r[0]-n)<tu?u>0?0:3:fe(r[0]-i)<tu?u>0?2:1:fe(r[1]-t)<tu?u>0?1:0:u>0?3:2}function s(n,t){return o(n.x,t.x)}function o(n,t){var i=u(n,1),r=u(t,1);return i!==r?i-r:0===i?t[1]-n[1]:1===i?n[0]-t[0]:2===i?n[1]-t[1]:t[0]-n[0]}return function(u){function d(n,t){f(n,t)&&o.point(n,t)}function g(u,e){var s=f(u,e),h,b;(c&&p.push([u,e]),w)?(nt=u,tt=e,it=s,w=!1,s&&(o.lineStart(),o.point(u,e))):s&&l?o.point(u,e):(h=[a=Math.max(kn,Math.min(ak,a)),v=Math.max(kn,Math.min(ak,v))],b=[u=Math.max(kn,Math.min(ak,u)),e=Math.max(kn,Math.min(ak,e))],wkt(h,b,n,t,i,r)?(l||(o.lineStart(),o.point(h[0],h[1])),o.point(b[0],b[1]),s||o.lineEnd(),y=!1):s&&(o.lineStart(),o.point(u,e),y=!1));a=u;v=e;l=s}var h,c,p,nt,tt,it,a,v,l,w,y,o=u,b=fyt(),k={point:d,lineStart:function(){k.point=g;c&&c.push(p=[]);w=!0;l=!1;a=v=NaN},lineEnd:function(){h&&(g(nt,tt),it&&l&&b.rejoin(),h.push(b.result()));k.point=d;l&&o.lineEnd()},polygonStart:function(){o=b;h=[];c=[];y=!0},polygonEnd:function(){var t=function(){for(var o=0,s=0,a=c.length;s<a;++s)for(var u,t,h=c[s],l=1,v=h.length,f=h[0],e=f[0],i=f[1];l<v;++l)u=e,t=i,e=(f=h[l])[0],i=f[1],t<=r?i>r&&(e-u)*(r-t)>(i-t)*(n-u)&&++o:i<=r&&(e-u)*(r-t)<(i-t)*(n-u)&&--o;return o}(),i=y&&t,f=(h=syt(h)).length;(i||f)&&(u.polygonStart(),i&&(u.lineStart(),e(null,null,1,u),u.lineEnd()),f&&eyt(h,s,t,e,u),u.polygonEnd());o=u;h=c=p=null}};return k}}function ewt(n){return n.length>1}function owt(n,t){return((n=n.x)[0]<0?n[1]-rs-tu:rs-n[1])-((t=t.x)[0]<0?t[1]-rs-tu:rs-t[1])}function alt(n){return function(t){var i=new vrt;for(var r in n)i[r]=n[r];return i.stream=t,i}}function vrt(){}function vlt(n,t,i){var e=t[1][0]-t[0][0],o=t[1][1]-t[0][1],u=n.clipExtent&&n.clipExtent();n.scale(150).translate([0,0]);null!=u&&n.clipExtent(null);ykt(i,n.stream(cyt));var r=cyt.result(),f=Math.min(e/(r[1][0]-r[0][0]),o/(r[1][1]-r[0][1])),s=+t[0][0]+(e-f*(r[1][0]+r[0][0]))/2,h=+t[0][1]+(o-f*(r[1][1]+r[0][1]))/2;return null!=u&&n.clipExtent(u),n.scale(150*f).translate([s,h])}function swt(n){return function(n){function t(n){return n=c(n[0]*wf,n[1]*wf),[n[0]*i+e,o-n[1]*i]}function rt(n,t){return n=u(n,t),[n[0]*i+e,o-n[1]*i]}function r(){c=uyt(ut=elt(d,g,nt),u);var n=u(b,k);return e=p-n[0]*i,o=w+n[1]*i,f()}function f(){return s=y=null,t}var u,e,o,ut,c,l,a,v,s,y,i=150,p=480,w=250,b=0,k=0,d=0,g=0,nt=0,tt=null,ft=ayt,h=null,et=hyt,it=.5,ot=yyt(rt,it);return t.stream=function(n){return s&&y===n?s:s=dkt(ft(ut,ot(et(y=n))))},t.clipAngle=function(n){return arguments.length?(ft=+n?bkt(tt=n*wf,6*wf):(tt=null,ayt),f()):tt*lh},t.clipExtent=function(n){return arguments.length?(et=null==n?(h=l=a=v=null,hyt):fwt(h=+n[0][0],l=+n[0][1],a=+n[1][0],v=+n[1][1]),f()):null==h?null:[[h,l],[a,v]]},t.scale=function(n){return arguments.length?(i=+n,r()):i},t.translate=function(n){return arguments.length?(p=+n[0],w=+n[1],r()):[p,w]},t.center=function(n){return arguments.length?(b=n[0]%360*wf,k=n[1]%360*wf,r()):[b*lh,k*lh]},t.rotate=function(n){return arguments.length?(d=n[0]%360*wf,g=n[1]%360*wf,nt=n.length>2?n[2]%360*wf:0,r()):[d*lh,g*lh,nt*lh]},t.precision=function(n){return arguments.length?(ot=yyt(rt,it=n*n),f()):wn(it)},t.fitExtent=function(n,i){return vlt(t,n,i)},t.fitSize=function(n,i){return function(n,t,i){return vlt(n,[[0,0],t],i)}(t,n,i)},function(){return u=n.apply(this,arguments),t.invert=u.invert&&function(n){return(n=c.invert((n[0]-e)/i,(o-n[1])/i))&&[n[0]*lh,n[1]*lh]},r()}}(function(){return n})()}function ylt(n,t){return[n,nyt(tyt((rs+t)/2))]}function plt(n,t){return[nyt(tyt((rs+t)/2)),-n]}function og(n,t,i,r){var l=n.properties||{},u="Feature"===n.type?n.geometry:n,e,c,o,s,h;if("GeometryCollection"===u.type)return e=[],nh(n,function(n){var u=og(n,t,i,r);u&&e.push(u)}),d(e);o=hu(n);s=o[1]>50&&o[3]>50;c=s?{type:u.type,coordinates:blt(u.coordinates,dlt(u))}:ha(u);var a=(new nw).read(c),v=vy(ev(t,i),"meters"),f=bu.bufferOp(a,v);if(f=(new tw).write(f),!wlt(f.coordinates))return(h=s?{type:f.type,coordinates:klt(f.coordinates,dlt(u))}:hd(f)).geometry?h:fu(h,l)}function wlt(n){return Array.isArray(n[0])?wlt(n[0]):isNaN(n[0])}function blt(n,t){return"object"!=typeof n[0]?t(n):n.map(function(n){return blt(n,t)})}function klt(n,t){return"object"!=typeof n[0]?t.invert(n):n.map(function(n){return klt(n,t)})}function dlt(n){var t=rd(n).geometry.coordinates.reverse(),i=t.map(function(n){return-n});return pyt().center(t).rotate(i).scale(tf)}function yrt(){for(var i=new nw,n=i.read(JSON.stringify(arguments[0].geometry)),t=1;t<arguments.length;t++)n=aw.union(n,i.read(JSON.stringify(arguments[t].geometry)));return n=(new tw).write(n),{type:"Feature",geometry:n,properties:arguments[0].properties}}function fp(n,t){var i=no(n),r=no(t);if(hl(dy(r,{precision:4})).coordinates[0].length<4||hl(dy(i,{precision:4})).coordinates[0].length<4)return null;var u=new nw,e=u.read(dy(i)),o=u.read(dy(r)),f=tt.intersection(e,o);return f.isEmpty()?null:fu((new tw).write(f))}function hwt(n,t){return function(n,t,i){var u,r;if(!Array.isArray(t))throw new Error("Get closest expects an array as second argument");return t.forEach(function(t,f){var e=i(t,n);e>=0&&(void 0===r||e<r)&&(r=e,u=f)}),u}(n,t,function(n,t){return n-t})}function glt(n,t,i){var ft,f,h,e,et,ot,y,p;if(i=i||{},!v(i))throw new Error("options is invalid");var ht=i.properties||{},wt=i.triangles,u=i.mask;if(null===t||void 0===t)throw new Error("cellSide is required");if(!gi(t))throw new Error("cellSide is invalid");if(!n)throw new Error("bbox is required");if(!Array.isArray(n))throw new Error("bbox must be array");if(4!==n.length)throw new Error("bbox must contain 4 numbers");if(u&&-1===["Polygon","MultiPolygon"].indexOf(fr(u)))throw new Error("options.mask must be a (Multi)Polygon");var o=n[0],s=n[1],c=n[2],l=n[3],ct=(s+l)/2,lt=(o+c)/2,w=2*t/tr([o,ct],[c,ct],i)*(c-o),b=2*t/tr([lt,s],[lt,l],i)*(l-s),a=w/2,k=2*a,r=Math.sqrt(3)/2*b,at=c-o,g=l-s,nt=.75*k,bt=r,kt=(at-k)/(k-a/2),vt=Math.floor(kt),dt=(vt*nt-a/2-at)/2-a/2+nt/2,tt=Math.floor((g-r)/r),yt=(g-tt*r)/2,pt=tt*r-g>r/2;pt&&(yt-=r/4);for(var it=[],rt=[],ut=0;ut<6;ut++)ft=Math.PI/3*ut,it.push(Math.cos(ft)),rt.push(Math.sin(ft));for(f=[],h=0;h<=vt;h++)for(e=0;e<=tt;e++)et=h%2==1,0===e&&et||0===e&&pt||(ot=h*nt+o-dt,y=e*bt+s+yt,(et&&(y-=r/2),!0===wt)?function(n,t,i,r,u,f){for(var o,s=[],e=0;e<6;e++)o=[],o.push(n),o.push([n[0]+t*u[e],n[1]+i*f[e]]),o.push([n[0]+t*u[(e+1)%6],n[1]+i*f[(e+1)%6]]),o.push(n),s.push(st([o],r));return s}([ot,y],w/2,b/2,ht,it,rt).forEach(function(n){u?fp(u,n)&&f.push(n):f.push(n)}):(p=function(n,t,i,r,u,f){for(var s,h,e=[],o=0;o<6;o++)s=n[0]+t*u[o],h=n[1]+i*f[o],e.push([s,h]);return e.push(e[0].slice()),st([e],r)}([ot,y],w/2,b/2,ht,it,rt),u?fp(u,p)&&f.push(p):f.push(p)));return d(f)}function nat(n){if(n.features.length<=1)return n;var t=function(n){var t=ep(),i=[];return su(n,function(n,t){var r=hu(n);i.push({minX:r[0],minY:r[1],maxX:r[2],maxY:r[3],geojson:n,index:t})}),t.load(i),t}(n),r=[],i={};return su(n,function(n,u){var f,e,o;if(i[u])return!0;for(t.remove({index:u},tat),i[u]=!0;;)if(f=hu(n),e=t.search({minX:f[0],minY:f[1],maxX:f[2],maxY:f[3]}),e.length>0&&(o=e.map(function(n){return i[n.index]=!0,t.remove({index:n.index},tat),n.geojson}),o.push(n),n=yrt.apply(this,o)),0===e.length)break;r.push(n)}),d(r)}function tat(n,t){return n.index===t.index}function iat(n,t,i){var r,p,c;if(i=i||{},!v(i))throw new Error("options is invalid");var tt=i.properties,h=i.mask,l=[];if(null===t||void 0===t)throw new Error("cellSide is required");if(!gi(t))throw new Error("cellSide is invalid");if(!n)throw new Error("bbox is required");if(!Array.isArray(n))throw new Error("bbox must be array");if(4!==n.length)throw new Error("bbox must contain 4 numbers");if(h&&-1===["Polygon","MultiPolygon"].indexOf(fr(h)))throw new Error("options.mask must be a (Multi)Polygon");for(var u=n[0],f=n[1],a=n[2],y=n[3],o=t/tr([u,f],[a,f],i)*(a-u),s=t/tr([u,f],[u,y],i)*(y-f),w=a-u,b=y-f,k=Math.floor(w/o),g=Math.floor(b/s),it=(b-g*s)/2,e=u+(w-k*o)/2,nt=0;nt<k;nt++){for(r=f+it,p=0;p<g;p++)c=st([[[e,r],[e,r+s],[e+o,r+s],[e+o,r],[e,r]]],tt),h?fp(h,c)&&l.push(c):l.push(c),r+=s;e+=o}return d(l)}function rat(n,t,i){var c,r,s,h;if(i=i||{},!v(i))throw new Error("options is invalid");var o=i.properties,l=i.mask,a=[];if(null===t||void 0===t)throw new Error("cellSide is required");if(!gi(t))throw new Error("cellSide is invalid");if(!n)throw new Error("bbox is required");if(!Array.isArray(n))throw new Error("bbox must be array");if(4!==n.length)throw new Error("bbox must contain 4 numbers");if(l&&-1===["Polygon","MultiPolygon"].indexOf(fr(l)))throw new Error("options.mask must be a (Multi)Polygon");for(var e=t/tr([n[0],n[1]],[n[2],n[1]],i)*(n[2]-n[0]),f=t/tr([n[0],n[1]],[n[0],n[3]],i)*(n[3]-n[1]),y=0,u=n[0];u<=n[2];){for(c=0,r=n[1];r<=n[3];)s=null,h=null,y%2==0&&c%2==0?(s=st([[[u,r],[u,r+f],[u+e,r],[u,r]]],o),h=st([[[u,r+f],[u+e,r+f],[u+e,r],[u,r+f]]],o)):y%2==0&&c%2==1?(s=st([[[u,r],[u+e,r+f],[u+e,r],[u,r]]],o),h=st([[[u,r],[u,r+f],[u+e,r+f],[u,r]]],o)):c%2==0&&y%2==1?(s=st([[[u,r],[u,r+f],[u+e,r+f],[u,r]]],o),h=st([[[u,r],[u+e,r+f],[u+e,r],[u,r]]],o)):c%2==1&&y%2==1&&(s=st([[[u,r],[u,r+f],[u+e,r],[u,r]]],o),h=st([[[u,r+f],[u+e,r+f],[u+e,r],[u,r+f]]],o)),l?(fp(l,s)&&a.push(s),fp(l,h)&&a.push(h)):(a.push(s),a.push(h)),r+=f,c++;y++;u+=e}return d(a)}var tf=6371008.8,sg={meters:tf,metres:tf,millimeters:1e3*tf,millimetres:1e3*tf,centimeters:100*tf,centimetres:100*tf,kilometers:tf/1e3,kilometres:tf/1e3,miles:tf/1609.344,nauticalmiles:tf/1852,inches:39.37*tf,yards:tf/1.0936,feet:3.28084*tf,radians:1,degrees:tf/111325},uat={meters:1,metres:1,millimeters:1e3,millimetres:1e3,centimeters:100,centimetres:100,kilometers:.001,kilometres:.001,miles:1/1609.344,nauticalmiles:1/1852,inches:39.37,yards:1/1.0936,feet:3.28084,radians:1/tf,degrees:1/111325},hg={meters:1,metres:1,millimeters:1e6,millimetres:1e6,centimeters:1e4,centimetres:1e4,kilometers:1e-6,kilometres:1e-6,acres:.000247105,miles:386e-9,yards:1.195990046,feet:10.763910417,inches:1550.003100006},cwt=Object.freeze({earthRadius:tf,factors:sg,unitsFactors:uat,areaFactors:hg,feature:fu,geometry:vft,point:wi,points:yft,polygon:st,polygons:pft,lineString:ur,lineStrings:wft,featureCollection:d,multiLineString:fa,multiPoint:yk,multiPolygon:ay,geometryCollection:ntt,round:bft,radiansToLength:vy,lengthToRadians:ev,lengthToDegrees:pk,bearingToAzimuth:ea,radiansToDegrees:oa,degreesToRadians:yu,convertLength:ov,convertArea:kft,isNumber:gi,isObject:v,validateBBox:yy,validateId:wk,radians2degrees:function(){throw new Error("method has been renamed to `radiansToDegrees`");},degrees2radians:function(){throw new Error("method has been renamed to `degreesToRadians`");},distanceToDegrees:function(){throw new Error("method has been renamed to `lengthToDegrees`");},distanceToRadians:function(){throw new Error("method has been renamed to `lengthToRadians`");},radiansToDistance:function(){throw new Error("method has been renamed to `radiansToLength`");},bearingToAngle:function(){throw new Error("method has been renamed to `bearingToAzimuth`");},convertDistance:function(){throw new Error("method has been renamed to `convertLength`");}}),lwt=Object.freeze({coordEach:pu,coordReduce:bk,propEach:ttt,propReduce:dft,featureEach:nr,featureReduce:itt,coordAll:ec,geomEach:nh,geomReduce:rtt,flattenEach:su,flattenReduce:gft,segmentEach:ol,segmentReduce:utt,lineEach:ftt,lineReduce:ett}),awt=Object.freeze({getCoord:cr,getCoords:p,containsNumber:kk,geojsonType:net,featureOf:yw,collectionOf:ah,getGeom:no,getGeomType:tet,getType:fr}),fat={successCallback:null,verbose:!1},cg={},vwt=uet,ep=dk,brt,vat,krt,pg,wg,drt,s,wh,al,ye,out,oe,hut,ca,lc,pv,r,hp,es,os,cp,u,lo,ne,lut,ot,lp,ao,l,aut,ss,nk,vr,la,vl,aa,cs,o,va,bh,b,th,nn,ih,ro,kh,wv,bv,kv,dv,eu,hvt,gv,vo,yp,ny,ya,cvt,pp,ik,yl,yi,yo,ls,po,rk,uo,rn,kr,wr,wp,se,pc,kp,dp,gp,dr,yut,rh,fn,as,en,ut,wut,avt,uk,tw,f,fk,vs,nc,ek,hf,or,di,iu,ok,ys,ir,iw,uf,on,ty,yr,he,iy,ko,tc,bc,wa,ou,but,go,ru,lu,sk,vvt,ry,kc,cf,ba,fh,rw,gr,a,kut,uw,le,ps,pl,fw,br,ew,we,gut,et,ka,hr,ow,ie,da,nft,wl,pi,eo,uy,eh,be,ff,ns,kl,ke,ws,oh,dl,ic,wu,tft,hk,lf,gc,bs,ift,re,rft,sw,fy,uft,fft,ga,sh,bu,ey,af,hh,gl,sn,nv,nl,rc,ku,ts,vf,eft,tl,tv,du,ef,ks,oo,hn,iv,il,ae,cn,gu,ln,ds,au,is,na,rv,gs,uv,ue,ch,nu,oft,sft,yf,rl,an,fv,ul,vu,pf,hw,ve,vn,ck,nf,cw,oy,sy,yn,hy,ta,lw,cy,ia,tt,fl,ly,ra,de,hft,ge,uu,cft,aw,ua,pyt;dk.prototype={all:function(){return this._all(this.data,[])},search:function(n){var t=this.data,r=[],s=this.toBBox,u,e,i,o,f;if(!nd(n,t))return r;for(f=[];t;){for(u=0,e=t.children.length;u<e;u++)i=t.children[u],nd(n,o=t.leaf?s(i):i)&&(t.leaf?r.push(i):htt(n,o)?this._all(i,r):f.push(i));t=f.pop()}return r},collides:function(n){var t=this.data,o=this.toBBox,i,e,r,u,f;if(!nd(n,t))return!1;for(f=[];t;){for(i=0,e=t.children.length;i<e;i++)if(r=t.children[i],u=t.leaf?o(r):r,nd(n,u)){if(t.leaf||htt(n,u))return!0;f.push(r)}t=f.pop()}return!1},load:function(n){var i,r,t,u;if(!n||!n.length)return this;if(n.length<this._minEntries){for(i=0,r=n.length;i<r;i++)this.insert(n[i]);return this}return t=this._build(n.slice(),0,n.length-1,0),this.data.children.length?this.data.height===t.height?this._splitRoot(this.data,t):(this.data.height<t.height&&(u=this.data,this.data=t,t=u),this._insert(t,this.data.height-t.height-1,!0)):this.data=t,this},insert:function(n){return n&&this._insert(n,this.data.height-1),this},clear:function(){return this.data=wy([]),this},remove:function(n,t){if(!n)return this;for(var u,f,o,e,i=this.data,h=this.toBBox(n),r=[],s=[];i||r.length;){if(i||(i=r.pop(),f=r[r.length-1],u=s.pop(),e=!0),i.leaf&&-1!==(o=function(n,t,i){if(!i)return t.indexOf(n);for(var r=0;r<t.length;r++)if(i(n,t[r]))return r;return-1}(n,i.children,t)))return i.children.splice(o,1),r.push(i),this._condense(r),this;e||i.leaf||!htt(i,h)?f?(u++,i=f.children[u],e=!1):i=null:(r.push(i),s.push(u),u=0,f=i,i=i.children[0])}return this},toBBox:function(n){return n},compareMinX:fet,compareMinY:eet,toJSON:function(){return this.data},fromJSON:function(n){return this.data=n,this},_all:function(n,t){for(var i=[];n;)n.leaf?t.push.apply(t,n.children):i.push.apply(i,n.children),n=i.pop();return t},_build:function(n,t,i,r){var u,h=i-t+1,f=this._maxEntries,e,o,l,a,s,c;if(h<=f)return u=wy(n.slice(t,i+1)),py(u,this.toBBox),u;for(r||(r=Math.ceil(Math.log(h)/Math.log(f)),f=Math.ceil(h/Math.pow(f,r-1))),(u=wy([])).leaf=!1,u.height=r,s=Math.ceil(h/f),c=s*Math.ceil(Math.sqrt(f)),oet(n,t,i,c,this.compareMinX),e=t;e<=i;e+=c)for(oet(n,e,l=Math.min(e+c-1,i),s,this.compareMinY),o=e;o<=l;o+=s)a=Math.min(o+s-1,l),u.children.push(this._build(n,o,a,r-1));return py(u,this.toBBox),u},_chooseSubtree:function(n,t,i,r){for(var e,l,o,h,u,c,f,s;r.push(t),!t.leaf&&r.length-1!==i;){for(f=s=1/0,e=0,l=t.children.length;e<l;e++)u=stt(o=t.children[e]),(c=function(n,t){return(Math.max(t.maxX,n.maxX)-Math.min(t.minX,n.minX))*(Math.max(t.maxY,n.maxY)-Math.min(t.minY,n.minY))}(n,o)-u)<s?(s=c,f=u<f?u:f,h=o):c===s&&u<f&&(f=u,h=o);t=h||t.children[0]}return t},_insert:function(n,t,i){var e=this.toBBox,u=i?n:e(n),r=[],f=this._chooseSubtree(u,this.data,t,r);for(f.children.push(n),bw(f,u);t>=0&&r[t].children.length>this._maxEntries;)this._split(r,t),t--;this._adjustParentBBoxes(u,r,t)},_split:function(n,t){var i=n[t],f=i.children.length,e=this._minEntries,u,r;this._chooseSplitAxis(i,e,f);u=this._chooseSplitIndex(i,e,f);r=wy(i.children.splice(u,i.children.length-u));r.height=i.height;r.leaf=i.leaf;py(i,this.toBBox);py(r,this.toBBox);t?n[t-1].children.push(r):this._splitRoot(i,r)},_splitRoot:function(n,t){this.data=wy([n,t]);this.data.height=n.height+1;this.data.leaf=!1;py(this.data,this.toBBox)},_chooseSplitIndex:function(n,t,i){for(var h,c,e,f,u,s,o=u=1/0,r=t;r<=i-t;r++)e=function(n,t){var i=Math.max(n.minX,t.minX),r=Math.max(n.minY,t.minY),u=Math.min(n.maxX,t.maxX),f=Math.min(n.maxY,t.maxY);return Math.max(0,u-i)*Math.max(0,f-r)}(h=ww(n,0,r,this.toBBox),c=ww(n,r,i,this.toBBox)),f=stt(h)+stt(c),e<o?(o=e,s=r,u=f<u?f:u):e===o&&f<u&&(u=f,s=r);return s},_chooseSplitAxis:function(n,t,i){var r=n.leaf?this.compareMinX:fet,u=n.leaf?this.compareMinY:eet;this._allDistMargin(n,t,i,r)<this._allDistMargin(n,t,i,u)&&n.children.sort(r)},_allDistMargin:function(n,t,i,r){n.children.sort(r);for(var f,e=this.toBBox,o=ww(n,0,t,e),s=ww(n,i-t,i,e),h=gk(o)+gk(s),u=t;u<i-t;u++)f=n.children[u],bw(o,n.leaf?e(f):f),h+=gk(o);for(u=i-t-1;u>=t;u--)f=n.children[u],bw(s,n.leaf?e(f):f),h+=gk(s);return h},_adjustParentBBoxes:function(n,t,i){for(var r=i;r>=0;r--)bw(t[r],n)},_condense:function(n){for(var i,t=n.length-1;t>=0;t--)0===n[t].children.length?t>0?(i=n[t-1].children).splice(i.indexOf(n[t]),1):this.clear():py(n[t],this.toBBox)},_initFormat:function(n){var t=["return a"," - b",";"];this.compareMinX=new Function("a","b",t.join(n[0]));this.compareMinY=new Function("a","b",t.join(n[1]));this.toBBox=new Function("a","return {minX: a"+n[0]+", minY: a"+n[1]+", maxX: a"+n[2]+", maxY: a"+n[3]+"};")}};var lg=function(n,t,i){var r=n*t,e=eat*n,u=e-(e-n),o=n-u,s=eat*t,f=s-(s-t),h=t-f,c=o*h-(r-u*f-o*f-u*h);return i?(i[0]=c,i[1]=r,i):[c,r]},eat=+(Math.pow(2,27)+1),ywt=function(n,t){var s=0|n.length,h=0|t.length;if(1===s&&1===h)return function(n,t){var i=n+t,r=i-n,u=n-(i-r)+(t-r);return u?[u,i]:[i]}(n[0],t[0]);var r,o,tt=s+h,v=new Array(tt),y=0,u=0,f=0,p=Math.abs,c=n[u],k=p(c),l=t[f],d=p(l);k<d?(o=c,(u+=1)<s&&(k=p(c=n[u]))):(o=l,(f+=1)<h&&(d=p(l=t[f])));u<s&&k<d||f>=h?(r=c,(u+=1)<s&&(k=p(c=n[u]))):(r=l,(f+=1)<h&&(d=p(l=t[f])));for(var a,g,e=r+o,nt=e-r,b=o-nt,w=b,i=e;u<s&&f<h;)k<d?(r=c,(u+=1)<s&&(k=p(c=n[u]))):(r=l,(f+=1)<h&&(d=p(l=t[f]))),(b=(o=w)-(nt=(e=r+o)-r))&&(v[y++]=b),w=i-((a=i+e)-(g=a-i))+(e-g),i=a;for(;u<s;)(b=(o=w)-(nt=(e=(r=c)+o)-r))&&(v[y++]=b),w=i-((a=i+e)-(g=a-i))+(e-g),i=a,(u+=1)<s&&(c=n[u]);for(;f<h;)(b=(o=w)-(nt=(e=(r=l)+o)-r))&&(v[y++]=b),w=i-((a=i+e)-(g=a-i))+(e-g),i=a,(f+=1)<h&&(l=t[f]);return w&&(v[y++]=w),i&&(v[y++]=i),y||(v[y++]=0),v.length=y,v},pwt=function(n,t,i){var r=n+t,u=r-n,f=t-u,e=n-(r-u);return i?(i[0]=e+f,i[1]=r,i):[e+f,r]},wwt=function(n,t){var o=n.length,f,e,h;if(1===o)return f=lg(n[0],t),f[0]?f:[f[1]];var r=new Array(2*o),i=[.1,.1],s=[.1,.1],u=0;for(lg(n[0],t,i),i[0]&&(r[u++]=i[0]),e=1;e<o;++e){lg(n[e],t,s);h=i[1];pwt(h,s[0],i);i[0]&&(r[u++]=i[0]);var c=s[1],l=i[1],a=c+l,v=l-(a-c);i[1]=a;v&&(r[u++]=v)}return i[1]&&(r[u++]=i[1]),0===u&&(r[u++]=0),r.length=u,r},bwt=function(n,t){var s=0|n.length,h=0|t.length;if(1===s&&1===h)return function(n,t){var i=n+t,r=i-n,u=n-(i-r)+(t-r);return u?[u,i]:[i]}(n[0],-t[0]);var r,o,tt=s+h,v=new Array(tt),y=0,u=0,f=0,p=Math.abs,c=n[u],k=p(c),l=-t[f],d=p(l);k<d?(o=c,(u+=1)<s&&(k=p(c=n[u]))):(o=l,(f+=1)<h&&(d=p(l=-t[f])));u<s&&k<d||f>=h?(r=c,(u+=1)<s&&(k=p(c=n[u]))):(r=l,(f+=1)<h&&(d=p(l=-t[f])));for(var a,g,e=r+o,nt=e-r,b=o-nt,w=b,i=e;u<s&&f<h;)k<d?(r=c,(u+=1)<s&&(k=p(c=n[u]))):(r=l,(f+=1)<h&&(d=p(l=-t[f]))),(b=(o=w)-(nt=(e=r+o)-r))&&(v[y++]=b),w=i-((a=i+e)-(g=a-i))+(e-g),i=a;for(;u<s;)(b=(o=w)-(nt=(e=(r=c)+o)-r))&&(v[y++]=b),w=i-((a=i+e)-(g=a-i))+(e-g),i=a,(u+=1)<s&&(c=n[u]);for(;f<h;)(b=(o=w)-(nt=(e=(r=l)+o)-r))&&(v[y++]=b),w=i-((a=i+e)-(g=a-i))+(e-g),i=a,(f+=1)<h&&(l=-t[f]);return w&&(v[y++]=w),i&&(v[y++]=i),y||(v[y++]=0),v.length=y,v},oat=sl(function(n){function f(n,t){for(var u=new Array(n.length-1),i=1;i<n.length;++i)for(var f=u[i-1]=new Array(n.length-1),r=0,e=0;r<n.length;++r)r!==t&&(f[e++]=n[i][r]);return u}function o(n){return 1&n?"-":""}function i(n){if(1===n.length)return n[0];if(2===n.length)return["sum(",n[0],",",n[1],")"].join("");var t=n.length>>1;return["sum(",i(n.slice(0,t)),",",i(n.slice(t)),")"].join("")}function e(n){if(2===n.length)return[["sum(prod(",n[0][0],",",n[1][1],"),prod(-",n[0][1],",",n[1][0],"))"].join("")];for(var r=[],t=0;t<n.length;++t)r.push(["scale(",i(e(f(n,t))),",",o(t),n[0][t],")"].join(""));return r}function r(n){for(var r=[],u=[],o=function(n){for(var i,r=new Array(n),t=0;t<n;++t)for(r[t]=new Array(n),i=0;i<n;++i)r[t][i]=["m",i,"[",n-t-1,"]"].join("");return r}(n),s=[],t=0;t<n;++t)0==(1&t)?r.push.apply(r,e(f(o,t))):u.push.apply(u,e(f(o,t))),s.push("m"+t);var c=i(r),l=i(u),h="orientation"+n+"Exact",a=["function ",h,"(",s.join(),"){var p=",c,",n=",l,",d=sub(p,n);return d[d.length-1];};return ",h].join("");return new Function("sum","prod","scale","sub",a)(ywt,lg,wwt,bwt)}var u=5,s=r(3),h=r(4),t=[function(){return 0},function(){return 0},function(n,t){return t[0]-n[0]},function(n,t,i){var e,r=(n[1]-i[1])*(t[0]-i[0]),u=(n[0]-i[0])*(t[1]-i[1]),f=r-u,o;if(r>0){if(u<=0)return f;e=r+u}else{if(!(r<0)||u>=0)return f;e=-(r+u)}return o=33306690738754716e-32*e,f>=o||f<=-o?f:s(n,t,i)},function(n,t,i,r){var f=n[0]-r[0],e=t[0]-r[0],o=i[0]-r[0],s=n[1]-r[1],c=t[1]-r[1],l=i[1]-r[1],a=n[2]-r[2],v=t[2]-r[2],y=i[2]-r[2],p=e*l,w=o*c,b=o*s,k=f*l,d=f*c,g=e*s,u=a*(p-w)+v*(b-k)+y*(d-g),nt=77715611723761027e-32*((Math.abs(p)+Math.abs(w))*Math.abs(a)+(Math.abs(b)+Math.abs(k))*Math.abs(v)+(Math.abs(d)+Math.abs(g))*Math.abs(y));return u>nt||-u>nt?u:h(n,t,i,r)}];!function(){for(var f,s;t.length<=u;)t.push(r(t.length));for(var e=[],o=["slow"],i=0;i<=u;++i)e.push("a"+i),o.push("o"+i);for(f=["function getOrientation(",e.join(),"){switch(arguments.length){case 0:case 1:return 0;"],i=2;i<=u;++i)f.push("case ",i,":return o",i,"(",e.slice(0,i).join(),");");for(f.push("}var s=new Array(arguments.length);for(var i=0;i<arguments.length;++i){s[i]=arguments[i]};return slow(s);}return getOrientation"),o.push(f.join("")),s=Function.apply(void 0,o),n.exports=s.apply(void 0,[function(n){var i=t[n.length];return i||(i=t[n.length]=r(n.length)),i.apply(void 0,n)}].concat(t)),i=0;i<=u;++i)n.exports[i]=t[i]}()}),kwt=function(n){var e=n.length,o,t,f,i,r,c,a,s;if(e<3){for(o=new Array(e),t=0;t<e;++t)o[t]=t;return 2===e&&n[0][0]===n[1][0]&&n[0][1]===n[1][1]?[0]:o}for(f=new Array(e),t=0;t<e;++t)f[t]=t;for(f.sort(function(t,i){var r=n[t][0]-n[i][0];return r||n[t][1]-n[i][1]}),i=[f[0],f[1]],r=[f[0],f[1]],t=2;t<e;++t){for(var h=f[t],l=n[h],u=i.length;u>1&&sat(n[i[u-2]],n[i[u-1]],l)<=0;)u-=1,i.pop();for(i.push(h),u=r.length;u>1&&sat(n[r[u-2]],n[r[u-1]],l)>=0;)u-=1,r.pop();r.push(h)}for(o=new Array(r.length+i.length-2),c=0,a=(t=0,i.length);t<a;++t)o[c++]=i[t];for(s=r.length-2;s>0;--s)o[c++]=r[s];return o},sat=oat[3],hat=kw,dwt=kw;kw.prototype={push:function(n){this.data.push(n);this.length++;this._up(this.length-1)},pop:function(){if(0!==this.length){var n=this.data[0];return this.length--,this.length>0&&(this.data[0]=this.data[this.length],this._down(0)),this.data.pop(),n}},peek:function(){return this.data[0]},_up:function(n){for(var i,r,t=this.data,f=this.compare,u=t[n];n>0;){if(i=n-1>>1,r=t[i],f(u,r)>=0)break;t[n]=r;n=i}t[n]=u},_down:function(n){for(var t=this.data,f=this.compare,o=this.length>>1,e=t[n];n<o;){var i=1+(n<<1),r=i+1,u=t[i];if(r<this.length&&f(t[r],u)<0&&(i=r,u=t[r]),f(u,e)>=0)break;t[n]=u;n=i}t[n]=e}};hat.default=dwt;var gwt=function(n,t){for(var h=n[0],r=n[1],u=!1,i=0,f=t.length-1;i<t.length;f=i++){var o=t[i][0],e=t[i][1],c=t[f][0],s=t[f][1];e>r!=s>r&&h<(c-o)*(r-e)/(s-e)+o&&(u=!u)}return u},ag=oat[3],cat=set,nbt=set;cat.default=nbt;var tbt=function(n){return n},ibt=function(n){if(null==n)return tbt;var t,i,r=n.scale[0],u=n.scale[1],f=n.translate[0],e=n.translate[1];return function(n,o){o||(t=i=0);var s=2,c=n.length,h=new Array(c);for(h[0]=(t+=n[0])*r+f,h[1]=(i+=n[1])*u+e;s<c;)h[s]=n[s],++s;return h}},rbt=function(n,t){for(var u,i=n.length,r=i-t;r<--i;)u=n[r],n[r++]=n[i],n[i]=u},ubt=function(n,t){function f(n,t){var r,i;for(r in n)i=n[r],delete t[i.start],delete i.start,delete i.end,i.forEach(function(n){e[n<0?~n:n]=1}),u.push(i)}var e={},i={},r={},u=[],o=-1;return t.forEach(function(i,r){var f,u=n.arcs[i<0?~i:i];u.length<3&&!u[1][0]&&!u[1][1]&&(f=t[++o],t[o]=i,t[r]=f)}),t.forEach(function(t){var u,f,c=function(t){var i,r=n.arcs[t<0?~t:t],u=r[0];return n.transform?(i=[0,0],r.forEach(function(n){i[0]+=n[0];i[1]+=n[1]})):i=r[r.length-1],t<0?[i,u]:[u,i]}(t),e=c[0],o=c[1],s,h;(u=r[e])?(delete r[u.end],u.push(t),u.end=o,f=i[o])?(delete i[f.start],s=f===u?u:u.concat(f),i[s.start=u.start]=r[s.end=f.end]=s):i[u.start]=r[u.end]=u:(u=i[o])?(delete i[u.start],u.unshift(t),u.start=e,f=r[e])?(delete r[f.end],h=f===u?u:f.concat(u),i[h.start=f.start]=r[h.end=u.end]=h):i[u.start]=r[u.end]=u:i[(u=[t]).start=e]=r[u.end=o]=u}),f(r,i),f(i,r),t.forEach(function(n){e[n<0?~n:n]||u.push([n])}),u},fbt=function(n){return get(n,npt.apply(this,arguments))},prt=function(n,t,i,r,u,f){3===arguments.length&&(r=f=Array,u=null);for(var e=new r(n=1<<Math.max(4,Math.ceil(Math.log(n)/Math.LN2))),s=new f(n),o=n-1,h=0;h<n;++h)e[h]=u;return{set:function(r,f){for(var h=t(r)&o,c=e[h],l=0;c!=u;){if(i(c,r))return s[h]=f;if(++l>=n)throw new Error("full hashmap");c=e[h=h+1&o]}return e[h]=r,s[h]=f,f},maybeSet:function(r,f){for(var h=t(r)&o,c=e[h],l=0;c!=u;){if(i(c,r))return s[h];if(++l>=n)throw new Error("full hashmap");c=e[h=h+1&o]}return e[h]=r,s[h]=f,f},get:function(r,f){for(var h=t(r)&o,c=e[h],l=0;c!=u;){if(i(c,r))return s[h];if(++l>=n)break;c=e[h=h+1&o]}return f},keys:function(){for(var t,i=[],n=0,r=e.length;n<r;++n)t=e[n],t!=u&&i.push(t);return i}}},av=function(n,t){return n[0]===t[0]&&n[1]===t[1]},lat=new ArrayBuffer(16),aat=new Float64Array(lat),vg=new Uint32Array(lat),wrt=function(n){aat[0]=n[0];aat[1]=n[1];var t=vg[0]^vg[1];return 2147483647&(t=t<<5^t>>7^vg[2]^vg[3])},ebt=function(n){function y(n,t,i,r){var u,f;o[i]!==n&&(o[i]=n,u=s[i],u>=0?(f=h[i],u===t&&f===r||u===r&&f===t||(++l,c[i]=1)):(s[i]=t,h[i]=r))}function tt(n){return wrt(i[n])}function it(n,t){return av(i[n],i[t])}for(var f,e,i=n.coordinates,w=n.lines,b=n.rings,u=function(){for(var r=prt(1.4*i.length,tt,it,Int32Array,-1,Int32Array),t=new Int32Array(i.length),n=0,u=i.length;n<u;++n)t[n]=r.maybeSet(n,n);return t}(),o=new Int32Array(i.length),s=new Int32Array(i.length),h=new Int32Array(i.length),c=new Int8Array(i.length),l=0,nt,p,t=0,r=i.length;t<r;++t)o[t]=s[t]=h[t]=-1;for(t=0,r=w.length;t<r;++t){var k=w[t],a=k[0],rt=k[1];for(f=u[a],e=u[++a],++l,c[f]=1;++a<=rt;)y(t,f,f=e,e=u[a]);++l;c[e]=1}for(t=0,r=i.length;t<r;++t)o[t]=-1;for(t=0,r=b.length;t<r;++t){var d=b[t],v=d[0]+1,g=d[1];for(y(t,u[g-1],f=u[v-1],e=u[v]);++v<=g;)y(t,f,f=e,e=u[v])}for(o=s=h=null,p=function(n,t,i,r,u){3===arguments.length&&(r=Array,u=null);for(var f=new r(n=1<<Math.max(4,Math.ceil(Math.log(n)/Math.LN2))),e=n-1,o=0;o<n;++o)f[o]=u;return{add:function(r){for(var o=t(r)&e,s=f[o],h=0;s!=u;){if(i(s,r))return!0;if(++h>=n)throw new Error("full hashset");s=f[o=o+1&e]}return f[o]=r,!0},has:function(r){for(var o=t(r)&e,s=f[o],h=0;s!=u;){if(i(s,r))return!0;if(++h>=n)break;s=f[o=o+1&e]}return!1},values:function(){for(var t,i=[],n=0,r=f.length;n<r;++n)t=f[n],t!=u&&i.push(t);return i}}}(1.4*l,wrt,av),t=0,r=i.length;t<r;++t)c[nt=u[t]]&&p.add(i[nt]);return p},obt=function(n){for(var o,l=ebt(n),i=n.coordinates,a=n.lines,v=n.rings,t=0,s=a.length;t<s;++t)for(var r=a[t],h=r[0],p=r[1];++h<p;)l.has(i[h])&&(o={0:h,1:r[1]},r[1]=h,r=r.next=o);for(t=0,s=v.length;t<s;++t)for(var u=v[t],e=u[0],f=e,c=u[1],y=l.has(i[e]);++f<c;)l.has(i[f])&&(y?(o={0:f,1:u[1]},u[1]=f,u=u.next=o):(!function(n,t,i,r){ptt(n,t,i);ptt(n,t,t+r);ptt(n,t+r,i)}(i,e,c,c-f),i[c]=i[e],y=!0,f=e));return n},sbt=function(n){function a(n){var h,c,r,e,u,o,t,s;if(r=f.get(h=i[n[0]]))for(t=0,s=r.length;t<s;++t)if(e=r[t],function(n,t){var r=n[0],u=t[0],f=n[1],e=t[1];if(r-f!=u-e)return!1;for(;r<=f;++r,++u)if(!av(i[r],i[u]))return!1;return!0}(e,n))return n[0]=e[0],void(n[1]=e[1]);if(u=f.get(c=i[n[1]]))for(t=0,s=u.length;t<s;++t)if(o=u[t],function(n,t){var r=n[0],e=t[0],f=n[1],u=t[1];if(r-f!=e-u)return!1;for(;r<=f;++r,--u)if(!av(i[r],i[u]))return!1;return!0}(o,n))return n[1]=o[0],void(n[0]=o[1]);r?r.push(n):f.set(h,[n]);u?u.push(n):f.set(c,[n]);l.push(n)}function v(n,t){var f=n[0],e=t[0],r=n[1]-f;if(r!==t[1]-e)return!1;for(var s=o(n),h=o(t),u=0;u<r;++u)if(!av(i[f+(u+s)%r],i[e+(u+h)%r]))return!1;return!0}function y(n,t){var f=n[0],s=t[0],h=n[1],e=t[1],r=h-f;if(r!==e-s)return!1;for(var c=o(n),l=r-o(t),u=0;u<r;++u)if(!av(i[f+(u+c)%r],i[e-(u+l)%r]))return!1;return!0}function o(n){for(var r,f=n[0],o=n[1],t=f,e=t,u=i[t];++t<o;)r=i[t],(r[0]<u[0]||r[0]===u[0]&&r[1]<u[1])&&(e=t,u=r);return e-f}var e,r,t,u,i=n.coordinates,s=n.lines,h=n.rings,c=s.length+h.length,f,l;for(delete n.lines,delete n.rings,t=0,u=s.length;t<u;++t)for(e=s[t];e=e.next;)++c;for(t=0,u=h.length;t<u;++t)for(r=h[t];r=r.next;)++c;for(f=prt(2*c*1.4,wrt,av),l=n.arcs=[],t=0,u=s.length;t<u;++t){e=s[t];do a(e);while(e=e.next)}for(t=0,u=h.length;t<u;++t)if((r=h[t]).next){do a(r);while(r=r.next)}else!function(n){var s,r,t,u,e;if(r=f.get(s=i[n[0]]))for(u=0,e=r.length;u<e;++u){if(t=r[u],v(t,n))return n[0]=t[0],void(n[1]=t[1]);if(y(t,n))return n[0]=t[1],void(n[1]=t[0])}if(r=f.get(s=i[n[0]+o(n)]))for(u=0,e=r.length;u<e;++u){if(t=r[u],v(t,n))return n[0]=t[0],void(n[1]=t[1]);if(y(t,n))return n[0]=t[1],void(n[1]=t[0])}r?r.push(n):f.set(s,[n]);l.push(n)}(r);return n},hbt=function(n,t){function e(n){n&&f.hasOwnProperty(n.type)&&f[n.type](n)}function r(n){var i=[],t;do t=h.get(n),i.push(n[0]<n[1]?t:~t);while(n=n.next);return i}function l(n){return n.map(r)}var u=function(n){function o(n){null!=n&&s.hasOwnProperty(n.type)&&s[n.type](n)}function e(n){var t=n[0],e=n[1];t<i&&(i=t);t>u&&(u=t);e<r&&(r=e);e>f&&(f=e)}function t(n){n.forEach(e)}function h(n){n.forEach(t)}var i=1/0,r=1/0,u=-1/0,f=-1/0,s={GeometryCollection:function(n){n.geometries.forEach(o)},Point:function(n){e(n.coordinates)},MultiPoint:function(n){n.coordinates.forEach(e)},LineString:function(n){t(n.arcs)},MultiLineString:function(n){n.arcs.forEach(t)},Polygon:function(n){n.arcs.forEach(t)},MultiPolygon:function(n){n.arcs.forEach(h)}};for(var c in n)o(n[c]);if(u>=i&&f>=r)return[i,r,u,f]}(n=function(n){var t,i={};for(t in n)i[t]=tpt(n[t]);return i}(n)),o=t>0&&u&&function(n,t,i){function o(n){return[Math.round((n[0]-r)*f),Math.round((n[1]-u)*e)]}function s(n,t){for(var s,l,a,h,c,v=-1,o=0,y=n.length,i=new Array(y);++v<y;)s=n[v],h=Math.round((s[0]-r)*f),c=Math.round((s[1]-u)*e),h===l&&c===a||(i[o++]=[l=h,a=c]);for(i.length=o;o<t;)o=i.push([i[0][0],i[0][1]]);return i}function h(n){return s(n,2)}function p(n){return s(n,4)}function c(n){return n.map(p)}function l(n){null!=n&&y.hasOwnProperty(n.type)&&y[n.type](n)}var r=t[0],u=t[1],a=t[2],v=t[3],f=a-r?(i-1)/(a-r):1,e=v-u?(i-1)/(v-u):1,y={GeometryCollection:function(n){n.geometries.forEach(l)},Point:function(n){n.coordinates=o(n.coordinates)},MultiPoint:function(n){n.coordinates=n.coordinates.map(o)},LineString:function(n){n.arcs=h(n.arcs)},MultiLineString:function(n){n.arcs=n.arcs.map(h)},Polygon:function(n){n.arcs=c(n.arcs)},MultiPolygon:function(n){n.arcs=n.arcs.map(c)}};for(var w in n)l(n[w]);return{scale:[1/f,1/e],translate:[r,u]}}(n,u,t),i=sbt(obt(function(n){function r(n){n&&s.hasOwnProperty(n.type)&&s[n.type](n)}function u(n){for(var f,r=0,u=n.length;r<u;++r)i[++t]=n[r];return f={0:t-u+1,1:t},e.push(f),f}function f(n){for(var f,r=0,u=n.length;r<u;++r)i[++t]=n[r];return f={0:t-u+1,1:t},o.push(f),f}function h(n){return n.map(f)}var t=-1,e=[],o=[],i=[],s={GeometryCollection:function(n){n.geometries.forEach(r)},LineString:function(n){n.arcs=u(n.arcs)},MultiLineString:function(n){n.arcs=n.arcs.map(u)},Polygon:function(n){n.arcs=n.arcs.map(f)},MultiPolygon:function(n){n.arcs=n.arcs.map(h)}};for(var c in n)r(n[c]);return{type:"Topology",coordinates:i,lines:e,rings:o,objects:n}}(n))),s=i.coordinates,h=prt(1.4*i.arcs.length,ipt,rpt),f,c;n=i.objects;i.bbox=u;i.arcs=i.arcs.map(function(n,t){return h.set(n,t),s.slice(n[0],n[1]+1)});delete i.coordinates;s=null;f={GeometryCollection:function(n){n.geometries.forEach(e)},LineString:function(n){n.arcs=r(n.arcs)},MultiLineString:function(n){n.arcs=n.arcs.map(r)},Polygon:function(n){n.arcs=n.arcs.map(r)},MultiPolygon:function(n){n.arcs=n.arcs.map(l)}};for(c in n)e(n[c]);return o&&(i.transform=o,i.arcs=function(n){for(var e=-1,h=n.length;++e<h;){for(var i,r,t=n[e],c=0,u=1,l=t.length,f=t[0],o=f[0],s=f[1];++c<l;)i=(f=t[c])[0],r=f[1],i===o&&r===s||(t[u++]=[i-o,r-s],o=i,s=r);1===u&&(t[u++]=[0,0]);t.length=u}return n}(i.arcs)),i},yg=function(n){var t,i,r;for(this.points=n.points||[],this.duration=n.duration||1e4,this.sharpness=n.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=n.stepLength||60,this.length=this.points.length,this.delay=0,t=0;t<this.length;t++)this.points[t].z=this.points[t].z||0;for(t=0;t<this.length-1;t++)i=this.points[t],r=this.points[t+1],this.centers.push({x:(i.x+r.x)/2,y:(i.y+r.y)/2,z:(i.z+r.z)/2});for(this.controls.push([this.points[0],this.points[0]]),t=0;t<this.centers.length-1;t++){i=this.centers[t];r=this.centers[t+1];var u=this.points[t+1].x-(this.centers[t].x+this.centers[t+1].x)/2,f=this.points[t+1].y-(this.centers[t].y+this.centers[t+1].y)/2,e=this.points[t+1].z-(this.centers[t].y+this.centers[t+1].z)/2;this.controls.push([{x:(1-this.sharpness)*this.points[t+1].x+this.sharpness*(this.centers[t].x+u),y:(1-this.sharpness)*this.points[t+1].y+this.sharpness*(this.centers[t].y+f),z:(1-this.sharpness)*this.points[t+1].z+this.sharpness*(this.centers[t].z+e)},{x:(1-this.sharpness)*this.points[t+1].x+this.sharpness*(this.centers[t+1].x+u),y:(1-this.sharpness)*this.points[t+1].y+this.sharpness*(this.centers[t+1].y+f),z:(1-this.sharpness)*this.points[t+1].z+this.sharpness*(this.centers[t+1].z+e)}])}return this.controls.push([this.points[this.length-1],this.points[this.length-1]]),this.steps=this.cacheSteps(this.stepLength),this};yg.prototype.cacheSteps=function(n){var u=[],i=this.pos(0),r,t;for(u.push(0),r=0;r<this.duration;r+=10)t=this.pos(r),Math.sqrt((t.x-i.x)*(t.x-i.x)+(t.y-i.y)*(t.y-i.y)+(t.z-i.z)*(t.z-i.z))>n&&(u.push(r),i=t);return u};yg.prototype.vector=function(n){var t=this.pos(n+10),i=this.pos(n-10);return{angle:180*Math.atan2(t.y-i.y,t.x-i.x)/3.14,speed:Math.sqrt((i.x-t.x)*(i.x-t.x)+(i.y-t.y)*(i.y-t.y)+(i.z-t.z)*(i.z-t.z))}};yg.prototype.pos=function(n){var i=n-this.delay,r,t;return(i<0&&(i=0),i>this.duration&&(i=this.duration-1),r=i/this.duration,r>=1)?this.points[this.length-1]:(t=Math.floor((this.points.length-1)*r),function(n,t,i,r,u){var f=function(n){var t=n*n;return[t*n,3*t*(1-n),3*n*(1-n)*(1-n),(1-n)*(1-n)*(1-n)]}(n);return{x:u.x*f[0]+r.x*f[1]+i.x*f[2]+t.x*f[3],y:u.y*f[0]+r.y*f[1]+i.y*f[2]+t.y*f[3],z:u.z*f[0]+r.z*f[1]+i.z*f[2]+t.z*f[3]}}((this.length-1)*r-t,this.points[t],this.controls[t][1],this.controls[t+1][0],this.points[t+1]))};brt=ud;vat=ud;ud.deviation=function(n,t,i,r){var h=t&&t.length,y=h?t[0]*i:n.length,f=Math.abs(uit(n,0,y,i)),u,s,c,l,e;if(h)for(u=0,s=t.length;u<s;u++)c=t[u]*i,l=u<s-1?t[u+1]*i:n.length,f-=Math.abs(uit(n,c,l,i));for(e=0,u=0;u<r.length;u+=3){var o=r[u]*i,a=r[u+1]*i,v=r[u+2]*i;e+=Math.abs((n[o]-n[v])*(n[a+1]-n[o+1])-(n[o]-n[a])*(n[v+1]-n[o+1]))}return 0===f&&0===e?0:Math.abs((e-f)/f)};ud.flatten=function(n){for(var i,r,f=n[0][0].length,u={vertices:[],holes:[],dimensions:f},e=0,t=0;t<n.length;t++){for(i=0;i<n[t].length;i++)for(r=0;r<f;r++)u.vertices.push(n[t][i][r]);t>0&&(e+=n[t-1].length,u.holes.push(e))}return u};brt.default=vat;us.prototype={all:function(){return this._all(this.data,[])},search:function(n){var t=this.data,r=[],s=this.toBBox,u,e,i,o,f;if(!od(n,t))return r;for(f=[];t;){for(u=0,e=t.children.length;u<e;u++)i=t.children[u],od(n,o=t.leaf?s(i):i)&&(t.leaf?r.push(i):oit(n,o)?this._all(i,r):f.push(i));t=f.pop()}return r},collides:function(n){var t=this.data,o=this.toBBox,i,e,r,u,f;if(!od(n,t))return!1;for(f=[];t;){for(i=0,e=t.children.length;i<e;i++)if(r=t.children[i],u=t.leaf?o(r):r,od(n,u)){if(t.leaf||oit(n,u))return!0;f.push(r)}t=f.pop()}return!1},load:function(n){var i,r,t,u;if(!n||!n.length)return this;if(n.length<this._minEntries){for(i=0,r=n.length;i<r;i++)this.insert(n[i]);return this}return t=this._build(n.slice(),0,n.length-1,0),this.data.children.length?this.data.height===t.height?this._splitRoot(this.data,t):(this.data.height<t.height&&(u=this.data,this.data=t,t=u),this._insert(t,this.data.height-t.height-1,!0)):this.data=t,this},insert:function(n){return n&&this._insert(n,this.data.height-1),this},clear:function(){return this.data=ky([]),this},remove:function(n,t){if(!n)return this;for(var u,f,o,e,i=this.data,h=this.toBBox(n),r=[],s=[];i||r.length;){if(i||(i=r.pop(),f=r[r.length-1],u=s.pop(),e=!0),i.leaf&&-1!==(o=function(n,t,i){if(!i)return t.indexOf(n);for(var r=0;r<t.length;r++)if(i(n,t[r]))return r;return-1}(n,i.children,t)))return i.children.splice(o,1),r.push(i),this._condense(r),this;e||i.leaf||!oit(i,h)?f?(u++,i=f.children[u],e=!1):i=null:(r.push(i),s.push(u),u=0,f=i,i=i.children[0])}return this},toBBox:function(n){return n},compareMinX:vot,compareMinY:yot,toJSON:function(){return this.data},fromJSON:function(n){return this.data=n,this},_all:function(n,t){for(var i=[];n;)n.leaf?t.push.apply(t,n.children):i.push.apply(i,n.children),n=i.pop();return t},_build:function(n,t,i,r){var u,h=i-t+1,f=this._maxEntries,e,o,l,a,s,c;if(h<=f)return u=ky(n.slice(t,i+1)),by(u,this.toBBox),u;for(r||(r=Math.ceil(Math.log(h)/Math.log(f)),f=Math.ceil(h/Math.pow(f,r-1))),(u=ky([])).leaf=!1,u.height=r,s=Math.ceil(h/f),c=s*Math.ceil(Math.sqrt(f)),pot(n,t,i,c,this.compareMinX),e=t;e<=i;e+=c)for(pot(n,e,l=Math.min(e+c-1,i),s,this.compareMinY),o=e;o<=l;o+=s)a=Math.min(o+s-1,l),u.children.push(this._build(n,o,a,r-1));return by(u,this.toBBox),u},_chooseSubtree:function(n,t,i,r){for(var e,l,o,h,u,c,f,s;r.push(t),!t.leaf&&r.length-1!==i;){for(f=s=1/0,e=0,l=t.children.length;e<l;e++)u=eit(o=t.children[e]),(c=function(n,t){return(Math.max(t.maxX,n.maxX)-Math.min(t.minX,n.minX))*(Math.max(t.maxY,n.maxY)-Math.min(t.minY,n.minY))}(n,o)-u)<s?(s=c,f=u<f?u:f,h=o):c===s&&u<f&&(f=u,h=o);t=h||t.children[0]}return t},_insert:function(n,t,i){var e=this.toBBox,u=i?n:e(n),r=[],f=this._chooseSubtree(u,this.data,t,r);for(f.children.push(n),ub(f,u);t>=0&&r[t].children.length>this._maxEntries;)this._split(r,t),t--;this._adjustParentBBoxes(u,r,t)},_split:function(n,t){var i=n[t],f=i.children.length,e=this._minEntries,u,r;this._chooseSplitAxis(i,e,f);u=this._chooseSplitIndex(i,e,f);r=ky(i.children.splice(u,i.children.length-u));r.height=i.height;r.leaf=i.leaf;by(i,this.toBBox);by(r,this.toBBox);t?n[t-1].children.push(r):this._splitRoot(i,r)},_splitRoot:function(n,t){this.data=ky([n,t]);this.data.height=n.height+1;this.data.leaf=!1;by(this.data,this.toBBox)},_chooseSplitIndex:function(n,t,i){for(var h,c,e,f,u,s,o=u=1/0,r=t;r<=i-t;r++)e=function(n,t){var i=Math.max(n.minX,t.minX),r=Math.max(n.minY,t.minY),u=Math.min(n.maxX,t.maxX),f=Math.min(n.maxY,t.maxY);return Math.max(0,u-i)*Math.max(0,f-r)}(h=rb(n,0,r,this.toBBox),c=rb(n,r,i,this.toBBox)),f=eit(h)+eit(c),e<o?(o=e,s=r,u=f<u?f:u):e===o&&f<u&&(u=f,s=r);return s},_chooseSplitAxis:function(n,t,i){var r=n.leaf?this.compareMinX:vot,u=n.leaf?this.compareMinY:yot;this._allDistMargin(n,t,i,r)<this._allDistMargin(n,t,i,u)&&n.children.sort(r)},_allDistMargin:function(n,t,i,r){n.children.sort(r);for(var f,e=this.toBBox,o=rb(n,0,t,e),s=rb(n,i-t,i,e),h=ed(o)+ed(s),u=t;u<i-t;u++)f=n.children[u],ub(o,n.leaf?e(f):f),h+=ed(o);for(u=i-t-1;u>=t;u--)f=n.children[u],ub(s,n.leaf?e(f):f),h+=ed(s);return h},_adjustParentBBoxes:function(n,t,i){for(var r=i;r>=0;r--)ub(t[r],n)},_condense:function(n){for(var i,t=n.length-1;t>=0;t--)0===n[t].children.length?t>0?(i=n[t-1].children).splice(i.indexOf(n[t]),1):this.clear():by(n[t],this.toBBox)},_initFormat:function(n){var t=["return a"," - b",";"];this.compareMinX=new Function("a","b",t.join(n[0]));this.compareMinY=new Function("a","b",t.join(n[1]));this.toBBox=new Function("a","return {minX: a"+n[0]+", minY: a"+n[1]+", maxX: a"+n[2]+", maxY: a"+n[3]+"};")}};var cbt=Object.freeze({toMercator:ha,toWgs84:hd}),yat=6378137,lbt=function(n,t,i){function v(n,i,u,f){var s=r[n][i],c=r[n][i+1],h=r[u][f],l=r[u][f+1],o=function(n,t,i,r){if(ob(n,i)||ob(n,r)||ob(t,i)||ob(r,i))return null;var u=n[0],f=n[1],e=t[0],o=t[1],s=i[0],h=i[1],c=r[0],l=r[1],a=(u-e)*(h-l)-(f-o)*(s-c);return 0===a?null:[((u*o-f*e)*(s-c)-(u-e)*(s*l-h*c))/a,((u*o-f*e)*(h-l)-(f-o)*(s*l-h*c))/a]}(s,c,h,l),a,v,y,w;null!==o&&((a=c[0]!==s[0]?(o[0]-s[0])/(c[0]-s[0]):(o[1]-s[1])/(c[1]-s[1]),v=l[0]!==h[0]?(o[0]-h[0])/(l[0]-h[0]):(o[1]-h[1])/(l[1]-h[1]),a>=1||a<=0||v>=1||v<=0)||(y=o,w=!p[y],w&&(p[y]=!0),t?e.push(t(o,n,i,s,c,a,u,f,h,l,v,w)):e.push(o)))}function y(n,t){var f,e,o,s,i=r[n][t],u=r[n][t+1];return i[0]<u[0]?(f=i[0],e=u[0]):(f=u[0],e=i[0]),i[1]<u[1]?(o=i[1],s=u[1]):(o=u[1],s=i[1]),{minX:f,minY:o,maxX:e,maxY:s,ring:n,edge:t}}var l,o,h,a,u,f,s,c;if("Polygon"!==n.geometry.type)throw new Error("The input feature must be a Polygon");void 0===i&&(i=1);var r=n.geometry.coordinates,e=[],p={};if(i){for(l=[],o=0;o<r.length;o++)for(h=0;h<r[o].length-1;h++)l.push(y(o,h));a=ep();a.load(l)}for(u=0;u<r.length;u++)for(f=0;f<r[u].length-1;f++)if(i)a.search(y(u,f)).forEach(function(n){var t=n.ring,i=n.edge;v(u,f,t,i)});else for(s=0;s<r.length;s++)for(c=0;c<r[s].length-1;c++)v(u,f,s,c);return t||(e={type:"Feature",geometry:{type:"MultiPoint",coordinates:e}}),e},abt=function(n){function lt(){for(var r,i,t=[],n=0;n<o.features.length;n++)-1==o.features[n].properties.parent&&t.push(n);if(t.length>1)for(n=0;n<t.length;n++){for(r=-1,i=0;i<o.features.length;i++)t[n]!=i&&pr(o.features[t[n]].geometry.coordinates[0][0],o.features[i],{ignoreBoundary:!0})&&eb(o.features[i])<1/0&&(r=i);o.features[t[n]].properties.parent=r}}function at(){for(var t,n=0;n<o.features.length;n++)-1==o.features[n].properties.parent&&(t=o.features[n].properties.winding,o.features[n].properties.netWinding=t,vt(n,t))}function vt(n,t){for(var r,i=0;i<o.features.length;i++)o.features[i].properties.parent==n&&(r=t+o.features[i].properties.winding,o.features[i].properties.netWinding=r,vt(i,r))}var a,p,o,e,i,r,pt,ut,tt,f,ft,c,b,l,v,wt,bt,kt,k,u,rt,h;if("Feature"!=n.type)throw new Error("The input must a geojson object of type Feature");if(void 0===n.geometry||null==n.geometry)throw new Error("The input must a geojson object with a non-empty geometry");if("Polygon"!=n.geometry.type)throw new Error("The input must be a geojson Polygon");for(var g=n.geometry.coordinates.length,nt=[],t=0;t<g;t++)a=n.geometry.coordinates[t],sb(a[0],a[a.length-1])||a.push(a[0]),nt.push.apply(nt,a.slice(0,a.length-1));if(!function(n){for(var i={},r=1,t=0,u=n.length;t<u;++t){if(i.hasOwnProperty(n[t])){r=0;break}i[n[t]]=1}return r}(nt))throw new Error("The input polygon may not have duplicate vertices (except for the first and last vertex of each ring)");var dt=nt.length,s=lbt(n,function(n,t,i,r,u,f,e,o,s,h,c,l){return[n,t,i,r,u,f,e,o,s,h,c,l]}),yt=s.length;if(0==yt){for(p=[],t=0;t<g;t++)p.push(st([n.geometry.coordinates[t]],{parent:-1,winding:function(n){for(var t=0,i=0;i<n.length-1;i++)n[i][0]<n[t][0]&&(t=i);return cd([n[(t-1).modulo(n.length-1)],n[t],n[(t+1).modulo(n.length-1)]],!0)?1:-1}(n.geometry.coordinates[t])}));return o=d(p),lt(),at(),o}for(e=[],i=[],t=0;t<g;t++)for(e.push([]),r=0;r<n.geometry.coordinates[t].length-1;r++)e[t].push([new pat(n.geometry.coordinates[t][(r+1).modulo(n.geometry.coordinates[t].length-1)],1,[t,r],[t,(r+1).modulo(n.geometry.coordinates[t].length-1)],void 0)]),i.push(new wat(n.geometry.coordinates[t][r],[t,(r-1).modulo(n.geometry.coordinates[t].length-1)],[t,r],void 0,void 0,!1,!0));for(t=0;t<yt;t++)e[s[t][1]][s[t][2]].push(new pat(s[t][0],s[t][5],[s[t][1],s[t][2]],[s[t][6],s[t][7]],void 0)),s[t][11]&&i.push(new wat(s[t][0],[s[t][1],s[t][2]],[s[t][6],s[t][7]],void 0,void 0,!0,!0));for(pt=i.length,t=0;t<e.length;t++)for(r=0;r<e[t].length;r++)e[t][r].sort(function(n,t){return n.param<t.param?-1:1});for(ut=[],t=0;t<pt;t++)ut.push({minX:i[t].coord[0],minY:i[t].coord[1],maxX:i[t].coord[0],maxY:i[t].coord[1],index:t});for(tt=ep(),tt.load(ut),t=0;t<e.length;t++)for(r=0;r<e[t].length;r++)for(f=0;f<e[t][r].length;f++)c=f==e[t][r].length-1?e[t][(r+1).modulo(n.geometry.coordinates[t].length-1)][0].coord:e[t][r][f+1].coord,ft=tt.search({minX:c[0],minY:c[1],maxX:c[0],maxY:c[1]})[0],e[t][r][f].nxtIsectAlongEdgeIn=ft.index;for(t=0;t<e.length;t++)for(r=0;r<e[t].length;r++)for(f=0;f<e[t][r].length;f++)c=e[t][r][f].coord,b=(ft=tt.search({minX:c[0],minY:c[1],maxX:c[0],maxY:c[1]})[0]).index,b<dt?i[b].nxtIsectAlongRingAndEdge2=e[t][r][f].nxtIsectAlongEdgeIn:sb(i[b].ringAndEdge1,e[t][r][f].ringAndEdgeIn)?i[b].nxtIsectAlongRingAndEdge1=e[t][r][f].nxtIsectAlongEdgeIn:i[b].nxtIsectAlongRingAndEdge2=e[t][r][f].nxtIsectAlongEdgeIn;for(l=[],t=0,r=0;r<g;r++){for(v=t,f=0;f<n.geometry.coordinates[r].length-1;f++)i[t].coord[0]<i[v].coord[0]&&(v=t),t++;for(wt=i[v].nxtIsectAlongRingAndEdge2,f=0;f<i.length;f++)if(i[f].nxtIsectAlongRingAndEdge1==v||i[f].nxtIsectAlongRingAndEdge2==v){bt=f;break}kt=cd([i[bt].coord,i[v].coord,i[wt].coord],!0)?1:-1;l.push({isect:v,parent:-1,winding:kt})}for(l.sort(function(n,t){return i[n.isect].coord>i[t.isect].coord?-1:1}),p=[];l.length>0;){var et=l.pop(),y=et.isect,ot=et.parent,w=et.winding,ht=p.length,ct=[i[y].coord],it=y;for(i[y].ringAndEdge1Walkable?(k=i[y].ringAndEdge1,u=i[y].nxtIsectAlongRingAndEdge1):(k=i[y].ringAndEdge2,u=i[y].nxtIsectAlongRingAndEdge2);!sb(i[y].coord,i[u].coord);){for(ct.push(i[u].coord),rt=void 0,t=0;t<l.length;t++)if(l[t].isect==u){rt=t;break}(void 0!=rt&&l.splice(rt,1),sb(k,i[u].ringAndEdge1))?((k=i[u].ringAndEdge2,i[u].ringAndEdge2Walkable=!1,i[u].ringAndEdge1Walkable)&&(h={isect:u},cd([i[it].coord,i[u].coord,i[i[u].nxtIsectAlongRingAndEdge2].coord],1==w)?(h.parent=ot,h.winding=-w):(h.parent=ht,h.winding=w),l.push(h)),it=u,u=i[u].nxtIsectAlongRingAndEdge2):((k=i[u].ringAndEdge1,i[u].ringAndEdge1Walkable=!1,i[u].ringAndEdge2Walkable)&&(h={isect:u},cd([i[it].coord,i[u].coord,i[i[u].nxtIsectAlongRingAndEdge1].coord],1==w)?(h.parent=ot,h.winding=-w):(h.parent=ht,h.winding=w),l.push(h)),it=u,u=i[u].nxtIsectAlongRingAndEdge1)}ct.push(i[u].coord);p.push(st([ct],{index:ht,parent:ot,winding:w,netWinding:void 0}))}return o=d(p),lt(),at(),o},pat=function(n,t,i,r,u){this.coord=n;this.param=t;this.ringAndEdgeIn=i;this.ringAndEdgeOut=r;this.nxtIsectAlongEdgeIn=u},wat=function(n,t,i,r,u,f,e){this.coord=n;this.ringAndEdge1=t;this.ringAndEdge2=i;this.nxtIsectAlongRingAndEdge1=r;this.nxtIsectAlongRingAndEdge2=u;this.ringAndEdge1Walkable=f;this.ringAndEdge2Walkable=e};Number.prototype.modulo=function(n){return(this%n+n)%n};var bat=Math.PI/180,kat=180/Math.PI,kb=function(n,t){this.lon=n;this.lat=t;this.x=bat*n;this.y=bat*t};kb.prototype.view=function(){return String(this.lon).slice(0,4)+","+String(this.lat).slice(0,4)};kb.prototype.antipode=function(){var n=-1*this.lat,t=this.lon<0?180+this.lon:-1*(180-this.lon);return new kb(t,n)};krt=function(){this.coords=[];this.length=0};krt.prototype.move_to=function(n){this.length++;this.coords.push(n)};pg=function(n){this.properties=n||{};this.geometries=[]};pg.prototype.json=function(){if(this.geometries.length<=0)return{geometry:{type:"LineString",coordinates:null},type:"Feature",properties:this.properties};if(1===this.geometries.length)return{geometry:{type:"LineString",coordinates:this.geometries[0].coords},type:"Feature",properties:this.properties};for(var t=[],n=0;n<this.geometries.length;n++)t.push(this.geometries[n].coords);return{geometry:{type:"MultiLineString",coordinates:t},type:"Feature",properties:this.properties}};pg.prototype.wkt=function(){for(var i="",t="LINESTRING(",r=function(n){t+=n[0]+" "+n[1]+","},n=0;n<this.geometries.length;n++){if(0===this.geometries[n].coords.length)return"LINESTRING(empty)";this.geometries[n].coords.forEach(r);i+=t.substring(0,t.length-1)+")"}return i};wg=function(n,t,i){if(!n||void 0===n.x||void 0===n.y)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");if(!t||void 0===t.x||void 0===t.y)throw new Error("GreatCircle constructor expects two args: start and end objects with x and y properties");this.start=new kb(n.x,n.y);this.end=new kb(t.x,t.y);this.properties=i||{};var r=this.start.x-this.end.x,u=this.start.y-this.end.y,f=Math.pow(Math.sin(u/2),2)+Math.cos(this.start.y)*Math.cos(this.end.y)*Math.pow(Math.sin(r/2),2);if(this.g=2*Math.asin(Math.sqrt(f)),this.g===Math.PI)throw new Error("it appears "+n.view()+" and "+t.view()+" are 'antipodal', e.g diametrically opposite, thus there is no single route but rather infinite");if(isNaN(this.g))throw new Error("could not calculate great circle between "+n+" and "+t);};wg.prototype.interpolate=function(n){var t=Math.sin((1-n)*this.g)/Math.sin(this.g),i=Math.sin(n*this.g)/Math.sin(this.g),r=t*Math.cos(this.start.y)*Math.cos(this.start.x)+i*Math.cos(this.end.y)*Math.cos(this.end.x),u=t*Math.cos(this.start.y)*Math.sin(this.start.x)+i*Math.cos(this.end.y)*Math.sin(this.end.x),f=t*Math.sin(this.start.y)+i*Math.sin(this.end.y),e=kat*Math.atan2(f,Math.sqrt(Math.pow(r,2)+Math.pow(u,2)));return[kat*Math.atan2(u,r),e]};wg.prototype.Arc=function(n,t){var i=[],st,l,ht,ct,s,u,r,g,vt,yt,it,rt,ut,c,ft,y,et,ot,p;if(!n||n<=2)i.push([this.start.lon,this.start.lat]),i.push([this.end.lon,this.end.lat]);else for(st=1/(n-1),l=0;l<n;++l)ht=st*l,ct=this.interpolate(ht),i.push(ct);for(var lt=!1,w=0,a=t&&t.offset?t.offset:10,o=180-a,h=-180+a,at=360-a,v=1;v<i.length;++v){var b=i[v-1][0],k=i[v][0],d=Math.abs(k-b);d>at&&(k>o&&b<h||b>o&&k<h)?lt=!0:d>w&&(w=d)}if(s=[],lt&&w<a)for(u=[],s.push(u),r=0;r<i.length;++r)if(g=parseFloat(i[r][0]),r>0&&Math.abs(g-i[r-1][0])>at){var f=parseFloat(i[r-1][0]),nt=parseFloat(i[r-1][1]),e=parseFloat(i[r][0]),tt=parseFloat(i[r][1]);if(f>-180&&f<h&&180===e&&r+1<i.length&&i[r-1][0]>-180&&i[r-1][0]<h){u.push([-180,i[r][1]]);r++;u.push([i[r][0],i[r][1]]);continue}if(f>o&&f<180&&-180===e&&r+1<i.length&&i[r-1][0]>o&&i[r-1][0]<180){u.push([180,i[r][1]]);r++;u.push([i[r][0],i[r][1]]);continue}f<h&&e>o&&(vt=f,f=e,e=vt,yt=nt,nt=tt,tt=yt);(f>o&&e<h&&(e+=360),f<=180&&e>=180&&f<e)?(it=(180-f)/(e-f),rt=it*tt+(1-it)*nt,u.push([i[r-1][0]>o?180:-180,rt]),(u=[]).push([i[r-1][0]>o?-180:180,rt]),s.push(u)):(u=[],s.push(u));u.push([g,i[r][1]])}else u.push([i[r][0],i[r][1]]);else for(ut=[],s.push(ut),c=0;c<i.length;++c)ut.push([i[c][0],i[c][1]]);for(ft=new pg(this.properties),y=0;y<s.length;++y)for(et=new krt,ft.geometries.push(et),ot=s[y],p=0;p<ot.length;++p)et.move_to(ot[p]);return ft};drt=ad;ad.polyline=ad;ad.polygon=function(n,t){for(var r,e,o,u,f,s,i=1;i<=8;i*=2){for(r=[],o=!(gy(e=n[n.length-1],t)&i),u=0;u<n.length;u++)(s=!(gy(f=n[u],t)&i))!==o&&r.push(yit(e,f,i,t)),s&&r.push(f),e=f,o=s;if(!(n=r).length)break}return r};var dat=Array.prototype.slice,gat={successCallback:null,verbose:!1,polygons:!1},vv={},ee=64,ph=16,sf=4,gf=1,ht=[],ct=[],lt=[],at=[],vt=[],yt=[],pt=[],wt=[],bt=[],kt=[],dt=[],gt=[],ni=[],ti=[],ii=[],ri=[],ui=[],fi=[],ei=[],oi=[],si=[],hi=[],ci=[],li=[];pt[85]=kt[85]=-1;wt[85]=dt[85]=0;bt[85]=gt[85]=1;ei[85]=hi[85]=1;oi[85]=ci[85]=0;si[85]=li[85]=1;ht[85]=at[85]=0;ct[85]=vt[85]=-1;lt[85]=ii[85]=0;ri[85]=ni[85]=0;ui[85]=ti[85]=1;yt[85]=fi[85]=1;hi[1]=hi[169]=0;ci[1]=ci[169]=-1;li[1]=li[169]=0;ni[1]=ni[169]=-1;ti[1]=ti[169]=0;ii[1]=ii[169]=0;kt[4]=kt[166]=0;dt[4]=dt[166]=-1;gt[4]=gt[166]=1;ri[4]=ri[166]=1;ui[4]=ui[166]=0;fi[4]=fi[166]=0;pt[16]=pt[154]=0;wt[16]=wt[154]=1;bt[16]=bt[154]=1;at[16]=at[154]=1;vt[16]=vt[154]=0;yt[16]=yt[154]=1;ei[64]=ei[106]=0;oi[64]=oi[106]=1;si[64]=si[106]=0;ht[64]=ht[106]=-1;ct[64]=ct[106]=0;lt[64]=lt[106]=1;ei[2]=ei[168]=0;oi[2]=oi[168]=-1;si[2]=si[168]=1;hi[2]=hi[168]=0;ci[2]=ci[168]=-1;li[2]=li[168]=0;ni[2]=ni[168]=-1;ti[2]=ti[168]=0;ii[2]=ii[168]=0;ri[2]=ri[168]=-1;ui[2]=ui[168]=0;fi[2]=fi[168]=1;pt[8]=pt[162]=0;wt[8]=wt[162]=-1;bt[8]=bt[162]=0;kt[8]=kt[162]=0;dt[8]=dt[162]=-1;gt[8]=gt[162]=1;ni[8]=ni[162]=1;ti[8]=ti[162]=0;ii[8]=ii[162]=1;ri[8]=ri[162]=1;ui[8]=ui[162]=0;fi[8]=fi[162]=0;pt[32]=pt[138]=0;wt[32]=wt[138]=1;bt[32]=bt[138]=1;kt[32]=kt[138]=0;dt[32]=dt[138]=1;gt[32]=gt[138]=0;ht[32]=ht[138]=1;ct[32]=ct[138]=0;lt[32]=lt[138]=0;at[32]=at[138]=1;vt[32]=vt[138]=0;yt[32]=yt[138]=1;hi[128]=hi[42]=0;ci[128]=ci[42]=1;li[128]=li[42]=1;ei[128]=ei[42]=0;oi[128]=oi[42]=1;si[128]=si[42]=0;ht[128]=ht[42]=-1;ct[128]=ct[42]=0;lt[128]=lt[42]=1;at[128]=at[42]=-1;vt[128]=vt[42]=0;yt[128]=yt[42]=0;kt[5]=kt[165]=-1;dt[5]=dt[165]=0;gt[5]=gt[165]=0;hi[5]=hi[165]=1;ci[5]=ci[165]=0;li[5]=li[165]=0;ri[20]=ri[150]=0;ui[20]=ui[150]=1;fi[20]=fi[150]=1;at[20]=at[150]=0;vt[20]=vt[150]=-1;yt[20]=yt[150]=1;pt[80]=pt[90]=-1;wt[80]=wt[90]=0;bt[80]=bt[90]=1;ei[80]=ei[90]=1;oi[80]=oi[90]=0;si[80]=si[90]=1;ni[65]=ni[105]=0;ti[65]=ti[105]=1;ii[65]=ii[105]=0;ht[65]=ht[105]=0;ct[65]=ct[105]=-1;lt[65]=lt[105]=0;pt[160]=pt[10]=-1;wt[160]=wt[10]=0;bt[160]=bt[10]=1;kt[160]=kt[10]=-1;dt[160]=dt[10]=0;gt[160]=gt[10]=0;hi[160]=hi[10]=1;ci[160]=ci[10]=0;li[160]=li[10]=0;ei[160]=ei[10]=1;oi[160]=oi[10]=0;si[160]=si[10]=1;ri[130]=ri[40]=0;ui[130]=ui[40]=1;fi[130]=fi[40]=1;ni[130]=ni[40]=0;ti[130]=ti[40]=1;ii[130]=ii[40]=0;ht[130]=ht[40]=0;ct[130]=ct[40]=-1;lt[130]=lt[40]=0;at[130]=at[40]=0;vt[130]=vt[40]=-1;yt[130]=yt[40]=1;kt[37]=kt[133]=0;dt[37]=dt[133]=1;gt[37]=gt[133]=1;hi[37]=hi[133]=0;ci[37]=ci[133]=1;li[37]=li[133]=0;ht[37]=ht[133]=-1;ct[37]=ct[133]=0;lt[37]=lt[133]=0;at[37]=at[133]=1;vt[37]=vt[133]=0;yt[37]=yt[133]=0;ri[148]=ri[22]=-1;ui[148]=ui[22]=0;fi[148]=fi[22]=0;hi[148]=hi[22]=0;ci[148]=ci[22]=-1;li[148]=li[22]=1;ei[148]=ei[22]=0;oi[148]=oi[22]=1;si[148]=si[22]=1;at[148]=at[22]=-1;vt[148]=vt[22]=0;yt[148]=yt[22]=1;pt[82]=pt[88]=0;wt[82]=wt[88]=-1;bt[82]=bt[88]=1;ri[82]=ri[88]=1;ui[82]=ui[88]=0;fi[82]=fi[88]=1;ni[82]=ni[88]=-1;ti[82]=ti[88]=0;ii[82]=ii[88]=1;ei[82]=ei[88]=0;oi[82]=oi[88]=-1;si[82]=si[88]=0;pt[73]=pt[97]=0;wt[73]=wt[97]=1;bt[73]=bt[97]=0;kt[73]=kt[97]=0;dt[73]=dt[97]=-1;gt[73]=gt[97]=0;ni[73]=ni[97]=1;ti[73]=ti[97]=0;ii[73]=ii[97]=0;ht[73]=ht[97]=1;ct[73]=ct[97]=0;lt[73]=lt[97]=1;pt[145]=pt[25]=0;wt[145]=wt[25]=-1;bt[145]=bt[25]=0;ni[145]=ni[25]=1;ti[145]=ti[25]=0;ii[145]=ii[25]=1;hi[145]=hi[25]=0;ci[145]=ci[25]=1;li[145]=li[25]=1;at[145]=at[25]=-1;vt[145]=vt[25]=0;yt[145]=yt[25]=0;kt[70]=kt[100]=0;dt[70]=dt[100]=1;gt[70]=gt[100]=0;ri[70]=ri[100]=-1;ui[70]=ui[100]=0;fi[70]=fi[100]=1;ei[70]=ei[100]=0;oi[70]=oi[100]=-1;si[70]=si[100]=1;ht[70]=ht[100]=1;ct[70]=ct[100]=0;lt[70]=lt[100]=0;kt[101]=kt[69]=0;dt[101]=dt[69]=1;gt[101]=gt[69]=0;ht[101]=ht[69]=1;ct[101]=ct[69]=0;lt[101]=lt[69]=0;hi[149]=hi[21]=0;ci[149]=ci[21]=1;li[149]=li[21]=1;at[149]=at[21]=-1;vt[149]=vt[21]=0;yt[149]=yt[21]=0;ri[86]=ri[84]=-1;ui[86]=ui[84]=0;fi[86]=fi[84]=1;ei[86]=ei[84]=0;oi[86]=oi[84]=-1;si[86]=si[84]=1;pt[89]=pt[81]=0;wt[89]=wt[81]=-1;bt[89]=bt[81]=0;ni[89]=ni[81]=1;ti[89]=ti[81]=0;ii[89]=ii[81]=1;pt[96]=pt[74]=0;wt[96]=wt[74]=1;bt[96]=bt[74]=0;kt[96]=kt[74]=-1;dt[96]=dt[74]=0;gt[96]=gt[74]=1;ei[96]=ei[74]=1;oi[96]=oi[74]=0;si[96]=si[74]=0;ht[96]=ht[74]=1;ct[96]=ct[74]=0;lt[96]=lt[74]=1;pt[24]=pt[146]=0;wt[24]=wt[146]=-1;bt[24]=bt[146]=1;ri[24]=ri[146]=1;ui[24]=ui[146]=0;fi[24]=fi[146]=1;ni[24]=ni[146]=0;ti[24]=ti[146]=1;ii[24]=ii[146]=1;at[24]=at[146]=0;vt[24]=vt[146]=-1;yt[24]=yt[146]=0;kt[6]=kt[164]=-1;dt[6]=dt[164]=0;gt[6]=gt[164]=1;ri[6]=ri[164]=-1;ui[6]=ui[164]=0;fi[6]=fi[164]=0;hi[6]=hi[164]=0;ci[6]=ci[164]=-1;li[6]=li[164]=1;ei[6]=ei[164]=1;oi[6]=oi[164]=0;si[6]=si[164]=0;ni[129]=ni[41]=0;ti[129]=ti[41]=1;ii[129]=ii[41]=1;hi[129]=hi[41]=0;ci[129]=ci[41]=1;li[129]=li[41]=0;ht[129]=ht[41]=-1;ct[129]=ct[41]=0;lt[129]=lt[41]=0;at[129]=at[41]=0;vt[129]=vt[41]=-1;yt[129]=yt[41]=0;ri[66]=ri[104]=0;ui[66]=ui[104]=1;fi[66]=fi[104]=0;ni[66]=ni[104]=-1;ti[66]=ti[104]=0;ii[66]=ii[104]=1;ei[66]=ei[104]=0;oi[66]=oi[104]=-1;si[66]=si[104]=0;ht[66]=ht[104]=0;ct[66]=ct[104]=-1;lt[66]=lt[104]=1;pt[144]=pt[26]=-1;wt[144]=wt[26]=0;bt[144]=bt[26]=0;hi[144]=hi[26]=1;ci[144]=ci[26]=0;li[144]=li[26]=1;ei[144]=ei[26]=0;oi[144]=oi[26]=1;si[144]=si[26]=1;at[144]=at[26]=-1;vt[144]=vt[26]=0;yt[144]=yt[26]=1;kt[36]=kt[134]=0;dt[36]=dt[134]=1;gt[36]=gt[134]=1;ri[36]=ri[134]=0;ui[36]=ui[134]=1;fi[36]=fi[134]=0;ht[36]=ht[134]=0;ct[36]=ct[134]=-1;lt[36]=lt[134]=1;at[36]=at[134]=1;vt[36]=vt[134]=0;yt[36]=yt[134]=0;pt[9]=pt[161]=-1;wt[9]=wt[161]=0;bt[9]=bt[161]=0;kt[9]=kt[161]=0;dt[9]=dt[161]=-1;gt[9]=gt[161]=0;ni[9]=ni[161]=1;ti[9]=ti[161]=0;ii[9]=ii[161]=0;hi[9]=hi[161]=1;ci[9]=ci[161]=0;li[9]=li[161]=1;pt[136]=0;wt[136]=1;bt[136]=1;kt[136]=0;dt[136]=1;gt[136]=0;ri[136]=-1;ui[136]=0;fi[136]=1;ni[136]=-1;ti[136]=0;ii[136]=0;hi[136]=0;ci[136]=-1;li[136]=0;ei[136]=0;oi[136]=-1;si[136]=1;ht[136]=1;ct[136]=0;lt[136]=0;at[136]=1;vt[136]=0;yt[136]=1;pt[34]=0;wt[34]=-1;bt[34]=0;kt[34]=0;dt[34]=-1;gt[34]=1;ri[34]=1;ui[34]=0;fi[34]=0;ni[34]=1;ti[34]=0;ii[34]=1;hi[34]=0;ci[34]=1;li[34]=1;ei[34]=0;oi[34]=1;si[34]=0;ht[34]=-1;ct[34]=0;lt[34]=1;at[34]=-1;vt[34]=0;yt[34]=0;pt[35]=0;wt[35]=1;bt[35]=1;kt[35]=0;dt[35]=-1;gt[35]=1;ri[35]=1;ui[35]=0;fi[35]=0;ni[35]=-1;ti[35]=0;ii[35]=0;hi[35]=0;ci[35]=-1;li[35]=0;ei[35]=0;oi[35]=1;si[35]=0;ht[35]=-1;ct[35]=0;lt[35]=1;at[35]=1;vt[35]=0;yt[35]=1;pt[153]=0;wt[153]=1;bt[153]=1;ni[153]=-1;ti[153]=0;ii[153]=0;hi[153]=0;ci[153]=-1;li[153]=0;at[153]=1;vt[153]=0;yt[153]=1;kt[102]=0;dt[102]=-1;gt[102]=1;ri[102]=1;ui[102]=0;fi[102]=0;ei[102]=0;oi[102]=1;si[102]=0;ht[102]=-1;ct[102]=0;lt[102]=1;pt[155]=0;wt[155]=-1;bt[155]=0;ni[155]=1;ti[155]=0;ii[155]=1;hi[155]=0;ci[155]=1;li[155]=1;at[155]=-1;vt[155]=0;yt[155]=0;kt[103]=0;dt[103]=1;gt[103]=0;ri[103]=-1;ui[103]=0;fi[103]=1;ei[103]=0;oi[103]=-1;si[103]=1;ht[103]=1;ct[103]=0;lt[103]=0;pt[152]=0;wt[152]=1;bt[152]=1;ri[152]=-1;ui[152]=0;fi[152]=1;ni[152]=-1;ti[152]=0;ii[152]=0;hi[152]=0;ci[152]=-1;li[152]=0;ei[152]=0;oi[152]=-1;si[152]=1;at[152]=1;vt[152]=0;yt[152]=1;pt[156]=0;wt[156]=-1;bt[156]=1;ri[156]=1;ui[156]=0;fi[156]=1;ni[156]=-1;ti[156]=0;ii[156]=0;hi[156]=0;ci[156]=-1;li[156]=0;ei[156]=0;oi[156]=1;si[156]=1;at[156]=-1;vt[156]=0;yt[156]=1;pt[137]=0;wt[137]=1;bt[137]=1;kt[137]=0;dt[137]=1;gt[137]=0;ni[137]=-1;ti[137]=0;ii[137]=0;hi[137]=0;ci[137]=-1;li[137]=0;ht[137]=1;ct[137]=0;lt[137]=0;at[137]=1;vt[137]=0;yt[137]=1;pt[139]=0;wt[139]=1;bt[139]=1;kt[139]=0;dt[139]=-1;gt[139]=0;ni[139]=1;ti[139]=0;ii[139]=0;hi[139]=0;ci[139]=1;li[139]=0;ht[139]=-1;ct[139]=0;lt[139]=0;at[139]=1;vt[139]=0;yt[139]=1;pt[98]=0;wt[98]=-1;bt[98]=0;kt[98]=0;dt[98]=-1;gt[98]=1;ri[98]=1;ui[98]=0;fi[98]=0;ni[98]=1;ti[98]=0;ii[98]=1;ei[98]=0;oi[98]=1;si[98]=0;ht[98]=-1;ct[98]=0;lt[98]=1;pt[99]=0;wt[99]=1;bt[99]=0;kt[99]=0;dt[99]=-1;gt[99]=1;ri[99]=1;ui[99]=0;fi[99]=0;ni[99]=-1;ti[99]=0;ii[99]=1;ei[99]=0;oi[99]=-1;si[99]=0;ht[99]=1;ct[99]=0;lt[99]=1;kt[38]=0;dt[38]=-1;gt[38]=1;ri[38]=1;ui[38]=0;fi[38]=0;hi[38]=0;ci[38]=1;li[38]=1;ei[38]=0;oi[38]=1;si[38]=0;ht[38]=-1;ct[38]=0;lt[38]=1;at[38]=-1;vt[38]=0;yt[38]=0;kt[39]=0;dt[39]=1;gt[39]=1;ri[39]=-1;ui[39]=0;fi[39]=0;hi[39]=0;ci[39]=-1;li[39]=1;ei[39]=0;oi[39]=1;si[39]=0;ht[39]=-1;ct[39]=0;lt[39]=1;at[39]=1;vt[39]=0;yt[39]=0;var grt=function(n){return[[n.bottomleft,0],[0,0],[0,n.leftbottom]]},nut=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0]]},tut=function(n){return[[n.topright,1],[1,1],[1,n.righttop]]},iut=function(n){return[[0,n.lefttop],[0,1],[n.topleft,1]]},rut=function(n){return[[n.bottomright,0],[n.bottomleft,0],[0,n.leftbottom],[0,n.lefttop]]},uut=function(n){return[[n.bottomright,0],[n.bottomleft,0],[1,n.righttop],[1,n.rightbottom]]},fut=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.topleft,1],[n.topright,1]]},eut=function(n){return[[0,n.leftbottom],[0,n.lefttop],[n.topleft,1],[n.topright,1]]},c=[],h=[],w=[],y=[],nt=[],g=[],ai=[],vi=[];y[1]=nt[1]=18;y[169]=nt[169]=18;w[4]=h[4]=12;w[166]=h[166]=12;c[16]=vi[16]=4;c[154]=vi[154]=4;g[64]=ai[64]=22;g[106]=ai[106]=22;w[2]=g[2]=17;y[2]=nt[2]=18;w[168]=g[168]=17;y[168]=nt[168]=18;c[8]=y[8]=9;h[8]=w[8]=12;c[162]=y[162]=9;h[162]=w[162]=12;c[32]=vi[32]=4;h[32]=ai[32]=1;c[138]=vi[138]=4;h[138]=ai[138]=1;nt[128]=vi[128]=21;g[128]=ai[128]=22;nt[42]=vi[42]=21;g[42]=ai[42]=22;h[5]=nt[5]=14;h[165]=nt[165]=14;w[20]=vi[20]=6;w[150]=vi[150]=6;c[80]=g[80]=11;c[90]=g[90]=11;y[65]=ai[65]=3;y[105]=ai[105]=3;c[160]=g[160]=11;h[160]=nt[160]=14;c[10]=g[10]=11;h[10]=nt[10]=14;w[130]=vi[130]=6;y[130]=ai[130]=3;w[40]=vi[40]=6;y[40]=ai[40]=3;h[101]=ai[101]=1;h[69]=ai[69]=1;nt[149]=vi[149]=21;nt[21]=vi[21]=21;w[86]=g[86]=17;w[84]=g[84]=17;c[89]=y[89]=9;c[81]=y[81]=9;c[96]=ai[96]=0;h[96]=g[96]=15;c[74]=ai[74]=0;h[74]=g[74]=15;c[24]=w[24]=8;y[24]=vi[24]=7;c[146]=w[146]=8;y[146]=vi[146]=7;h[6]=g[6]=15;w[6]=nt[6]=16;h[164]=g[164]=15;w[164]=nt[164]=16;y[129]=vi[129]=7;nt[129]=ai[129]=20;y[41]=vi[41]=7;nt[41]=ai[41]=20;w[66]=ai[66]=2;y[66]=g[66]=19;w[104]=ai[104]=2;y[104]=g[104]=19;c[144]=nt[144]=10;g[144]=vi[144]=23;c[26]=nt[26]=10;g[26]=vi[26]=23;h[36]=vi[36]=5;w[36]=ai[36]=2;h[134]=vi[134]=5;w[134]=ai[134]=2;c[9]=nt[9]=10;h[9]=y[9]=13;c[161]=nt[161]=10;h[161]=y[161]=13;h[37]=vi[37]=5;nt[37]=ai[37]=20;h[133]=vi[133]=5;nt[133]=ai[133]=20;w[148]=nt[148]=16;g[148]=vi[148]=23;w[22]=nt[22]=16;g[22]=vi[22]=23;c[82]=w[82]=8;y[82]=g[82]=19;c[88]=w[88]=8;y[88]=g[88]=19;c[73]=ai[73]=0;h[73]=y[73]=13;c[97]=ai[97]=0;h[97]=y[97]=13;c[145]=y[145]=9;nt[145]=vi[145]=21;c[25]=y[25]=9;nt[25]=vi[25]=21;h[70]=ai[70]=1;w[70]=g[70]=17;h[100]=ai[100]=1;w[100]=g[100]=17;c[34]=y[34]=9;h[34]=w[34]=12;nt[34]=vi[34]=21;g[34]=ai[34]=22;c[136]=vi[136]=4;h[136]=ai[136]=1;w[136]=g[136]=17;y[136]=nt[136]=18;c[35]=vi[35]=4;h[35]=w[35]=12;y[35]=nt[35]=18;g[35]=ai[35]=22;c[153]=vi[153]=4;y[153]=nt[153]=18;h[102]=w[102]=12;g[102]=ai[102]=22;c[155]=y[155]=9;nt[155]=vi[155]=23;h[103]=ai[103]=1;w[103]=g[103]=17;c[152]=vi[152]=4;w[152]=g[152]=17;y[152]=nt[152]=18;c[156]=w[156]=8;y[156]=nt[156]=18;g[156]=vi[156]=23;c[137]=vi[137]=4;h[137]=ai[137]=1;y[137]=nt[137]=18;c[139]=vi[139]=4;h[139]=y[139]=13;nt[139]=ai[139]=20;c[98]=y[98]=9;h[98]=w[98]=12;g[98]=ai[98]=22;c[99]=ai[99]=0;h[99]=w[99]=12;y[99]=g[99]=19;h[38]=w[38]=12;nt[38]=vi[38]=21;g[38]=ai[38]=22;h[39]=vi[39]=5;w[39]=nt[39]=16;g[39]=ai[39]=22;s=[];s[1]=s[169]=grt;s[4]=s[166]=nut;s[16]=s[154]=tut;s[64]=s[106]=iut;s[168]=s[2]=rut;s[162]=s[8]=uut;s[138]=s[32]=fut;s[42]=s[128]=eut;s[5]=s[165]=function(n){return[[0,0],[0,n.leftbottom],[1,n.rightbottom],[1,0]]};s[20]=s[150]=function(n){return[[1,0],[n.bottomright,0],[n.topright,1],[1,1]]};s[80]=s[90]=function(n){return[[1,1],[1,n.righttop],[0,n.lefttop],[0,1]]};s[65]=s[105]=function(n){return[[n.bottomleft,0],[0,0],[0,1],[n.topleft,1]]};s[160]=s[10]=function(n){return[[1,n.righttop],[1,n.rightbottom],[0,n.leftbottom],[0,n.lefttop]]};s[130]=s[40]=function(n){return[[n.topleft,1],[n.topright,1],[n.bottomright,0],[n.bottomleft,0]]};s[85]=function(){return[[0,0],[0,1],[1,1],[1,0]]};s[101]=s[69]=function(n){return[[1,n.rightbottom],[1,0],[0,0],[0,1],[n.topleft,1]]};s[149]=s[21]=function(n){return[[n.topright,1],[1,1],[1,0],[0,0],[0,n.leftbottom]]};s[86]=s[84]=function(n){return[[1,0],[n.bottomright,0],[0,n.lefttop],[0,1],[1,1]]};s[89]=s[81]=function(n){return[[1,1],[1,n.righttop],[n.bottomleft,0],[0,0],[0,1]]};s[96]=s[74]=function(n){return[[1,n.righttop],[1,n.rightbottom],[0,n.lefttop],[0,1],[n.topleft,1]]};s[24]=s[146]=function(n){return[[1,1],[1,n.righttop],[n.bottomright,0],[n.bottomleft,0],[n.topright,1]]};s[6]=s[164]=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[0,n.leftbottom],[0,n.lefttop]]};s[129]=s[41]=function(n){return[[n.topright,1],[n.bottomleft,0],[0,0],[0,n.leftbottom],[n.topleft,1]]};s[66]=s[104]=function(n){return[[n.bottomright,0],[n.bottomleft,0],[0,n.lefttop],[0,1],[n.topleft,1]]};s[144]=s[26]=function(n){return[[1,1],[1,n.righttop],[0,n.leftbottom],[0,n.lefttop],[n.topright,1]]};s[36]=s[134]=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[n.topleft,1],[n.topright,1]]};s[9]=s[161]=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomleft,0],[0,0],[0,n.leftbottom]]};s[37]=s[133]=function(n){return[[1,n.rightbottom],[1,0],[0,0],[0,n.leftbottom],[n.topleft,1],[n.topright,1]]};s[148]=s[22]=function(n){return[[1,1],[1,0],[n.bottomright,0],[0,n.leftbottom],[0,n.lefttop],[n.topright,1]]};s[82]=s[88]=function(n){return[[1,1],[1,n.righttop],[n.bottomright,0],[n.bottomleft,0],[0,n.lefttop],[0,1]]};s[73]=s[97]=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomleft,0],[0,0],[0,1],[n.topleft,1]]};s[145]=s[25]=function(n){return[[1,1],[1,n.righttop],[n.bottomleft,0],[0,0],[0,n.leftbottom],[n.topright,1]]};s[70]=s[100]=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[0,n.lefttop],[0,1],[n.topleft,1]]};s[34]=function(n){return[eut(n),uut(n)]};s[35]=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomright,0],[n.bottomleft,0],[0,n.leftbottom],[0,n.lefttop],[n.topleft,1],[n.topright,1]]};s[136]=function(n){return[fut(n),rut(n)]};s[153]=function(n){return[tut(n),grt(n)]};s[102]=function(n){return[nut(n),iut(n)]};s[155]=function(n){return[[1,1],[1,n.righttop],[n.bottomleft,0],[0,0],[0,n.leftbottom],[n.topright,1]]};s[103]=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[0,n.lefttop],[0,1],[n.topleft,1]]};s[152]=function(n){return[tut(n),rut(n)]};s[156]=function(n){return[[1,1],[1,n.righttop],[n.bottomright,0],[n.bottomleft,0],[0,n.leftbottom],[0,n.lefttop],[n.topright,1]]};s[137]=function(n){return[fut(n),grt(n)]};s[139]=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomleft,0],[0,0],[0,n.leftbottom],[n.topleft,1],[n.topright,1]]};s[98]=function(n){return[uut(n),iut(n)]};s[99]=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomright,0],[n.bottomleft,0],[0,n.lefttop],[0,1],[n.topleft,1]]};s[38]=function(n){return[nut(n),eut(n)]};s[39]=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[0,n.leftbottom],[0,n.lefttop],[n.topleft,1],[n.topright,1]]};wh=function n(t){this.id=n.buildId(t);this.coordinates=t;this.innerEdges=[];this.outerEdges=[];this.outerEdgesSorted=!1};wh.buildId=function(n){return n.join(",")};wh.prototype.removeInnerEdge=function(n){this.innerEdges=this.innerEdges.filter(function(t){return t.from.id!==n.from.id})};wh.prototype.removeOuterEdge=function(n){this.outerEdges=this.outerEdges.filter(function(t){return t.to.id!==n.to.id})};wh.prototype.addOuterEdge=function(n){this.outerEdges.push(n);this.outerEdgesSorted=!1};wh.prototype.sortOuterEdges=function(){var n=this;this.outerEdgesSorted||(this.outerEdges.sort(function(t,i){var r=t.to,u=i.to,f;return r.coordinates[0]-n.coordinates[0]>=0&&u.coordinates[0]-n.coordinates[0]<0?1:r.coordinates[0]-n.coordinates[0]<0&&u.coordinates[0]-n.coordinates[0]>=0?-1:r.coordinates[0]-n.coordinates[0]==0&&u.coordinates[0]-n.coordinates[0]==0?r.coordinates[1]-n.coordinates[1]>=0||u.coordinates[1]-n.coordinates[1]>=0?r.coordinates[1]-u.coordinates[1]:u.coordinates[1]-r.coordinates[1]:(f=kit(n.coordinates,r.coordinates,u.coordinates),f<0)?1:f>0?-1:Math.pow(r.coordinates[0]-n.coordinates[0],2)+Math.pow(r.coordinates[1]-n.coordinates[1],2)-(Math.pow(u.coordinates[0]-n.coordinates[0],2)+Math.pow(u.coordinates[1]-n.coordinates[1],2))}),this.outerEdgesSorted=!0)};wh.prototype.getOuterEdges=function(){return this.sortOuterEdges(),this.outerEdges};wh.prototype.getOuterEdge=function(n){return this.sortOuterEdges(),this.outerEdges[n]};wh.prototype.addInnerEdge=function(n){this.innerEdges.push(n)};al=function(n,t){this.from=n;this.to=t;this.next=void 0;this.label=void 0;this.symetric=void 0;this.ring=void 0;this.from.addOuterEdge(this);this.to.addInnerEdge(this)};al.prototype.getSymetric=function(){return this.symetric||(this.symetric=new al(this.to,this.from),this.symetric.symetric=this),this.symetric};al.prototype.deleteEdge=function(){this.from.removeOuterEdge(this);this.to.removeInnerEdge(this)};al.prototype.isEqual=function(n){return this.from.id===n.from.id&&this.to.id===n.to.id};al.prototype.toString=function(){return"Edge { "+this.from.id+" -> "+this.to.id+" }"};al.prototype.toLineString=function(){return ur([this.from.coordinates,this.to.coordinates])};al.prototype.compareTo=function(n){return kit(n.from.coordinates,n.to.coordinates,this.to.coordinates)};ye=function(){this.edges=[];this.polygon=void 0;this.envelope=void 0};out={length:{configurable:!0}};ye.prototype.push=function(n){this[this.edges.length]=n;this.edges.push(n);this.polygon=this.envelope=void 0};ye.prototype.get=function(n){return this.edges[n]};out.length.get=function(){return this.edges.length};ye.prototype.forEach=function(n){this.edges.forEach(n)};ye.prototype.map=function(n){return this.edges.map(n)};ye.prototype.some=function(n){return this.edges.some(n)};ye.prototype.isValid=function(){return!0};ye.prototype.isHole=function(){var u=this,n=this.edges.reduce(function(n,t,i){return t.from.coordinates[1]>u.edges[n].from.coordinates[1]&&(n=i),n},0),t=(0===n?this.length:n)-1,i=(n+1)%this.length,r=kit(this.edges[t].from.coordinates,this.edges[n].from.coordinates,this.edges[i].from.coordinates);return 0===r?this.edges[t].from.coordinates[0]>this.edges[i].from.coordinates[0]:r>0};ye.prototype.toMultiPoint=function(){return yk(this.edges.map(function(n){return n.from.coordinates}))};ye.prototype.toPolygon=function(){if(this.polygon)return this.polygon;var n=this.edges.map(function(n){return n.from.coordinates});return n.push(this.edges[0].from.coordinates),this.polygon=st([n])};ye.prototype.getEnvelope=function(){return this.envelope?this.envelope:this.envelope=uot(this.toPolygon())};ye.findEdgeRingContaining=function(n,t){var r,i,u=n.getEnvelope();return t.forEach(function(t){var f=t.getEnvelope(),e;(i&&(r=i.getEnvelope()),!function(n,t){var i=n.geometry.coordinates.map(function(n){return n[0]}),r=n.geometry.coordinates.map(function(n){return n[1]}),u=t.geometry.coordinates.map(function(n){return n[0]}),f=t.geometry.coordinates.map(function(n){return n[1]});return Math.max(null,i)===Math.max(null,u)&&Math.max(null,r)===Math.max(null,f)&&Math.min(null,i)===Math.min(null,u)&&Math.min(null,r)===Math.min(null,f)}(f,u)&&aht(f,u))&&(e=n.map(function(n){return n.from.coordinates}).find(function(n){return!t.some(function(t){return function(n,t){return n[0]===t[0]&&n[1]===t[1]}(n,t.from.coordinates)})}),e&&t.inside(wi(e))&&(i&&!aht(r,f)||(i=t)))}),i};ye.prototype.inside=function(n){return pr(n,this.toPolygon())};Object.defineProperties(ye.prototype,out);oe=function(){this.edges=[];this.nodes={}};oe.fromGeoJson=function(n){!function(n){if(!n)throw new Error("No geojson passed");if("FeatureCollection"!==n.type&&"GeometryCollection"!==n.type&&"MultiLineString"!==n.type&&"LineString"!==n.type&&"Feature"!==n.type)throw new Error("Invalid input type '"+n.type+"'. Geojson must be FeatureCollection, GeometryCollection, LineString, MultiLineString or Feature");}(n);var t=new oe;return su(n,function(n){yw(n,"LineString","Graph::fromGeoJson");bk(n,function(n,i){if(n){var r=t.getNode(n),u=t.getNode(i);t.addEdge(r,u)}return i})}),t};oe.prototype.getNode=function(n){var i=wh.buildId(n),t=this.nodes[i];return t||(t=this.nodes[i]=new wh(n)),t};oe.prototype.addEdge=function(n,t){var i=new al(n,t),r=i.getSymetric();this.edges.push(i);this.edges.push(r)};oe.prototype.deleteDangles=function(){var n=this;Object.keys(this.nodes).map(function(t){return n.nodes[t]}).forEach(function(t){return n._removeIfDangle(t)})};oe.prototype._removeIfDangle=function(n){var i=this,t;n.innerEdges.length<=1&&(t=n.getOuterEdges().map(function(n){return n.to}),this.removeNode(n),t.forEach(function(n){return i._removeIfDangle(n)}))};oe.prototype.deleteCutEdges=function(){var n=this;this._computeNextCWEdges();this._findLabeledEdgeRings();this.edges.forEach(function(t){t.label===t.symetric.label&&(n.removeEdge(t.symetric),n.removeEdge(t))})};oe.prototype._computeNextCWEdges=function(n){var t=this;void 0===n?Object.keys(this.nodes).forEach(function(n){return t._computeNextCWEdges(t.nodes[n])}):n.getOuterEdges().forEach(function(t,i){n.getOuterEdge((0===i?n.getOuterEdges().length:i)-1).symetric.next=t})};oe.prototype._computeNextCCWEdges=function(n,t){for(var e,i,o=n.getOuterEdges(),u=o.length-1;u>=0;--u){var s=o[u],h=s.symetric,r=void 0,f=void 0;s.label===t&&(r=s);h.label===t&&(f=h);r&&f&&(f&&(i=f),r&&(i&&(i.next=r,i=void 0),e||(e=r)))}i&&(i.next=e)};oe.prototype._findLabeledEdgeRings=function(){var n=[],t=0;return this.edges.forEach(function(i){if(!(i.label>=0)){n.push(i);var r=i;do r.label=t,r=r.next;while(!i.isEqual(r));t++}}),n};oe.prototype.getEdgeRings=function(){var n=this,t;return this._computeNextCWEdges(),this.edges.forEach(function(n){n.label=void 0}),this._findLabeledEdgeRings().forEach(function(t){n._findIntersectionNodes(t).forEach(function(i){n._computeNextCCWEdges(i,t.label)})}),t=[],this.edges.forEach(function(i){i.ring||t.push(n._findEdgeRing(i))}),t};oe.prototype._findIntersectionNodes=function(n){var i=[],t=n,r=function(){var r=0;t.from.getOuterEdges().forEach(function(t){t.label===n.label&&++r});r>1&&i.push(t.from);t=t.next};do r();while(!n.isEqual(t));return i};oe.prototype._findEdgeRing=function(n){var t=n,i=new ye;do i.push(t),t.ring=i,t=t.next;while(!n.isEqual(t));return i};oe.prototype.removeNode=function(n){var t=this;n.getOuterEdges().forEach(function(n){return t.removeEdge(n)});n.innerEdges.forEach(function(n){return t.removeEdge(n)});delete this.nodes[n.id]};oe.prototype.removeEdge=function(n){this.edges=this.edges.filter(function(t){return!t.isEqual(n)});n.deleteEdge()};var sut=sl(function(n){function t(n){var t=[];for(var i in n)t.push(i);return t}(n.exports="function"==typeof Object.keys?Object.keys:t).shim=t}),bg=(sut.shim,sl(function(n,t){function i(n){return"[object Arguments]"==Object.prototype.toString.call(n)}function r(n){return n&&"object"==typeof n&&"number"==typeof n.length&&Object.prototype.hasOwnProperty.call(n,"callee")&&!Object.prototype.propertyIsEnumerable.call(n,"callee")||!1}var u="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();(t=n.exports=u?i:r).supported=i;t.unsupported=r})),vbt=(bg.supported,bg.unsupported,sl(function(n){function t(n){return null===n||void 0===n}function i(n){return!(!n||"object"!=typeof n||"number"!=typeof n.length)&&"function"==typeof n.copy&&"function"==typeof n.slice&&!(n.length>0&&"number"!=typeof n[0])}var r=Array.prototype.slice,u=n.exports=function(n,f,e){return e||(e={}),n===f||(n instanceof Date&&f instanceof Date?n.getTime()===f.getTime():!n||!f||"object"!=typeof n&&"object"!=typeof f?e.strict?n===f:n==f:function(n,f,e){var o,c,s,h;if(t(n)||t(f)||n.prototype!==f.prototype)return!1;if(bg(n))return!!bg(f)&&(n=r.call(n),f=r.call(f),u(n,f,e));if(i(n)){if(!i(f)||n.length!==f.length)return!1;for(o=0;o<n.length;o++)if(n[o]!==f[o])return!1;return!0}try{s=sut(n);h=sut(f)}catch(n){return!1}if(s.length!=h.length)return!1;for(s.sort(),h.sort(),o=s.length-1;o>=0;o--)if(s[o]!=h[o])return!1;for(o=s.length-1;o>=0;o--)if(c=s[o],!u(n[c],f[c],e))return!1;return typeof n==typeof f}(n,f,e))}})),cc=function(n){this.precision=n&&n.precision?n.precision:17;this.direction=!(!n||!n.direction)&&n.direction;this.pseudoNode=!(!n||!n.pseudoNode)&&n.pseudoNode;this.objectComparator=n&&n.objectComparator?n.objectComparator:vpt};cc.prototype.compare=function(n,t){if(n.type!==t.type||!nct(n,t))return!1;switch(n.type){case"Point":return this.compareCoord(n.coordinates,t.coordinates);case"LineString":return this.compareLine(n.coordinates,t.coordinates,0,!1);case"Polygon":return this.comparePolygon(n,t);case"Feature":return this.compareFeature(n,t);default:if(0===n.type.indexOf("Multi")){var i=this,r=ght(n),u=ght(t);return r.every(function(n){return this.some(function(t){return i.compare(n,t)})},u)}}return!1};cc.prototype.compareCoord=function(n,t){if(n.length!==t.length)return!1;for(var i=0;i<n.length;i++)if(n[i].toFixed(this.precision)!==t[i].toFixed(this.precision))return!1;return!0};cc.prototype.compareLine=function(n,t,i,r){var f,u,e;return nct(n,t)?(f=this.pseudoNode?n:this.removePseudo(n),u=this.pseudoNode?t:this.removePseudo(t),!r||this.compareCoord(f[0],u[0])||(u=this.fixStartIndex(u,f))?(e=this.compareCoord(f[i],u[i]),this.direction||e?this.comparePath(f,u):!!this.compareCoord(f[i],u[u.length-(1+i)])&&this.comparePath(f.slice().reverse(),u)):void 0):!1};cc.prototype.fixStartIndex=function(n,t){for(var u,i=-1,r=0;r<n.length;r++)if(this.compareCoord(n[r],t[0])){i=r;break}return i>=0&&(u=[].concat(n.slice(i,n.length),n.slice(1,i+1))),u};cc.prototype.comparePath=function(n,t){var i=this;return n.every(function(n,t){return i.compareCoord(n,this[t])},t)};cc.prototype.comparePolygon=function(n,t){if(this.compareLine(n.coordinates[0],t.coordinates[0],1,!0)){var i=n.coordinates.slice(1,n.coordinates.length),r=t.coordinates.slice(1,t.coordinates.length),u=this;return i.every(function(n){return this.some(function(t){return u.compareLine(n,t,1,!0)})},r)}return!1};cc.prototype.compareFeature=function(n,t){return!(n.id!==t.id||!this.objectComparator(n.properties,t.properties)||!this.compareBBox(n,t))&&this.compare(n.geometry,t.geometry)};cc.prototype.compareBBox=function(n,t){return!!(!n.bbox&&!t.bbox||n.bbox&&t.bbox&&this.compareCoord(n.bbox,t.bbox))};cc.prototype.removePseudo=function(n){return n};var nvt=cc,ybt=sl(function(n){function t(n,t,i,r){this.dataset=[];this.epsilon=1;this.minPts=2;this.distance=this._euclideanDistance;this.clusters=[];this.noise=[];this._visited=[];this._assigned=[];this._datasetLength=0;this._init(n,t,i,r)}t.prototype.run=function(n,t,i,r){var u,f,e;for(this._init(n,t,i,r),u=0;u<this._datasetLength;u++)1!==this._visited[u]&&(this._visited[u]=1,f=this._regionQuery(u),f.length<this.minPts?this.noise.push(u):(e=this.clusters.length,this.clusters.push([]),this._addToCluster(u,e),this._expandCluster(e,f)));return this.clusters};t.prototype._init=function(n,t,i,r){if(n){if(!(n instanceof Array))throw Error("Dataset must be of type array, "+typeof n+" given");this.dataset=n;this.clusters=[];this.noise=[];this._datasetLength=n.length;this._visited=new Array(this._datasetLength);this._assigned=new Array(this._datasetLength)}t&&(this.epsilon=t);i&&(this.minPts=i);r&&(this.distance=r)};t.prototype._expandCluster=function(n,t){for(var i,u,r=0;r<t.length;r++)i=t[r],1!==this._visited[i]&&(this._visited[i]=1,u=this._regionQuery(i),u.length>=this.minPts&&(t=this._mergeArrays(t,u))),1!==this._assigned[i]&&this._addToCluster(i,n)};t.prototype._addToCluster=function(n,t){this.clusters[t].push(n);this._assigned[n]=1};t.prototype._regionQuery=function(n){for(var i=[],t=0;t<this._datasetLength;t++)this.distance(this.dataset[n],this.dataset[t])<this.epsilon&&i.push(t);return i};t.prototype._mergeArrays=function(n,t){for(var r,u=t.length,i=0;i<u;i++)r=t[i],n.indexOf(r)<0&&n.push(r);return n};t.prototype._euclideanDistance=function(n,t){for(var r=0,i=Math.min(n.length,t.length);i--;)r+=(n[i]-t[i])*(n[i]-t[i]);return Math.sqrt(r)};n.exports&&(n.exports=t)}),pbt=sl(function(n){function t(n,t,i){this.k=3;this.dataset=[];this.assignments=[];this.centroids=[];this.init(n,t,i)}t.prototype.init=function(n,t,i){this.assignments=[];this.centroids=[];void 0!==n&&(this.dataset=n);void 0!==t&&(this.k=t);void 0!==i&&(this.distance=i)};t.prototype.run=function(n,t){var c,e,o,r,u,f;for(this.init(n,t),c=this.dataset.length,e=0;e<this.k;e++)this.centroids[e]=this.randomCentroid();for(o=!0;o;)for(o=this.assign(),r=0;r<this.k;r++){for(var s=new Array(f),h=0,i=0;i<f;i++)s[i]=0;for(u=0;u<c;u++)if(f=this.dataset[u].length,r===this.assignments[u]){for(i=0;i<f;i++)s[i]+=this.dataset[u][i];h++}if(h>0){for(i=0;i<f;i++)s[i]/=h;this.centroids[r]=s}else this.centroids[r]=this.randomCentroid(),o=!0}return this.getClusters()};t.prototype.randomCentroid=function(){var n,t,i=this.dataset.length-1;do t=Math.round(Math.random()*i),n=this.dataset[t];while(this.centroids.indexOf(n)>=0);return n};t.prototype.assign=function(){for(var t,i=!1,r=this.dataset.length,n=0;n<r;n++)(t=this.argmin(this.dataset[n],this.centroids,this.distance))!=this.assignments[n]&&(this.assignments[n]=t,i=!0);return i};t.prototype.getClusters=function(){for(var i,n=new Array(this.k),t=0;t<this.assignments.length;t++)void 0===n[i=this.assignments[t]]&&(n[i]=[]),n[i].push(t);return n};t.prototype.argmin=function(n,t,i){for(var u,f=Number.MAX_VALUE,e=0,o=t.length,r=0;r<o;r++)(u=i(n,t[r]))<f&&(f=u,e=r);return e};t.prototype.distance=function(n,t){for(var u,r=0,i=Math.min(n.length,t.length);i--;)u=n[i]-t[i],r+=u*u;return Math.sqrt(r)};n.exports&&(n.exports=t)}),tvt=sl(function(n){function t(n,t,i){this._queue=[];this._priorities=[];this._sorting="desc";this._init(n,t,i)}t.prototype.insert=function(n,t){for(var u,i=this._queue.length,r=i;r--;)u=this._priorities[r],"desc"===this._sorting?t>u&&(i=r):t<u&&(i=r);this._insertAt(n,t,i)};t.prototype.remove=function(n){for(var t=this._queue.length;t--;)if(n===this._queue[t]){this._queue.splice(t,1);this._priorities.splice(t,1);break}};t.prototype.forEach=function(n){this._queue.forEach(n)};t.prototype.getElements=function(){return this._queue};t.prototype.getElementPriority=function(n){return this._priorities[n]};t.prototype.getPriorities=function(){return this._priorities};t.prototype.getElementsWithPriorities=function(){for(var t=[],n=0,i=this._queue.length;n<i;n++)t.push([this._queue[n],this._priorities[n]]);return t};t.prototype._init=function(n,t,i){if(n&&t){if(this._queue=[],this._priorities=[],n.length!==t.length)throw new Error("Arrays must have the same length");for(var r=0;r<n.length;r++)this.insert(n[r],t[r])}i&&(this._sorting=i)};t.prototype._insertAt=function(n,t,i){this._queue.length===i?(this._queue.push(n),this._priorities.push(t)):(this._queue.splice(i,0,n),this._priorities.splice(i,0,t))};n.exports&&(n.exports=t)}),wbt=sl(function(n){function t(n,t,i,r){this.epsilon=1;this.minPts=1;this.distance=this._euclideanDistance;this._reachability=[];this._processed=[];this._coreDistance=0;this._orderedList=[];this._init(n,t,i,r)}if(n.exports)var i=tvt;t.prototype.run=function(n,t,r,u){var f,o,s,e,h;for(this._init(n,t,r,u),f=0,o=this.dataset.length;f<o;f++)1!==this._processed[f]&&(this._processed[f]=1,this.clusters.push([f]),s=this.clusters.length-1,this._orderedList.push(f),e=new i(null,null,"asc"),h=this._regionQuery(f),void 0!==this._distanceToCore(f)&&(this._updateQueue(f,h,e),this._expandCluster(s,e)));return this.clusters};t.prototype.getReachabilityPlot=function(){for(var t,r,i=[],n=0,u=this._orderedList.length;n<u;n++)t=this._orderedList[n],r=this._reachability[t],i.push([t,r]);return i};t.prototype._init=function(n,t,i,r){if(n){if(!(n instanceof Array))throw Error("Dataset must be of type array, "+typeof n+" given");this.dataset=n;this.clusters=[];this._reachability=new Array(this.dataset.length);this._processed=new Array(this.dataset.length);this._coreDistance=0;this._orderedList=[]}t&&(this.epsilon=t);i&&(this.minPts=i);r&&(this.distance=r)};t.prototype._updateQueue=function(n,t,i){var r=this;this._coreDistance=this._distanceToCore(n);t.forEach(function(t){if(void 0===r._processed[t]){var f=r.distance(r.dataset[n],r.dataset[t]),u=Math.max(r._coreDistance,f);void 0===r._reachability[t]?(r._reachability[t]=u,i.insert(t,u)):u<r._reachability[t]&&(r._reachability[t]=u,i.remove(t),i.insert(t,u))}})};t.prototype._expandCluster=function(n,t){for(var i,f,u=t.getElements(),r=0,e=u.length;r<e;r++)i=u[r],void 0===this._processed[i]&&(f=this._regionQuery(i),this._processed[i]=1,this.clusters[n].push(i),this._orderedList.push(i),void 0!==this._distanceToCore(i)&&(this._updateQueue(i,f,t),this._expandCluster(n,t)))};t.prototype._distanceToCore=function(n){for(var i=this.epsilon,t=0;t<i;t++)if(this._regionQuery(n,t).length>=this.minPts)return t};t.prototype._regionQuery=function(n,t){t=t||this.epsilon;for(var r=[],i=0,u=this.dataset.length;i<u;i++)this.distance(this.dataset[n],this.dataset[i])<t&&r.push(i);return r};t.prototype._euclideanDistance=function(n,t){for(var r=0,i=Math.min(n.length,t.length);i--;)r+=(n[i]-t[i])*(n[i]-t[i]);return Math.sqrt(r)};n.exports&&(n.exports=t)}),db=sl(function(n){n.exports&&(n.exports={DBSCAN:ybt,KMEANS:pbt,OPTICS:wbt,PriorityQueue:tvt})}),ivt=(db.DBSCAN,db.KMEANS,db.OPTICS,db.PriorityQueue,function(n,t,i){for(var f,e=n.length,u=0,r=0;r<e;r++)f=(n[r]||0)-(t[r]||0),u+=f*f;return i?Math.sqrt(u):u}),bbt=ivt,kbt=function(n,t,i){var r=Math.abs(n-t);return i?r:r*r},dbt=ivt,gbt=function(n,t){for(var r,u,f={},i=[],e=t<<2,o=n.length,s=n[0].length>0;i.length<t&&e-->0;)r=n[Math.floor(Math.random()*o)],u=s?r.join("_"):""+r,f[u]||(f[u]=!0,i.push(r));if(i.length<t)throw new Error("Error initializating clusters");return i},nkt=function(n,t){var b=n[0].length?bbt:kbt,u=[],f=n.length,k=n[0].length>0,y=n[Math.floor(Math.random()*f)],s,h,v,c,r,e,w,l;for(k&&y.join("_"),u.push(y);u.length<t;){for(var a=[],d=u.length,p=0,i=[],o=0;o<f;o++){for(s=1/0,h=0;h<d;h++)v=b(n[o],u[h]),v<=s&&(s=v);a[o]=s}for(c=0;c<f;c++)p+=a[c];for(r=0;r<f;r++)i[r]={i:r,v:n[r],pr:a[r]/p,cs:0};for(i.sort(function(n,t){return n.pr-t.pr}),i[0].cs=i[0].pr,e=1;e<f;e++)i[e].cs=i[e-1].cs+i[e].pr;for(w=Math.random(),l=0;l<f-1&&i[l++].cs<w;);u.push(i[l-1].v)}return u},rvt=1e4,tkt=function(n,t,i,r){var u=[],b=[],k=[],ot=[],f=!1,st=r||rvt,d=n.length,l=n[0].length,ut=l>0,g=[],ft,nt,h,e,o,tt,v,s,y,p,c,w;if(i)u="kmrand"==i?gbt(n,t):"kmpp"==i?nkt(n,t):i;else for(ft={};u.length<t;)nt=Math.floor(Math.random()*d),ft[nt]||(ft[nt]=!0,u.push(n[nt]));do{for(ict(t,0,g),h=0;h<d;h++){for(var ht=1/0,et=0,a=0;a<t;a++)(ot=ut?dbt(n[h],u[a]):Math.abs(n[h]-u[a]))<=ht&&(ht=ot,et=a);k[h]=et;g[et]++}for(e=[],o=(b=[],0);o<t;o++)e[o]=ut?ict(l,0,e[o]):0,b[o]=u[o];if(ut){for(tt=0;tt<t;tt++)u[tt]=[];for(v=0;v<d;v++)for(var lt=e[k[v]],at=n[v],it=0;it<l;it++)lt[it]+=at[it];for(f=!0,s=0;s<t;s++){for(var ct=u[s],vt=e[s],yt=b[s],pt=g[s],rt=0;rt<l;rt++)ct[rt]=vt[rt]/pt||0;if(f)for(y=0;y<l;y++)if(yt[y]!=ct[y]){f=!1;break}}}else{for(p=0;p<d;p++)e[k[p]]+=n[p];for(c=0;c<t;c++)u[c]=e[c]/g[c]||0;for(f=!0,w=0;w<t;w++)if(b[w]!=u[w]){f=!1;break}}f=f||--st<=0}while(!f);return{it:rvt-st,k:t,idxs:k,centroids:u}},kg={search:function(n,t,i,r){var f,u,h,c;n.cleanDirty();var l=(r=r||{}).heuristic||kg.heuristics.manhattan,a=r.closest||!1,e=new fct(function(n){return n.f}),o=t;for(t.h=l(t,i),e.push(t);e.size()>0;){if(f=e.pop(),f===i)return uct(f);f.closed=!0;for(var v=n.neighbors(f),s=0,y=v.length;s<y;++s)u=v[s],u.closed||u.isWall()||(h=f.g+u.getCost(f),c=u.visited,(!c||h<u.g)&&(u.visited=!0,u.parent=f,u.h=u.h||l(u,i),u.g=h,u.f=u.g+u.h,n.markDirty(u),a&&(u.h<o.h||u.h===o.h&&u.g<o.g)&&(o=u),c?e.rescoreElement(u):e.push(u)))}return a?uct(o):[]},heuristics:{manhattan:function(n,t){return Math.abs(t.x-n.x)+Math.abs(t.y-n.y)},diagonal:function(n,t){var u=Math.sqrt(2),i=Math.abs(t.x-n.x),r=Math.abs(t.y-n.y);return 1*(i+r)+(u-2)*Math.min(i,r)}},cleanNode:function(n){n.f=0;n.g=0;n.h=0;n.visited=!1;n.closed=!1;n.parent=null}};tp.prototype.init=function(){this.dirtyNodes=[];for(var n=0;n<this.nodes.length;n++)kg.cleanNode(this.nodes[n])};tp.prototype.cleanDirty=function(){for(var n=0;n<this.dirtyNodes.length;n++)kg.cleanNode(this.dirtyNodes[n]);this.dirtyNodes=[]};tp.prototype.markDirty=function(n){this.dirtyNodes.push(n)};tp.prototype.neighbors=function(n){var u=[],t=n.x,r=n.y,i=this.grid;return i[t-1]&&i[t-1][r]&&u.push(i[t-1][r]),i[t+1]&&i[t+1][r]&&u.push(i[t+1][r]),i[t]&&i[t][r-1]&&u.push(i[t][r-1]),i[t]&&i[t][r+1]&&u.push(i[t][r+1]),this.diagonal&&(i[t-1]&&i[t-1][r-1]&&u.push(i[t-1][r-1]),i[t+1]&&i[t+1][r-1]&&u.push(i[t+1][r-1]),i[t-1]&&i[t-1][r+1]&&u.push(i[t-1][r+1]),i[t+1]&&i[t+1][r+1]&&u.push(i[t+1][r+1])),u};tp.prototype.toString=function(){for(var t,r,n,u,f=[],e=this.grid,i=0,o=e.length;i<o;i++){for(t=[],n=0,u=(r=e[i]).length;n<u;n++)t.push(r[n].weight);f.push(t.join(" "))}return f.join("\n")};wd.prototype.toString=function(){return"["+this.x+" "+this.y+"]"};wd.prototype.getCost=function(n){return n&&n.x!==this.x&&n.y!==this.y?1.41421*this.weight:this.weight};wd.prototype.isWall=function(){return 0===this.weight};fct.prototype={push:function(n){this.content.push(n);this.sinkDown(this.content.length-1)},pop:function(){var n=this.content[0],t=this.content.pop();return this.content.length>0&&(this.content[0]=t,this.bubbleUp(0)),n},remove:function(n){var t=this.content.indexOf(n),i=this.content.pop();t!==this.content.length-1&&(this.content[t]=i,this.scoreFunction(i)<this.scoreFunction(n)?this.sinkDown(t):this.bubbleUp(t))},size:function(){return this.content.length},rescoreElement:function(n){this.sinkDown(this.content.indexOf(n))},sinkDown:function(n){for(var t,r,i=this.content[n];n>0;){if(t=(n+1>>1)-1,r=this.content[t],!(this.scoreFunction(i)<this.scoreFunction(r)))break;this.content[t]=i;this.content[n]=r;n=t}},bubbleUp:function(n){for(var s,h,u=this.content.length,f=this.content[n],e=this.scoreFunction(f);;){var o,i=n+1<<1,r=i-1,t=null;if(r<u&&(s=this.content[r],(o=this.scoreFunction(s))<e&&(t=r)),i<u&&(h=this.content[i],this.scoreFunction(h)<(null===t?e:o)&&(t=i)),null===t)break;this.content[n]=this.content[t];this.content[t]=f;n=t}}};hut=function(n){return function(){return n}};bd.prototype={constructor:bd,insert:function(n,t){var i,r,u;if(n){if(t.P=n,t.N=n.N,n.N&&(n.N.P=t),n.N=t,n.R){for(n=n.R;n.L;)n=n.L;n.L=t}else n.R=t;i=n}else this._?(n=ect(this._),t.P=null,t.N=n,n.P=n.L=t,i=n):(t.P=t.N=null,this._=t,i=null);for(t.L=t.R=null,t.U=i,t.C=!0,n=t;i&&i.C;)i===(r=i.U).L?(u=r.R)&&u.C?(i.C=u.C=!1,r.C=!0,n=r):(n===i.R&&(cb(this,i),i=(n=i).U),i.C=!1,r.C=!0,lb(this,r)):(u=r.L)&&u.C?(i.C=u.C=!1,r.C=!0,n=r):(n===i.L&&(lb(this,i),i=(n=i).U),i.C=!1,r.C=!0,cb(this,r)),i=n.U;this._.C=!1},remove:function(n){n.N&&(n.N.P=n.P);n.P&&(n.P.N=n.N);n.N=n.P=null;var t,r,e,i=n.U,f=n.L,u=n.R;if(r=f?u?ect(u):f:u,i?i.L===n?i.L=r:i.R=r:this._=r,f&&u?(e=r.C,r.C=n.C,r.L=f,f.U=r,r!==u?(i=r.U,r.U=n.U,n=r.R,i.L=n,r.R=u,u.U=r):(r.U=i,i=r,n=r.R)):(e=n.C,n=r),n&&(n.U=i),!e)if(n&&n.C)n.C=!1;else{do{if(n===this._)break;if(n===i.L){if((t=i.R).C&&(t.C=!1,i.C=!0,cb(this,i),t=i.R),t.L&&t.L.C||t.R&&t.R.C){t.R&&t.R.C||(t.L.C=!1,t.C=!0,lb(this,t),t=i.R);t.C=i.C;i.C=t.R.C=!1;cb(this,i);n=this._;break}}else if((t=i.L).C&&(t.C=!1,i.C=!0,lb(this,i),t=i.L),t.L&&t.L.C||t.R&&t.R.C){t.L&&t.L.C||(t.R.C=!1,t.C=!0,cb(this,t),t=i.L);t.C=i.C;i.C=t.L.C=!1;lb(this,i);n=this._;break}t.C=!0;n=i;i=i.U}while(!n.C);n&&(n.C=!1)}}};var cut,op,fs,gb,pe,uvt=[],fvt=[],lr=1e-6,ikt=1e-12;nrt.prototype={constructor:nrt,polygons:function(){var n=this.edges;return this.cells.map(function(t){var i=t.halfedges.map(function(i){return oct(t,n[i])});return i.data=t.site.data,i})},triangles:function(){var n=[],t=this.edges;return this.cells.forEach(function(i,r){if(h=(s=i.halfedges).length)for(var s,h,e,o=i.site,c=-1,u=t[s[h-1]],f=u.left===o?u.right:u.left;++c<h;)e=f,f=(u=t[s[c]]).left===o?u.right:u.left,e&&f&&r<e.index&&r<f.index&&twt(o,e,f)<0&&n.push([o.data,e.data,f.data])}),n},links:function(){return this.edges.filter(function(n){return n.right}).map(function(n){return{source:n.left.data,target:n.right.data}})},find:function(n,t,i){for(var o,r,u=this,f=u._found||0,c=u.cells.length;!(r=u.cells[f]);)if(++f>=c)return null;var s=n-r.site[0],h=t-r.site[1],e=s*s+h*h;do r=u.cells[o=f],f=null,r.halfedges.forEach(function(i){var s=u.edges[i],o=s.left;if(o!==r.site&&o||(o=s.right)){var h=n-o[0],c=t-o[1],l=h*h+c*c;l<e&&(e=l,f=o.index)}});while(null!==f);return u._found=o,null==i||e<=i*i?r.site:null}};var rkt=function(){function n(n){return new nrt(n.map(function(t,u){var f=[Math.round(i(t,u,n)/lr)*lr,Math.round(r(t,u,n)/lr)*lr];return f.index=u,f.data=t,f}),t)}var i=ypt,r=ppt,t=null;return n.polygons=function(t){return n(t).polygons()},n.links=function(t){return n(t).links()},n.triangles=function(t){return n(t).triangles()},n.x=function(t){return arguments.length?(i="function"==typeof t?t:hut(+t),n):i},n.y=function(t){return arguments.length?(r="function"==typeof t?t:hut(+t),n):r},n.extent=function(i){return arguments.length?(t=null==i?null:[[+i[0][0],+i[0][1]],[+i[1][0],+i[1][1]]],n):t&&[[t[0][0],t[0][1]],[t[1][0],t[1][1]]]},n.size=function(i){return arguments.length?(t=null==i?null:[[0,0],[+i[0],+i[1]]],n):t&&[t[1][0]-t[0][0],t[1][1]-t[0][1]]},n},ukt=Object.freeze({randomPosition:yb,randomPoint:yct,randomPolygon:pct,randomLineString:wct}),fkt=Object.freeze({getCluster:kct,clusterEach:irt,clusterReduce:dct,createBins:rrt,applyFilter:gd,propertiesContainsFilter:urt,filterProperties:gct});"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(n){var r;if(void 0===this||null===this)throw new TypeError(this+" is not an object");var u=Object(this),i=Math.max(Math.min(u.length,9007199254740991),0)||0,t=1 in arguments?parseInt(Number(arguments[1]),10)||0:0;for(t=t<0?Math.max(i+t,0):Math.min(t,i),r=(2 in arguments)&&void 0!==arguments[2]?parseInt(Number(arguments[2]),10)||0:i,r=r<0?Math.max(i+arguments[2],0):Math.min(r,i);t<r;)u[t]=n,++t;return u},writable:!0});Number.isFinite=Number.isFinite||function(n){return"number"==typeof n&&isFinite(n)};Number.isInteger=Number.isInteger||function(n){return"number"==typeof n&&isFinite(n)&&Math.floor(n)===n};Number.parseFloat=Number.parseFloat||parseFloat;Number.isNaN=Number.isNaN||function(n){return n!=n};Math.trunc=Math.trunc||function(n){return n<0?Math.ceil(n):Math.floor(n)};ca=function(){};ca.prototype.interfaces_=function(){return[]};ca.prototype.getClass=function(){return ca};ca.prototype.equalsWithTolerance=function(n,t,i){return Math.abs(n-t)<=i};var ar=function(){},it=function(){},evt={MAX_VALUE:{configurable:!0}};it.isNaN=function(n){return Number.isNaN(n)};it.doubleToLongBits=function(n){return n};it.longBitsToDouble=function(n){return n};it.isInfinite=function(n){return!Number.isFinite(n)};evt.MAX_VALUE.get=function(){return Number.MAX_VALUE};Object.defineProperties(it,evt);var co=function(){},dg=function(){},sp=function(){},i=function n(){if(this.x=null,this.y=null,this.z=null,0===arguments.length)this.x=0,this.y=0,this.z=n.NULL_ORDINATE;else if(1===arguments.length){var t=arguments[0];this.x=t.x;this.y=t.y;this.z=t.z}else 2===arguments.length?(this.x=arguments[0],this.y=arguments[1],this.z=n.NULL_ORDINATE):3===arguments.length&&(this.x=arguments[0],this.y=arguments[1],this.z=arguments[2])},yv={DimensionalComparator:{configurable:!0},serialVersionUID:{configurable:!0},NULL_ORDINATE:{configurable:!0},X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0}};i.prototype.setOrdinate=function(n,t){switch(n){case i.X:this.x=t;break;case i.Y:this.y=t;break;case i.Z:this.z=t;break;default:throw new ar("Invalid ordinate index: "+n);}};i.prototype.equals2D=function(){var n,t,i;return 1===arguments.length?(n=arguments[0],this.x===n.x&&this.y===n.y):2===arguments.length?(t=arguments[0],i=arguments[1],!!ca.equalsWithTolerance(this.x,t.x,i)&&!!ca.equalsWithTolerance(this.y,t.y,i)):void 0};i.prototype.getOrdinate=function(n){switch(n){case i.X:return this.x;case i.Y:return this.y;case i.Z:return this.z}throw new ar("Invalid ordinate index: "+n);};i.prototype.equals3D=function(n){return this.x===n.x&&this.y===n.y&&(this.z===n.z||it.isNaN(this.z))&&it.isNaN(n.z)};i.prototype.equals=function(n){return n instanceof i&&this.equals2D(n)};i.prototype.equalInZ=function(n,t){return ca.equalsWithTolerance(this.z,n.z,t)};i.prototype.compareTo=function(n){var t=n;return this.x<t.x?-1:this.x>t.x?1:this.y<t.y?-1:this.y>t.y?1:0};i.prototype.clone=function(){};i.prototype.copy=function(){return new i(this)};i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"};i.prototype.distance3D=function(n){var t=this.x-n.x,i=this.y-n.y,r=this.z-n.z;return Math.sqrt(t*t+i*i+r*r)};i.prototype.distance=function(n){var t=this.x-n.x,i=this.y-n.y;return Math.sqrt(t*t+i*i)};i.prototype.hashCode=function(){var n=17;return n=37*n+i.hashCode(this.x),n=37*n+i.hashCode(this.y)};i.prototype.setCoordinate=function(n){this.x=n.x;this.y=n.y;this.z=n.z};i.prototype.interfaces_=function(){return[co,dg,ho]};i.prototype.getClass=function(){return i};i.hashCode=function(){if(1===arguments.length){var t=arguments[0],n=it.doubleToLongBits(t);return Math.trunc((n^n)>>>32)}};yv.DimensionalComparator.get=function(){return lc};yv.serialVersionUID.get=function(){return 0x5cbf2c235c7e5800};yv.NULL_ORDINATE.get=function(){return it.NaN};yv.X.get=function(){return 0};yv.Y.get=function(){return 1};yv.Z.get=function(){return 2};Object.defineProperties(i,yv);lc=function(){if((this._dimensionsToTest=2,0!==arguments.length)&&1===arguments.length){var n=arguments[0];if(2!==n&&3!==n)throw new ar("only 2 or 3 dimensions may be specified");this._dimensionsToTest=n}};lc.prototype.compare=function(n,t){var i=n,r=t,f=lc.compare(i.x,r.x),u;return 0!==f?f:(u=lc.compare(i.y,r.y),0!==u)?u:this._dimensionsToTest<=2?0:lc.compare(i.z,r.z)};lc.prototype.interfaces_=function(){return[sp]};lc.prototype.getClass=function(){return lc};lc.compare=function(n,t){return n<t?-1:n>t?1:it.isNaN(n)?it.isNaN(t)?0:-1:it.isNaN(t)?1:0};pv=function(){};pv.prototype.create=function(){};pv.prototype.interfaces_=function(){return[]};pv.prototype.getClass=function(){return pv};r=function(){};hp={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};r.prototype.interfaces_=function(){return[]};r.prototype.getClass=function(){return r};r.toLocationSymbol=function(n){switch(n){case r.EXTERIOR:return"e";case r.BOUNDARY:return"b";case r.INTERIOR:return"i";case r.NONE:return"-"}throw new ar("Unknown location value: "+n);};hp.INTERIOR.get=function(){return 0};hp.BOUNDARY.get=function(){return 1};hp.EXTERIOR.get=function(){return 2};hp.NONE.get=function(){return-1};Object.defineProperties(r,hp);var k=function(n,t){return n.interfaces_&&n.interfaces_().indexOf(t)>-1},io=function(){},ovt={LOG_10:{configurable:!0}};io.prototype.interfaces_=function(){return[]};io.prototype.getClass=function(){return io};io.log10=function(n){var t=Math.log(n);return it.isInfinite(t)?t:it.isNaN(t)?t:t/io.LOG_10};io.min=function(n,t,i,r){var u=n;return t<u&&(u=t),i<u&&(u=i),r<u&&(u=r),u};io.clamp=function(){if("number"==typeof arguments[2]&&"number"==typeof arguments[0]&&"number"==typeof arguments[1]){var n=arguments[0],i=arguments[1],r=arguments[2];return n<i?i:n>r?r:n}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var t=arguments[0],u=arguments[1],f=arguments[2];return t<u?u:t>f?f:t}};io.wrap=function(n,t){return n<0?t- -n%t:n%t};io.max=function(){if(3===arguments.length){var o=arguments[0],i=arguments[1],r=arguments[2],t=o;return i>t&&(t=i),r>t&&(t=r),t}if(4===arguments.length){var s=arguments[0],u=arguments[1],f=arguments[2],e=arguments[3],n=s;return u>n&&(n=u),f>n&&(n=f),e>n&&(n=e),n}};io.average=function(n,t){return(n+t)/2};ovt.LOG_10.get=function(){return Math.log(10)};Object.defineProperties(io,ovt);es=function(n){this.str=n};es.prototype.append=function(n){this.str+=n};es.prototype.setCharAt=function(n,t){this.str=this.str.substr(0,n)+t+this.str.substr(n+1)};es.prototype.toString=function(){return this.str};os=function(n){this.value=n};os.prototype.intValue=function(){return this.value};os.prototype.compareTo=function(n){return this.value<n?-1:this.value>n?1:0};os.isNaN=function(n){return Number.isNaN(n)};cp=function(){};cp.isWhitespace=function(n){return n<=32&&n>=0||127===n};cp.toUpperCase=function(n){return n.toUpperCase()};u=function n(){var t,i,r,u,f;(this._hi=0,this._lo=0,0===arguments.length)?this.init(0):1===arguments.length?"number"==typeof arguments[0]?(t=arguments[0],this.init(t)):arguments[0]instanceof n?(i=arguments[0],this.init(i)):"string"==typeof arguments[0]&&(r=arguments[0],n.call(this,n.parse(r))):2===arguments.length&&(u=arguments[0],f=arguments[1],this.init(u,f))};lo={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}};u.prototype.le=function(n){return(this._hi<n._hi||this._hi===n._hi)&&this._lo<=n._lo};u.prototype.extractSignificantDigits=function(n,t){var i=this.abs(),r=u.magnitude(i._hi),v=u.TEN.pow(r),f,h,o,c,l;(i=i.divide(v)).gt(u.TEN)?(i=i.divide(u.TEN),r+=1):i.lt(u.ONE)&&(i=i.multiply(u.TEN),r-=1);for(var y=r+1,s=new es,a=u.MAX_PRINT_DIGITS-1,e=0;e<=a;e++){if(n&&e===y&&s.append("."),f=Math.trunc(i._hi),f<0)break;if(h=!1,o=0,f>9?(h=!0,o="9"):o="0"+f,s.append(o),i=i.subtract(u.valueOf(f)).multiply(u.TEN),h&&i.selfAdd(u.TEN),c=!0,l=u.magnitude(i._hi),l<0&&Math.abs(l)>=a-e&&(c=!1),!c)break}return t[0]=r,s.toString()};u.prototype.sqr=function(){return this.multiply(this)};u.prototype.doubleValue=function(){return this._hi+this._lo};u.prototype.subtract=function(){var n,t;return arguments[0]instanceof u?(n=arguments[0],this.add(n.negate())):"number"==typeof arguments[0]?(t=arguments[0],this.add(-t)):void 0};u.prototype.equals=function(){if(1===arguments.length){var n=arguments[0];return this._hi===n._hi&&this._lo===n._lo}};u.prototype.isZero=function(){return 0===this._hi&&0===this._lo};u.prototype.selfSubtract=function(){var n,t;return arguments[0]instanceof u?(n=arguments[0],this.isNaN()?this:this.selfAdd(-n._hi,-n._lo)):"number"==typeof arguments[0]?(t=arguments[0],this.isNaN()?this:this.selfAdd(-t,0)):void 0};u.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null};u.prototype.min=function(n){return this.le(n)?this:n};u.prototype.selfDivide=function(){var o,l;if(1===arguments.length){if(arguments[0]instanceof u)return o=arguments[0],this.selfDivide(o._hi,o._lo);if("number"==typeof arguments[0])return l=arguments[0],this.selfDivide(l,0)}else if(2===arguments.length){var i=arguments[0],a=arguments[1],r=null,s=null,f=null,h=null,n=null,e=null,c=null,t=null;return n=this._hi/i,e=u.SPLIT*n,r=e-n,t=u.SPLIT*i,r=e-r,s=n-r,f=t-i,c=n*i,f=t-f,h=i-f,t=r*f-c+r*h+s*f+s*h,e=(this._hi-c-t+this._lo-n*a)/i,t=n+e,this._hi=t,this._lo=n-t+e,this}};u.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"};u.prototype.divide=function(){var s;if(arguments[0]instanceof u){var n=arguments[0],f=null,o=null,e=null,h=null,t=null,r=null,c=null,i=null;return o=(t=this._hi/n._hi)-(f=(r=u.SPLIT*t)-(f=r-t)),i=f*(e=(i=u.SPLIT*n._hi)-(e=i-n._hi))-(c=t*n._hi)+f*(h=n._hi-e)+o*e+o*h,r=(this._hi-c-i+this._lo-t*n._lo)/n._hi,new u(i=t+r,t-i+r)}if("number"==typeof arguments[0])return s=arguments[0],it.isNaN(s)?u.createNaN():u.copy(this).selfDivide(s,0)};u.prototype.ge=function(n){return(this._hi>n._hi||this._hi===n._hi)&&this._lo>=n._lo};u.prototype.pow=function(n){if(0===n)return u.valueOf(1);var t=new u(this),i=u.valueOf(1),r=Math.abs(n);if(r>1)for(;r>0;)r%2==1&&i.selfMultiply(t),(r/=2)>0&&(t=t.sqr());else i=t;return n<0?i.reciprocal():i};u.prototype.ceil=function(){if(this.isNaN())return u.NaN;var n=Math.ceil(this._hi),t=0;return n===this._hi&&(t=Math.ceil(this._lo)),new u(n,t)};u.prototype.compareTo=function(n){var t=n;return this._hi<t._hi?-1:this._hi>t._hi?1:this._lo<t._lo?-1:this._lo>t._lo?1:0};u.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()};u.prototype.setValue=function(){var n,t;return arguments[0]instanceof u?(n=arguments[0],this.init(n),this):"number"==typeof arguments[0]?(t=arguments[0],this.init(t),this):void 0};u.prototype.max=function(n){return this.ge(n)?this:n};u.prototype.sqrt=function(){if(this.isZero())return u.valueOf(0);if(this.isNegative())return u.NaN;var n=1/Math.sqrt(this._hi),i=this._hi*n,t=u.valueOf(i),r=this.subtract(t.sqr())._hi*.5*n;return t.add(r)};u.prototype.selfAdd=function(){var o,y,d;if(1===arguments.length){if(arguments[0]instanceof u)return o=arguments[0],this.selfAdd(o._hi,o._lo);if("number"==typeof arguments[0]){var p=arguments[0],r=null,s=null,t=null,f=null,h=null,c=null;return t=this._hi+p,h=t-this._hi,f=t-h,f=p-h+(this._hi-f),c=f+this._lo,r=t+c,s=c+(t-r),this._hi=r+s,this._lo=s+(r-this._hi),this}}else if(2===arguments.length){var w=arguments[0],b=arguments[1],l=null,e=null,a=null,i=null,v=null,n=null,k=null;return i=this._hi+w,e=this._lo+b,v=i-(n=i-this._hi),a=e-(k=e-this._lo),y=(l=i+(n=(v=w-n+(this._hi-v))+e))+(n=(a=b-k+(this._lo-a))+(n+(i-l))),d=n+(l-y),this._hi=y,this._lo=d,this}};u.prototype.selfMultiply=function(){var e,h,s,l;if(1===arguments.length){if(arguments[0]instanceof u)return e=arguments[0],this.selfMultiply(e._hi,e._lo);if("number"==typeof arguments[0])return h=arguments[0],this.selfMultiply(h,0)}else if(2===arguments.length){var t=arguments[0],a=arguments[1],n=null,o=null,i=null,c=null,r=null,f=null;return n=(r=u.SPLIT*this._hi)-this._hi,f=u.SPLIT*t,n=r-n,o=this._hi-n,i=f-t,s=(r=this._hi*t)+(f=n*(i=f-i)-r+n*(c=t-i)+o*i+o*c+(this._hi*a+this._lo*t)),l=f+(n=r-s),this._hi=s,this._lo=l,this}};u.prototype.selfSqr=function(){return this.selfMultiply(this)};u.prototype.floor=function(){if(this.isNaN())return u.NaN;var n=Math.floor(this._hi),t=0;return n===this._hi&&(t=Math.floor(this._lo)),new u(n,t)};u.prototype.negate=function(){return this.isNaN()?this:new u(-this._hi,-this._lo)};u.prototype.clone=function(){};u.prototype.multiply=function(){var n,t;return arguments[0]instanceof u?(n=arguments[0],n.isNaN()?u.createNaN():u.copy(this).selfMultiply(n)):"number"==typeof arguments[0]?(t=arguments[0],it.isNaN(t)?u.createNaN():u.copy(this).selfMultiply(t,0)):void 0};u.prototype.isNaN=function(){return it.isNaN(this._hi)};u.prototype.intValue=function(){return Math.trunc(this._hi)};u.prototype.toString=function(){var n=u.magnitude(this._hi);return n>=-3&&n<=20?this.toStandardNotation():this.toSciNotation()};u.prototype.toStandardNotation=function(){var r=this.getSpecialNumberString(),e;if(null!==r)return r;var f=new Array(1).fill(null),n=this.extractSignificantDigits(!0,f),i=f[0]+1,t=n;return"."===n.charAt(0)?t="0"+n:i<0?t="0."+u.stringOfChar("0",-i)+n:-1===n.indexOf(".")&&(e=i-n.length,t=n+u.stringOfChar("0",e)+".0"),this.isNegative()?"-"+t:t};u.prototype.reciprocal=function(){var i=null,f=null,t=null,s=null,n=null,r=null,h=null,e=null,o;return f=(n=1/this._hi)-(i=(r=u.SPLIT*n)-(i=r-n)),t=(e=u.SPLIT*this._hi)-this._hi,o=n+(r=(1-(h=n*this._hi)-(e=i*(t=e-t)-h+i*(s=this._hi-t)+f*t+f*s)-n*this._lo)/this._hi),new u(o,n-o+r)};u.prototype.toSciNotation=function(){var t,i,r;if(this.isZero())return u.SCI_NOT_ZERO;if(t=this.getSpecialNumberString(),null!==t)return t;var f=new Array(1).fill(null),n=this.extractSignificantDigits(!1,f),e=u.SCI_NOT_EXPONENT_CHAR+f[0];if("0"===n.charAt(0))throw new Error("Found leading zero: "+n);return i="",n.length>1&&(i=n.substring(1)),r=n.charAt(0)+"."+i,this.isNegative()?"-"+r+e:r+e};u.prototype.abs=function(){return this.isNaN()?u.NaN:this.isNegative()?this.negate():new u(this)};u.prototype.isPositive=function(){return(this._hi>0||0===this._hi)&&this._lo>0};u.prototype.lt=function(n){return(this._hi<n._hi||this._hi===n._hi)&&this._lo<n._lo};u.prototype.add=function(){var n,t;return arguments[0]instanceof u?(n=arguments[0],u.copy(this).selfAdd(n)):"number"==typeof arguments[0]?(t=arguments[0],u.copy(this).selfAdd(t)):void 0};u.prototype.init=function(){var t,n,i,r;1===arguments.length?"number"==typeof arguments[0]?(t=arguments[0],this._hi=t,this._lo=0):arguments[0]instanceof u&&(n=arguments[0],this._hi=n._hi,this._lo=n._lo):2===arguments.length&&(i=arguments[0],r=arguments[1],this._hi=i,this._lo=r)};u.prototype.gt=function(n){return(this._hi>n._hi||this._hi===n._hi)&&this._lo>n._lo};u.prototype.isNegative=function(){return(this._hi<0||0===this._hi)&&this._lo<0};u.prototype.trunc=function(){return this.isNaN()?u.NaN:this.isPositive()?this.floor():this.ceil()};u.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0};u.prototype.interfaces_=function(){return[ho,co,dg]};u.prototype.getClass=function(){return u};u.sqr=function(n){return u.valueOf(n).selfMultiply(n)};u.valueOf=function(){var n,t;return"string"==typeof arguments[0]?(n=arguments[0],u.parse(n)):"number"==typeof arguments[0]?(t=arguments[0],new u(t)):void 0};u.sqrt=function(n){return u.valueOf(n).sqrt()};u.parse=function(n){for(var h,o,i,y,l,f,e,p,w,t=0,s=n.length;cp.isWhitespace(n.charAt(t));)t++;h=!1;t<s&&(o=n.charAt(t),"-"!==o&&"+"!==o||(t++,"-"===o&&(h=!0)));for(var r=new u,c=0,a=0,v=0;!(t>=s);)if(i=n.charAt(t),t++,cp.isDigit(i))y=i-"0",r.selfMultiply(u.TEN),r.selfAdd(y),c++;else{if("."!==i){if("e"===i||"E"===i){l=n.substring(t);try{v=os.parseInt(l)}catch(t){throw t instanceof Error?new Error("Invalid exponent "+l+" in string "+n):t;}break}throw new Error("Unexpected character '"+i+"' at position "+t+" in string "+n);}a=c}return f=r,e=c-a-v,0===e?f=r:e>0?(p=u.TEN.pow(e),f=r.divide(p)):e<0&&(w=u.TEN.pow(-e),f=r.multiply(w)),h?f.negate():f};u.createNaN=function(){return new u(it.NaN,it.NaN)};u.copy=function(n){return new u(n)};u.magnitude=function(n){var i=Math.abs(n),r=Math.log(i)/Math.log(10),t=Math.trunc(Math.floor(r));return 10*Math.pow(10,t)<=i&&(t+=1),t};u.stringOfChar=function(n,t){for(var i=new es,r=0;r<t;r++)i.append(n);return i.toString()};lo.PI.get=function(){return new u(3.1415926535897931,12246467991473532e-32)};lo.TWO_PI.get=function(){return new u(6.2831853071795862,24492935982947064e-32)};lo.PI_2.get=function(){return new u(1.5707963267948966,6123233995736766e-32)};lo.E.get=function(){return new u(2.7182818284590451,14456468917292502e-32)};lo.NaN.get=function(){return new u(it.NaN,it.NaN)};lo.EPS.get=function(){return 123259516440783e-46};lo.SPLIT.get=function(){return 134217729};lo.MAX_PRINT_DIGITS.get=function(){return 32};lo.TEN.get=function(){return u.valueOf(10)};lo.ONE.get=function(){return u.valueOf(1)};lo.SCI_NOT_EXPONENT_CHAR.get=function(){return"E"};lo.SCI_NOT_ZERO.get=function(){return"0.0E0"};Object.defineProperties(u,lo);ne=function(){};lut={DP_SAFE_EPSILON:{configurable:!0}};ne.prototype.interfaces_=function(){return[]};ne.prototype.getClass=function(){return ne};ne.orientationIndex=function(n,t,i){var r=ne.orientationIndexFilter(n,t,i);if(r<=1)return r;var f=u.valueOf(t.x).selfAdd(-n.x),e=u.valueOf(t.y).selfAdd(-n.y),o=u.valueOf(i.x).selfAdd(-t.x),s=u.valueOf(i.y).selfAdd(-t.y);return f.selfMultiply(s).selfSubtract(e.selfMultiply(o)).signum()};ne.signOfDet2x2=function(n,t,i,r){return n.multiply(r).selfSubtract(t.multiply(i)).signum()};ne.intersection=function(n,t,r,f){var o=u.valueOf(f.y).selfSubtract(r.y).selfMultiply(u.valueOf(t.x).selfSubtract(n.x)),s=u.valueOf(f.x).selfSubtract(r.x).selfMultiply(u.valueOf(t.y).selfSubtract(n.y)),e=o.subtract(s),h=u.valueOf(f.x).selfSubtract(r.x).selfMultiply(u.valueOf(n.y).selfSubtract(r.y)),c=u.valueOf(f.y).selfSubtract(r.y).selfMultiply(u.valueOf(n.x).selfSubtract(r.x)),l=h.subtract(c).selfDivide(e).doubleValue(),a=u.valueOf(n.x).selfAdd(u.valueOf(t.x).selfSubtract(n.x).selfMultiply(l)).doubleValue(),v=u.valueOf(t.x).selfSubtract(n.x).selfMultiply(u.valueOf(n.y).selfSubtract(r.y)),y=u.valueOf(t.y).selfSubtract(n.y).selfMultiply(u.valueOf(n.x).selfSubtract(r.x)),p=v.subtract(y).selfDivide(e).doubleValue(),w=u.valueOf(r.y).selfAdd(u.valueOf(f.y).selfSubtract(r.y).selfMultiply(p)).doubleValue();return new i(a,w)};ne.orientationIndexFilter=function(n,t,i){var e=null,r=(n.x-i.x)*(t.y-i.y),u=(n.y-i.y)*(t.x-i.x),f=r-u,o;if(r>0){if(u<=0)return ne.signum(f);e=r+u}else{if(!(r<0)||u>=0)return ne.signum(f);e=-r-u}return o=ne.DP_SAFE_EPSILON*e,f>=o||-f>=o?ne.signum(f):2};ne.signum=function(n){return n>0?1:n<0?-1:0};lut.DP_SAFE_EPSILON.get=function(){return 1e-15};Object.defineProperties(ne,lut);ot=function(){};lp={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};lp.X.get=function(){return 0};lp.Y.get=function(){return 1};lp.Z.get=function(){return 2};lp.M.get=function(){return 3};ot.prototype.setOrdinate=function(){};ot.prototype.size=function(){};ot.prototype.getOrdinate=function(){};ot.prototype.getCoordinate=function(){};ot.prototype.getCoordinateCopy=function(){};ot.prototype.getDimension=function(){};ot.prototype.getX=function(){};ot.prototype.clone=function(){};ot.prototype.expandEnvelope=function(){};ot.prototype.copy=function(){};ot.prototype.getY=function(){};ot.prototype.toCoordinateArray=function(){};ot.prototype.interfaces_=function(){return[dg]};ot.prototype.getClass=function(){return ot};Object.defineProperties(ot,lp);var svt=function(){},ap=function(n){function t(){n.call(this,"Projective point not representable on the Cartesian plane.")}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(svt),rf=function(){};rf.arraycopy=function(n,t,i,r,u){for(var e=0,f=t;f<t+u;f++)i[r+e]=n[f],e++};rf.getProperty=function(n){return{"line.separator":"\n"}[n]};ao=function n(){var c,l,a,t,r,u,f;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)c=arguments[0],this.x=c.x,this.y=c.y,this.w=1;else if(2===arguments.length)"number"==typeof arguments[0]&&"number"==typeof arguments[1]?(l=arguments[0],a=arguments[1],this.x=l,this.y=a,this.w=1):arguments[0]instanceof n&&arguments[1]instanceof n?(t=arguments[0],r=arguments[1],this.x=t.y*r.w-r.y*t.w,this.y=r.x*t.w-t.x*r.w,this.w=t.x*r.y-r.x*t.y):arguments[0]instanceof i&&arguments[1]instanceof i&&(u=arguments[0],f=arguments[1],this.x=u.y-f.y,this.y=f.x-u.x,this.w=u.x*f.y-f.x*u.y);else if(3===arguments.length){var d=arguments[0],g=arguments[1],nt=arguments[2];this.x=d;this.y=g;this.w=nt}else if(4===arguments.length){var e=arguments[0],o=arguments[1],s=arguments[2],h=arguments[3],v=e.y-o.y,y=o.x-e.x,p=e.x*o.y-o.x*e.y,w=s.y-h.y,b=h.x-s.x,k=s.x*h.y-h.x*s.y;this.x=y*k-b*p;this.y=w*p-v*k;this.w=v*b-w*y}};ao.prototype.getY=function(){var n=this.y/this.w;if(it.isNaN(n)||it.isInfinite(n))throw new ap;return n};ao.prototype.getX=function(){var n=this.x/this.w;if(it.isNaN(n)||it.isInfinite(n))throw new ap;return n};ao.prototype.getCoordinate=function(){var n=new i;return n.x=this.getX(),n.y=this.getY(),n};ao.prototype.interfaces_=function(){return[]};ao.prototype.getClass=function(){return ao};ao.intersection=function(n,t,r,u){var o=n.y-t.y,s=t.x-n.x,h=n.x*t.y-t.x*n.y,c=r.y-u.y,l=u.x-r.x,a=r.x*u.y-u.x*r.y,v=o*l-c*s,f=(s*a-l*h)/v,e=(c*h-o*a)/v;if(it.isNaN(f)||it.isInfinite(f)||it.isNaN(e)||it.isInfinite(e))throw new ap;return new i(f,e)};l=function n(){var t,f,r,u;if(this._minx=null,this._maxx=null,this._miny=null,this._maxy=null,0===arguments.length)this.init();else if(1===arguments.length)arguments[0]instanceof i?(t=arguments[0],this.init(t.x,t.x,t.y,t.y)):arguments[0]instanceof n&&(f=arguments[0],this.init(f));else if(2===arguments.length)r=arguments[0],u=arguments[1],this.init(r.x,u.x,r.y,u.y);else if(4===arguments.length){var e=arguments[0],o=arguments[1],s=arguments[2],h=arguments[3];this.init(e,o,s,h)}};aut={serialVersionUID:{configurable:!0}};l.prototype.getArea=function(){return this.getWidth()*this.getHeight()};l.prototype.equals=function(n){if(!(n instanceof l))return!1;var t=n;return this.isNull()?t.isNull():this._maxx===t.getMaxX()&&this._maxy===t.getMaxY()&&this._minx===t.getMinX()&&this._miny===t.getMinY()};l.prototype.intersection=function(n){if(this.isNull()||n.isNull()||!this.intersects(n))return new l;var t=this._minx>n._minx?this._minx:n._minx,i=this._miny>n._miny?this._miny:n._miny,r=this._maxx<n._maxx?this._maxx:n._maxx,u=this._maxy<n._maxy?this._maxy:n._maxy;return new l(t,r,i,u)};l.prototype.isNull=function(){return this._maxx<this._minx};l.prototype.getMaxX=function(){return this._maxx};l.prototype.covers=function(){var t,n,r,u;if(1===arguments.length){if(arguments[0]instanceof i)return t=arguments[0],this.covers(t.x,t.y);if(arguments[0]instanceof l)return n=arguments[0],!this.isNull()&&!n.isNull()&&n.getMinX()>=this._minx&&n.getMaxX()<=this._maxx&&n.getMinY()>=this._miny&&n.getMaxY()<=this._maxy}else if(2===arguments.length)return r=arguments[0],u=arguments[1],!this.isNull()&&r>=this._minx&&r<=this._maxx&&u>=this._miny&&u<=this._maxy};l.prototype.intersects=function(){var n,t,r,u;if(1===arguments.length){if(arguments[0]instanceof l)return n=arguments[0],!this.isNull()&&!n.isNull()&&!(n._minx>this._maxx||n._maxx<this._minx||n._miny>this._maxy||n._maxy<this._miny);if(arguments[0]instanceof i)return t=arguments[0],this.intersects(t.x,t.y)}else if(2===arguments.length)return r=arguments[0],u=arguments[1],!this.isNull()&&!(r>this._maxx||r<this._minx||u>this._maxy||u<this._miny)};l.prototype.getMinY=function(){return this._miny};l.prototype.getMinX=function(){return this._minx};l.prototype.expandToInclude=function(){var u,n,t,r;if(1===arguments.length){if(arguments[0]instanceof i)u=arguments[0],this.expandToInclude(u.x,u.y);else if(arguments[0]instanceof l){if(n=arguments[0],n.isNull())return null;this.isNull()?(this._minx=n.getMinX(),this._maxx=n.getMaxX(),this._miny=n.getMinY(),this._maxy=n.getMaxY()):(n._minx<this._minx&&(this._minx=n._minx),n._maxx>this._maxx&&(this._maxx=n._maxx),n._miny<this._miny&&(this._miny=n._miny),n._maxy>this._maxy&&(this._maxy=n._maxy))}}else 2===arguments.length&&(t=arguments[0],r=arguments[1],this.isNull()?(this._minx=t,this._maxx=t,this._miny=r,this._maxy=r):(t<this._minx&&(this._minx=t),t>this._maxx&&(this._maxx=t),r<this._miny&&(this._miny=r),r>this._maxy&&(this._maxy=r)))};l.prototype.minExtent=function(){if(this.isNull())return 0;var n=this.getWidth(),t=this.getHeight();return n<t?n:t};l.prototype.getWidth=function(){return this.isNull()?0:this._maxx-this._minx};l.prototype.compareTo=function(n){var t=n;return this.isNull()?t.isNull()?0:-1:t.isNull()?1:this._minx<t._minx?-1:this._minx>t._minx?1:this._miny<t._miny?-1:this._miny>t._miny?1:this._maxx<t._maxx?-1:this._maxx>t._maxx?1:this._maxy<t._maxy?-1:this._maxy>t._maxy?1:0};l.prototype.translate=function(n,t){if(this.isNull())return null;this.init(this.getMinX()+n,this.getMaxX()+n,this.getMinY()+t,this.getMaxY()+t)};l.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"};l.prototype.setToNull=function(){this._minx=0;this._maxx=-1;this._miny=0;this._maxy=-1};l.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny};l.prototype.maxExtent=function(){if(this.isNull())return 0;var n=this.getWidth(),t=this.getHeight();return n>t?n:t};l.prototype.expandBy=function(){var n,t,i;if(1===arguments.length)n=arguments[0],this.expandBy(n,n);else if(2===arguments.length){if(t=arguments[0],i=arguments[1],this.isNull())return null;this._minx-=t;this._maxx+=t;this._miny-=i;this._maxy+=i;(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}};l.prototype.contains=function(){var n,t,r,u;if(1===arguments.length){if(arguments[0]instanceof l)return n=arguments[0],this.covers(n);if(arguments[0]instanceof i)return t=arguments[0],this.covers(t)}else if(2===arguments.length)return r=arguments[0],u=arguments[1],this.covers(r,u)};l.prototype.centre=function(){return this.isNull()?null:new i((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)};l.prototype.init=function(){var n,t,r,u;if(0===arguments.length)this.setToNull();else if(1===arguments.length)arguments[0]instanceof i?(n=arguments[0],this.init(n.x,n.x,n.y,n.y)):arguments[0]instanceof l&&(t=arguments[0],this._minx=t._minx,this._maxx=t._maxx,this._miny=t._miny,this._maxy=t._maxy);else if(2===arguments.length)r=arguments[0],u=arguments[1],this.init(r.x,u.x,r.y,u.y);else if(4===arguments.length){var f=arguments[0],e=arguments[1],o=arguments[2],s=arguments[3];f<e?(this._minx=f,this._maxx=e):(this._minx=e,this._maxx=f);o<s?(this._miny=o,this._maxy=s):(this._miny=s,this._maxy=o)}};l.prototype.getMaxY=function(){return this._maxy};l.prototype.distance=function(n){var t,i;return this.intersects(n)?0:(t=0,this._maxx<n._minx?t=n._minx-this._maxx:this._minx>n._maxx&&(t=this._minx-n._maxx),i=0,this._maxy<n._miny?i=n._miny-this._maxy:this._miny>n._maxy&&(i=this._miny-n._maxy),0===t?i:0===i?t:Math.sqrt(t*t+i*i))};l.prototype.hashCode=function(){var n=17;return n=37*n+i.hashCode(this._minx),n=37*n+i.hashCode(this._maxx),n=37*n+i.hashCode(this._miny),n=37*n+i.hashCode(this._maxy)};l.prototype.interfaces_=function(){return[co,ho]};l.prototype.getClass=function(){return l};l.intersects=function(){if(3===arguments.length){var n=arguments[0],t=arguments[1],i=arguments[2];return i.x>=(n.x<t.x?n.x:t.x)&&i.x<=(n.x>t.x?n.x:t.x)&&i.y>=(n.y<t.y?n.y:t.y)&&i.y<=(n.y>t.y?n.y:t.y)}if(4===arguments.length){var r=arguments[0],u=arguments[1],f=arguments[2],e=arguments[3],o=Math.min(f.x,e.x),s=Math.max(f.x,e.x),h=Math.min(r.x,u.x),c=Math.max(r.x,u.x);return!(h>s)&&!(c<o)&&(o=Math.min(f.y,e.y),s=Math.max(f.y,e.y),h=Math.min(r.y,u.y),c=Math.max(r.y,u.y),!(h>s)&&!(c<o))}};aut.serialVersionUID.get=function(){return 0x51845cd552189800};Object.defineProperties(l,aut);ss={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*$/};nk=function(n){this.geometryFactory=n||new ut};nk.prototype.read=function(n){var i,r,u,t;if(n=n.replace(/[\n\r]/g," "),t=ss.typeStr.exec(n),-1!==n.search("EMPTY")&&((t=ss.emptyTypeStr.exec(n))[2]=void 0),t&&(r=t[1].toLowerCase(),u=t[2],vp[r]&&(i=vp[r].apply(this,[u]))),void 0===i)throw new Error("Could not parse WKT "+n);return i};nk.prototype.write=function(n){return this.extractGeometry(n)};nk.prototype.extractGeometry=function(n){var t=n.getGeometryType().toLowerCase(),i;return ac[t]?(i=t.toUpperCase(),n.isEmpty()?i+" EMPTY":i+"("+ac[t].apply(this,[n])+")"):null};var ac={coordinate:function(n){return n.x+" "+n.y},point:function(n){return ac.coordinate.call(this,n._coordinates._coordinates[0])},multipoint:function(n){for(var i=[],t=0,r=n._geometries.length;t<r;++t)i.push("("+ac.point.apply(this,[n._geometries[t]])+")");return i.join(",")},linestring:function(n){for(var i=[],t=0,r=n._points._coordinates.length;t<r;++t)i.push(ac.coordinate.apply(this,[n._points._coordinates[t]]));return i.join(",")},linearring:function(n){for(var i=[],t=0,r=n._points._coordinates.length;t<r;++t)i.push(ac.coordinate.apply(this,[n._points._coordinates[t]]));return i.join(",")},multilinestring:function(n){for(var i=[],t=0,r=n._geometries.length;t<r;++t)i.push("("+ac.linestring.apply(this,[n._geometries[t]])+")");return i.join(",")},polygon:function(n){var i=[],t,r;for(i.push("("+ac.linestring.apply(this,[n._shell])+")"),t=0,r=n._holes.length;t<r;++t)i.push("("+ac.linestring.apply(this,[n._holes[t]])+")");return i.join(",")},multipolygon:function(n){for(var i=[],t=0,r=n._geometries.length;t<r;++t)i.push("("+ac.polygon.apply(this,[n._geometries[t]])+")");return i.join(",")},geometrycollection:function(n){for(var i=[],t=0,r=n._geometries.length;t<r;++t)i.push(this.extractGeometry(n._geometries[t]));return i.join(",")}},vp={point:function(n){if(void 0===n)return this.geometryFactory.createPoint();var t=n.trim().split(ss.spaces);return this.geometryFactory.createPoint(new i(Number.parseFloat(t[0]),Number.parseFloat(t[1])))},multipoint:function(n){if(void 0===n)return this.geometryFactory.createMultiPoint();for(var i,r=n.trim().split(","),u=[],t=0,f=r.length;t<f;++t)i=r[t].replace(ss.trimParens,"$1"),u.push(vp.point.apply(this,[i]));return this.geometryFactory.createMultiPoint(u)},linestring:function(n){if(void 0===n)return this.geometryFactory.createLineString();for(var t,u=n.trim().split(","),f=[],r=0,e=u.length;r<e;++r)t=u[r].trim().split(ss.spaces),f.push(new i(Number.parseFloat(t[0]),Number.parseFloat(t[1])));return this.geometryFactory.createLineString(f)},linearring:function(n){if(void 0===n)return this.geometryFactory.createLinearRing();for(var t,u=n.trim().split(","),f=[],r=0,e=u.length;r<e;++r)t=u[r].trim().split(ss.spaces),f.push(new i(Number.parseFloat(t[0]),Number.parseFloat(t[1])));return this.geometryFactory.createLinearRing(f)},multilinestring:function(n){if(void 0===n)return this.geometryFactory.createMultiLineString();for(var i,r=n.trim().split(ss.parenComma),u=[],t=0,f=r.length;t<f;++t)i=r[t].replace(ss.trimParens,"$1"),u.push(vp.linestring.apply(this,[i]));return this.geometryFactory.createMultiLineString(u)},polygon:function(n){if(void 0===n)return this.geometryFactory.createPolygon();for(var r,u,i,f,e=n.trim().split(ss.parenComma),o=[],t=0,s=e.length;t<s;++t)r=e[t].replace(ss.trimParens,"$1"),u=vp.linestring.apply(this,[r]),i=this.geometryFactory.createLinearRing(u._points),0===t?f=i:o.push(i);return this.geometryFactory.createPolygon(f,o)},multipolygon:function(n){if(void 0===n)return this.geometryFactory.createMultiPolygon();for(var i,r=n.trim().split(ss.doubleParenComma),u=[],t=0,f=r.length;t<f;++t)i=r[t].replace(ss.trimParens,"$1"),u.push(vp.polygon.apply(this,[i]));return this.geometryFactory.createMultiPolygon(u)},geometrycollection:function(n){if(void 0===n)return this.geometryFactory.createGeometryCollection();for(var i=(n=n.replace(/,\s*([A-Za-z])/g,"|$1")).trim().split("|"),r=[],t=0,u=i.length;t<u;++t)r.push(this.read(i[t]));return this.geometryFactory.createGeometryCollection(r)}},hs=function(n){this.parser=new nk(n)};hs.prototype.write=function(n){return this.parser.write(n)};hs.toLineString=function(n,t){if(2!==arguments.length)throw new Error("Not implemented");return"LINESTRING ( "+n.x+" "+n.y+", "+t.x+" "+t.y+" )"};var vc=function(n){function t(t){n.call(this,t);this.name="RuntimeException";this.message=t;this.stack=(new n).stack}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(Error),gg=function(n){function t(){if(n.call(this),0===arguments.length)n.call(this);else if(1===arguments.length){var t=arguments[0];n.call(this,t)}}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(vc),rt=function(){};rt.prototype.interfaces_=function(){return[]};rt.prototype.getClass=function(){return rt};rt.shouldNeverReachHere=function(){if(0===arguments.length)rt.shouldNeverReachHere(null);else if(1===arguments.length){var n=arguments[0];throw new gg("Should never reach here"+(null!==n?": "+n:""));}};rt.isTrue=function(){var n,t;if(1===arguments.length)n=arguments[0],rt.isTrue(n,null);else if(2===arguments.length&&(n=arguments[0],t=arguments[1],!n))throw null===t?new gg:new gg(t);};rt.equals=function(){var n,t,i;if(2===arguments.length)n=arguments[0],t=arguments[1],rt.equals(n,t,null);else if(3===arguments.length&&(n=arguments[0],t=arguments[1],i=arguments[2],!t.equals(n)))throw new gg("Expected "+n+" but encountered "+t+(null!==i?": "+i:""));};vr=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 i;this._intPt[1]=new i;this._pa=this._intPt[0];this._pb=this._intPt[1];this._result=0};la={DONT_INTERSECT:{configurable:!0},DO_INTERSECT:{configurable:!0},COLLINEAR:{configurable:!0},NO_INTERSECTION:{configurable:!0},POINT_INTERSECTION:{configurable:!0},COLLINEAR_INTERSECTION:{configurable:!0}};vr.prototype.getIndexAlongSegment=function(n,t){return this.computeIntLineIndex(),this._intLineIndex[n][t]};vr.prototype.getTopologySummary=function(){var n=new es;return this.isEndPoint()&&n.append(" endpoint"),this._isProper&&n.append(" proper"),this.isCollinear()&&n.append(" collinear"),n.toString()};vr.prototype.computeIntersection=function(n,t,i,r){this._inputLines[0][0]=n;this._inputLines[0][1]=t;this._inputLines[1][0]=i;this._inputLines[1][1]=r;this._result=this.computeIntersect(n,t,i,r)};vr.prototype.getIntersectionNum=function(){return this._result};vr.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 n=arguments[0];this.getEdgeDistance(n,0)>this.getEdgeDistance(n,1)?(this._intLineIndex[n][0]=0,this._intLineIndex[n][1]=1):(this._intLineIndex[n][0]=1,this._intLineIndex[n][1]=0)}};vr.prototype.isProper=function(){return this.hasIntersection()&&this._isProper};vr.prototype.setPrecisionModel=function(n){this._precisionModel=n};vr.prototype.isInteriorIntersection=function(){if(0===arguments.length)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(1===arguments.length){for(var t=arguments[0],n=0;n<this._result;n++)if(!this._intPt[n].equals2D(this._inputLines[t][0])&&!this._intPt[n].equals2D(this._inputLines[t][1]))return!0;return!1}};vr.prototype.getIntersection=function(n){return this._intPt[n]};vr.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper};vr.prototype.hasIntersection=function(){return this._result!==vr.NO_INTERSECTION};vr.prototype.getEdgeDistance=function(n,t){return vr.computeEdgeDistance(this._intPt[t],this._inputLines[n][0],this._inputLines[n][1])};vr.prototype.isCollinear=function(){return this._result===vr.COLLINEAR_INTERSECTION};vr.prototype.toString=function(){return hs.toLineString(this._inputLines[0][0],this._inputLines[0][1])+" - "+hs.toLineString(this._inputLines[1][0],this._inputLines[1][1])+this.getTopologySummary()};vr.prototype.getEndpoint=function(n,t){return this._inputLines[n][t]};vr.prototype.isIntersection=function(n){for(var t=0;t<this._result;t++)if(this._intPt[t].equals2D(n))return!0;return!1};vr.prototype.getIntersectionAlongSegment=function(n,t){return this.computeIntLineIndex(),this._intPt[this._intLineIndex[n][t]]};vr.prototype.interfaces_=function(){return[]};vr.prototype.getClass=function(){return vr};vr.computeEdgeDistance=function(n,t,i){var u=Math.abs(i.x-t.x),f=Math.abs(i.y-t.y),r=-1,e,o;return n.equals(t)?r=0:n.equals(i)?r=u>f?u:f:(e=Math.abs(n.x-t.x),o=Math.abs(n.y-t.y),0!==(r=u>f?e:o)||n.equals(t)||(r=Math.max(e,o))),rt.isTrue(!(0===r&&!n.equals(t)),"Bad distance calculation"),r};vr.nonRobustComputeEdgeDistance=function(n,t){var i=n.x-t.x,r=n.y-t.y,u=Math.sqrt(i*i+r*r);return rt.isTrue(!(0===u&&!n.equals(t)),"Invalid distance calculation"),u};la.DONT_INTERSECT.get=function(){return 0};la.DO_INTERSECT.get=function(){return 1};la.COLLINEAR.get=function(){return 2};la.NO_INTERSECTION.get=function(){return 0};la.POINT_INTERSECTION.get=function(){return 1};la.COLLINEAR_INTERSECTION.get=function(){return 2};Object.defineProperties(vr,la);vl=function(n){function t(){n.apply(this,arguments)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.isInSegmentEnvelopes=function(n){var t=new l(this._inputLines[0][0],this._inputLines[0][1]),i=new l(this._inputLines[1][0],this._inputLines[1][1]);return t.contains(n)&&i.contains(n)},t.prototype.computeIntersection=function(){if(3!==arguments.length)return n.prototype.computeIntersection.apply(this,arguments);var t=arguments[0],i=arguments[1],r=arguments[2];if(this._isProper=!1,l.intersects(i,r,t)&&0===o.orientationIndex(i,r,t)&&0===o.orientationIndex(r,i,t))return this._isProper=!0,(t.equals(i)||t.equals(r))&&(this._isProper=!1),this._result=n.POINT_INTERSECTION,null;this._result=n.NO_INTERSECTION},t.prototype.normalizeToMinimum=function(n,t,i,r,u){u.x=this.smallestInAbsValue(n.x,t.x,i.x,r.x);u.y=this.smallestInAbsValue(n.y,t.y,i.y,r.y);n.x-=u.x;n.y-=u.y;t.x-=u.x;t.y-=u.y;i.x-=u.x;i.y-=u.y;r.x-=u.x;r.y-=u.y},t.prototype.safeHCoordinateIntersection=function(n,i,r,u){var f=null;try{f=ao.intersection(n,i,r,u)}catch(e){if(!(e instanceof ap))throw e;f=t.nearestEndpoint(n,i,r,u)}return f},t.prototype.intersection=function(n,r,u,f){var e=this.intersectionWithNormalization(n,r,u,f);return this.isInSegmentEnvelopes(e)||(e=new i(t.nearestEndpoint(n,r,u,f))),null!==this._precisionModel&&this._precisionModel.makePrecise(e),e},t.prototype.smallestInAbsValue=function(n,t,i,r){var u=n,f=Math.abs(u);return Math.abs(t)<f&&(u=t,f=Math.abs(t)),Math.abs(i)<f&&(u=i,f=Math.abs(i)),Math.abs(r)<f&&(u=r),u},t.prototype.checkDD=function(n,t,i,r,u){var f=ne.intersection(n,t,i,r),e=this.isInSegmentEnvelopes(f);rf.out.println("DD in env = "+e+"  --------------------- "+f);u.distance(f)>.0001&&rf.out.println("Distance = "+u.distance(f))},t.prototype.intersectionWithNormalization=function(n,t,r,u){var o=new i(n),s=new i(t),h=new i(r),c=new i(u),e=new i,f;return this.normalizeToEnvCentre(o,s,h,c,e),f=this.safeHCoordinateIntersection(o,s,h,c),f.x+=e.x,f.y+=e.y,f},t.prototype.computeCollinearIntersection=function(t,i,r,u){var f=l.intersects(t,i,r),e=l.intersects(t,i,u),o=l.intersects(r,u,t),s=l.intersects(r,u,i);return f&&e?(this._intPt[0]=r,this._intPt[1]=u,n.COLLINEAR_INTERSECTION):o&&s?(this._intPt[0]=t,this._intPt[1]=i,n.COLLINEAR_INTERSECTION):f&&o?(this._intPt[0]=r,this._intPt[1]=t,!r.equals(t)||e||s?n.COLLINEAR_INTERSECTION:n.POINT_INTERSECTION):f&&s?(this._intPt[0]=r,this._intPt[1]=i,!r.equals(i)||e||o?n.COLLINEAR_INTERSECTION:n.POINT_INTERSECTION):e&&o?(this._intPt[0]=u,this._intPt[1]=t,!u.equals(t)||f||s?n.COLLINEAR_INTERSECTION:n.POINT_INTERSECTION):e&&s?(this._intPt[0]=u,this._intPt[1]=i,!u.equals(i)||f||o?n.COLLINEAR_INTERSECTION:n.POINT_INTERSECTION):n.NO_INTERSECTION},t.prototype.normalizeToEnvCentre=function(n,t,i,r,u){var f=n.x<t.x?n.x:t.x,e=n.y<t.y?n.y:t.y,o=n.x>t.x?n.x:t.x,s=n.y>t.y?n.y:t.y,h=i.x<r.x?i.x:r.x,c=i.y<r.y?i.y:r.y,l=i.x>r.x?i.x:r.x,a=i.y>r.y?i.y:r.y,v=((f>h?f:h)+(o<l?o:l))/2,y=((e>c?e:c)+(s<a?s:a))/2;u.x=v;u.y=y;n.x-=u.x;n.y-=u.y;t.x-=u.x;t.y-=u.y;i.x-=u.x;i.y-=u.y;r.x-=u.x;r.y-=u.y},t.prototype.computeIntersect=function(t,r,u,f){var e,s,h,c;return(this._isProper=!1,!l.intersects(t,r,u,f))?n.NO_INTERSECTION:(e=o.orientationIndex(t,r,u),s=o.orientationIndex(t,r,f),e>0&&s>0||e<0&&s<0)?n.NO_INTERSECTION:(h=o.orientationIndex(u,f,t),c=o.orientationIndex(u,f,r),h>0&&c>0||h<0&&c<0)?n.NO_INTERSECTION:0===e&&0===s&&0===h&&0===c?this.computeCollinearIntersection(t,r,u,f):(0===e||0===s||0===h||0===c?(this._isProper=!1,t.equals2D(u)||t.equals2D(f)?this._intPt[0]=t:r.equals2D(u)||r.equals2D(f)?this._intPt[0]=r:0===e?this._intPt[0]=new i(u):0===s?this._intPt[0]=new i(f):0===h?this._intPt[0]=new i(t):0===c&&(this._intPt[0]=new i(r))):(this._isProper=!0,this._intPt[0]=this.intersection(t,r,u,f)),n.POINT_INTERSECTION)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.nearestEndpoint=function(n,t,i,r){var e=n,u=o.distancePointLine(n,i,r),f=o.distancePointLine(t,i,r);return f<u&&(u=f,e=t),(f=o.distancePointLine(i,n,t))<u&&(u=f,e=i),(f=o.distancePointLine(r,n,t))<u&&(u=f,e=r),e},t}(vr);aa=function(){};aa.prototype.interfaces_=function(){return[]};aa.prototype.getClass=function(){return aa};aa.orientationIndex=function(n,t,i){var r=t.x-n.x,u=t.y-n.y,f=i.x-t.x,e=i.y-t.y;return aa.signOfDet2x2(r,u,f,e)};aa.signOfDet2x2=function(n,t,i,r){var u=null,f=null,e=null;if(u=1,0===n||0===r)return 0===t||0===i?0:t>0?i>0?-u:u:i>0?u:-u;if(0===t||0===i)return r>0?n>0?u:-u:n>0?-u:u;if(t>0?r>0?t<=r||(u=-u,f=n,n=i,i=f,f=t,t=r,r=f):t<=-r?(u=-u,i=-i,r=-r):(f=n,n=-i,i=f,f=t,t=-r,r=f):r>0?-t<=r?(u=-u,n=-n,t=-t):(f=-n,n=i,i=f,f=-t,t=r,r=f):t>=r?(n=-n,t=-t,i=-i,r=-r):(u=-u,f=-n,n=-i,i=f,f=-t,t=-r,r=f),n>0){if(!(i>0)||!(n<=i))return u}else{if(i>0||!(n>=i))return-u;u=-u;n=-n;i=-i}for(;;){if(e=Math.floor(i/n),i-=e*n,(r-=e*t)<0)return-u;if(r>t)return u;if(n>i+i){if(t<r+r)return u}else{if(t>r+r)return-u;i=n-i;r=t-r;u=-u}if(0===r)return 0===i?0:-u;if(0===i||(e=Math.floor(n/i),n-=e*i,(t-=e*r)<0))return u;if(t>r)return-u;if(i>n+n){if(r<t+t)return-u}else{if(r>t+t)return u;n=i-n;t=r-t;u=-u}if(0===t)return 0===n?0:u;if(0===n)return-u}};cs=function(){this._p=null;this._crossingCount=0;this._isPointOnSegment=!1;var n=arguments[0];this._p=n};cs.prototype.countSegment=function(n,t){var i,r;if(n.x<this._p.x&&t.x<this._p.x)return null;if(this._p.x===t.x&&this._p.y===t.y)return this._isPointOnSegment=!0,null;if(n.y===this._p.y&&t.y===this._p.y)return i=n.x,r=t.x,i>r&&(i=t.x,r=n.x),this._p.x>=i&&this._p.x<=r&&(this._isPointOnSegment=!0),null;if(n.y>this._p.y&&t.y<=this._p.y||t.y>this._p.y&&n.y<=this._p.y){var o=n.x-this._p.x,f=n.y-this._p.y,s=t.x-this._p.x,e=t.y-this._p.y,u=aa.signOfDet2x2(o,f,s,e);if(0===u)return this._isPointOnSegment=!0,null;e<f&&(u=-u);u>0&&this._crossingCount++}};cs.prototype.isPointInPolygon=function(){return this.getLocation()!==r.EXTERIOR};cs.prototype.getLocation=function(){return this._isPointOnSegment?r.BOUNDARY:this._crossingCount%2==1?r.INTERIOR:r.EXTERIOR};cs.prototype.isOnSegment=function(){return this._isPointOnSegment};cs.prototype.interfaces_=function(){return[]};cs.prototype.getClass=function(){return cs};cs.locatePointInRing=function(){var h,c;if(arguments[0]instanceof i&&k(arguments[1],ot)){for(var l=arguments[0],f=arguments[1],n=new cs(l),o=new i,s=new i,t=1;t<f.size();t++)if(f.getCoordinate(t,o),f.getCoordinate(t-1,s),n.countSegment(o,s),n.isOnSegment())return n.getLocation();return n.getLocation()}if(arguments[0]instanceof i&&arguments[1]instanceof Array){for(var a=arguments[0],e=arguments[1],r=new cs(a),u=1;u<e.length;u++)if(h=e[u],c=e[u-1],r.countSegment(h,c),r.isOnSegment())return r.getLocation();return r.getLocation()}};o=function(){};va={CLOCKWISE:{configurable:!0},RIGHT:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},LEFT:{configurable:!0},COLLINEAR:{configurable:!0},STRAIGHT:{configurable:!0}};o.prototype.interfaces_=function(){return[]};o.prototype.getClass=function(){return o};o.orientationIndex=function(n,t,i){return ne.orientationIndex(n,t,i)};o.signedArea=function(){var n,l,a,f,o,s,h,e;if(arguments[0]instanceof Array){if(n=arguments[0],n.length<3)return 0;for(var c=0,y=n[0].x,u=1;u<n.length-1;u++)l=n[u].x-y,a=n[u+1].y,c+=l*(n[u-1].y-a);return c/2}if(k(arguments[0],ot)){if(f=arguments[0],o=f.size(),o<3)return 0;var v=new i,r=new i,t=new i;for(f.getCoordinate(0,r),f.getCoordinate(1,t),s=r.x,t.x-=s,h=0,e=1;e<o-1;e++)v.y=r.y,r.x=t.x,r.y=t.y,f.getCoordinate(e+1,t),t.x-=s,h+=r.x*(v.y-t.y);return h/2}};o.distanceLineLine=function(n,t,i,r){var u,f;if(n.equals(t))return o.distancePointLine(n,i,r);if(i.equals(r))return o.distancePointLine(r,n,t);if(u=!1,l.intersects(n,t,i,r))if(f=(t.x-n.x)*(r.y-i.y)-(t.y-n.y)*(r.x-i.x),0===f)u=!0;else{var h=(n.y-i.y)*(r.x-i.x)-(n.x-i.x)*(r.y-i.y),e=((n.y-i.y)*(t.x-n.x)-(n.x-i.x)*(t.y-n.y))/f,s=h/f;(s<0||s>1||e<0||e>1)&&(u=!0)}else u=!0;return u?io.min(o.distancePointLine(n,i,r),o.distancePointLine(t,i,r),o.distancePointLine(i,n,t),o.distancePointLine(r,n,t)):0};o.isPointInRing=function(n,t){return o.locatePointInRing(n,t)!==r.EXTERIOR};o.computeLength=function(n){var f=n.size(),r,t;if(f<=1)return 0;r=0;t=new i;n.getCoordinate(0,t);for(var e=t.x,o=t.y,u=1;u<f;u++){n.getCoordinate(u,t);var s=t.x,h=t.y,c=s-e,l=h-o;r+=Math.sqrt(c*c+l*l);e=s;o=h}return r};o.isCCW=function(n){var s=n.length-1,c,i,r,f,e,l,a;if(s<3)throw new ar("Ring has fewer than 4 points, so orientation cannot be determined");for(var t=n[0],u=0,h=1;h<=s;h++)c=n[h],c.y>t.y&&(t=c,u=h);i=u;do(i-=1)<0&&(i=s);while(n[i].equals2D(t)&&i!==u);r=u;do r=(r+1)%s;while(n[r].equals2D(t)&&r!==u);return(f=n[i],e=n[r],f.equals2D(t)||e.equals2D(t)||f.equals2D(e))?!1:(l=o.computeOrientation(f,t,e),a=!1,a=0===l?f.x>e.x:l>0,a)};o.locatePointInRing=function(n,t){return cs.locatePointInRing(n,t)};o.distancePointLinePerpendicular=function(n,t,i){var r=(i.x-t.x)*(i.x-t.x)+(i.y-t.y)*(i.y-t.y),u=((t.y-n.y)*(i.x-t.x)-(t.x-n.x)*(i.y-t.y))/r;return Math.abs(u)*Math.sqrt(r)};o.computeOrientation=function(n,t,i){return o.orientationIndex(n,t,i)};o.distancePointLine=function(){var s,r,f,u,h,e,c,l;if(2===arguments.length){if(s=arguments[0],r=arguments[1],0===r.length)throw new ar("Line array must contain at least one vertex");for(f=s.distance(r[0]),u=0;u<r.length-1;u++)h=o.distancePointLine(s,r[u],r[u+1]),h<f&&(f=h);return f}if(3===arguments.length){var i=arguments[0],n=arguments[1],t=arguments[2];return n.x===t.x&&n.y===t.y?i.distance(n):(e=(t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y),c=((i.x-n.x)*(t.x-n.x)+(i.y-n.y)*(t.y-n.y))/e,c<=0)?i.distance(n):c>=1?i.distance(t):(l=((n.y-i.y)*(t.x-n.x)-(n.x-i.x)*(t.y-n.y))/e,Math.abs(l)*Math.sqrt(e))}};o.isOnLine=function(n,t){for(var u,f,r=new vl,i=1;i<t.length;i++)if(u=t[i-1],f=t[i],r.computeIntersection(n,u,f),r.hasIntersection())return!0;return!1};va.CLOCKWISE.get=function(){return-1};va.RIGHT.get=function(){return o.CLOCKWISE};va.COUNTERCLOCKWISE.get=function(){return 1};va.LEFT.get=function(){return o.COUNTERCLOCKWISE};va.COLLINEAR.get=function(){return 0};va.STRAIGHT.get=function(){return o.COLLINEAR};Object.defineProperties(o,va);bh=function(){};bh.prototype.filter=function(){};bh.prototype.interfaces_=function(){return[]};bh.prototype.getClass=function(){return bh};b=function(){var n=arguments[0];this._envelope=null;this._factory=null;this._SRID=null;this._userData=null;this._factory=n;this._SRID=n.getSRID()};th={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}};b.prototype.isGeometryCollection=function(){return this.getSortIndex()===b.SORTINDEX_GEOMETRYCOLLECTION};b.prototype.getFactory=function(){return this._factory};b.prototype.getGeometryN=function(){return this};b.prototype.getArea=function(){return 0};b.prototype.isRectangle=function(){return!1};b.prototype.equals=function(){var n,t,i;return arguments[0]instanceof b?(n=arguments[0],null!==n&&this.equalsTopo(n)):arguments[0]instanceof Object?(t=arguments[0],!(t instanceof b))?!1:(i=t,this.equalsExact(i)):void 0};b.prototype.equalsExact=function(n){return this===n||this.equalsExact(n,0)};b.prototype.geometryChanged=function(){this.apply(b.geometryChangedFilter)};b.prototype.geometryChangedAction=function(){this._envelope=null};b.prototype.equalsNorm=function(n){return null!==n&&this.norm().equalsExact(n.norm())};b.prototype.getLength=function(){return 0};b.prototype.getNumGeometries=function(){return 1};b.prototype.compareTo=function(){var i,t,n,r;return 1===arguments.length?(i=arguments[0],t=i,this.getSortIndex()!==t.getSortIndex()?this.getSortIndex()-t.getSortIndex():this.isEmpty()&&t.isEmpty()?0:this.isEmpty()?-1:t.isEmpty()?1:this.compareToSameClass(i)):2===arguments.length?(n=arguments[0],r=arguments[1],this.getSortIndex()!==n.getSortIndex()?this.getSortIndex()-n.getSortIndex():this.isEmpty()&&n.isEmpty()?0:this.isEmpty()?-1:n.isEmpty()?1:this.compareToSameClass(n,r)):void 0};b.prototype.getUserData=function(){return this._userData};b.prototype.getSRID=function(){return this._SRID};b.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())};b.prototype.checkNotGeometryCollection=function(n){if(n.getSortIndex()===b.SORTINDEX_GEOMETRYCOLLECTION)throw new ar("This method does not support GeometryCollection arguments");};b.prototype.equal=function(n,t,i){return 0===i?n.equals(t):n.distance(t)<=i};b.prototype.norm=function(){var n=this.copy();return n.normalize(),n};b.prototype.getPrecisionModel=function(){return this._factory.getPrecisionModel()};b.prototype.getEnvelopeInternal=function(){return null===this._envelope&&(this._envelope=this.computeEnvelopeInternal()),new l(this._envelope)};b.prototype.setSRID=function(n){this._SRID=n};b.prototype.setUserData=function(n){this._userData=n};b.prototype.compare=function(n,t){for(var i=n.iterator(),r=t.iterator();i.hasNext()&&r.hasNext();){var f=i.next(),e=r.next(),u=f.compareTo(e);if(0!==u)return u}return i.hasNext()?1:r.hasNext()?-1:0};b.prototype.hashCode=function(){return this.getEnvelopeInternal().hashCode()};b.prototype.isGeometryCollectionOrDerived=function(){return this.getSortIndex()===b.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===b.SORTINDEX_MULTIPOINT||this.getSortIndex()===b.SORTINDEX_MULTILINESTRING||this.getSortIndex()===b.SORTINDEX_MULTIPOLYGON};b.prototype.interfaces_=function(){return[dg,co,ho]};b.prototype.getClass=function(){return b};b.hasNonEmptyElements=function(n){for(var t=0;t<n.length;t++)if(!n[t].isEmpty())return!0;return!1};b.hasNullElements=function(n){for(var t=0;t<n.length;t++)if(null===n[t])return!0;return!1};th.serialVersionUID.get=function(){return 0x799ea46522854c00};th.SORTINDEX_POINT.get=function(){return 0};th.SORTINDEX_MULTIPOINT.get=function(){return 1};th.SORTINDEX_LINESTRING.get=function(){return 2};th.SORTINDEX_LINEARRING.get=function(){return 3};th.SORTINDEX_MULTILINESTRING.get=function(){return 4};th.SORTINDEX_POLYGON.get=function(){return 5};th.SORTINDEX_MULTIPOLYGON.get=function(){return 6};th.SORTINDEX_GEOMETRYCOLLECTION.get=function(){return 7};th.geometryChangedFilter.get=function(){return nn};Object.defineProperties(b,th);nn=function(){};nn.interfaces_=function(){return[bh]};nn.filter=function(n){n.geometryChangedAction()};ih=function(){};ih.prototype.filter=function(){};ih.prototype.interfaces_=function(){return[]};ih.prototype.getClass=function(){return ih};ro=function(){};kh={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}};ro.prototype.isInBoundary=function(){};ro.prototype.interfaces_=function(){return[]};ro.prototype.getClass=function(){return ro};kh.Mod2BoundaryNodeRule.get=function(){return wv};kh.EndPointBoundaryNodeRule.get=function(){return bv};kh.MultiValentEndPointBoundaryNodeRule.get=function(){return kv};kh.MonoValentEndPointBoundaryNodeRule.get=function(){return dv};kh.MOD2_BOUNDARY_RULE.get=function(){return new wv};kh.ENDPOINT_BOUNDARY_RULE.get=function(){return new bv};kh.MULTIVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new kv};kh.MONOVALENT_ENDPOINT_BOUNDARY_RULE.get=function(){return new dv};kh.OGC_SFS_BOUNDARY_RULE.get=function(){return ro.MOD2_BOUNDARY_RULE};Object.defineProperties(ro,kh);wv=function(){};wv.prototype.isInBoundary=function(n){return n%2==1};wv.prototype.interfaces_=function(){return[ro]};wv.prototype.getClass=function(){return wv};bv=function(){};bv.prototype.isInBoundary=function(n){return n>0};bv.prototype.interfaces_=function(){return[ro]};bv.prototype.getClass=function(){return bv};kv=function(){};kv.prototype.isInBoundary=function(n){return n>1};kv.prototype.interfaces_=function(){return[ro]};kv.prototype.getClass=function(){return kv};dv=function(){};dv.prototype.isInBoundary=function(n){return 1===n};dv.prototype.interfaces_=function(){return[ro]};dv.prototype.getClass=function(){return dv};eu=function(){};eu.prototype.add=function(){};eu.prototype.addAll=function(){};eu.prototype.isEmpty=function(){};eu.prototype.iterator=function(){};eu.prototype.size=function(){};eu.prototype.toArray=function(){};eu.prototype.remove=function(){};hvt=function(n){function t(t){n.call(this);this.message=t||""}n&&(t.__proto__=n);(t.prototype=Object.create(n&&n.prototype)).constructor=t;var i={name:{configurable:!0}};return i.name.get=function(){return"IndexOutOfBoundsException"},Object.defineProperties(t,i),t}(Error);gv=function(){};gv.prototype.hasNext=function(){};gv.prototype.next=function(){};gv.prototype.remove=function(){};vo=function(n){function t(){n.apply(this,arguments)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.get=function(){},t.prototype.set=function(){},t.prototype.isEmpty=function(){},t}(eu);(pb.prototype=new Error).name="NoSuchElementException";var e=function(n){function t(){n.call(this);this.array_=[];arguments[0]instanceof eu&&this.addAll(arguments[0])}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.ensureCapacity=function(){},t.prototype.interfaces_=function(){return[n,eu]},t.prototype.add=function(n){return 1===arguments.length?this.array_.push(n):this.array_.splice(arguments[0],arguments[1]),!0},t.prototype.clear=function(){this.array_=[]},t.prototype.addAll=function(n){for(var t=n.iterator();t.hasNext();)this.add(t.next());return!0},t.prototype.set=function(n,t){var i=this.array_[n];return this.array_[n]=t,i},t.prototype.iterator=function(){return new ekt(this)},t.prototype.get=function(n){if(n<0||n>=this.size())throw new hvt;return this.array_[n]},t.prototype.isEmpty=function(){return 0===this.array_.length},t.prototype.size=function(){return this.array_.length},t.prototype.toArray=function(){for(var t=[],n=0,i=this.array_.length;n<i;n++)t.push(this.array_[n]);return t},t.prototype.remove=function(n){for(var i=!1,t=0,r=this.array_.length;t<r;t++)if(this.array_[t]===n){this.array_.splice(t,1);i=!0;break}return i},t}(vo),ekt=function(n){function t(t){n.call(this);this.arrayList_=t;this.position_=0}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new pb;return this.arrayList_.get(this.position_++)},t.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},t.prototype.set=function(n){return this.arrayList_.set(this.position_-1,n)},t.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))},t}(gv),tk=function(n){function t(){var t,i,r;(n.call(this),0===arguments.length)||(1===arguments.length?(t=arguments[0],this.ensureCapacity(t.length),this.add(t,!0)):2===arguments.length&&(i=arguments[0],r=arguments[1],this.ensureCapacity(i.length),this.add(i,r)))}n&&(t.__proto__=n);(t.prototype=Object.create(n&&n.prototype)).constructor=t;var r={coordArrayType:{configurable:!0}};return r.coordArrayType.get=function(){return new Array(0).fill(null)},t.prototype.getCoordinate=function(n){return this.get(n)},t.prototype.addAll=function(){if(2===arguments.length){for(var r=arguments[0],u=arguments[1],t=!1,i=r.iterator();i.hasNext();)this.add(i.next(),u),t=!0;return t}return n.prototype.addAll.apply(this,arguments)},t.prototype.clone=function(){for(var i=n.prototype.clone.call(this),t=0;t<this.size();t++)i.add(t,this.get(t).copy());return i},t.prototype.toCoordinateArray=function(){return this.toArray(t.coordArrayType)},t.prototype.add=function(){var l,a,v,s,y,p,r,h,u,f,t,e,c,o;if(1===arguments.length)l=arguments[0],n.prototype.add.call(this,l);else if(2===arguments.length){if(arguments[0]instanceof Array&&"boolean"==typeof arguments[1])return a=arguments[0],v=arguments[1],this.add(a,v,!0),!0;if(arguments[0]instanceof i&&"boolean"==typeof arguments[1]){if(s=arguments[0],!arguments[1]&&this.size()>=1&&this.get(this.size()-1).equals2D(s))return null;n.prototype.add.call(this,s)}else if(arguments[0]instanceof Object&&"boolean"==typeof arguments[1])return y=arguments[0],p=arguments[1],this.add(y,p),!0}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){if(r=arguments[0],h=arguments[1],arguments[2])for(u=0;u<r.length;u++)this.add(r[u],h);else for(f=r.length-1;f>=0;f--)this.add(r[f],h);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof i){if(t=arguments[0],e=arguments[1],!arguments[2]&&(c=this.size(),c>0&&(t>0&&this.get(t-1).equals2D(e)||t<c&&this.get(t).equals2D(e))))return null;n.prototype.add.call(this,t,e)}}else if(4===arguments.length){var d=arguments[0],g=arguments[1],w=arguments[2],b=arguments[3],k=1;for(w>b&&(k=-1),o=w;o!==b;o+=k)this.add(d[o],g);return!0}},t.prototype.closeRing=function(){this.size()>0&&this.add(new i(this.get(0)),!1)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},Object.defineProperties(t,r),t}(e),ft=function(){},tn={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};tn.ForwardComparator.get=function(){return yp};tn.BidirectionalComparator.get=function(){return ny};tn.coordArrayType.get=function(){return new Array(0).fill(null)};ft.prototype.interfaces_=function(){return[]};ft.prototype.getClass=function(){return ft};ft.isRing=function(n){return!(n.length<4)&&!!n[0].equals2D(n[n.length-1])};ft.ptNotInList=function(n,t){for(var r,i=0;i<n.length;i++)if(r=n[i],ft.indexOf(r,t)<0)return r;return null};ft.scroll=function(n,t){var i=ft.indexOf(t,n),r;if(i<0)return null;r=new Array(n.length).fill(null);rf.arraycopy(n,i,r,0,n.length-i);rf.arraycopy(n,0,r,n.length-i,i);rf.arraycopy(r,0,n,0,n.length)};ft.equals=function(){var n,t,i,u;if(2===arguments.length){if(n=arguments[0],t=arguments[1],n===t)return!0;if(null===n||null===t||n.length!==t.length)return!1;for(i=0;i<n.length;i++)if(!n[i].equals(t[i]))return!1;return!0}if(3===arguments.length){var r=arguments[0],f=arguments[1],e=arguments[2];if(r===f)return!0;if(null===r||null===f||r.length!==f.length)return!1;for(u=0;u<r.length;u++)if(0!==e.compare(r[u],f[u]))return!1;return!0}};ft.intersection=function(n,t){for(var r=new tk,i=0;i<n.length;i++)t.intersects(n[i])&&r.add(n[i],!0);return r.toCoordinateArray()};ft.hasRepeatedPoints=function(n){for(var t=1;t<n.length;t++)if(n[t-1].equals(n[t]))return!0;return!1};ft.removeRepeatedPoints=function(n){return ft.hasRepeatedPoints(n)?new tk(n,!1).toCoordinateArray():n};ft.reverse=function(n){for(var r,i=n.length-1,u=Math.trunc(i/2),t=0;t<=u;t++)r=n[t],n[t]=n[i-t],n[i-t]=r};ft.removeNull=function(n){for(var u,f,t,i=0,r=0;r<n.length;r++)null!==n[r]&&i++;if(u=new Array(i).fill(null),0===i)return u;for(f=0,t=0;t<n.length;t++)null!==n[t]&&(u[f++]=n[t]);return u};ft.copyDeep=function(){if(1===arguments.length){for(var r=arguments[0],u=new Array(r.length).fill(null),n=0;n<r.length;n++)u[n]=new i(r[n]);return u}if(5===arguments.length)for(var f=arguments[0],e=arguments[1],o=arguments[2],s=arguments[3],h=arguments[4],t=0;t<h;t++)o[s+t]=new i(f[e+t])};ft.isEqualReversed=function(n,t){for(var r,u,i=0;i<n.length;i++)if(r=n[i],u=t[n.length-i-1],0!==r.compareTo(u))return!1;return!0};ft.envelope=function(n){for(var i=new l,t=0;t<n.length;t++)i.expandToInclude(n[t]);return i};ft.toCoordinateArray=function(n){return n.toArray(ft.coordArrayType)};ft.atLeastNCoordinatesOrNothing=function(n,t){return t.length>=n?t:[]};ft.indexOf=function(n,t){for(var i=0;i<t.length;i++)if(n.equals(t[i]))return i;return-1};ft.increasingDirection=function(n){for(var r,i,t=0;t<Math.trunc(n.length/2);t++)if(r=n.length-1-t,i=n[t].compareTo(n[r]),0!==i)return i;return 1};ft.compare=function(n,t){for(var r,i=0;i<n.length&&i<t.length;){if(r=n[i].compareTo(t[i]),0!==r)return r;i++}return i<t.length?-1:i<n.length?1:0};ft.minCoordinate=function(n){for(var t=null,i=0;i<n.length;i++)(null===t||t.compareTo(n[i])>0)&&(t=n[i]);return t};ft.extract=function(n,t,i){var r,u,e,f;if(t=io.clamp(t,0,n.length),r=(i=io.clamp(i,-1,n.length))-t+1,i<0&&(r=0),t>=n.length&&(r=0),i<t&&(r=0),u=new Array(r).fill(null),0===r)return u;for(e=0,f=t;f<=i;f++)u[e++]=n[f];return u};Object.defineProperties(ft,tn);yp=function(){};yp.prototype.compare=function(n,t){return ft.compare(n,t)};yp.prototype.interfaces_=function(){return[sp]};yp.prototype.getClass=function(){return yp};ny=function(){};ny.prototype.compare=function(n,t){var i=n,r=t,u;return i.length<r.length?-1:i.length>r.length?1:0===i.length?0:(u=ft.compare(i,r),ft.isEqualReversed(i,r)?0:u)};ny.prototype.OLDcompare=function(n,t){var i=n,r=t,u;if(i.length<r.length)return-1;if(i.length>r.length)return 1;if(0===i.length)return 0;for(var f=ft.increasingDirection(i),e=ft.increasingDirection(r),o=f>0?0:i.length-1,s=e>0?0:i.length-1,h=0;h<i.length;h++){if(u=i[o].compareTo(r[s]),0!==u)return u;o+=f;s+=e}return 0};ny.prototype.interfaces_=function(){return[sp]};ny.prototype.getClass=function(){return ny};ya=function(){};ya.prototype.get=function(){};ya.prototype.put=function(){};ya.prototype.size=function(){};ya.prototype.values=function(){};ya.prototype.entrySet=function(){};cvt=function(n){function t(){n.apply(this,arguments)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(ya);(ng.prototype=new Error).name="OperationNotSupported";(frt.prototype=new eu).contains=function(){};var vut=function(n){function t(){n.call(this);this.array_=[];arguments[0]instanceof eu&&this.addAll(arguments[0])}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.contains=function(n){for(var t=0,i=this.array_.length;t<i;t++)if(this.array_[t]===n)return!0;return!1},t.prototype.add=function(n){return!this.contains(n)&&(this.array_.push(n),!0)},t.prototype.addAll=function(n){for(var t=n.iterator();t.hasNext();)this.add(t.next());return!0},t.prototype.remove=function(){throw new Error;},t.prototype.size=function(){return this.array_.length},t.prototype.isEmpty=function(){return 0===this.array_.length},t.prototype.toArray=function(){for(var t=[],n=0,i=this.array_.length;n<i;n++)t.push(this.array_[n]);return t},t.prototype.iterator=function(){return new okt(this)},t}(frt),okt=function(n){function t(t){n.call(this);this.hashSet_=t;this.position_=0}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new pb;return this.hashSet_.array_[this.position_++]},t.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},t.prototype.remove=function(){throw new ng;},t}(gv),yc=0;(df.prototype=new cvt).get=function(n){for(var i,t=this.root_;null!==t;)if(i=n.compareTo(t.key),i<0)t=t.left;else{if(!(i>0))return t.value;t=t.right}return null};df.prototype.put=function(n,t){var r,f,i,e,u;if(null===this.root_)return this.root_={key:n,value:t,left:null,right:null,parent:null,color:yc,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;i=this.root_;do if(r=i,(f=n.compareTo(i.key))<0)i=i.left;else{if(!(f>0))return e=i.value,i.value=t,e;i=i.right}while(null!==i);return u={key:n,left:null,right:null,value:t,parent:r,color:yc,getValue:function(){return this.value},getKey:function(){return this.key}},f<0?r.left=u:r.right=u,this.fixAfterInsertion(u),this.size_++,null};df.prototype.fixAfterInsertion=function(n){var t,i;for(n.color=1;null!=n&&n!==this.root_&&1===n.parent.color;)sr(n)===ert(sr(sr(n)))?(t=tlt(sr(sr(n))),1===nlt(t)?(hc(sr(n),yc),hc(t,yc),hc(sr(sr(n)),1),n=sr(sr(n))):(n===tlt(sr(n))&&(n=sr(n),this.rotateLeft(n)),hc(sr(n),yc),hc(sr(sr(n)),1),this.rotateRight(sr(sr(n))))):(i=ert(sr(sr(n))),1===nlt(i)?(hc(sr(n),yc),hc(i,yc),hc(sr(sr(n)),1),n=sr(sr(n))):(n===ert(sr(n))&&(n=sr(n),this.rotateRight(n)),hc(sr(n),yc),hc(sr(sr(n)),1),this.rotateLeft(sr(sr(n)))));this.root_.color=yc};df.prototype.values=function(){var t=new e,n=this.getFirstEntry();if(null!==n)for(t.add(n.value);null!==(n=df.successor(n));)t.add(n.value);return t};df.prototype.entrySet=function(){var t=new vut,n=this.getFirstEntry();if(null!==n)for(t.add(n);null!==(n=df.successor(n));)t.add(n);return t};df.prototype.rotateLeft=function(n){if(null!=n){var t=n.right;n.right=t.left;null!=t.left&&(t.left.parent=n);t.parent=n.parent;null===n.parent?this.root_=t:n.parent.left===n?n.parent.left=t:n.parent.right=t;t.left=n;n.parent=t}};df.prototype.rotateRight=function(n){if(null!=n){var t=n.left;n.left=t.right;null!=t.right&&(t.right.parent=n);t.parent=n.parent;null===n.parent?this.root_=t:n.parent.right===n?n.parent.right=t:n.parent.left=t;t.right=n;n.parent=t}};df.prototype.getFirstEntry=function(){var n=this.root_;if(null!=n)for(;null!=n.left;)n=n.left;return n};df.successor=function(n){var i,t,r;if(null===n)return null;if(null!==n.right){for(i=n.right;null!==i.left;)i=i.left;return i}for(t=n.parent,r=n;null!==t&&r===t.right;)r=t,t=t.parent;return t};df.prototype.size=function(){return this.size_};pp=function(){};pp.prototype.interfaces_=function(){return[]};pp.prototype.getClass=function(){return pp};ilt.prototype=new frt;(vh.prototype=new ilt).contains=function(n){for(var t=0,i=this.array_.length;t<i;t++)if(0===this.array_[t].compareTo(n))return!0;return!1};vh.prototype.add=function(n){if(this.contains(n))return!1;for(var t=0,i=this.array_.length;t<i;t++)if(1===this.array_[t].compareTo(n))return this.array_.splice(t,0,n),!0;return this.array_.push(n),!0};vh.prototype.addAll=function(n){for(var t=n.iterator();t.hasNext();)this.add(t.next());return!0};vh.prototype.remove=function(){throw new ng;};vh.prototype.size=function(){return this.array_.length};vh.prototype.isEmpty=function(){return 0===this.array_.length};vh.prototype.toArray=function(){for(var t=[],n=0,i=this.array_.length;n<i;n++)t.push(this.array_[n]);return t};vh.prototype.iterator=function(){return new ik(this)};ik=function(n){this.treeSet_=n;this.position_=0};ik.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new pb;return this.treeSet_.array_[this.position_++]};ik.prototype.hasNext=function(){return this.position_<this.treeSet_.size()};ik.prototype.remove=function(){throw new ng;};yl=function(){};yl.sort=function(){var t,u,f,i,n=arguments[0],r;if(1===arguments.length)i=function(n,t){return n.compareTo(t)},n.sort(i);else if(2===arguments.length)f=arguments[1],i=function(n,t){return f.compare(n,t)},n.sort(i);else if(3===arguments.length)for((u=n.slice(arguments[1],arguments[2])).sort(),r=n.slice(0,arguments[1]).concat(u,n.slice(arguments[2],n.length)),n.splice(0,n.length),t=0;t<r.length;t++)n.push(r[t]);else if(4===arguments.length)for(u=n.slice(arguments[1],arguments[2]),f=arguments[3],i=function(n,t){return f.compare(n,t)},u.sort(i),r=n.slice(0,arguments[1]).concat(u,n.slice(arguments[2],n.length)),n.splice(0,n.length),t=0;t<r.length;t++)n.push(r[t])};yl.asList=function(n){for(var i=new e,t=0,r=n.length;t<r;t++)i.add(n[t]);return i};yi=function(){};yo={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}};yo.P.get=function(){return 0};yo.L.get=function(){return 1};yo.A.get=function(){return 2};yo.FALSE.get=function(){return-1};yo.TRUE.get=function(){return-2};yo.DONTCARE.get=function(){return-3};yo.SYM_FALSE.get=function(){return"F"};yo.SYM_TRUE.get=function(){return"T"};yo.SYM_DONTCARE.get=function(){return"*"};yo.SYM_P.get=function(){return"0"};yo.SYM_L.get=function(){return"1"};yo.SYM_A.get=function(){return"2"};yi.prototype.interfaces_=function(){return[]};yi.prototype.getClass=function(){return yi};yi.toDimensionSymbol=function(n){switch(n){case yi.FALSE:return yi.SYM_FALSE;case yi.TRUE:return yi.SYM_TRUE;case yi.DONTCARE:return yi.SYM_DONTCARE;case yi.P:return yi.SYM_P;case yi.L:return yi.SYM_L;case yi.A:return yi.SYM_A}throw new ar("Unknown dimension value: "+n);};yi.toDimensionValue=function(n){switch(cp.toUpperCase(n)){case yi.SYM_FALSE:return yi.FALSE;case yi.SYM_TRUE:return yi.TRUE;case yi.SYM_DONTCARE:return yi.DONTCARE;case yi.SYM_P:return yi.P;case yi.SYM_L:return yi.L;case yi.SYM_A:return yi.A}throw new ar("Unknown dimension symbol: "+n);};Object.defineProperties(yi,yo);ls=function(){};ls.prototype.filter=function(){};ls.prototype.interfaces_=function(){return[]};ls.prototype.getClass=function(){return ls};po=function(){};po.prototype.filter=function(){};po.prototype.isDone=function(){};po.prototype.isGeometryChanged=function(){};po.prototype.interfaces_=function(){return[]};po.prototype.getClass=function(){return po};var te=function(n){function t(t,i){if(n.call(this,i),this._geometries=t||[],n.hasNullElements(this._geometries))throw new ar("geometries must not contain null elements");}n&&(t.__proto__=n);(t.prototype=Object.create(n&&n.prototype)).constructor=t;var i={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){for(var t=new l,n=0;n<this._geometries.length;n++)t.expandToInclude(this._geometries[n].getEnvelopeInternal());return t},t.prototype.getGeometryN=function(n){return this._geometries[n]},t.prototype.getSortIndex=function(){return n.SORTINDEX_GEOMETRYCOLLECTION},t.prototype.getCoordinates=function(){for(var i,n,r=new Array(this.getNumPoints()).fill(null),u=-1,t=0;t<this._geometries.length;t++)for(i=this._geometries[t].getCoordinates(),n=0;n<i.length;n++)r[++u]=i[n];return r},t.prototype.getArea=function(){for(var t=0,n=0;n<this._geometries.length;n++)t+=this._geometries[n].getArea();return t},t.prototype.equalsExact=function(){var i,u,r,t;if(2===arguments.length){if((i=arguments[0],u=arguments[1],!this.isEquivalentClass(i))||(r=i,this._geometries.length!==r._geometries.length))return!1;for(t=0;t<this._geometries.length;t++)if(!this._geometries[t].equalsExact(r._geometries[t],u))return!1;return!0}return n.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){for(var n=0;n<this._geometries.length;n++)this._geometries[n].normalize();yl.sort(this._geometries)},t.prototype.getCoordinate=function(){return this.isEmpty()?null:this._geometries[0].getCoordinate()},t.prototype.getBoundaryDimension=function(){for(var n=yi.FALSE,t=0;t<this._geometries.length;t++)n=Math.max(n,this._geometries[t].getBoundaryDimension());return n},t.prototype.getDimension=function(){for(var n=yi.FALSE,t=0;t<this._geometries.length;t++)n=Math.max(n,this._geometries[t].getDimension());return n},t.prototype.getLength=function(){for(var t=0,n=0;n<this._geometries.length;n++)t+=this._geometries[n].getLength();return t},t.prototype.getNumPoints=function(){for(var t=0,n=0;n<this._geometries.length;n++)t+=this._geometries[n].getNumPoints();return t},t.prototype.getNumGeometries=function(){return this._geometries.length},t.prototype.reverse=function(){for(var i=this._geometries.length,t=new Array(i).fill(null),n=0;n<this._geometries.length;n++)t[n]=this._geometries[n].reverse();return this.getFactory().createGeometryCollection(t)},t.prototype.compareToSameClass=function(){if(1===arguments.length){var f=arguments[0],e=new vh(yl.asList(this._geometries)),o=new vh(yl.asList(f._geometries));return this.compare(e,o)}if(2===arguments.length){for(var s=arguments[0],h=arguments[1],t=s,i=this.getNumGeometries(),r=t.getNumGeometries(),n=0;n<i&&n<r;){var c=this.getGeometryN(n),l=t.getGeometryN(n),u=c.compareToSameClass(l,h);if(0!==u)return u;n++}return n<i?1:n<r?-1:0}},t.prototype.apply=function(){var o,n,t,i,f,r,e,u;if(k(arguments[0],ih))for(o=arguments[0],n=0;n<this._geometries.length;n++)this._geometries[n].apply(o);else if(k(arguments[0],po)){if(t=arguments[0],0===this._geometries.length)return null;for(i=0;i<this._geometries.length&&(this._geometries[i].apply(t),!t.isDone());i++);t.isGeometryChanged()&&this.geometryChanged()}else if(k(arguments[0],ls))for(f=arguments[0],f.filter(this),r=0;r<this._geometries.length;r++)this._geometries[r].apply(f);else if(k(arguments[0],bh))for(e=arguments[0],e.filter(this),u=0;u<this._geometries.length;u++)this._geometries[u].apply(e)},t.prototype.getBoundary=function(){return this.checkNotGeometryCollection(this),rt.shouldNeverReachHere(),null},t.prototype.clone=function(){var i=n.prototype.clone.call(this),t;for(i._geometries=new Array(this._geometries.length).fill(null),t=0;t<this._geometries.length;t++)i._geometries[t]=this._geometries[t].clone();return i},t.prototype.getGeometryType=function(){return"GeometryCollection"},t.prototype.copy=function(){for(var i=new Array(this._geometries.length).fill(null),n=0;n<i.length;n++)i[n]=this._geometries[n].copy();return new t(i,this._factory)},t.prototype.isEmpty=function(){for(var n=0;n<this._geometries.length;n++)if(!this._geometries[n].isEmpty())return!1;return!0},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},i.serialVersionUID.get=function(){return-0x4f07bcb1f857d800},Object.defineProperties(t,i),t}(b),pa=function(n){function t(){n.apply(this,arguments)}n&&(t.__proto__=n);(t.prototype=Object.create(n&&n.prototype)).constructor=t;var i={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return b.SORTINDEX_MULTILINESTRING},t.prototype.equalsExact=function(){if(2===arguments.length){var t=arguments[0],i=arguments[1];return!!this.isEquivalentClass(t)&&n.prototype.equalsExact.call(this,t,i)}return n.prototype.equalsExact.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return this.isClosed()?yi.FALSE:0},t.prototype.isClosed=function(){if(this.isEmpty())return!1;for(var n=0;n<this._geometries.length;n++)if(!this._geometries[n].isClosed())return!1;return!0},t.prototype.getDimension=function(){return 1},t.prototype.reverse=function(){for(var t=this._geometries.length,i=new Array(t).fill(null),n=0;n<this._geometries.length;n++)i[t-1-n]=this._geometries[n].reverse();return this.getFactory().createMultiLineString(i)},t.prototype.getBoundary=function(){return new wo(this).getBoundary()},t.prototype.getGeometryType=function(){return"MultiLineString"},t.prototype.copy=function(){for(var i=new Array(this._geometries.length).fill(null),n=0;n<i.length;n++)i[n]=this._geometries[n].copy();return new t(i,this._factory)},t.prototype.interfaces_=function(){return[pp]},t.prototype.getClass=function(){return t},i.serialVersionUID.get=function(){return 0x7155d2ab4afa8000},Object.defineProperties(t,i),t}(te),wo=function(){var n,i,t,r;(this._geom=null,this._geomFact=null,this._bnRule=null,this._endpointMap=null,1===arguments.length)?(n=arguments[0],i=ro.MOD2_BOUNDARY_RULE,this._geom=n,this._geomFact=n.getFactory(),this._bnRule=i):2===arguments.length&&(t=arguments[0],r=arguments[1],this._geom=t,this._geomFact=t.getFactory(),this._bnRule=r)};wo.prototype.boundaryMultiLineString=function(n){if(this._geom.isEmpty())return this.getEmptyMultiPoint();var t=this.computeBoundaryCoordinates(n);return 1===t.length?this._geomFact.createPoint(t[0]):this._geomFact.createMultiPointFromCoords(t)};wo.prototype.getBoundary=function(){return this._geom instanceof wr?this.boundaryLineString(this._geom):this._geom instanceof pa?this.boundaryMultiLineString(this._geom):this._geom.getBoundary()};wo.prototype.boundaryLineString=function(n){return this._geom.isEmpty()?this.getEmptyMultiPoint():n.isClosed()?this._bnRule.isInBoundary(2)?n.getStartPoint():this._geomFact.createMultiPoint():this._geomFact.createMultiPoint([n.getStartPoint(),n.getEndPoint()])};wo.prototype.getEmptyMultiPoint=function(){return this._geomFact.createMultiPoint()};wo.prototype.computeBoundaryCoordinates=function(n){var f=new e,i,t,r,u,o;for(this._endpointMap=new df,i=0;i<n.getNumGeometries();i++)t=n.getGeometryN(i),0!==t.getNumPoints()&&(this.addEndpoint(t.getCoordinateN(0)),this.addEndpoint(t.getCoordinateN(t.getNumPoints()-1)));for(r=this._endpointMap.entrySet().iterator();r.hasNext();)u=r.next(),o=u.getValue().count,this._bnRule.isInBoundary(o)&&f.add(u.getKey());return ft.toCoordinateArray(f)};wo.prototype.addEndpoint=function(n){var t=this._endpointMap.get(n);null===t&&(t=new rk,this._endpointMap.put(n,t));t.count++};wo.prototype.interfaces_=function(){return[]};wo.prototype.getClass=function(){return wo};wo.getBoundary=function(){var n,t,i;return 1===arguments.length?(n=arguments[0],new wo(n).getBoundary()):2===arguments.length?(t=arguments[0],i=arguments[1],new wo(t,i).getBoundary()):void 0};rk=function(){this.count=null};rk.prototype.interfaces_=function(){return[]};rk.prototype.getClass=function(){return rk};uo=function(){};rn={NEWLINE:{configurable:!0},SIMPLE_ORDINATE_FORMAT:{configurable:!0}};uo.prototype.interfaces_=function(){return[]};uo.prototype.getClass=function(){return uo};uo.chars=function(n,t){for(var r=new Array(t).fill(null),i=0;i<t;i++)r[i]=n;return String(r)};uo.getStackTrace=function(){if(1===arguments.length){var n=arguments[0],t=new function(){},u=new function(){}(t);return n.printStackTrace(u),t.toString()}if(2===arguments.length){for(var f=arguments[0],e=arguments[1],i="",o=new function(){}(new function(){}(uo.getStackTrace(f))),r=0;r<e;r++)try{i+=o.readLine()+uo.NEWLINE}catch(n){if(!(n instanceof uwt))throw n;rt.shouldNeverReachHere()}return i}};uo.split=function(n,t){for(var s,o,r,h=t.length,u=new e,i=""+n,f=i.indexOf(t);f>=0;)s=i.substring(0,f),u.add(s),f=(i=i.substring(f+h)).indexOf(t);for(i.length>0&&u.add(i),o=new Array(u.size()).fill(null),r=0;r<o.length;r++)o[r]=u.get(r);return o};uo.toString=function(){if(1===arguments.length){var n=arguments[0];return uo.SIMPLE_ORDINATE_FORMAT.format(n)}};uo.spaces=function(n){return uo.chars(" ",n)};rn.NEWLINE.get=function(){return rf.getProperty("line.separator")};rn.SIMPLE_ORDINATE_FORMAT.get=function(){return new function(){}("0.#")};Object.defineProperties(uo,rn);kr=function(){};kr.prototype.interfaces_=function(){return[]};kr.prototype.getClass=function(){return kr};kr.copyCoord=function(n,t,i,r){for(var f=Math.min(n.getDimension(),i.getDimension()),u=0;u<f;u++)i.setOrdinate(r,u,n.getOrdinate(t,u))};kr.isRing=function(n){var t=n.size();return 0===t||!(t<=3)&&n.getOrdinate(0,ot.X)===n.getOrdinate(t-1,ot.X)&&n.getOrdinate(0,ot.Y)===n.getOrdinate(t-1,ot.Y)};kr.isEqual=function(n,t){var u=n.size(),f,i,r,e,o;if(u!==t.size())return!1;for(f=Math.min(n.getDimension(),t.getDimension()),i=0;i<u;i++)for(r=0;r<f;r++)if(e=n.getOrdinate(i,r),o=t.getOrdinate(i,r),n.getOrdinate(i,r)!==t.getOrdinate(i,r)&&(!it.isNaN(e)||!it.isNaN(o)))return!1;return!0};kr.extend=function(n,t,i){var f=n.create(i,t.getDimension()),r=t.size(),u;if(kr.copy(t,0,f,0,r),r>0)for(u=r;u<i;u++)kr.copy(t,r-1,f,u,1);return f};kr.reverse=function(n){for(var i=n.size()-1,r=Math.trunc(i/2),t=0;t<=r;t++)kr.swap(n,t,i-t)};kr.swap=function(n,t,i){var r,u;if(t===i)return null;for(r=0;r<n.getDimension();r++)u=n.getOrdinate(t,r),n.setOrdinate(t,r,n.getOrdinate(i,r)),n.setOrdinate(i,r,u)};kr.copy=function(n,t,i,r,u){for(var f=0;f<u;f++)kr.copyCoord(n,t+f,i,r+f)};kr.toString=function(){var r,u,f,n,t,i;if(1===arguments.length){if(r=arguments[0],u=r.size(),0===u)return"()";for(f=r.getDimension(),n=new es,n.append("("),t=0;t<u;t++)for(t>0&&n.append(" "),i=0;i<f;i++)i>0&&n.append(","),n.append(uo.toString(r.getOrdinate(t,i)));return n.append(")"),n.toString()}};kr.ensureValidRing=function(n,t){var i=t.size();return 0===i?t:i<=3?kr.createClosedRing(n,t,4):t.getOrdinate(0,ot.X)===t.getOrdinate(i-1,ot.X)&&t.getOrdinate(0,ot.Y)===t.getOrdinate(i-1,ot.Y)?t:kr.createClosedRing(n,t,i+1)};kr.createClosedRing=function(n,t,i){var u=n.create(i,t.getDimension()),f=t.size(),r;for(kr.copy(t,0,u,0,f),r=f;r<i;r++)kr.copy(t,0,u,r,1);return u};wr=function(n){function t(t,i){n.call(this,i);this._points=null;this.init(t)}n&&(t.__proto__=n);(t.prototype=Object.create(n&&n.prototype)).constructor=t;var i={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){return this.isEmpty()?new l:this._points.expandEnvelope(new l)},t.prototype.isRing=function(){return this.isClosed()&&this.isSimple()},t.prototype.getSortIndex=function(){return n.SORTINDEX_LINESTRING},t.prototype.getCoordinates=function(){return this._points.toCoordinateArray()},t.prototype.equalsExact=function(){var i,u,r,t;if(2===arguments.length){if((i=arguments[0],u=arguments[1],!this.isEquivalentClass(i))||(r=i,this._points.size()!==r._points.size()))return!1;for(t=0;t<this._points.size();t++)if(!this.equal(this._points.getCoordinate(t),r._points.getCoordinate(t),u))return!1;return!0}return n.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){for(var t,n=0;n<Math.trunc(this._points.size()/2);n++)if(t=this._points.size()-1-n,!this._points.getCoordinate(n).equals(this._points.getCoordinate(t)))return this._points.getCoordinate(n).compareTo(this._points.getCoordinate(t))>0&&kr.reverse(this._points),null},t.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},t.prototype.getBoundaryDimension=function(){return this.isClosed()?yi.FALSE:0},t.prototype.isClosed=function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},t.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},t.prototype.getDimension=function(){return 1},t.prototype.getLength=function(){return o.computeLength(this._points)},t.prototype.getNumPoints=function(){return this._points.size()},t.prototype.reverse=function(){var n=this._points.copy();return kr.reverse(n),this.getFactory().createLineString(n)},t.prototype.compareToSameClass=function(){var r,u;if(1===arguments.length){for(var i=arguments[0],n=0,t=0;n<this._points.size()&&t<i._points.size();){if(r=this._points.getCoordinate(n).compareTo(i._points.getCoordinate(t)),0!==r)return r;n++;t++}return n<this._points.size()?1:t<i._points.size()?-1:0}if(2===arguments.length)return u=arguments[0],arguments[1].compare(this._points,u._points)},t.prototype.apply=function(){var r,n,t,i;if(k(arguments[0],ih))for(r=arguments[0],n=0;n<this._points.size();n++)r.filter(this._points.getCoordinate(n));else if(k(arguments[0],po)){if(t=arguments[0],0===this._points.size())return null;for(i=0;i<this._points.size()&&(t.filter(this._points,i),!t.isDone());i++);t.isGeometryChanged()&&this.geometryChanged()}else k(arguments[0],ls)?arguments[0].filter(this):k(arguments[0],bh)&&arguments[0].filter(this)},t.prototype.getBoundary=function(){return new wo(this).getBoundary()},t.prototype.isEquivalentClass=function(n){return n instanceof t},t.prototype.clone=function(){var t=n.prototype.clone.call(this);return t._points=this._points.clone(),t},t.prototype.getCoordinateN=function(n){return this._points.getCoordinate(n)},t.prototype.getGeometryType=function(){return"LineString"},t.prototype.copy=function(){return new t(this._points.copy(),this._factory)},t.prototype.getCoordinateSequence=function(){return this._points},t.prototype.isEmpty=function(){return 0===this._points.size()},t.prototype.init=function(n){if(null===n&&(n=this.getFactory().getCoordinateSequenceFactory().create([])),1===n.size())throw new ar("Invalid number of points in LineString (found "+n.size()+" - must be 0 or >= 2)");this._points=n},t.prototype.isCoordinate=function(n){for(var t=0;t<this._points.size();t++)if(this._points.getCoordinate(t).equals(n))return!0;return!1},t.prototype.getStartPoint=function(){return this.isEmpty()?null:this.getPointN(0)},t.prototype.getPointN=function(n){return this.getFactory().createPoint(this._points.getCoordinate(n))},t.prototype.interfaces_=function(){return[pp]},t.prototype.getClass=function(){return t},i.serialVersionUID.get=function(){return 0x2b2b51ba435c8e00},Object.defineProperties(t,i),t}(b);wp=function(){};wp.prototype.interfaces_=function(){return[]};wp.prototype.getClass=function(){return wp};se=function(n){function t(t,i){n.call(this,i);this._coordinates=t||null;this.init(this._coordinates)}n&&(t.__proto__=n);(t.prototype=Object.create(n&&n.prototype)).constructor=t;var i={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){if(this.isEmpty())return new l;var n=new l;return n.expandToInclude(this._coordinates.getX(0),this._coordinates.getY(0)),n},t.prototype.getSortIndex=function(){return n.SORTINDEX_POINT},t.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.getCoordinate()]},t.prototype.equalsExact=function(){if(2===arguments.length){var t=arguments[0],i=arguments[1];return!!this.isEquivalentClass(t)&&(!(!this.isEmpty()||!t.isEmpty())||this.isEmpty()===t.isEmpty()&&this.equal(t.getCoordinate(),this.getCoordinate(),i))}return n.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){},t.prototype.getCoordinate=function(){return 0!==this._coordinates.size()?this._coordinates.getCoordinate(0):null},t.prototype.getBoundaryDimension=function(){return yi.FALSE},t.prototype.getDimension=function(){return 0},t.prototype.getNumPoints=function(){return this.isEmpty()?0:1},t.prototype.reverse=function(){return this.copy()},t.prototype.getX=function(){if(null===this.getCoordinate())throw new Error("getX called on empty Point");return this.getCoordinate().x},t.prototype.compareToSameClass=function(){var n,t;return 1===arguments.length?(n=arguments[0],this.getCoordinate().compareTo(n.getCoordinate())):2===arguments.length?(t=arguments[0],arguments[1].compare(this._coordinates,t._coordinates)):void 0},t.prototype.apply=function(){var t,n;if(k(arguments[0],ih)){if(t=arguments[0],this.isEmpty())return null;t.filter(this.getCoordinate())}else if(k(arguments[0],po)){if(n=arguments[0],this.isEmpty())return null;n.filter(this._coordinates,0);n.isGeometryChanged()&&this.geometryChanged()}else k(arguments[0],ls)?arguments[0].filter(this):k(arguments[0],bh)&&arguments[0].filter(this)},t.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},t.prototype.clone=function(){var t=n.prototype.clone.call(this);return t._coordinates=this._coordinates.clone(),t},t.prototype.getGeometryType=function(){return"Point"},t.prototype.copy=function(){return new t(this._coordinates.copy(),this._factory)},t.prototype.getCoordinateSequence=function(){return this._coordinates},t.prototype.getY=function(){if(null===this.getCoordinate())throw new Error("getY called on empty Point");return this.getCoordinate().y},t.prototype.isEmpty=function(){return 0===this._coordinates.size()},t.prototype.init=function(n){null===n&&(n=this.getFactory().getCoordinateSequenceFactory().create([]));rt.isTrue(n.size()<=1);this._coordinates=n},t.prototype.isSimple=function(){return!0},t.prototype.interfaces_=function(){return[wp]},t.prototype.getClass=function(){return t},i.serialVersionUID.get=function(){return 0x44077bad161cbc00},Object.defineProperties(t,i),t}(b);pc=function(){};pc.prototype.interfaces_=function(){return[]};pc.prototype.getClass=function(){return pc};var cu=function(n){function t(t,i,r){if(n.call(this,r),this._shell=null,this._holes=null,null===t&&(t=this.getFactory().createLinearRing()),null===i&&(i=[]),n.hasNullElements(i))throw new ar("holes must not contain null elements");if(t.isEmpty()&&n.hasNonEmptyElements(i))throw new ar("shell is empty but holes are not");this._shell=t;this._holes=i}n&&(t.__proto__=n);(t.prototype=Object.create(n&&n.prototype)).constructor=t;var i={serialVersionUID:{configurable:!0}};return t.prototype.computeEnvelopeInternal=function(){return this._shell.getEnvelopeInternal()},t.prototype.getSortIndex=function(){return n.SORTINDEX_POLYGON},t.prototype.getCoordinates=function(){var n,u,t;if(this.isEmpty())return[];for(var i=new Array(this.getNumPoints()).fill(null),f=-1,e=this._shell.getCoordinates(),r=0;r<e.length;r++)i[++f]=e[r];for(n=0;n<this._holes.length;n++)for(u=this._holes[n].getCoordinates(),t=0;t<u.length;t++)i[++f]=u[t];return i},t.prototype.getArea=function(){var t=0,n;for(t+=Math.abs(o.signedArea(this._shell.getCoordinateSequence())),n=0;n<this._holes.length;n++)t-=Math.abs(o.signedArea(this._holes[n].getCoordinateSequence()));return t},t.prototype.isRectangle=function(){var u,f,e,o;if(0!==this.getNumInteriorRing()||null===this._shell||5!==this._shell.getNumPoints())return!1;for(var n=this._shell.getCoordinateSequence(),t=this.getEnvelopeInternal(),i=0;i<5;i++)if((u=n.getX(i),u!==t.getMinX()&&u!==t.getMaxX())||(f=n.getY(i),f!==t.getMinY()&&f!==t.getMaxY()))return!1;for(var s=n.getX(0),h=n.getY(0),r=1;r<=4;r++){if(e=n.getX(r),o=n.getY(r),e!==s==(o!==h))return!1;s=e;h=o}return!0},t.prototype.equalsExact=function(){var i,r,t;if(2===arguments.length){if(i=arguments[0],r=arguments[1],!this.isEquivalentClass(i))return!1;var u=i,f=this._shell,e=u._shell;if(!f.equalsExact(e,r)||this._holes.length!==u._holes.length)return!1;for(t=0;t<this._holes.length;t++)if(!this._holes[t].equalsExact(u._holes[t],r))return!1;return!0}return n.prototype.equalsExact.apply(this,arguments)},t.prototype.normalize=function(){var i,n,r,t,u;if(0===arguments.length){for(this.normalize(this._shell,!0),i=0;i<this._holes.length;i++)this.normalize(this._holes[i],!1);yl.sort(this._holes)}else if(2===arguments.length){if(n=arguments[0],r=arguments[1],n.isEmpty())return null;t=new Array(n.getCoordinates().length-1).fill(null);rf.arraycopy(n.getCoordinates(),0,t,0,t.length);u=ft.minCoordinate(n.getCoordinates());ft.scroll(t,u);rf.arraycopy(t,0,n.getCoordinates(),0,t.length);n.getCoordinates()[t.length]=t[0];o.isCCW(n.getCoordinates())===r&&ft.reverse(n.getCoordinates())}},t.prototype.getCoordinate=function(){return this._shell.getCoordinate()},t.prototype.getNumInteriorRing=function(){return this._holes.length},t.prototype.getBoundaryDimension=function(){return 1},t.prototype.getDimension=function(){return 2},t.prototype.getLength=function(){var t=0,n;for(t+=this._shell.getLength(),n=0;n<this._holes.length;n++)t+=this._holes[n].getLength();return t},t.prototype.getNumPoints=function(){for(var t=this._shell.getNumPoints(),n=0;n<this._holes.length;n++)t+=this._holes[n].getNumPoints();return t},t.prototype.reverse=function(){var t=this.copy(),n;for(t._shell=this._shell.copy().reverse(),t._holes=new Array(this._holes.length).fill(null),n=0;n<this._holes.length;n++)t._holes[n]=this._holes[n].copy().reverse();return t},t.prototype.convexHull=function(){return this.getExteriorRing().convexHull()},t.prototype.compareToSameClass=function(){if(1===arguments.length){var o=arguments[0],s=this._shell,h=o._shell;return s.compareToSameClass(h)}if(2===arguments.length){var c=arguments[0],i=arguments[1],t=c,l=this._shell,a=t._shell,r=l.compareToSameClass(a,i);if(0!==r)return r;for(var u=this.getNumInteriorRing(),f=t.getNumInteriorRing(),n=0;n<u&&n<f;){var v=this.getInteriorRingN(n),y=t.getInteriorRingN(n),e=v.compareToSameClass(y,i);if(0!==e)return e;n++}return n<u?1:n<f?-1:0}},t.prototype.apply=function(n){var t,i,r;if(k(n,ih))for(this._shell.apply(n),t=0;t<this._holes.length;t++)this._holes[t].apply(n);else if(k(n,po)){if(this._shell.apply(n),!n.isDone())for(i=0;i<this._holes.length&&(this._holes[i].apply(n),!n.isDone());i++);n.isGeometryChanged()&&this.geometryChanged()}else if(k(n,ls))n.filter(this);else if(k(n,bh))for(n.filter(this),this._shell.apply(n),r=0;r<this._holes.length;r++)this._holes[r].apply(n)},t.prototype.getBoundary=function(){var n,t;if(this.isEmpty())return this.getFactory().createMultiLineString();for(n=new Array(this._holes.length+1).fill(null),n[0]=this._shell,t=0;t<this._holes.length;t++)n[t+1]=this._holes[t];return n.length<=1?this.getFactory().createLinearRing(n[0].getCoordinateSequence()):this.getFactory().createMultiLineString(n)},t.prototype.clone=function(){var i=n.prototype.clone.call(this),t;for(i._shell=this._shell.clone(),i._holes=new Array(this._holes.length).fill(null),t=0;t<this._holes.length;t++)i._holes[t]=this._holes[t].clone();return i},t.prototype.getGeometryType=function(){return"Polygon"},t.prototype.copy=function(){for(var r=this._shell.copy(),i=new Array(this._holes.length).fill(null),n=0;n<i.length;n++)i[n]=this._holes[n].copy();return new t(r,i,this._factory)},t.prototype.getExteriorRing=function(){return this._shell},t.prototype.isEmpty=function(){return this._shell.isEmpty()},t.prototype.getInteriorRingN=function(n){return this._holes[n]},t.prototype.interfaces_=function(){return[pc]},t.prototype.getClass=function(){return t},i.serialVersionUID.get=function(){return-0x307ffefd8dc97200},Object.defineProperties(t,i),t}(b),bp=function(n){function t(){n.apply(this,arguments)}n&&(t.__proto__=n);(t.prototype=Object.create(n&&n.prototype)).constructor=t;var i={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return b.SORTINDEX_MULTIPOINT},t.prototype.isValid=function(){return!0},t.prototype.equalsExact=function(){if(2===arguments.length){var t=arguments[0],i=arguments[1];return!!this.isEquivalentClass(t)&&n.prototype.equalsExact.call(this,t,i)}return n.prototype.equalsExact.apply(this,arguments)},t.prototype.getCoordinate=function(){if(1===arguments.length){var t=arguments[0];return this._geometries[t].getCoordinate()}return n.prototype.getCoordinate.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return yi.FALSE},t.prototype.getDimension=function(){return 0},t.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)},t.prototype.getGeometryType=function(){return"MultiPoint"},t.prototype.copy=function(){for(var i=new Array(this._geometries.length).fill(null),n=0;n<i.length;n++)i[n]=this._geometries[n].copy();return new t(i,this._factory)},t.prototype.interfaces_=function(){return[wp]},t.prototype.getClass=function(){return t},i.serialVersionUID.get=function(){return-0x6fb1ed4162e0fc00},Object.defineProperties(t,i),t}(te),dh=function(n){function t(t,r){t instanceof i&&r instanceof ut&&(t=r.getCoordinateSequenceFactory().create(t));n.call(this,t,r);this.validateConstruction()}n&&(t.__proto__=n);(t.prototype=Object.create(n&&n.prototype)).constructor=t;var r={MINIMUM_VALID_SIZE:{configurable:!0},serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return b.SORTINDEX_LINEARRING},t.prototype.getBoundaryDimension=function(){return yi.FALSE},t.prototype.isClosed=function(){return!!this.isEmpty()||n.prototype.isClosed.call(this)},t.prototype.reverse=function(){var n=this._points.copy();return kr.reverse(n),this.getFactory().createLinearRing(n)},t.prototype.validateConstruction=function(){if(!this.isEmpty()&&!n.prototype.isClosed.call(this))throw new ar("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<t.MINIMUM_VALID_SIZE)throw new ar("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)");},t.prototype.getGeometryType=function(){return"LinearRing"},t.prototype.copy=function(){return new t(this._points.copy(),this._factory)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},r.MINIMUM_VALID_SIZE.get=function(){return 4},r.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(t,r),t}(wr),gh=function(n){function t(){n.apply(this,arguments)}n&&(t.__proto__=n);(t.prototype=Object.create(n&&n.prototype)).constructor=t;var i={serialVersionUID:{configurable:!0}};return t.prototype.getSortIndex=function(){return b.SORTINDEX_MULTIPOLYGON},t.prototype.equalsExact=function(){if(2===arguments.length){var t=arguments[0],i=arguments[1];return!!this.isEquivalentClass(t)&&n.prototype.equalsExact.call(this,t,i)}return n.prototype.equalsExact.apply(this,arguments)},t.prototype.getBoundaryDimension=function(){return 1},t.prototype.getDimension=function(){return 2},t.prototype.reverse=function(){for(var i=this._geometries.length,t=new Array(i).fill(null),n=0;n<this._geometries.length;n++)t[n]=this._geometries[n].reverse();return this.getFactory().createMultiPolygon(t)},t.prototype.getBoundary=function(){var n,t,r,i,u;if(this.isEmpty())return this.getFactory().createMultiLineString();for(n=new e,t=0;t<this._geometries.length;t++)for(r=this._geometries[t].getBoundary(),i=0;i<r.getNumGeometries();i++)n.add(r.getGeometryN(i));return u=new Array(n.size()).fill(null),this.getFactory().createMultiLineString(n.toArray(u))},t.prototype.getGeometryType=function(){return"MultiPolygon"},t.prototype.copy=function(){for(var i=new Array(this._geometries.length).fill(null),n=0;n<i.length;n++)i[n]=this._geometries[n].copy();return new t(i,this._factory)},t.prototype.interfaces_=function(){return[pc]},t.prototype.getClass=function(){return t},i.serialVersionUID.get=function(){return-0x7a5aa1369171980},Object.defineProperties(t,i),t}(te),bo=function(n){this._factory=n||null;this._isUserDataCopied=!1},un={NoOpGeometryOperation:{configurable:!0},CoordinateOperation:{configurable:!0},CoordinateSequenceOperation:{configurable:!0}};bo.prototype.setCopyUserData=function(n){this._isUserDataCopied=n};bo.prototype.edit=function(n,t){if(null===n)return null;var i=this.editInternal(n,t);return this._isUserDataCopied&&i.setUserData(n.getUserData()),i};bo.prototype.editInternal=function(n,t){return null===this._factory&&(this._factory=n.getFactory()),n instanceof te?this.editGeometryCollection(n,t):n instanceof cu?this.editPolygon(n,t):n instanceof se?t.edit(n,this._factory):n instanceof wr?t.edit(n,this._factory):(rt.shouldNeverReachHere("Unsupported Geometry class: "+n.getClass().getName()),null)};bo.prototype.editGeometryCollection=function(n,t){for(var u,i=t.edit(n,this._factory),r=new e,f=0;f<i.getNumGeometries();f++)u=this.edit(i.getGeometryN(f),t),null===u||u.isEmpty()||r.add(u);return i.getClass()===bp?this._factory.createMultiPoint(r.toArray([])):i.getClass()===pa?this._factory.createMultiLineString(r.toArray([])):i.getClass()===gh?this._factory.createMultiPolygon(r.toArray([])):this._factory.createGeometryCollection(r.toArray([]))};bo.prototype.editPolygon=function(n,t){var i=t.edit(n,this._factory),r,o,u,f;if(null===i&&(i=this._factory.createPolygon(null)),i.isEmpty())return i;if(r=this.edit(i.getExteriorRing(),t),null===r||r.isEmpty())return this._factory.createPolygon();for(o=new e,u=0;u<i.getNumInteriorRing();u++)f=this.edit(i.getInteriorRingN(u),t),null===f||f.isEmpty()||o.add(f);return this._factory.createPolygon(r,o.toArray([]))};bo.prototype.interfaces_=function(){return[]};bo.prototype.getClass=function(){return bo};bo.GeometryEditorOperation=function(){};un.NoOpGeometryOperation.get=function(){return kp};un.CoordinateOperation.get=function(){return dp};un.CoordinateSequenceOperation.get=function(){return gp};Object.defineProperties(bo,un);kp=function(){};kp.prototype.edit=function(n){return n};kp.prototype.interfaces_=function(){return[bo.GeometryEditorOperation]};kp.prototype.getClass=function(){return kp};dp=function(){};dp.prototype.edit=function(n,t){var i=this.editCoordinates(n.getCoordinates(),n);return null===i?n:n instanceof dh?t.createLinearRing(i):n instanceof wr?t.createLineString(i):n instanceof se?i.length>0?t.createPoint(i[0]):t.createPoint():n};dp.prototype.interfaces_=function(){return[bo.GeometryEditorOperation]};dp.prototype.getClass=function(){return dp};gp=function(){};gp.prototype.edit=function(n,t){return n instanceof dh?t.createLinearRing(this.edit(n.getCoordinateSequence(),n)):n instanceof wr?t.createLineString(this.edit(n.getCoordinateSequence(),n)):n instanceof se?t.createPoint(this.edit(n.getCoordinateSequence(),n)):n};gp.prototype.interfaces_=function(){return[bo.GeometryEditorOperation]};gp.prototype.getClass=function(){return gp};dr=function(){var f,r,n,t,e,s,o,h,u;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]))for(f=arguments[0],this._coordinates=new Array(f).fill(null),r=0;r<f;r++)this._coordinates[r]=new i;else if(k(arguments[0],ot)){if(n=arguments[0],null===n)return this._coordinates=new Array(0).fill(null),null;for(this._dimension=n.getDimension(),this._coordinates=new Array(n.size()).fill(null),t=0;t<this._coordinates.length;t++)this._coordinates[t]=n.getCoordinateCopy(t)}}else if(2===arguments.length)if(arguments[0]instanceof Array&&Number.isInteger(arguments[1]))e=arguments[0],s=arguments[1],this._coordinates=e,this._dimension=s,null===e&&(this._coordinates=new Array(0).fill(null));else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1]))for(o=arguments[0],h=arguments[1],this._coordinates=new Array(o).fill(null),this._dimension=h,u=0;u<o;u++)this._coordinates[u]=new i};yut={serialVersionUID:{configurable:!0}};dr.prototype.setOrdinate=function(n,t,i){switch(t){case ot.X:this._coordinates[n].x=i;break;case ot.Y:this._coordinates[n].y=i;break;case ot.Z:this._coordinates[n].z=i;break;default:throw new ar("invalid ordinateIndex");}};dr.prototype.size=function(){return this._coordinates.length};dr.prototype.getOrdinate=function(n,t){switch(t){case ot.X:return this._coordinates[n].x;case ot.Y:return this._coordinates[n].y;case ot.Z:return this._coordinates[n].z}return it.NaN};dr.prototype.getCoordinate=function(){var i,n,t;if(1===arguments.length)return i=arguments[0],this._coordinates[i];2===arguments.length&&(n=arguments[0],t=arguments[1],t.x=this._coordinates[n].x,t.y=this._coordinates[n].y,t.z=this._coordinates[n].z)};dr.prototype.getCoordinateCopy=function(n){return new i(this._coordinates[n])};dr.prototype.getDimension=function(){return this._dimension};dr.prototype.getX=function(n){return this._coordinates[n].x};dr.prototype.clone=function(){for(var t=new Array(this.size()).fill(null),n=0;n<this._coordinates.length;n++)t[n]=this._coordinates[n].clone();return new dr(t,this._dimension)};dr.prototype.expandEnvelope=function(n){for(var t=0;t<this._coordinates.length;t++)n.expandToInclude(this._coordinates[t]);return n};dr.prototype.copy=function(){for(var t=new Array(this.size()).fill(null),n=0;n<this._coordinates.length;n++)t[n]=this._coordinates[n].copy();return new dr(t,this._dimension)};dr.prototype.toString=function(){var n,t;if(this._coordinates.length>0){for(n=new es(17*this._coordinates.length),n.append("("),n.append(this._coordinates[0]),t=1;t<this._coordinates.length;t++)n.append(", "),n.append(this._coordinates[t]);return n.append(")"),n.toString()}return"()"};dr.prototype.getY=function(n){return this._coordinates[n].y};dr.prototype.toCoordinateArray=function(){return this._coordinates};dr.prototype.interfaces_=function(){return[ot,ho]};dr.prototype.getClass=function(){return dr};yut.serialVersionUID.get=function(){return-0xcb44a778db18e00};Object.defineProperties(dr,yut);rh=function(){};fn={serialVersionUID:{configurable:!0},instanceObject:{configurable:!0}};rh.prototype.readResolve=function(){return rh.instance()};rh.prototype.create=function(){var i,r,t,n;if(1===arguments.length){if(arguments[0]instanceof Array)return i=arguments[0],new dr(i);if(k(arguments[0],ot))return r=arguments[0],new dr(r)}else if(2===arguments.length)return t=arguments[0],n=arguments[1],n>3&&(n=3),n<2?new dr(t):new dr(t,n)};rh.prototype.interfaces_=function(){return[pv,ho]};rh.prototype.getClass=function(){return rh};rh.instance=function(){return rh.instanceObject};fn.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00};fn.instanceObject.get=function(){return new rh};Object.defineProperties(rh,fn);var lvt=function(n){function t(){n.call(this);this.map_=new Map}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.get=function(n){return this.map_.get(n)||null},t.prototype.put=function(n,t){return this.map_.set(n,t),t},t.prototype.values=function(){for(var t=new e,i=this.map_.values(),n=i.next();!n.done;)t.add(n.value),n=i.next();return t},t.prototype.entrySet=function(){var n=new vut;return this.map_.entries().forEach(function(t){return n.add(t)}),n},t.prototype.size=function(){return this.map_.size()},t}(ya),bi=function n(){var t,r,i;(this._modelType=null,this._scale=null,0===arguments.length)?this._modelType=n.FLOATING:1===arguments.length&&(arguments[0]instanceof as?(t=arguments[0],this._modelType=t,t===n.FIXED&&this.setScale(1)):"number"==typeof arguments[0]?(r=arguments[0],this._modelType=n.FIXED,this.setScale(r)):arguments[0]instanceof n&&(i=arguments[0],this._modelType=i._modelType,this._scale=i._scale))},put={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};bi.prototype.equals=function(n){if(!(n instanceof bi))return!1;var t=n;return this._modelType===t._modelType&&this._scale===t._scale};bi.prototype.compareTo=function(n){var t=n,i=this.getMaximumSignificantDigits(),r=t.getMaximumSignificantDigits();return new os(i).compareTo(new os(r))};bi.prototype.getScale=function(){return this._scale};bi.prototype.isFloating=function(){return this._modelType===bi.FLOATING||this._modelType===bi.FLOATING_SINGLE};bi.prototype.getType=function(){return this._modelType};bi.prototype.toString=function(){var n="UNKNOWN";return this._modelType===bi.FLOATING?n="Floating":this._modelType===bi.FLOATING_SINGLE?n="Floating-Single":this._modelType===bi.FIXED&&(n="Fixed (Scale="+this.getScale()+")"),n};bi.prototype.makePrecise=function(){var n,t;if("number"==typeof arguments[0])return(n=arguments[0],it.isNaN(n))?n:this._modelType===bi.FLOATING_SINGLE?n:this._modelType===bi.FIXED?Math.round(n*this._scale)/this._scale:n;if(arguments[0]instanceof i){if(t=arguments[0],this._modelType===bi.FLOATING)return null;t.x=this.makePrecise(t.x);t.y=this.makePrecise(t.y)}};bi.prototype.getMaximumSignificantDigits=function(){var n=16;return this._modelType===bi.FLOATING?n=16:this._modelType===bi.FLOATING_SINGLE?n=6:this._modelType===bi.FIXED&&(n=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),n};bi.prototype.setScale=function(n){this._scale=Math.abs(n)};bi.prototype.interfaces_=function(){return[ho,co]};bi.prototype.getClass=function(){return bi};bi.mostPrecise=function(n,t){return n.compareTo(t)>=0?n:t};put.serialVersionUID.get=function(){return 0x6bee6404e9a25c00};put.maximumPreciseValue.get=function(){return 9007199254740992};Object.defineProperties(bi,put);as=function n(t){this._name=t||null;n.nameToTypeMap.put(t,this)};en={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};as.prototype.readResolve=function(){return as.nameToTypeMap.get(this._name)};as.prototype.toString=function(){return this._name};as.prototype.interfaces_=function(){return[ho]};as.prototype.getClass=function(){return as};en.serialVersionUID.get=function(){return-552860263173159e4};en.nameToTypeMap.get=function(){return new lvt};Object.defineProperties(as,en);bi.Type=as;bi.FIXED=new as("FIXED");bi.FLOATING=new as("FLOATING");bi.FLOATING_SINGLE=new as("FLOATING SINGLE");ut=function n(){this._precisionModel=new bi;this._SRID=0;this._coordinateSequenceFactory=n.getDefaultCoordinateSequenceFactory();0===arguments.length||(1===arguments.length?k(arguments[0],pv)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof bi&&(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]))};wut={serialVersionUID:{configurable:!0}};ut.prototype.toGeometry=function(n){return n.isNull()?this.createPoint(null):n.getMinX()===n.getMaxX()&&n.getMinY()===n.getMaxY()?this.createPoint(new i(n.getMinX(),n.getMinY())):n.getMinX()===n.getMaxX()||n.getMinY()===n.getMaxY()?this.createLineString([new i(n.getMinX(),n.getMinY()),new i(n.getMaxX(),n.getMaxY())]):this.createPolygon(this.createLinearRing([new i(n.getMinX(),n.getMinY()),new i(n.getMinX(),n.getMaxY()),new i(n.getMaxX(),n.getMaxY()),new i(n.getMaxX(),n.getMinY()),new i(n.getMinX(),n.getMinY())]),null)};ut.prototype.createLineString=function(n){return n?n instanceof Array?new wr(this.getCoordinateSequenceFactory().create(n),this):k(n,ot)?new wr(n,this):void 0:new wr(this.getCoordinateSequenceFactory().create([]),this)};ut.prototype.createMultiLineString=function(){if(0===arguments.length)return new pa(null,this);if(1===arguments.length){var n=arguments[0];return new pa(n,this)}};ut.prototype.buildGeometry=function(n){for(var r,u,t,i=null,f=!1,e=!1,o=n.iterator();o.hasNext();)r=o.next(),u=r.getClass(),null===i&&(i=u),u!==i&&(f=!0),r.isGeometryCollectionOrDerived()&&(e=!0);if(null===i)return this.createGeometryCollection();if(f||e)return this.createGeometryCollection(ut.toGeometryArray(n));if(t=n.iterator().next(),n.size()>1){if(t instanceof cu)return this.createMultiPolygon(ut.toPolygonArray(n));if(t instanceof wr)return this.createMultiLineString(ut.toLineStringArray(n));if(t instanceof se)return this.createMultiPoint(ut.toPointArray(n));rt.shouldNeverReachHere("Unhandled class: "+t.getClass().getName())}return t};ut.prototype.createMultiPointFromCoords=function(n){return this.createMultiPoint(null!==n?this.getCoordinateSequenceFactory().create(n):null)};ut.prototype.createPoint=function(){var n,t;if(0===arguments.length)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof i)return n=arguments[0],this.createPoint(null!==n?this.getCoordinateSequenceFactory().create([n]):null);if(k(arguments[0],ot))return t=arguments[0],new se(t,this)}};ut.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory};ut.prototype.createPolygon=function(){var n,t,i,r,u;if(0===arguments.length)return new cu(null,null,this);if(1===arguments.length){if(k(arguments[0],ot))return n=arguments[0],this.createPolygon(this.createLinearRing(n));if(arguments[0]instanceof Array)return t=arguments[0],this.createPolygon(this.createLinearRing(t));if(arguments[0]instanceof dh)return i=arguments[0],this.createPolygon(i,null)}else if(2===arguments.length)return r=arguments[0],u=arguments[1],new cu(r,u,this)};ut.prototype.getSRID=function(){return this._SRID};ut.prototype.createGeometryCollection=function(){if(0===arguments.length)return new te(null,this);if(1===arguments.length){var n=arguments[0];return new te(n,this)}};ut.prototype.createGeometry=function(n){return new bo(this).edit(n,{edit:function(){if(2===arguments.length){var n=arguments[0];return this._coordinateSequenceFactory.create(n)}}})};ut.prototype.getPrecisionModel=function(){return this._precisionModel};ut.prototype.createLinearRing=function(){var n,t;if(0===arguments.length)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Array)return n=arguments[0],this.createLinearRing(null!==n?this.getCoordinateSequenceFactory().create(n):null);if(k(arguments[0],ot))return t=arguments[0],new dh(t,this)}};ut.prototype.createMultiPolygon=function(){if(0===arguments.length)return new gh(null,this);if(1===arguments.length){var n=arguments[0];return new gh(n,this)}};ut.prototype.createMultiPoint=function(){var f,i,n,r,t,u;if(0===arguments.length)return new bp(null,this);if(1===arguments.length){if(arguments[0]instanceof Array)return f=arguments[0],new bp(f,this);if(arguments[0]instanceof Array)return i=arguments[0],this.createMultiPoint(null!==i?this.getCoordinateSequenceFactory().create(i):null);if(k(arguments[0],ot)){if(n=arguments[0],null===n)return this.createMultiPoint(new Array(0).fill(null));for(r=new Array(n.size()).fill(null),t=0;t<n.size();t++)u=this.getCoordinateSequenceFactory().create(1,n.getDimension()),kr.copy(n,t,u,0,1),r[t]=this.createPoint(u);return this.createMultiPoint(r)}}};ut.prototype.interfaces_=function(){return[ho]};ut.prototype.getClass=function(){return ut};ut.toMultiPolygonArray=function(n){var t=new Array(n.size()).fill(null);return n.toArray(t)};ut.toGeometryArray=function(n){if(null===n)return null;var t=new Array(n.size()).fill(null);return n.toArray(t)};ut.getDefaultCoordinateSequenceFactory=function(){return rh.instance()};ut.toMultiLineStringArray=function(n){var t=new Array(n.size()).fill(null);return n.toArray(t)};ut.toLineStringArray=function(n){var t=new Array(n.size()).fill(null);return n.toArray(t)};ut.toMultiPointArray=function(n){var t=new Array(n.size()).fill(null);return n.toArray(t)};ut.toLinearRingArray=function(n){var t=new Array(n.size()).fill(null);return n.toArray(t)};ut.toPointArray=function(n){var t=new Array(n.size()).fill(null);return n.toArray(t)};ut.toPolygonArray=function(n){var t=new Array(n.size()).fill(null);return n.toArray(t)};ut.createPointFromInternalCoord=function(n,t){return t.getPrecisionModel().makePrecise(n),t.getFactory().createPoint(n)};wut.serialVersionUID.get=function(){return-0x5ea75f2051eeb400};Object.defineProperties(ut,wut);avt=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"];uk=function(n){this.geometryFactory=n||new ut};uk.prototype.read=function(n){var i,t=(i="string"==typeof n?JSON.parse(n):n).type;if(!uh[t])throw new Error("Unknown GeoJSON type: "+i.type);return-1!==avt.indexOf(t)?uh[t].apply(this,[i.coordinates]):"GeometryCollection"===t?uh[t].apply(this,[i.geometries]):uh[t].apply(this,[i])};uk.prototype.write=function(n){var t=n.getGeometryType();if(!wc[t])throw new Error("Geometry is not supported");return wc[t].apply(this,[n])};var uh={Feature:function(n){var t={},i,r;for(i in n)t[i]=n[i];if(n.geometry){if(r=n.geometry.type,!uh[r])throw new Error("Unknown GeoJSON type: "+n.type);t.geometry=this.read(n.geometry)}return n.bbox&&(t.bbox=uh.bbox.apply(this,[n.bbox])),t},FeatureCollection:function(n){var t={},i;if(n.features)for(t.features=[],i=0;i<n.features.length;++i)t.features.push(this.read(n.features[i]));return n.bbox&&(t.bbox=this.parse.bbox.apply(this,[n.bbox])),t},coordinates:function(n){for(var u,r=[],t=0;t<n.length;++t)u=n[t],r.push(new i(u[0],u[1]));return r},bbox:function(n){return this.geometryFactory.createLinearRing([new i(n[0],n[1]),new i(n[2],n[1]),new i(n[2],n[3]),new i(n[0],n[3]),new i(n[0],n[1])])},Point:function(n){var t=new i(n[0],n[1]);return this.geometryFactory.createPoint(t)},MultiPoint:function(n){for(var i=[],t=0;t<n.length;++t)i.push(uh.Point.apply(this,[n[t]]));return this.geometryFactory.createMultiPoint(i)},LineString:function(n){var t=uh.coordinates.apply(this,[n]);return this.geometryFactory.createLineString(t)},MultiLineString:function(n){for(var i=[],t=0;t<n.length;++t)i.push(uh.LineString.apply(this,[n[t]]));return this.geometryFactory.createMultiLineString(i)},Polygon:function(n){for(var r=uh.coordinates.apply(this,[n[0]]),u=this.geometryFactory.createLinearRing(r),i=[],t=1;t<n.length;++t){var f=n[t],e=uh.coordinates.apply(this,[f]),o=this.geometryFactory.createLinearRing(e);i.push(o)}return this.geometryFactory.createPolygon(u,i)},MultiPolygon:function(n){for(var r,i=[],t=0;t<n.length;++t)r=n[t],i.push(uh.Polygon.apply(this,[r]));return this.geometryFactory.createMultiPolygon(i)},GeometryCollection:function(n){for(var r,i=[],t=0;t<n.length;++t)r=n[t],i.push(this.read(r));return this.geometryFactory.createGeometryCollection(i)}},wc={coordinate:function(n){return[n.x,n.y]},Point:function(n){return{type:"Point",coordinates:wc.coordinate.apply(this,[n.getCoordinate()])}},MultiPoint:function(n){for(var r,u,i=[],t=0;t<n._geometries.length;++t)r=n._geometries[t],u=wc.Point.apply(this,[r]),i.push(u.coordinates);return{type:"MultiPoint",coordinates:i}},LineString:function(n){for(var u,i=[],r=n.getCoordinates(),t=0;t<r.length;++t)u=r[t],i.push(wc.coordinate.apply(this,[u]));return{type:"LineString",coordinates:i}},MultiLineString:function(n){for(var r,u,i=[],t=0;t<n._geometries.length;++t)r=n._geometries[t],u=wc.LineString.apply(this,[r]),i.push(u.coordinates);return{type:"MultiLineString",coordinates:i}},Polygon:function(n){var i=[],f=wc.LineString.apply(this,[n._shell]),t,r,u;for(i.push(f.coordinates),t=0;t<n._holes.length;++t)r=n._holes[t],u=wc.LineString.apply(this,[r]),i.push(u.coordinates);return{type:"Polygon",coordinates:i}},MultiPolygon:function(n){for(var r,u,i=[],t=0;t<n._geometries.length;++t)r=n._geometries[t],u=wc.Polygon.apply(this,[r]),i.push(u.coordinates);return{type:"MultiPolygon",coordinates:i}},GeometryCollection:function(n){for(var r,u,i=[],t=0;t<n._geometries.length;++t)r=n._geometries[t],u=r.getGeometryType(),i.push(wc[u].apply(this,[r]));return{type:"GeometryCollection",geometries:i}}},nw=function(n){this.geometryFactory=n||new ut;this.precisionModel=this.geometryFactory.getPrecisionModel();this.parser=new uk(this.geometryFactory)};nw.prototype.read=function(n){var t=this.parser.read(n);return this.precisionModel.getType()===bi.FIXED&&this.reducePrecision(t),t};nw.prototype.reducePrecision=function(n){var t,i;if(n.coordinate)this.precisionModel.makePrecise(n.coordinate);else if(n.points)for(t=0,i=n.points.length;t<i;t++)this.precisionModel.makePrecise(n.points[t]);else if(n.geometries)for(t=0,i=n.geometries.length;t<i;t++)this.reducePrecision(n.geometries[t])};tw=function(){this.parser=new uk(this.geometryFactory)};tw.prototype.write=function(n){return this.parser.write(n)};f=function(){};fk={ON:{configurable:!0},LEFT:{configurable:!0},RIGHT:{configurable:!0}};f.prototype.interfaces_=function(){return[]};f.prototype.getClass=function(){return f};f.opposite=function(n){return n===f.LEFT?f.RIGHT:n===f.RIGHT?f.LEFT:n};fk.ON.get=function(){return 0};fk.LEFT.get=function(){return 1};fk.RIGHT.get=function(){return 2};Object.defineProperties(f,fk);(ort.prototype=new Error).name="EmptyStackException";(yh.prototype=new vo).add=function(n){return this.array_.push(n),!0};yh.prototype.get=function(n){if(n<0||n>=this.size())throw new Error;return this.array_[n]};yh.prototype.push=function(n){return this.array_.push(n),n};yh.prototype.pop=function(){if(0===this.array_.length)throw new ort;return this.array_.pop()};yh.prototype.peek=function(){if(0===this.array_.length)throw new ort;return this.array_[this.array_.length-1]};yh.prototype.empty=function(){return 0===this.array_.length};yh.prototype.isEmpty=function(){return this.empty()};yh.prototype.search=function(n){return this.array_.indexOf(n)};yh.prototype.size=function(){return this.array_.length};yh.prototype.toArray=function(){for(var t=[],n=0,i=this.array_.length;n<i;n++)t.push(this.array_[n]);return t};vs=function(){this._minIndex=-1;this._minCoord=null;this._minDe=null;this._orientedDe=null};vs.prototype.getCoordinate=function(){return this._minCoord};vs.prototype.getRightmostSide=function(n,t){var i=this.getRightmostSideOfSegment(n,t);return i<0&&(i=this.getRightmostSideOfSegment(n,t-1)),i<0&&(this._minCoord=null,this.checkForRightmostCoordinate(n)),i};vs.prototype.findRightmostEdgeAtVertex=function(){var n=this._minDe.getEdge().getCoordinates();rt.isTrue(this._minIndex>0&&this._minIndex<n.length,"rightmost point expected to be interior vertex of edge");var t=n[this._minIndex-1],i=n[this._minIndex+1],u=o.computeOrientation(this._minCoord,i,t),r=!1;t.y<this._minCoord.y&&i.y<this._minCoord.y&&u===o.COUNTERCLOCKWISE?r=!0:t.y>this._minCoord.y&&i.y>this._minCoord.y&&u===o.CLOCKWISE&&(r=!0);r&&(this._minIndex=this._minIndex-1)};vs.prototype.getRightmostSideOfSegment=function(n,t){var i=n.getEdge().getCoordinates(),r;return t<0||t+1>=i.length?-1:i[t].y===i[t+1].y?-1:(r=f.LEFT,i[t].y<i[t+1].y&&(r=f.RIGHT),r)};vs.prototype.getEdge=function(){return this._orientedDe};vs.prototype.checkForRightmostCoordinate=function(n){for(var i=n.getEdge().getCoordinates(),t=0;t<i.length-1;t++)(null===this._minCoord||i[t].x>this._minCoord.x)&&(this._minDe=n,this._minIndex=t,this._minCoord=i[t])};vs.prototype.findRightmostEdgeAtNode=function(){var n=this._minDe.getNode().getEdges();this._minDe=n.getRightmostEdge();this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)};vs.prototype.findEdge=function(n){for(var i,t=n.iterator();t.hasNext();)i=t.next(),i.isForward()&&this.checkForRightmostCoordinate(i);rt.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)===f.LEFT&&(this._orientedDe=this._minDe.getSym())};vs.prototype.interfaces_=function(){return[]};vs.prototype.getClass=function(){return vs};nc=function(n){function t(r,u){n.call(this,t.msgWithCoord(r,u));this.pt=u?new i(u):null;this.name="TopologyException"}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getCoordinate=function(){return this.pt},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.msgWithCoord=function(n,t){return t?n:n+" [ "+t+" ]"},t}(vc);ek=function(){this.array_=[]};ek.prototype.addLast=function(n){this.array_.push(n)};ek.prototype.removeFirst=function(){return this.array_.shift()};ek.prototype.isEmpty=function(){return 0===this.array_.length};hf=function(){this._finder=null;this._dirEdgeList=new e;this._nodes=new e;this._rightMostCoord=null;this._env=null;this._finder=new vs};hf.prototype.clearVisitedEdges=function(){for(var n=this._dirEdgeList.iterator();n.hasNext();)n.next().setVisited(!1)};hf.prototype.getRightmostCoordinate=function(){return this._rightMostCoord};hf.prototype.computeNodeDepth=function(n){for(var i,u,f,t=null,r=n.getEdges().iterator();r.hasNext();)if(i=r.next(),i.isVisited()||i.getSym().isVisited()){t=i;break}if(null===t)throw new nc("unable to find edge to compute depths at "+n.getCoordinate());for(n.getEdges().computeDepths(t),u=n.getEdges().iterator();u.hasNext();)f=u.next(),f.setVisited(!0),this.copySymDepths(f)};hf.prototype.computeDepth=function(n){this.clearVisitedEdges();var t=this._finder.getEdge();t.setEdgeDepths(f.RIGHT,n);this.copySymDepths(t);this.computeDepths(t)};hf.prototype.create=function(n){this.addReachable(n);this._finder.findEdge(this._dirEdgeList);this._rightMostCoord=this._finder.getCoordinate()};hf.prototype.findResultEdges=function(){for(var n,t=this._dirEdgeList.iterator();t.hasNext();)n=t.next(),n.getDepth(f.RIGHT)>=1&&n.getDepth(f.LEFT)<=0&&!n.isInteriorAreaEdge()&&n.setInResult(!0)};hf.prototype.computeDepths=function(n){var t=new vut,i=new ek,o=n.getNode(),r,f,e,u;for(i.addLast(o),t.add(o),n.setVisited(!0);!i.isEmpty();)for(r=i.removeFirst(),t.add(r),this.computeNodeDepth(r),f=r.getEdges().iterator();f.hasNext();)e=f.next().getSym(),e.isVisited()||(u=e.getNode(),t.contains(u)||(i.addLast(u),t.add(u)))};hf.prototype.compareTo=function(n){var t=n;return this._rightMostCoord.x<t._rightMostCoord.x?-1:this._rightMostCoord.x>t._rightMostCoord.x?1:0};hf.prototype.getEnvelope=function(){var t,i,r,n;if(null===this._env){for(t=new l,i=this._dirEdgeList.iterator();i.hasNext();)for(r=i.next().getEdge().getCoordinates(),n=0;n<r.length-1;n++)t.expandToInclude(r[n]);this._env=t}return this._env};hf.prototype.addReachable=function(n){var t=new yh,i;for(t.add(n);!t.empty();)i=t.pop(),this.add(i,t)};hf.prototype.copySymDepths=function(n){var t=n.getSym();t.setDepth(f.LEFT,n.getDepth(f.RIGHT));t.setDepth(f.RIGHT,n.getDepth(f.LEFT))};hf.prototype.add=function(n,t){var i,r,u;for(n.setVisited(!0),this._nodes.add(n),i=n.getEdges().iterator();i.hasNext();)r=i.next(),this._dirEdgeList.add(r),u=r.getSym().getNode(),u.isVisited()||t.push(u)};hf.prototype.getNodes=function(){return this._nodes};hf.prototype.getDirectedEdges=function(){return this._dirEdgeList};hf.prototype.interfaces_=function(){return[co]};hf.prototype.getClass=function(){return hf};or=function n(){var r,u,i,t;if(this.location=null,1===arguments.length){if(arguments[0]instanceof Array)r=arguments[0],this.init(r.length);else if(Number.isInteger(arguments[0]))u=arguments[0],this.init(1),this.location[f.ON]=u;else if(arguments[0]instanceof n&&(i=arguments[0],this.init(i.location.length),null!==i))for(t=0;t<this.location.length;t++)this.location[t]=i.location[t]}else if(3===arguments.length){var e=arguments[0],o=arguments[1],s=arguments[2];this.init(3);this.location[f.ON]=e;this.location[f.LEFT]=o;this.location[f.RIGHT]=s}};or.prototype.setAllLocations=function(n){for(var t=0;t<this.location.length;t++)this.location[t]=n};or.prototype.isNull=function(){for(var n=0;n<this.location.length;n++)if(this.location[n]!==r.NONE)return!1;return!0};or.prototype.setAllLocationsIfNull=function(n){for(var t=0;t<this.location.length;t++)this.location[t]===r.NONE&&(this.location[t]=n)};or.prototype.isLine=function(){return 1===this.location.length};or.prototype.merge=function(n){var i,t;for(n.location.length>this.location.length&&(i=new Array(3).fill(null),i[f.ON]=this.location[f.ON],i[f.LEFT]=r.NONE,i[f.RIGHT]=r.NONE,this.location=i),t=0;t<this.location.length;t++)this.location[t]===r.NONE&&t<n.location.length&&(this.location[t]=n.location[t])};or.prototype.getLocations=function(){return this.location};or.prototype.flip=function(){if(this.location.length<=1)return null;var n=this.location[f.LEFT];this.location[f.LEFT]=this.location[f.RIGHT];this.location[f.RIGHT]=n};or.prototype.toString=function(){var n=new es;return this.location.length>1&&n.append(r.toLocationSymbol(this.location[f.LEFT])),n.append(r.toLocationSymbol(this.location[f.ON])),this.location.length>1&&n.append(r.toLocationSymbol(this.location[f.RIGHT])),n.toString()};or.prototype.setLocations=function(n,t,i){this.location[f.ON]=n;this.location[f.LEFT]=t;this.location[f.RIGHT]=i};or.prototype.get=function(n){return n<this.location.length?this.location[n]:r.NONE};or.prototype.isArea=function(){return this.location.length>1};or.prototype.isAnyNull=function(){for(var n=0;n<this.location.length;n++)if(this.location[n]===r.NONE)return!0;return!1};or.prototype.setLocation=function(){var n,t,i;1===arguments.length?(n=arguments[0],this.setLocation(f.ON,n)):2===arguments.length&&(t=arguments[0],i=arguments[1],this.location[t]=i)};or.prototype.init=function(n){this.location=new Array(n).fill(null);this.setAllLocations(r.NONE)};or.prototype.isEqualOnSide=function(n,t){return this.location[t]===n.location[t]};or.prototype.allPositionsEqual=function(n){for(var t=0;t<this.location.length;t++)if(this.location[t]!==n)return!1;return!0};or.prototype.interfaces_=function(){return[]};or.prototype.getClass=function(){return or};di=function n(){var t,i,u,f;if(this.elt=new Array(2).fill(null),1===arguments.length)Number.isInteger(arguments[0])?(t=arguments[0],this.elt[0]=new or(t),this.elt[1]=new or(t)):arguments[0]instanceof n&&(i=arguments[0],this.elt[0]=new or(i.elt[0]),this.elt[1]=new or(i.elt[1]));else if(2===arguments.length)u=arguments[0],f=arguments[1],this.elt[0]=new or(r.NONE),this.elt[1]=new or(r.NONE),this.elt[u].setLocation(f);else if(3===arguments.length){var e=arguments[0],o=arguments[1],s=arguments[2];this.elt[0]=new or(e,o,s);this.elt[1]=new or(e,o,s)}else if(4===arguments.length){var h=arguments[0],c=arguments[1],l=arguments[2],a=arguments[3];this.elt[0]=new or(r.NONE,r.NONE,r.NONE);this.elt[1]=new or(r.NONE,r.NONE,r.NONE);this.elt[h].setLocations(c,l,a)}};di.prototype.getGeometryCount=function(){var n=0;return this.elt[0].isNull()||n++,this.elt[1].isNull()||n++,n};di.prototype.setAllLocations=function(n,t){this.elt[n].setAllLocations(t)};di.prototype.isNull=function(n){return this.elt[n].isNull()};di.prototype.setAllLocationsIfNull=function(){var n,t,i;1===arguments.length?(n=arguments[0],this.setAllLocationsIfNull(0,n),this.setAllLocationsIfNull(1,n)):2===arguments.length&&(t=arguments[0],i=arguments[1],this.elt[t].setAllLocationsIfNull(i))};di.prototype.isLine=function(n){return this.elt[n].isLine()};di.prototype.merge=function(n){for(var t=0;t<2;t++)null===this.elt[t]&&null!==n.elt[t]?this.elt[t]=new or(n.elt[t]):this.elt[t].merge(n.elt[t])};di.prototype.flip=function(){this.elt[0].flip();this.elt[1].flip()};di.prototype.getLocation=function(){var n,t,i;return 1===arguments.length?(n=arguments[0],this.elt[n].get(f.ON)):2===arguments.length?(t=arguments[0],i=arguments[1],this.elt[t].get(i)):void 0};di.prototype.toString=function(){var n=new es;return null!==this.elt[0]&&(n.append("A:"),n.append(this.elt[0].toString())),null!==this.elt[1]&&(n.append(" B:"),n.append(this.elt[1].toString())),n.toString()};di.prototype.isArea=function(){if(0===arguments.length)return this.elt[0].isArea()||this.elt[1].isArea();if(1===arguments.length){var n=arguments[0];return this.elt[n].isArea()}};di.prototype.isAnyNull=function(n){return this.elt[n].isAnyNull()};di.prototype.setLocation=function(){var n,t;if(2===arguments.length)n=arguments[0],t=arguments[1],this.elt[n].setLocation(f.ON,t);else if(3===arguments.length){var i=arguments[0],r=arguments[1],u=arguments[2];this.elt[i].setLocation(r,u)}};di.prototype.isEqualOnSide=function(n,t){return this.elt[0].isEqualOnSide(n.elt[0],t)&&this.elt[1].isEqualOnSide(n.elt[1],t)};di.prototype.allPositionsEqual=function(n,t){return this.elt[n].allPositionsEqual(t)};di.prototype.toLine=function(n){this.elt[n].isArea()&&(this.elt[n]=new or(this.elt[n].location[0]))};di.prototype.interfaces_=function(){return[]};di.prototype.getClass=function(){return di};di.toLineLabel=function(n){for(var i=new di(r.NONE),t=0;t<2;t++)i.setLocation(t,n.getLocation(t));return i};iu=function(){this._startDe=null;this._maxNodeDegree=-1;this._edges=new e;this._pts=new e;this._label=new di(r.NONE);this._ring=null;this._isHole=null;this._shell=null;this._holes=new e;this._geometryFactory=null;var n=arguments[0],t=arguments[1];this._geometryFactory=t;this.computePoints(n);this.computeRing()};iu.prototype.computeRing=function(){if(null!==this._ring)return null;for(var t=new Array(this._pts.size()).fill(null),n=0;n<this._pts.size();n++)t[n]=this._pts.get(n);this._ring=this._geometryFactory.createLinearRing(t);this._isHole=o.isCCW(this._ring.getCoordinates())};iu.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()};iu.prototype.computePoints=function(n){var t,i,r;this._startDe=n;t=n;i=!0;do{if(null===t)throw new nc("Found null DirectedEdge");if(t.getEdgeRing()===this)throw new nc("Directed Edge visited twice during ring-building at "+t.getCoordinate());this._edges.add(t);r=t.getLabel();rt.isTrue(r.isArea());this.mergeLabel(r);this.addPoints(t.getEdge(),t.isForward(),i);i=!1;this.setEdgeRing(t,this);t=this.getNext(t)}while(t!==this._startDe)};iu.prototype.getLinearRing=function(){return this._ring};iu.prototype.getCoordinate=function(n){return this._pts.get(n)};iu.prototype.computeMaxNodeDegree=function(){var n,t;this._maxNodeDegree=0;n=this._startDe;do t=n.getNode().getEdges().getOutgoingDegree(this),t>this._maxNodeDegree&&(this._maxNodeDegree=t),n=this.getNext(n);while(n!==this._startDe);this._maxNodeDegree*=2};iu.prototype.addPoints=function(n,t,i){var r=n.getCoordinates(),e,u,o,f;if(t)for(e=1,i&&(e=0),u=e;u<r.length;u++)this._pts.add(r[u]);else for(o=r.length-2,i&&(o=r.length-1),f=o;f>=0;f--)this._pts.add(r[f])};iu.prototype.isHole=function(){return this._isHole};iu.prototype.setInResult=function(){var n=this._startDe;do n.getEdge().setInResult(!0),n=n.getNext();while(n!==this._startDe)};iu.prototype.containsPoint=function(n){var i=this.getLinearRing(),t;if(!i.getEnvelopeInternal().contains(n)||!o.isPointInRing(n,i.getCoordinates()))return!1;for(t=this._holes.iterator();t.hasNext();)if(t.next().containsPoint(n))return!1;return!0};iu.prototype.addHole=function(n){this._holes.add(n)};iu.prototype.isShell=function(){return null===this._shell};iu.prototype.getLabel=function(){return this._label};iu.prototype.getEdges=function(){return this._edges};iu.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree};iu.prototype.getShell=function(){return this._shell};iu.prototype.mergeLabel=function(){var n;if(1===arguments.length)n=arguments[0],this.mergeLabel(n,0),this.mergeLabel(n,1);else if(2===arguments.length){var u=arguments[0],t=arguments[1],i=u.getLocation(t,f.RIGHT);if(i===r.NONE)return null;if(this._label.getLocation(t)===r.NONE)return this._label.setLocation(t,i),null}};iu.prototype.setShell=function(n){this._shell=n;null!==n&&n.addHole(this)};iu.prototype.toPolygon=function(n){for(var i=new Array(this._holes.size()).fill(null),t=0;t<this._holes.size();t++)i[t]=this._holes.get(t).getLinearRing();return n.createPolygon(this.getLinearRing(),i)};iu.prototype.interfaces_=function(){return[]};iu.prototype.getClass=function(){return iu};var skt=function(n){function t(){var t=arguments[0],i=arguments[1];n.call(this,t,i)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.setEdgeRing=function(n,t){n.setMinEdgeRing(t)},t.prototype.getNext=function(n){return n.getNextMin()},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(iu),hkt=function(n){function t(){var t=arguments[0],i=arguments[1];n.call(this,t,i)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.buildMinimalRings=function(){var t=new e,n=this._startDe,i;do null===n.getMinEdgeRing()&&(i=new skt(n,this._geometryFactory),t.add(i)),n=n.getNext();while(n!==this._startDe);return t},t.prototype.setEdgeRing=function(n,t){n.setEdgeRing(t)},t.prototype.linkDirectedEdgesForMinimalEdgeRings=function(){var n=this._startDe;do n.getNode().getEdges().linkMinimalDirectedEdges(this),n=n.getNext();while(n!==this._startDe)},t.prototype.getNext=function(n){return n.getNext()},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(iu),fo=function(){if((this._label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,0!==arguments.length)&&1===arguments.length){var n=arguments[0];this._label=n}};fo.prototype.setVisited=function(n){this._isVisited=n};fo.prototype.setInResult=function(n){this._isInResult=n};fo.prototype.isCovered=function(){return this._isCovered};fo.prototype.isCoveredSet=function(){return this._isCoveredSet};fo.prototype.setLabel=function(n){this._label=n};fo.prototype.getLabel=function(){return this._label};fo.prototype.setCovered=function(n){this._isCovered=n;this._isCoveredSet=!0};fo.prototype.updateIM=function(n){rt.isTrue(this._label.getGeometryCount()>=2,"found partial label");this.computeIM(n)};fo.prototype.isInResult=function(){return this._isInResult};fo.prototype.isVisited=function(){return this._isVisited};fo.prototype.interfaces_=function(){return[]};fo.prototype.getClass=function(){return fo};ok=function(n){function t(){n.call(this);this._coord=null;this._edges=null;var t=arguments[0],i=arguments[1];this._coord=t;this._edges=i;this._label=new di(0,r.NONE)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.isIncidentEdgeInResult=function(){for(var n=this.getEdges().getEdges().iterator();n.hasNext();)if(n.next().getEdge().isInResult())return!0;return!1},t.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},t.prototype.getCoordinate=function(){return this._coord},t.prototype.print=function(n){n.println("node "+this._coord+" lbl: "+this._label)},t.prototype.computeIM=function(){},t.prototype.computeMergedLocation=function(n,t){var i=r.NONE,u;return(i=this._label.getLocation(t),n.isNull(t))||(u=n.getLocation(t),i!==r.BOUNDARY&&(i=u)),i},t.prototype.setLabel=function(){if(2!==arguments.length)return n.prototype.setLabel.apply(this,arguments);var t=arguments[0],i=arguments[1];null===this._label?this._label=new di(t,i):this._label.setLocation(t,i)},t.prototype.getEdges=function(){return this._edges},t.prototype.mergeLabel=function(){var i,u,n,f;if(arguments[0]instanceof t)i=arguments[0],this.mergeLabel(i._label);else if(arguments[0]instanceof di)for(u=arguments[0],n=0;n<2;n++)f=this.computeMergedLocation(u,n),this._label.getLocation(n)===r.NONE&&this._label.setLocation(n,f)},t.prototype.add=function(n){this._edges.insert(n);n.setNode(this)},t.prototype.setLabelBoundary=function(n){var i,t;if(null===this._label)return null;i=r.NONE;null!==this._label&&(i=this._label.getLocation(n));t=null;switch(i){case r.BOUNDARY:t=r.INTERIOR;break;case r.INTERIOR:default:t=r.BOUNDARY}this._label.setLocation(n,t)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(fo);ys=function(){this.nodeMap=new df;this.nodeFact=null;var n=arguments[0];this.nodeFact=n};ys.prototype.find=function(n){return this.nodeMap.get(n)};ys.prototype.addNode=function(){var r,t,n,u;return arguments[0]instanceof i?(r=arguments[0],t=this.nodeMap.get(r),null===t&&(t=this.nodeFact.createNode(r),this.nodeMap.put(r,t)),t):arguments[0]instanceof ok?(n=arguments[0],u=this.nodeMap.get(n.getCoordinate()),null===u?(this.nodeMap.put(n.getCoordinate(),n),n):(u.mergeLabel(n),u)):void 0};ys.prototype.print=function(n){for(var t=this.iterator();t.hasNext();)t.next().print(n)};ys.prototype.iterator=function(){return this.nodeMap.values().iterator()};ys.prototype.values=function(){return this.nodeMap.values()};ys.prototype.getBoundaryNodes=function(n){for(var u,t=new e,i=this.iterator();i.hasNext();)u=i.next(),u.getLabel().getLocation(n)===r.BOUNDARY&&t.add(u);return t};ys.prototype.add=function(n){var t=n.getCoordinate();this.addNode(t).add(n)};ys.prototype.interfaces_=function(){return[]};ys.prototype.getClass=function(){return ys};ir=function(){};iw={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};ir.prototype.interfaces_=function(){return[]};ir.prototype.getClass=function(){return ir};ir.isNorthern=function(n){return n===ir.NE||n===ir.NW};ir.isOpposite=function(n,t){return n===t?!1:2==(n-t+4)%4};ir.commonHalfPlane=function(n,t){if(n===t)return n;if(2==(n-t+4)%4)return-1;var i=n<t?n:t;return 0===i&&3===(n>t?n:t)?3:i};ir.isInHalfPlane=function(n,t){return t===ir.SE?n===ir.SE||n===ir.SW:n===t||n===t+1};ir.quadrant=function(){var u,r,n,t;if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){if(u=arguments[0],r=arguments[1],0===u&&0===r)throw new ar("Cannot compute the quadrant for point ( "+u+", "+r+" )");return u>=0?r>=0?ir.NE:ir.SE:r>=0?ir.NW:ir.SW}if(arguments[0]instanceof i&&arguments[1]instanceof i){if(n=arguments[0],t=arguments[1],t.x===n.x&&t.y===n.y)throw new ar("Cannot compute the quadrant for two identical points "+n);return t.x>=n.x?t.y>=n.y?ir.NE:ir.SE:t.y>=n.y?ir.NW:ir.SW}};iw.NE.get=function(){return 0};iw.NW.get=function(){return 1};iw.SW.get=function(){return 2};iw.SE.get=function(){return 3};Object.defineProperties(ir,iw);uf=function(){var n;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)n=arguments[0],this._edge=n;else if(3===arguments.length){var t=arguments[0],i=arguments[1],r=arguments[2];this._edge=t;this.init(i,r);this._label=null}else if(4===arguments.length){var u=arguments[0],f=arguments[1],e=arguments[2],o=arguments[3];this._edge=u;this.init(f,e);this._label=o}};uf.prototype.compareDirection=function(n){return this._dx===n._dx&&this._dy===n._dy?0:this._quadrant>n._quadrant?1:this._quadrant<n._quadrant?-1:o.computeOrientation(n._p0,n._p1,this._p1)};uf.prototype.getDy=function(){return this._dy};uf.prototype.getCoordinate=function(){return this._p0};uf.prototype.setNode=function(n){this._node=n};uf.prototype.print=function(n){var i=Math.atan2(this._dy,this._dx),t=this.getClass().getName(),r=t.lastIndexOf("."),u=t.substring(r+1);n.print("  "+u+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+i+"   "+this._label)};uf.prototype.compareTo=function(n){var t=n;return this.compareDirection(t)};uf.prototype.getDirectedCoordinate=function(){return this._p1};uf.prototype.getDx=function(){return this._dx};uf.prototype.getLabel=function(){return this._label};uf.prototype.getEdge=function(){return this._edge};uf.prototype.getQuadrant=function(){return this._quadrant};uf.prototype.getNode=function(){return this._node};uf.prototype.toString=function(){var t=Math.atan2(this._dy,this._dx),n=this.getClass().getName(),i=n.lastIndexOf(".");return"  "+n.substring(i+1)+": "+this._p0+" - "+this._p1+" "+this._quadrant+":"+t+"   "+this._label};uf.prototype.computeLabel=function(){};uf.prototype.init=function(n,t){this._p0=n;this._p1=t;this._dx=t.x-n.x;this._dy=t.y-n.y;this._quadrant=ir.quadrant(this._dx,this._dy);rt.isTrue(!(0===this._dx&&0===this._dy),"EdgeEnd with identical endpoints found")};uf.prototype.interfaces_=function(){return[co]};uf.prototype.getClass=function(){return uf};on=function(n){function t(){var t=arguments[0],r=arguments[1],i;(n.call(this,t),this._isForward=null,this._isInResult=!1,this._isVisited=!1,this._sym=null,this._next=null,this._nextMin=null,this._edgeRing=null,this._minEdgeRing=null,this._depth=[0,-999,-999],this._isForward=r,r)?this.init(t.getCoordinate(0),t.getCoordinate(1)):(i=t.getNumPoints()-1,this.init(t.getCoordinate(i),t.getCoordinate(i-1)));this.computeDirectedLabel()}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getNextMin=function(){return this._nextMin},t.prototype.getDepth=function(n){return this._depth[n]},t.prototype.setVisited=function(n){this._isVisited=n},t.prototype.computeDirectedLabel=function(){this._label=new di(this._edge.getLabel());this._isForward||this._label.flip()},t.prototype.getNext=function(){return this._next},t.prototype.setDepth=function(n,t){if(-999!==this._depth[n]&&this._depth[n]!==t)throw new nc("assigned depths do not match",this.getCoordinate());this._depth[n]=t},t.prototype.isInteriorAreaEdge=function(){for(var t=!0,n=0;n<2;n++)this._label.isArea(n)&&this._label.getLocation(n,f.LEFT)===r.INTERIOR&&this._label.getLocation(n,f.RIGHT)===r.INTERIOR||(t=!1);return t},t.prototype.setNextMin=function(n){this._nextMin=n},t.prototype.print=function(t){n.prototype.print.call(this,t);t.print(" "+this._depth[f.LEFT]+"/"+this._depth[f.RIGHT]);t.print(" ("+this.getDepthDelta()+")");this._isInResult&&t.print(" inResult")},t.prototype.setMinEdgeRing=function(n){this._minEdgeRing=n},t.prototype.isLineEdge=function(){var n=this._label.isLine(0)||this._label.isLine(1),t=!this._label.isArea(0)||this._label.allPositionsEqual(0,r.EXTERIOR),i=!this._label.isArea(1)||this._label.allPositionsEqual(1,r.EXTERIOR);return n&&t&&i},t.prototype.setEdgeRing=function(n){this._edgeRing=n},t.prototype.getMinEdgeRing=function(){return this._minEdgeRing},t.prototype.getDepthDelta=function(){var n=this._edge.getDepthDelta();return this._isForward||(n=-n),n},t.prototype.setInResult=function(n){this._isInResult=n},t.prototype.getSym=function(){return this._sym},t.prototype.isForward=function(){return this._isForward},t.prototype.getEdge=function(){return this._edge},t.prototype.printEdge=function(n){this.print(n);n.print(" ");this._isForward?this._edge.print(n):this._edge.printReverse(n)},t.prototype.setSym=function(n){this._sym=n},t.prototype.setVisitedEdge=function(n){this.setVisited(n);this._sym.setVisited(n)},t.prototype.setEdgeDepths=function(n,t){var i=this.getEdge().getDepthDelta(),r,u,e;this._isForward||(i=-i);r=1;n===f.LEFT&&(r=-1);u=f.opposite(n);e=t+i*r;this.setDepth(n,t);this.setDepth(u,e)},t.prototype.getEdgeRing=function(){return this._edgeRing},t.prototype.isInResult=function(){return this._isInResult},t.prototype.setNext=function(n){this._next=n},t.prototype.isVisited=function(){return this._isVisited},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.depthFactor=function(n,t){return n===r.EXTERIOR&&t===r.INTERIOR?1:n===r.INTERIOR&&t===r.EXTERIOR?-1:0},t}(uf);ty=function(){};ty.prototype.createNode=function(n){return new ok(n,null)};ty.prototype.interfaces_=function(){return[]};ty.prototype.getClass=function(){return ty};yr=function(){if(this._edges=new e,this._nodes=null,this._edgeEndList=new e,0===arguments.length)this._nodes=new ys(new ty);else if(1===arguments.length){var n=arguments[0];this._nodes=new ys(n)}};yr.prototype.printEdges=function(n){var t,i;for(n.println("Edges:"),t=0;t<this._edges.size();t++)n.println("edge "+t+":"),i=this._edges.get(t),i.print(n),i.eiList.print(n)};yr.prototype.find=function(n){return this._nodes.find(n)};yr.prototype.addNode=function(){var n,t;return arguments[0]instanceof ok?(n=arguments[0],this._nodes.addNode(n)):arguments[0]instanceof i?(t=arguments[0],this._nodes.addNode(t)):void 0};yr.prototype.getNodeIterator=function(){return this._nodes.iterator()};yr.prototype.linkResultDirectedEdges=function(){for(var n=this._nodes.iterator();n.hasNext();)n.next().getEdges().linkResultDirectedEdges()};yr.prototype.debugPrintln=function(n){rf.out.println(n)};yr.prototype.isBoundaryNode=function(n,t){var u=this._nodes.find(t),i;return null===u?!1:(i=u.getLabel(),null!==i&&i.getLocation(n)===r.BOUNDARY)};yr.prototype.linkAllDirectedEdges=function(){for(var n=this._nodes.iterator();n.hasNext();)n.next().getEdges().linkAllDirectedEdges()};yr.prototype.matchInSameDirection=function(n,t,i,r){return!!n.equals(i)&&o.computeOrientation(n,t,r)===o.COLLINEAR&&ir.quadrant(n,t)===ir.quadrant(i,r)};yr.prototype.getEdgeEnds=function(){return this._edgeEndList};yr.prototype.debugPrint=function(n){rf.out.print(n)};yr.prototype.getEdgeIterator=function(){return this._edges.iterator()};yr.prototype.findEdgeInSameDirection=function(n,t){for(var u,i,r=0;r<this._edges.size();r++)if((u=this._edges.get(r),i=u.getCoordinates(),this.matchInSameDirection(n,t,i[0],i[1]))||this.matchInSameDirection(n,t,i[i.length-1],i[i.length-2]))return u;return null};yr.prototype.insertEdge=function(n){this._edges.add(n)};yr.prototype.findEdgeEnd=function(n){for(var i,t=this.getEdgeEnds().iterator();t.hasNext();)if(i=t.next(),i.getEdge()===n)return i;return null};yr.prototype.addEdges=function(n){for(var t,i,r,u=n.iterator();u.hasNext();)t=u.next(),this._edges.add(t),i=new on(t,!0),r=new on(t,!1),i.setSym(r),r.setSym(i),this.add(i),this.add(r)};yr.prototype.add=function(n){this._nodes.add(n);this._edgeEndList.add(n)};yr.prototype.getNodes=function(){return this._nodes.values()};yr.prototype.findEdge=function(n,t){for(var r,u,i=0;i<this._edges.size();i++)if(r=this._edges.get(i),u=r.getCoordinates(),n.equals(u[0])&&t.equals(u[1]))return r;return null};yr.prototype.interfaces_=function(){return[]};yr.prototype.getClass=function(){return yr};yr.linkResultDirectedEdges=function(n){for(var t=n.iterator();t.hasNext();)t.next().getEdges().linkResultDirectedEdges()};he=function(){this._geometryFactory=null;this._shellList=new e;var n=arguments[0];this._geometryFactory=n};he.prototype.sortShellsAndHoles=function(n,t,i){for(var r,u=n.iterator();u.hasNext();)r=u.next(),r.isHole()?i.add(r):t.add(r)};he.prototype.computePolygons=function(n){for(var r,t=new e,i=n.iterator();i.hasNext();)r=i.next().toPolygon(this._geometryFactory),t.add(r);return t};he.prototype.placeFreeHoles=function(n,t){for(var i,u,r=t.iterator();r.hasNext();)if(i=r.next(),null===i.getShell()){if(u=this.findEdgeRingContaining(i,n),null===u)throw new nc("unable to assign hole to a shell",i.getCoordinate(0));i.setShell(u)}};he.prototype.buildMinimalEdgeRings=function(n,t,i){for(var r,u,f,o=new e,s=n.iterator();s.hasNext();)r=s.next(),r.getMaxNodeDegree()>2?(r.linkDirectedEdgesForMinimalEdgeRings(),u=r.buildMinimalRings(),f=this.findShell(u),null!==f?(this.placePolygonHoles(f,u),t.add(f)):i.addAll(u)):o.add(r);return o};he.prototype.containsPoint=function(n){for(var t=this._shellList.iterator();t.hasNext();)if(t.next().containsPoint(n))return!0;return!1};he.prototype.buildMaximalEdgeRings=function(n){for(var t,u,i=new e,r=n.iterator();r.hasNext();)t=r.next(),t.isInResult()&&t.getLabel().isArea()&&null===t.getEdgeRing()&&(u=new hkt(t,this._geometryFactory),i.add(u),u.setInResult());return i};he.prototype.placePolygonHoles=function(n,t){for(var r,i=t.iterator();i.hasNext();)r=i.next(),r.isHole()&&r.setShell(n)};he.prototype.getPolygons=function(){return this.computePolygons(this._shellList)};he.prototype.findEdgeRingContaining=function(n,t){for(var r,u=n.getLinearRing(),l=u.getEnvelopeInternal(),a=u.getCoordinateN(0),i=null,f=null,e=t.iterator();e.hasNext();){var s=e.next(),h=s.getLinearRing(),c=h.getEnvelopeInternal();null!==i&&(f=i.getLinearRing().getEnvelopeInternal());r=!1;c.contains(l)&&o.isPointInRing(a,h.getCoordinates())&&(r=!0);r&&(null===i||f.contains(c))&&(i=s)}return i};he.prototype.findShell=function(n){for(var t,i=0,r=null,u=n.iterator();u.hasNext();)t=u.next(),t.isHole()||(r=t,i++);return rt.isTrue(i<=1,"found two shells in MinimalEdgeRing list"),r};he.prototype.add=function(){var n,i,r;if(1===arguments.length)n=arguments[0],this.add(n.getEdgeEnds(),n.getNodes());else if(2===arguments.length){i=arguments[0];r=arguments[1];yr.linkResultDirectedEdges(r);var u=this.buildMaximalEdgeRings(i),t=new e,f=this.buildMinimalEdgeRings(u,this._shellList,t);this.sortShellsAndHoles(f,this._shellList,t);this.placeFreeHoles(this._shellList,t)}};he.prototype.interfaces_=function(){return[]};he.prototype.getClass=function(){return he};iy=function(){};iy.prototype.getBounds=function(){};iy.prototype.interfaces_=function(){return[]};iy.prototype.getClass=function(){return iy};ko=function(){this._bounds=null;this._item=null;var n=arguments[0],t=arguments[1];this._bounds=n;this._item=t};ko.prototype.getItem=function(){return this._item};ko.prototype.getBounds=function(){return this._bounds};ko.prototype.interfaces_=function(){return[iy,ho]};ko.prototype.getClass=function(){return ko};tc=function(){this._size=null;this._items=null;this._size=0;this._items=new e;this._items.add(null)};tc.prototype.poll=function(){if(this.isEmpty())return null;var n=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),n};tc.prototype.size=function(){return this._size};tc.prototype.reorder=function(n){for(var t=null,i=this._items.get(n);2*n<=this._size&&((t=2*n)!==this._size&&this._items.get(t+1).compareTo(this._items.get(t))<0&&t++,this._items.get(t).compareTo(i)<0);n=t)this._items.set(n,this._items.get(t));this._items.set(n,i)};tc.prototype.clear=function(){this._size=0;this._items.clear()};tc.prototype.isEmpty=function(){return 0===this._size};tc.prototype.add=function(n){this._items.add(null);this._size+=1;var t=this._size;for(this._items.set(0,n);n.compareTo(this._items.get(Math.trunc(t/2)))<0;t/=2)this._items.set(t,this._items.get(Math.trunc(t/2)));this._items.set(t,n)};tc.prototype.interfaces_=function(){return[]};tc.prototype.getClass=function(){return tc};bc=function(){};bc.prototype.visitItem=function(){};bc.prototype.interfaces_=function(){return[]};bc.prototype.getClass=function(){return bc};wa=function(){};wa.prototype.insert=function(){};wa.prototype.remove=function(){};wa.prototype.query=function(){};wa.prototype.interfaces_=function(){return[]};wa.prototype.getClass=function(){return wa};ou=function(){if((this._childBoundables=new e,this._bounds=null,this._level=null,0!==arguments.length)&&1===arguments.length){var n=arguments[0];this._level=n}};but={serialVersionUID:{configurable:!0}};ou.prototype.getLevel=function(){return this._level};ou.prototype.size=function(){return this._childBoundables.size()};ou.prototype.getChildBoundables=function(){return this._childBoundables};ou.prototype.addChildBoundable=function(n){rt.isTrue(null===this._bounds);this._childBoundables.add(n)};ou.prototype.isEmpty=function(){return this._childBoundables.isEmpty()};ou.prototype.getBounds=function(){return null===this._bounds&&(this._bounds=this.computeBounds()),this._bounds};ou.prototype.interfaces_=function(){return[iy,ho]};ou.prototype.getClass=function(){return ou};but.serialVersionUID.get=function(){return 0x5a1e55ec41369800};Object.defineProperties(ou,but);go=function(){};go.reverseOrder=function(){return{compare:function(n,t){return t.compareTo(n)}}};go.min=function(n){return go.sort(n),n.get(0)};go.sort=function(n,t){var i=n.toArray();t?yl.sort(i,t):yl.sort(i);for(var u=n.iterator(),r=0,f=i.length;r<f;r++)u.next(),u.set(i[r])};go.singletonList=function(n){var t=new e;return t.add(n),t};ru=function(){this._boundable1=null;this._boundable2=null;this._distance=null;this._itemDistance=null;var n=arguments[0],t=arguments[1],i=arguments[2];this._boundable1=n;this._boundable2=t;this._itemDistance=i;this._distance=this.distance()};ru.prototype.expandToQueue=function(n,t){var i=ru.isComposite(this._boundable1),r=ru.isComposite(this._boundable2);if(i&&r)return ru.area(this._boundable1)>ru.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,n,t),null):(this.expand(this._boundable2,this._boundable1,n,t),null);if(i)return this.expand(this._boundable1,this._boundable2,n,t),null;if(r)return this.expand(this._boundable2,this._boundable1,n,t),null;throw new ar("neither boundable is composite");};ru.prototype.isLeaves=function(){return!(ru.isComposite(this._boundable1)||ru.isComposite(this._boundable2))};ru.prototype.compareTo=function(n){var t=n;return this._distance<t._distance?-1:this._distance>t._distance?1:0};ru.prototype.expand=function(n,t,i,r){for(var e,f,u=n.getChildBoundables().iterator();u.hasNext();)e=u.next(),f=new ru(e,t,this._itemDistance),f.getDistance()<r&&i.add(f)};ru.prototype.getBoundable=function(n){return 0===n?this._boundable1:this._boundable2};ru.prototype.getDistance=function(){return this._distance};ru.prototype.distance=function(){return this.isLeaves()?this._itemDistance.distance(this._boundable1,this._boundable2):this._boundable1.getBounds().distance(this._boundable2.getBounds())};ru.prototype.interfaces_=function(){return[co]};ru.prototype.getClass=function(){return ru};ru.area=function(n){return n.getBounds().getArea()};ru.isComposite=function(n){return n instanceof ou};lu=function n(){var i,t;(this._root=null,this._built=!1,this._itemBoundables=new e,this._nodeCapacity=null,0===arguments.length)?(i=n.DEFAULT_NODE_CAPACITY,this._nodeCapacity=i):1===arguments.length&&(t=arguments[0],rt.isTrue(t>1,"Node capacity must be greater than 1"),this._nodeCapacity=t)};sk={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};lu.prototype.getNodeCapacity=function(){return this._nodeCapacity};lu.prototype.lastNode=function(n){return n.get(n.size()-1)};lu.prototype.size=function(){var n,i,t;if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.size(this._root));if(1===arguments.length){for(n=0,i=arguments[0].getChildBoundables().iterator();i.hasNext();)t=i.next(),t instanceof ou?n+=this.size(t):t instanceof ko&&(n+=1);return n}};lu.prototype.removeItem=function(n,t){for(var r,i=null,u=n.getChildBoundables().iterator();u.hasNext();)r=u.next(),r instanceof ko&&r.getItem()===t&&(i=r);return null!==i&&(n.getChildBoundables().remove(i),!0)};lu.prototype.itemsTree=function(){var i,n,r;if(0===arguments.length)return this.build(),i=this.itemsTree(this._root),null===i?new e:i;if(1===arguments.length){for(var f=arguments[0],t=new e,u=f.getChildBoundables().iterator();u.hasNext();)n=u.next(),n instanceof ou?(r=this.itemsTree(n),null!==r&&t.add(r)):n instanceof ko?t.add(n.getItem()):rt.shouldNeverReachHere();return t.size()<=0?null:t}};lu.prototype.insert=function(n,t){rt.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built.");this._itemBoundables.add(new ko(n,t))};lu.prototype.boundablesAtLevel=function(){var o,i,f,n;if(1===arguments.length)return o=arguments[0],i=new e,this.boundablesAtLevel(o,this._root,i),i;if(3===arguments.length){var t=arguments[0],r=arguments[1],u=arguments[2];if(rt.isTrue(t>-2),r.getLevel()===t)return u.add(r),null;for(f=r.getChildBoundables().iterator();f.hasNext();)n=f.next(),n instanceof ou?this.boundablesAtLevel(t,n,u):(rt.isTrue(n instanceof ko),-1===t&&u.add(n));return null}};lu.prototype.query=function(){var r,i,u,s,n,t;if(1===arguments.length)return r=arguments[0],this.build(),i=new e,this.isEmpty()?i:(this.getIntersectsOp().intersects(this._root.getBounds(),r)&&this.query(r,this._root,i),i);if(2===arguments.length){if(u=arguments[0],s=arguments[1],this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),u)&&this.query(u,this._root,s)}else if(3===arguments.length)if(k(arguments[2],bc)&&arguments[0]instanceof Object&&arguments[1]instanceof ou)for(var h=arguments[0],p=arguments[1],c=arguments[2],l=p.getChildBoundables(),f=0;f<l.size();f++)n=l.get(f),this.getIntersectsOp().intersects(n.getBounds(),h)&&(n instanceof ou?this.query(h,n,c):n instanceof ko?c.visitItem(n.getItem()):rt.shouldNeverReachHere());else if(k(arguments[2],vo)&&arguments[0]instanceof Object&&arguments[1]instanceof ou)for(var a=arguments[0],w=arguments[1],v=arguments[2],y=w.getChildBoundables(),o=0;o<y.size();o++)t=y.get(o),this.getIntersectsOp().intersects(t.getBounds(),a)&&(t instanceof ou?this.query(a,t,v):t instanceof ko?v.add(t.getItem()):rt.shouldNeverReachHere())};lu.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};lu.prototype.getRoot=function(){return this.build(),this._root};lu.prototype.remove=function(){var i,e,n,f,t;if(2===arguments.length)return i=arguments[0],e=arguments[1],this.build(),!!this.getIntersectsOp().intersects(this._root.getBounds(),i)&&this.remove(i,this._root,e);if(3===arguments.length){var o=arguments[0],r=arguments[1],s=arguments[2],u=this.removeItem(r,s);if(u)return!0;for(n=null,f=r.getChildBoundables().iterator();f.hasNext();)if(t=f.next(),this.getIntersectsOp().intersects(t.getBounds(),o)&&t instanceof ou&&(u=this.remove(o,t,s))){n=t;break}return null!==n&&n.getChildBoundables().isEmpty()&&r.getChildBoundables().remove(n),u}};lu.prototype.createHigherLevels=function(n,t){rt.isTrue(!n.isEmpty());var i=this.createParentBoundables(n,t+1);return 1===i.size()?i.get(0):this.createHigherLevels(i,t+1)};lu.prototype.depth=function(){var n,t,i,r;if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.depth(this._root));if(1===arguments.length){for(n=0,t=arguments[0].getChildBoundables().iterator();t.hasNext();)i=t.next(),i instanceof ou&&(r=this.depth(i),r>n&&(n=r));return n+1}};lu.prototype.createParentBoundables=function(n,t){var i,r,u,f;for(rt.isTrue(!n.isEmpty()),i=new e,i.add(this.createNode(t)),r=new e(n),go.sort(r,this.getComparator()),u=r.iterator();u.hasNext();)f=u.next(),this.lastNode(i).getChildBoundables().size()===this.getNodeCapacity()&&i.add(this.createNode(t)),this.lastNode(i).addChildBoundable(f);return i};lu.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()};lu.prototype.interfaces_=function(){return[ho]};lu.prototype.getClass=function(){return lu};lu.compareDoubles=function(n,t){return n>t?1:n<t?-1:0};sk.IntersectsOp.get=function(){return vvt};sk.serialVersionUID.get=function(){return-0x35ef64c82d4c5400};sk.DEFAULT_NODE_CAPACITY.get=function(){return 10};Object.defineProperties(lu,sk);vvt=function(){};ry=function(){};ry.prototype.distance=function(){};ry.prototype.interfaces_=function(){return[]};ry.prototype.getClass=function(){return ry};var yvt=function(n){function t(i){i=i||t.DEFAULT_NODE_CAPACITY;n.call(this,i)}n&&(t.__proto__=n);(t.prototype=Object.create(n&&n.prototype)).constructor=t;var i={STRtreeNode:{configurable:!0},serialVersionUID:{configurable:!0},xComparator:{configurable:!0},yComparator:{configurable:!0},intersectsOp:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};return t.prototype.createParentBoundablesFromVerticalSlices=function(n,t){rt.isTrue(n.length>0);for(var r=new e,i=0;i<n.length;i++)r.addAll(this.createParentBoundablesFromVerticalSlice(n[i],t));return r},t.prototype.createNode=function(n){return new pvt(n)},t.prototype.size=function(){return 0===arguments.length?n.prototype.size.call(this):n.prototype.size.apply(this,arguments)},t.prototype.insert=function(){if(2!==arguments.length)return n.prototype.insert.apply(this,arguments);var t=arguments[0],i=arguments[1];if(t.isNull())return null;n.prototype.insert.call(this,t,i)},t.prototype.getIntersectsOp=function(){return t.intersectsOp},t.prototype.verticalSlices=function(n,t){for(var u,o,s=Math.trunc(Math.ceil(n.size()/t)),r=new Array(t).fill(null),f=n.iterator(),i=0;i<t;i++)for(r[i]=new e,u=0;f.hasNext()&&u<s;)o=f.next(),r[i].add(o),u++;return r},t.prototype.query=function(){var t,i,r;if(1===arguments.length)return t=arguments[0],n.prototype.query.call(this,t);if(2===arguments.length)i=arguments[0],r=arguments[1],n.prototype.query.call(this,i,r);else if(3===arguments.length)if(k(arguments[2],bc)&&arguments[0]instanceof Object&&arguments[1]instanceof ou){var u=arguments[0],f=arguments[1],e=arguments[2];n.prototype.query.call(this,u,f,e)}else if(k(arguments[2],vo)&&arguments[0]instanceof Object&&arguments[1]instanceof ou){var o=arguments[0],s=arguments[1],h=arguments[2];n.prototype.query.call(this,o,s,h)}},t.prototype.getComparator=function(){return t.yComparator},t.prototype.createParentBoundablesFromVerticalSlice=function(t,i){return n.prototype.createParentBoundables.call(this,t,i)},t.prototype.remove=function(){if(2===arguments.length){var t=arguments[0],i=arguments[1];return n.prototype.remove.call(this,t,i)}return n.prototype.remove.apply(this,arguments)},t.prototype.depth=function(){return 0===arguments.length?n.prototype.depth.call(this):n.prototype.depth.apply(this,arguments)},t.prototype.createParentBoundables=function(n,i){var u,r,f;return rt.isTrue(!n.isEmpty()),u=Math.trunc(Math.ceil(n.size()/this.getNodeCapacity())),r=new e(n),go.sort(r,t.xComparator),f=this.verticalSlices(r,Math.trunc(Math.ceil(Math.sqrt(u)))),this.createParentBoundablesFromVerticalSlices(f,i)},t.prototype.nearestNeighbour=function(){var e,o,s,n,f;if(1===arguments.length){if(k(arguments[0],ry))return e=arguments[0],o=new ru(this.getRoot(),this.getRoot(),e),this.nearestNeighbour(o);if(arguments[0]instanceof ru)return s=arguments[0],this.nearestNeighbour(s,it.POSITIVE_INFINITY)}else if(2===arguments.length){if(arguments[0]instanceof t&&k(arguments[1],ry)){var h=arguments[0],c=arguments[1],l=new ru(this.getRoot(),h.getRoot(),c);return this.nearestNeighbour(l)}if(arguments[0]instanceof ru&&"number"==typeof arguments[1]){var a=arguments[0],i=arguments[1],u=null,r=new tc;for(r.add(a);!r.isEmpty()&&i>0;){if(n=r.poll(),f=n.getDistance(),f>=i)break;n.isLeaves()?(i=f,u=n):n.expandToQueue(r,i)}return[u.getBoundable(0).getItem(),u.getBoundable(1).getItem()]}}else if(3===arguments.length){var v=arguments[0],y=arguments[1],p=arguments[2],w=new ko(v,y),b=new ru(this.getRoot(),w,p);return this.nearestNeighbour(b)[0]}},t.prototype.interfaces_=function(){return[wa,ho]},t.prototype.getClass=function(){return t},t.centreX=function(n){return t.avg(n.getMinX(),n.getMaxX())},t.avg=function(n,t){return(n+t)/2},t.centreY=function(n){return t.avg(n.getMinY(),n.getMaxY())},i.STRtreeNode.get=function(){return pvt},i.serialVersionUID.get=function(){return 0x39920f7d5f261e0},i.xComparator.get=function(){return{interfaces_:function(){return[sp]},compare:function(i,r){return n.compareDoubles(t.centreX(i.getBounds()),t.centreX(r.getBounds()))}}},i.yComparator.get=function(){return{interfaces_:function(){return[sp]},compare:function(i,r){return n.compareDoubles(t.centreY(i.getBounds()),t.centreY(r.getBounds()))}}},i.intersectsOp.get=function(){return{interfaces_:function(){return[n.IntersectsOp]},intersects:function(n,t){return n.intersects(t)}}},i.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(t,i),t}(lu),pvt=function(n){function t(){var t=arguments[0];n.call(this,t)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.computeBounds=function(){for(var i,n=null,t=this.getChildBoundables().iterator();t.hasNext();)i=t.next(),null===n?n=new l(i.getBounds()):n.expandToInclude(i.getBounds());return n},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(ou),ce=function(){};ce.prototype.interfaces_=function(){return[]};ce.prototype.getClass=function(){return ce};ce.relativeSign=function(n,t){return n<t?-1:n>t?1:0};ce.compare=function(n,t,i){if(t.equals2D(i))return 0;var r=ce.relativeSign(t.x,i.x),u=ce.relativeSign(t.y,i.y);switch(n){case 0:return ce.compareValue(r,u);case 1:return ce.compareValue(u,r);case 2:return ce.compareValue(u,-r);case 3:return ce.compareValue(-r,u);case 4:return ce.compareValue(-r,-u);case 5:return ce.compareValue(-u,-r);case 6:return ce.compareValue(-u,r);case 7:return ce.compareValue(r,-u)}return rt.shouldNeverReachHere("invalid octant value"),0};ce.compareValue=function(n,t){return n<0?-1:n>0?1:t<0?-1:t>0?1:0};kc=function(){this._segString=null;this.coord=null;this.segmentIndex=null;this._segmentOctant=null;this._isInterior=null;var n=arguments[0],t=arguments[1],r=arguments[2],u=arguments[3];this._segString=n;this.coord=new i(t);this.segmentIndex=r;this._segmentOctant=u;this._isInterior=!t.equals2D(n.getCoordinate(r))};kc.prototype.getCoordinate=function(){return this.coord};kc.prototype.print=function(n){n.print(this.coord);n.print(" seg # = "+this.segmentIndex)};kc.prototype.compareTo=function(n){var t=n;return this.segmentIndex<t.segmentIndex?-1:this.segmentIndex>t.segmentIndex?1:this.coord.equals2D(t.coord)?0:ce.compare(this._segmentOctant,this.coord,t.coord)};kc.prototype.isEndPoint=function(n){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===n};kc.prototype.isInterior=function(){return this._isInterior};kc.prototype.interfaces_=function(){return[co]};kc.prototype.getClass=function(){return kc};cf=function(){this._nodeMap=new df;this._edge=null;var n=arguments[0];this._edge=n};cf.prototype.getSplitCoordinates=function(){var r=new tk,n,t,i;for(this.addEndpoints(),n=this.iterator(),t=n.next();n.hasNext();)i=n.next(),this.addEdgeCoordinates(t,i,r),t=i;return r.toCoordinateArray()};cf.prototype.addCollapsedNodes=function(){var n=new e,t,i;for(this.findCollapsesFromInsertedNodes(n),this.findCollapsesFromExistingVertices(n),t=n.iterator();t.hasNext();)i=t.next().intValue(),this.add(this._edge.getCoordinate(i),i)};cf.prototype.print=function(n){n.println("Intersections:");for(var t=this.iterator();t.hasNext();)t.next().print(n)};cf.prototype.findCollapsesFromExistingVertices=function(n){for(var i,r,t=0;t<this._edge.size()-2;t++)i=this._edge.getCoordinate(t),r=this._edge.getCoordinate(t+2),i.equals2D(r)&&n.add(new os(t+1))};cf.prototype.addEdgeCoordinates=function(n,t,r){var f=this._edge.getCoordinate(t.segmentIndex),e=t.isInterior()||!t.coord.equals2D(f),u;for(r.add(new i(n.coord),!1),u=n.segmentIndex+1;u<=t.segmentIndex;u++)r.add(this._edge.getCoordinate(u));e&&r.add(new i(t.coord))};cf.prototype.iterator=function(){return this._nodeMap.values().iterator()};cf.prototype.addSplitEdges=function(n){var t,i,r,u;for(this.addEndpoints(),this.addCollapsedNodes(),t=this.iterator(),i=t.next();t.hasNext();)r=t.next(),u=this.createSplitEdge(i,r),n.add(u),i=r};cf.prototype.findCollapseIndex=function(n,t,i){if(!n.coord.equals2D(t.coord))return!1;var r=t.segmentIndex-n.segmentIndex;return t.isInterior()||r--,1===r&&(i[0]=n.segmentIndex+1,!0)};cf.prototype.findCollapsesFromInsertedNodes=function(n){for(var i,r=new Array(1).fill(null),t=this.iterator(),u=t.next();t.hasNext();)i=t.next(),this.findCollapseIndex(u,i,r)&&n.add(new os(r[0])),u=i};cf.prototype.getEdge=function(){return this._edge};cf.prototype.addEndpoints=function(){var n=this._edge.size()-1;this.add(this._edge.getCoordinate(0),0);this.add(this._edge.getCoordinate(n),n)};cf.prototype.createSplitEdge=function(n,t){var e=t.segmentIndex-n.segmentIndex+2,s=this._edge.getCoordinate(t.segmentIndex),o=t.isInterior()||!t.coord.equals2D(s),r,u,f;for(o||e--,r=new Array(e).fill(null),u=0,r[u++]=new i(n.coord),f=n.segmentIndex+1;f<=t.segmentIndex;f++)r[u++]=this._edge.getCoordinate(f);return o&&(r[u]=new i(t.coord)),new gr(r,this._edge.getData())};cf.prototype.add=function(n,t){var i=new kc(this._edge,n,t,this._edge.getSegmentOctant(t)),r=this._nodeMap.get(i);return null!==r?(rt.isTrue(r.coord.equals2D(n),"Found equal nodes with different coordinates"),r):(this._nodeMap.put(i,i),i)};cf.prototype.checkSplitEdgesCorrectness=function(n){var t=this._edge.getCoordinates(),u=n.get(0).getCoordinate(0),i,r;if(!u.equals2D(t[0]))throw new vc("bad split edge start point at "+u);if(i=n.get(n.size()-1).getCoordinates(),r=i[i.length-1],!r.equals2D(t[t.length-1]))throw new vc("bad split edge end point at "+r);};cf.prototype.interfaces_=function(){return[]};cf.prototype.getClass=function(){return cf};ba=function(){};ba.prototype.interfaces_=function(){return[]};ba.prototype.getClass=function(){return ba};ba.octant=function(){var t,n,r,u;if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){if(t=arguments[0],n=arguments[1],0===t&&0===n)throw new ar("Cannot compute the octant for point ( "+t+", "+n+" )");return r=Math.abs(t),u=Math.abs(n),t>=0?n>=0?r>=u?0:1:r>=u?7:6:n>=0?r>=u?3:2:r>=u?4:5}if(arguments[0]instanceof i&&arguments[1]instanceof i){var f=arguments[0],e=arguments[1],o=e.x-f.x,s=e.y-f.y;if(0===o&&0===s)throw new ar("Cannot compute the octant for two identical points "+f);return ba.octant(o,s)}};fh=function(){};fh.prototype.getCoordinates=function(){};fh.prototype.size=function(){};fh.prototype.getCoordinate=function(){};fh.prototype.isClosed=function(){};fh.prototype.setData=function(){};fh.prototype.getData=function(){};fh.prototype.interfaces_=function(){return[]};fh.prototype.getClass=function(){return fh};rw=function(){};rw.prototype.addIntersection=function(){};rw.prototype.interfaces_=function(){return[fh]};rw.prototype.getClass=function(){return rw};gr=function(){this._nodeList=new cf(this);this._pts=null;this._data=null;var n=arguments[0],t=arguments[1];this._pts=n;this._data=t};gr.prototype.getCoordinates=function(){return this._pts};gr.prototype.size=function(){return this._pts.length};gr.prototype.getCoordinate=function(n){return this._pts[n]};gr.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])};gr.prototype.getSegmentOctant=function(n){return n===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(n),this.getCoordinate(n+1))};gr.prototype.setData=function(n){this._data=n};gr.prototype.safeOctant=function(n,t){return n.equals2D(t)?0:ba.octant(n,t)};gr.prototype.getData=function(){return this._data};gr.prototype.addIntersection=function(){var n,t;if(2===arguments.length)n=arguments[0],t=arguments[1],this.addIntersectionNode(n,t);else if(4===arguments.length){var r=arguments[0],u=arguments[1],f=arguments[3],e=new i(r.getIntersection(f));this.addIntersection(e,u)}};gr.prototype.toString=function(){return hs.toLineString(new dr(this._pts))};gr.prototype.getNodeList=function(){return this._nodeList};gr.prototype.addIntersectionNode=function(n,t){var i=t,r=i+1,u;return r<this._pts.length&&(u=this._pts[r],n.equals2D(u)&&(i=r)),this._nodeList.add(n,i)};gr.prototype.addIntersections=function(n,t,i){for(var r=0;r<n.getIntersectionNum();r++)this.addIntersection(n,t,i,r)};gr.prototype.interfaces_=function(){return[rw]};gr.prototype.getClass=function(){return gr};gr.getNodedSubstrings=function(){var t,n;if(1===arguments.length)return t=arguments[0],n=new e,gr.getNodedSubstrings(t,n),n;if(2===arguments.length)for(var r=arguments[0],u=arguments[1],i=r.iterator();i.hasNext();)i.next().getNodeList().addSplitEdges(u)};a=function(){var n;if(this.p0=null,this.p1=null,0===arguments.length)this.p0=new i,this.p1=new i;else if(1===arguments.length)n=arguments[0],this.p0=new i(n.p0),this.p1=new i(n.p1);else if(2===arguments.length)this.p0=arguments[0],this.p1=arguments[1];else if(4===arguments.length){var t=arguments[0],r=arguments[1],u=arguments[2],f=arguments[3];this.p0=new i(t,r);this.p1=new i(u,f)}};kut={serialVersionUID:{configurable:!0}};a.prototype.minX=function(){return Math.min(this.p0.x,this.p1.x)};a.prototype.orientationIndex=function(){var u;if(arguments[0]instanceof a){var r=arguments[0],n=o.orientationIndex(this.p0,this.p1,r.p0),t=o.orientationIndex(this.p0,this.p1,r.p1);return n>=0&&t>=0?Math.max(n,t):n<=0&&t<=0?Math.max(n,t):0}if(arguments[0]instanceof i)return u=arguments[0],o.orientationIndex(this.p0,this.p1,u)};a.prototype.toGeometry=function(n){return n.createLineString([this.p0,this.p1])};a.prototype.isVertical=function(){return this.p0.x===this.p1.x};a.prototype.equals=function(n){if(!(n instanceof a))return!1;var t=n;return this.p0.equals(t.p0)&&this.p1.equals(t.p1)};a.prototype.intersection=function(n){var t=new vl;return t.computeIntersection(this.p0,this.p1,n.p0,n.p1),t.hasIntersection()?t.getIntersection(0):null};a.prototype.project=function(){var n,s,t,e,o;if(arguments[0]instanceof i)return(n=arguments[0],n.equals(this.p0)||n.equals(this.p1))?new i(n):(s=this.projectionFactor(n),t=new i,t.x=this.p0.x+s*(this.p1.x-this.p0.x),t.y=this.p0.y+s*(this.p1.y-this.p0.y),t);if(arguments[0]instanceof a){var r=arguments[0],u=this.projectionFactor(r.p0),f=this.projectionFactor(r.p1);return u>=1&&f>=1?null:u<=0&&f<=0?null:(e=this.project(r.p0),u<0&&(e=this.p0),u>1&&(e=this.p1),o=this.project(r.p1),f<0&&(o=this.p0),f>1&&(o=this.p1),new a(e,o))}};a.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()};a.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)};a.prototype.getCoordinate=function(n){return 0===n?this.p0:this.p1};a.prototype.distancePerpendicular=function(n){return o.distancePointLinePerpendicular(n,this.p0,this.p1)};a.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)};a.prototype.midPoint=function(){return a.midPoint(this.p0,this.p1)};a.prototype.projectionFactor=function(n){if(n.equals(this.p0))return 0;if(n.equals(this.p1))return 1;var t=this.p1.x-this.p0.x,i=this.p1.y-this.p0.y,r=t*t+i*i;return r<=0?it.NaN:((n.x-this.p0.x)*t+(n.y-this.p0.y)*i)/r};a.prototype.closestPoints=function(n){var u=this.intersection(n),f,e,o;if(null!==u)return[u,u];var t=new Array(2).fill(null),i=it.MAX_VALUE,r=null,s=this.closestPoint(n.p0);return i=s.distance(n.p0),t[0]=s,t[1]=n.p0,f=this.closestPoint(n.p1),(r=f.distance(n.p1))<i&&(i=r,t[0]=f,t[1]=n.p1),e=n.closestPoint(this.p0),(r=e.distance(this.p0))<i&&(i=r,t[0]=this.p0,t[1]=e),o=n.closestPoint(this.p1),(r=o.distance(this.p1))<i&&(i=r,t[0]=this.p1,t[1]=o),t};a.prototype.closestPoint=function(n){var t=this.projectionFactor(n);return t>0&&t<1?this.project(n):this.p0.distance(n)<this.p1.distance(n)?this.p0:this.p1};a.prototype.maxX=function(){return Math.max(this.p0.x,this.p1.x)};a.prototype.getLength=function(){return this.p0.distance(this.p1)};a.prototype.compareTo=function(n){var t=n,i=this.p0.compareTo(t.p0);return 0!==i?i:this.p1.compareTo(t.p1)};a.prototype.reverse=function(){var n=this.p0;this.p0=this.p1;this.p1=n};a.prototype.equalsTopo=function(n){return this.p0.equals(n.p0)&&(this.p1.equals(n.p1)||this.p0.equals(n.p1))&&this.p1.equals(n.p0)};a.prototype.lineIntersection=function(n){try{return ao.intersection(this.p0,this.p1,n.p0,n.p1)}catch(n){if(!(n instanceof ap))throw n;}return null};a.prototype.maxY=function(){return Math.max(this.p0.y,this.p1.y)};a.prototype.pointAlongOffset=function(n,t){var s=this.p0.x+n*(this.p1.x-this.p0.x),h=this.p0.y+n*(this.p1.y-this.p0.y),r=this.p1.x-this.p0.x,u=this.p1.y-this.p0.y,f=Math.sqrt(r*r+u*u),e=0,o=0;if(0!==t){if(f<=0)throw new Error("Cannot compute offset from zero-length line segment");e=t*r/f;o=t*u/f}return new i(s-o,h+e)};a.prototype.setCoordinates=function(){var n,t,i;1===arguments.length?(n=arguments[0],this.setCoordinates(n.p0,n.p1)):2===arguments.length&&(t=arguments[0],i=arguments[1],this.p0.x=t.x,this.p0.y=t.y,this.p1.x=i.x,this.p1.y=i.y)};a.prototype.segmentFraction=function(n){var t=this.projectionFactor(n);return t<0?t=0:(t>1||it.isNaN(t))&&(t=1),t};a.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"};a.prototype.isHorizontal=function(){return this.p0.y===this.p1.y};a.prototype.distance=function(){var n,t;return arguments[0]instanceof a?(n=arguments[0],o.distanceLineLine(this.p0,this.p1,n.p0,n.p1)):arguments[0]instanceof i?(t=arguments[0],o.distancePointLine(t,this.p0,this.p1)):void 0};a.prototype.pointAlong=function(n){var t=new i;return t.x=this.p0.x+n*(this.p1.x-this.p0.x),t.y=this.p0.y+n*(this.p1.y-this.p0.y),t};a.prototype.hashCode=function(){var t=it.doubleToLongBits(this.p0.x),i,n;return t^=31*it.doubleToLongBits(this.p0.y),i=Math.trunc(t)^Math.trunc(t>>32),n=it.doubleToLongBits(this.p1.x),n^=31*it.doubleToLongBits(this.p1.y),i^Math.trunc(n)^Math.trunc(n>>32)};a.prototype.interfaces_=function(){return[co,ho]};a.prototype.getClass=function(){return a};a.midPoint=function(n,t){return new i((n.x+t.x)/2,(n.y+t.y)/2)};kut.serialVersionUID.get=function(){return 0x2d2172135f411c00};Object.defineProperties(a,kut);uw=function(){this.tempEnv1=new l;this.tempEnv2=new l;this._overlapSeg1=new a;this._overlapSeg2=new a};uw.prototype.overlap=function(){if(2!==arguments.length&&4===arguments.length){var n=arguments[0],t=arguments[1],i=arguments[2],r=arguments[3];n.getLineSegment(t,this._overlapSeg1);i.getLineSegment(r,this._overlapSeg2);this.overlap(this._overlapSeg1,this._overlapSeg2)}};uw.prototype.interfaces_=function(){return[]};uw.prototype.getClass=function(){return uw};le=function(){this._pts=null;this._start=null;this._end=null;this._env=null;this._context=null;this._id=null;var n=arguments[0],t=arguments[1],i=arguments[2],r=arguments[3];this._pts=n;this._start=t;this._end=i;this._context=r};le.prototype.getLineSegment=function(n,t){t.p0=this._pts[n];t.p1=this._pts[n+1]};le.prototype.computeSelect=function(n,t,i,r){var f=this._pts[t],e=this._pts[i],u;if(r.tempEnv1.init(f,e),i-t==1)return r.select(this,t),null;if(!n.intersects(r.tempEnv1))return null;u=Math.trunc((t+i)/2);t<u&&this.computeSelect(n,t,u,r);u<i&&this.computeSelect(n,u,i,r)};le.prototype.getCoordinates=function(){for(var t=new Array(this._end-this._start+1).fill(null),i=0,n=this._start;n<=this._end;n++)t[i++]=this._pts[n];return t};le.prototype.computeOverlaps=function(n,t){this.computeOverlapsInternal(this._start,this._end,n,n._start,n._end,t)};le.prototype.setId=function(n){this._id=n};le.prototype.select=function(n,t){this.computeSelect(n,this._start,this._end,t)};le.prototype.getEnvelope=function(){if(null===this._env){var n=this._pts[this._start],t=this._pts[this._end];this._env=new l(n,t)}return this._env};le.prototype.getEndIndex=function(){return this._end};le.prototype.getStartIndex=function(){return this._start};le.prototype.getContext=function(){return this._context};le.prototype.getId=function(){return this._id};le.prototype.computeOverlapsInternal=function(n,t,i,r,u,f){var s=this._pts[n],h=this._pts[t],c=i._pts[r],l=i._pts[u],o,e;if(t-n==1&&u-r==1)return f.overlap(this,n,i,r),null;if(f.tempEnv1.init(s,h),f.tempEnv2.init(c,l),!f.tempEnv1.intersects(f.tempEnv2))return null;o=Math.trunc((n+t)/2);e=Math.trunc((r+u)/2);n<o&&(r<e&&this.computeOverlapsInternal(n,o,i,r,e,f),e<u&&this.computeOverlapsInternal(n,o,i,e,u,f));o<t&&(r<e&&this.computeOverlapsInternal(o,t,i,r,e,f),e<u&&this.computeOverlapsInternal(o,t,i,e,u,f))};le.prototype.interfaces_=function(){return[]};le.prototype.getClass=function(){return le};ps=function(){};ps.prototype.interfaces_=function(){return[]};ps.prototype.getClass=function(){return ps};ps.getChainStartIndices=function(n){var t=0,i=new e,r;i.add(new os(t));do r=ps.findChainEnd(n,t),i.add(new os(r)),t=r;while(t<n.length-1);return ps.toIntArray(i)};ps.findChainEnd=function(n,t){for(var u,r,i=t;i<n.length-1&&n[i].equals2D(n[i+1]);)i++;if(i>=n.length-1)return n.length-1;for(u=ir.quadrant(n[i],n[i+1]),r=t+1;r<n.length;){if(!n[r-1].equals2D(n[r])&&ir.quadrant(n[r-1],n[r])!==u)break;r++}return r-1};ps.getChains=function(){var i,f;if(1===arguments.length)return i=arguments[0],ps.getChains(i,null);if(2===arguments.length){for(var r=arguments[0],o=arguments[1],u=new e,t=ps.getChainStartIndices(r),n=0;n<t.length-1;n++)f=new le(r,t[n],t[n+1],o),u.add(f);return u}};ps.toIntArray=function(n){for(var i=new Array(n.size()).fill(null),t=0;t<i.length;t++)i[t]=n.get(t).intValue();return i};pl=function(){};pl.prototype.computeNodes=function(){};pl.prototype.getNodedSubstrings=function(){};pl.prototype.interfaces_=function(){return[]};pl.prototype.getClass=function(){return pl};fw=function(){if((this._segInt=null,0!==arguments.length)&&1===arguments.length){var n=arguments[0];this.setSegmentIntersector(n)}};fw.prototype.setSegmentIntersector=function(n){this._segInt=n};fw.prototype.interfaces_=function(){return[pl]};fw.prototype.getClass=function(){return fw};var dut=function(n){function t(t){t?n.call(this,t):n.call(this);this._monoChains=new e;this._index=new yvt;this._idCounter=0;this._nodedSegStrings=null;this._nOverlaps=0}n&&(t.__proto__=n);(t.prototype=Object.create(n&&n.prototype)).constructor=t;var i={SegmentOverlapAction:{configurable:!0}};return t.prototype.getMonotoneChains=function(){return this._monoChains},t.prototype.getNodedSubstrings=function(){return gr.getNodedSubstrings(this._nodedSegStrings)},t.prototype.getIndex=function(){return this._index},t.prototype.add=function(n){for(var t,i=ps.getChains(n.getCoordinates(),n).iterator();i.hasNext();)t=i.next(),t.setId(this._idCounter++),this._index.insert(t.getEnvelope(),t),this._monoChains.add(t)},t.prototype.computeNodes=function(n){this._nodedSegStrings=n;for(var t=n.iterator();t.hasNext();)this.add(t.next());this.intersectChains()},t.prototype.intersectChains=function(){for(var n,i,r,u=new wvt(this._segInt),t=this._monoChains.iterator();t.hasNext();)for(n=t.next(),i=this._index.query(n.getEnvelope()).iterator();i.hasNext();)if(r=i.next(),r.getId()>n.getId()&&(n.computeOverlaps(r,u),this._nOverlaps++),this._segInt.isDone())return null},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},i.SegmentOverlapAction.get=function(){return wvt},Object.defineProperties(t,i),t}(fw),wvt=function(n){function t(){n.call(this);this._si=null;var t=arguments[0];this._si=t}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.overlap=function(){if(4!==arguments.length)return n.prototype.overlap.apply(this,arguments);var t=arguments[0],i=arguments[1],r=arguments[2],u=arguments[3],f=t.getContext(),e=r.getContext();this._si.processIntersections(f,i,e,u)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(uw),ki=function n(){var t,i,r;if(this._quadrantSegments=n.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=n.CAP_ROUND,this._joinStyle=n.JOIN_ROUND,this._mitreLimit=n.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=n.DEFAULT_SIMPLIFY_FACTOR,0!==arguments.length)if(1===arguments.length)t=arguments[0],this.setQuadrantSegments(t);else if(2===arguments.length)i=arguments[0],r=arguments[1],this.setQuadrantSegments(i),this.setEndCapStyle(r);else if(4===arguments.length){var u=arguments[0],f=arguments[1],e=arguments[2],o=arguments[3];this.setQuadrantSegments(u);this.setEndCapStyle(f);this.setJoinStyle(e);this.setMitreLimit(o)}},dc={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}};ki.prototype.getEndCapStyle=function(){return this._endCapStyle};ki.prototype.isSingleSided=function(){return this._isSingleSided};ki.prototype.setQuadrantSegments=function(n){this._quadrantSegments=n;0===this._quadrantSegments&&(this._joinStyle=ki.JOIN_BEVEL);this._quadrantSegments<0&&(this._joinStyle=ki.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments));n<=0&&(this._quadrantSegments=1);this._joinStyle!==ki.JOIN_ROUND&&(this._quadrantSegments=ki.DEFAULT_QUADRANT_SEGMENTS)};ki.prototype.getJoinStyle=function(){return this._joinStyle};ki.prototype.setJoinStyle=function(n){this._joinStyle=n};ki.prototype.setSimplifyFactor=function(n){this._simplifyFactor=n<0?0:n};ki.prototype.getSimplifyFactor=function(){return this._simplifyFactor};ki.prototype.getQuadrantSegments=function(){return this._quadrantSegments};ki.prototype.setEndCapStyle=function(n){this._endCapStyle=n};ki.prototype.getMitreLimit=function(){return this._mitreLimit};ki.prototype.setMitreLimit=function(n){this._mitreLimit=n};ki.prototype.setSingleSided=function(n){this._isSingleSided=n};ki.prototype.interfaces_=function(){return[]};ki.prototype.getClass=function(){return ki};ki.bufferDistanceError=function(n){var t=Math.PI/2/n;return 1-Math.cos(t/2)};dc.CAP_ROUND.get=function(){return 1};dc.CAP_FLAT.get=function(){return 2};dc.CAP_SQUARE.get=function(){return 3};dc.JOIN_ROUND.get=function(){return 1};dc.JOIN_MITRE.get=function(){return 2};dc.JOIN_BEVEL.get=function(){return 3};dc.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8};dc.DEFAULT_MITRE_LIMIT.get=function(){return 5};dc.DEFAULT_SIMPLIFY_FACTOR.get=function(){return.01};Object.defineProperties(ki,dc);br=function(n){this._distanceTol=null;this._isDeleted=null;this._angleOrientation=o.COUNTERCLOCKWISE;this._inputLine=n||null};ew={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};br.prototype.isDeletable=function(n,t,i,r){var u=this._inputLine[n],f=this._inputLine[t],e=this._inputLine[i];return!!this.isConcave(u,f,e)&&!!this.isShallow(u,f,e,r)&&this.isShallowSampled(u,f,n,i,r)};br.prototype.deleteShallowConcavities=function(){for(var r,t=1,n=this.findNextNonDeletedIndex(t),i=this.findNextNonDeletedIndex(n),u=!1;i<this._inputLine.length;)r=!1,this.isDeletable(t,n,i,this._distanceTol)&&(this._isDeleted[n]=br.DELETE,r=!0,u=!0),t=r?i:n,n=this.findNextNonDeletedIndex(t),i=this.findNextNonDeletedIndex(n);return u};br.prototype.isShallowConcavity=function(n,t,i,r){return(o.computeOrientation(n,t,i)===this._angleOrientation)?o.distancePointLine(t,n,i)<r:!1};br.prototype.isShallowSampled=function(n,t,i,r,u){var e=Math.trunc((r-i)/br.NUM_PTS_TO_CHECK),f;for(e<=0&&(e=1),f=i;f<r;f+=e)if(!this.isShallow(n,t,this._inputLine[f],u))return!1;return!0};br.prototype.isConcave=function(n,t,i){return o.computeOrientation(n,t,i)===this._angleOrientation};br.prototype.simplify=function(n){this._distanceTol=Math.abs(n);n<0&&(this._angleOrientation=o.CLOCKWISE);this._isDeleted=new Array(this._inputLine.length).fill(null);var t=!1;do t=this.deleteShallowConcavities();while(t);return this.collapseLine()};br.prototype.findNextNonDeletedIndex=function(n){for(var t=n+1;t<this._inputLine.length&&this._isDeleted[t]===br.DELETE;)t++;return t};br.prototype.isShallow=function(n,t,i,r){return o.distancePointLine(t,n,i)<r};br.prototype.collapseLine=function(){for(var t=new tk,n=0;n<this._inputLine.length;n++)this._isDeleted[n]!==br.DELETE&&t.add(this._inputLine[n]);return t.toCoordinateArray()};br.prototype.interfaces_=function(){return[]};br.prototype.getClass=function(){return br};br.simplify=function(n,t){return new br(n).simplify(t)};ew.INIT.get=function(){return 0};ew.DELETE.get=function(){return 1};ew.KEEP.get=function(){return 1};ew.NUM_PTS_TO_CHECK.get=function(){return 10};Object.defineProperties(br,ew);we=function(){this._ptList=null;this._precisionModel=null;this._minimimVertexDistance=0;this._ptList=new e};gut={COORDINATE_ARRAY_TYPE:{configurable:!0}};we.prototype.getCoordinates=function(){return this._ptList.toArray(we.COORDINATE_ARRAY_TYPE)};we.prototype.setPrecisionModel=function(n){this._precisionModel=n};we.prototype.addPt=function(n){var t=new i(n);if(this._precisionModel.makePrecise(t),this.isRedundant(t))return null;this._ptList.add(t)};we.prototype.revere=function(){};we.prototype.addPts=function(n,t){var i,r;if(t)for(i=0;i<n.length;i++)this.addPt(n[i]);else for(r=n.length-1;r>=0;r--)this.addPt(n[r])};we.prototype.isRedundant=function(n){if(this._ptList.size()<1)return!1;var t=this._ptList.get(this._ptList.size()-1);return n.distance(t)<this._minimimVertexDistance};we.prototype.toString=function(){return(new ut).createLineString(this.getCoordinates()).toString()};we.prototype.closeRing=function(){if(this._ptList.size()<1)return null;var n=new i(this._ptList.get(0)),t=this._ptList.get(this._ptList.size()-1);if(n.equals(t))return null;this._ptList.add(n)};we.prototype.setMinimumVertexDistance=function(n){this._minimimVertexDistance=n};we.prototype.interfaces_=function(){return[]};we.prototype.getClass=function(){return we};gut.COORDINATE_ARRAY_TYPE.get=function(){return new Array(0).fill(null)};Object.defineProperties(we,gut);et=function(){};ka={PI_TIMES_2:{configurable:!0},PI_OVER_2:{configurable:!0},PI_OVER_4:{configurable:!0},COUNTERCLOCKWISE:{configurable:!0},CLOCKWISE:{configurable:!0},NONE:{configurable:!0}};et.prototype.interfaces_=function(){return[]};et.prototype.getClass=function(){return et};et.toDegrees=function(n){return 180*n/Math.PI};et.normalize=function(n){for(;n>Math.PI;)n-=et.PI_TIMES_2;for(;n<=-Math.PI;)n+=et.PI_TIMES_2;return n};et.angle=function(){var n;if(1===arguments.length)return n=arguments[0],Math.atan2(n.y,n.x);if(2===arguments.length){var t=arguments[0],i=arguments[1],r=i.x-t.x,u=i.y-t.y;return Math.atan2(u,r)}};et.isAcute=function(n,t,i){var r=n.x-t.x,u=n.y-t.y;return r*(i.x-t.x)+u*(i.y-t.y)>0};et.isObtuse=function(n,t,i){var r=n.x-t.x,u=n.y-t.y;return r*(i.x-t.x)+u*(i.y-t.y)<0};et.interiorAngle=function(n,t,i){var r=et.angle(t,n),u=et.angle(t,i);return Math.abs(u-r)};et.normalizePositive=function(n){if(n<0){for(;n<0;)n+=et.PI_TIMES_2;n>=et.PI_TIMES_2&&(n=0)}else{for(;n>=et.PI_TIMES_2;)n-=et.PI_TIMES_2;n<0&&(n=0)}return n};et.angleBetween=function(n,t,i){var r=et.angle(t,n),u=et.angle(t,i);return et.diff(r,u)};et.diff=function(n,t){var i=null;return(i=n<t?t-n:n-t)>Math.PI&&(i=2*Math.PI-i),i};et.toRadians=function(n){return n*Math.PI/180};et.getTurn=function(n,t){var i=Math.sin(t-n);return i>0?et.COUNTERCLOCKWISE:i<0?et.CLOCKWISE:et.NONE};et.angleBetweenOriented=function(n,t,i){var u=et.angle(t,n),r=et.angle(t,i)-u;return r<=-Math.PI?r+et.PI_TIMES_2:r>Math.PI?r-et.PI_TIMES_2:r};ka.PI_TIMES_2.get=function(){return 2*Math.PI};ka.PI_OVER_2.get=function(){return Math.PI/2};ka.PI_OVER_4.get=function(){return Math.PI/4};ka.COUNTERCLOCKWISE.get=function(){return o.COUNTERCLOCKWISE};ka.CLOCKWISE.get=function(){return o.CLOCKWISE};ka.NONE.get=function(){return o.COLLINEAR};Object.defineProperties(et,ka);hr=function n(){this._maxCurveSegmentError=0;this._filletAngleQuantum=null;this._closingSegLengthFactor=1;this._segList=null;this._distance=0;this._precisionModel=null;this._bufParams=null;this._li=null;this._s0=null;this._s1=null;this._s2=null;this._seg0=new a;this._seg1=new a;this._offset0=new a;this._offset1=new a;this._side=0;this._hasNarrowConcaveAngle=!1;var i=arguments[0],t=arguments[1],r=arguments[2];this._precisionModel=i;this._bufParams=t;this._li=new vl;this._filletAngleQuantum=Math.PI/2/t.getQuadrantSegments();t.getQuadrantSegments()>=8&&t.getJoinStyle()===ki.JOIN_ROUND&&(this._closingSegLengthFactor=n.MAX_CLOSING_SEG_LEN_FACTOR);this.init(r)};ow={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}};hr.prototype.addNextSegment=function(n,t){if(this._s0=this._s1,this._s1=this._s2,this._s2=n,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var i=o.computeOrientation(this._s0,this._s1,this._s2),r=i===o.CLOCKWISE&&this._side===f.LEFT||i===o.COUNTERCLOCKWISE&&this._side===f.RIGHT;0===i?this.addCollinear(t):r?this.addOutsideTurn(i,t):this.addInsideTurn(i,t)};hr.prototype.addLineEndCap=function(n,t){var h=new a(n,t),e=new a,u,r,c,l;this.computeOffsetSegment(h,f.LEFT,this._distance,e);u=new a;this.computeOffsetSegment(h,f.RIGHT,this._distance,u);var v=t.x-n.x,y=t.y-n.y,s=Math.atan2(y,v);switch(this._bufParams.getEndCapStyle()){case ki.CAP_ROUND:this._segList.addPt(e.p1);this.addFilletArc(t,s+Math.PI/2,s-Math.PI/2,o.CLOCKWISE,this._distance);this._segList.addPt(u.p1);break;case ki.CAP_FLAT:this._segList.addPt(e.p1);this._segList.addPt(u.p1);break;case ki.CAP_SQUARE:r=new i;r.x=Math.abs(this._distance)*Math.cos(s);r.y=Math.abs(this._distance)*Math.sin(s);c=new i(e.p1.x+r.x,e.p1.y+r.y);l=new i(u.p1.x+r.x,u.p1.y+r.y);this._segList.addPt(c);this._segList.addPt(l)}};hr.prototype.getCoordinates=function(){return this._segList.getCoordinates()};hr.prototype.addMitreJoin=function(n,t,r,u){var e=!0,f=null;try{f=ao.intersection(t.p0,t.p1,r.p0,r.p1);(u<=0?1:f.distance(n)/Math.abs(u))>this._bufParams.getMitreLimit()&&(e=!1)}catch(n){if(!(n instanceof ap))throw n;f=new i(0,0);e=!1}e?this._segList.addPt(f):this.addLimitedMitreJoin(t,r,u,this._bufParams.getMitreLimit())};hr.prototype.addFilletCorner=function(n,t,i,r,u){var s=t.x-n.x,h=t.y-n.y,f=Math.atan2(h,s),c=i.x-n.x,l=i.y-n.y,e=Math.atan2(l,c);r===o.CLOCKWISE?f<=e&&(f+=2*Math.PI):f>=e&&(f-=2*Math.PI);this._segList.addPt(t);this.addFilletArc(n,f,e,r,u);this._segList.addPt(i)};hr.prototype.addOutsideTurn=function(n,t){if(this._offset0.p1.distance(this._offset1.p0)<this._distance*hr.OFFSET_SEGMENT_SEPARATION_FACTOR)return this._segList.addPt(this._offset0.p1),null;this._bufParams.getJoinStyle()===ki.JOIN_MITRE?this.addMitreJoin(this._s1,this._offset0,this._offset1,this._distance):this._bufParams.getJoinStyle()===ki.JOIN_BEVEL?this.addBevelJoin(this._offset0,this._offset1):(t&&this._segList.addPt(this._offset0.p1),this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,n,this._distance),this._segList.addPt(this._offset1.p0))};hr.prototype.createSquare=function(n){this._segList.addPt(new i(n.x+this._distance,n.y+this._distance));this._segList.addPt(new i(n.x+this._distance,n.y-this._distance));this._segList.addPt(new i(n.x-this._distance,n.y-this._distance));this._segList.addPt(new i(n.x-this._distance,n.y+this._distance));this._segList.closeRing()};hr.prototype.addSegments=function(n,t){this._segList.addPts(n,t)};hr.prototype.addFirstSegment=function(){this._segList.addPt(this._offset1.p0)};hr.prototype.addLastSegment=function(){this._segList.addPt(this._offset1.p1)};hr.prototype.initSideSegments=function(n,t,i){this._s1=n;this._s2=t;this._side=i;this._seg1.setCoordinates(n,t);this.computeOffsetSegment(this._seg1,i,this._distance,this._offset1)};hr.prototype.addLimitedMitreJoin=function(n,t,r,u){var e=this._seg0.p1,p=et.angle(e,this._seg0.p0),s=et.angleBetweenOriented(this._seg0.p0,e,this._seg1.p1)/2,w=et.normalize(p+s),h=et.normalize(w+Math.PI),o=u*r,c=r-o*Math.abs(Math.sin(s)),b=e.x+o*Math.cos(h),k=e.y+o*Math.sin(h),d=new i(b,k),l=new a(e,d),v=l.pointAlongOffset(1,c),y=l.pointAlongOffset(1,-c);this._side===f.LEFT?(this._segList.addPt(v),this._segList.addPt(y)):(this._segList.addPt(y),this._segList.addPt(v))};hr.prototype.computeOffsetSegment=function(n,t,i,r){var o=t===f.LEFT?1:-1,u=n.p1.x-n.p0.x,e=n.p1.y-n.p0.y,s=Math.sqrt(u*u+e*e),h=o*i*u/s,c=o*i*e/s;r.p0.x=n.p0.x-c;r.p0.y=n.p0.y+h;r.p1.x=n.p1.x-c;r.p1.y=n.p1.y+h};hr.prototype.addFilletArc=function(n,t,r,u,f){var a=u===o.CLOCKWISE?-1:1,e=Math.abs(t-r),l=Math.trunc(e/this._filletAngleQuantum+.5),c;if(l<1)return null;for(var v=e/l,s=0,h=new i;s<e;)c=t+a*s,h.x=n.x+f*Math.cos(c),h.y=n.y+f*Math.sin(c),this._segList.addPt(h),s+=v};hr.prototype.addInsideTurn=function(){var n,t;(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)):(this._hasNarrowConcaveAngle=!0,this._offset0.p1.distance(this._offset1.p0)<this._distance*hr.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)?this._segList.addPt(this._offset0.p1):((this._segList.addPt(this._offset0.p1),this._closingSegLengthFactor>0)?(n=new i((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),t=new i((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(t)):this._segList.addPt(this._s1),this._segList.addPt(this._offset1.p0))};hr.prototype.createCircle=function(n){var t=new i(n.x+this._distance,n.y);this._segList.addPt(t);this.addFilletArc(n,0,2*Math.PI,-1,this._distance);this._segList.closeRing()};hr.prototype.addBevelJoin=function(n,t){this._segList.addPt(n.p1);this._segList.addPt(t.p0)};hr.prototype.init=function(n){this._distance=n;this._maxCurveSegmentError=n*(1-Math.cos(this._filletAngleQuantum/2));this._segList=new we;this._segList.setPrecisionModel(this._precisionModel);this._segList.setMinimumVertexDistance(n*hr.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)};hr.prototype.addCollinear=function(n){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2);this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===ki.JOIN_BEVEL||this._bufParams.getJoinStyle()===ki.JOIN_MITRE?(n&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,o.CLOCKWISE,this._distance))};hr.prototype.closeRing=function(){this._segList.closeRing()};hr.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle};hr.prototype.interfaces_=function(){return[]};hr.prototype.getClass=function(){return hr};ow.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return.001};ow.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return.001};ow.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6};ow.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80};Object.defineProperties(hr,ow);ie=function(){this._distance=0;this._precisionModel=null;this._bufParams=null;var n=arguments[0],t=arguments[1];this._precisionModel=n;this._bufParams=t};ie.prototype.getOffsetCurve=function(n,t){var r;if(this._distance=t,0===t)return null;var u=t<0,f=Math.abs(t),i=this.getSegGen(f);return n.length<=1?this.computePointCurve(n[0],i):this.computeOffsetCurve(n,u,i),r=i.getCoordinates(),u&&ft.reverse(r),r};ie.prototype.computeSingleSidedBufferCurve=function(n,t,i){var h=this.simplifyTolerance(this._distance),r,e,o,u,c,s;if(t)for(i.addSegments(n,!0),r=br.simplify(n,-h),e=r.length-1,i.initSideSegments(r[e],r[e-1],f.LEFT),i.addFirstSegment(),o=e-2;o>=0;o--)i.addNextSegment(r[o],!0);else for(i.addSegments(n,!1),u=br.simplify(n,h),c=u.length-1,i.initSideSegments(u[0],u[1],f.LEFT),i.addFirstSegment(),s=2;s<=c;s++)i.addNextSegment(u[s],!0);i.addLastSegment();i.closeRing()};ie.prototype.computeRingBufferCurve=function(n,t,i){var e=this.simplifyTolerance(this._distance),r,o,u,s;for(t===f.RIGHT&&(e=-e),r=br.simplify(n,e),o=r.length-1,i.initSideSegments(r[o-1],r[0],t),u=1;u<=o;u++)s=1!==u,i.addNextSegment(r[u],s);i.closeRing()};ie.prototype.computeLineBufferCurve=function(n,t){var h=this.simplifyTolerance(this._distance),r=br.simplify(n,h),s=r.length-1,u,i,e,o;for(t.initSideSegments(r[0],r[1],f.LEFT),u=2;u<=s;u++)t.addNextSegment(r[u],!0);for(t.addLastSegment(),t.addLineEndCap(r[s-1],r[s]),i=br.simplify(n,-h),e=i.length-1,t.initSideSegments(i[e],i[e-1],f.LEFT),o=e-2;o>=0;o--)t.addNextSegment(i[o],!0);t.addLastSegment();t.addLineEndCap(i[1],i[0]);t.closeRing()};ie.prototype.computePointCurve=function(n,t){switch(this._bufParams.getEndCapStyle()){case ki.CAP_ROUND:t.createCircle(n);break;case ki.CAP_SQUARE:t.createSquare(n)}};ie.prototype.getLineCurve=function(n,t){var r,i,u;return(this._distance=t,t<0&&!this._bufParams.isSingleSided())?null:0===t?null:(r=Math.abs(t),i=this.getSegGen(r),n.length<=1?this.computePointCurve(n[0],i):this._bufParams.isSingleSided()?(u=t<0,this.computeSingleSidedBufferCurve(n,u,i)):this.computeLineBufferCurve(n,i),i.getCoordinates())};ie.prototype.getBufferParameters=function(){return this._bufParams};ie.prototype.simplifyTolerance=function(n){return n*this._bufParams.getSimplifyFactor()};ie.prototype.getRingCurve=function(n,t,i){if(this._distance=i,n.length<=2)return this.getLineCurve(n,i);if(0===i)return ie.copyCoordinates(n);var r=this.getSegGen(i);return this.computeRingBufferCurve(n,t,r),r.getCoordinates()};ie.prototype.computeOffsetCurve=function(n,t,i){var h=this.simplifyTolerance(this._distance),r,e,o,u,c,s;if(t)for(r=br.simplify(n,-h),e=r.length-1,i.initSideSegments(r[e],r[e-1],f.LEFT),i.addFirstSegment(),o=e-2;o>=0;o--)i.addNextSegment(r[o],!0);else for(u=br.simplify(n,h),c=u.length-1,i.initSideSegments(u[0],u[1],f.LEFT),i.addFirstSegment(),s=2;s<=c;s++)i.addNextSegment(u[s],!0);i.addLastSegment()};ie.prototype.getSegGen=function(n){return new hr(this._precisionModel,this._bufParams,n)};ie.prototype.interfaces_=function(){return[]};ie.prototype.getClass=function(){return ie};ie.copyCoordinates=function(n){for(var r=new Array(n.length).fill(null),t=0;t<r.length;t++)r[t]=new i(n[t]);return r};da=function(){this._subgraphs=null;this._seg=new a;this._cga=new o;var n=arguments[0];this._subgraphs=n};nft={DepthSegment:{configurable:!0}};da.prototype.findStabbedSegments=function(){var s,h,l,p,a;if(1===arguments.length){for(var u=arguments[0],v=new e,y=this._subgraphs.iterator();y.hasNext();)s=y.next(),h=s.getEnvelope(),u.y<h.getMinY()||u.y>h.getMaxY()||this.findStabbedSegments(u,s.getDirectedEdges(),v);return v}if(3===arguments.length)if(k(arguments[2],vo)&&arguments[0]instanceof i&&arguments[1]instanceof on)for(var t=arguments[0],c=arguments[1],b=arguments[2],r=c.getEdge().getCoordinates(),n=0;n<r.length-1;n++)this._seg.p0=r[n],this._seg.p1=r[n+1],this._seg.p0.y>this._seg.p1.y&&this._seg.reverse(),Math.max(this._seg.p0.x,this._seg.p1.x)<t.x||this._seg.isHorizontal()||t.y<this._seg.p0.y||t.y>this._seg.p1.y||o.computeOrientation(this._seg.p0,this._seg.p1,t)===o.RIGHT||(l=c.getDepth(f.LEFT),this._seg.p0.equals(r[n])||(l=c.getDepth(f.RIGHT)),p=new wl(this._seg,l),b.add(p));else if(k(arguments[2],vo)&&arguments[0]instanceof i&&k(arguments[1],vo))for(var d=arguments[0],g=arguments[1],nt=arguments[2],w=g.iterator();w.hasNext();)a=w.next(),a.isForward()&&this.findStabbedSegments(d,a,nt)};da.prototype.getDepth=function(n){var t=this.findStabbedSegments(n);return 0===t.size()?0:go.min(t)._leftDepth};da.prototype.interfaces_=function(){return[]};da.prototype.getClass=function(){return da};nft.DepthSegment.get=function(){return wl};Object.defineProperties(da,nft);wl=function(){this._upwardSeg=null;this._leftDepth=null;var n=arguments[0],t=arguments[1];this._upwardSeg=new a(n);this._leftDepth=t};wl.prototype.compareTo=function(n){var t=n,i;return this._upwardSeg.minX()>=t._upwardSeg.maxX()?1:this._upwardSeg.maxX()<=t._upwardSeg.minX()?-1:(i=this._upwardSeg.orientationIndex(t._upwardSeg),0!==i?i:0!=(i=-1*t._upwardSeg.orientationIndex(this._upwardSeg))?i:this._upwardSeg.compareTo(t._upwardSeg))};wl.prototype.compareX=function(n,t){var i=n.p0.compareTo(t.p0);return 0!==i?i:n.p1.compareTo(t.p1)};wl.prototype.toString=function(){return this._upwardSeg.toString()};wl.prototype.interfaces_=function(){return[co]};wl.prototype.getClass=function(){return wl};pi=function(n,t,i){this.p0=n||null;this.p1=t||null;this.p2=i||null};pi.prototype.area=function(){return pi.area(this.p0,this.p1,this.p2)};pi.prototype.signedArea=function(){return pi.signedArea(this.p0,this.p1,this.p2)};pi.prototype.interpolateZ=function(n){if(null===n)throw new ar("Supplied point is null.");return pi.interpolateZ(n,this.p0,this.p1,this.p2)};pi.prototype.longestSideLength=function(){return pi.longestSideLength(this.p0,this.p1,this.p2)};pi.prototype.isAcute=function(){return pi.isAcute(this.p0,this.p1,this.p2)};pi.prototype.circumcentre=function(){return pi.circumcentre(this.p0,this.p1,this.p2)};pi.prototype.area3D=function(){return pi.area3D(this.p0,this.p1,this.p2)};pi.prototype.centroid=function(){return pi.centroid(this.p0,this.p1,this.p2)};pi.prototype.inCentre=function(){return pi.inCentre(this.p0,this.p1,this.p2)};pi.prototype.interfaces_=function(){return[]};pi.prototype.getClass=function(){return pi};pi.area=function(n,t,i){return Math.abs(((i.x-n.x)*(t.y-n.y)-(t.x-n.x)*(i.y-n.y))/2)};pi.signedArea=function(n,t,i){return((i.x-n.x)*(t.y-n.y)-(t.x-n.x)*(i.y-n.y))/2};pi.det=function(n,t,i,r){return n*r-t*i};pi.interpolateZ=function(n,t,i,r){var u=t.x,f=t.y,e=i.x-u,o=r.x-u,s=i.y-f,h=r.y-f,c=e*h-o*s,l=n.x-u,a=n.y-f,v=(h*l-o*a)/c,y=(-s*l+e*a)/c;return t.z+v*(i.z-t.z)+y*(r.z-t.z)};pi.longestSideLength=function(n,t,i){var e=n.distance(t),u=t.distance(i),f=i.distance(n),r=e;return u>r&&(r=u),f>r&&(r=f),r};pi.isAcute=function(n,t,i){return!!et.isAcute(n,t,i)&&!!et.isAcute(t,i,n)&&!!et.isAcute(i,n,t)};pi.circumcentre=function(n,t,r){var s=r.x,h=r.y,u=n.x-s,f=n.y-h,e=t.x-s,o=t.y-h,c=2*pi.det(u,f,e,o),l=pi.det(f,u*u+f*f,o,e*e+o*o),a=pi.det(u,u*u+f*f,e,e*e+o*o);return new i(s-l/c,h+a/c)};pi.perpendicularBisector=function(n,t){var i=t.x-n.x,r=t.y-n.y,u=new ao(n.x+i/2,n.y+r/2,1),f=new ao(n.x-r+i/2,n.y+i+r/2,1);return new ao(u,f)};pi.angleBisector=function(n,t,r){var u=t.distance(n),f=u/(u+t.distance(r)),e=r.x-n.x,o=r.y-n.y;return new i(n.x+f*e,n.y+f*o)};pi.area3D=function(n,t,i){var r=t.x-n.x,u=t.y-n.y,f=t.z-n.z,e=i.x-n.x,o=i.y-n.y,s=i.z-n.z,h=u*s-f*o,c=f*e-r*s,l=r*o-u*e,a=h*h+c*c+l*l;return Math.sqrt(a)/2};pi.centroid=function(n,t,r){var u=(n.x+t.x+r.x)/3,f=(n.y+t.y+r.y)/3;return new i(u,f)};pi.inCentre=function(n,t,r){var u=t.distance(r),f=n.distance(r),e=n.distance(t),o=u+f+e,s=(u*n.x+f*t.x+e*r.x)/o,h=(u*n.y+f*t.y+e*r.y)/o;return new i(s,h)};eo=function(){this._inputGeom=null;this._distance=null;this._curveBuilder=null;this._curveList=new e;var n=arguments[0],t=arguments[1],i=arguments[2];this._inputGeom=n;this._distance=t;this._curveBuilder=i};eo.prototype.addPoint=function(n){if(this._distance<=0)return null;var t=n.getCoordinates(),i=this._curveBuilder.getLineCurve(t,this._distance);this.addCurve(i,r.EXTERIOR,r.INTERIOR)};eo.prototype.addPolygon=function(n){var i=this._distance,u=f.LEFT,e,o,t,s,h;if((this._distance<0&&(i=-this._distance,u=f.RIGHT),e=n.getExteriorRing(),o=ft.removeRepeatedPoints(e.getCoordinates()),this._distance<0&&this.isErodedCompletely(e,this._distance))||this._distance<=0&&o.length<3)return null;for(this.addPolygonRing(o,i,u,r.EXTERIOR,r.INTERIOR),t=0;t<n.getNumInteriorRing();t++)s=n.getInteriorRingN(t),h=ft.removeRepeatedPoints(s.getCoordinates()),this._distance>0&&this.isErodedCompletely(s,-this._distance)||this.addPolygonRing(h,i,f.opposite(u),r.INTERIOR,r.EXTERIOR)};eo.prototype.isTriangleErodedCompletely=function(n,t){var i=new pi(n[0],n[1],n[2]),r=i.inCentre();return o.distancePointLine(r,i.p0,i.p1)<Math.abs(t)};eo.prototype.addLineString=function(n){if(this._distance<=0&&!this._curveBuilder.getBufferParameters().isSingleSided())return null;var t=ft.removeRepeatedPoints(n.getCoordinates()),i=this._curveBuilder.getLineCurve(t,this._distance);this.addCurve(i,r.EXTERIOR,r.INTERIOR)};eo.prototype.addCurve=function(n,t,i){if(null===n||n.length<2)return null;var u=new gr(n,new di(0,r.BOUNDARY,t,i));this._curveList.add(u)};eo.prototype.getCurves=function(){return this.add(this._inputGeom),this._curveList};eo.prototype.addPolygonRing=function(n,t,i,r,u){var e,s,h;if(0===t&&n.length<dh.MINIMUM_VALID_SIZE)return null;e=r;s=u;n.length>=dh.MINIMUM_VALID_SIZE&&o.isCCW(n)&&(e=u,s=r,i=f.opposite(i));h=this._curveBuilder.getRingCurve(n,i,t);this.addCurve(h,e,s)};eo.prototype.add=function(n){if(n.isEmpty())return null;n instanceof cu?this.addPolygon(n):n instanceof wr?this.addLineString(n):n instanceof se?this.addPoint(n):n instanceof bp?this.addCollection(n):n instanceof pa?this.addCollection(n):n instanceof gh?this.addCollection(n):n instanceof te&&this.addCollection(n)};eo.prototype.isErodedCompletely=function(n,t){var i=n.getCoordinates(),r,u;return i.length<4?t<0:4===i.length?this.isTriangleErodedCompletely(i,t):(r=n.getEnvelopeInternal(),u=Math.min(r.getHeight(),r.getWidth()),t<0&&2*Math.abs(t)>u)};eo.prototype.addCollection=function(n){for(var i,t=0;t<n.getNumGeometries();t++)i=n.getGeometryN(t),this.add(i)};eo.prototype.interfaces_=function(){return[]};eo.prototype.getClass=function(){return eo};uy=function(){};uy.prototype.locate=function(){};uy.prototype.interfaces_=function(){return[]};uy.prototype.getClass=function(){return uy};eh=function(){this._parent=null;this._atStart=null;this._max=null;this._index=null;this._subcollectionIterator=null;var n=arguments[0];this._parent=n;this._atStart=!0;this._index=0;this._max=n.getNumGeometries()};eh.prototype.next=function(){if(this._atStart)return this._atStart=!1,eh.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 pb;var n=this._parent.getGeometryN(this._index++);return n instanceof te?(this._subcollectionIterator=new eh(n),this._subcollectionIterator.next()):n};eh.prototype.remove=function(){throw new Error(this.getClass().getName());};eh.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)};eh.prototype.interfaces_=function(){return[gv]};eh.prototype.getClass=function(){return eh};eh.isAtomic=function(n){return!(n instanceof te)};be=function(){this._geom=null;var n=arguments[0];this._geom=n};be.prototype.locate=function(n){return be.locate(n,this._geom)};be.prototype.interfaces_=function(){return[uy]};be.prototype.getClass=function(){return be};be.isPointInRing=function(n,t){return!!t.getEnvelopeInternal().intersects(n)&&o.isPointInRing(n,t.getCoordinates())};be.containsPointInPolygon=function(n,t){var r,i,u;if(t.isEmpty()||(r=t.getExteriorRing(),!be.isPointInRing(n,r)))return!1;for(i=0;i<t.getNumInteriorRing();i++)if(u=t.getInteriorRingN(i),be.isPointInRing(n,u))return!1;return!0};be.containsPoint=function(n,t){var i,r;if(t instanceof cu)return be.containsPointInPolygon(n,t);if(t instanceof te)for(i=new eh(t);i.hasNext();)if(r=i.next(),r!==t&&be.containsPoint(n,r))return!0;return!1};be.locate=function(n,t){return t.isEmpty()?r.EXTERIOR:be.containsPoint(n,t)?r.INTERIOR:r.EXTERIOR};ff=function(){this._edgeMap=new df;this._edgeList=null;this._ptInAreaLocation=[r.NONE,r.NONE]};ff.prototype.getNextCW=function(n){this.getEdges();var t=this._edgeList.indexOf(n),i=t-1;return 0===t&&(i=this._edgeList.size()-1),this._edgeList.get(i)};ff.prototype.propagateSideLabels=function(n){for(var e,i,h,o,t,c,l,u=r.NONE,s=this.iterator();s.hasNext();)e=s.next().getLabel(),e.isArea(n)&&e.getLocation(n,f.LEFT)!==r.NONE&&(u=e.getLocation(n,f.LEFT));if(u===r.NONE)return null;for(i=u,h=this.iterator();h.hasNext();)if(o=h.next(),t=o.getLabel(),t.getLocation(n,f.ON)===r.NONE&&t.setLocation(n,f.ON,i),t.isArea(n))if(c=t.getLocation(n,f.LEFT),l=t.getLocation(n,f.RIGHT),l!==r.NONE){if(l!==i)throw new nc("side location conflict",o.getCoordinate());c===r.NONE&&rt.shouldNeverReachHere("found single null side (at "+o.getCoordinate()+")");i=c}else rt.isTrue(t.getLocation(n,f.LEFT)===r.NONE,"found single null side"),t.setLocation(n,f.RIGHT,i),t.setLocation(n,f.LEFT,i)};ff.prototype.getCoordinate=function(){var n=this.iterator();return n.hasNext()?n.next().getCoordinate():null};ff.prototype.print=function(n){rf.out.println("EdgeEndStar:   "+this.getCoordinate());for(var t=this.iterator();t.hasNext();)t.next().print(n)};ff.prototype.isAreaLabelsConsistent=function(n){return this.computeEdgeEndLabels(n.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)};ff.prototype.checkAreaLabelsConsistent=function(n){var i=this.getEdges(),c,u,e,o,t,s,h;if(i.size()<=0)return!0;for(c=i.size()-1,u=i.get(c).getLabel().getLocation(n,f.LEFT),rt.isTrue(u!==r.NONE,"Found unlabelled area edge"),e=u,o=this.iterator();o.hasNext();){if((t=o.next().getLabel(),rt.isTrue(t.isArea(n),"Found non-area edge"),s=t.getLocation(n,f.LEFT),h=t.getLocation(n,f.RIGHT),s===h)||h!==e)return!1;e=s}return!0};ff.prototype.findIndex=function(n){this.iterator();for(var t=0;t<this._edgeList.size();t++)if(this._edgeList.get(t)===n)return t;return-1};ff.prototype.iterator=function(){return this.getEdges().iterator()};ff.prototype.getEdges=function(){return null===this._edgeList&&(this._edgeList=new e(this._edgeMap.values())),this._edgeList};ff.prototype.getLocation=function(n,t,i){return this._ptInAreaLocation[n]===r.NONE&&(this._ptInAreaLocation[n]=be.locate(t,i[n].getGeometry())),this._ptInAreaLocation[n]};ff.prototype.toString=function(){var n=new es,t,i;for(n.append("EdgeEndStar:   "+this.getCoordinate()),n.append("\n"),t=this.iterator();t.hasNext();)i=t.next(),n.append(i),n.append("\n");return n.toString()};ff.prototype.computeEdgeEndLabels=function(n){for(var t=this.iterator();t.hasNext();)t.next().computeLabel(n)};ff.prototype.computeLabelling=function(n){var f,e,o,t,s,u,l;for(this.computeEdgeEndLabels(n[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1),f=[!1,!1],e=this.iterator();e.hasNext();)for(o=e.next().getLabel(),t=0;t<2;t++)o.isLine(t)&&o.getLocation(t)===r.BOUNDARY&&(f[t]=!0);for(s=this.iterator();s.hasNext();)for(var h=s.next(),c=h.getLabel(),i=0;i<2;i++)c.isAnyNull(i)&&(u=r.NONE,f[i]?u=r.EXTERIOR:(l=h.getCoordinate(),u=this.getLocation(i,l,n)),c.setAllLocationsIfNull(i,u))};ff.prototype.getDegree=function(){return this._edgeMap.size()};ff.prototype.insertEdgeEnd=function(n,t){this._edgeMap.put(n,t);this._edgeList=null};ff.prototype.interfaces_=function(){return[]};ff.prototype.getClass=function(){return ff};var ckt=function(n){function t(){n.call(this);this._resultAreaEdgeList=null;this._label=null;this._SCANNING_FOR_INCOMING=1;this._LINKING_TO_OUTGOING=2}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.linkResultDirectedEdges=function(){var n,f;this.getResultAreaEdges();for(var t=null,r=null,i=this._SCANNING_FOR_INCOMING,u=0;u<this._resultAreaEdgeList.size();u++)if(n=this._resultAreaEdgeList.get(u),f=n.getSym(),n.getLabel().isArea())switch(null===t&&n.isInResult()&&(t=n),i){case this._SCANNING_FOR_INCOMING:if(!f.isInResult())continue;r=f;i=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(!n.isInResult())continue;r.setNext(n);i=this._SCANNING_FOR_INCOMING}if(i===this._LINKING_TO_OUTGOING){if(null===t)throw new nc("no outgoing dirEdge found",this.getCoordinate());rt.isTrue(t.isInResult(),"unable to link last incoming dirEdge");r.setNext(t)}},t.prototype.insert=function(n){var t=n;this.insertEdgeEnd(t,t)},t.prototype.getRightmostEdge=function(){var i=this.getEdges(),r=i.size(),n;if(r<1)return null;if(n=i.get(0),1===r)return n;var t=i.get(r-1),u=n.getQuadrant(),f=t.getQuadrant();return ir.isNorthern(u)&&ir.isNorthern(f)?n:ir.isNorthern(u)||ir.isNorthern(f)?0!==n.getDy()?n:0!==t.getDy()?t:(rt.shouldNeverReachHere("found two horizontal edges incident on node"),null):t},t.prototype.print=function(n){var t,i;for(rf.out.println("DirectedEdgeStar: "+this.getCoordinate()),t=this.iterator();t.hasNext();)i=t.next(),n.print("out "),i.print(n),n.println(),n.print("in "),i.getSym().print(n),n.println()},t.prototype.getResultAreaEdges=function(){var t,n;if(null!==this._resultAreaEdgeList)return this._resultAreaEdgeList;for(this._resultAreaEdgeList=new e,t=this.iterator();t.hasNext();)n=t.next(),(n.isInResult()||n.getSym().isInResult())&&this._resultAreaEdgeList.add(n);return this._resultAreaEdgeList},t.prototype.updateLabelling=function(n){for(var i,t=this.iterator();t.hasNext();)i=t.next().getLabel(),i.setAllLocationsIfNull(0,n.getLocation(0)),i.setAllLocationsIfNull(1,n.getLocation(1))},t.prototype.linkAllDirectedEdges=function(){var r,u;this.getEdges();for(var n=null,t=null,i=this._edgeList.size()-1;i>=0;i--)r=this._edgeList.get(i),u=r.getSym(),null===t&&(t=u),null!==n&&u.setNext(n),n=r;t.setNext(n)},t.prototype.computeDepths=function(){var r;if(1===arguments.length){var n=arguments[0],u=this.findIndex(n),e=n.getDepth(f.LEFT),o=n.getDepth(f.RIGHT),s=this.computeDepths(u+1,this._edgeList.size(),e);if(this.computeDepths(0,u,s)!==o)throw new nc("depth mismatch at "+n.getCoordinate());}else if(3===arguments.length){for(var h=arguments[0],c=arguments[1],t=arguments[2],i=h;i<c;i++)r=this._edgeList.get(i),r.setEdgeDepths(f.RIGHT,t),t=r.getDepth(f.LEFT);return t}},t.prototype.mergeSymLabels=function(){for(var t,n=this.iterator();n.hasNext();)t=n.next(),t.getLabel().merge(t.getSym().getLabel())},t.prototype.linkMinimalDirectedEdges=function(n){for(var t,e,i=null,u=null,r=this._SCANNING_FOR_INCOMING,f=this._resultAreaEdgeList.size()-1;f>=0;f--){t=this._resultAreaEdgeList.get(f);e=t.getSym();switch(null===i&&t.getEdgeRing()===n&&(i=t),r){case this._SCANNING_FOR_INCOMING:if(e.getEdgeRing()!==n)continue;u=e;r=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(t.getEdgeRing()!==n)continue;u.setNextMin(t);r=this._SCANNING_FOR_INCOMING}}r===this._LINKING_TO_OUTGOING&&(rt.isTrue(null!==i,"found null for first outgoing dirEdge"),rt.isTrue(i.getEdgeRing()===n,"unable to link last incoming dirEdge"),u.setNextMin(i))},t.prototype.getOutgoingDegree=function(){var n,t;if(0===arguments.length){for(n=0,t=this.iterator();t.hasNext();)t.next().isInResult()&&n++;return n}if(1===arguments.length){for(var u=arguments[0],i=0,r=this.iterator();r.hasNext();)r.next().getEdgeRing()===u&&i++;return i}},t.prototype.getLabel=function(){return this._label},t.prototype.findCoveredLineEdges=function(){for(var i,o,u,e,t,s,n=r.NONE,f=this.iterator();f.hasNext();)if(i=f.next(),o=i.getSym(),!i.isLineEdge()){if(i.isInResult()){n=r.INTERIOR;break}if(o.isInResult()){n=r.EXTERIOR;break}}if(n===r.NONE)return null;for(u=n,e=this.iterator();e.hasNext();)t=e.next(),s=t.getSym(),t.isLineEdge()?t.getEdge().setCovered(u===r.INTERIOR):(t.isInResult()&&(u=r.EXTERIOR),s.isInResult()&&(u=r.INTERIOR))},t.prototype.computeLabelling=function(t){var u,e,i,f;for(n.prototype.computeLabelling.call(this,t),this._label=new di(r.NONE),u=this.iterator();u.hasNext();)for(e=u.next().getEdge().getLabel(),i=0;i<2;i++)f=e.getLocation(i),f!==r.INTERIOR&&f!==r.BOUNDARY||this._label.setLocation(i,r.INTERIOR)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(ff),bvt=function(n){function t(){n.apply(this,arguments)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.createNode=function(n){return new ok(n,new ckt)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(ty),bl=function n(){this._pts=null;this._orientation=null;var t=arguments[0];this._pts=t;this._orientation=n.orientation(t)};bl.prototype.compareTo=function(n){var t=n;return bl.compareOriented(this._pts,this._orientation,t._pts,t._orientation)};bl.prototype.interfaces_=function(){return[co]};bl.prototype.getClass=function(){return bl};bl.orientation=function(n){return 1===ft.increasingDirection(n)};bl.compareOriented=function(n,t,i,r){for(var e,u,f,h=t?1:-1,c=r?1:-1,l=t?n.length:-1,a=r?i.length:-1,o=t?0:n.length-1,s=r?0:i.length-1;;){if(e=n[o].compareTo(i[s]),0!==e)return e;if(u=(o+=h)===l,f=(s+=c)===a,u&&!f)return-1;if(!u&&f)return 1;if(u&&f)return 0}};ns=function(){this._edges=new e;this._ocaMap=new df};ns.prototype.print=function(n){var i,u,r,t;for(n.print("MULTILINESTRING ( "),i=0;i<this._edges.size();i++){for(u=this._edges.get(i),i>0&&n.print(","),n.print("("),r=u.getCoordinates(),t=0;t<r.length;t++)t>0&&n.print(","),n.print(r[t].x+" "+r[t].y);n.println(")")}n.print(")  ")};ns.prototype.addAll=function(n){for(var t=n.iterator();t.hasNext();)this.add(t.next())};ns.prototype.findEdgeIndex=function(n){for(var t=0;t<this._edges.size();t++)if(this._edges.get(t).equals(n))return t;return-1};ns.prototype.iterator=function(){return this._edges.iterator()};ns.prototype.getEdges=function(){return this._edges};ns.prototype.get=function(n){return this._edges.get(n)};ns.prototype.findEqualEdge=function(n){var t=new bl(n.getCoordinates());return this._ocaMap.get(t)};ns.prototype.add=function(n){this._edges.add(n);var t=new bl(n.getCoordinates());this._ocaMap.put(t,n)};ns.prototype.interfaces_=function(){return[]};ns.prototype.getClass=function(){return ns};kl=function(){};kl.prototype.processIntersections=function(){};kl.prototype.isDone=function(){};kl.prototype.interfaces_=function(){return[]};kl.prototype.getClass=function(){return kl};ke=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 n=arguments[0];this._li=n};ke.prototype.isTrivialIntersection=function(n,t,i,r){if(n===i&&1===this._li.getIntersectionNum()){if(ke.isAdjacentSegments(t,r))return!0;if(n.isClosed()){var u=n.size()-1;if(0===t&&r===u||0===r&&t===u)return!0}}return!1};ke.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint};ke.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior};ke.prototype.getLineIntersector=function(){return this._li};ke.prototype.hasProperIntersection=function(){return this._hasProper};ke.prototype.processIntersections=function(n,t,i,r){if(n===i&&t===r)return null;this.numTests++;var u=n.getCoordinates()[t],f=n.getCoordinates()[t+1],e=i.getCoordinates()[r],o=i.getCoordinates()[r+1];this._li.computeIntersection(u,f,e,o);this._li.hasIntersection()&&(this.numIntersections++,this._li.isInteriorIntersection()&&(this.numInteriorIntersections++,this._hasInterior=!0),this.isTrivialIntersection(n,t,i,r)||(this._hasIntersection=!0,n.addIntersections(this._li,t,0),i.addIntersections(this._li,r,1),this._li.isProper()&&(this.numProperIntersections++,this._hasProper=!0,this._hasProperInterior=!0)))};ke.prototype.hasIntersection=function(){return this._hasIntersection};ke.prototype.isDone=function(){return!1};ke.prototype.hasInteriorIntersection=function(){return this._hasInterior};ke.prototype.interfaces_=function(){return[kl]};ke.prototype.getClass=function(){return ke};ke.isAdjacentSegments=function(n,t){return 1===Math.abs(n-t)};ws=function(){this.coord=null;this.segmentIndex=null;this.dist=null;var n=arguments[0],t=arguments[1],r=arguments[2];this.coord=new i(n);this.segmentIndex=t;this.dist=r};ws.prototype.getSegmentIndex=function(){return this.segmentIndex};ws.prototype.getCoordinate=function(){return this.coord};ws.prototype.print=function(n){n.print(this.coord);n.print(" seg # = "+this.segmentIndex);n.println(" dist = "+this.dist)};ws.prototype.compareTo=function(n){var t=n;return this.compare(t.segmentIndex,t.dist)};ws.prototype.isEndPoint=function(n){return 0===this.segmentIndex&&0===this.dist||this.segmentIndex===n};ws.prototype.toString=function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist};ws.prototype.getDistance=function(){return this.dist};ws.prototype.compare=function(n,t){return this.segmentIndex<n?-1:this.segmentIndex>n?1:this.dist<t?-1:this.dist>t?1:0};ws.prototype.interfaces_=function(){return[co]};ws.prototype.getClass=function(){return ws};oh=function(){this._nodeMap=new df;this.edge=null;var n=arguments[0];this.edge=n};oh.prototype.print=function(n){n.println("Intersections:");for(var t=this.iterator();t.hasNext();)t.next().print(n)};oh.prototype.iterator=function(){return this._nodeMap.values().iterator()};oh.prototype.addSplitEdges=function(n){var t,i,r,u;for(this.addEndpoints(),t=this.iterator(),i=t.next();t.hasNext();)r=t.next(),u=this.createSplitEdge(i,r),n.add(u),i=r};oh.prototype.addEndpoints=function(){var n=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0);this.add(this.edge.pts[n],n,0)};oh.prototype.createSplitEdge=function(n,t){var e=t.segmentIndex-n.segmentIndex+2,s=this.edge.pts[t.segmentIndex],o=t.dist>0||!t.coord.equals2D(s),r,u,f;for(o||e--,r=new Array(e).fill(null),u=0,r[u++]=new i(n.coord),f=n.segmentIndex+1;f<=t.segmentIndex;f++)r[u++]=this.edge.pts[f];return o&&(r[u]=t.coord),new hk(r,new di(this.edge._label))};oh.prototype.add=function(n,t,i){var r=new ws(n,t,i),u=this._nodeMap.get(r);return null!==u?u:(this._nodeMap.put(r,r),r)};oh.prototype.isIntersection=function(n){for(var t=this.iterator();t.hasNext();)if(t.next().coord.equals(n))return!0;return!1};oh.prototype.interfaces_=function(){return[]};oh.prototype.getClass=function(){return oh};dl=function(){};dl.prototype.getChainStartIndices=function(n){var t=0,i=new e,r;i.add(new os(t));do r=this.findChainEnd(n,t),i.add(new os(r)),t=r;while(t<n.length-1);return dl.toIntArray(i)};dl.prototype.findChainEnd=function(n,t){for(var r=ir.quadrant(n[t],n[t+1]),i=t+1;i<n.length;){if(ir.quadrant(n[i-1],n[i])!==r)break;i++}return i-1};dl.prototype.interfaces_=function(){return[]};dl.prototype.getClass=function(){return dl};dl.toIntArray=function(n){for(var i=new Array(n.size()).fill(null),t=0;t<i.length;t++)i[t]=n.get(t).intValue();return i};ic=function(){var n,t;this.e=null;this.pts=null;this.startIndex=null;this.env1=new l;this.env2=new l;n=arguments[0];this.e=n;this.pts=n.getCoordinates();t=new dl;this.startIndex=t.getChainStartIndices(this.pts)};ic.prototype.getCoordinates=function(){return this.pts};ic.prototype.getMaxX=function(n){var t=this.pts[this.startIndex[n]].x,i=this.pts[this.startIndex[n+1]].x;return t>i?t:i};ic.prototype.getMinX=function(n){var t=this.pts[this.startIndex[n]].x,i=this.pts[this.startIndex[n+1]].x;return t<i?t:i};ic.prototype.computeIntersectsForChain=function(){var f,n;if(4===arguments.length){var h=arguments[0],s=arguments[1],c=arguments[2],l=arguments[3];this.computeIntersectsForChain(this.startIndex[h],this.startIndex[h+1],s,s.startIndex[c],s.startIndex[c+1],l)}else if(6===arguments.length){var i=arguments[0],e=arguments[1],r=arguments[2],t=arguments[3],u=arguments[4],o=arguments[5],a=this.pts[i],v=this.pts[e],y=r.pts[t],p=r.pts[u];if(e-i==1&&u-t==1)return o.addIntersections(this.e,i,r.e,t),null;if(this.env1.init(a,v),this.env2.init(y,p),!this.env1.intersects(this.env2))return null;f=Math.trunc((i+e)/2);n=Math.trunc((t+u)/2);i<f&&(t<n&&this.computeIntersectsForChain(i,f,r,t,n,o),n<u&&this.computeIntersectsForChain(i,f,r,n,u,o));f<e&&(t<n&&this.computeIntersectsForChain(f,e,r,t,n,o),n<u&&this.computeIntersectsForChain(f,e,r,n,u,o))}};ic.prototype.getStartIndexes=function(){return this.startIndex};ic.prototype.computeIntersects=function(n,t){for(var r,i=0;i<this.startIndex.length-1;i++)for(r=0;r<n.startIndex.length-1;r++)this.computeIntersectsForChain(i,n,r,t)};ic.prototype.interfaces_=function(){return[]};ic.prototype.getClass=function(){return ic};wu=function n(){var t,i;for(this._depth=Array(2).fill().map(function(){return Array(3)}),t=0;t<2;t++)for(i=0;i<3;i++)this._depth[t][i]=n.NULL_VALUE};tft={NULL_VALUE:{configurable:!0}};wu.prototype.getDepth=function(n,t){return this._depth[n][t]};wu.prototype.setDepth=function(n,t,i){this._depth[n][t]=i};wu.prototype.isNull=function(){var n,t,i,r,u;if(0===arguments.length){for(n=0;n<2;n++)for(t=0;t<3;t++)if(this._depth[n][t]!==wu.NULL_VALUE)return!1;return!0}return 1===arguments.length?(i=arguments[0],this._depth[i][1]===wu.NULL_VALUE):2===arguments.length?(r=arguments[0],u=arguments[1],this._depth[r][u]===wu.NULL_VALUE):void 0};wu.prototype.normalize=function(){for(var t,i,r,n=0;n<2;n++)if(!this.isNull(n))for(t=this._depth[n][1],this._depth[n][2]<t&&(t=this._depth[n][2]),t<0&&(t=0),i=1;i<3;i++)r=0,this._depth[n][i]>t&&(r=1),this._depth[n][i]=r};wu.prototype.getDelta=function(n){return this._depth[n][f.RIGHT]-this._depth[n][f.LEFT]};wu.prototype.getLocation=function(n,t){return this._depth[n][t]<=0?r.EXTERIOR:r.INTERIOR};wu.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]};wu.prototype.add=function(){var u,n,t,i,f,e;if(1===arguments.length)for(u=arguments[0],n=0;n<2;n++)for(t=1;t<3;t++)i=u.getLocation(n,t),i!==r.EXTERIOR&&i!==r.INTERIOR||(this.isNull(n,t)?this._depth[n][t]=wu.depthAtLocation(i):this._depth[n][t]+=wu.depthAtLocation(i));else 3===arguments.length&&(f=arguments[0],e=arguments[1],arguments[2]===r.INTERIOR&&this._depth[f][e]++)};wu.prototype.interfaces_=function(){return[]};wu.prototype.getClass=function(){return wu};wu.depthAtLocation=function(n){return n===r.EXTERIOR?0:n===r.INTERIOR?1:wu.NULL_VALUE};tft.NULL_VALUE.get=function(){return-1};Object.defineProperties(wu,tft);hk=function(n){function t(){var i,r,u;(n.call(this),this.pts=null,this._env=null,this.eiList=new oh(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new wu,this._depthDelta=0,1===arguments.length)?(i=arguments[0],t.call(this,i,null)):2===arguments.length&&(r=arguments[0],u=arguments[1],this.pts=r,this._label=u)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getDepth=function(){return this._depth},t.prototype.getCollapsedEdge=function(){var n=new Array(2).fill(null);return n[0]=this.pts[0],n[1]=this.pts[1],new t(n,di.toLineLabel(this._label))},t.prototype.isIsolated=function(){return this._isIsolated},t.prototype.getCoordinates=function(){return this.pts},t.prototype.setIsolated=function(n){this._isIsolated=n},t.prototype.setName=function(n){this._name=n},t.prototype.equals=function(n){var r;if(!(n instanceof t)||(r=n,this.pts.length!==r.pts.length))return!1;for(var u=!0,f=!0,e=this.pts.length,i=0;i<this.pts.length;i++)if(this.pts[i].equals2D(r.pts[i])||(u=!1),this.pts[i].equals2D(r.pts[--e])||(f=!1),!u&&!f)return!1;return!0},t.prototype.getCoordinate=function(){if(0===arguments.length)return this.pts.length>0?this.pts[0]:null;if(1===arguments.length){var n=arguments[0];return this.pts[n]}},t.prototype.print=function(n){n.print("edge "+this._name+": ");n.print("LINESTRING (");for(var t=0;t<this.pts.length;t++)t>0&&n.print(","),n.print(this.pts[t].x+" "+this.pts[t].y);n.print(")  "+this._label+" "+this._depthDelta)},t.prototype.computeIM=function(n){t.updateIM(this._label,n)},t.prototype.isCollapsed=function(){return!!this._label.isArea()&&3===this.pts.length&&!!this.pts[0].equals(this.pts[2])},t.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},t.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},t.prototype.getDepthDelta=function(){return this._depthDelta},t.prototype.getNumPoints=function(){return this.pts.length},t.prototype.printReverse=function(n){n.print("edge "+this._name+": ");for(var t=this.pts.length-1;t>=0;t--)n.print(this.pts[t]+" ");n.println("")},t.prototype.getMonotoneChainEdge=function(){return null===this._mce&&(this._mce=new ic(this)),this._mce},t.prototype.getEnvelope=function(){if(null===this._env){this._env=new l;for(var n=0;n<this.pts.length;n++)this._env.expandToInclude(this.pts[n])}return this._env},t.prototype.addIntersection=function(n,t,r,u){var o=new i(n.getIntersection(u)),f=t,s=n.getEdgeDistance(r,u),e=f+1,h;e<this.pts.length&&(h=this.pts[e],o.equals2D(h)&&(f=e,s=0));this.eiList.add(o,f,s)},t.prototype.toString=function(){var n=new es,t;for(n.append("edge "+this._name+": "),n.append("LINESTRING ("),t=0;t<this.pts.length;t++)t>0&&n.append(","),n.append(this.pts[t].x+" "+this.pts[t].y);return n.append(")  "+this._label+" "+this._depthDelta),n.toString()},t.prototype.isPointwiseEqual=function(n){if(this.pts.length!==n.pts.length)return!1;for(var t=0;t<this.pts.length;t++)if(!this.pts[t].equals2D(n.pts[t]))return!1;return!0},t.prototype.setDepthDelta=function(n){this._depthDelta=n},t.prototype.getEdgeIntersectionList=function(){return this.eiList},t.prototype.addIntersections=function(n,t,i){for(var r=0;r<n.getIntersectionNum();r++)this.addIntersection(n,t,i,r)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.updateIM=function(){if(2!==arguments.length)return n.prototype.updateIM.apply(this,arguments);var t=arguments[0],i=arguments[1];i.setAtLeastIfValid(t.getLocation(0,f.ON),t.getLocation(1,f.ON),1);t.isArea()&&(i.setAtLeastIfValid(t.getLocation(0,f.LEFT),t.getLocation(1,f.LEFT),2),i.setAtLeastIfValid(t.getLocation(0,f.RIGHT),t.getLocation(1,f.RIGHT),2))},t}(fo);lf=function(n){this._workingPrecisionModel=null;this._workingNoder=null;this._geomFact=null;this._graph=null;this._edgeList=new ns;this._bufParams=n||null};lf.prototype.setWorkingPrecisionModel=function(n){this._workingPrecisionModel=n};lf.prototype.insertUniqueEdge=function(n){var t=this._edgeList.findEqualEdge(n),r,i,u,f;null!==t?(r=t.getLabel(),i=n.getLabel(),t.isPointwiseEqual(n)||(i=new di(n.getLabel())).flip(),r.merge(i),u=lf.depthDelta(i),f=t.getDepthDelta()+u,t.setDepthDelta(f)):(this._edgeList.add(n),n.setDepthDelta(lf.depthDelta(n.getLabel())))};lf.prototype.buildSubgraphs=function(n,t){for(var r=new e,u=n.iterator();u.hasNext();){var i=u.next(),f=i.getRightmostCoordinate(),o=new da(r).getDepth(f);i.computeDepth(o);i.findResultEdges();r.add(i);t.add(i.getDirectedEdges(),i.getNodes())}};lf.prototype.createSubgraphs=function(n){for(var r,u,t=new e,i=n.getNodes().iterator();i.hasNext();)r=i.next(),r.isVisited()||(u=new hf,u.create(r),t.add(u));return go.sort(t,go.reverseOrder()),t};lf.prototype.createEmptyResultGeometry=function(){return this._geomFact.createPolygon()};lf.prototype.getNoder=function(n){if(null!==this._workingNoder)return this._workingNoder;var t=new dut,i=new vl;return i.setPrecisionModel(n),t.setSegmentIntersector(new ke(i)),t};lf.prototype.buffer=function(n,t){var i=this._workingPrecisionModel,e,r,o,u,f;return(null===i&&(i=n.getPrecisionModel()),this._geomFact=n.getFactory(),e=new ie(i,this._bufParams),r=new eo(n,t,e).getCurves(),r.size()<=0)?this.createEmptyResultGeometry():(this.computeNodedEdges(r,i),this._graph=new yr(new bvt),this._graph.addEdges(this._edgeList.getEdges()),o=this.createSubgraphs(this._graph),u=new he(this._geomFact),this.buildSubgraphs(o,u),f=u.getPolygons(),f.size()<=0)?this.createEmptyResultGeometry():this._geomFact.buildGeometry(f)};lf.prototype.computeNodedEdges=function(n,t){var f=this.getNoder(t),u,i,r,e,o;for(f.computeNodes(n),u=f.getNodedSubstrings().iterator();u.hasNext();)i=u.next(),r=i.getCoordinates(),2===r.length&&r[0].equals2D(r[1])||(e=i.getData(),o=new hk(i.getCoordinates(),new di(e)),this.insertUniqueEdge(o))};lf.prototype.setNoder=function(n){this._workingNoder=n};lf.prototype.interfaces_=function(){return[]};lf.prototype.getClass=function(){return lf};lf.depthDelta=function(n){var t=n.getLocation(0,f.LEFT),i=n.getLocation(0,f.RIGHT);return t===r.INTERIOR&&i===r.EXTERIOR?1:t===r.EXTERIOR&&i===r.INTERIOR?-1:0};lf.convertSegStrings=function(n){for(var r,u,t=new ut,i=new e;n.hasNext();)r=n.next(),u=t.createLineString(r.getCoordinates()),i.add(u);return t.buildGeometry(i)};gc=function(){var n,t;if(this._noder=null,this._scaleFactor=null,this._offsetX=null,this._offsetY=null,this._isScaled=!1,2===arguments.length)n=arguments[0],t=arguments[1],this._noder=n,this._scaleFactor=t,this._offsetX=0,this._offsetY=0,this._isScaled=!this.isIntegerPrecision();else if(4===arguments.length){var i=arguments[0],r=arguments[1],u=arguments[2],f=arguments[3];this._noder=i;this._scaleFactor=r;this._offsetX=u;this._offsetY=f;this._isScaled=!this.isIntegerPrecision()}};gc.prototype.rescale=function(){var i,r,n,t;if(k(arguments[0],eu))for(i=arguments[0].iterator();i.hasNext();)r=i.next(),this.rescale(r.getCoordinates());else if(arguments[0]instanceof Array){for(n=arguments[0],t=0;t<n.length;t++)n[t].x=n[t].x/this._scaleFactor+this._offsetX,n[t].y=n[t].y/this._scaleFactor+this._offsetY;2===n.length&&n[0].equals2D(n[1])&&rf.out.println(n)}};gc.prototype.scale=function(){var r;if(k(arguments[0],eu)){for(var s=arguments[0],u=new e,f=s.iterator();f.hasNext();)r=f.next(),u.add(new gr(this.scale(r.getCoordinates()),r.getData()));return u}if(arguments[0]instanceof Array){for(var t=arguments[0],o=new Array(t.length).fill(null),n=0;n<t.length;n++)o[n]=new i(Math.round((t[n].x-this._offsetX)*this._scaleFactor),Math.round((t[n].y-this._offsetY)*this._scaleFactor),t[n].z);return ft.removeRepeatedPoints(o)}};gc.prototype.isIntegerPrecision=function(){return 1===this._scaleFactor};gc.prototype.getNodedSubstrings=function(){var n=this._noder.getNodedSubstrings();return this._isScaled&&this.rescale(n),n};gc.prototype.computeNodes=function(n){var t=n;this._isScaled&&(t=this.scale(n));this._noder.computeNodes(t)};gc.prototype.interfaces_=function(){return[pl]};gc.prototype.getClass=function(){return gc};bs=function(){this._li=new vl;this._segStrings=null;var n=arguments[0];this._segStrings=n};ift={fact:{configurable:!0}};bs.prototype.checkEndPtVertexIntersections=function(){var i,t,r,u,f,n;if(0===arguments.length)for(i=this._segStrings.iterator();i.hasNext();)t=i.next().getCoordinates(),this.checkEndPtVertexIntersections(t[0],this._segStrings),this.checkEndPtVertexIntersections(t[t.length-1],this._segStrings);else if(2===arguments.length)for(r=arguments[0],u=arguments[1].iterator();u.hasNext();)for(f=u.next().getCoordinates(),n=1;n<f.length-1;n++)if(f[n].equals(r))throw new vc("found endpt/interior pt intersection at index "+n+" :pt "+r);};bs.prototype.checkInteriorIntersections=function(){var t,a,i,v,n;if(0===arguments.length)for(t=this._segStrings.iterator();t.hasNext();)for(a=t.next(),i=this._segStrings.iterator();i.hasNext();)v=i.next(),this.checkInteriorIntersections(a,v);else if(2===arguments.length)for(var y=arguments[0],p=arguments[1],w=y.getCoordinates(),b=p.getCoordinates(),r=0;r<w.length-1;r++)for(n=0;n<b.length-1;n++)this.checkInteriorIntersections(y,r,p,n);else if(4===arguments.length){var u=arguments[0],f=arguments[1],e=arguments[2],o=arguments[3];if(u===e&&f===o)return null;var s=u.getCoordinates()[f],h=u.getCoordinates()[f+1],c=e.getCoordinates()[o],l=e.getCoordinates()[o+1];if(this._li.computeIntersection(s,h,c,l),this._li.hasIntersection()&&(this._li.isProper()||this.hasInteriorIntersection(this._li,s,h)||this.hasInteriorIntersection(this._li,c,l)))throw new vc("found non-noded intersection at "+s+"-"+h+" and "+c+"-"+l);}};bs.prototype.checkValid=function(){this.checkEndPtVertexIntersections();this.checkInteriorIntersections();this.checkCollapses()};bs.prototype.checkCollapses=function(){var i,r,t,n;if(0===arguments.length)for(i=this._segStrings.iterator();i.hasNext();)r=i.next(),this.checkCollapses(r);else if(1===arguments.length)for(t=arguments[0].getCoordinates(),n=0;n<t.length-2;n++)this.checkCollapse(t[n],t[n+1],t[n+2])};bs.prototype.hasInteriorIntersection=function(n,t,i){for(var u,r=0;r<n.getIntersectionNum();r++)if(u=n.getIntersection(r),!u.equals(t)&&!u.equals(i))return!0;return!1};bs.prototype.checkCollapse=function(n,t,i){if(n.equals(i))throw new vc("found non-noded collapse at "+bs.fact.createLineString([n,t,i]));};bs.prototype.interfaces_=function(){return[]};bs.prototype.getClass=function(){return bs};ift.fact.get=function(){return new ut};Object.defineProperties(bs,ift);re=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 n=arguments[0],t=arguments[1],r=arguments[2];if(this._originalPt=n,this._pt=n,this._scaleFactor=t,this._li=r,t<=0)throw new ar("Scale factor must be non-zero");1!==t&&(this._pt=new i(this.scale(n.x),this.scale(n.y)),this._p0Scaled=new i,this._p1Scaled=new i);this.initCorners(this._pt)};rft={SAFE_ENV_EXPANSION_FACTOR:{configurable:!0}};re.prototype.intersectsScaled=function(n,t){var u=Math.min(n.x,t.x),f=Math.max(n.x,t.x),e=Math.min(n.y,t.y),o=Math.max(n.y,t.y),r=this._maxx<u||this._minx>f||this._maxy<e||this._miny>o,i;return r?!1:(i=this.intersectsToleranceSquare(n,t),rt.isTrue(!(r&&i),"Found bad envelope test"),i)};re.prototype.initCorners=function(n){this._minx=n.x-.5;this._maxx=n.x+.5;this._miny=n.y-.5;this._maxy=n.y+.5;this._corner[0]=new i(this._maxx,this._maxy);this._corner[1]=new i(this._minx,this._maxy);this._corner[2]=new i(this._minx,this._miny);this._corner[3]=new i(this._maxx,this._miny)};re.prototype.intersects=function(n,t){return 1===this._scaleFactor?this.intersectsScaled(n,t):(this.copyScaled(n,this._p0Scaled),this.copyScaled(t,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))};re.prototype.scale=function(n){return Math.round(n*this._scaleFactor)};re.prototype.getCoordinate=function(){return this._originalPt};re.prototype.copyScaled=function(n,t){t.x=this.scale(n.x);t.y=this.scale(n.y)};re.prototype.getSafeEnvelope=function(){if(null===this._safeEnv){var n=re.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new l(this._originalPt.x-n,this._originalPt.x+n,this._originalPt.y-n,this._originalPt.y+n)}return this._safeEnv};re.prototype.intersectsPixelClosure=function(n,t){return this._li.computeIntersection(n,t,this._corner[0],this._corner[1]),!!this._li.hasIntersection()||(this._li.computeIntersection(n,t,this._corner[1],this._corner[2]),!!this._li.hasIntersection()||(this._li.computeIntersection(n,t,this._corner[2],this._corner[3]),!!this._li.hasIntersection()||(this._li.computeIntersection(n,t,this._corner[3],this._corner[0]),!!this._li.hasIntersection())))};re.prototype.intersectsToleranceSquare=function(n,t){var i=!1,r=!1;return this._li.computeIntersection(n,t,this._corner[0],this._corner[1]),!!this._li.isProper()||(this._li.computeIntersection(n,t,this._corner[1],this._corner[2]),!!this._li.isProper()||(this._li.hasIntersection()&&(i=!0),this._li.computeIntersection(n,t,this._corner[2],this._corner[3]),!!this._li.isProper()||(this._li.hasIntersection()&&(r=!0),this._li.computeIntersection(n,t,this._corner[3],this._corner[0]),!!this._li.isProper()||!(!i||!r)||!!n.equals(this._pt)||!!t.equals(this._pt))))};re.prototype.addSnappedNode=function(n,t){var i=n.getCoordinate(t),r=n.getCoordinate(t+1);return!!this.intersects(i,r)&&(n.addIntersection(this.getCoordinate(),t),!0)};re.prototype.interfaces_=function(){return[]};re.prototype.getClass=function(){return re};rft.SAFE_ENV_EXPANSION_FACTOR.get=function(){return.75};Object.defineProperties(re,rft);sw=function(){this.tempEnv1=new l;this.selectedSegment=new a};sw.prototype.select=function(){if(1!==arguments.length&&2===arguments.length){var n=arguments[0],t=arguments[1];n.getLineSegment(t,this.selectedSegment);this.select(this.selectedSegment)}};sw.prototype.interfaces_=function(){return[]};sw.prototype.getClass=function(){return sw};fy=function(){this._index=null;var n=arguments[0];this._index=n};uft={HotPixelSnapAction:{configurable:!0}};fy.prototype.snap=function(){var n;if(1===arguments.length)return n=arguments[0],this.snap(n,null,-1);if(3===arguments.length){var t=arguments[0],u=arguments[1],f=arguments[2],i=t.getSafeEnvelope(),r=new fft(t,u,f);return this._index.query(i,{interfaces_:function(){return[bc]},visitItem:function(n){n.select(i,r)}}),r.isNodeAdded()}};fy.prototype.interfaces_=function(){return[]};fy.prototype.getClass=function(){return fy};uft.HotPixelSnapAction.get=function(){return fft};Object.defineProperties(fy,uft);fft=function(n){function t(){n.call(this);this._hotPixel=null;this._parentEdge=null;this._hotPixelVertexIndex=null;this._isNodeAdded=!1;var t=arguments[0],i=arguments[1],r=arguments[2];this._hotPixel=t;this._parentEdge=i;this._hotPixelVertexIndex=r}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.isNodeAdded=function(){return this._isNodeAdded},t.prototype.select=function(){if(2!==arguments.length)return n.prototype.select.apply(this,arguments);var r=arguments[0],t=arguments[1],i=r.getContext();if(null!==this._parentEdge&&i===this._parentEdge&&t===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(i,t)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(sw);ga=function(){this._li=null;this._interiorIntersections=null;var n=arguments[0];this._li=n;this._interiorIntersections=new e};ga.prototype.processIntersections=function(n,t,i,r){var u;if(n===i&&t===r)return null;var f=n.getCoordinates()[t],e=n.getCoordinates()[t+1],o=i.getCoordinates()[r],s=i.getCoordinates()[r+1];if(this._li.computeIntersection(f,e,o,s),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(u=0;u<this._li.getIntersectionNum();u++)this._interiorIntersections.add(this._li.getIntersection(u));n.addIntersections(this._li,t,0);i.addIntersections(this._li,r,1)}};ga.prototype.isDone=function(){return!1};ga.prototype.getInteriorIntersections=function(){return this._interiorIntersections};ga.prototype.interfaces_=function(){return[kl]};ga.prototype.getClass=function(){return ga};sh=function(){this._pm=null;this._li=null;this._scaleFactor=null;this._noder=null;this._pointSnapper=null;this._nodedSegStrings=null;var n=arguments[0];this._pm=n;this._li=new vl;this._li.setPrecisionModel(n);this._scaleFactor=n.getScale()};sh.prototype.checkCorrectness=function(n){var t=gr.getNodedSubstrings(n),i=new bs(t);try{i.checkValid()}catch(n){if(!(n instanceof svt))throw n;n.printStackTrace()}};sh.prototype.getNodedSubstrings=function(){return gr.getNodedSubstrings(this._nodedSegStrings)};sh.prototype.snapRound=function(n,t){var i=this.findInteriorIntersections(n,t);this.computeIntersectionSnaps(i);this.computeVertexSnaps(n)};sh.prototype.findInteriorIntersections=function(n,t){var i=new ga(t);return this._noder.setSegmentIntersector(i),this._noder.computeNodes(n),i.getInteriorIntersections()};sh.prototype.computeVertexSnaps=function(){var t,u,f;if(k(arguments[0],eu))for(t=arguments[0].iterator();t.hasNext();)u=t.next(),this.computeVertexSnaps(u);else if(arguments[0]instanceof gr)for(var i=arguments[0],r=i.getCoordinates(),n=0;n<r.length;n++)f=new re(r[n],this._scaleFactor,this._li),this._pointSnapper.snap(f,i,n)&&i.addIntersection(r[n],n)};sh.prototype.computeNodes=function(n){this._nodedSegStrings=n;this._noder=new dut;this._pointSnapper=new fy(this._noder.getIndex());this.snapRound(n,this._li)};sh.prototype.computeIntersectionSnaps=function(n){for(var i,r,t=n.iterator();t.hasNext();)i=t.next(),r=new re(i,this._scaleFactor,this._li),this._pointSnapper.snap(r)};sh.prototype.interfaces_=function(){return[pl]};sh.prototype.getClass=function(){return sh};bu=function(){var n,t,i;(this._argGeom=null,this._distance=null,this._bufParams=new ki,this._resultGeometry=null,this._saveException=null,1===arguments.length)?(n=arguments[0],this._argGeom=n):2===arguments.length&&(t=arguments[0],i=arguments[1],this._argGeom=t,this._bufParams=i)};ey={CAP_ROUND:{configurable:!0},CAP_BUTT:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},MAX_PRECISION_DIGITS:{configurable:!0}};bu.prototype.bufferFixedPrecision=function(n){var i=new gc(new sh(new bi(1)),n.getScale()),t=new lf(this._bufParams);t.setWorkingPrecisionModel(n);t.setNoder(i);this._resultGeometry=t.buffer(this._argGeom,this._distance)};bu.prototype.bufferReducedPrecision=function(){var t=this,n;if(0===arguments.length){for(n=bu.MAX_PRECISION_DIGITS;n>=0;n--){try{t.bufferReducedPrecision(n)}catch(n){if(!(n instanceof nc))throw n;t._saveException=n}if(null!==t._resultGeometry)return null}throw this._saveException;}if(1===arguments.length){var i=arguments[0],r=bu.precisionScaleFactor(this._argGeom,this._distance,i),u=new bi(r);this.bufferFixedPrecision(u)}};bu.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),null!==this._resultGeometry)return null;var n=this._argGeom.getFactory().getPrecisionModel();n.getType()===bi.FIXED?this.bufferFixedPrecision(n):this.bufferReducedPrecision()};bu.prototype.setQuadrantSegments=function(n){this._bufParams.setQuadrantSegments(n)};bu.prototype.bufferOriginalPrecision=function(){try{var n=new lf(this._bufParams);this._resultGeometry=n.buffer(this._argGeom,this._distance)}catch(n){if(!(n instanceof vc))throw n;this._saveException=n}};bu.prototype.getResultGeometry=function(n){return this._distance=n,this.computeGeometry(),this._resultGeometry};bu.prototype.setEndCapStyle=function(n){this._bufParams.setEndCapStyle(n)};bu.prototype.interfaces_=function(){return[]};bu.prototype.getClass=function(){return bu};bu.bufferOp=function(){var t,i;if(2===arguments.length)return t=arguments[0],i=arguments[1],new bu(t).getResultGeometry(i);if(3===arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof b&&"number"==typeof arguments[1]){var u=arguments[0],f=arguments[1],e=arguments[2],r=new bu(u);return r.setQuadrantSegments(e),r.getResultGeometry(f)}if(arguments[2]instanceof ki&&arguments[0]instanceof b&&"number"==typeof arguments[1]){var o=arguments[0],s=arguments[1],h=arguments[2];return new bu(o,h).getResultGeometry(s)}}else if(4===arguments.length){var c=arguments[0],l=arguments[1],a=arguments[2],v=arguments[3],n=new bu(c);return n.setQuadrantSegments(a),n.setEndCapStyle(v),n.getResultGeometry(l)}};bu.precisionScaleFactor=function(n,t,i){var r=n.getEnvelopeInternal(),u=io.max(Math.abs(r.getMaxX()),Math.abs(r.getMaxY()),Math.abs(r.getMinX()),Math.abs(r.getMinY()))+2*(t>0?t:0),f=i-Math.trunc(Math.log(u)/Math.log(10)+1);return Math.pow(10,f)};ey.CAP_ROUND.get=function(){return ki.CAP_ROUND};ey.CAP_BUTT.get=function(){return ki.CAP_FLAT};ey.CAP_FLAT.get=function(){return ki.CAP_FLAT};ey.CAP_SQUARE.get=function(){return ki.CAP_SQUARE};ey.MAX_PRECISION_DIGITS.get=function(){return 12};Object.defineProperties(bu,ey);af=function(){this._pt=[new i,new i];this._distance=it.NaN;this._isNull=!0};af.prototype.getCoordinates=function(){return this._pt};af.prototype.getCoordinate=function(n){return this._pt[n]};af.prototype.setMinimum=function(){var i,n,t,r;if(1===arguments.length)i=arguments[0],this.setMinimum(i._pt[0],i._pt[1]);else if(2===arguments.length){if(n=arguments[0],t=arguments[1],this._isNull)return this.initialize(n,t),null;r=n.distance(t);r<this._distance&&this.initialize(n,t,r)}};af.prototype.initialize=function(){var n,t;if(0===arguments.length)this._isNull=!0;else if(2===arguments.length)n=arguments[0],t=arguments[1],this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(t),this._distance=n.distance(t),this._isNull=!1;else if(3===arguments.length){var i=arguments[0],r=arguments[1],u=arguments[2];this._pt[0].setCoordinate(i);this._pt[1].setCoordinate(r);this._distance=u;this._isNull=!1}};af.prototype.getDistance=function(){return this._distance};af.prototype.setMaximum=function(){var i,n,t,r;if(1===arguments.length)i=arguments[0],this.setMaximum(i._pt[0],i._pt[1]);else if(2===arguments.length){if(n=arguments[0],t=arguments[1],this._isNull)return this.initialize(n,t),null;r=n.distance(t);r>this._distance&&this.initialize(n,t,r)}};af.prototype.interfaces_=function(){return[]};af.prototype.getClass=function(){return af};hh=function(){};hh.prototype.interfaces_=function(){return[]};hh.prototype.getClass=function(){return hh};hh.computeDistance=function(){var v,r,h,e,w;if(arguments[2]instanceof af&&arguments[0]instanceof wr&&arguments[1]instanceof i)for(var d=arguments[0],c=arguments[1],g=arguments[2],o=d.getCoordinates(),l=new a,t=0;t<o.length-1;t++)l.setCoordinates(o[t],o[t+1]),v=l.closestPoint(c),g.setMinimum(v,c);else if(arguments[2]instanceof af&&arguments[0]instanceof cu&&arguments[1]instanceof i){var s=arguments[0],y=arguments[1],p=arguments[2];for(hh.computeDistance(s.getExteriorRing(),y,p),r=0;r<s.getNumInteriorRing();r++)hh.computeDistance(s.getInteriorRingN(r),y,p)}else if(arguments[2]instanceof af&&arguments[0]instanceof b&&arguments[1]instanceof i){var n=arguments[0],u=arguments[1],f=arguments[2];if(n instanceof wr)hh.computeDistance(n,u,f);else if(n instanceof cu)hh.computeDistance(n,u,f);else if(n instanceof te)for(h=n,e=0;e<h.getNumGeometries();e++)w=h.getGeometryN(e),hh.computeDistance(w,u,f);else f.setMinimum(n.getCoordinate(),u)}else if(arguments[2]instanceof af&&arguments[0]instanceof a&&arguments[1]instanceof i){var nt=arguments[0],k=arguments[1],tt=arguments[2],it=nt.closestPoint(k);tt.setMinimum(it,k)}};gl=function(n){this._maxPtDist=new af;this._inputGeom=n||null};sn={MaxPointDistanceFilter:{configurable:!0},MaxMidpointDistanceFilter:{configurable:!0}};gl.prototype.computeMaxMidpointDistance=function(n){var t=new nl(this._inputGeom);n.apply(t);this._maxPtDist.setMaximum(t.getMaxPointDistance())};gl.prototype.computeMaxVertexDistance=function(n){var t=new nv(this._inputGeom);n.apply(t);this._maxPtDist.setMaximum(t.getMaxPointDistance())};gl.prototype.findDistance=function(n){return this.computeMaxVertexDistance(n),this.computeMaxMidpointDistance(n),this._maxPtDist.getDistance()};gl.prototype.getDistancePoints=function(){return this._maxPtDist};gl.prototype.interfaces_=function(){return[]};gl.prototype.getClass=function(){return gl};sn.MaxPointDistanceFilter.get=function(){return nv};sn.MaxMidpointDistanceFilter.get=function(){return nl};Object.defineProperties(gl,sn);nv=function(n){this._maxPtDist=new af;this._minPtDist=new af;this._geom=n||null};nv.prototype.filter=function(n){this._minPtDist.initialize();hh.computeDistance(this._geom,n,this._minPtDist);this._maxPtDist.setMaximum(this._minPtDist)};nv.prototype.getMaxPointDistance=function(){return this._maxPtDist};nv.prototype.interfaces_=function(){return[ih]};nv.prototype.getClass=function(){return nv};nl=function(n){this._maxPtDist=new af;this._minPtDist=new af;this._geom=n||null};nl.prototype.filter=function(n,t){if(0===t)return null;var r=n.getCoordinate(t-1),u=n.getCoordinate(t),f=new i((r.x+u.x)/2,(r.y+u.y)/2);this._minPtDist.initialize();hh.computeDistance(this._geom,f,this._minPtDist);this._maxPtDist.setMaximum(this._minPtDist)};nl.prototype.isDone=function(){return!1};nl.prototype.isGeometryChanged=function(){return!1};nl.prototype.getMaxPointDistance=function(){return this._maxPtDist};nl.prototype.interfaces_=function(){return[po]};nl.prototype.getClass=function(){return nl};rc=function(n){this._comps=n||null};rc.prototype.filter=function(n){n instanceof cu&&this._comps.add(n)};rc.prototype.interfaces_=function(){return[ls]};rc.prototype.getClass=function(){return rc};rc.getPolygons=function(){var i,n,t;return 1===arguments.length?(i=arguments[0],rc.getPolygons(i,new e)):2===arguments.length?(n=arguments[0],t=arguments[1],n instanceof cu?t.add(n):n instanceof te&&n.apply(new rc(t)),t):void 0};ku=function(){var n,t,i;(this._lines=null,this._isForcedToLineString=!1,1===arguments.length)?(n=arguments[0],this._lines=n):2===arguments.length&&(t=arguments[0],i=arguments[1],this._lines=t,this._isForcedToLineString=i)};ku.prototype.filter=function(n){if(this._isForcedToLineString&&n instanceof dh){var t=n.getFactory().createLineString(n.getCoordinateSequence());return this._lines.add(t),null}n instanceof wr&&this._lines.add(n)};ku.prototype.setForceToLineString=function(n){this._isForcedToLineString=n};ku.prototype.interfaces_=function(){return[bh]};ku.prototype.getClass=function(){return ku};ku.getGeometry=function(){var n,t,i;return 1===arguments.length?(n=arguments[0],n.getFactory().buildGeometry(ku.getLines(n))):2===arguments.length?(t=arguments[0],i=arguments[1],t.getFactory().buildGeometry(ku.getLines(t,i))):void 0};ku.getLines=function(){var i,f,n,t,c;if(1===arguments.length)return i=arguments[0],ku.getLines(i,!1);if(2===arguments.length){if(k(arguments[0],eu)&&k(arguments[1],eu)){for(var a=arguments[0],r=arguments[1],u=a.iterator();u.hasNext();)f=u.next(),ku.getLines(f,r);return r}if(arguments[0]instanceof b&&"boolean"==typeof arguments[1]){var v=arguments[0],y=arguments[1],o=new e;return v.apply(new ku(o,y)),o}if(arguments[0]instanceof b&&k(arguments[1],eu))return n=arguments[0],t=arguments[1],n instanceof wr?t.add(n):n.apply(new ku(t)),t}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&k(arguments[0],eu)&&k(arguments[1],eu)){for(var p=arguments[0],s=arguments[1],w=arguments[2],h=p.iterator();h.hasNext();)c=h.next(),ku.getLines(c,s,w);return s}if("boolean"==typeof arguments[2]&&arguments[0]instanceof b&&k(arguments[1],eu)){var d=arguments[0],l=arguments[1],g=arguments[2];return d.apply(new ku(l,g)),l}}};ts=function(){if((this._boundaryRule=ro.OGC_SFS_BOUNDARY_RULE,this._isIn=null,this._numBoundaries=null,0!==arguments.length)&&1===arguments.length){var n=arguments[0];if(null===n)throw new ar("Rule must be non-null");this._boundaryRule=n}};ts.prototype.locateInternal=function(){var s,n,l,h,f,a,c,t,e,u,v;if(arguments[0]instanceof i&&arguments[1]instanceof cu){if((s=arguments[0],n=arguments[1],n.isEmpty())||(l=n.getExteriorRing(),h=this.locateInPolygonRing(s,l),h===r.EXTERIOR))return r.EXTERIOR;if(h===r.BOUNDARY)return r.BOUNDARY;for(f=0;f<n.getNumInteriorRing();f++){if(a=n.getInteriorRingN(f),c=this.locateInPolygonRing(s,a),c===r.INTERIOR)return r.EXTERIOR;if(c===r.BOUNDARY)return r.BOUNDARY}return r.INTERIOR}return arguments[0]instanceof i&&arguments[1]instanceof wr?(t=arguments[0],e=arguments[1],!e.getEnvelopeInternal().intersects(t))?r.EXTERIOR:(u=e.getCoordinates(),e.isClosed()||!t.equals(u[0])&&!t.equals(u[u.length-1])?o.isOnLine(t,u)?r.INTERIOR:r.EXTERIOR:r.BOUNDARY):arguments[0]instanceof i&&arguments[1]instanceof se?(v=arguments[0],arguments[1].getCoordinate().equals2D(v)?r.INTERIOR:r.EXTERIOR):void 0};ts.prototype.locateInPolygonRing=function(n,t){return t.getEnvelopeInternal().intersects(n)?o.locatePointInRing(n,t.getCoordinates()):r.EXTERIOR};ts.prototype.intersects=function(n,t){return this.locate(n,t)!==r.EXTERIOR};ts.prototype.updateLocationInfo=function(n){n===r.INTERIOR&&(this._isIn=!0);n===r.BOUNDARY&&this._numBoundaries++};ts.prototype.computeLocation=function(n,t){var u,i,s,f,r,h,e,o;if(t instanceof se&&this.updateLocationInfo(this.locateInternal(n,t)),t instanceof wr)this.updateLocationInfo(this.locateInternal(n,t));else if(t instanceof cu)this.updateLocationInfo(this.locateInternal(n,t));else if(t instanceof pa)for(u=t,i=0;i<u.getNumGeometries();i++)s=u.getGeometryN(i),this.updateLocationInfo(this.locateInternal(n,s));else if(t instanceof gh)for(f=t,r=0;r<f.getNumGeometries();r++)h=f.getGeometryN(r),this.updateLocationInfo(this.locateInternal(n,h));else if(t instanceof te)for(e=new eh(t);e.hasNext();)o=e.next(),o!==t&&this.computeLocation(n,o)};ts.prototype.locate=function(n,t){return t.isEmpty()?r.EXTERIOR:t instanceof wr?this.locateInternal(n,t):t instanceof cu?this.locateInternal(n,t):(this._isIn=!1,this._numBoundaries=0,this.computeLocation(n,t),this._boundaryRule.isInBoundary(this._numBoundaries)?r.BOUNDARY:this._numBoundaries>0||this._isIn?r.INTERIOR:r.EXTERIOR)};ts.prototype.interfaces_=function(){return[]};ts.prototype.getClass=function(){return ts};vf=function n(){var t,i;if(this._component=null,this._segIndex=null,this._pt=null,2===arguments.length)t=arguments[0],i=arguments[1],n.call(this,t,n.INSIDE_AREA,i);else if(3===arguments.length){var r=arguments[0],u=arguments[1],f=arguments[2];this._component=r;this._segIndex=u;this._pt=f}};eft={INSIDE_AREA:{configurable:!0}};vf.prototype.isInsideArea=function(){return this._segIndex===vf.INSIDE_AREA};vf.prototype.getCoordinate=function(){return this._pt};vf.prototype.getGeometryComponent=function(){return this._component};vf.prototype.getSegmentIndex=function(){return this._segIndex};vf.prototype.interfaces_=function(){return[]};vf.prototype.getClass=function(){return vf};eft.INSIDE_AREA.get=function(){return-1};Object.defineProperties(vf,eft);tl=function(n){this._pts=n||null};tl.prototype.filter=function(n){n instanceof se&&this._pts.add(n)};tl.prototype.interfaces_=function(){return[ls]};tl.prototype.getClass=function(){return tl};tl.getPoints=function(){var t,n,i;return 1===arguments.length?(t=arguments[0],t instanceof se?go.singletonList(t):tl.getPoints(t,new e)):2===arguments.length?(n=arguments[0],i=arguments[1],n instanceof se?i.add(n):n instanceof te&&n.apply(new tl(i)),i):void 0};tv=function(){this._locations=null;var n=arguments[0];this._locations=n};tv.prototype.filter=function(n){(n instanceof se||n instanceof wr||n instanceof cu)&&this._locations.add(new vf(n,0,n.getCoordinate()))};tv.prototype.interfaces_=function(){return[ls]};tv.prototype.getClass=function(){return tv};tv.getLocations=function(n){var t=new e;return n.apply(new tv(t)),t};du=function(){var n,t;if(this._geom=null,this._terminateDistance=0,this._ptLocator=new ts,this._minDistanceLocation=null,this._minDistance=it.MAX_VALUE,2===arguments.length)n=arguments[0],t=arguments[1],this._geom=[n,t],this._terminateDistance=0;else if(3===arguments.length){var i=arguments[0],r=arguments[1],u=arguments[2];this._geom=new Array(2).fill(null);this._geom[0]=i;this._geom[1]=r;this._terminateDistance=u}};du.prototype.computeContainmentDistance=function(){var t,s,l,n;if(0===arguments.length){if(t=new Array(2).fill(null),this.computeContainmentDistance(0,t),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,t)}else if(2===arguments.length){var i=arguments[0],u=arguments[1],e=1-i,o=rc.getPolygons(this._geom[i]);if(o.size()>0&&(s=tv.getLocations(this._geom[e]),this.computeContainmentDistance(s,o,u),this._minDistance<=this._terminateDistance))return this._minDistanceLocation[e]=u[0],this._minDistanceLocation[i]=u[1],null}else if(3===arguments.length)if(arguments[2]instanceof Array&&k(arguments[0],vo)&&k(arguments[1],vo)){for(var h=arguments[0],c=arguments[1],w=arguments[2],f=0;f<h.size();f++)for(l=h.get(f),n=0;n<c.size();n++)if(this.computeContainmentDistance(l,c.get(n),w),this._minDistance<=this._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof vf&&arguments[1]instanceof cu){var a=arguments[0],v=arguments[1],y=arguments[2],p=a.getCoordinate();if(r.EXTERIOR!==this._ptLocator.locate(p,v))return this._minDistance=0,y[0]=a,y[1]=new vf(v,p),null}};du.prototype.computeMinDistanceLinesPoints=function(n,t,i){for(var f,u,e,r=0;r<n.size();r++)for(f=n.get(r),u=0;u<t.size();u++)if(e=t.get(u),this.computeMinDistance(f,e,i),this._minDistance<=this._terminateDistance)return null};du.prototype.computeFacetDistance=function(){var n=new Array(2).fill(null),t=ku.getLines(this._geom[0]),i=ku.getLines(this._geom[1]),r=tl.getPoints(this._geom[0]),u=tl.getPoints(this._geom[1]);return this.computeMinDistanceLines(t,i,n),this.updateMinDistance(n,!1),this._minDistance<=this._terminateDistance?null:(n[0]=null,n[1]=null,this.computeMinDistanceLinesPoints(t,u,n),this.updateMinDistance(n,!1),this._minDistance<=this._terminateDistance?null:(n[0]=null,n[1]=null,this.computeMinDistanceLinesPoints(i,r,n),this.updateMinDistance(n,!0),this._minDistance<=this._terminateDistance?null:(n[0]=null,n[1]=null,this.computeMinDistancePoints(r,u,n),void this.updateMinDistance(n,!1))))};du.prototype.nearestLocations=function(){return this.computeMinDistance(),this._minDistanceLocation};du.prototype.updateMinDistance=function(n,t){if(null===n[0])return null;t?(this._minDistanceLocation[0]=n[1],this._minDistanceLocation[1]=n[0]):(this._minDistanceLocation[0]=n[0],this._minDistanceLocation[1]=n[1])};du.prototype.nearestPoints=function(){return this.computeMinDistance(),[this._minDistanceLocation[0].getCoordinate(),this._minDistanceLocation[1].getCoordinate()]};du.prototype.computeMinDistance=function(){var c,w,n,y;if(0===arguments.length){if(null!==this._minDistanceLocation||(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 wr&&arguments[1]instanceof se){var e=arguments[0],s=arguments[1],p=arguments[2];if(e.getEnvelopeInternal().distance(s.getEnvelopeInternal())>this._minDistance)return null;for(var r=e.getCoordinates(),h=s.getCoordinate(),t=0;t<r.length-1;t++)if(c=o.distancePointLine(h,r[t],r[t+1]),c<this._minDistance&&(this._minDistance=c,w=new a(r[t],r[t+1]).closestPoint(h),p[0]=new vf(e,t,w),p[1]=new vf(s,0,h)),this._minDistance<=this._terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof wr&&arguments[1]instanceof wr){var l=arguments[0],v=arguments[1],b=arguments[2];if(l.getEnvelopeInternal().distance(v.getEnvelopeInternal())>this._minDistance)return null;for(var u=l.getCoordinates(),f=v.getCoordinates(),i=0;i<u.length-1;i++)for(n=0;n<f.length-1;n++){if(y=o.distanceLineLine(u[i],u[i+1],f[n],f[n+1]),y<this._minDistance){this._minDistance=y;var d=new a(u[i],u[i+1]),g=new a(f[n],f[n+1]),k=d.closestPoints(g);b[0]=new vf(l,i,k[0]);b[1]=new vf(v,n,k[1])}if(this._minDistance<=this._terminateDistance)return null}}};du.prototype.computeMinDistancePoints=function(n,t,i){for(var u,f,e,o,r=0;r<n.size();r++)for(u=n.get(r),f=0;f<t.size();f++)if(e=t.get(f),o=u.getCoordinate().distance(e.getCoordinate()),o<this._minDistance&&(this._minDistance=o,i[0]=new vf(u,0,u.getCoordinate()),i[1]=new vf(e,0,e.getCoordinate())),this._minDistance<=this._terminateDistance)return null};du.prototype.distance=function(){if(null===this._geom[0]||null===this._geom[1])throw new ar("null geometries are not supported");return this._geom[0].isEmpty()||this._geom[1].isEmpty()?0:(this.computeMinDistance(),this._minDistance)};du.prototype.computeMinDistanceLines=function(n,t,i){for(var f,u,e,r=0;r<n.size();r++)for(f=n.get(r),u=0;u<t.size();u++)if(e=t.get(u),this.computeMinDistance(f,e,i),this._minDistance<=this._terminateDistance)return null};du.prototype.interfaces_=function(){return[]};du.prototype.getClass=function(){return du};du.distance=function(n,t){return new du(n,t).distance()};du.isWithinDistance=function(n,t,i){return new du(n,t,i).distance()<=i};du.nearestPoints=function(n,t){return new du(n,t).nearestPoints()};ef=function(){this._pt=[new i,new i];this._distance=it.NaN;this._isNull=!0};ef.prototype.getCoordinates=function(){return this._pt};ef.prototype.getCoordinate=function(n){return this._pt[n]};ef.prototype.setMinimum=function(){var i,n,t,r;if(1===arguments.length)i=arguments[0],this.setMinimum(i._pt[0],i._pt[1]);else if(2===arguments.length){if(n=arguments[0],t=arguments[1],this._isNull)return this.initialize(n,t),null;r=n.distance(t);r<this._distance&&this.initialize(n,t,r)}};ef.prototype.initialize=function(){var n,t;if(0===arguments.length)this._isNull=!0;else if(2===arguments.length)n=arguments[0],t=arguments[1],this._pt[0].setCoordinate(n),this._pt[1].setCoordinate(t),this._distance=n.distance(t),this._isNull=!1;else if(3===arguments.length){var i=arguments[0],r=arguments[1],u=arguments[2];this._pt[0].setCoordinate(i);this._pt[1].setCoordinate(r);this._distance=u;this._isNull=!1}};ef.prototype.toString=function(){return hs.toLineString(this._pt[0],this._pt[1])};ef.prototype.getDistance=function(){return this._distance};ef.prototype.setMaximum=function(){var i,n,t,r;if(1===arguments.length)i=arguments[0],this.setMaximum(i._pt[0],i._pt[1]);else if(2===arguments.length){if(n=arguments[0],t=arguments[1],this._isNull)return this.initialize(n,t),null;r=n.distance(t);r>this._distance&&this.initialize(n,t,r)}};ef.prototype.interfaces_=function(){return[]};ef.prototype.getClass=function(){return ef};ks=function(){};ks.prototype.interfaces_=function(){return[]};ks.prototype.getClass=function(){return ks};ks.computeDistance=function(){var v,r,h,e,w;if(arguments[2]instanceof ef&&arguments[0]instanceof wr&&arguments[1]instanceof i)for(var d=arguments[0],c=arguments[1],g=arguments[2],l=new a,o=d.getCoordinates(),t=0;t<o.length-1;t++)l.setCoordinates(o[t],o[t+1]),v=l.closestPoint(c),g.setMinimum(v,c);else if(arguments[2]instanceof ef&&arguments[0]instanceof cu&&arguments[1]instanceof i){var s=arguments[0],y=arguments[1],p=arguments[2];for(ks.computeDistance(s.getExteriorRing(),y,p),r=0;r<s.getNumInteriorRing();r++)ks.computeDistance(s.getInteriorRingN(r),y,p)}else if(arguments[2]instanceof ef&&arguments[0]instanceof b&&arguments[1]instanceof i){var n=arguments[0],u=arguments[1],f=arguments[2];if(n instanceof wr)ks.computeDistance(n,u,f);else if(n instanceof cu)ks.computeDistance(n,u,f);else if(n instanceof te)for(h=n,e=0;e<h.getNumGeometries();e++)w=h.getGeometryN(e),ks.computeDistance(w,u,f);else f.setMinimum(n.getCoordinate(),u)}else if(arguments[2]instanceof ef&&arguments[0]instanceof a&&arguments[1]instanceof i){var nt=arguments[0],k=arguments[1],tt=arguments[2],it=nt.closestPoint(k);tt.setMinimum(it,k)}};oo=function(){this._g0=null;this._g1=null;this._ptDist=new ef;this._densifyFrac=0;var n=arguments[0],t=arguments[1];this._g0=n;this._g1=t};hn={MaxPointDistanceFilter:{configurable:!0},MaxDensifiedByFractionDistanceFilter:{configurable:!0}};oo.prototype.getCoordinates=function(){return this._ptDist.getCoordinates()};oo.prototype.setDensifyFraction=function(n){if(n>1||n<=0)throw new ar("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=n};oo.prototype.compute=function(n,t){this.computeOrientedDistance(n,t,this._ptDist);this.computeOrientedDistance(t,n,this._ptDist)};oo.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()};oo.prototype.computeOrientedDistance=function(n,t,i){var u=new iv(t),r;(n.apply(u),i.setMaximum(u.getMaxPointDistance()),this._densifyFrac>0)&&(r=new il(t,this._densifyFrac),n.apply(r),i.setMaximum(r.getMaxPointDistance()))};oo.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()};oo.prototype.interfaces_=function(){return[]};oo.prototype.getClass=function(){return oo};oo.distance=function(){var n,t;if(2===arguments.length)return n=arguments[0],t=arguments[1],new oo(n,t).distance();if(3===arguments.length){var r=arguments[0],u=arguments[1],f=arguments[2],i=new oo(r,u);return i.setDensifyFraction(f),i.distance()}};hn.MaxPointDistanceFilter.get=function(){return iv};hn.MaxDensifiedByFractionDistanceFilter.get=function(){return il};Object.defineProperties(oo,hn);iv=function(){this._maxPtDist=new ef;this._minPtDist=new ef;this._euclideanDist=new ks;this._geom=null;var n=arguments[0];this._geom=n};iv.prototype.filter=function(n){this._minPtDist.initialize();ks.computeDistance(this._geom,n,this._minPtDist);this._maxPtDist.setMaximum(this._minPtDist)};iv.prototype.getMaxPointDistance=function(){return this._maxPtDist};iv.prototype.interfaces_=function(){return[ih]};iv.prototype.getClass=function(){return iv};il=function(){this._maxPtDist=new ef;this._minPtDist=new ef;this._geom=null;this._numSubSegs=0;var n=arguments[0],t=arguments[1];this._geom=n;this._numSubSegs=Math.trunc(Math.round(1/t))};il.prototype.filter=function(n,t){if(0===t)return null;for(var r=n.getCoordinate(t-1),f=n.getCoordinate(t),e=(f.x-r.x)/this._numSubSegs,o=(f.y-r.y)/this._numSubSegs,u=0;u<this._numSubSegs;u++){var s=r.x+u*e,h=r.y+u*o,c=new i(s,h);this._minPtDist.initialize();ks.computeDistance(this._geom,c,this._minPtDist);this._maxPtDist.setMaximum(this._minPtDist)}};il.prototype.isDone=function(){return!1};il.prototype.isGeometryChanged=function(){return!1};il.prototype.getMaxPointDistance=function(){return this._maxPtDist};il.prototype.interfaces_=function(){return[po]};il.prototype.getClass=function(){return il};ae=function(n,t,i){this._minValidDistance=null;this._maxValidDistance=null;this._minDistanceFound=null;this._maxDistanceFound=null;this._isValid=!0;this._errMsg=null;this._errorLocation=null;this._errorIndicator=null;this._input=n||null;this._bufDistance=t||null;this._result=i||null};cn={VERBOSE:{configurable:!0},MAX_DISTANCE_DIFF_FRAC:{configurable:!0}};ae.prototype.checkMaximumDistance=function(n,t,i){var u=new oo(t,n),r;(u.setDensifyFraction(.25),this._maxDistanceFound=u.orientedDistance(),this._maxDistanceFound>i)&&(this._isValid=!1,r=u.getCoordinates(),this._errorLocation=r[1],this._errorIndicator=n.getFactory().createLineString(r),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+hs.toLineString(r[0],r[1])+")")};ae.prototype.isValid=function(){var n=Math.abs(this._bufDistance),t=ae.MAX_DISTANCE_DIFF_FRAC*n;return this._minValidDistance=n-t,this._maxValidDistance=n+t,!(!this._input.isEmpty()&&!this._result.isEmpty())||(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),ae.VERBOSE&&rf.out.println("Min Dist= "+this._minDistanceFound+"  err= "+(1-this._minDistanceFound/this._bufDistance)+"  Max Dist= "+this._maxDistanceFound+"  err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)};ae.prototype.checkNegativeValid=function(){if(!(this._input instanceof cu||this._input instanceof gh||this._input instanceof te))return null;var n=this.getPolygonLines(this._input);if(this.checkMinimumDistance(n,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(n,this._result,this._maxValidDistance)};ae.prototype.getErrorIndicator=function(){return this._errorIndicator};ae.prototype.checkMinimumDistance=function(n,t,i){var u=new du(n,t,i),r;(this._minDistanceFound=u.distance(),this._minDistanceFound<i)&&(this._isValid=!1,r=u.nearestPoints(),this._errorLocation=u.nearestPoints()[1],this._errorIndicator=n.getFactory().createLineString(r),this._errMsg="Distance between buffer curve and input is too small ("+this._minDistanceFound+" at "+hs.toLineString(r[0],r[1])+" )")};ae.prototype.checkPositiveValid=function(){var n=this._result.getBoundary();if(this.checkMinimumDistance(this._input,n,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(this._input,n,this._maxValidDistance)};ae.prototype.getErrorLocation=function(){return this._errorLocation};ae.prototype.getPolygonLines=function(n){for(var t=new e,r=new ku(t),i=rc.getPolygons(n).iterator();i.hasNext();)i.next().apply(r);return n.getFactory().buildGeometry(t)};ae.prototype.getErrorMessage=function(){return this._errMsg};ae.prototype.interfaces_=function(){return[]};ae.prototype.getClass=function(){return ae};cn.VERBOSE.get=function(){return!1};cn.MAX_DISTANCE_DIFF_FRAC.get=function(){return.012};Object.defineProperties(ae,cn);gu=function(n,t,i){this._isValid=!0;this._errorMsg=null;this._errorLocation=null;this._errorIndicator=null;this._input=n||null;this._distance=t||null;this._result=i||null};ln={VERBOSE:{configurable:!0},MAX_ENV_DIFF_FRAC:{configurable:!0}};gu.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};gu.prototype.checkEnvelope=function(){var n,i,t;if(this._distance<0)return null;n=this._distance*gu.MAX_ENV_DIFF_FRAC;0===n&&(n=.001);i=new l(this._input.getEnvelopeInternal());i.expandBy(this._distance);t=new l(this._result.getEnvelopeInternal());t.expandBy(n);t.contains(i)||(this._isValid=!1,this._errorMsg="Buffer envelope is incorrect",this._errorIndicator=this._input.getFactory().toGeometry(t));this.report("Envelope")};gu.prototype.checkDistance=function(){var n=new ae(this._input,this._distance,this._result);n.isValid()||(this._isValid=!1,this._errorMsg=n.getErrorMessage(),this._errorLocation=n.getErrorLocation(),this._errorIndicator=n.getErrorIndicator());this.report("Distance")};gu.prototype.checkArea=function(){var n=this._input.getArea(),t=this._result.getArea();this._distance>0&&n>t&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result);this._distance<0&&n<t&&(this._isValid=!1,this._errorMsg="Area of negative buffer is larger than input",this._errorIndicator=this._result);this.report("Area")};gu.prototype.checkPolygonal=function(){this._result instanceof cu||this._result instanceof gh||(this._isValid=!1);this._errorMsg="Result is not polygonal";this._errorIndicator=this._result;this.report("Polygonal")};gu.prototype.getErrorIndicator=function(){return this._errorIndicator};gu.prototype.getErrorLocation=function(){return this._errorLocation};gu.prototype.checkExpectedEmpty=function(){return this._input.getDimension()>=2?null:this._distance>0?null:(this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),void this.report("ExpectedEmpty"))};gu.prototype.report=function(n){if(!gu.VERBOSE)return null;rf.out.println("Check "+n+": "+(this._isValid?"passed":"FAILED"))};gu.prototype.getErrorMessage=function(){return this._errorMsg};gu.prototype.interfaces_=function(){return[]};gu.prototype.getClass=function(){return gu};gu.isValidMsg=function(n,t,i){var r=new gu(n,t,i);return r.isValid()?null:r.getErrorMessage()};gu.isValid=function(n,t,i){return!!new gu(n,t,i).isValid()};ln.VERBOSE.get=function(){return!1};ln.MAX_ENV_DIFF_FRAC.get=function(){return.012};Object.defineProperties(gu,ln);ds=function(){this._pts=null;this._data=null;var n=arguments[0],t=arguments[1];this._pts=n;this._data=t};ds.prototype.getCoordinates=function(){return this._pts};ds.prototype.size=function(){return this._pts.length};ds.prototype.getCoordinate=function(n){return this._pts[n]};ds.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])};ds.prototype.getSegmentOctant=function(n){return n===this._pts.length-1?-1:ba.octant(this.getCoordinate(n),this.getCoordinate(n+1))};ds.prototype.setData=function(n){this._data=n};ds.prototype.getData=function(){return this._data};ds.prototype.toString=function(){return hs.toLineString(new dr(this._pts))};ds.prototype.interfaces_=function(){return[fh]};ds.prototype.getClass=function(){return ds};au=function(){this._findAllIntersections=!1;this._isCheckEndSegmentsOnly=!1;this._li=null;this._interiorIntersection=null;this._intSegments=null;this._intersections=new e;this._intersectionCount=0;this._keepIntersections=!0;var n=arguments[0];this._li=n;this._interiorIntersection=null};au.prototype.getInteriorIntersection=function(){return this._interiorIntersection};au.prototype.setCheckEndSegmentsOnly=function(n){this._isCheckEndSegmentsOnly=n};au.prototype.getIntersectionSegments=function(){return this._intSegments};au.prototype.count=function(){return this._intersectionCount};au.prototype.getIntersections=function(){return this._intersections};au.prototype.setFindAllIntersections=function(n){this._findAllIntersections=n};au.prototype.setKeepIntersections=function(n){this._keepIntersections=n};au.prototype.processIntersections=function(n,t,i,r){if(!this._findAllIntersections&&this.hasIntersection()||n===i&&t===r||this._isCheckEndSegmentsOnly&&!(this.isEndSegment(n,t)||this.isEndSegment(i,r)))return null;var u=n.getCoordinates()[t],f=n.getCoordinates()[t+1],e=i.getCoordinates()[r],o=i.getCoordinates()[r+1];this._li.computeIntersection(u,f,e,o);this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=u,this._intSegments[1]=f,this._intSegments[2]=e,this._intSegments[3]=o,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)};au.prototype.isEndSegment=function(n,t){return 0===t||t>=n.size()-2};au.prototype.hasIntersection=function(){return null!==this._interiorIntersection};au.prototype.isDone=function(){return!this._findAllIntersections&&null!==this._interiorIntersection};au.prototype.interfaces_=function(){return[kl]};au.prototype.getClass=function(){return au};au.createAllIntersectionsFinder=function(n){var t=new au(n);return t.setFindAllIntersections(!0),t};au.createAnyIntersectionFinder=function(n){return new au(n)};au.createIntersectionCounter=function(n){var t=new au(n);return t.setFindAllIntersections(!0),t.setKeepIntersections(!1),t};is=function(){this._li=new vl;this._segStrings=null;this._findAllIntersections=!1;this._segInt=null;this._isValid=!0;var n=arguments[0];this._segStrings=n};is.prototype.execute=function(){if(null!==this._segInt)return null;this.checkInteriorIntersections()};is.prototype.getIntersections=function(){return this._segInt.getIntersections()};is.prototype.isValid=function(){return this.execute(),this._isValid};is.prototype.setFindAllIntersections=function(n){this._findAllIntersections=n};is.prototype.checkInteriorIntersections=function(){this._isValid=!0;this._segInt=new au(this._li);this._segInt.setFindAllIntersections(this._findAllIntersections);var n=new dut;if(n.setSegmentIntersector(this._segInt),n.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null};is.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new nc(this.getErrorMessage(),this._segInt.getInteriorIntersection());};is.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var n=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+hs.toLineString(n[0],n[1])+" and "+hs.toLineString(n[2],n[3])};is.prototype.interfaces_=function(){return[]};is.prototype.getClass=function(){return is};is.computeIntersections=function(n){var t=new is(n);return t.setFindAllIntersections(!0),t.isValid(),t.getIntersections()};na=function n(){this._nv=null;var t=arguments[0];this._nv=new is(n.toSegmentStrings(t))};na.prototype.checkValid=function(){this._nv.checkValid()};na.prototype.interfaces_=function(){return[]};na.prototype.getClass=function(){return na};na.toSegmentStrings=function(n){for(var r,t=new e,i=n.iterator();i.hasNext();)r=i.next(),t.add(new ds(r.getCoordinates(),r));return t};na.checkValid=function(n){new na(n).checkValid()};rv=function(n){this._mapOp=n};rv.prototype.map=function(n){for(var r,i=new e,t=0;t<n.getNumGeometries();t++)r=this._mapOp.map(n.getGeometryN(t)),r.isEmpty()||i.add(r);return n.getFactory().createGeometryCollection(ut.toGeometryArray(i))};rv.prototype.interfaces_=function(){return[]};rv.prototype.getClass=function(){return rv};rv.map=function(n,t){return new rv(t).map(n)};gs=function(){this._op=null;this._geometryFactory=null;this._ptLocator=null;this._lineEdgesList=new e;this._resultLineList=new e;var n=arguments[0],t=arguments[1],i=arguments[2];this._op=n;this._geometryFactory=t;this._ptLocator=i};gs.prototype.collectLines=function(n){for(var i,t=this._op.getGraph().getEdgeEnds().iterator();t.hasNext();)i=t.next(),this.collectLineEdge(i,n,this._lineEdgesList),this.collectBoundaryTouchEdge(i,n,this._lineEdgesList)};gs.prototype.labelIsolatedLine=function(n,t){var i=this._ptLocator.locate(n.getCoordinate(),this._op.getArgGeometry(t));n.getLabel().setLocation(t,i)};gs.prototype.build=function(n){return this.findCoveredLineEdges(),this.collectLines(n),this.buildLines(n),this._resultLineList};gs.prototype.collectLineEdge=function(n,t,i){var u=n.getLabel(),r=n.getEdge();n.isLineEdge()&&(n.isVisited()||!tt.isResultOfOp(u,t)||r.isCovered()||(i.add(r),n.setVisitedEdge(!0)))};gs.prototype.findCoveredLineEdges=function(){for(var i,n,r,u,t=this._op.getGraph().getNodes().iterator();t.hasNext();)t.next().getEdges().findCoveredLineEdges();for(i=this._op.getGraph().getEdgeEnds().iterator();i.hasNext();)n=i.next(),r=n.getEdge(),n.isLineEdge()&&!r.isCoveredSet()&&(u=this._op.isCoveredByA(n.getCoordinate()),r.setCovered(u))};gs.prototype.labelIsolatedLines=function(n){for(var t,r,i=n.iterator();i.hasNext();)t=i.next(),r=t.getLabel(),t.isIsolated()&&(r.isNull(0)?this.labelIsolatedLine(t,0):this.labelIsolatedLine(t,1))};gs.prototype.buildLines=function(){for(var t,i,n=this._lineEdgesList.iterator();n.hasNext();)t=n.next(),i=this._geometryFactory.createLineString(t.getCoordinates()),this._resultLineList.add(i),t.setInResult(!0)};gs.prototype.collectBoundaryTouchEdge=function(n,t,i){var r=n.getLabel();return n.isLineEdge()?null:n.isVisited()?null:n.isInteriorAreaEdge()?null:n.getEdge().isInResult()?null:(rt.isTrue(!(n.isInResult()||n.getSym().isInResult())||!n.getEdge().isInResult()),void(tt.isResultOfOp(r,t)&&t===tt.INTERSECTION&&(i.add(n.getEdge()),n.setVisitedEdge(!0))))};gs.prototype.interfaces_=function(){return[]};gs.prototype.getClass=function(){return gs};uv=function(){this._op=null;this._geometryFactory=null;this._resultPointList=new e;var n=arguments[0],t=arguments[1];this._op=n;this._geometryFactory=t};uv.prototype.filterCoveredNodeToPoint=function(n){var t=n.getCoordinate(),i;this._op.isCoveredByLA(t)||(i=this._geometryFactory.createPoint(t),this._resultPointList.add(i))};uv.prototype.extractNonCoveredResultNodes=function(n){for(var t,r,i=this._op.getGraph().getNodes().iterator();i.hasNext();)t=i.next(),t.isInResult()||t.isIncidentEdgeInResult()||0!==t.getEdges().getDegree()&&n!==tt.INTERSECTION||(r=t.getLabel(),tt.isResultOfOp(r,n)&&this.filterCoveredNodeToPoint(t))};uv.prototype.build=function(n){return this.extractNonCoveredResultNodes(n),this._resultPointList};uv.prototype.interfaces_=function(){return[]};uv.prototype.getClass=function(){return uv};ue=function(){this._inputGeom=null;this._factory=null;this._pruneEmptyGeometry=!0;this._preserveGeometryCollectionType=!0;this._preserveCollections=!1;this._preserveType=!1};ue.prototype.transformPoint=function(n){return this._factory.createPoint(this.transformCoordinates(n.getCoordinateSequence(),n))};ue.prototype.transformPolygon=function(n){var o=!0,t=this.transformLinearRing(n.getExteriorRing(),n),r,u,i,f;for(null!==t&&t instanceof dh&&!t.isEmpty()||(o=!1),r=new e,u=0;u<n.getNumInteriorRing();u++)i=this.transformLinearRing(n.getInteriorRingN(u),n),null===i||i.isEmpty()||(i instanceof dh||(o=!1),r.add(i));return o?this._factory.createPolygon(t,r.toArray([])):(f=new e,null!==t&&f.add(t),f.addAll(r),this._factory.buildGeometry(f))};ue.prototype.createCoordinateSequence=function(n){return this._factory.getCoordinateSequenceFactory().create(n)};ue.prototype.getInputGeometry=function(){return this._inputGeom};ue.prototype.transformMultiLineString=function(n){for(var i,r=new e,t=0;t<n.getNumGeometries();t++)i=this.transformLineString(n.getGeometryN(t),n),null!==i&&(i.isEmpty()||r.add(i));return this._factory.buildGeometry(r)};ue.prototype.transformCoordinates=function(n){return this.copy(n)};ue.prototype.transformLineString=function(n){return this._factory.createLineString(this.transformCoordinates(n.getCoordinateSequence(),n))};ue.prototype.transformMultiPoint=function(n){for(var i,r=new e,t=0;t<n.getNumGeometries();t++)i=this.transformPoint(n.getGeometryN(t),n),null!==i&&(i.isEmpty()||r.add(i));return this._factory.buildGeometry(r)};ue.prototype.transformMultiPolygon=function(n){for(var i,r=new e,t=0;t<n.getNumGeometries();t++)i=this.transformPolygon(n.getGeometryN(t),n),null!==i&&(i.isEmpty()||r.add(i));return this._factory.buildGeometry(r)};ue.prototype.copy=function(n){return n.copy()};ue.prototype.transformGeometryCollection=function(n){for(var r,t=new e,i=0;i<n.getNumGeometries();i++)r=this.transform(n.getGeometryN(i)),null!==r&&(this._pruneEmptyGeometry&&r.isEmpty()||t.add(r));return this._preserveGeometryCollectionType?this._factory.createGeometryCollection(ut.toGeometryArray(t)):this._factory.buildGeometry(t)};ue.prototype.transform=function(n){if(this._inputGeom=n,this._factory=n.getFactory(),n instanceof se)return this.transformPoint(n,null);if(n instanceof bp)return this.transformMultiPoint(n,null);if(n instanceof dh)return this.transformLinearRing(n,null);if(n instanceof wr)return this.transformLineString(n,null);if(n instanceof pa)return this.transformMultiLineString(n,null);if(n instanceof cu)return this.transformPolygon(n,null);if(n instanceof gh)return this.transformMultiPolygon(n,null);if(n instanceof te)return this.transformGeometryCollection(n,null);throw new ar("Unknown Geometry subtype: "+n.getClass().getName());};ue.prototype.transformLinearRing=function(n){var t=this.transformCoordinates(n.getCoordinateSequence(),n),i;return null===t?this._factory.createLinearRing(null):(i=t.size(),i>0&&i<4&&!this._preserveType?this._factory.createLineString(t):this._factory.createLinearRing(t))};ue.prototype.interfaces_=function(){return[]};ue.prototype.getClass=function(){return ue};ch=function n(){var i,r,t,u;(this._snapTolerance=0,this._srcPts=null,this._seg=new a,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof wr&&"number"==typeof arguments[1])?(i=arguments[0],r=arguments[1],n.call(this,i.getCoordinates(),r)):arguments[0]instanceof Array&&"number"==typeof arguments[1]&&(t=arguments[0],u=arguments[1],this._srcPts=t,this._isClosed=n.isClosed(t),this._snapTolerance=u)};ch.prototype.snapVertices=function(n,t){for(var e,u,f=this._isClosed?n.size()-1:n.size(),r=0;r<f;r++)e=n.get(r),u=this.findSnapForVertex(e,t),null!==u&&(n.set(r,new i(u)),0===r&&this._isClosed&&n.set(n.size()-1,new i(u)))};ch.prototype.findSnapForVertex=function(n,t){for(var i=0;i<t.length;i++){if(n.equals2D(t[i]))return null;if(n.distance(t[i])<this._snapTolerance)return t[i]}return null};ch.prototype.snapTo=function(n){var t=new tk(this._srcPts);return this.snapVertices(t,n),this.snapSegments(t,n),t.toCoordinateArray()};ch.prototype.snapSegments=function(n,t){var u,r,f,e;if(0===t.length)return null;for(u=t.length,t[0].equals2D(t[t.length-1])&&(u=t.length-1),r=0;r<u;r++)f=t[r],e=this.findSegmentIndexToSnap(f,n),e>=0&&n.add(e+1,new i(f),!1)};ch.prototype.findSegmentIndexToSnap=function(n,t){for(var r,u=it.MAX_VALUE,f=-1,i=0;i<t.size()-1;i++){if(this._seg.p0=t.get(i),this._seg.p1=t.get(i+1),this._seg.p0.equals2D(n)||this._seg.p1.equals2D(n)){if(this._allowSnappingToSourceVertices)continue;return-1}r=this._seg.distance(n);r<this._snapTolerance&&r<u&&(u=r,f=i)}return f};ch.prototype.setAllowSnappingToSourceVertices=function(n){this._allowSnappingToSourceVertices=n};ch.prototype.interfaces_=function(){return[]};ch.prototype.getClass=function(){return ch};ch.isClosed=function(n){return!(n.length<=1)&&n[0].equals2D(n[n.length-1])};nu=function(n){this._srcGeom=n||null};oft={SNAP_PRECISION_FACTOR:{configurable:!0}};nu.prototype.snapTo=function(n,t){var i=this.extractTargetCoordinates(n);return new sft(t,i).transform(this._srcGeom)};nu.prototype.snapToSelf=function(n,t){var u=this.extractTargetCoordinates(this._srcGeom),r=new sft(n,u,!0).transform(this._srcGeom),i=r;return t&&k(i,pc)&&(i=r.buffer(0)),i};nu.prototype.computeSnapTolerance=function(n){return this.computeMinimumSegmentLength(n)/10};nu.prototype.extractTargetCoordinates=function(n){for(var i=new vh,r=n.getCoordinates(),t=0;t<r.length;t++)i.add(r[t]);return i.toArray(new Array(0).fill(null))};nu.prototype.computeMinimumSegmentLength=function(n){for(var r,i=it.MAX_VALUE,t=0;t<n.length-1;t++)r=n[t].distance(n[t+1]),r<i&&(i=r);return i};nu.prototype.interfaces_=function(){return[]};nu.prototype.getClass=function(){return nu};nu.snap=function(n,t,i){var r=new Array(2).fill(null),f=new nu(n),u;return r[0]=f.snapTo(t,i),u=new nu(t),r[1]=u.snapTo(r[0],i),r};nu.computeOverlaySnapTolerance=function(){var t,u,f;if(1===arguments.length){var i=arguments[0],n=nu.computeSizeBasedSnapTolerance(i),r=i.getPrecisionModel();return r.getType()===bi.FIXED&&(t=2/r.getScale()/1.415,t>n&&(n=t)),n}if(2===arguments.length)return u=arguments[0],f=arguments[1],Math.min(nu.computeOverlaySnapTolerance(u),nu.computeOverlaySnapTolerance(f))};nu.computeSizeBasedSnapTolerance=function(n){var t=n.getEnvelopeInternal();return Math.min(t.getHeight(),t.getWidth())*nu.SNAP_PRECISION_FACTOR};nu.snapToSelf=function(n,t,i){return new nu(n).snapToSelf(t,i)};oft.SNAP_PRECISION_FACTOR.get=function(){return 1e-9};Object.defineProperties(nu,oft);sft=function(n){function t(t,i,r){n.call(this);this._snapTolerance=t||null;this._snapPts=i||null;this._isSelfSnap=void 0!==r&&r}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.snapLine=function(n,t){var i=new ch(n,this._snapTolerance);return i.setAllowSnappingToSourceVertices(this._isSelfSnap),i.snapTo(t)},t.prototype.transformCoordinates=function(n){var t=n.toCoordinateArray(),i=this.snapLine(t,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(i)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(ue);yf=function(){this._isFirst=!0;this._commonMantissaBitsCount=53;this._commonBits=0;this._commonSignExp=null};yf.prototype.getCommon=function(){return it.longBitsToDouble(this._commonBits)};yf.prototype.add=function(n){var t=it.doubleToLongBits(n);if(this._isFirst)return this._commonBits=t,this._commonSignExp=yf.signExpBits(this._commonBits),this._isFirst=!1,null;if(yf.signExpBits(t)!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=yf.numCommonMostSigMantissaBits(this._commonBits,t);this._commonBits=yf.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))};yf.prototype.toString=function(){if(1===arguments.length){var t=arguments[0],r=it.longBitsToDouble(t),i="0000000000000000000000000000000000000000000000000000000000000000"+it.toBinaryString(t),n=i.substring(i.length-64);return n.substring(0,1)+"  "+n.substring(1,12)+"(exp) "+n.substring(12)+" [ "+r+" ]"}};yf.prototype.interfaces_=function(){return[]};yf.prototype.getClass=function(){return yf};yf.getBit=function(n,t){return 0!=(n&1<<t)?1:0};yf.signExpBits=function(n){return n>>52};yf.zeroLowerBits=function(n,t){return n&~((1<<t)-1)};yf.numCommonMostSigMantissaBits=function(n,t){for(var r=0,i=52;i>=0;i--){if(yf.getBit(n,i)!==yf.getBit(t,i))return r;r++}return 52};rl=function(){this._commonCoord=null;this._ccFilter=new fv};an={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};rl.prototype.addCommonBits=function(n){var t=new ul(this._commonCoord);n.apply(t);n.geometryChanged()};rl.prototype.removeCommonBits=function(n){var t,r;return 0===this._commonCoord.x&&0===this._commonCoord.y?n:(t=new i(this._commonCoord),t.x=-t.x,t.y=-t.y,r=new ul(t),n.apply(r),n.geometryChanged(),n)};rl.prototype.getCommonCoordinate=function(){return this._commonCoord};rl.prototype.add=function(n){n.apply(this._ccFilter);this._commonCoord=this._ccFilter.getCommonCoordinate()};rl.prototype.interfaces_=function(){return[]};rl.prototype.getClass=function(){return rl};an.CommonCoordinateFilter.get=function(){return fv};an.Translater.get=function(){return ul};Object.defineProperties(rl,an);fv=function(){this._commonBitsX=new yf;this._commonBitsY=new yf};fv.prototype.filter=function(n){this._commonBitsX.add(n.x);this._commonBitsY.add(n.y)};fv.prototype.getCommonCoordinate=function(){return new i(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())};fv.prototype.interfaces_=function(){return[ih]};fv.prototype.getClass=function(){return fv};ul=function(){this.trans=null;var n=arguments[0];this.trans=n};ul.prototype.filter=function(n,t){var i=n.getOrdinate(t,0)+this.trans.x,r=n.getOrdinate(t,1)+this.trans.y;n.setOrdinate(t,0,i);n.setOrdinate(t,1,r)};ul.prototype.isDone=function(){return!1};ul.prototype.isGeometryChanged=function(){return!0};ul.prototype.interfaces_=function(){return[po]};ul.prototype.getClass=function(){return ul};vu=function(n,t){this._geom=new Array(2).fill(null);this._snapTolerance=null;this._cbr=null;this._geom[0]=n;this._geom[1]=t;this.computeSnapTolerance()};vu.prototype.selfSnap=function(n){return new nu(n).snapTo(n,this._snapTolerance)};vu.prototype.removeCommonBits=function(n){this._cbr=new rl;this._cbr.add(n[0]);this._cbr.add(n[1]);var t=new Array(2).fill(null);return t[0]=this._cbr.removeCommonBits(n[0].copy()),t[1]=this._cbr.removeCommonBits(n[1].copy()),t};vu.prototype.prepareResult=function(n){return this._cbr.addCommonBits(n),n};vu.prototype.getResultGeometry=function(n){var t=this.snap(this._geom),i=tt.overlayOp(t[0],t[1],n);return this.prepareResult(i)};vu.prototype.checkValid=function(n){n.isValid()||rf.out.println("Snapped geometry is invalid")};vu.prototype.computeSnapTolerance=function(){this._snapTolerance=nu.computeOverlaySnapTolerance(this._geom[0],this._geom[1])};vu.prototype.snap=function(n){var t=this.removeCommonBits(n);return nu.snap(t[0],t[1],this._snapTolerance)};vu.prototype.interfaces_=function(){return[]};vu.prototype.getClass=function(){return vu};vu.overlayOp=function(n,t,i){return new vu(n,t).getResultGeometry(i)};vu.union=function(n,t){return vu.overlayOp(n,t,tt.UNION)};vu.intersection=function(n,t){return vu.overlayOp(n,t,tt.INTERSECTION)};vu.symDifference=function(n,t){return vu.overlayOp(n,t,tt.SYMDIFFERENCE)};vu.difference=function(n,t){return vu.overlayOp(n,t,tt.DIFFERENCE)};pf=function(n,t){this._geom=new Array(2).fill(null);this._geom[0]=n;this._geom[1]=t};pf.prototype.getResultGeometry=function(n){var t=null,i=!1,r=null;try{t=tt.overlayOp(this._geom[0],this._geom[1],n);i=!0}catch(n){if(!(n instanceof vc))throw n;r=n}if(!i)try{t=vu.overlayOp(this._geom[0],this._geom[1],n)}catch(n){throw n instanceof vc?r:n;}return t};pf.prototype.interfaces_=function(){return[]};pf.prototype.getClass=function(){return pf};pf.overlayOp=function(n,t,i){return new pf(n,t).getResultGeometry(i)};pf.union=function(n,t){return pf.overlayOp(n,t,tt.UNION)};pf.intersection=function(n,t){return pf.overlayOp(n,t,tt.INTERSECTION)};pf.symDifference=function(n,t){return pf.overlayOp(n,t,tt.SYMDIFFERENCE)};pf.difference=function(n,t){return pf.overlayOp(n,t,tt.DIFFERENCE)};hw=function(){this.mce=null;this.chainIndex=null;var n=arguments[0],t=arguments[1];this.mce=n;this.chainIndex=t};hw.prototype.computeIntersections=function(n,t){this.mce.computeIntersectsForChain(this.chainIndex,n.mce,n.chainIndex,t)};hw.prototype.interfaces_=function(){return[]};hw.prototype.getClass=function(){return hw};ve=function n(){var t,i;if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,2===arguments.length)t=arguments[0],i=arguments[1],this._eventType=n.DELETE,this._xValue=t,this._insertEvent=i;else if(3===arguments.length){var r=arguments[0],u=arguments[1],f=arguments[2];this._eventType=n.INSERT;this._label=r;this._xValue=u;this._obj=f}};vn={INSERT:{configurable:!0},DELETE:{configurable:!0}};ve.prototype.isDelete=function(){return this._eventType===ve.DELETE};ve.prototype.setDeleteEventIndex=function(n){this._deleteEventIndex=n};ve.prototype.getObject=function(){return this._obj};ve.prototype.compareTo=function(n){var t=n;return this._xValue<t._xValue?-1:this._xValue>t._xValue?1:this._eventType<t._eventType?-1:this._eventType>t._eventType?1:0};ve.prototype.getInsertEvent=function(){return this._insertEvent};ve.prototype.isInsert=function(){return this._eventType===ve.INSERT};ve.prototype.isSameLabel=function(n){return null!==this._label&&this._label===n._label};ve.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex};ve.prototype.interfaces_=function(){return[co]};ve.prototype.getClass=function(){return ve};vn.INSERT.get=function(){return 1};vn.DELETE.get=function(){return 2};Object.defineProperties(ve,vn);ck=function(){};ck.prototype.interfaces_=function(){return[]};ck.prototype.getClass=function(){return ck};nf=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 n=arguments[0],t=arguments[1],i=arguments[2];this._li=n;this._includeProper=t;this._recordIsolated=i};nf.prototype.isTrivialIntersection=function(n,t,i,r){if(n===i&&1===this._li.getIntersectionNum()){if(nf.isAdjacentSegments(t,r))return!0;if(n.isClosed()){var u=n.getNumPoints()-1;if(0===t&&r===u||0===r&&t===u)return!0}}return!1};nf.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint};nf.prototype.setIsDoneIfProperInt=function(n){this._isDoneWhenProperInt=n};nf.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior};nf.prototype.isBoundaryPointInternal=function(n,t){for(var r,i=t.iterator();i.hasNext();)if(r=i.next().getCoordinate(),n.isIntersection(r))return!0;return!1};nf.prototype.hasProperIntersection=function(){return this._hasProper};nf.prototype.hasIntersection=function(){return this._hasIntersection};nf.prototype.isDone=function(){return this._isDone};nf.prototype.isBoundaryPoint=function(n,t){return null!==t&&(!!this.isBoundaryPointInternal(n,t[0])||!!this.isBoundaryPointInternal(n,t[1]))};nf.prototype.setBoundaryNodes=function(n,t){this._bdyNodes=new Array(2).fill(null);this._bdyNodes[0]=n;this._bdyNodes[1]=t};nf.prototype.addIntersections=function(n,t,i,r){if(n===i&&t===r)return null;this.numTests++;var u=n.getCoordinates()[t],f=n.getCoordinates()[t+1],e=i.getCoordinates()[r],o=i.getCoordinates()[r+1];this._li.computeIntersection(u,f,e,o);this._li.hasIntersection()&&(this._recordIsolated&&(n.setIsolated(!1),i.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(n,t,i,r)||(this._hasIntersection=!0,!this._includeProper&&this._li.isProper()||(n.addIntersections(this._li,t,0),i.addIntersections(this._li,r,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))};nf.prototype.interfaces_=function(){return[]};nf.prototype.getClass=function(){return nf};nf.isAdjacentSegments=function(n,t){return 1===Math.abs(n-t)};var lkt=function(n){function t(){n.call(this);this.events=new e;this.nOverlaps=null}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.prepareEvents=function(){var n,t;for(go.sort(this.events),n=0;n<this.events.size();n++)t=this.events.get(n),t.isDelete()&&t.getInsertEvent().setDeleteEventIndex(n)},t.prototype.computeIntersections=function(){var i,n,t,r,e;if(1===arguments.length){for(i=arguments[0],this.nOverlaps=0,this.prepareEvents(),n=0;n<this.events.size();n++)if(t=this.events.get(n),t.isInsert()&&this.processOverlaps(n,t.getDeleteEventIndex(),t,i),i.isDone())break}else if(3===arguments.length)if(arguments[2]instanceof nf&&k(arguments[0],vo)&&k(arguments[1],vo)){var u=arguments[0],f=arguments[1],o=arguments[2];this.addEdges(u,u);this.addEdges(f,f);this.computeIntersections(o)}else"boolean"==typeof arguments[2]&&k(arguments[0],vo)&&arguments[1]instanceof nf&&(r=arguments[0],e=arguments[1],arguments[2]?this.addEdges(r,null):this.addEdges(r),this.computeIntersections(e))},t.prototype.addEdge=function(n,t){for(var f,u,r=n.getMonotoneChainEdge(),e=r.getStartIndexes(),i=0;i<e.length-1;i++)f=new hw(r,i),u=new ve(t,r.getMinX(i),f),this.events.add(u),this.events.add(new ve(r.getMaxX(i),u))},t.prototype.processOverlaps=function(n,t,i,r){for(var f,o,e=i.getObject(),u=n;u<t;u++)f=this.events.get(u),f.isInsert()&&(o=f.getObject(),i.isSameLabel(f)||(e.computeIntersections(o,r),this.nOverlaps++))},t.prototype.addEdges=function(){var n,t,r;if(1===arguments.length)for(n=arguments[0].iterator();n.hasNext();)t=n.next(),this.addEdge(t,t);else if(2===arguments.length)for(var u=arguments[0],f=arguments[1],i=u.iterator();i.hasNext();)r=i.next(),this.addEdge(r,f)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(ck),uc=function(){this._min=it.POSITIVE_INFINITY;this._max=it.NEGATIVE_INFINITY},kvt={NodeComparator:{configurable:!0}};uc.prototype.getMin=function(){return this._min};uc.prototype.intersects=function(n,t){return!(this._min>t||this._max<n)};uc.prototype.getMax=function(){return this._max};uc.prototype.toString=function(){return hs.toLineString(new i(this._min,0),new i(this._max,0))};uc.prototype.interfaces_=function(){return[]};uc.prototype.getClass=function(){return uc};kvt.NodeComparator.get=function(){return cw};Object.defineProperties(uc,kvt);cw=function(){};cw.prototype.compare=function(n,t){var i=n,r=t,u=(i._min+i._max)/2,f=(r._min+r._max)/2;return u<f?-1:u>f?1:0};cw.prototype.interfaces_=function(){return[sp]};cw.prototype.getClass=function(){return cw};var akt=function(n){function t(){n.call(this);this._item=null;var t=arguments[0],i=arguments[1],r=arguments[2];this._min=t;this._max=i;this._item=r}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.query=function(n,t,i){if(!this.intersects(n,t))return null;i.visitItem(this._item)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(uc),vkt=function(n){function t(){n.call(this);this._node1=null;this._node2=null;var t=arguments[0],i=arguments[1];this._node1=t;this._node2=i;this.buildExtent(this._node1,this._node2)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.buildExtent=function(n,t){this._min=Math.min(n._min,t._min);this._max=Math.max(n._max,t._max)},t.prototype.query=function(n,t,i){if(!this.intersects(n,t))return null;null!==this._node1&&this._node1.query(n,t,i);null!==this._node2&&this._node2.query(n,t,i)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(uc),fc=function(){this._leaves=new e;this._root=null;this._level=0};fc.prototype.buildTree=function(){go.sort(this._leaves,new uc.NodeComparator);for(var t=this._leaves,i=null,n=new e;;){if(this.buildLevel(t,n),1===n.size())return n.get(0);i=t;t=n;n=i}};fc.prototype.insert=function(n,t,i){if(null!==this._root)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new akt(n,t,i))};fc.prototype.query=function(n,t,i){this.init();this._root.query(n,t,i)};fc.prototype.buildRoot=function(){if(null!==this._root)return null;this._root=this.buildTree()};fc.prototype.printNode=function(n){rf.out.println(hs.toLineString(new i(n._min,this._level),new i(n._max,this._level)))};fc.prototype.init=function(){if(null!==this._root)return null;this.buildRoot()};fc.prototype.buildLevel=function(n,t){var i,r,u;for(this._level++,t.clear(),i=0;i<n.size();i+=2)r=n.get(i),null===(i+1<n.size()?n.get(i):null)?t.add(r):(u=new vkt(n.get(i),n.get(i+1)),t.add(u))};fc.prototype.interfaces_=function(){return[]};fc.prototype.getClass=function(){return fc};oy=function(){this._items=new e};oy.prototype.visitItem=function(n){this._items.add(n)};oy.prototype.getItems=function(){return this._items};oy.prototype.interfaces_=function(){return[bc]};oy.prototype.getClass=function(){return oy};sy=function(){this._index=null;var n=arguments[0];if(!k(n,pc))throw new ar("Argument must be Polygonal");this._index=new ta(n)};yn={SegmentVisitor:{configurable:!0},IntervalIndexedGeometry:{configurable:!0}};sy.prototype.locate=function(n){var t=new cs(n),i=new hy(t);return this._index.query(n.y,n.y,i),t.getLocation()};sy.prototype.interfaces_=function(){return[uy]};sy.prototype.getClass=function(){return sy};yn.SegmentVisitor.get=function(){return hy};yn.IntervalIndexedGeometry.get=function(){return ta};Object.defineProperties(sy,yn);hy=function(){this._counter=null;var n=arguments[0];this._counter=n};hy.prototype.visitItem=function(n){var t=n;this._counter.countSegment(t.getCoordinate(0),t.getCoordinate(1))};hy.prototype.interfaces_=function(){return[bc]};hy.prototype.getClass=function(){return hy};ta=function(){this._index=new fc;var n=arguments[0];this.init(n)};ta.prototype.init=function(n){for(var i,t=ku.getLines(n).iterator();t.hasNext();)i=t.next().getCoordinates(),this.addLine(i)};ta.prototype.addLine=function(n){for(var t=1;t<n.length;t++){var i=new a(n[t-1],n[t]),r=Math.min(i.p0.y,i.p1.y),u=Math.max(i.p0.y,i.p1.y);this._index.insert(r,u,i)}};ta.prototype.query=function(){if(2===arguments.length){var t=arguments[0],i=arguments[1],n=new oy;return this._index.query(t,i,n),n.getItems()}if(3===arguments.length){var r=arguments[0],u=arguments[1],f=arguments[2];this._index.query(r,u,f)}};ta.prototype.interfaces_=function(){return[]};ta.prototype.getClass=function(){return ta};lw=function(n){function t(){if(n.call(this),this._parentGeom=null,this._lineEdgeMap=new lvt,this._boundaryNodeRule=null,this._useBoundaryDeterminationRule=!0,this._argIndex=null,this._boundaryNodes=null,this._hasTooFewPoints=!1,this._invalidPoint=null,this._areaPtLocator=null,this._ptLocator=new ts,2===arguments.length){var r=arguments[0],t=arguments[1],u=ro.OGC_SFS_BOUNDARY_RULE;this._argIndex=r;this._parentGeom=t;this._boundaryNodeRule=u;null!==t&&this.add(t)}else if(3===arguments.length){var f=arguments[0],i=arguments[1],e=arguments[2];this._argIndex=f;this._parentGeom=i;this._boundaryNodeRule=e;null!==i&&this.add(i)}}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.insertBoundaryPoint=function(n,i){var u=this._nodes.addNode(i).getLabel(),e=1,o;r.NONE;u.getLocation(n,f.ON)===r.BOUNDARY&&e++;o=t.determineBoundary(this._boundaryNodeRule,e);u.setLocation(n,o)},t.prototype.computeSelfNodes=function(){var t,i;if(2===arguments.length)return t=arguments[0],i=arguments[1],this.computeSelfNodes(t,i,!1);if(3===arguments.length){var r=arguments[0],u=arguments[1],f=arguments[2],n=new nf(r,!0,!1);n.setIsDoneIfProperInt(f);var e=this.createEdgeSetIntersector(),o=this._parentGeom instanceof dh||this._parentGeom instanceof cu||this._parentGeom instanceof gh,s=u||!o;return e.computeIntersections(this._edges,n,s),this.addSelfIntersectionNodes(this._argIndex),n}},t.prototype.computeSplitEdges=function(n){for(var t=this._edges.iterator();t.hasNext();)t.next().eiList.addSplitEdges(n)},t.prototype.computeEdgeIntersections=function(n,t,i){var r=new nf(t,i,!0);return r.setBoundaryNodes(this.getBoundaryNodes(),n.getBoundaryNodes()),this.createEdgeSetIntersector().computeIntersections(this._edges,n._edges,r),r},t.prototype.getGeometry=function(){return this._parentGeom},t.prototype.getBoundaryNodeRule=function(){return this._boundaryNodeRule},t.prototype.hasTooFewPoints=function(){return this._hasTooFewPoints},t.prototype.addPoint=function(){var n,t;arguments[0]instanceof se?(n=arguments[0].getCoordinate(),this.insertPoint(this._argIndex,n,r.INTERIOR)):arguments[0]instanceof i&&(t=arguments[0],this.insertPoint(this._argIndex,t,r.INTERIOR))},t.prototype.addPolygon=function(n){var t,i;for(this.addPolygonRing(n.getExteriorRing(),r.EXTERIOR,r.INTERIOR),t=0;t<n.getNumInteriorRing();t++)i=n.getInteriorRingN(t),this.addPolygonRing(i,r.INTERIOR,r.EXTERIOR)},t.prototype.addEdge=function(n){this.insertEdge(n);var t=n.getCoordinates();this.insertPoint(this._argIndex,t[0],r.BOUNDARY);this.insertPoint(this._argIndex,t[t.length-1],r.BOUNDARY)},t.prototype.addLineString=function(n){var t=ft.removeRepeatedPoints(n.getCoordinates()),i;if(t.length<2)return this._hasTooFewPoints=!0,this._invalidPoint=t[0],null;i=new hk(t,new di(this._argIndex,r.INTERIOR));this._lineEdgeMap.put(n,i);this.insertEdge(i);rt.isTrue(t.length>=2,"found LineString with single point");this.insertBoundaryPoint(this._argIndex,t[0]);this.insertBoundaryPoint(this._argIndex,t[t.length-1])},t.prototype.getInvalidPoint=function(){return this._invalidPoint},t.prototype.getBoundaryPoints=function(){for(var r,n=this.getBoundaryNodes(),t=new Array(n.size()).fill(null),u=0,i=n.iterator();i.hasNext();)r=i.next(),t[u++]=r.getCoordinate().copy();return t},t.prototype.getBoundaryNodes=function(){return null===this._boundaryNodes&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},t.prototype.addSelfIntersectionNode=function(n,t,i){if(this.isBoundaryNode(n,t))return null;i===r.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(n,t):this.insertPoint(n,t,i)},t.prototype.addPolygonRing=function(n,t,i){var u,f,e,s;if(n.isEmpty())return null;if(u=ft.removeRepeatedPoints(n.getCoordinates()),u.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=u[0],null;f=t;e=i;o.isCCW(u)&&(f=i,e=t);s=new hk(u,new di(this._argIndex,r.BOUNDARY,f,e));this._lineEdgeMap.put(n,s);this.insertEdge(s);this.insertPoint(this._argIndex,u[0],r.BOUNDARY)},t.prototype.insertPoint=function(n,t,i){var r=this._nodes.addNode(t),u=r.getLabel();null===u?r._label=new di(n,i):u.setLocation(n,i)},t.prototype.createEdgeSetIntersector=function(){return new lkt},t.prototype.addSelfIntersectionNodes=function(n){for(var u,t=this._edges.iterator();t.hasNext();)for(var i=t.next(),f=i.getLabel().getLocation(n),r=i.eiList.iterator();r.hasNext();)u=r.next(),this.addSelfIntersectionNode(n,u.coord,f)},t.prototype.add=function(){if(1!==arguments.length)return n.prototype.add.apply(this,arguments);var t=arguments[0];if(t.isEmpty())return null;if(t instanceof gh&&(this._useBoundaryDeterminationRule=!1),t instanceof cu)this.addPolygon(t);else if(t instanceof wr)this.addLineString(t);else if(t instanceof se)this.addPoint(t);else if(t instanceof bp)this.addCollection(t);else if(t instanceof pa)this.addCollection(t);else if(t instanceof gh)this.addCollection(t);else{if(!(t instanceof te))throw new Error(t.getClass().getName());this.addCollection(t)}},t.prototype.addCollection=function(n){for(var i,t=0;t<n.getNumGeometries();t++)i=n.getGeometryN(t),this.add(i)},t.prototype.locate=function(n){return k(this._parentGeom,pc)&&this._parentGeom.getNumGeometries()>50?(null===this._areaPtLocator&&(this._areaPtLocator=new sy(this._parentGeom)),this._areaPtLocator.locate(n)):this._ptLocator.locate(n,this._parentGeom)},t.prototype.findEdge=function(){if(1===arguments.length){var t=arguments[0];return this._lineEdgeMap.get(t)}return n.prototype.findEdge.apply(this,arguments)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t.determineBoundary=function(n,t){return n.isInBoundary(t)?r.BOUNDARY:r.INTERIOR},t}(yr);cy=function(){var n;if(this._li=new vl,this._resultPrecisionModel=null,this._arg=null,1===arguments.length)n=arguments[0],this.setComputationPrecision(n.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new lw(0,n);else if(2===arguments.length){var t=arguments[0],i=arguments[1],f=ro.OGC_SFS_BOUNDARY_RULE;t.getPrecisionModel().compareTo(i.getPrecisionModel())>=0?this.setComputationPrecision(t.getPrecisionModel()):this.setComputationPrecision(i.getPrecisionModel());this._arg=new Array(2).fill(null);this._arg[0]=new lw(0,t,f);this._arg[1]=new lw(1,i,f)}else if(3===arguments.length){var r=arguments[0],u=arguments[1],e=arguments[2];r.getPrecisionModel().compareTo(u.getPrecisionModel())>=0?this.setComputationPrecision(r.getPrecisionModel()):this.setComputationPrecision(u.getPrecisionModel());this._arg=new Array(2).fill(null);this._arg[0]=new lw(0,r,e);this._arg[1]=new lw(1,u,e)}};cy.prototype.getArgGeometry=function(n){return this._arg[n].getGeometry()};cy.prototype.setComputationPrecision=function(n){this._resultPrecisionModel=n;this._li.setPrecisionModel(this._resultPrecisionModel)};cy.prototype.interfaces_=function(){return[]};cy.prototype.getClass=function(){return cy};ia=function(){};ia.prototype.interfaces_=function(){return[]};ia.prototype.getClass=function(){return ia};ia.map=function(){var i,s,r;if(arguments[0]instanceof b&&k(arguments[1],ia.MapOp)){for(var n=arguments[0],h=arguments[1],u=new e,t=0;t<n.getNumGeometries();t++)i=h.map(n.getGeometryN(t)),null!==i&&u.add(i);return n.getFactory().buildGeometry(u)}if(k(arguments[0],eu)&&k(arguments[1],ia.MapOp)){for(var c=arguments[0],l=arguments[1],f=new e,o=c.iterator();o.hasNext();)s=o.next(),r=l.map(s),null!==r&&f.add(r);return f}};ia.MapOp=function(){};tt=function(n){function t(){var t=arguments[0],i=arguments[1];n.call(this,t,i);this._ptLocator=new ts;this._geomFact=null;this._resultGeom=null;this._graph=null;this._edgeList=new ns;this._resultPolyList=new e;this._resultLineList=new e;this._resultPointList=new e;this._graph=new yr(new bvt);this._geomFact=t.getFactory()}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.insertUniqueEdge=function(n){var t=this._edgeList.findEqualEdge(n),u,i,r;null!==t?(u=t.getLabel(),i=n.getLabel(),t.isPointwiseEqual(n)||(i=new di(n.getLabel())).flip(),r=t.getDepth(),r.isNull()&&r.add(u),r.add(i),u.merge(i)):this._edgeList.add(n)},t.prototype.getGraph=function(){return this._graph},t.prototype.cancelDuplicateResultEdges=function(){for(var n,i,t=this._graph.getEdgeEnds().iterator();t.hasNext();)n=t.next(),i=n.getSym(),n.isInResult()&&i.isInResult()&&(n.setInResult(!1),i.setInResult(!1))},t.prototype.isCoveredByLA=function(n){return!!this.isCovered(n,this._resultLineList)||!!this.isCovered(n,this._resultPolyList)},t.prototype.computeGeometry=function(n,i,r,u){var f=new e;return f.addAll(n),f.addAll(i),f.addAll(r),f.isEmpty()?t.createEmptyResult(u,this._arg[0].getGeometry(),this._arg[1].getGeometry(),this._geomFact):this._geomFact.buildGeometry(f)},t.prototype.mergeSymLabels=function(){for(var n=this._graph.getNodes().iterator();n.hasNext();)n.next().getEdges().mergeSymLabels()},t.prototype.isCovered=function(n,t){for(var u,i=t.iterator();i.hasNext();)if(u=i.next(),this._ptLocator.locate(n,u)!==r.EXTERIOR)return!0;return!1},t.prototype.replaceCollapsedEdges=function(){for(var i,t=new e,n=this._edgeList.iterator();n.hasNext();)i=n.next(),i.isCollapsed()&&(n.remove(),t.add(i.getCollapsedEdge()));this._edgeList.addAll(t)},t.prototype.updateNodeLabelling=function(){for(var t,i,n=this._graph.getNodes().iterator();n.hasNext();)t=n.next(),i=t.getEdges().getLabel(),t.getLabel().merge(i)},t.prototype.getResultGeometry=function(n){return this.computeOverlay(n),this._resultGeom},t.prototype.insertUniqueEdges=function(n){for(var i,t=n.iterator();t.hasNext();)i=t.next(),this.insertUniqueEdge(i)},t.prototype.computeOverlay=function(n){var t,i,r,u;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);t=new e;this._arg[0].computeSplitEdges(t);this._arg[1].computeSplitEdges(t);this.insertUniqueEdges(t);this.computeLabelsFromDepths();this.replaceCollapsedEdges();na.checkValid(this._edgeList.getEdges());this._graph.addEdges(this._edgeList.getEdges());this.computeLabelling();this.labelIncompleteNodes();this.findResultAreaEdges(n);this.cancelDuplicateResultEdges();i=new he(this._geomFact);i.add(this._graph);this._resultPolyList=i.getPolygons();r=new gs(this,this._geomFact,this._ptLocator);this._resultLineList=r.build(n);u=new uv(this,this._geomFact,this._ptLocator);this._resultPointList=u.build(n);this._resultGeom=this.computeGeometry(this._resultPointList,this._resultLineList,this._resultPolyList,n)},t.prototype.labelIncompleteNode=function(n,t){var i=this._ptLocator.locate(n.getCoordinate(),this._arg[t].getGeometry());n.getLabel().setLocation(t,i)},t.prototype.copyPoints=function(n){for(var i,t=this._arg[n].getNodeIterator();t.hasNext();)i=t.next(),this._graph.addNode(i.getCoordinate()).setLabel(n,i.getLabel().getLocation(n))},t.prototype.findResultAreaEdges=function(n){for(var i,r,u=this._graph.getEdgeEnds().iterator();u.hasNext();)i=u.next(),r=i.getLabel(),r.isArea()&&!i.isInteriorAreaEdge()&&t.isResultOfOp(r.getLocation(0,f.RIGHT),r.getLocation(1,f.RIGHT),n)&&i.setInResult(!0)},t.prototype.computeLabelsFromDepths=function(){for(var n,r=this._edgeList.iterator();r.hasNext();){var u=r.next(),i=u.getLabel(),t=u.getDepth();if(!t.isNull())for(t.normalize(),n=0;n<2;n++)i.isNull(n)||!i.isArea()||t.isNull(n)||(0===t.getDelta(n)?i.toLine(n):(rt.isTrue(!t.isNull(n,f.LEFT),"depth of LEFT side has not been initialized"),i.setLocation(n,f.LEFT,t.getLocation(n,f.LEFT)),rt.isTrue(!t.isNull(n,f.RIGHT),"depth of RIGHT side has not been initialized"),i.setLocation(n,f.RIGHT,t.getLocation(n,f.RIGHT))))}},t.prototype.computeLabelling=function(){for(var n=this._graph.getNodes().iterator();n.hasNext();)n.next().getEdges().computeLabelling(this._arg);this.mergeSymLabels();this.updateNodeLabelling()},t.prototype.labelIncompleteNodes=function(){for(var n,i,t=this._graph.getNodes().iterator();t.hasNext();)n=t.next(),i=n.getLabel(),n.isIsolated()&&(i.isNull(0)?this.labelIncompleteNode(n,0):this.labelIncompleteNode(n,1)),n.getEdges().updateLabelling(i)},t.prototype.isCoveredByA=function(n){return!!this.isCovered(n,this._resultPolyList)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},t}(cy);tt.overlayOp=function(n,t,i){return new tt(n,t).getResultGeometry(i)};tt.intersection=function(n,t){if(n.isEmpty()||t.isEmpty())return tt.createEmptyResult(tt.INTERSECTION,n,t,n.getFactory());if(n.isGeometryCollection()){var i=t;return rv.map(n,{interfaces_:function(){return[ia.MapOp]},map:function(n){return n.intersection(i)}})}return n.checkNotGeometryCollection(n),n.checkNotGeometryCollection(t),pf.overlayOp(n,t,tt.INTERSECTION)};tt.symDifference=function(n,t){if(n.isEmpty()||t.isEmpty()){if(n.isEmpty()&&t.isEmpty())return tt.createEmptyResult(tt.SYMDIFFERENCE,n,t,n.getFactory());if(n.isEmpty())return t.copy();if(t.isEmpty())return n.copy()}return n.checkNotGeometryCollection(n),n.checkNotGeometryCollection(t),pf.overlayOp(n,t,tt.SYMDIFFERENCE)};tt.resultDimension=function(n,t,i){var u=t.getDimension(),f=i.getDimension(),r=-1;switch(n){case tt.INTERSECTION:r=Math.min(u,f);break;case tt.UNION:r=Math.max(u,f);break;case tt.DIFFERENCE:r=u;break;case tt.SYMDIFFERENCE:r=Math.max(u,f)}return r};tt.createEmptyResult=function(n,t,i,r){var u=null;switch(tt.resultDimension(n,t,i)){case-1:u=r.createGeometryCollection(new Array(0).fill(null));break;case 0:u=r.createPoint();break;case 1:u=r.createLineString();break;case 2:u=r.createPolygon()}return u};tt.difference=function(n,t){return n.isEmpty()?tt.createEmptyResult(tt.DIFFERENCE,n,t,n.getFactory()):t.isEmpty()?n.copy():(n.checkNotGeometryCollection(n),n.checkNotGeometryCollection(t),pf.overlayOp(n,t,tt.DIFFERENCE))};tt.isResultOfOp=function(){if(2===arguments.length){var i=arguments[0],u=arguments[1],f=i.getLocation(0),e=i.getLocation(1);return tt.isResultOfOp(f,e,u)}if(3===arguments.length){var n=arguments[0],t=arguments[1],o=arguments[2];switch(n===r.BOUNDARY&&(n=r.INTERIOR),t===r.BOUNDARY&&(t=r.INTERIOR),o){case tt.INTERSECTION:return n===r.INTERIOR&&t===r.INTERIOR;case tt.UNION:return n===r.INTERIOR||t===r.INTERIOR;case tt.DIFFERENCE:return n===r.INTERIOR&&t!==r.INTERIOR;case tt.SYMDIFFERENCE:return n===r.INTERIOR&&t!==r.INTERIOR||n!==r.INTERIOR&&t===r.INTERIOR}return!1}};tt.INTERSECTION=1;tt.UNION=2;tt.DIFFERENCE=3;tt.SYMDIFFERENCE=4;fl=function(){this._g=null;this._boundaryDistanceTolerance=null;this._linework=null;this._ptLocator=new ts;this._seg=new a;var n=arguments[0],t=arguments[1];this._g=n;this._boundaryDistanceTolerance=t;this._linework=this.extractLinework(n)};fl.prototype.isWithinToleranceOfBoundary=function(n){for(var r,t,i=0;i<this._linework.getNumGeometries();i++)for(r=this._linework.getGeometryN(i).getCoordinateSequence(),t=0;t<r.size()-1;t++)if(r.getCoordinate(t,this._seg.p0),r.getCoordinate(t+1,this._seg.p1),this._seg.distance(n)<=this._boundaryDistanceTolerance)return!0;return!1};fl.prototype.getLocation=function(n){return this.isWithinToleranceOfBoundary(n)?r.BOUNDARY:this._ptLocator.locate(n,this._g)};fl.prototype.extractLinework=function(n){var t=new ly,i,r;return n.apply(t),i=t.getLinework(),r=ut.toLineStringArray(i),n.getFactory().createMultiLineString(r)};fl.prototype.interfaces_=function(){return[]};fl.prototype.getClass=function(){return fl};ly=function(){this._linework=null;this._linework=new e};ly.prototype.getLinework=function(){return this._linework};ly.prototype.filter=function(n){var t,i;if(n instanceof cu)for(t=n,this._linework.add(t.getExteriorRing()),i=0;i<t.getNumInteriorRing();i++)this._linework.add(t.getInteriorRingN(i))};ly.prototype.interfaces_=function(){return[ls]};ly.prototype.getClass=function(){return ly};ra=function(){this._g=null;this._doLeft=!0;this._doRight=!0;var n=arguments[0];this._g=n};ra.prototype.extractPoints=function(n,t,i){for(var u=n.getCoordinates(),r=0;r<u.length-1;r++)this.computeOffsetPoints(u[r],u[r+1],t,i)};ra.prototype.setSidesToGenerate=function(n,t){this._doLeft=n;this._doRight=t};ra.prototype.getPoints=function(n){for(var r,t=new e,i=ku.getLines(this._g).iterator();i.hasNext();)r=i.next(),this.extractPoints(r,n,t);return t};ra.prototype.computeOffsetPoints=function(n,t,r,u){var f=t.x-n.x,e=t.y-n.y,o=Math.sqrt(f*f+e*e),s=r*f/o,h=r*e/o,c=(t.x+n.x)/2,l=(t.y+n.y)/2,a,v;this._doLeft&&(a=new i(c-h,l+s),u.add(a));this._doRight&&(v=new i(c+h,l-s),u.add(v))};ra.prototype.interfaces_=function(){return[]};ra.prototype.getClass=function(){return ra};de=function n(){this._geom=null;this._locFinder=null;this._location=new Array(3).fill(null);this._invalidLocation=null;this._boundaryDistanceTolerance=n.TOLERANCE;this._testCoords=new e;var t=arguments[0],i=arguments[1],r=arguments[2];this._boundaryDistanceTolerance=n.computeBoundaryDistanceTolerance(t,i);this._geom=[t,i,r];this._locFinder=[new fl(this._geom[0],this._boundaryDistanceTolerance),new fl(this._geom[1],this._boundaryDistanceTolerance),new fl(this._geom[2],this._boundaryDistanceTolerance)]};hft={TOLERANCE:{configurable:!0}};de.prototype.reportResult=function(n,t,i){rf.out.println("Overlay result invalid - A:"+r.toLocationSymbol(t[0])+" B:"+r.toLocationSymbol(t[1])+" expected:"+(i?"i":"e")+" actual:"+r.toLocationSymbol(t[2]))};de.prototype.isValid=function(n){this.addTestPts(this._geom[0]);this.addTestPts(this._geom[1]);return this.checkValid(n)};de.prototype.checkValid=function(){var u,n,i,f,t;if(1===arguments.length){for(u=arguments[0],n=0;n<this._testCoords.size();n++)if(i=this._testCoords.get(n),!this.checkValid(u,i))return this._invalidLocation=i,!1;return!0}if(2===arguments.length)return f=arguments[0],t=arguments[1],this._location[0]=this._locFinder[0].getLocation(t),this._location[1]=this._locFinder[1].getLocation(t),this._location[2]=this._locFinder[2].getLocation(t),!!de.hasLocation(this._location,r.BOUNDARY)||this.isValidResult(f,this._location)};de.prototype.addTestPts=function(n){var t=new ra(n);this._testCoords.addAll(t.getPoints(5*this._boundaryDistanceTolerance))};de.prototype.isValidResult=function(n,t){var i=tt.isResultOfOp(t[0],t[1],n),u=!(i^t[2]===r.INTERIOR);return u||this.reportResult(n,t,i),u};de.prototype.getInvalidLocation=function(){return this._invalidLocation};de.prototype.interfaces_=function(){return[]};de.prototype.getClass=function(){return de};de.hasLocation=function(n,t){for(var i=0;i<3;i++)if(n[i]===t)return!0;return!1};de.computeBoundaryDistanceTolerance=function(n,t){return Math.min(nu.computeSizeBasedSnapTolerance(n),nu.computeSizeBasedSnapTolerance(t))};de.isValid=function(n,t,i,r){return new de(n,t,r).isValid(i)};hft.TOLERANCE.get=function(){return 1e-6};Object.defineProperties(de,hft);ge=function n(t){this._geomFactory=null;this._skipEmpty=!1;this._inputGeoms=null;this._geomFactory=n.extractFactory(t);this._inputGeoms=t};ge.prototype.extractElements=function(n,t){var i,r;if(null===n)return null;for(i=0;i<n.getNumGeometries();i++)r=n.getGeometryN(i),this._skipEmpty&&r.isEmpty()||t.add(r)};ge.prototype.combine=function(){for(var i,n=new e,t=this._inputGeoms.iterator();t.hasNext();)i=t.next(),this.extractElements(i,n);return 0===n.size()?null!==this._geomFactory?this._geomFactory.createGeometryCollection(null):null:this._geomFactory.buildGeometry(n)};ge.prototype.interfaces_=function(){return[]};ge.prototype.getClass=function(){return ge};ge.combine=function(){var n,t,i;if(1===arguments.length)return n=arguments[0],new ge(n).combine();if(2===arguments.length)return t=arguments[0],i=arguments[1],new ge(ge.createList(t,i)).combine();if(3===arguments.length){var r=arguments[0],u=arguments[1],f=arguments[2];return new ge(ge.createList(r,u,f)).combine()}};ge.extractFactory=function(n){return n.isEmpty()?null:n.iterator().next().getFactory()};ge.createList=function(){if(2===arguments.length){var i=arguments[0],r=arguments[1],t=new e;return t.add(i),t.add(r),t}if(3===arguments.length){var u=arguments[0],f=arguments[1],o=arguments[2],n=new e;return n.add(u),n.add(f),n.add(o),n}};uu=function(){this._inputPolys=null;this._geomFactory=null;var n=arguments[0];this._inputPolys=n;null===this._inputPolys&&(this._inputPolys=new e)};cft={STRTREE_NODE_CAPACITY:{configurable:!0}};uu.prototype.reduceToGeometries=function(n){for(var t,i,r=new e,u=n.iterator();u.hasNext();)t=u.next(),i=null,k(t,vo)?i=this.unionTree(t):t instanceof b&&(i=t),r.add(i);return r};uu.prototype.extractByEnvelope=function(n,t,i){for(var u,f=new e,r=0;r<t.getNumGeometries();r++)u=t.getGeometryN(r),u.getEnvelopeInternal().intersects(n)?f.add(u):i.add(u);return this._geomFactory.buildGeometry(f)};uu.prototype.unionOptimized=function(n,t){var i=n.getEnvelopeInternal(),r=t.getEnvelopeInternal(),u;return i.intersects(r)?n.getNumGeometries()<=1&&t.getNumGeometries()<=1?this.unionActual(n,t):(u=i.intersection(r),this.unionUsingEnvelopeIntersection(n,t,u)):ge.combine(n,t)};uu.prototype.union=function(){var n,t,i,r;if(null===this._inputPolys)throw new Error("union() method cannot be called twice");if(this._inputPolys.isEmpty())return null;for(this._geomFactory=this._inputPolys.iterator().next().getFactory(),n=new yvt(uu.STRTREE_NODE_CAPACITY),t=this._inputPolys.iterator();t.hasNext();)i=t.next(),n.insert(i.getEnvelopeInternal(),i);return this._inputPolys=null,r=n.itemsTree(),this.unionTree(r)};uu.prototype.binaryUnion=function(){var r,u;if(1===arguments.length)return r=arguments[0],this.binaryUnion(r,0,r.size());if(3===arguments.length){var t=arguments[0],n=arguments[1],i=arguments[2];if(i-n<=1)return u=uu.getGeometry(t,n),this.unionSafe(u,null);if(i-n==2)return this.unionSafe(uu.getGeometry(t,n),uu.getGeometry(t,n+1));var f=Math.trunc((i+n)/2),e=this.binaryUnion(t,n,f),o=this.binaryUnion(t,f,i);return this.unionSafe(e,o)}};uu.prototype.repeatedUnion=function(n){for(var r,t=null,i=n.iterator();i.hasNext();)r=i.next(),t=null===t?r.copy():t.union(r);return t};uu.prototype.unionSafe=function(n,t){return null===n&&null===t?null:null===n?t.copy():null===t?n.copy():this.unionOptimized(n,t)};uu.prototype.unionActual=function(n,t){return uu.restrictToPolygons(n.union(t))};uu.prototype.unionTree=function(n){var t=this.reduceToGeometries(n);return this.binaryUnion(t)};uu.prototype.unionUsingEnvelopeIntersection=function(n,t,i){var r=new e,u=this.extractByEnvelope(i,n,r),f=this.extractByEnvelope(i,t,r),o=this.unionActual(u,f);return r.add(o),ge.combine(r)};uu.prototype.bufferUnion=function(){var n,t,i;return 1===arguments.length?(n=arguments[0],n.get(0).getFactory().buildGeometry(n).buffer(0)):2===arguments.length?(t=arguments[0],i=arguments[1],t.getFactory().createGeometryCollection([t,i]).buffer(0)):void 0};uu.prototype.interfaces_=function(){return[]};uu.prototype.getClass=function(){return uu};uu.restrictToPolygons=function(n){if(k(n,pc))return n;var t=rc.getPolygons(n);return 1===t.size()?t.get(0):n.getFactory().createMultiPolygon(ut.toPolygonArray(t))};uu.getGeometry=function(n,t){return t>=n.size()?null:n.get(t)};uu.union=function(n){return new uu(n).union()};cft.STRTREE_NODE_CAPACITY.get=function(){return 4};Object.defineProperties(uu,cft);aw=function(){};aw.prototype.interfaces_=function(){return[]};aw.prototype.getClass=function(){return aw};aw.union=function(n,t){if(n.isEmpty()||t.isEmpty()){if(n.isEmpty()&&t.isEmpty())return tt.createEmptyResult(tt.UNION,n,t,n.getFactory());if(n.isEmpty())return t.copy();if(t.isEmpty())return n.copy()}return n.checkNotGeometryCollection(n),n.checkNotGeometryCollection(t),pf.overlayOp(n,t,tt.UNION)};ua=function(){return new tg};tg.prototype={constructor:tg,reset:function(){this.s=this.t=0},add:function(n){ult(pn,n,this.t);ult(this,pn.s,this.s);this.s?this.t+=pn.t:this.s=pn.t},valueOf:function(){return this.s}};var pn=new tg,tu=1e-6,rr=Math.PI,rs=rr/2,dvt=rr/4,el=2*rr,lh=180/rr,wf=rr/180,fe=Math.abs,lft=Math.atan,lk=Math.atan2,of=Math.cos,gvt=Math.exp,nyt=Math.log,bf=Math.sin,wn=Math.sqrt,tyt=Math.tan,iyt={Feature:function(n,t){ig(n.geometry,t)},FeatureCollection:function(n,t){for(var i=n.features,r=-1,u=i.length;++r<u;)ig(i[r].geometry,t)}},ryt={Sphere:function(n,t){t.sphere()},Point:function(n,t){n=n.coordinates;t.point(n[0],n[1],n[2])},MultiPoint:function(n,t){for(var i=n.coordinates,r=-1,u=i.length;++r<u;)n=i[r],t.point(n[0],n[1],n[2])},LineString:function(n,t){srt(n.coordinates,t,0)},MultiLineString:function(n,t){for(var i=n.coordinates,r=-1,u=i.length;++r<u;)srt(i[r],t,0)},Polygon:function(n,t){flt(n.coordinates,t)},MultiPolygon:function(n,t){for(var i=n.coordinates,r=-1,u=i.length;++r<u;)flt(i[r],t)},GeometryCollection:function(n,t){for(var i=n.geometries,r=-1,u=i.length;++r<u;)ig(i[r],t)}},ykt=function(n,t){n&&iyt.hasOwnProperty(n.type)?iyt[n.type](n,t):ig(n,t)},uyt=(ua(),ua(),ua(),function(n,t){function i(i,r){return i=n(i,r),t(i[0],i[1])}return n.invert&&t.invert&&(i.invert=function(i,r){return(i=t.invert(i,r))&&n.invert(i[0],i[1])}),i});art.invert=art;var pkt=function(n){function t(t){return t=n(t[0]*wf,t[1]*wf),t[0]*=lh,t[1]*=lh,t}return n=elt(n[0]*wf,n[1]*wf,n.length>2?n[2]*wf:0),t.invert=function(t){return t=n.invert(t[0]*wf,t[1]*wf),t[0]*=lh,t[1]*=lh,t},t},fyt=function(){var t,n=[];return{point:function(n,i){t.push([n,i])},lineStart:function(){n.push(t=[])},lineEnd:bb,rejoin:function(){n.length>1&&n.push(n.pop().concat(n.shift()))},result:function(){var i=n;return n=[],t=null,i}}},wkt=function(n,t,i,r,u,f){var e,l=n[0],a=n[1],o=0,s=1,h=t[0]-l,c=t[1]-a;if(e=i-l,h||!(e>0)){if(e/=h,h<0){if(e<o)return;e<s&&(s=e)}else if(h>0){if(e>s)return;e>o&&(o=e)}if(e=u-l,h||!(e<0)){if(e/=h,h<0){if(e>s)return;e>o&&(o=e)}else if(h>0){if(e<o)return;e<s&&(s=e)}if(e=r-a,c||!(e>0)){if(e/=c,c<0){if(e<o)return;e<s&&(s=e)}else if(c>0){if(e>s)return;e>o&&(o=e)}if(e=f-a,c||!(e<0)){if(e/=c,c<0){if(e>s)return;e>o&&(o=e)}else if(c>0){if(e<o)return;e<s&&(s=e)}return o>0&&(n[0]=l+o*h,n[1]=a+o*c),s<1&&(t[0]=l+s*h,t[1]=a+s*c),!0}}}}},bn=function(n,t){return fe(n[0]-t[0])<tu&&fe(n[1]-t[1])<tu},eyt=function(n,t,i,r,u){var e,l,h=[],s=[],o,a,v,f,c;if(n.forEach(function(n){if(!((r=n.length-1)<=0)){var r,t,i=n[0],f=n[r];if(bn(i,f)){for(u.lineStart(),e=0;e<r;++e)u.point((i=n[e])[0],i[1]);u.lineEnd()}else h.push(t=new eg(i,n,null,!0)),s.push(t.o=new eg(i,null,t,!1)),h.push(t=new eg(f,n,null,!1)),s.push(t.o=new eg(f,null,t,!0))}}),h.length){for(s.sort(t),llt(h),llt(s),e=0,l=s.length;e<l;++e)s[e].e=i=!i;for(v=h[0];;){for(f=v,c=!0;f.v;)if((f=f.n)===v)return;o=f.z;u.lineStart();do{if(f.v=f.o.v=!0,f.e){if(c)for(e=0,l=o.length;e<l;++e)u.point((a=o[e])[0],a[1]);else r(f.x,f.n.x,1,u);f=f.n}else{if(c)for(o=f.p.z,e=o.length-1;e>=0;--e)u.point((a=o[e])[0],a[1]);else r(f.x,f.p.x,-1,u);f=f.p}o=(f=f.o).z;c=!c}while(!f.v);u.lineEnd()}}},oyt=function(n,t){return n<t?-1:n>t?1:n>=t?0:NaN},syt=(function(n){1===n.length&&(n=function(n){return function(t,i){return oyt(n(t),i)}}(n))}(oyt),function(n){for(var t,i,f,r=n.length,e=-1,u=0;++e<r;)u+=n[e].length;for(i=new Array(u);--r>=0;)for(t=(f=n[r]).length;--t>=0;)i[--u]=f[t];return i}),ak=1e9,kn=-ak,aft=ua(),hyt=(ua(),function(n){return n}),vw=(ua(),ua(),1/0),dn=vw,vk=-vw,gn=vk,cyt={point:function(n,t){n<vw&&(vw=n);n>vk&&(vk=n);t<dn&&(dn=t);t>gn&&(gn=t)},lineStart:bb,lineEnd:bb,polygonStart:bb,polygonEnd:bb,result:function(){var n=[[vw,dn],[vk,gn]];return vk=gn=-(dn=vw=1/0),n}},lyt=(ua(),function(n,t,i,r){return function(u,f){function a(t,i){var r=u(t,i);n(t=r[0],i=r[1])&&f.point(t,i)}function k(n,t){var i=u(n,t);v.point(i[0],i[1])}function y(){e.point=k;v.lineStart()}function p(){e.point=a;v.lineEnd()}function w(n,t){h.push([n,t]);var i=u(n,t);l.point(i[0],i[1])}function d(){l.lineStart();h=[]}function g(){w(h[0][0],h[0][1]);l.lineEnd();var t,r,i,u,e=l.clean(),n=b.result(),a=n.length;if(h.pop(),c.push(h),h=null,a)if(1&e){if(i=n[0],(r=i.length-1)>0){for(o||(f.polygonStart(),o=!0),f.lineStart(),t=0;t<r;++t)f.point((u=i[t])[0],u[1]);f.lineEnd()}}else a>1&&2&e&&n.push(n.pop().concat(n.shift())),s.push(n.filter(ewt))}var c,s,h,v=t(f),nt=u.invert(r[0],r[1]),b=fyt(),l=t(b),o=!1,e={point:a,lineStart:y,lineEnd:p,polygonStart:function(){e.point=w;e.lineStart=d;e.lineEnd=g;s=[];c=[]},polygonEnd:function(){e.point=a;e.lineStart=y;e.lineEnd=p;s=syt(s);var n=function(n,t){var u=t[0],d=t[1],st=[bf(u),-of(u),0],h=0,g=0,f,nt,r,b,k;for(aft.reset(),f=0,nt=n.length;f<nt;++f)if(l=(c=n[f]).length)for(var c,l,e=c[l-1],a=e[0],tt=e[1]/2+dvt,it=bf(tt),rt=of(tt),v=0;v<l;++v,a=y,it=ft,rt=et,e=o){var o=c[v],y=o[0],ut=o[1]/2+dvt,ft=bf(ut),et=of(ut),i=y-a,p=i>=0?1:-1,w=p*i,s=w>rr,ot=it*ft;(aft.add(lk(ot*p*bf(w),rt*et+ot*of(w))),h+=s?i+p*el:i,s^a>=u^y>=u)&&(r=ug(up(e),up(o)),lrt(r),b=ug(st,r),lrt(b),k=(s^i>=0?-1:1)*wb(b[2]),(d>k||d===k&&(r[0]||r[1]))&&(g+=s^i>=0?1:-1))}return(h<-tu||h<tu&&aft<-tu)^1&g}(c,nt);s.length?(o||(f.polygonStart(),o=!0),eyt(s,owt,n,i,f)):n&&(o||(f.polygonStart(),o=!0),f.lineStart(),i(null,null,1,f),f.lineEnd());o&&(f.polygonEnd(),o=!1);s=c=null},sphere:function(){f.polygonStart();f.lineStart();i(null,null,1,f);f.lineEnd();f.polygonEnd()}};return e}}),ayt=lyt(function(){return!0},function(n){var u,i=NaN,t=NaN,r=NaN;return{lineStart:function(){n.lineStart();u=1},point:function(f,e){var o=f>0?rr:-rr,s=fe(f-i);fe(s-rr)<tu?(n.point(i,t=(t+e)/2>0?rs:-rs),n.point(r,t),n.lineEnd(),n.lineStart(),n.point(o,t),n.point(f,t),u=0):r!==o&&s>=rr&&(fe(i-r)<tu&&(i-=r*tu),fe(f-o)<tu&&(f-=o*tu),t=function(n,t,i,r){var u,f,e=bf(n-i);return fe(e)>tu?lft((bf(t)*(f=of(r))*bf(i)-bf(r)*(u=of(t))*bf(n))/(u*f*e)):(t+r)/2}(i,t,f,e),n.point(r,t),n.lineEnd(),n.lineStart(),n.point(o,t),u=0);n.point(i=f,t=e);r=o},lineEnd:function(){n.lineEnd();i=t=NaN},clean:function(){return 2-u}}},function(n,t,i,r){var u,f;null==n?(u=i*rs,r.point(-rr,u),r.point(0,u),r.point(rr,u),r.point(rr,0),r.point(rr,-u),r.point(0,-u),r.point(-rr,-u),r.point(-rr,0),r.point(-rr,u)):fe(n[0]-t[0])>tu?(f=n[0]<t[0]?rr:-rr,u=i*f/2,r.point(-f,u),r.point(0,u),r.point(f,u)):r.point(t[0],t[1])},[-rr,-rs]),bkt=function(n,t){function f(n,t){return of(n)*of(t)>i}function u(n,t,r){var nt=[1,0,0],h=ug(up(n),up(t)),tt=rg(h,h),w=h[0],b=tt-w*w,d,u,y,p,g;if(!b)return!r&&n;var rt=i*tt/b,ut=-i*w/b,ft=ug(nt,h),f=fg(nt,rt);crt(f,fg(h,ut));var c=ft,a=rg(f,c),k=rg(c,c),it=a*a-k*(rg(f,f)-1);if(!(it<0)){if(d=wn(it),u=fg(c,(-a-d)/k),crt(u,f),u=hrt(u),!r)return u;var v,e=n[0],l=t[0],o=n[1],s=t[1];if(l<e&&(v=e,e=l,l=v),y=l-e,p=fe(y-rr)<tu,!p&&s<o&&(v=o,o=s,s=v),p||y<tu?p?o+s>0^u[1]<(fe(u[0]-e)<tu?o:s):o<=u[1]&&u[1]<=s:y>rr^(e<=u[0]&&u[0]<=l))return g=fg(c,(-a+d)/k),crt(g,f),[u,hrt(g)]}}function e(t,i){var f=r?n:rr-n,u=0;return t<-f?u|=1:t>f&&(u|=2),i<-f?u|=4:i>f&&(u|=8),u}var i=of(n),r=i>0,o=fe(i)>tu;return lyt(f,function(n){var t,c,i,h,s;return{lineStart:function(){h=i=!1;s=1},point:function(l,a){var y,v=[l,a],p=f(l,a),b=r?p?0:e(l,a):p?e(l+(l<0?rr:-rr),a):0,w;(!t&&(h=i=p)&&n.lineStart(),p!==i&&(!(y=u(t,v))||bn(t,y)||bn(v,y))&&(v[0]+=tu,v[1]+=tu,p=f(v[0],v[1])),p!==i)?(s=0,p?(n.lineStart(),y=u(v,t),n.point(y[0],y[1])):(y=u(t,v),n.point(y[0],y[1]),n.lineEnd()),t=y):o&&t&&r^p&&(b&c||!(w=u(v,t,!0))||(s=0,r?(n.lineStart(),n.point(w[0][0],w[0][1]),n.point(w[1][0],w[1][1]),n.lineEnd()):(n.point(w[1][0],w[1][1]),n.lineEnd(),n.lineStart(),n.point(w[0][0],w[0][1]))));!p||t&&bn(t,v)||n.point(v[0],v[1]);t=v;i=p;c=b},lineEnd:function(){i&&n.lineEnd();t=null},clean:function(){return s|(h&&i)<<1}}},function(i,r,u,f){!function(n,t,i,r,u,f){var s,e;if(i){var o=of(t),h=bf(t),c=r*i;for(null==u?(u=t+r*el,f=t-c/2):(u=clt(o,u),f=clt(o,f),(r>0?u<f:u>f)&&(u+=r*el)),e=u;r>0?e>f:e<f;e-=c)s=hrt([o,-h*of(e),-h*bf(e)]),n.point(s[0],s[1])}}(f,n,t,u,i,r)},r?[0,-n]:[-rr,n-rr])};vrt.prototype={constructor:vrt,point:function(n,t){this.stream.point(n,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var vyt=16,kkt=of(30*wf),yyt=function(n,t){return+t?function(n,t){function i(r,u,f,e,o,s,h,c,l,a,v,y,p,w){var g=h-r,nt=c-u,rt=g*g+nt*nt;if(rt>4*t&&p--){var k=e+a,d=o+v,b=s+y,ut=wn(k*k+d*d+b*b),ct=wb(b/=ut),ft=fe(fe(b)-1)<tu||fe(f-l)<tu?(f+l)/2:lk(d,k),et=n(ft,ct),tt=et[0],it=et[1],ot=tt-r,st=it-u,ht=nt*ot-g*st;(ht*ht/rt>t||fe((g*ot+nt*st)/rt-.5)>.3||e*a+o*v+s*y<kkt)&&(i(r,u,f,e,o,s,tt,it,ft,k/=ut,d/=ut,b,p,w),w.point(tt,it),i(tt,it,ft,k,d,b,h,c,l,a,v,y,p,w))}}return function(t){function v(i,r){i=n(i,r);t.point(i[0],i[1])}function h(){u=NaN;r.point=c;t.lineStart()}function c(r,h){var c=up([r,h]),l=n(r,h);i(u,f,a,e,o,s,u=l[0],f=l[1],a=r,e=c[0],o=c[1],s=c[2],vyt,t);t.point(u,f)}function l(){r.point=v;t.lineEnd()}function g(){h();r.point=nt;r.lineEnd=tt}function nt(n,t){c(y=n,t);p=u;w=f;b=e;k=o;d=s;r.point=c}function tt(){i(u,f,a,e,o,s,p,w,y,b,k,d,vyt,t);r.lineEnd=l;l()}var y,p,w,b,k,d,a,u,f,e,o,s,r={point:v,lineStart:h,lineEnd:l,polygonStart:function(){t.polygonStart();r.lineStart=g},polygonEnd:function(){t.polygonEnd();r.lineStart=h}};return r}}(n,t):function(n){return alt({point:function(t,i){t=n(t,i);this.stream.point(t[0],t[1])}})}(n)},dkt=alt({point:function(n,t){this.stream.point(n*wf,t*wf)}});ylt.invert=function(n,t){return[n,2*lft(gvt(t))-rs]};plt.invert=function(n,t){return[-t,2*lft(gvt(n))-rs]};pyt=function(){var n=function(n){function r(){var r=rr*o(),s=t(pkt(t.rotate()).invert([0,0]));return c(null==i?[[s[0]-r,s[1]-r],[s[0]+r,s[1]+r]]:n===ylt?[[Math.max(s[0]-r,i),u],[Math.min(s[0]+r,f),e]]:[[i,Math.max(s[1]-r,u)],[f,Math.min(s[1]+r,e)]])}var u,f,e,t=swt(n),s=t.center,o=t.scale,h=t.translate,c=t.clipExtent,i=null;return t.scale=function(n){return arguments.length?(o(n),r()):o()},t.translate=function(n){return arguments.length?(h(n),r()):h()},t.center=function(n){return arguments.length?(s(n),r()):s()},t.clipExtent=function(n){return arguments.length?(null==n?i=u=f=e=null:(i=+n[0][0],u=+n[0][1],f=+n[1][0],e=+n[1][1]),r()):null==i?null:[[i,u],[f,e]]},r()}(plt),i=n.center,t=n.rotate;return n.center=function(n){return arguments.length?i([-n[1],n[0]]):(n=i(),[n[1],-n[0]])},n.rotate=function(n){return arguments.length?t([n[0],n[1],n.length>2?n[2]+90:90]):(n=t(),[n[0],n[1],n[2]-90])},t([0,0,90]).scale(159.155)};n.projection=cbt;n.random=ukt;n.clusters=fkt;n.helpers=cwt;n.invariant=awt;n.meta=lwt;n.isolines=function(n,t,i){var r;if(i=i||{},!v(i))throw new Error("options is invalid");var u=i.zProperty||"elevation",f=i.commonProperties||{},e=i.breaksProperties||[];if(ah(n,"Point","Input must contain Points"),!t)throw new Error("breaks is required");if(!Array.isArray(t))throw new Error("breaks must be an Array");if(!v(f))throw new Error("commonProperties must be an Object");if(!Array.isArray(e))throw new Error("breaksProperties must be an Array");return r=byt(n,{zProperty:u,flip:!0}),d(function(n,t,i){var r=hu(i),u=r[2]-r[0],f=r[3]-r[1],e=r[0],o=r[1],s=t[0].length-1,h=t.length-1,c=u/s,l=f/h,a=function(n){n[0]=n[0]*c+e;n[1]=n[1]*l+o};return n.forEach(function(n){pu(n,a)}),n}(function(n,t,i,r,u){for(var o,s,h,e=[],f=1;f<t.length;f++)o=+t[f],s=Object.assign({},r,u[f]),s[i]=o,h=fa(wyt(n,o),s),e.push(h);return e}(r,t,u,f,e),r,n))};n.convex=vet;n.pointsWithinPolygon=vtt;n.concave=function(n,t){var r,u,i;if(t=t||{},!v(t))throw new Error("options is invalid");if(!n)throw new Error("points is required");if(r=t.maxEdge||1/0,!gi(r))throw new Error("maxEdge is invalid");return(u=pet(function(n){var t=[],i={};return nr(n,function(n){if(n.geometry){var r=n.geometry.coordinates.join("-");i.hasOwnProperty(r)||(t.push(n),i[r]=!0)}}),d(t)}(n)),u.features=u.features.filter(function(n){var i=n.geometry.coordinates[0][0],u=n.geometry.coordinates[0][1],f=n.geometry.coordinates[0][2],e=tr(i,u,t),o=tr(u,f,t),s=tr(i,f,t);return e<=r&&o<=r&&s<=r}),u.features.length<1)?null:(i=fpt(u,t),1===i.coordinates.length&&(i.coordinates=i.coordinates[0],i.type="Polygon"),fu(i))};n.collect=function(n,t,i,r){var u=ep(6),f=t.features.map(function(n){return{minX:n.geometry.coordinates[0],minY:n.geometry.coordinates[1],maxX:n.geometry.coordinates[0],maxY:n.geometry.coordinates[1],property:n.properties[i]}});return u.load(f),n.features.forEach(function(n){n.properties||(n.properties={});var t=hu(n),i=[];u.search({minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]}).forEach(function(t){pr([t.minX,t.minY],n)&&i.push(t.property)});n.properties[r]=i}),n};n.flip=function(n,t){if(t=t||{},!v(t))throw new Error("options is invalid");var i=t.mutate;if(!n)throw new Error("geojson is required");return!1!==i&&void 0!==i||(n=kf(n)),pu(n,function(n){var t=n[0],i=n[1];n[0]=i;n[1]=t}),n};n.simplify=function(n,t){if(t=t||{},!v(t))throw new Error("options is invalid");var i=void 0!==t.tolerance?t.tolerance:1,r=t.highQuality||!1,u=t.mutate||!1;if(!n)throw new Error("geojson is required");if(i&&i<0)throw new Error("invalid tolerance");return!0!==u&&(n=kf(n)),nh(n,function(n){!function(n,t,i){var u=n.type,r;if("Point"===u||"MultiPoint"===u)return n;hl(n,!0);r=n.coordinates;switch(u){case"LineString":n.coordinates=tot(r,t,i);break;case"MultiLineString":n.coordinates=r.map(function(n){return tot(n,t,i)});break;case"Polygon":n.coordinates=iot(r,t,i);break;case"MultiPolygon":n.coordinates=r.map(function(n){return iot(n,t,i)})}}(n,i,r)}),n};n.bezierSpline=rot;n.tag=function(n,t,i,r){return n=kf(n),t=kf(t),nr(n,function(n){n.properties||(n.properties={});nr(t,function(t){void 0===n.properties[r]&&pr(n,t)&&(n.properties[r]=t.properties[i])})}),n};n.sample=function(n,t){if(!n)throw new Error("featurecollection is required");if(null===t||void 0===t)throw new Error("num is required");if("number"!=typeof t)throw new Error("num must be a number");return d(function(n,t){for(var f,u,i=n.slice(0),r=n.length,e=r-t;r-->e;)u=Math.floor((r+1)*Math.random()),f=i[u],i[u]=i[r],i[r]=f;return i.slice(e)}(n.features,t))};n.envelope=uot;n.square=fot;n.circle=nit;n.midpoint=function(n,t){return oc(n,tr(n,t)/2,sc(n,t))};n.center=rd;n.centerOfMass=eot;n.centroid=sv;n.combine=function(n){function i(n,i,r){r?t[i].coordinates=t[i].coordinates.concat(n.geometry.coordinates):t[i].coordinates.push(n.geometry.coordinates);t[i].properties.push(n.properties)}var t={MultiPoint:{coordinates:[],properties:[]},MultiLineString:{coordinates:[],properties:[]},MultiPolygon:{coordinates:[],properties:[]}},r=Object.keys(t).reduce(function(n,t){return n[t.replace("Multi","")]=t,n},{});return nr(n,function(n){n.geometry&&(t[n.geometry.type]?i(n,n.geometry.type,!0):r[n.geometry.type]&&i(n,r[n.geometry.type],!1))}),d(Object.keys(t).filter(function(n){return t[n].coordinates.length}).sort().map(function(n){return fu({type:n,coordinates:t[n].coordinates},{collectedProperties:t[n].properties})}))};n.distance=tr;n.explode=tit;n.bbox=hu;n.tesselate=function(n){if(!n.geometry||"Polygon"!==n.geometry.type&&"MultiPolygon"!==n.geometry.type)throw new Error("input must be a Polygon or MultiPolygon");var t={type:"FeatureCollection",features:[]};return"Polygon"===n.geometry.type?t.features=lot(n.geometry.coordinates):n.geometry.coordinates.forEach(function(n){t.features=t.features.concat(lot(n))}),t};n.bboxPolygon=gtt;n.booleanPointInPolygon=pr;n.nearestPoint=fit;n.nearestPointOnLine=ll;n.nearestPointToLine=function(n,t,i){var f,e,u,r;if(i=i||{},!v(i))throw new Error("options is invalid");if(f=i.units,e=i.properties||{},!n)throw new Error("points is required");if(!(n=function(n){var t=[];switch(n.geometry?n.geometry.type:n.type){case"GeometryCollection":return nh(n,function(n){"Point"===n.type&&t.push({type:"Feature",properties:{},geometry:n})}),{type:"FeatureCollection",features:t};case"FeatureCollection":return n.features=n.features.filter(function(n){return"Point"===n.geometry.type}),n;default:throw new Error("points must be a Point Collection");}}(n)).features.length)throw new Error("points must contain features");if(!t)throw new Error("line is required");if("LineString"!==fr(t))throw new Error("line must be a LineString");return u=1/0,r=null,nr(n,function(n){var i=nst(n,t,{units:f});i<u&&(u=i,r=n)}),r&&(r.properties=Object.assign({dist:u},r.properties,e)),r};n.planepoint=function(n,t){var a=cr(n),u=no(t).coordinates[0];if(u.length<4)throw new Error("OuterRing of a Polygon must have 4 or more Positions.");var l=t.properties||{},v=l.a,y=l.b,p=l.c,i=a[0],r=a[1],f=u[0][0],e=u[0][1],w=void 0!==v?v:u[0][2],o=u[1][0],s=u[1][1],b=void 0!==y?y:u[1][2],h=u[2][0],c=u[2][1],k=void 0!==p?p:u[2][2];return(k*(i-f)*(r-s)+w*(i-o)*(r-c)+b*(i-h)*(r-e)-b*(i-f)*(r-c)-k*(i-o)*(r-e)-w*(i-h)*(r-s))/((i-f)*(r-s)+(i-o)*(r-c)+(i-h)*(r-e)-(i-f)*(r-c)-(i-o)*(r-e)-(i-h)*(r-s))};n.tin=pet;n.bearing=sc;n.destination=oc;n.kinks=function(n){var i,t,r={type:"FeatureCollection",features:[]};if("LineString"===(t="Feature"===n.type?n.geometry:n).type)i=[t.coordinates];else if("MultiLineString"===t.type)i=t.coordinates;else if("MultiPolygon"===t.type)i=[].concat.apply([],t.coordinates);else{if("Polygon"!==t.type)throw new Error("Input must be a LineString, MultiLineString, Polygon, or MultiPolygon Feature or Geometry");i=t.coordinates}return i.forEach(function(n){i.forEach(function(t){for(var u,f,i=0;i<n.length-1;i++)for(u=i;u<t.length-1;u++){if(n===t){if(1===Math.abs(i-u))continue;if(0===i&&u===n.length-2&&n[i][0]===n[n.length-1][0]&&n[i][1]===n[n.length-1][1])continue}f=function(n,t,i,r,u,f,e,o){var l,h,c,a,v,s={x:null,y:null,onLine1:!1,onLine2:!1};return 0==(l=(o-f)*(i-n)-(e-u)*(r-t))?null!==s.x&&null!==s.y&&s:(h=t-f,c=n-u,a=(e-u)*h-(o-f)*c,v=(i-n)*h-(r-t)*c,h=a/l,c=v/l,s.x=n+h*(i-n),s.y=t+h*(r-t),h>=0&&h<=1&&(s.onLine1=!0),c>=0&&c<=1&&(s.onLine2=!0),!(!s.onLine1||!s.onLine2)&&[s.x,s.y])}(n[i][0],n[i][1],n[i+1][0],n[i+1][1],t[u][0],t[u][1],t[u+1][0],t[u+1][1]);f&&r.features.push(wi([f[0],f[1]]))}})}),r};n.pointOnFeature=ist;n.area=eb;n.along=function(n,t,i){var r,f,u,e,o;if(i=i||{},!v(i))throw new Error("options is invalid");if("Feature"===n.type)r=n.geometry.coordinates;else{if("LineString"!==n.type)throw new Error("input must be a LineString Feature or Geometry");r=n.coordinates}if(!gi(t))throw new Error("distance must be a number");for(f=0,u=0;u<r.length&&!(t>=f&&u===r.length-1);u++){if(f>=t)return(e=t-f,e)?(o=sc(r[u],r[u-1])-180,oc(r[u],e,o,i)):wi(r[u]);f+=tr(r[u],r[u+1],i)}return wi(r[r.length-1])};n.length=lit;n.lineSlice=function(n,t,i){var s=p(i);if("LineString"!==fr(i))throw new Error("line must be a LineString");for(var r,u=ll(i,n),f=ll(i,t),e=[(r=u.properties.index<=f.properties.index?[u,f]:[f,u])[0].geometry.coordinates],o=r[0].properties.index+1;o<r[1].properties.index+1;o++)e.push(s[o]);return e.push(r[1].geometry.coordinates),ur(e,i.properties)};n.lineSliceAlong=ost;n.pointGrid=lst;n.truncate=dy;n.flatten=function(n){if(!n)throw new Error("geojson is required");var t=[];return su(n,function(n){t.push(n)}),d(t)};n.lineIntersect=cl;n.lineChunk=function(n,t,i){var u,f,r;if(i=i||{},!v(i))throw new Error("options is invalid");if(u=i.units,f=i.reverse,!n)throw new Error("geojson is required");if(t<=0)throw new Error("segmentLength must be greater than 0");return r=[],su(n,function(n){f&&(n.geometry.coordinates=n.geometry.coordinates.reverse()),function(n,t,i,r){var e=lit(n,{units:i}),f,u,o;if(e<=t)return r(n);for(f=e/t,Number.isInteger(f)||(f=Math.floor(f)+1),u=0;u<f;u++)o=ost(n,t*u,t*(u+1),{units:i}),r(o,u)}(n,t,u,function(n){r.push(n)})}),d(r)};n.unkinkPolygon=function(n){var t=[];return su(n,function(n){"Polygon"===n.geometry.type&&nr(abt(n),function(i){t.push(st(i.geometry.coordinates,n.properties))})}),d(t)};n.greatCircle=function(n,t,i){if("object"!=typeof(i=i||{}))throw new Error("options is invalid");var r=i.properties,u=i.npoints,f=i.offset;return n=cr(n),t=cr(t),r=r||{},u=u||100,f=f||10,new wg({x:n[0],y:n[1]},{x:t[0],y:t[1]},r).Arc(u,{offset:f}).json()};n.lineSegment=cv;n.lineSplit=function(n,t){var u,i,r;if(!n)throw new Error("line is required");if(!t)throw new Error("splitter is required");if(u=fr(n),i=fr(t),"LineString"!==u)throw new Error("line must be LineString");if("FeatureCollection"===i)throw new Error("splitter cannot be a FeatureCollection");if("GeometryCollection"===i)throw new Error("splitter cannot be a GeometryCollection");r=dy(t,{precision:7});switch(i){case"Point":return ait(n,r);case"MultiPoint":return ast(n,r);case"LineString":case"MultiLineString":case"Polygon":case"MultiPolygon":return ast(n,cl(n,r))}};n.lineArc=yst;n.polygonToLine=ld;n.lineToPolygon=bst;n.bboxClip=function(n,t){var f=function(n){return n.geometry?n.geometry.type:n.type}(n),i=p(n),u=n.properties,r;switch(f){case"LineString":case"MultiLineString":return r=[],"LineString"===f&&(i=[i]),i.forEach(function(n){drt(n,t,r)}),1===r.length?ur(r[0],u):fa(r,u);case"Polygon":return st(gst(i,t),u);case"MultiPolygon":return ay(i.map(function(n){return gst(n,t)}),u);default:throw new Error("geometry "+f+" not supported");}};n.lineOverlap=rht;n.sector=function(n,t,i,r,u){if(u=u||{},!v(u))throw new Error("options is invalid");if(!n)throw new Error("center is required");if(void 0===i||null===i)throw new Error("bearing1 is required");if(void 0===r||null===r)throw new Error("bearing2 is required");if(!t)throw new Error("radius is required");if("object"!=typeof u)throw new Error("options must be an object");if(uht(i)===uht(r))return nit(n,t,u);var e=p(n),f=[[e]];return pu(yst(n,t,i,r,u),function(n){f[0].push(n)}),f[0].push(e),st(f)};n.rhumbBearing=sa;n.rhumbDistance=sd;n.rhumbDestination=np;n.polygonTangents=function(n,t){var r,u,f,e=p(n),i=p(t),o;switch(fr(t)){case"Polygon":r=i[0][0];u=i[0][0];f=hb(i[0][0],i[0][i[0].length-1],e);o=fht(i[0],e,f,void 0,r,u);r=o[0];u=o[1];break;case"MultiPolygon":r=i[0][0][0];u=i[0][0][0];f=hb(i[0][0][0],i[0][0][i[0][0].length-1],e);i.forEach(function(n){var t=fht(n[0],e,f,void 0,r,u);r=t[0];u=t[1]})}return d([wi(r),wi(u)])};n.rewind=function(n,t){var i,r,u;if(t=t||{},!v(t))throw new Error("options is invalid");if(i=t.reverse||!1,r=t.mutate||!1,!n)throw new Error("<geojson> is required");if("boolean"!=typeof i)throw new Error("<reverse> must be a boolean");if("boolean"!=typeof r)throw new Error("<mutate> must be a boolean");!1===r&&(n=kf(n));u=[];switch(n.type){case"GeometryCollection":return nh(n,function(n){yd(n,i)}),n;case"FeatureCollection":return nr(n,function(n){nr(yd(n,i),function(n){u.push(n)})}),d(u)}return yd(n,i)};n.isobands=function(n,t,i){var f,e;if(i=i||{},!v(i))throw new Error("options is invalid");var r=i.zProperty||"elevation",o=i.commonProperties||{},u=i.breaksProperties||[];if(ah(n,"Point","Input must contain Points"),!t)throw new Error("breaks is required");if(!Array.isArray(t))throw new Error("breaks is not an Array");if(!v(o))throw new Error("commonProperties is not an Object");if(!Array.isArray(u))throw new Error("breaksProperties is not an Array");return f=cpt(n,{zProperty:r,flip:!0}),e=function(n,t,i){for(var u=[],r=1;r<t.length;r++){var f=+t[r-1],o=+t[r],s=lpt(n,f,o-f),h=function(n){var t=[],i=[],r;return n.forEach(function(n){var r=eb(st([n]));i.push(r);t.push({ring:n,area:r})}),i.sort(function(n,t){return t-n}),r=[],i.forEach(function(n){for(var i=0;i<t.length;i++)if(t[i].area===n){r.push(t[i].ring);t.splice(i,1);break}}),r}(s),c=function(n){for(var i,u,e,r,o,t=n.map(function(n){return{lrCoordinates:n,grouped:!1}}),f=[];!function(n){for(var t=0;t<n.length;t++)if(!1===n[t].grouped)return!1;return!0}(t);)for(i=0;i<t.length;i++)if(!t[i].grouped){for(u=[],u.push(t[i].lrCoordinates),t[i].grouped=!0,e=st([t[i].lrCoordinates]),r=i+1;r<t.length;r++)t[r].grouped||(o=st([t[r].lrCoordinates]),function(n,t){for(var r=tit(n),i=0;i<r.features.length;i++)if(!pr(r.features[i],t))return!1;return!0}(o,e)&&(u.push(t[r].lrCoordinates),t[r].grouped=!0));f.push(u)}return f}(h),e={};e.groupedRings=c;e[i]=f+"-"+o;u.push(e)}return u}(f,t,r),d((e=function(n,t,i){var r=hu(i),u=r[2]-r[0],f=r[3]-r[1],e=r[0],o=r[1],s=t[0].length-1,h=t.length-1,c=u/s,l=f/h,a=function(n){n[0]=n[0]*c+e;n[1]=n[1]*l+o};return n.forEach(function(n){n.groupedRings.forEach(function(n){n.forEach(function(n){n.forEach(a)})})}),n}(e,f,n)).map(function(n,t){if(u[t]&&!v(u[t]))throw new Error("Each mappedProperty is required to be an Object");var i=Object.assign({},o,u[t]);return i[r]=n[r],ay(n.groupedRings,i)}))};n.transformRotate=sht;n.transformScale=hht;n.transformTranslate=function(n,t,i,r){if(r=r||{},!v(r))throw new Error("options is invalid");var e=r.units,u=r.zTranslation,f=r.mutate;if(!n)throw new Error("geojson is required");if(void 0===t||null===t||isNaN(t))throw new Error("distance is required");if(u&&"number"!=typeof u&&isNaN(u))throw new Error("zTranslation is not a number");if(u=void 0!==u?u:0,0===t&&0===u)return n;if(void 0===i||null===i||isNaN(i))throw new Error("direction is required");return t<0&&(t=-t,i=-i),!1!==f&&void 0!==f||(n=kf(n)),pu(n,function(n){var r=p(np(n,t,i,{units:e}));n[0]=r[0];n[1]=r[1];u&&3===n.length&&(n[2]+=u)}),n};n.lineOffset=function(n,t,i){var r,u,e,f;if(i=i||{},!v(i))throw new Error("options is invalid");if(r=i.units,!n)throw new Error("geojson is required");if(void 0===t||null===t||isNaN(t))throw new Error("distance is required");u=fr(n);e=n.properties;switch(u){case"LineString":return lht(n,t,r);case"MultiLineString":return f=[],su(n,function(n){f.push(lht(n,t,r).geometry.coordinates)}),fa(f,e);default:throw new Error("geometry "+u+" is not supported");}};n.polygonize=function(n){var i=oe.fromGeoJson(n),r,t;return i.deleteDangles(),i.deleteCutEdges(),r=[],t=[],i.getEdgeRings().filter(function(n){return n.isValid()}).forEach(function(n){n.isHole()?r.push(n):t.push(n)}),r.forEach(function(n){ye.findEdgeRingContaining(n,t)&&t.push(n)}),d(t.map(function(n){return n.toPolygon()}))};n.booleanDisjoint=function(n,t){var i;return su(n,function(n){su(t,function(t){if(!1===i)return!1;i=function(n,t){switch(n.type){case"Point":switch(t.type){case"Point":return!function(n,t){return n[0]===t[0]&&n[1]===t[1]}(n.coordinates,t.coordinates);case"LineString":return!vht(t,n);case"Polygon":return!pr(n,t)}break;case"LineString":switch(t.type){case"Point":return!vht(n,t);case"LineString":return!function(n,t){return cl(n,t).features.length>0}(n,t);case"Polygon":return!yht(t,n)}break;case"Polygon":switch(t.type){case"Point":return!pr(t,n);case"LineString":return!yht(n,t);case"Polygon":return!function(n,t){for(var r,i=0;i<n.coordinates[0].length;i++)if(pr(n.coordinates[0][i],t))return!0;for(r=0;r<t.coordinates[0].length;r++)if(pr(t.coordinates[0][r],n))return!0;return!1}(t,n)}}}(n.geometry,t.geometry)})}),i};n.booleanContains=function(n,t){var f=fr(n),u=fr(t),i=no(n),r=no(t),e=p(n),o=p(t);switch(f){case"Point":switch(u){case"Point":return dit(e,o);default:throw new Error("feature2 "+u+" geometry not supported");}case"MultiPoint":switch(u){case"Point":return function(n,t){for(var r=!1,i=0;i<n.coordinates.length;i++)if(dit(n.coordinates[i],t.coordinates)){r=!0;break}return r}(i,r);case"MultiPoint":return function(n,t){for(var u,r,i=0;i<t.coordinates.length;i++){for(u=!1,r=0;r<n.coordinates.length;r++)if(dit(t.coordinates[i],n.coordinates[r])){u=!0;break}if(!u)return!1}return!0}(i,r);default:throw new Error("feature2 "+u+" geometry not supported");}case"LineString":switch(u){case"Point":return so(r,i,{ignoreEndVertices:!0});case"LineString":return function(n,t){for(var r=!1,i=0;i<t.coordinates.length;i++)if(so({type:"Point",coordinates:t.coordinates[i]},n,{ignoreEndVertices:!0})&&(r=!0),!so({type:"Point",coordinates:t.coordinates[i]},n,{ignoreEndVertices:!1}))return!1;return r}(i,r);case"MultiPoint":return function(n,t){for(var r=!1,i=0;i<t.coordinates.length;i++)if(so(t.coordinates[i],n,{ignoreEndVertices:!0})&&(r=!0),!so(t.coordinates[i],n))return!1;return!!r}(i,r);default:throw new Error("feature2 "+u+" geometry not supported");}case"Polygon":switch(u){case"Point":return pr(r,i,{ignoreBoundary:!0});case"LineString":return function(n,t){var r=!1,i=0,f=hu(n),e=hu(t),u;if(!pht(f,e))return!1;for(;i<t.coordinates.length-1;i++)if(u=function(n,t){return[(n[0]+t[0])/2,(n[1]+t[1])/2]}(t.coordinates[i],t.coordinates[i+1]),pr({type:"Point",coordinates:u},n,{ignoreBoundary:!0})){r=!0;break}return r}(i,r);case"Polygon":return function(n,t){var r=hu(n),u=hu(t),i;if(!pht(r,u))return!1;for(i=0;i<t.coordinates[0].length;i++)if(!pr(t.coordinates[0][i],n))return!1;return!0}(i,r);case"MultiPoint":return function(n,t){for(var i=0;i<t.coordinates.length;i++)if(!pr(t.coordinates[i],n,{ignoreBoundary:!0}))return!1;return!0}(i,r);default:throw new Error("feature2 "+u+" geometry not supported");}default:throw new Error("feature1 "+f+" geometry not supported");}};n.booleanCrosses=function(n,t){var f=fr(n),u=fr(t),i=no(n),r=no(t);switch(f){case"MultiPoint":switch(u){case"LineString":return wht(i,r);case"Polygon":return kht(i,r);default:throw new Error("feature2 "+u+" geometry not supported");}case"LineString":switch(u){case"MultiPoint":return wht(r,i);case"LineString":return function(n,t){var r,i,u;if(cl(n,t).features.length>0)for(r=0;r<n.coordinates.length-1;r++)for(i=0;i<t.coordinates.length-1;i++)if(u=!0,0!==i&&i!==t.coordinates.length-2||(u=!1),dht(n.coordinates[r],n.coordinates[r+1],t.coordinates[i],u))return!0;return!1}(i,r);case"Polygon":return bht(i,r);default:throw new Error("feature2 "+u+" geometry not supported");}case"Polygon":switch(u){case"MultiPoint":return kht(r,i);case"LineString":return bht(r,i);default:throw new Error("feature2 "+u+" geometry not supported");}default:throw new Error("feature1 "+f+" geometry not supported");}};n.booleanClockwise=vd;n.booleanOverlap=tct;n.booleanPointOnLine=so;n.booleanEqual=function(n,t){if(!n)throw new Error("feature1 is required");if(!t)throw new Error("feature2 is required");return fr(n)===fr(t)&&new nvt({precision:6}).compare(hl(n),hl(t))};n.booleanWithin=sst;n.clone=kf;n.cleanCoords=hl;n.clustersDbscan=function(n,t,i){var r,e,u,f;if("object"!=typeof(i=i||{}))throw new Error("options is invalid");if(r=i.minPoints,e=i.units,ah(n,"Point","Input must contain Points"),null===t||void 0===t)throw new Error("maxDistance is required");if(!(Math.sign(t)>0))throw new Error("Invalid maxDistance");if(!(void 0===r||null===r||Math.sign(r)>0))throw new Error("Invalid minPoints");return n=kf(n),r=r||3,u=new db.DBSCAN,f=-1,u.run(ec(n),ov(t,e),r,tr).forEach(function(t){f++;t.forEach(function(t){var i=n.features[t];i.properties||(i.properties={});i.properties.cluster=f;i.properties.dbscan="core"})}),u.noise.forEach(function(t){var i=n.features[t];i.properties||(i.properties={});i.properties.dbscan=i.properties.cluster?"edge":"noise"}),n};n.clustersKmeans=function(n,t){var i,u,r;if("object"!=typeof(t=t||{}))throw new Error("options is invalid");i=t.numberOfClusters;u=t.mutate;ah(n,"Point","Input must contain Points");r=n.features.length;(i=i||Math.round(Math.sqrt(r/2)))>r&&(i=r);!1!==u&&void 0!==u||(n=kf(n));var f=ec(n),s=f.slice(0,i),e=tkt(f,i,s),o={};return e.centroids.forEach(function(n,t){o[t]=n}),nr(n,function(n,t){var i=e.idxs[t];n.properties.cluster=i;n.properties.centroid=o[i]}),n};n.pointToLineDistance=nst;n.booleanParallel=function(n,t){var f;if(!n)throw new Error("line1 is required");if(!t)throw new Error("line2 is required");if("LineString"!==rct(n,"line1"))throw new Error("line1 must be a LineString");if("LineString"!==rct(t,"line2"))throw new Error("line2 must be a LineString");for(var r=cv(hl(n)).features,u=cv(hl(t)).features,i=0;i<r.length;i++){if(f=r[i].geometry.coordinates,!u[i])break;if(!function(n,t){var i=ea(sa(n[0],n[1])),r=ea(sa(t[0],t[1]));return i===r}(f,u[i].geometry.coordinates))return!1}return!0};n.shortestPath=function(n,t,i){var h,c,e,r,w,b,ut,ft;if(i=i||{},!v(i))throw new Error("options is invalid");var u=i.resolution,wt=i.minDistance,f=i.obstacles||d([]);if(!n)throw new Error("start is required");if(!t)throw new Error("end is required");if(u&&!gi(u)||u<=0)throw new Error("options.resolution must be a number, greater than 0");if(wt)throw new Error("options.minDistance is not yet implemented");h=cr(n);c=cr(t);switch(n=wi(h),t=wi(c),fr(f)){case"FeatureCollection":if(0===f.features.length)return ur([h,c]);break;case"Polygon":f=d([fu(no(f))]);break;default:throw new Error("invalid obstacles");}e=f;e.features.push(n);e.features.push(t);r=hu(hht(gtt(hu(e)),1.15));u||(u=tr([r[0],r[1]],[r[2],r[1]],i)/100);e.features.pop();e.features.pop();for(var o=r[0],s=r[1],l=r[2],a=r[3],k=u/tr([o,s],[l,s],i)*(l-o),g=u/tr([o,s],[o,a],i)*(a-s),st=l-o,ht=a-s,bt=(st-Math.floor(st/k)*k)/2,ct=[],lt=[],nt=[],tt=[],at=1/0,vt=1/0,y=a-(ht-Math.floor(ht/g)*g)/2,it=0;y>=s;){for(var yt=[],pt=[],p=o+bt,rt=0;p<=l;)w=wi([p,y]),b=function(n,t){for(var i=0;i<t.features.length;i++)if(pr(n,t.features[i]))return!0;return!1}(w,f),yt.push(b?0:1),pt.push(p+"|"+y),ut=tr(w,n),!b&&ut<at&&(at=ut,nt={x:rt,y:it}),ft=tr(w,t),!b&&ft<vt&&(vt=ft,tt={x:rt,y:it}),p+=k,rt++;lt.push(yt);ct.push(pt);y-=g;it++}var et=new tp(lt,{diagonal:!0}),kt=et.grid[nt.y][nt.x],dt=et.grid[tt.y][tt.x],ot=[h];return kg.search(et,kt,dt).forEach(function(n){var t=ct[n.x][n.y].split("|");ot.push([+t[0],+t[1]])}),ot.push(c),hl(ur(ot))};n.voronoi=function(n,t){if(t=t||{},!v(t))throw new Error("options is invalid");var i=t.bbox||[-180,-85,180,85];if(!n)throw new Error("points is required");if(!Array.isArray(i))throw new Error("bbox is invalid");return ah(n,"Point","points"),d(rkt().x(function(n){return n.geometry.coordinates[0]}).y(function(n){return n.geometry.coordinates[1]}).extent([[i[0],i[1]],[i[2],i[3]]]).polygons(n.features).map(rwt))};n.ellipse=cct;n.centerMean=trt;n.centerMedian=function(n,t){var i;if(t=t||{},!v(t))throw new Error("options is invalid");if(i=t.counter||10,!gi(i))throw new Error("counter must be a number");var u=t.weight,f=trt(n,{weight:t.weight}),r=d([]);return nr(n,function(n){r.features.push(sv(n,{weight:n.properties[u]}))}),r.properties={tolerance:t.tolerance,medianCandidates:[]},act(f.geometry.coordinates,[0,0],r,i)};n.standardDeviationalEllipse=function(n,t){if(t=t||{},!v(t))throw new Error("options is invalid");var s=t.steps||64,u=t.weight,h=t.properties||{};if(!gi(s))throw new Error("steps must be a number");if(!v(h))throw new Error("properties must be a number");var c=ec(n).length,r=trt(n,{weight:u}),l=0,a=0,f=0;nr(n,function(n){var i=n.properties[u]||1,t=vct(p(n),p(r));l+=Math.pow(t.x,2)*i;a+=Math.pow(t.y,2)*i;f+=t.x*t.y*i});var y=l-a,tt=Math.sqrt(Math.pow(y,2)+4*Math.pow(f,2)),it=2*f,i=Math.atan((y+tt)/it),w=180*i/Math.PI,b=0,k=0,e=0;nr(n,function(n){var f=n.properties[u]||1,t=vct(p(n),p(r));b+=Math.pow(t.x*Math.cos(i)-t.y*Math.sin(i),2)*f;k+=Math.pow(t.x*Math.sin(i)+t.y*Math.cos(i),2)*f;e+=f});var g=Math.sqrt(2*b/e),nt=Math.sqrt(2*k/e),o=cct(r,g,nt,{units:"degrees",angle:w,steps:s,properties:h}),rt=vtt(n,d([o])),ut={meanCenterCoordinates:p(r),semiMajorAxis:g,semiMinorAxis:nt,numberOfFeatures:c,angle:w,percentageWithinEllipse:100*ec(rt).length/c};return o.properties.standardDeviationalEllipse=ut,o};n.difference=function(n,t){var i=no(n),r=no(t),u=n.properties||{};if(i=rlt(i),r=rlt(r),!i)return null;if(!r)return fu(i,u);var f=new nw,o=f.read(i),s=f.read(r),e=tt.difference(o,s);return e.isEmpty()?null:fu((new tw).write(e),u)};n.buffer=function(n,t,i){var u=(i=i||{}).units,r=i.steps||64,f;if(!n)throw new Error("geojson is required");if("object"!=typeof i)throw new Error("options must be an object");if("number"!=typeof r)throw new Error("steps must be an number");if(void 0===t)throw new Error("radius is required");if(r<=0)throw new Error("steps must be greater than 0");r=r||64;u=u||"kilometers";f=[];switch(n.type){case"GeometryCollection":return nh(n,function(n){var i=og(n,t,u,r);i&&f.push(i)}),d(f);case"FeatureCollection":return nr(n,function(n){var i=og(n,t,u,r);i&&nr(i,function(n){n&&f.push(n)})}),d(f)}return og(n,t,u,r)};n.union=yrt;n.intersect=fp;n.dissolve=function(n,t){var o,e,u,i,h;if(t=t||{},!v(t))throw new Error("options is invalid");o=t.propertyName;ah(n,"Polygon","dissolve");var s=kf(n),r=s.features,f=[];r.forEach(function(n,t){n.properties.origIndexPosition=t});e=fb();e.load(s);for(u in r)if(i=r[u],h=!1,e.search(i).features.forEach(function(n){var t,c,s;i=r[u];t=n.properties.origIndexPosition;f.length>0&&0!==t&&(t>f[f.length-1]?t-=f.length:(c=hwt(t,f),0!==c&&(t-=c)));t!==+u&&(s=r[t],s&&i&&(void 0!==o&&s.properties[o]!==i.properties[o]||tct(i,s)&&function(n,t){var i=ur(ec(n)),r=ur(ec(t));return cl(i,r).features.length>0}(i,s)&&(r[u]=yrt(i,s),f.push(n.properties.origIndexPosition),f.sort(function(n,t){return n-t}),e.remove(n),r.splice(t,1),i.properties.origIndexPosition=u,e.remove(i,function(n,t){return n.properties.origIndexPosition===t.properties.origIndexPosition}),h=!0)))}),h){if(!i)continue;i.properties.origIndexPosition=u;e.insert(i);u--}return r.forEach(function(n){delete n.properties.origIndexPosition;delete n.bbox}),s};n.hexGrid=glt;n.mask=function(n,t){var f=function(n){return st(n&&n.geometry.coordinates||[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]])}(t),i=function(n){var t=[],i=[];return su(n,function(n){var r=n.geometry.coordinates,u=r[0],f=r.slice(1);t.push(st([u]));f.forEach(function(n){i.push(st([n]))})}),[d(t),d(i)]}(n),r=i[0],u=i[1];return function(n,t,i){var r=[];return r.push(n.geometry.coordinates[0]),su(t,function(n){r.push(n.geometry.coordinates[0])}),su(i,function(n){r.push(n.geometry.coordinates[0])}),st(r)}(f,r=nat(r),u=nat(u))};n.squareGrid=iat;n.triangleGrid=rat;n.interpolate=function(n,t,i){var f,e,s;if("object"!=typeof(i=i||{}))throw new Error("options is invalid");var o=i.gridType,r=i.property,u=i.weight;if(!n)throw new Error("points is required");if(ah(n,"Point","input must contain Points"),!t)throw new Error("cellSize is required");if(void 0!==u&&"number"!=typeof u)throw new Error("weight must be a number");r=r||"elevation";o=o||"square";u=u||1;e=hu(n);switch(o){case"point":case"points":f=lst(e,t,i);break;case"square":case"squares":f=iat(e,t,i);break;case"hex":case"hexes":f=glt(e,t,i);break;case"triangle":case"triangles":f=rat(e,t,i);break;default:throw new Error("invalid gridType");}return s=[],nr(f,function(t){var f=0,h=0,e;nr(n,function(n){var e,c=tr("point"===o?t:sv(t),n,i),s;if(void 0!==r&&(e=n.properties[r]),void 0===e&&(e=n.geometry.coordinates[2]),void 0===e)throw new Error("zValue is missing");0===c&&(f=e);s=1/Math.pow(c,u);h+=s;f+=s*e});e=kf(t);e.properties[r]=f/h;s.push(e)}),d(s)};n.pointOnSurface=ist;n.polygonToLineString=ld;n.lineStringToPolygon=bst;n.inside=pr;n.within=vtt;n.bezier=rot;n.nearest=fit;n.pointOnLine=ll;n.lineDistance=lit;n.radians2degrees=oa;n.degrees2radians=yu;n.distanceToDegrees=pk;n.distanceToRadians=ev;n.radiansToDistance=vy;n.bearingToAngle=ea;n.convertDistance=ov;n.toMercator=ha;n.toWgs84=hd;n.randomPosition=yb;n.randomPoint=yct;n.randomPolygon=pct;n.randomLineString=wct;n.getCluster=kct;n.clusterEach=irt;n.clusterReduce=dct;n.createBins=rrt;n.applyFilter=gd;n.propertiesContainsFilter=urt;n.filterProperties=gct;n.earthRadius=tf;n.factors=sg;n.unitsFactors=uat;n.areaFactors=hg;n.feature=fu;n.geometry=vft;n.point=wi;n.points=yft;n.polygon=st;n.polygons=pft;n.lineString=ur;n.lineStrings=wft;n.featureCollection=d;n.multiLineString=fa;n.multiPoint=yk;n.multiPolygon=ay;n.geometryCollection=ntt;n.round=bft;n.radiansToLength=vy;n.lengthToRadians=ev;n.lengthToDegrees=pk;n.bearingToAzimuth=ea;n.radiansToDegrees=oa;n.degreesToRadians=yu;n.convertLength=ov;n.convertArea=kft;n.isNumber=gi;n.isObject=v;n.validateBBox=yy;n.validateId=wk;n.getCoord=cr;n.getCoords=p;n.containsNumber=kk;n.geojsonType=net;n.featureOf=yw;n.collectionOf=ah;n.getGeom=no;n.getGeomType=tet;n.getType=fr;n.coordEach=pu;n.coordReduce=bk;n.propEach=ttt;n.propReduce=dft;n.featureEach=nr;n.featureReduce=itt;n.coordAll=ec;n.geomEach=nh;n.geomReduce=rtt;n.flattenEach=su;n.flattenReduce=gft;n.segmentEach=ol;n.segmentReduce=utt;n.lineEach=ftt;n.lineReduce=ett;Object.defineProperty(n,"__esModule",{value:!0})}),function(n,t){typeof module!="undefined"?module.exports=t():typeof define=="function"&&typeof define.amd=="object"?define(t):this[n]=t()}("Clusterize",function(){"use strict";function u(n,t,i){return t.addEventListener?t.addEventListener(n,i,!1):t.attachEvent("on"+n,i)}function f(n,t,i){return t.removeEventListener?t.removeEventListener(n,i,!1):t.detachEvent("on"+n,i)}function r(n){return Object.prototype.toString.call(n)==="[object Array]"}function i(n,t){return window.getComputedStyle?window.getComputedStyle(t)[n]:t.currentStyle[n]}var t=function(){for(var n=3,t=document.createElement("b"),i=t.all||[];t.innerHTML="<!--[if gt IE "+ ++n+"]><i><![endif]-->",i[0];);return n>4?n:document.documentMode}(),e=navigator.platform.toLowerCase().indexOf("mac")+1,n=function(t){var i,p,w,c,b,h,s,y;if(!(this instanceof n))return new n(t);for(i=this,p={rows_in_block:50,blocks_in_cluster:4,tag:null,show_no_data_row:!0,no_data_class:"clusterize-no-data",no_data_text:"No data",keep_parity:!0,dom_mode:!1,callbacks:{}},i.options={},w=["rows_in_block","blocks_in_cluster","show_no_data_row","no_data_class","no_data_text","keep_parity","tag","dom_mode","callbacks"],h=0;c=w[h];h++)i.options[c]=typeof t[c]!="undefined"&&t[c]!=null?t[c]:p[c];for(b=["scroll","content"],h=0;s=b[h];h++)if(i[s+"_elem"]=t[s+"Id"]?document.getElementById(t[s+"Id"]):t[s+"Elem"],!i[s+"_elem"])throw new Error("Error! Could not find "+s+" element");i.content_elem.hasAttribute("tabindex")||i.content_elem.setAttribute("tabindex",0);var o=r(t.rows)?t.rows:i.fetchMarkup(),l={},tt=i.scroll_elem.scrollTop;i.insertToDOM(o,l);i.scroll_elem.scrollTop=tt;var a=!1,k=0,v=!1,d=function(){e&&(v||(i.content_elem.style.pointerEvents="none"),v=!0,clearTimeout(k),k=setTimeout(function(){i.content_elem.style.pointerEvents="auto";v=!1},50));a!=(a=i.getClusterNum())&&i.insertToDOM(o,l);i.options.callbacks.scrollingProgress&&i.options.callbacks.scrollingProgress(i.getScrollProgress())},g=0,nt=function(){clearTimeout(g);g=setTimeout(i.refresh,100)};u("scroll",i.scroll_elem,d);u("resize",window,nt);i.destroy=function(n){f("scroll",i.scroll_elem,d);f("resize",window,nt);i.html(n?i.generateEmptyRow():o)};i.refresh=function(n){(i.getRowsHeight(o)||n)&&i.update(o)};i.update=function(n){o=r(n)?n:[];var t=i.scroll_elem.scrollTop;o.length*i.options.item_height<t&&(i.scroll_elem.scrollTop=0,a=0);i.insertToDOM(o,l);i.scroll_elem.scrollTop=t};i.clear=function(){i.update([])};i.getRowsAmount=function(){return o.length};i.getScrollProgress=function(){return this.options.scroll_top/(o.length*this.options.item_height)*100||0};y=function(n,t){var u=r(t)?t:[];u.length&&(o=n=="append"?o.concat(u):u.concat(o),i.insertToDOM(o,l))};i.append=function(n){y("append",n)};i.prepend=function(n){y("prepend",n)}};return n.prototype={constructor:n,fetchMarkup:function(){var n=[],t=this.getChildNodes(this.content_elem);if(this.options.dom_mode)n=t;else while(t.length)n.push(t.shift().outerHTML);return n},exploreEnvironment:function(n,i){var r=this.options;(r.content_tag=this.content_elem.tagName.toLowerCase(),n.length)&&(t&&t<=9&&!r.tag&&(r.tag=n[0].match(/<([^>\s/]*)/)[1].toLowerCase()),this.content_elem.children.length<=1&&(i.data=this.html([n[0]])),r.tag||(r.tag=this.content_elem.children[0].tagName.toLowerCase()),this.getRowsHeight(n))},getRowsHeight:function(n){var t=this.options,o=t.item_height,r,u,f,e;if(t.cluster_height=0,n.length)return(r=this.content_elem.children,!r.length)?void 0:(u=r[Math.floor(r.length/2)],t.item_height=u.offsetHeight,t.tag=="tr"&&i("borderCollapse",this.content_elem)!="collapse"&&(t.item_height+=parseInt(i("borderSpacing",this.content_elem),10)||0),t.tag!="tr"&&(f=parseInt(i("marginTop",u),10)||0,e=parseInt(i("marginBottom",u),10)||0,t.item_height+=Math.max(f,e)),t.block_height=t.item_height*t.rows_in_block,t.rows_in_cluster=t.blocks_in_cluster*t.rows_in_block,t.cluster_height=t.blocks_in_cluster*t.block_height,o!=t.item_height)},getClusterNum:function(){return this.options.scroll_top=this.scroll_elem.scrollTop,Math.floor(this.options.scroll_top/(this.options.cluster_height-this.options.block_height))||0},generateEmptyRow:function(){var n=this.options,t,r,i;return!n.tag||!n.show_no_data_row?[]:(t=document.createElement(n.tag),r=document.createTextNode(n.no_data_text),t.className=n.no_data_class,n.tag=="tr"&&(i=document.createElement("td"),i.colSpan=100,i.appendChild(r)),t.appendChild(i||r),n.dom_mode?[t]:[t.outerHTML])},generate:function(n,t){var i=this.options,f=n.length,r;if(f<i.rows_in_block)return{top_offset:0,bottom_offset:0,rows_above:0,rows:f?n:this.generateEmptyRow()};var u=Math.max((i.rows_in_cluster-i.rows_in_block)*t,0),e=u+i.rows_in_cluster,o=Math.max(u*i.item_height,0),c=Math.max((f-e)*i.item_height,0),s=[],h=u;for(o<1&&h++,r=u;r<e;r++)n[r]&&s.push(n[r]);return{top_offset:o,bottom_offset:c,rows_above:h,rows:s}},renderExtraTag:function(n,t){var i=document.createElement(this.options.tag),r="clusterize-";return i.className=[r+"extra-row",r+n].join(" "),t&&(i.style.height=t+"px"),this.options.dom_mode?i:i.outerHTML},insertToDOM:function(n,t){this.options.cluster_height||this.exploreEnvironment(n,t);var i=this.generate(n,this.getClusterNum()),f=i.rows,e=this.checkChanges("data",f,t),o=this.checkChanges("top",i.top_offset,t),s=this.checkChanges("bottom",i.bottom_offset,t),u=this.options.callbacks,r=[];e||o?(i.top_offset&&(this.options.keep_parity&&r.push(this.renderExtraTag("keep-parity")),r.push(this.renderExtraTag("top-space",i.top_offset))),r=r.concat(f),i.bottom_offset&&r.push(this.renderExtraTag("bottom-space",i.bottom_offset)),u.clusterWillChange&&u.clusterWillChange(),this.html(r),this.options.content_tag=="ol"&&this.content_elem.setAttribute("start",i.rows_above),this.content_elem.style["counter-increment"]="clusterize-counter "+(i.rows_above-1),u.clusterChanged&&u.clusterChanged()):s&&(this.content_elem.lastChild.style.height=i.bottom_offset+"px")},html:function(n){var i=this.content_elem,s=this.options,e,h,u,o,r,f;if(t&&t<=9&&this.options.tag=="tr"){if(e=document.createElement("div"),e.innerHTML="<table><tbody><\/tbody><\/table>",u=e.firstChild.firstChild,s.dom_mode)for(r=0,f=n.length;r<f;r++)u.appendChild(n[r]);else u.innerHTML=n.join("");while(h=i.lastChild)i.removeChild(h);for(o=this.getChildNodes(u);o.length;)i.appendChild(o.shift())}else if(s.dom_mode){while(i.firstChild)i.removeChild(i.firstChild);for(r=0,f=n.length;r<f;r++)i.appendChild(n[r])}else i.innerHTML=n.join("")},getChildNodes:function(n){return[].slice.call(n.children)},checkChanges:function(n,t,i){var r=t!=i[n];return i[n]=t,r}},n});L.Polyline=L.Polyline.include({getDistance:function(n){for(var i=0,r=this._latlngs.length,t=1;t<r;t++)i+=this._latlngs[t].distanceTo(this._latlngs[t-1]);return n==="imperial"?i/1609.34:i/1e3}});L.DragResizeCircle=L.Circle.extend({onAdd:function(){this._renderer._initPath(this);this._initCircleHandles();this._reset();this._renderer._addPath(this);this._addSubControls()},onRemove:function(){this._renderer._removePath(this);for(var n=0;n<this._handles.length;n++)L.DomUtil.remove(this._handles[n])},_updatePath:function(){L.Circle.prototype._updatePath.call(this);this._updateSubControlsPath()},_addSubControls:function(){for(var n=0;n<this._handles.length;n++)this._renderer._rootGroup.appendChild(this._handles[n]);this._initEvents()},_updateSubControlsPath:function(){for(var t,i,n=0;n<this._handles.length;n++)t=this._handles[n],i=this._getHandlePathString(t.start,t.end),i||(i="M0 0"),t.setAttribute("d",i)},bringToFront:function(){if(this._renderer){this._renderer._bringToFront(this);for(var n=0;n<this._handles.length;n++)L.DomUtil.toFront(this._handles[n])}return this},bringToBack:function(){if(this._renderer){for(var n=0;n<this._handles.length;n++)L.DomUtil.toFront(this._handles[n]);this._renderer._bringToBack(this)}return this},_initEvents:function(){var t,n,i;for(this._dragStartTarget=this._path,t=["touchstart","mousedown"],n=t.length-1;n>=0;n--)L.DomEvent.on(this._dragStartTarget,t[n],this._onDown,this);for(n=0;n<this._handles.length;n++)for(i=t.length-1;i>=0;i--)L.DomEvent.on(this._handles[n],t[i],this._onDown,this)},_initCircleHandles:function(){var r,t,i,n;for(this._handles=[],r=["north-east","east","south-east","south","south-west","west","north-west","north"],t=22.5,i=0;t<360;t+=45,i++)n=L.SVG.create("path"),n.start=t,n.end=t+45,n.setAttribute("fill","transparent"),L.DomUtil.addClass(n,"leaflet-interactive"),L.DomUtil.addClass(n,"resize-handle"),L.DomUtil.addClass(n,"resize-handle-"+r[i]),this._handles.push(n)},_getHandlePathString:function(n,t){function e(n,t,i,r,u){var f=(u-90)*Math.PI/180;return{x:n+i*Math.cos(f),y:t+r*Math.sin(f)}}var i=this._point,u=this._radius,f=this._radiusY||u,r=this.options.weight,o=e(i.x,i.y,u+r,f+r,t),s=e(i.x,i.y,u+r,f+r,n),h=e(i.x,i.y,u-r,f-r,t),c=e(i.x,i.y,u-r,f-r,n),l=t-n<=180?"0":"1";return"M"+o.x+" "+o.y+"A"+u+" "+f+" 0 "+l+" 0"+s.x+","+s.y+"L"+c.x+" "+c.y+"A"+u+" "+f+" 0 "+l+" 1"+h.x+","+h.y+"z"},_onDown:function(n){var t,i,r;if(!n._simulated&&!n.shiftKey&&(n.which===1||n.button===1||n.touches)){if(L.DomEvent.stopPropagation(n),L.DomUtil.disableImageDrag(),L.DomUtil.disableTextSelection(),t=this._map,L.DomUtil.addClass(this._path,"dragging"),n.touches&&n.touches.length===2){if(this._mode==="resize")return;this._mode="resize";i=t.mouseEventToLayerPoint(n.touches[0]);r=t.mouseEventToLayerPoint(n.touches[1]);this._startCenter=i.add(r)._divideBy(2);this._startDist=i.distanceTo(r);this._startRadius=this.getRadius();t._panAnim&&t._panAnim.stop();L.DomEvent.preventDefault(n)}else if(L.DomUtil.hasClass(n.target,"resize-handle")){if(this._mode==="resize-handle")return;this._mode="resize-handle";var f=n.touches&&n.touches.length===1?n.touches[0]:n,e=t.mouseEventToContainerPoint(f),o=t.containerPointToLayerPoint(e),u=t.layerPointToLatLng(o),h=this.getLatLng();this._startDist=u.distanceTo(h);this._startRadius=this.getRadius()}else{if(this._mode==="move")return;this._mode="move";var f=n.touches&&n.touches.length===1?n.touches[0]:n,e=t.mouseEventToContainerPoint(f),o=t.containerPointToLayerPoint(e),u=t.layerPointToLatLng(o),s=this.getLatLng();this._offset=new L.LatLng(u.lat-s.lat,u.lng-s.lng)}L.DomEvent.on(document,L.Draggable.MOVE[n.type],this._onMove,this).on(document,L.Draggable.END[n.type],this._onUp,this)}},_onMove:function(n){var t=this._map,i,r;if(this._mode==="resize"){if(!n.touches||n.touches.length!==2)return;if(L.DomEvent.preventDefault(n),i=t.mouseEventToLayerPoint(n.touches[0]),r=t.mouseEventToLayerPoint(n.touches[1]),this._scale=i.distanceTo(r)/this._startDist,this._scale===1)return;L.Util.cancelAnimFrame(this._animRequest);this._animRequest=L.Util.requestAnimFrame(this._updateResize,this,!0,t._container)}else if(this._mode==="move"){if(n.touches&&n.touches.length>1)return;L.DomEvent.preventDefault(n);var u=n.touches&&n.touches.length===1?n.touches[0]:n,f=t.mouseEventToContainerPoint(u),e=t.containerPointToLayerPoint(f),o=t.layerPointToLatLng(e);this._newPos=new L.LatLng(o.lat-this._offset.lat,o.lng-this._offset.lng);L.Util.cancelAnimFrame(this._animRequest);this._animRequest=L.Util.requestAnimFrame(this._updatePosition,this,!0,this._dragStartTarget)}else if(this._mode==="resize-handle"){if(n.touches&&n.touches.length>1)return;L.DomEvent.preventDefault(n);var u=n.touches&&n.touches.length===1?n.touches[0]:n,f=t.mouseEventToContainerPoint(u),e=t.containerPointToLayerPoint(f),s=t.layerPointToLatLng(e),h=this.getLatLng(),c=s.distanceTo(h);this._scale=c/this._startDist;L.Util.cancelAnimFrame(this._animRequest);this._animRequest=L.Util.requestAnimFrame(this._updateResize,this,!0,this._dragStartTarget)}},setLatLng:function(n){var t=L.Circle.prototype.setLatLng.call(this,n);return this.fire("positionchanged"),t},setRadius:function(n){var t=L.Circle.prototype.setRadius.call(this,n);return this.fire("radiuschanged"),t},_updateResize:function(){this.setRadius(this._startRadius*this._scale)},_updatePosition:function(){this.setLatLng(this._newPos)},_onUp:function(){for(var n in L.Draggable.MOVE)L.DomEvent.off(document,L.Draggable.MOVE[n],this._onMove).off(document,L.Draggable.END[n],this._onUp);this._mode==="move"?this.fire("dragend"):(this._mode==="resize"||this._mode==="resize-handle")&&this.fire("resizeend");L.DomUtil.enableImageDrag();L.DomUtil.enableTextSelection();L.DomUtil.removeClass(this._path,"dragging");this._mode=null}});requestAuthHeader=undefined;L.TileLayer.prototype.createTile=function(n){return function(){var i=n.apply(this,arguments),t;return window.BackgroundMapOptions.username&&(t={type:"GET",url:i.src,contentType:"text/plain",xhrFields:{responseType:"blob",withCredentials:!1},statusCode:{401:n=>{if(t.digestRoundTrip)throw new Error("Unauthorized (401)");var r=n.getResponseHeader("WWW-Authenticate");r&&r.startsWith("Digest")&&(requestAuthHeader=generateDigestHeaders(r,i.src,window.BackgroundMapOptions.username,window.BackgroundMapOptions.password),t.digestRoundTrip=!0,$.ajax(t))}},success:function(n){const t=window.URL||window.webkitURL;i.src=t.createObjectURL(n)},beforeSend:function(n){requestAuthHeader&&n.setRequestHeader("Authorization",requestAuthHeader)}},$.ajax(t)),i}}(L.TileLayer.prototype.createTile);var _tileOnLoad=function(n,t){Browser.ielt9?setTimeout(Util.bind(n,this,null,t),0):n(null,t)},_tileOnError=function(n,t,i){var r=this.options.errorTileUrl;r&&t.getAttribute("src")!==r&&(t.src=r);n(i,t)},leafletLocalized=!1;leafletProjections=[{area:L.latLngBounds(L.latLng(-52,-180),L.latLng(-27,-160)),project:function(n){return L.latLng(n.lat,n.lng+360)}}];siteMapIcon=L.divIcon({iconSize:[16,16],iconAnchor:[8,8],labelAnchor:[0,8],popupAnchor:[16,8],className:"siteMarker-wrapper",html:'<div class="siteMarker icon-circles"><\/div>'});L.Layer.prototype.bindSiteTooltip=function(n,t){return t.direction==="right"?t.offset=[siteMapIcon.options.iconSize[0]-siteMapIcon.options.iconAnchor[0],0]:t.direction==="top"&&(t.offset=[0,-siteMapIcon.options.iconAnchor[1]]),this.bindTooltip(n,t)};L.Marker.addInitHook(function(){if(this.options.virtual){this._updateVisibility=function(){var f=this._map,r=f.getBounds().contains(this.getLatLng()),e=this._wasVisible,u=this._icon,t=this._iconParent,n=this._shadow,i=this._shadowParent;t||(t=this._iconParent=u.parentNode);n&&!i&&(i=this._shadowParent=n.parentNode);r!=e&&(r?(t.appendChild(u),n&&i.appendChild(n)):(t.removeChild(u),n&&i.removeChild(n)),this._wasVisible=r)};this.on("add",function(){this._map.on("resize moveend zoomend",this._updateVisibility,this)},this)}})