function initMap(n){return mapboxgl.accessToken=C_MAPBOX_ACESS_TOKEN,map=new mapboxgl.Map(n),map.addControl(new mapboxgl.NavigationControl),translateMap(map,C_LANGUAGE),map}function translateMap(n,t){var i=t.split("-"),r;if(i&&i[0]){r=["country-label-lg","state-label-lg","place-town","poi-parks-scalerank1","poi-parks-scalerank2","poi-parks-scalerank3","poi-parks_scalerank4","place-city-lg-n","water-label","marine-label-lg-pt","marine-label-sm-pt","poi-scalerank1","poi-scalerank2","poi-scalerank3","poi-scalerank4-l1","poi-scalerank4-l15","waterway-label","airport-label","place-village"];n.on("style.load",function(){r.forEach(function(t){n.setLayoutProperty(t,"text-field","{name_"+i[0].toLowerCase()+"}")});setDefaultLayersVisibility()})}}function AddGeolocationControl(){geolocate=new mapboxgl.GeolocateControl({positionOptions:{enableHighAccuracy:!0,maximumAge:0},trackUserLocation:!1,showUserLocation:!0});geolocate.on("geolocate",function(n){n&&n.coords&&(locationSetted=!0,map.setCenter([n.coords.longitude,n.coords.latitude]),map.setZoom(12),C_GETCLOSEST_POINTS&&getClosestPoints(n.coords),showRegionLayer(!1))});geolocate.on("error",function(n){switch(n.code){case n.PERMISSION_DENIED:console.log("User denied the request for Geolocation.");break;case n.POSITION_UNAVAILABLE:console.log("Location information is unavailable.");console.log(n);break;case n.TIMEOUT:console.log("The request to get user location timed out.");break;case n.UNKNOWN_ERROR:console.log("An unknown error occurred.");console.log(n);break;default:console.log("An unknown error occurred.");console.log(n)}});map.addControl(geolocate)}function disableZoomControls(n,t){if(n){if(!t){var i=getDefaultZoomByMaster();map.setMinZoom(i-1);map.setMaxZoom(i+1)}}else map.setMaxZoom(20),map.setMinZoom(7)}function flyToStore(n,t){t?map.flyTo({zoom:C_DEFAULT_ZOOM_FLYTO}):map.flyTo({center:n.geometry.coordinates,zoom:15})}function fitMapBoundsToCoordinates(n){var t=n.reduce(function(n,t){return n.extend(t)},new mapboxgl.LngLatBounds(n[0],n[0]));map.fitBounds(t,{padding:20,animate:!1})}function mapResize(){map.resize()}function sidebarMouseoverEffect(n,t){var i,r;n&&t&&t.features&&t.features.length!==0&&(i=t.features.filter(function(t){return t.properties.Id==n}),i&&i.length!=0)&&(map.getLayer(C_MOUSEOVER_LAYER)&&(map.removeLayer(C_MOUSEOVER_LAYER),map.removeSource(C_MOUSEOVER_LAYER)),r={id:C_MOUSEOVER_LAYER,type:"symbol",source:{type:"geojson",data:{type:"FeatureCollection",features:i}},layout:{"icon-image":"{MarkerIconOver}","text-font":["Open Sans Semibold","Arial Unicode MS Bold"],"text-offset":[0,.6],"text-anchor":"top"}},createLayer(r))}function sidebarRuasMouseOut(){map.getLayer(C_MOUSEOVER_LAYER)&&map.getSource(C_MOUSEOVER_LAYER).setData(EMPTY_SOURCE_FEATURE_COLLECTION)}function createLayer(n){n&&(map.getLayer(n.id)||map.addLayer(n))}function setDefaultLocationAndZoomByMasterID(n){var t=getDefaultCoordsByMasterID(),i=getDefaultZoomByMaster();if(!t||t.length!==2)throw"Ocorreu um erro ao obter as coordenadas pré-definidas.";n.setCenter(t);n.setZoom(i)}function getDefaultZoomByMaster(){switch(getMasterID()){case"1":return C_DEFAULT_ZOOM_PORTUGAL;case"2":return C_DEFAULT_ZOOM_ESPANHA;case"3":return C_DEFAULT_ZOOM_CENTRAL_AMERICA;case"4":return C_DEFAULT_ZOOM_COLOMBIA;case"5":return C_DEFAULT_ZOOM_PERU;case"8":return C_DEFAULT_ZOOM_BOLIVIA;default:return 6}}function getDefaultCoordsByMasterID(){switch(getMasterID()){case"1":return[-8.066518,39.80915];case"2":return[-3.305096,40.165982];case"3":return[-84.640698,12.60174];case"4":return[-73.454581,3.294037];case"5":return[-75.0326,-9.497412];case"8":return[-64.769895,-15.665838];case"11":return[-64.769895,-15.665838];default:return[-8.012368,40.026827]}}function setDefaultLayersVisibility(){setVisibilitySattelliteInformation(!1);setVisibilityCompassButton(!1);setVisibilityTrashButton(!1);setVisibilityUsefulInformation(!0)}function setVisibilityDrawButtons(n){n?$(".mapbox-gl-draw_polygon").parent().show():$(".mapbox-gl-draw_polygon").parent().hide()}function setVisibilityTrashButton(n){n?$(".mapbox-gl-draw_trash").show():$(".mapbox-gl-draw_trash").hide()}function setVisibilityCompassButton(n){n?$(".mapboxgl-ctrl-compass").show():$(".mapboxgl-ctrl-compass").hide()}function setVisibilityUsefulInformation(){[["C21_Schools",["C21_Schools"],!0,!0],["C21_Restaurants",["C21_Restaurants"],!0,!0],["C21_Cafes",["C21_Cafes"],!0,!0],["C21_Supermarkets",["C21_Supermarkets"],!0,!0],["C21_Transports",["C21_Transports_pol_label","C21_Transports_rail_station_label","airport-label","rail-label"],!0,!0],["C21_Universities",["C21_Universities"],!0,!0],["C21_Policy",["C21_Policy"],!0,!0],["C21_Religious",["C21_Religious"],!0,!0],["C21_Services",["C21_Services"],!0,!0],["poi-parks",["poi-parks-scalerank1","poi-parks-scalerank2","poi-parks-scalerank3","poi-parks_scalerank4"],!0,!0],["C21_Monuments",["C21_Monuments"],!0,!0],["C21_Hospital",["C21_Hospital"],!0,!0]].forEach(function(n){C_SHOW_USEFULL_INFO_CHECKBOXS&&n[2]?n[3]&&$("#"+n[0]).attr("checked","checked"):$("#"+n[0]+"_Group").hide();n[1].forEach(function(t){showLayer(t,C_SHOW_USEFULL_INFO_CHECKBOXS?n[2]&&n[3]:C_SHOW_USEFULL_LAYERS_WHITOUT_CHECKBOXS)})})}function setVisibilitySattelliteInformation(n){n?map.setLayoutProperty("mapbox-mapbox-satellite","visibility","visible"):map.setLayoutProperty("mapbox-mapbox-satellite","visibility","none")}function showLayer(n,t){map.setLayoutProperty(n,"visibility",t?"visible":"none")}function showLayersArray(n,t){n&&n.length>0&&n.forEach(function(n){map.setLayoutProperty(n,"visibility",t?"visible":"none")})}function showCityLabels(n){showLayer("place-town",n);showLayer("place-city-sm",n);showLayer("road-shields-black",n)}function pushFeatureToFeatureCollection(n,t,i,r,u){var f={type:"Feature",properties:r,geometry:{type:t,coordinates:i}};u&&(f.id=u);n.features.push(f)}function showInfo(n,t,i,r,u){n&&(u&&n.html(u),n.fadeIn(t,function(){i&&setTimeout(function(){n.fadeOut()},r)}))}function showErrorNotification(n){n&&($("#contact_success").hide(),showInfo($("#contact_error"),400,!0,1e3,n))}function getMasterID(){var n=queryStringJson.masterId;if(!n||n===0)throw"MasterID is not defined.";return n}function addEmptySourceLayer(n,t){map.getSource(n)||map.addSource(n,{type:"geojson",data:t})}function forceStartMap(){try{if(queryStringJson.v!=="m")return;applyRulesDrawButtons();mapLoaded?(showPleaseWaitTrobbler(!0,"forceStartMap mapLoaded"),getQueryDataset()):(setDefaults(),createMapInstance())}catch(n){console.log("Ocorreu um erro ao iniciar o mapa: "+n)}}function SyncFiltersWithMapbox(n){if(showPleaseWaitTrobbler(!0,"SyncFiltersWithMapbox"),mapLoaded){manageGetAllSEOResponse(n);setMapSource(stores);var t=queryStringJson.q.split("+");t&&t.length>=4&&setStartingMapPositionByLocationFilters()}}function setDefaults(){polygonRegionID=0;C_LANGUAGE=queryStringJson.language;isDrawing=!1;hasPolygonDrawed=!1;locationSetted=!1;sidebarHidedByZoom=!1;areRegionPolygonVisible=!1;selectedRegionName=undefined;btnAplicarPoligono=$("#btnAplicarPoligono");btnAplicarPoligono.hide();btnLimparPoligono=$("#btnLimparPoligono");btnLimparPoligono.hide();btnLimparRegiao=$("#btnLimparRegiao");queryStringJson&&queryStringJson.pr&&queryStringJson.pr=="1"?btnLimparRegiao.show():btnLimparRegiao.hide();btnCancelarPoligono=$("#btnCancelarPoligono");btnCancelarPoligono.hide();chkMostrarInfoUtil=$("#chkMostrarInfoUtil");chkMostrarInfoUtil.attr("checked",!0);spanEmptyListMessage=$("#emptyListMessage");spanEmptyListMessage.hide();divListings=$("#listings");divListings.hide();divMapInfo=$("#map-info");divMapInfo.hide();divMapInfo_messageImoveisVisiveis=$("#map-info #messageImoveisVisiveis");divMapInfo_messageImoveisVisiveis.hide();divMapboxContent=$(".mapboxContent");sidebarCardsPagination=$("#sidebarCardsPagination");kendoPropertiesMapview=$("#properties-mapview");selectedCardModal_UL=$("#selectedCardModal .modal-body ul");selectedCardModal=$("#selectedCardModal");container=$(".container");header_search=$(".header-search");throbber=$("#throbber");regionLayerName=getLayerNameByMasterID();btnAplicarPoligono.click(function(){addPolygonToQueryString(!1)});btnCancelarPoligono.click(function(){var n=draw.getAll(),t=undefined;if(n&&n.features&&n.features.length>0&&(t=n.features[0].id),!t){ResetPolygonButtons();return}draw.changeMode("FreeDrawMode",{id:t});draw.trash();ResetPolygonButtons()});btnLimparRegiao.click(function(){limparSelecaoRegiao()});isCallingGetAllSEO=!1;btnLimparPoligono.click(function(){var n=draw.getAll();n&&(restoreMap(),removePolygon())});mapOptions={container:"map",zoom:getDefaultZoomByMaster(),center:getDefaultCoordsByMasterID(),style:C_MAPBOX_MAP_STYLE,minZoom:2,renderWorldCopies:!1,dragRotate:!1,pitchWithRotate:!1}}function createMapInstance(){map=initMap(mapOptions);mapOnLoad();mapOnClick();addMapboxControls();mapOnZoom();divMapboxContent.show()}function mapOnLoad(){map.on("load",function(){MapLoad();mapLoaded=!0;setTimeout(function(){redrawPolygon()},1);mapResize()})}function MapLoad(){addEmptySourceLayer(C_MOUSEOVER_SOURCE);addEmptySourceLayer(C_MAPBOX_SOURCE_LAYER);addMarkersStyleLayer()}function addEmptySourceLayer(n){map.getSource(n)||map.addSource(n,{type:"geojson",data:EMPTY_SOURCE_FEATURE_COLLECTION})}function addMarkersStyleLayer(){var n={id:"unclustered-point",source:C_MAPBOX_SOURCE_LAYER,type:"symbol",layout:{"icon-image":"{MarkerIcon}","text-field":"{PriceCurrencyFormated}","text-offset":[0,1.5],"text-size":{stops:[[10,0],[11,10],[14,14]]},"icon-allow-overlap":!0,"icon-ignore-placement":!0,"text-optional":!0},paint:{"text-color":"#222222","text-halo-color":"#ffffff","text-halo-width":2},filter:["!has","point_count"],minzoom:C_ZOOM_TO_HIDE_MARKERS,maxzoom:20};createLayer(n);map.on("mouseenter","unclustered-point",function(){map.getCanvas().style.cursor="pointer"});map.on("mouseleave","unclustered-point",function(){map.getCanvas().style.cursor=""})}function addMapboxControls(){var n=MapboxDraw.modes;n.static=StaticMode;n.FreeDrawMode=FreeDrawMode;draw=new MapboxDraw({displayControlsDefault:!1,touchEnabled:!1,boxSelect:!1,keybindings:!1,controls:{polygon:!0,trash:!0},modes:n,styles:[{id:"highlight-active-points",type:"symbol",filter:["all",["==","$type","Point"],["==","meta","feature"],["==","active","true"]],layout:{"icon-image":"{MarkerIcon}","icon-allow-overlap":!0}},{id:"points-are-blue",type:"circle",filter:["all",["==","$type","Point"],["==","meta","feature"],["==","active","false"]],paint:{"circle-radius":10,"circle-color":"#000088"}},{id:"gl-draw-line",type:"line",filter:["all",["==","$type","LineString"],["!=","mode","static"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#D20C0C","line-dasharray":[.2,2],"line-width":2}},{id:"gl-draw-polygon-fill",type:"fill",filter:["all",["==","$type","Polygon"]],paint:{"fill-color":"#D20C0C","fill-outline-color":"#D20C0C","fill-opacity":.1}},{id:"gl-draw-polygon-stroke-active",type:"line",filter:["all",["==","$type","Polygon"],["!=","mode","static"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#D20C0C","line-dasharray":[.2,2],"line-width":2}},{id:"gl-draw-polygon-and-line-vertex-halo-active",type:"circle",filter:["all",["==","meta","vertex"],["==","$type","Point"],["!=","mode","static"]],paint:{"circle-radius":5,"circle-color":"#FFF"}},{id:"gl-draw-polygon-and-line-vertex-active",type:"circle",filter:["all",["==","meta","vertex"],["==","$type","Point"],["!=","mode","static"]],paint:{"circle-radius":3,"circle-color":"#D20C0C"}},{id:"gl-draw-line-static",type:"line",filter:["all",["==","$type","LineString"],["==","mode","static"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#D20C0C","line-width":3}},{id:"gl-draw-polygon-fill-static",type:"fill",filter:["all",["==","$type","Polygon"],["==","mode","static"]],paint:{"fill-color":"#000","fill-outline-color":"#000","fill-opacity":.1}},{id:"gl-draw-polygon-stroke-static",type:"line",filter:["all",["==","$type","Polygon"],["==","mode","static"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#D20C0C","line-width":3}}]});map.addControl(draw);$(".mapbox-gl-draw_polygon").click(function(){addDrawRestrictions()});AddGeolocationControl()}function mapOnClick(){map.on("click",function(n){var i=!1,t;checkDrawModeActive(n)||(t=map.queryRenderedFeatures(n.point,{layers:["unclustered-point"]}),t.length&&(sidebarRuasMouseOver(t[0].id),addHighlightCardOnMarkerClick(t[0]),i=!0),draw&&!i&&checkDrawsLimit(n))});map.on("mousemove",function(n){checkDrawModeActive(n)})}function mapOnZoom(){map.on("zoom",function(){var n=map.getZoom();applyRulesDrawButtons();n<C_ZOOM_TO_HIDE_MARKERS&&!sidebarHidedByZoom?(divListings.hide(),spanEmptyListMessage.show(),spanEmptyListMessage.text(mapWithoutResults),sidebarHidedByZoom=!0):sidebarHidedByZoom&&n>=C_ZOOM_TO_HIDE_MARKERS&&(spanEmptyListMessage.hide(),divListings.show(),sidebarHidedByZoom=!1)})}function getQueryDataset(){if(validateNecessityToInvokeGetAllSEO()){isCallingGetAllSEO=!0;showPleaseWaitTrobbler(!0,"getQueryDataset");var n=getURLGetALLSEO(decifredPolygonCoords);$.when($.ajax({url:n,dataType:"json",success:function(n){manageGetAllSEOResponse(n)},error:function(){console.log("Ocorreu um erro ao carregar os pontos.")}})).done(function(){setMapSource(stores);showPleaseWaitTrobbler(!1,"getQueryDataset")})}}function validateNecessityToInvokeGetAllSEO(){if(areRegionPolygonVisible)return addMapCountryPolygons(!1),showPleaseWaitTrobbler(!1,"getQueryDataset"),!1;if(isFilterPostback()||queryStringJson.userLocation){if(!isLocationSetted(!0))return addMapCountryPolygons(!0),showPleaseWaitTrobbler(!1,"getQueryDataset"),queryStringJson.pr=undefined,!1}else if(geolocate&&geolocate._onClickGeolocate&&$(".mapboxgl-ctrl-geolocate").is(":visible")&&setTimeout(geolocate._onClickGeolocate.bind(),1),masterAllowPolygonRegionView())return addMapCountryPolygons(!0),showPleaseWaitTrobbler(!1,"getQueryDataset"),!1;return isCallingGetAllSEO?!1:!0}function getURLGetALLSEO(){var i="/umbraco/Surface/C21PropertiesSearchListingSurface/GetAllSEO?",u=["rv","mapRequest"],r=!0,t,n;for(t in queryStringJson)if(!(u.indexOf(t)>-1)){n=queryStringJson[t];switch(t){case"numberOfElements":n=C_NUMBER_FEATURES;break;case"vtd":n=getKendoDropDownListSelectedId("#propertyviewtype","vtd");break;case"ptd":n=getKendoDropDownListSelectedId("#propertytype","ptd");break;case"lsd":n=getKendoDropDownListSelectedId("#propertylifestyletype","lsd");break;case"ccd":n=getKendoListViewSelectedIds("#customCharacteristics-listview","ccd");break;case"etd":n=getKendoMultiSelectSelectedIds("#equipmenttype","etd");break;case"pstld":n=getKendoListViewSelectedIds("#propertySubType-listview","pstld");break;case"v":n="m";break;case"q":n=n.replace(new RegExp(/\+/g),"%2b");break;default:n=n?n:n===!1?"false":""}r||(i+="&");i+=t+"="+n;r=!1}return i+"&mapRequest=true"}function manageGetAllSEOResponse(n){var t=createFeatureCollectionStores(n);stores=t;originalStores=JSON.parse(JSON.stringify(t));totalImoveis=n.PropertiesCount.toString().replace(/\B(?=(\d{3})+(?!\d))/g,".")}function setMapSource(n){if(sidebarRuasMouseOut(),stores=JSON.parse(JSON.stringify(n)),locationSetted||queryStringJson.polygon||setStartingMapPosition(),addEmptySourceLayer(C_MAPBOX_SOURCE_LAYER),map.getSource(C_MAPBOX_SOURCE_LAYER).setData(stores),divListings.show(),stores.features.length>0){buildPagination(1,10,1);var t=document.getElementById("listingCard-"+stores.features[0].properties.Id);t&&t.scrollIntoView();showTotalImoveisInfo()}else showWithoutResults();showPleaseWaitTrobbler(!1,"setMapSource");isCallingGetAllSEO=!1;masterAllowPolygonRegionView()&&showRegionLayer(!1)}function createFeatureCollectionStores(n){var u={},r,t,e,f,o;for(u.type="FeatureCollection",u.features=[],i=0;i<n.Properties.length;i++){r=n.Properties[i];t={};for(f in r)e=!0,f==="PriceCurrencyFormated"&&r.Stamps.HidePrice&&(e=!1),t[f]=e?r[f]:r.Stamps.HidePrice;o=[parseFloat(r.Longitude),parseFloat(r.Latitude)];t.MarkerIcon=getMarkerIcon(t.Stamps);t.MarkerIconOver=t.MarkerIcon+"-selected";t.CSSClass=getStampCSSClass(t.Stamps);t.StampText=getStampText(t.Stamps);pushFeatureToFeatureCollection(u,"Point",o,t,r.Id)}return u}function getStampText(n){return n.DropPrice?n.DropPrice:n.FullyFinanced?n.FullyFinanced:n.Reserved?n.Reserved:n.Sold?n.Sold:n.Campaign?n.Campaign:""}function getStampCSSClass(n){return n.DropPrice?"label label-danger":n.FullyFinanced?"label label-blue":n.Reserved?"label label-primary":n.Sold?"label label-primary":n.Campaign?"label label-danger":""}function getMarkerIcon(n){return n.DropPrice!==""?"marker-property-pricedrop":n.FullyFinanced!==""?"marker-property-financed":n.Reserved!==""?"marker-property-reserved":n.Sold!==""?"marker-property-sold":"marker-property"}function getKendoDropDownListSelectedId(n,t){var i=-1,r=queryStringJson[t]!==null&&queryStringJson[t]!=undefined?queryStringJson[t].replace(/\+/g," "):"";return $(n).data("kendoDropDownList").dataSource._data.forEach(function(t,u){t.Name.toUpperCase()==r.toUpperCase()&&(i=$(n).data("kendoDropDownList").dataSource._data[u].Id)}),i}function getKendoListViewSelectedIds(n,t){var i=[],r=queryStringJson[t].split("|");return r.forEach(function(t){$(n).data("kendoListView").dataSource._data.forEach(function(r,u){r.Name.toUpperCase()==t.toUpperCase()&&i.push($(n).data("kendoListView").dataSource._data[u].Id)})}),String(i.join("|"))}function getKendoMultiSelectSelectedIds(n,t){var i=[],r=queryStringJson[t].split("|");return r.forEach(function(t){$(n).data("kendoMultiSelect").dataSource._data.forEach(function(r,u){r.Name.toUpperCase()==t.toUpperCase()&&i.push($(n).data("kendoMultiSelect").dataSource._data[u].Id)})}),String(i.join("|"))}function checkIfDropdownContainsValue(n,t){var i=!1;return t=t.replace(/[\-]/g," "),$(n).data("kendoDropDownList").dataSource._data.forEach(function(n){n||n.Location||(i=!1);n=n.Location.replace(/[\-]/g," ");n.toUpperCase()==t.toUpperCase()&&(i=!0)}),i}function createSidebarCardsList(n){var t,i,r;n?(i=n==1?0:(n-1)*10,r=n==1?10:n*10,t=stores.features.slice(i,r)):t=stores.features.slice(0,10);updateKendoCardList(t)}function addHighlightCardOnMarkerClick(n){flyToStore(n,!1);goToCardsPage(n);removeHighlightCard();var t=document.getElementById("listingCard-"+n.properties.Id);t&&(t.classList.add("active"),t.scrollIntoView());$(window).width()<768&&(selectedCardModal_UL.html(t),selectedCardModal.modal("show"))}function removeHighlightCard(){var n=document.getElementsByClassName("active"),t=!1;if(n&&n.length>0)for(c=0;c<n.length&&!t;c++)n[c].id.startsWith("listingCard-")&&(n[c].classList.remove("active"),t=!0)}function goToCardsPage(n){var r=$.map(stores.features,function(t,i){if(t.properties.Id==n.properties.Id)return i});if(r){var i=Math.floor((r[0]+10)/10),t=getTotalCardsPages(stores.features.length),u=i>t?t:i,f=10>t?t:10;buildPagination(u,f,i)}}function buildPagination(n,t,i){createSidebarCardsList(i);sidebarCardsPagination.data("twbs-pagination")&&sidebarCardsPagination.twbsPagination("destroy");sidebarCardsPagination.twbsPagination({next:map_c21Pagination.Next,prev:map_c21Pagination.Previous,first:map_c21Pagination.First,last:map_c21Pagination.Last,startPage:n,totalPages:getTotalCardsPages(stores.features.length),visiblePages:t,onPageClick:function(n,t){createSidebarCardsList(t)}})}function sidebarRuasMouseOver(n){sidebarMouseoverEffect(n,stores)}function updateKendoCardList(n){var t=new kendo.data.DataSource({data:n});kendoPropertiesMapview.data("kendoListView").setDataSource(t)}function getTotalCardsPages(n){return n<10?1:Math.round(n/10)}function restoreMap(){stores=JSON.parse(JSON.stringify(originalStores));setMapSource(originalStores)}function showWithoutResults(){divListings.hide();spanEmptyListMessage.show();spanEmptyListMessage.text(mapWithoutResults);divMapInfo_messageImoveisVisiveis.show();divMapInfo_messageImoveisVisiveis.text(mapWithoutResults)}function showTotalImoveisInfo(){var n;hidePropertyListTotal===0?n=totalResultsMessage.replace("{0}",stores.features.length).replace("{1}",totalImoveis):hidePropertyListTotal==1&&(n=totalResultsMessage_HidePropertyListTotal.replace("{0}",stores.features.length));totalImoveis.replace(".","")>C_NUMBER_FEATURES?(divMapInfo.show(),divMapInfo_messageImoveisVisiveis.html(n),divMapInfo_messageImoveisVisiveis.show()):divMapInfo_messageImoveisVisiveis.hide()}function setStartingMapPosition(){if(queryStringJson.q){var n=queryStringJson.q.split("+");(n&&n.length>1||queryStringJson.pr=="1")&&setStartingMapPositionByLocationFilters()}else masterAllowPolygonRegionView()||isFilterPostback()?!queryStringJson.userLocation&&!geolocate&&geolocate._onClickGeolocate&&$(".mapboxgl-ctrl-geolocate").is(":visible")&&setTimeout(geolocate._onClickGeolocate.bind(),1):(map.setMinZoom(getDefaultZoomByMaster()),setDefaultLocationAndZoomByMasterID(map),map.setLayerZoomRange("unclustered-point",getDefaultZoomByMaster(),20),applyRulesDrawButtons());locationSetted||addMapCountryPolygons(!0)}function setStartingMapPositionByLocationFilters(){var t,r,u,f;if(stores&&stores.features&&stores.features.length>0){var n=[],e=stores.features.length>10?10:stores.features.length;if(stores.features.length==1)flyToStore(stores.features[0],!1),locationSetted=!0;else{for(i=0;i<e;i++)if(stores.features[i].geometry.coordinates&&stores.features[i].geometry.coordinates[0]&&stores.features[i].geometry.coordinates[1]){for(t=0,r=turf.point(stores.features[i].geometry.coordinates),x=0;x<(5>stores.features.length?stores.features.length:5);x++)if(x!=i){if(t==2)break;stores.features[x].geometry.coordinates&&stores.features[x].geometry.coordinates[0]&&stores.features[x].geometry.coordinates[1]&&(u=turf.point(stores.features[x].geometry.coordinates),f=turf.distance(r,u,"kilometers"),f<75&&t++)}t>=1&&n.push(stores.features[i].geometry.coordinates)}n&&n.length>0&&(fitMapBoundsToCoordinates(n),locationSetted=!0);locationSetted&&showRegionLayer(!1)}}}function isLocationSetted(n){if(isSetted=!1,queryStringJson.q){var t=queryStringJson.q.split("+");(t&&t.length>1||queryStringJson.pr=="1")&&(isSetted=!0)}else queryStringJson.polygon?isSetted=!0:n&&selectedRegionName&&(isSetted=!0);return isSetted}function getClosestPoints(n){if(!queryStringJson||queryStringJson.userLocation!=1||!queryStringJson.polygon){var t={name:"geolocationCircle",centerCoordinates:[n.longitude,n.latitude]};draw.deleteAll();createCircle([n.longitude,n.latitude],C_GEOLOCATION_DISTANCE_KM,10,"kilometers",t);draw.add(circle);addPolygonToQueryString(!0)}}function getLayerNameByMasterID(){switch(getMasterID()){case"1":return"portugal_layer2";case"2":return"spain-provinces-6xlbhj";case"3":return"americacentral-1jnrmo";case"4":return"colombia-a57n5z";case"5":return"peru-departamental-26wa8f";case"8":return"bolivia-670u27";default:return undefined}}function addMapCountryPolygons(n){var r,t;if(masterAllowPolygonRegionView()&&(setDefaultLocationAndZoomByMasterID(map),locationSetted=!0,showRegionLayer(!0),n)&&(!queryStringJson||!queryStringJson.pr||queryStringJson.pr!="1")&&!(map.getZoom()>6)&&propertiesSearchListingViewModel&&getMasterID()&&regionLayerName){r={id:"state-fills-hover",type:"fill",source:{type:"geojson",data:EMPTY_SOURCE_FEATURE_COLLECTION},paint:{"fill-color":"#ff9900","fill-opacity":.8,"fill-outline-color":"#000000"}};createLayer(r);t=new mapboxgl.Popup({closeButton:!1,closeOnClick:!1});areRegionPolygonVisible=!0;map.on("mousemove",regionLayerName,function(n){var r,u,o,f,e,s,h;if((map.getCanvasContainer().style.cursor="pointer",r=getActiveFeaturesOnRegionsLayer(n),r)&&(u=getRegionNameFieldByMasterID(),o=r[0].properties[u],t.setLngLat(n.lngLat).setHTML(o).addTo(map),!selectedRegionName||selectedRegionName!=r[0].properties[u])){if(r.length>1){for(i=0;i<r.length-1;i++){if(s=i==0?r[i]:e,i+1>r.length)break;h=r[i+1];e=turf.union(s,h)}f=e}else f=r[0];map.getSource("state-fills-hover").setData({type:"FeatureCollection",features:[f]});selectedRegionName=r[0].properties[getRegionNameFieldByMasterID()]}});map.on("mouseleave",regionLayerName,function(){selectedRegionName=undefined;map.getSource("state-fills-hover").setData(EMPTY_SOURCE_FEATURE_COLLECTION);t.remove()});map.on("click",regionLayerName,function(n){var f=getActiveFeaturesOnRegionsLayer(n),i,r,u,e,o,t;if(f){if(i=f[0].properties[getRegionNameFieldByMasterID()],r=locationDiacritics(i),u=getMasterID()=="3"?r:locationDiacritics(propertiesSearchListingViewModel.selectedaddressLocationLevel1Id)+"+"+r,e=getMasterID()=="3"?"#addressLocationLevel1":"#addressLocationLevel2",o=checkIfDropdownContainsValue(e,i),!o){showErrorNotification(mapWithoutResults);return}queryStringJson&&(t=RemoveParameterFromUrl(document.location.href,"q"),t+="&q="+u,t+="&pr=1",queryStringJson.q=u,queryStringJson.pr=1,redirectToPage(t))}})}}function getRegionNameFieldByMasterID(){switch(getMasterID()){case"1":return"Distrito";case"3":return"country";case"4":return"NOMBRE_DPT";case"2":case"5":case"8":return"name";default:throw"Region name property is not defined to current MasterID";}}function limparSelecaoRegiao(){var n=RemoveParameterFromUrl(document.location.href,"q");n=RemoveParameterFromUrl(n,"pr");queryStringJson.q="";queryStringJson.pr=undefined;redirectToPage(n)}function getActiveFeaturesOnRegionsLayer(n){if(n.features.length>0){var t=getRegionNameFieldByMasterID();return getRenderedMapFeatures(n.features[0].properties[t])}}function getRenderedMapFeatures(n){regionLayerName||(regionLayerName=getLayerNameByMasterID());var t=getRegionNameFieldByMasterID();return map.queryRenderedFeatures({layers:[regionLayerName],filter:["==",t,n]})}function showRegionLayer(n){regionLayerName||(regionLayerName=getLayerNameByMasterID());map.setLayoutProperty(regionLayerName,"visibility",n?"visible":"none");areRegionPolygonVisible=n;n?(map.dragPan.disable(),showCityLabels(!1),disableZoomControls(!0,!1)):(map.setMaxZoom(20),map.setMinZoom(10),map.dragPan.enable(),showCityLabels(!0));applyRulesDrawButtons()}function masterAllowPolygonRegionView(){return notAllowedUseRegionsPolygon.indexOf(getMasterID())==-1}function applyRulesDrawButtons(){if(hasPolygonDrawed){setVisibilityDrawButtons(!1);return}if(areRegionPolygonVisible||$(window).width()<1024){setVisibilityDrawButtons(!1);return}if(mapLoaded&&map.getZoom()>C_ZOOM_TO_SHOW_DRAW_CONTROL){setVisibilityDrawButtons(!0);return}setVisibilityDrawButtons(!1);return}function checkDrawModeActive(n){if(n.target._container.classList.contains("mode-FreeDrawMode")){var t=draw.getAll();return t&&t.features&&t.features.length>0&&t.features[0].geometry.coordinates.length>0&&t.features[0].geometry.coordinates[0].length>=5&&btnAplicarPoligono.show(),isDrawing=!0,!0}return!1}function addDrawRestrictions(){btnCancelarPoligono.show();disableControlsAndBlockPageContent(!0);draw.changeMode("FreeDrawMode");$(".mapbox-gl-draw_polygon").addClass("active")}function removeDrawRestrictions(){btnCancelarPoligono.hide();disableControlsAndBlockPageContent(!1);$(".mapbox-gl-draw_polygon").removeClass("active")}function ResetPolygonButtons(){btnAplicarPoligono.hide();btnLimparPoligono.hide();removeDrawRestrictions();isDrawing=!1;hasPolygonDrawed=!1}function encryptAndFormatPolygonCoordinates(n){var t=n.split(";"),i=t[0]+";#######"+n;return encryptString(i,C_CIPHER_KEY)}function addPolygonToQueryString(n){var t,i;showPleaseWaitTrobbler(!0,"addPolygonToQueryString");t=draw.getAll();t&&(t.features&&t.features.length>0?(i="",t.features.forEach(function(t){var u,f,r;t.geometry.type==="Polygon"&&(u=[],u=checkLenghtOfPolygonCoordinates(t.geometry.coordinates[0]),u.forEach(function(n){i+=n[0]+","+n[1]+";"}),f="&polygon="+encryptAndFormatPolygonCoordinates(i),r=applyURLRules(),r=RemoveParameterFromUrl(r,"polygon"),queryStringJson&&queryStringJson.q&&(r=RemoveParameterFromUrl(r,"q"),queryStringJson.q=""),queryStringJson&&queryStringJson.pr&&(r=RemoveParameterFromUrl(r,"pr"),queryStringJson.pr=""),n&&(r+="&userLocation=1",queryStringJson.userLocation=1),r+=f,btnAplicarPoligono.hide(),removeDrawRestrictions(),isDrawing=!1,redirectToPage(r))})):removePolygon())}function removePolygon(){var n=RemoveParameterFromUrl(applyURLRules(),"polygon");queryStringJson.userLocation==1&&(n=RemoveParameterFromUrl(applyURLRules(),"polygon"),n+="&userLocation=0",queryStringJson.userLocation=0);ResetPolygonButtons();redirectToPage(n)}function redrawPolygon(){var r={},u,f,n,e,t;if(location.search&&(r=splitURL(),r.polygon)){for(hasPolygonDrawed=!0,u=decryptString(r.polygon,C_CIPHER_KEY),decifredPolygonCoords=u,f=u.split(";"),n=[],i=0;i<f.length;i++)(t=f[i].split(","),t!="")&&n.push([Number(t[0]),Number(t[1])]);draw&&(e=turf.polygon([n],{name:"qsPolygon"}),draw.add(e),fitMapBoundsToCoordinates(n),draw.changeMode("static"));btnLimparPoligono.show();applyRulesDrawButtons()}getQueryDataset()}function checkDrawsLimit(){var n=draw.getAll();if(n&&n.features.length>1){draw.delete(n.features[1].id).getAll();console.log("Grave a geometria atual antes de começar uma nova!");return}}function createCircle(n,t,i,r,u){return circle=turf.circle(n,t,i,r,u)}function checkLenghtOfPolygonCoordinates(n){if(n.length>=C_LIMIT_COORDS_TO_WS){var t=[],r=parseInt(n.length/C_LIMIT_COORDS_TO_WS);for(i=0;i<n.length;i++)(i%r==0||i==n.length-1)&&t.push(n[i]);return t}return n}function encryptString(n,t){var t=CryptoJS.enc.Utf8.parse(t),i=CryptoJS.enc.Utf8.parse(t),r=CryptoJS.AES.encrypt(CryptoJS.enc.Utf8.parse(n),t,{keySize:128,iv:i,mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7});return r.toString()}function decryptString(n,t){var f=n.replace(/[\r\n]/g,""),e=CryptoJS.enc.Utf8.parse(t),o=CryptoJS.enc.Utf8.parse(t),s=CryptoJS.AES.decrypt(f,e,{keySize:16,iv:o,mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7}),r=s.toString(CryptoJS.enc.Utf8),i,u;if(r)return(i=r.split(";#######"),!i||i.length<2)?r:(u=i.splice(1,i.length-1),u[0])}function disableControlsAndBlockPageContent(n){n?(map.dragPan.disable(),disableZoomControls(!0,!0),divListings.addClass("disabledbutton"),container.addClass("disabledbutton"),header_search.addClass("disabledbutton"),btnLimparRegiao.hide()):(map.dragPan.enable(),disableZoomControls(!1,!0),divListings.removeClass("disabledbutton"),container.removeClass("disabledbutton"),header_search.removeClass("disabledbutton"),queryStringJson&&queryStringJson.pr&&queryStringJson.pr=="1"&&btnLimparRegiao.show())}function showPleaseWaitTrobbler(n){var t=throbber.is(":visible");n&&!t?throbber.show():!n&&t&&throbber.hide()}function redirectToPage(n){var t=RemoveParameterFromUrl(n,"v");t=t+"&v=m";document.location.href=t}function applyURLRules(){var n=document.location.href;return n.charAt(n.length-1)=="#"&&(n=n.substr(0,n.length-1)),n}function splitURL(){for(var i=location.search.substring(1).split("&"),r={},t,n=0;n<i.length;n++)(t=i[n].split("="),t[0])&&(r[t[0]]=t[1]||!0);return r}function isFilterPostback(){var n=!1;return n=isLocationSetted(!1),n||(queryStringJson.vtd||queryStringJson.ptd||queryStringJson.lsd||queryStringJson.ccd||queryStringJson.etd)&&(n=!0),n}var FreeDrawMode={currentFeatureID:undefined,coordinates:[],isDragging:!1,allowDrag:!0,limitCoordinates:20,onSetup:function(n){n&&(this.currentFeatureID=n?n.id:undefined);this.coordinates=[]},firstOrDefault:function(n,t){for(var i in n)if(n.hasOwnProperty(i))return n[i];return t},createPolygon:function(n){if(!(n.length<=1))return this.newFeature({type:"Feature",geometry:{type:"Polygon",coordinates:[n]}})},replaceFeature:function(){var t,n,i;(this.currentFeatureID&&this.deleteFeature(this.currentFeatureID),t=this.createPolygon(this.coordinates),t)&&(n=this.addFeature(t),n&&n._features&&(i=this.firstOrDefault(n._features,0),this.currentFeatureID=i.id))},endFreeDraw:function(){if(this.coordinates.length>=this.limitCoordinates){var n=[],t=parseInt(this.coordinates.length/this.limitCoordinates);for(i=0;i<this.coordinates.length;i++)i%t==0&&n.push(this.coordinates[i]);this.coordinates=n}this.replaceFeature();this.coordinates=[]},onDrag:function(n,t){this.allowDrag&&(this.isDragging=!0,this.coordinates.push([t.lngLat.lng,t.lngLat.lat]),this.replaceFeature())},onMouseUp:function(){this.isDragging&&(this.endFreeDraw(),this.isDragging=!1,this.allowDrag=!1)},onTrash:function(){this.currentFeatureID&&this.deleteFeature(this.currentFeatureID);this.coordinates=[]},toDisplayFeatures:function(n,t,i){i(t)}},StaticMode={},CryptoJS,totalImoveis,stores,originalStores,btnLimparRegiao,map,draw,btnAplicarPoligono,btnLimparPoligono,mapLoaded,chkMostrarInfoUtil,isDrawing,spanEmptyListMessage,hasPolygonDrawed,mapOptions,isCallingGetAllSEO,decifredPolygonCoords,btnCancelarPoligono,locationSetted,polygonRegionID,divMapInfo_messageImoveisVisiveis,sidebarHidedByZoom,divListings,divMapInfo,divMapboxContent,sidebarCardsPagination,kendoPropertiesMapview,selectedCardModal_UL,selectedCardModal,container,header_search,throbber,areRegionPolygonVisible,selectedRegionName,regionLayerName;StaticMode.onSetup=function(){return this.setActionableState(),{}};StaticMode.toDisplayFeatures=function(n,t,i){i(t)},function(n){if(typeof exports=="object"&&typeof module!="undefined")module.exports=n();else if(typeof define=="function"&&define.amd)define([],n);else{var t;t=typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:this;t.mapboxgl=n()}}(function(){var n;return function t(n,i,r){function f(u,o){var h,c,s;if(!i[u]){if(!n[u]){if(h=typeof require=="function"&&require,!o&&h)return h(u,!0);if(e)return e(u,!0);c=new Error("Cannot find module '"+u+"'");throw c.code="MODULE_NOT_FOUND",c;}s=i[u]={exports:{}};n[u][0].call(s.exports,function(t){var i=n[u][1][t];return f(i?i:t)},s,s.exports,t,n,i,r)}return i[u].exports}for(var e=typeof require=="function"&&require,u=0;u<r.length;u++)f(r[u]);return f}({1:[function(t,i,r){!function(t,u){"object"==typeof r&&"undefined"!=typeof i?i.exports=u():"function"==typeof n&&n.amd?n(u):t.glMatrix=u()}(this,function(){"use strict";function n(n,t,i){var r=t[0],u=t[1],f=t[2];return n[0]=r*i[0]+u*i[3]+f*i[6],n[1]=r*i[1]+u*i[4]+f*i[7],n[2]=r*i[2]+u*i[5]+f*i[8],n}function t(n,t,i){var r=t[0],u=t[1],f=t[2],e=t[3];return n[0]=i[0]*r+i[4]*u+i[8]*f+i[12]*e,n[1]=i[1]*r+i[5]*u+i[9]*f+i[13]*e,n[2]=i[2]*r+i[6]*u+i[10]*f+i[14]*e,n[3]=i[3]*r+i[7]*u+i[11]*f+i[15]*e,n}function i(){var n=new Float32Array(4);return n[0]=1,n[1]=0,n[2]=0,n[3]=1,n}function r(n,t,i){var f=t[0],e=t[1],o=t[2],s=t[3],r=Math.sin(i),u=Math.cos(i);return n[0]=f*u+o*r,n[1]=e*u+s*r,n[2]=f*-r+o*u,n[3]=e*-r+s*u,n}function u(n,t,i){var f=t[0],e=t[1],o=t[2],s=t[3],r=i[0],u=i[1];return n[0]=f*r,n[1]=e*r,n[2]=o*u,n[3]=s*u,n}function f(){var n=new Float32Array(9);return n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=1,n[5]=0,n[6]=0,n[7]=0,n[8]=1,n}function e(n,t){var i=Math.sin(t),r=Math.cos(t);return n[0]=r,n[1]=i,n[2]=0,n[3]=-i,n[4]=r,n[5]=0,n[6]=0,n[7]=0,n[8]=1,n}function o(){var n=new Float32Array(16);return n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function s(n){return n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function h(n,t){var r=t[0],u=t[1],f=t[2],e=t[3],o=t[4],s=t[5],h=t[6],c=t[7],l=t[8],a=t[9],v=t[10],y=t[11],p=t[12],w=t[13],b=t[14],k=t[15],d=r*s-u*o,g=r*h-f*o,nt=r*c-e*o,tt=u*h-f*s,it=u*c-e*s,rt=f*c-e*h,ut=l*w-a*p,ft=l*b-v*p,et=l*k-y*p,ot=a*b-v*w,st=a*k-y*w,ht=v*k-y*b,i=d*ht-g*st+nt*ot+tt*et-it*ft+rt*ut;return i?(i=1/i,n[0]=(s*ht-h*st+c*ot)*i,n[1]=(f*st-u*ht-e*ot)*i,n[2]=(w*rt-b*it+k*tt)*i,n[3]=(v*it-a*rt-y*tt)*i,n[4]=(h*et-o*ht-c*ft)*i,n[5]=(r*ht-f*et+e*ft)*i,n[6]=(b*nt-p*rt-k*g)*i,n[7]=(l*rt-v*nt+y*g)*i,n[8]=(o*st-s*et+c*ut)*i,n[9]=(u*et-r*st-e*ut)*i,n[10]=(p*it-w*nt+k*d)*i,n[11]=(a*nt-l*it-y*d)*i,n[12]=(s*ft-o*ot-h*ut)*i,n[13]=(r*ot-u*ft+f*ut)*i,n[14]=(w*g-p*tt-b*d)*i,n[15]=(l*tt-a*g+v*d)*i,n):null}function c(n,t,i){var o=t[0],s=t[1],h=t[2],c=t[3],l=t[4],a=t[5],v=t[6],y=t[7],p=t[8],w=t[9],b=t[10],k=t[11],d=t[12],g=t[13],nt=t[14],tt=t[15],r=i[0],u=i[1],f=i[2],e=i[3];return n[0]=r*o+u*l+f*p+e*d,n[1]=r*s+u*a+f*w+e*g,n[2]=r*h+u*v+f*b+e*nt,n[3]=r*c+u*y+f*k+e*tt,r=i[4],u=i[5],f=i[6],e=i[7],n[4]=r*o+u*l+f*p+e*d,n[5]=r*s+u*a+f*w+e*g,n[6]=r*h+u*v+f*b+e*nt,n[7]=r*c+u*y+f*k+e*tt,r=i[8],u=i[9],f=i[10],e=i[11],n[8]=r*o+u*l+f*p+e*d,n[9]=r*s+u*a+f*w+e*g,n[10]=r*h+u*v+f*b+e*nt,n[11]=r*c+u*y+f*k+e*tt,r=i[12],u=i[13],f=i[14],e=i[15],n[12]=r*o+u*l+f*p+e*d,n[13]=r*s+u*a+f*w+e*g,n[14]=r*h+u*v+f*b+e*nt,n[15]=r*c+u*y+f*k+e*tt,n}function l(n,t,i){var e,o,s,h,c,l,a,v,y,p,w,b,r=i[0],u=i[1],f=i[2];return t===n?(n[12]=t[0]*r+t[4]*u+t[8]*f+t[12],n[13]=t[1]*r+t[5]*u+t[9]*f+t[13],n[14]=t[2]*r+t[6]*u+t[10]*f+t[14],n[15]=t[3]*r+t[7]*u+t[11]*f+t[15]):(e=t[0],o=t[1],s=t[2],h=t[3],c=t[4],l=t[5],a=t[6],v=t[7],y=t[8],p=t[9],w=t[10],b=t[11],n[0]=e,n[1]=o,n[2]=s,n[3]=h,n[4]=c,n[5]=l,n[6]=a,n[7]=v,n[8]=y,n[9]=p,n[10]=w,n[11]=b,n[12]=e*r+c*u+y*f+t[12],n[13]=o*r+l*u+p*f+t[13],n[14]=s*r+a*u+w*f+t[14],n[15]=h*r+v*u+b*f+t[15]),n}function a(n,t,i){var r=i[0],u=i[1],f=i[2];return n[0]=t[0]*r,n[1]=t[1]*r,n[2]=t[2]*r,n[3]=t[3]*r,n[4]=t[4]*u,n[5]=t[5]*u,n[6]=t[6]*u,n[7]=t[7]*u,n[8]=t[8]*f,n[9]=t[9]*f,n[10]=t[10]*f,n[11]=t[11]*f,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n}function v(n,t,i){var r=Math.sin(i),u=Math.cos(i),f=t[4],e=t[5],o=t[6],s=t[7],h=t[8],c=t[9],l=t[10],a=t[11];return t!==n&&(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15]),n[4]=f*u+h*r,n[5]=e*u+c*r,n[6]=o*u+l*r,n[7]=s*u+a*r,n[8]=h*u-f*r,n[9]=c*u-e*r,n[10]=l*u-o*r,n[11]=a*u-s*r,n}function y(n,t,i){var r=Math.sin(i),u=Math.cos(i),f=t[0],e=t[1],o=t[2],s=t[3],h=t[4],c=t[5],l=t[6],a=t[7];return t!==n&&(n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15]),n[0]=f*u+h*r,n[1]=e*u+c*r,n[2]=o*u+l*r,n[3]=s*u+a*r,n[4]=h*u-f*r,n[5]=c*u-e*r,n[6]=l*u-o*r,n[7]=a*u-s*r,n}function p(n,t,i,r,u){var f=1/Math.tan(t/2),e=1/(r-u);return n[0]=f/i,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=f,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=(u+r)*e,n[11]=-1,n[12]=0,n[13]=0,n[14]=2*u*r*e,n[15]=0,n}function w(n,t,i,r,u,f,e){var o=1/(t-i),s=1/(r-u),h=1/(f-e);return n[0]=-2*o,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=-2*s,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=2*h,n[11]=0,n[12]=(t+i)*o,n[13]=(u+r)*s,n[14]=(e+f)*h,n[15]=1,n}return function(){var n=new Float32Array(3);n[0]=0;n[1]=0;n[2]=0}(),function(){var n=new Float32Array(4);n[0]=0;n[1]=0;n[2]=0;n[3]=0}(),{vec3:{transformMat3:n},vec4:{transformMat4:t},mat2:{create:i,rotate:r,scale:u},mat3:{create:f,fromRotation:e},mat4:{create:o,identity:s,translate:l,scale:a,multiply:c,perspective:p,rotateX:v,rotateZ:y,invert:h,ortho:w}}})},{}],2:[function(n,t){"use strict";function i(n,t){this.x=n;this.y=t}t.exports=i;i.prototype={clone:function(){return new i(this.x,this.y)},add:function(n){return this.clone()._add(n)},sub:function(n){return this.clone()._sub(n)},multByPoint:function(n){return this.clone()._multByPoint(n)},divByPoint:function(n){return this.clone()._divByPoint(n)},mult:function(n){return this.clone()._mult(n)},div:function(n){return this.clone()._div(n)},rotate:function(n){return this.clone()._rotate(n)},rotateAround:function(n,t){return this.clone()._rotateAround(n,t)},matMult:function(n){return this.clone()._matMult(n)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(n){return this.x===n.x&&this.y===n.y},dist:function(n){return Math.sqrt(this.distSqr(n))},distSqr:function(n){var t=n.x-this.x,i=n.y-this.y;return t*t+i*i},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(n){return Math.atan2(this.y-n.y,this.x-n.x)},angleWith:function(n){return this.angleWithSep(n.x,n.y)},angleWithSep:function(n,t){return Math.atan2(this.x*t-this.y*n,this.x*n+this.y*t)},_matMult:function(n){var t=n[0]*this.x+n[1]*this.y,i=n[2]*this.x+n[3]*this.y;return this.x=t,this.y=i,this},_add:function(n){return this.x+=n.x,this.y+=n.y,this},_sub:function(n){return this.x-=n.x,this.y-=n.y,this},_mult:function(n){return this.x*=n,this.y*=n,this},_div:function(n){return this.x/=n,this.y/=n,this},_multByPoint:function(n){return this.x*=n.x,this.y*=n.y,this},_divByPoint:function(n){return this.x/=n.x,this.y/=n.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var n=this.y;return this.y=this.x,this.x=-n,this},_rotate:function(n){var t=Math.cos(n),i=Math.sin(n),r=t*this.x-i*this.y,u=i*this.x+t*this.y;return this.x=r,this.y=u,this},_rotateAround:function(n,t){var i=Math.cos(n),r=Math.sin(n),u=t.x+i*(this.x-t.x)-r*(this.y-t.y),f=t.y+r*(this.x-t.x)+i*(this.y-t.y);return this.x=u,this.y=f,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}};i.convert=function(n){return n instanceof i?n:Array.isArray(n)?new i(n[0],n[1]):n}},{}],3:[function(t,i,r){!function(t,u){"object"==typeof r&&"undefined"!=typeof i?i.exports=u():"function"==typeof n&&n.amd?n(u):t.ShelfPack=u()}(this,function(){function n(n,t,i){i=i||{};this.w=n||64;this.h=t||64;this.autoResize=!!i.autoResize;this.shelves=[];this.freebins=[];this.stats={};this.bins={};this.maxId=0}function t(n,t,i){this.x=0;this.y=n;this.w=this.free=t;this.h=i}function i(n,t,i,r,u,f,e){this.id=n;this.x=t;this.y=i;this.w=r;this.h=u;this.maxw=f||r;this.maxh=e||u;this.refcount=0}return n.prototype.pack=function(n,t){n=[].concat(n);t=t||{};for(var u,f,e,r,o=[],i=0;i<n.length;i++)if(u=n[i].w||n[i].width,f=n[i].h||n[i].height,e=n[i].id,u&&f){if(!(r=this.packOne(u,f,e)))continue;t.inPlace&&(n[i].x=r.x,n[i].y=r.y,n[i].id=r.id);o.push(r)}return this.shrink(),o},n.prototype.packOne=function(n,i,r){var u,o,c,f,e={freebin:-1,shelf:-1,waste:1/0},l=0,s,a,h,v;if("string"==typeof r||"number"==typeof r){if(u=this.getBin(r))return this.ref(u),u;"number"==typeof r&&(this.maxId=Math.max(r,this.maxId))}else r=++this.maxId;for(f=0;f<this.freebins.length;f++){if(u=this.freebins[f],i===u.maxh&&n===u.maxw)return this.allocFreebin(f,n,i,r);i>u.maxh||n>u.maxw||i<=u.maxh&&n<=u.maxw&&(c=u.maxw*u.maxh-n*i)<e.waste&&(e.waste=c,e.freebin=f)}for(f=0;f<this.shelves.length;f++)if(o=this.shelves[f],l+=o.h,!(n>o.free)){if(i===o.h)return this.allocShelf(f,n,i,r);i>o.h||i<o.h&&(c=(o.h-i)*n)<e.waste&&(e.freebin=-1,e.waste=c,e.shelf=f)}return-1!==e.freebin?this.allocFreebin(e.freebin,n,i,r):-1!==e.shelf?this.allocShelf(e.shelf,n,i,r):i<=this.h-l&&n<=this.w?(o=new t(l,this.w,i),this.allocShelf(this.shelves.push(o)-1,n,i,r)):this.autoResize?(s=a=this.h,h=v=this.w,(h<=s||n>h)&&(v=2*Math.max(n,h)),(s<h||i>s)&&(a=2*Math.max(i,s)),this.resize(v,a),this.packOne(n,i,r)):null},n.prototype.allocFreebin=function(n,t,i,r){var u=this.freebins.splice(n,1)[0];return u.id=r,u.w=t,u.h=i,u.refcount=0,this.bins[r]=u,this.ref(u),u},n.prototype.allocShelf=function(n,t,i,r){var f=this.shelves[n],u=f.alloc(t,i,r);return this.bins[r]=u,this.ref(u),u},n.prototype.shrink=function(){var n;if(this.shelves.length>0){for(var t=0,r=0,i=0;i<this.shelves.length;i++)n=this.shelves[i],r+=n.h,t=Math.max(n.w-n.free,t);this.resize(t,r)}},n.prototype.getBin=function(n){return this.bins[n]},n.prototype.ref=function(n){if(1==++n.refcount){var t=n.h;this.stats[t]=1+(0|this.stats[t])}return n.refcount},n.prototype.unref=function(n){return 0===n.refcount?0:(0==--n.refcount&&(this.stats[n.h]--,delete this.bins[n.id],this.freebins.push(n)),n.refcount)},n.prototype.clear=function(){this.shelves=[];this.freebins=[];this.stats={};this.bins={};this.maxId=0},n.prototype.resize=function(n,t){this.w=n;this.h=t;for(var i=0;i<this.shelves.length;i++)this.shelves[i].resize(n);return!0},t.prototype.alloc=function(n,t,r){if(n>this.free||t>this.h)return null;var u=this.x;return this.x+=n,this.free-=n,new i(r,u,this.y,n,t,n,this.h)},t.prototype.resize=function(n){return this.free+=n-this.w,this.w=n,!0},n})},{}],4:[function(n,t){"use strict";function r(n,t,i,r,u,f){this.fontSize=n||24;this.buffer=void 0===t?3:t;this.cutoff=r||.25;this.fontFamily=u||"sans-serif";this.fontWeight=f||"normal";this.radius=i||8;var e=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas");this.canvas.width=this.canvas.height=e;this.ctx=this.canvas.getContext("2d");this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily;this.ctx.textBaseline="middle";this.ctx.fillStyle="black";this.gridOuter=new Float64Array(e*e);this.gridInner=new Float64Array(e*e);this.f=new Float64Array(e);this.d=new Float64Array(e);this.z=new Float64Array(e+1);this.v=new Int16Array(e);this.middle=Math.round(e/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function u(n,t,i,r,u,e,o){for(var h,s=0;s<t;s++){for(h=0;h<i;h++)r[h]=n[h*t+s];for(f(r,u,e,o,i),h=0;h<i;h++)n[h*t+s]=u[h]}for(h=0;h<i;h++){for(s=0;s<t;s++)r[s]=n[h*t+s];for(f(r,u,e,o,t),s=0;s<t;s++)n[h*t+s]=Math.sqrt(u[s])}}function f(n,t,r,u,f){var o,e,s;for(r[0]=0,u[0]=-i,u[1]=+i,o=1,e=0;o<f;o++){for(s=(n[o]+o*o-(n[r[e]]+r[e]*r[e]))/(2*o-2*r[e]);s<=u[e];)e--,s=(n[o]+o*o-(n[r[e]]+r[e]*r[e]))/(2*o-2*r[e]);e++;r[e]=o;u[e]=s;u[e+1]=+i}for(o=0,e=0;o<f;o++){for(;u[e+1]<o;)e++;t[o]=(o-r[e])*(o-r[e])+n[r[e]]}}t.exports=r;var i=1e20;r.prototype.draw=function(n){var r,e;this.ctx.clearRect(0,0,this.size,this.size);this.ctx.fillText(n,this.buffer,this.middle);for(var o=this.ctx.getImageData(0,0,this.size,this.size),f=new Uint8ClampedArray(this.size*this.size),t=0;t<this.size*this.size;t++)r=o.data[4*t+3]/255,this.gridOuter[t]=1===r?0:0===r?i:Math.pow(Math.max(0,.5-r),2),this.gridInner[t]=1===r?i:0===r?0:Math.pow(Math.max(0,r-.5),2);for(u(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),u(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),t=0;t<this.size*this.size;t++)e=this.gridOuter[t]-this.gridInner[t],f[t]=Math.max(0,Math.min(255,Math.round(255-255*(e/this.radius+this.cutoff))));return f}},{}],5:[function(n,t){function i(n,t,i,r){this.cx=3*n;this.bx=3*(i-n)-this.cx;this.ax=1-this.cx-this.bx;this.cy=3*t;this.by=3*(r-t)-this.cy;this.ay=1-this.cy-this.by;this.p1x=n;this.p1y=r;this.p2x=i;this.p2y=r}t.exports=i;i.prototype.sampleCurveX=function(n){return((this.ax*n+this.bx)*n+this.cx)*n};i.prototype.sampleCurveY=function(n){return((this.ay*n+this.by)*n+this.cy)*n};i.prototype.sampleCurveDerivativeX=function(n){return(3*this.ax*n+2*this.bx)*n+this.cx};i.prototype.solveCurveX=function(n,t){var r,u,i,f,e,o;for(void 0===t&&(t=1e-6),i=n,e=0;e<8;e++){if(f=this.sampleCurveX(i)-n,Math.abs(f)<t)return i;if(o=this.sampleCurveDerivativeX(i),Math.abs(o)<1e-6)break;i-=f/o}if(r=0,u=1,(i=n)<r)return r;if(i>u)return u;for(;r<u;){if(f=this.sampleCurveX(i),Math.abs(f-n)<t)return i;n>f?r=i:u=i;i=.5*(u-r)+r}return i};i.prototype.solve=function(n,t){return this.sampleCurveY(this.solveCurveX(n,t))}},{}],6:[function(n,t){t.exports.VectorTile=n("./lib/vectortile.js");t.exports.VectorTileFeature=n("./lib/vectortilefeature.js");t.exports.VectorTileLayer=n("./lib/vectortilelayer.js")},{"./lib/vectortile.js":7,"./lib/vectortilefeature.js":8,"./lib/vectortilelayer.js":9}],7:[function(n,t){"use strict";function i(n,t){this.layers=n.readFields(r,{},t)}function r(n,t,i){if(3===n){var r=new u(i,i.readVarint()+i.pos);r.length&&(t[r.name]=r)}}var u=n("./vectortilelayer");t.exports=i},{"./vectortilelayer":9}],8:[function(n,t){"use strict";function i(n,t,i,u,f){this.properties={};this.extent=i;this.type=0;this._pbf=n;this._geometry=-1;this._keys=u;this._values=f;n.readFields(r,this,t)}function r(n,t,i){1==n?t.id=i.readVarint():2==n?u(i,t):3==n?t.type=i.readVarint():4==n&&(t._geometry=i.pos)}function u(n,t){for(var r,u,i=n.readVarint()+n.pos;n.pos<i;)r=t._keys[n.readVarint()],u=t._values[n.readVarint()],t.properties[r]=u}function f(n){var o=n.length,t,f,r,i,u;if(o<=1)return[n];for(r=[],i=0;i<o;i++)u=e(n[i]),0!==u&&(void 0===f&&(f=u<0),f===u<0?(t&&r.push(t),t=[n[i]]):t.push(n[i]));return t&&r.push(t),r}function e(n){for(var t,i,u=0,r=0,f=n.length,e=f-1;r<f;e=r++)t=n[r],i=n[e],u+=(i.x-t.x)*(t.y+i.y);return u}var o=n("@mapbox/point-geometry");t.exports=i;i.types=["Unknown","Point","LineString","Polygon"];i.prototype.loadGeometry=function(){var t=this._pbf,f;t.pos=this._geometry;for(var n,h=t.readVarint()+t.pos,i=1,r=0,e=0,s=0,u=[];t.pos<h;)if(r||(f=t.readVarint(),i=7&f,r=f>>3),r--,1===i||2===i)e+=t.readSVarint(),s+=t.readSVarint(),1===i&&(n&&u.push(n),n=[]),n.push(new o(e,s));else{if(7!==i)throw new Error("unknown command "+i);n&&n.push(n[0].clone())}return n&&u.push(n),u};i.prototype.bbox=function(){var n=this._pbf,h;n.pos=this._geometry;for(var c=n.readVarint()+n.pos,t=1,u=0,i=0,r=0,f=1/0,e=-1/0,o=1/0,s=-1/0;n.pos<c;)if(u||(h=n.readVarint(),t=7&h,u=h>>3),u--,1===t||2===t)i+=n.readSVarint(),r+=n.readSVarint(),i<f&&(f=i),i>e&&(e=i),r<o&&(o=r),r>s&&(s=r);else if(7!==t)throw new Error("unknown command "+t);return[f,o,e,s]};i.prototype.toGeoJSON=function(n,t,r){function s(n){for(var i,r,t=0;t<n.length;t++)i=n[t],r=180-360*(i.y+y)/a,n[t]=[360*(i.x+v)/a-180,360/Math.PI*Math.atan(Math.exp(r*Math.PI/180))-90]}var e,o,a=this.extent*Math.pow(2,r),v=this.extent*n,y=this.extent*t,u=this.loadGeometry(),h=i.types[this.type],c,l;switch(this.type){case 1:for(c=[],e=0;e<u.length;e++)c[e]=u[e][0];u=c;s(u);break;case 2:for(e=0;e<u.length;e++)s(u[e]);break;case 3:for(u=f(u),e=0;e<u.length;e++)for(o=0;o<u[e].length;o++)s(u[e][o])}return 1===u.length?u=u[0]:h="Multi"+h,l={type:"Feature",geometry:{type:h,coordinates:u},properties:this.properties},"id"in this&&(l.id=this.id),l}},{"@mapbox/point-geometry":2}],9:[function(n,t){"use strict";function i(n,t){this.version=1;this.name=null;this.extent=4096;this.length=0;this._pbf=n;this._keys=[];this._values=[];this._features=[];n.readFields(r,this,t);this.length=this._features.length}function r(n,t,i){15===n?t.version=i.readVarint():1===n?t.name=i.readString():5===n?t.extent=i.readVarint():2===n?t._features.push(i.pos):3===n?t._keys.push(i.readString()):4===n&&t._values.push(u(i))}function u(n){for(var t,i=null,r=n.readVarint()+n.pos;n.pos<r;)t=n.readVarint()>>3,i=1===t?n.readString():2===t?n.readFloat():3===t?n.readDouble():4===t?n.readVarint64():5===t?n.readVarint():6===t?n.readSVarint():7===t?n.readBoolean():null;return i}var f=n("./vectortilefeature.js");t.exports=i;i.prototype.feature=function(n){if(n<0||n>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[n];var t=this._pbf.readVarint()+this._pbf.pos;return new f(this._pbf,t,this.extent,this._keys,this._values)}},{"./vectortilefeature.js":8}],10:[function(t,i,r){!function(t,u){"object"==typeof r&&"undefined"!=typeof i?u(r):"function"==typeof n&&n.amd?n(["exports"],u):u(t.WhooTS=t.WhooTS||{})}(this,function(n){function r(n,t,r,u,f,e){return e=e||{},n+"?"+["bbox="+i(r,u,f),"format="+(e.format||"image/png"),"service="+(e.service||"WMS"),"version="+(e.version||"1.1.1"),"request="+(e.request||"GetMap"),"srs="+(e.srs||"EPSG:3857"),"width="+(e.width||256),"height="+(e.height||256),"layers="+t].join("&")}function i(n,i,r){i=Math.pow(2,r)-i-1;var u=t(256*n,256*i,r),f=t(256*(n+1),256*(i+1),r);return u[0]+","+u[1]+","+f[0]+","+f[1]}function t(n,t,i){var r=12756274*Math.PI/256/Math.pow(2,i);return[n*r-6378137*Math.PI,t*r-6378137*Math.PI]}n.getURL=r;n.getTileBBox=i;n.getMercCoords=t;Object.defineProperty(n,"__esModule",{value:!0})})},{}],11:[function(n,t,i){function r(n){return n=Math.round(n),n<0?0:n>255?255:n}function s(n){return n<0?0:n>1?1:n}function f(n){return r("%"===n[n.length-1]?parseFloat(n)/100*255:parseInt(n))}function u(n){return s("%"===n[n.length-1]?parseFloat(n)/100:parseFloat(n))}function e(n,t,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?n+(t-n)*i*6:2*i<1?t:3*i<2?n+(t-n)*(2/3-i)*6:n}function h(n){var i=n.replace(/ /g,"").toLowerCase(),t,h,v;if(i in o)return o[i].slice();if("#"===i[0])return 4===i.length?(t=parseInt(i.substr(1),16),t>=0&&t<=4095?[(3840&t)>>4|(3840&t)>>8,240&t|(240&t)>>4,15&t|(15&t)<<4,1]:null):7===i.length?(t=parseInt(i.substr(1),16),t>=0&&t<=16777215?[(16711680&t)>>16,(65280&t)>>8,255&t,1]:null):null;if(h=i.indexOf("("),v=i.indexOf(")"),-1!==h&&v+1===i.length){var b=i.substr(0,h),s=i.substr(h+1,v-(h+1)).split(","),l=1;switch(b){case"rgba":if(4!==s.length)return null;l=u(s.pop());case"rgb":return 3!==s.length?null:[f(s[0]),f(s[1]),f(s[2]),l];case"hsla":if(4!==s.length)return null;l=u(s.pop());case"hsl":if(3!==s.length)return null;var y=(parseFloat(s[0])%360+360)%360/360,p=u(s[1]),c=u(s[2]),a=c<=.5?c*(p+1):c+p-c*p,w=2*c-a;return[r(255*e(w,a,y+1/3)),r(255*e(w,a,y)),r(255*e(w,a,y-1/3)),l];default:return null}}return null}var o={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};try{i.parseCSSColor=h}catch(c){}},{}],12:[function(n,t){"use strict";function h(n,t,i){var r,u,c,l,e,o,w,s;i=i||2;var y=t&&t.length,p=y?t[0]*i:n.length,h=v(n,0,p,i,!0),a=[];if(!h)return a;if(y&&(h=nt(n,t,h,i)),n.length>80*i){for(r=c=n[0],u=l=n[1],s=i;s<p;s+=i)e=n[s],o=n[s+1],e<r&&(r=e),o<u&&(u=o),e>c&&(c=e),o>l&&(l=o);w=Math.max(c-r,l-u)}return f(h,a,i,r,u,w),a}function v(n,t,i,u,f){var e,s;if(f===a(n,t,i,u)>0)for(e=t;e<i;e+=u)s=w(e,n[e],n[e+1],s);else for(e=i-u;e>=t;e-=u)s=w(e,n[e],n[e+1],s);return s&&r(s,s.next)&&(o(s),s=s.next),s}function u(n,t){if(!n)return n;t||(t=n);var f,u=n;do if(f=!1,u.steiner||!r(u,u.next)&&0!==i(u.prev,u,u.next))u=u.next;else{if(o(u),(u=t=u.prev)===u.next)return null;f=!0}while(f||u!==t);return t}function f(n,t,i,r,e,s,h){if(n){!h&&s&&ut(n,r,e,s);for(var l,c,a=n;n.prev!==n.next;)if(l=n.prev,c=n.next,s?k(n,r,e,s):b(n))t.push(l.i/i),t.push(n.i/i),t.push(c.i/i),o(n),n=c.next,a=c.next;else if((n=c)===a){h?1===h?(n=d(n,t,i),f(n,t,i,r,e,s,2)):2===h&&g(n,t,i,r,e,s):f(u(n),t,i,r,e,s,1);break}}}function b(n){var r=n.prev,u=n,f=n.next,t;if(i(r,u,f)>=0)return!1;for(t=n.next.next;t!==n.prev;){if(s(r.x,r.y,u.x,u.y,f.x,f.y,t.x,t.y)&&i(t.prev,t,t.next)>=0)return!1;t=t.next}return!0}function k(n,t,r,u){var o=n.prev,h=n,e=n.next;if(i(o,h,e)>=0)return!1;for(var l=o.x<h.x?o.x<e.x?o.x:e.x:h.x<e.x?h.x:e.x,a=o.y<h.y?o.y<e.y?o.y:e.y:h.y<e.y?h.y:e.y,v=o.x>h.x?o.x>e.x?o.x:e.x:h.x>e.x?h.x:e.x,y=o.y>h.y?o.y>e.y?o.y:e.y:h.y>e.y?h.y:e.y,p=c(l,a,t,r,u),w=c(v,y,t,r,u),f=n.nextZ;f&&f.z<=w;){if(f!==n.prev&&f!==n.next&&s(o.x,o.y,h.x,h.y,e.x,e.y,f.x,f.y)&&i(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(f=n.prevZ;f&&f.z>=p;){if(f!==n.prev&&f!==n.next&&s(o.x,o.y,h.x,h.y,e.x,e.y,f.x,f.y)&&i(f.prev,f,f.next)>=0)return!1;f=f.prevZ}return!0}function d(n,t,i){var u=n,s,f;do s=u.prev,f=u.next.next,!r(s,f)&&y(s,u,u.next,f)&&e(s,f)&&e(f,s)&&(t.push(s.i/i),t.push(u.i/i),t.push(f.i/i),o(u),o(u.next),u=n=f),u=u.next;while(u!==n);return u}function g(n,t,i,r,e,o){var s=n,h,c;do{for(h=s.next.next;h!==s.prev;){if(s.i!==h.i&&ot(s,h))return c=p(s,h),s=u(s,s.next),c=u(c,c.next),f(s,t,i,r,e,o),void f(c,t,i,r,e,o);h=h.next}s=s.next}while(s!==n)}function nt(n,t,i,r){for(var h,c,e,o=[],f=0,s=t.length;f<s;f++)h=t[f]*r,c=f<s-1?t[f+1]*r:n.length,e=v(n,h,c,r,!1),e===e.next&&(e.steiner=!0),o.push(et(e));for(o.sort(tt),f=0;f<o.length;f++)it(o[f],i),i=u(i,i.next);return i}function tt(n,t){return n.x-t.x}function it(n,t){if(t=rt(n,t)){var i=p(t,n);u(i,i.next)}}function rt(n,t){var r,i=t,f=n.x,u=n.y,o=-1/0,h;do{if(u<=i.y&&u>=i.next.y&&(h=i.x+(u-i.y)*(i.next.x-i.x)/(i.next.y-i.y),h<=f&&h>o)){if(o=h,h===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===o)return r.prev;var c,y=r,v=r.x,l=r.y,a=1/0;for(i=r.next;i!==y;)f>=i.x&&i.x>=v&&s(u<l?f:o,u,v,l,u<l?o:f,u,i.x,i.y)&&((c=Math.abs(u-i.y)/(f-i.x))<a||c===a&&i.x>r.x)&&e(i,n)&&(r=i,a=c),i=i.next;return r}function ut(n,t,i,r){var u=n;do null===u.z&&(u.z=c(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;ft(u)}function ft(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?(r=t,t=t.nextZ,e--):0!==e&&t?i.z<=t.z?(r=i,i=i.nextZ,f--):(r=t,t=t.nextZ,e--):(r=i,i=i.nextZ,f--),u?u.nextZ=r:n=r,r.prevZ=u,u=r;i=t}u.nextZ=null;h*=2}while(s>1);return n}function c(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 et(n){var t=n,i=n;do t.x<i.x&&(i=t),t=t.next;while(t!==n);return i}function s(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 ot(n,t){return n.next.i!==t.i&&n.prev.i!==t.i&&!st(n,t)&&e(n,t)&&e(t,n)&&ht(n,t)}function i(n,t,i){return(t.y-n.y)*(i.x-t.x)-(t.x-n.x)*(i.y-t.y)}function r(n,t){return n.x===t.x&&n.y===t.y}function y(n,t,u,f){return!!(r(n,t)&&r(u,f)||r(n,f)&&r(u,t))||i(n,t,u)>0!=i(n,t,f)>0&&i(u,f,n)>0!=i(u,f,t)>0}function st(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&&y(i,i.next,n,t))return!0;i=i.next}while(i!==n);return!1}function e(n,t){return i(n.prev,n,n.next)<0?i(n,t,n.next)>=0&&i(n,n.prev,t)>=0:i(n,t,n.prev)<0||i(n,n.next,t)<0}function ht(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&&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}function p(n,t){var r=new l(n.i,n.x,n.y),i=new l(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 w(n,t,i,r){var u=new l(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 o(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 l(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 a(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}t.exports=h;h.deviation=function(n,t,i,r){var h=t&&t.length,p=h?t[0]*i:n.length,f=Math.abs(a(n,0,p,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(a(n,c,l,i));for(e=0,u=0;u<r.length;u+=3){var o=r[u]*i,v=r[u+1]*i,y=r[u+2]*i;e+=Math.abs((n[o]-n[y])*(n[v+1]-n[o+1])-(n[o]-n[v])*(n[y+1]-n[o+1]))}return 0===f&&0===e?0:Math.abs((e-f)/f)};h.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}},{}],13:[function(n,t){function e(n){if("Polygon"===n.type)return u(n.coordinates);if("MultiPolygon"===n.type){for(var i=0,t=0;t<n.coordinates.length;t++)i+=u(n.coordinates[t]);return i}return null}function u(n){var r=0,t;if(n&&n.length>0)for(r+=Math.abs(i(n[0])),t=1;t<n.length;t++)r-=Math.abs(i(n[t]));return r}function i(n){var i=0,u,e,t;if(n.length>2){for(t=0;t<n.length-1;t++)u=n[t],e=n[t+1],i+=r(e[0]-u[0])*(2+Math.sin(r(u[1]))+Math.sin(r(e[1])));i=i*f.RADIUS*f.RADIUS/2}return i}function r(n){return n*Math.PI/180}var f=n("wgs84");t.exports.geometry=e;t.exports.ring=i},{wgs84:49}],14:[function(n,t){function i(n,t){switch(n&&n.type||null){case"FeatureCollection":return n.features=n.features.map(r(i,t)),n;case"Feature":return n.geometry=i(n.geometry,t),n;case"Polygon":case"MultiPolygon":return e(n,t);default:return n}}function r(n,t){return function(i){return n(i,t)}}function e(n,t){return"Polygon"===n.type?n.coordinates=u(n.coordinates,t):"MultiPolygon"===n.type&&(n.coordinates=n.coordinates.map(r(u,t))),n}function u(n,t){t=!!t;n[0]=f(n[0],t);for(var i=1;i<n.length;i++)n[i]=f(n[i],!t);return n}function f(n,t){return o(n)===t?n:n.reverse()}function o(n){return s.ring(n)>=0}var s=n("geojson-area");t.exports=i},{"geojson-area":13}],15:[function(n,t){"use strict";function r(n,t,i,r,o,s,h,c){var a,v,b;if(i/=t,r/=t,h>=i&&c<=r)return n;if(h>r||c<i)return null;for(a=[],v=0;v<n.length;v++){var y,p,l=n[v],k=l.geometry,w=l.type;(y=l.min[o],p=l.max[o],y>=i&&p<=r)?a.push(l):y>r||p<i||(b=1===w?u(k,i,r,o):f(k,i,r,o,s,3===w),b.length&&a.push(e(l.tags,w,b,l.id)))}return a.length?a:null}function u(n,t,i,r){for(var e,o,f=[],u=0;u<n.length;u++)e=n[u],o=e[r],o>=t&&o<=i&&f.push(e);return f}function f(n,t,r,u,f,e){for(var l=[],k=0;k<n.length;k++){for(var s,d,v=0,c=0,h=null,a=n[k],p=a.area,w=a.dist,b=a.outer,g=a.length,o=[],y=0;y<g-1;y++)s=h||a[y],h=a[y+1],v=c||s[u],c=h[u],v<t?c>r?(o.push(f(s,h,t),f(s,h,r)),e||(o=i(l,o,p,w,b))):c>=t&&o.push(f(s,h,t)):v>r?c<t?(o.push(f(s,h,r),f(s,h,t)),e||(o=i(l,o,p,w,b))):c<=r&&o.push(f(s,h,r)):(o.push(s),c<t?(o.push(f(s,h,t)),e||(o=i(l,o,p,w,b))):c>r&&(o.push(f(s,h,r)),e||(o=i(l,o,p,w,b))));s=a[g-1];v=s[u];v>=t&&v<=r&&o.push(s);d=o[o.length-1];e&&d&&(o[0][0]!==d[0]||o[0][1]!==d[1])&&o.push(o[0]);i(l,o,p,w,b)}return l}function i(n,t,i,r,u){return t.length&&(t.area=i,t.dist=r,void 0!==u&&(t.outer=u),n.push(t)),[]}t.exports=r;var e=n("./feature")},{"./feature":17}],16:[function(n,t){"use strict";function e(n,t){var i=[],u;if("FeatureCollection"===n.type)for(u=0;u<n.features.length;u++)r(i,n.features[u],t);else"Feature"===n.type?r(i,n,t):r(i,{geometry:n},t);return i}function r(n,t,e){if(null!==t.geometry){var o,v,c,l,p=t.geometry,s=p.type,h=p.coordinates,a=t.properties,y=t.id;if("Point"===s)n.push(i(a,1,[f(h)],y));else if("MultiPoint"===s)n.push(i(a,1,u(h),y));else if("LineString"===s)n.push(i(a,2,[u(h,e)],y));else if("MultiLineString"===s||"Polygon"===s){for(c=[],o=0;o<h.length;o++)l=u(h[o],e),"Polygon"===s&&(l.outer=0===o),c.push(l);n.push(i(a,"Polygon"===s?3:2,c,y))}else if("MultiPolygon"===s){for(c=[],o=0;o<h.length;o++)for(v=0;v<h[o].length;v++)l=u(h[o][v],e),l.outer=0===v,c.push(l);n.push(i(a,3,c,y))}else{if("GeometryCollection"!==s)throw new Error("Input data is not a valid GeoJSON object.");for(o=0;o<p.geometries.length;o++)r(n,{geometry:p.geometries[o],properties:a},e)}}}function u(n,t){for(var i=[],r=0;r<n.length;r++)i.push(f(n[r]));return t&&(s(i,t),o(i)),i}function f(n){var i=Math.sin(n[1]*Math.PI/180),r=n[0]/360+.5,t=.5-.25*Math.log((1+i)/(1-i))/Math.PI;return t=t<0?0:t>1?1:t,[r,t,0]}function o(n){for(var i,t,u=0,f=0,r=0;r<n.length-1;r++)i=t||n[r],t=n[r+1],u+=i[0]*t[1]-t[0]*i[1],f+=Math.abs(t[0]-i[0])+Math.abs(t[1]-i[1]);n.area=Math.abs(u/2);n.dist=f}t.exports=e;var s=n("./simplify"),i=n("./feature")},{"./feature":17,"./simplify":19}],17:[function(n,t){"use strict";function r(n,t,i,r){var f={id:r||null,type:t,geometry:i,tags:n||null,min:[1/0,1/0],max:[-1/0,-1/0]};return u(f),f}function u(n){var r=n.geometry,u=n.min,f=n.max,t;if(1===n.type)i(u,f,r);else for(t=0;t<r.length;t++)i(u,f,r[t]);return n}function i(n,t,i){for(var r,u=0;u<i.length;u++)r=i[u],n[0]=Math.min(r[0],n[0]),t[0]=Math.max(r[0],t[0]),n[1]=Math.min(r[1],n[1]),t[1]=Math.max(r[1],t[1])}t.exports=r},{}],18:[function(n,t){"use strict";function h(n,t){return new r(n,t)}function r(n,t){var r,u,i;t=this.options=c(Object.create(this.options),t);r=t.debug;r&&console.time("preprocess data");u=1<<t.maxZoom;i=l(n,t.tolerance/(u*t.extent));this.tiles={};this.tileCoords=[];r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",t.indexMaxZoom,t.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0);i=a(i,t.buffer/t.extent,o);i.length&&this.splitTile(i,0,0,0);r&&(i.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function u(n,t,i){return 32*((1<<n)*i+t)+n}function o(n,t,i){return[i,(i-n[0])*(t[1]-n[1])/(t[0]-n[0])+n[1],1]}function f(n,t,i){return[(i-n[1])*(t[0]-n[0])/(t[1]-n[1])+n[0],i,1]}function c(n,t){for(var i in t)n[i]=t[i];return n}function s(n,t,i){var s=n.source,r,o,f,u;if(1!==s.length||(r=s[0],3!==r.type||r.geometry.length>1)||(o=r.geometry[0].length,5!==o))return!1;for(f=0;f<o;f++)if(u=e.point(r.geometry[0][f],t,n.z2,n.x,n.y),u[0]!==-i&&u[0]!==t+i||u[1]!==-i&&u[1]!==t+i)return!1;return!0}t.exports=h;var l=n("./convert"),e=n("./transform"),i=n("./clip"),a=n("./wrap"),v=n("./tile");r.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,solidChildren:!1,tolerance:3,extent:4096,buffer:64,debug:0};r.prototype.splitTile=function(n,t,r,e,h,c,l){for(var nt,tt,p=[n,t,r,e],y=this.options,k=y.debug,ht=null;p.length;){e=p.pop();r=p.pop();t=p.pop();n=p.pop();var w=1<<t,ct=u(t,r,e),a=this.tiles[ct],lt=t===y.maxZoom?0:y.tolerance/(w*y.extent);if(!a&&(k>1&&console.time("creation"),a=this.tiles[ct]=v(n,w,r,e,lt,t===y.maxZoom),this.tileCoords.push({z:t,x:r,y:e}),k)&&(k>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",t,r,e,a.numFeatures,a.numPoints,a.numSimplified),console.timeEnd("creation")),nt="z"+t,this.stats[nt]=(this.stats[nt]||0)+1,this.total++),a.source=n,h){if(t===y.maxZoom||t===h)continue;if(tt=1<<h-t,r!==Math.floor(c/tt)||e!==Math.floor(l/tt))continue}else if(t===y.indexMaxZoom||a.numPoints<=y.indexMaxPoints)continue;if(y.solidChildren||!s(a,y.extent,y.buffer)){a.source=null;k>1&&console.time("clipping");var it,rt,ut,ft,d,g,b=.5*y.buffer/y.extent,et=.5-b,ot=.5+b,st=1+b;it=rt=ut=ft=null;d=i(n,w,r-b,r+ot,0,o,a.min[0],a.max[0]);g=i(n,w,r+et,r+st,0,o,a.min[0],a.max[0]);d&&(it=i(d,w,e-b,e+ot,1,f,a.min[1],a.max[1]),rt=i(d,w,e+et,e+st,1,f,a.min[1],a.max[1]));g&&(ut=i(g,w,e-b,e+ot,1,f,a.min[1],a.max[1]),ft=i(g,w,e+et,e+st,1,f,a.min[1],a.max[1]));k>1&&console.timeEnd("clipping");n.length&&(p.push(it||[],t+1,2*r,2*e),p.push(rt||[],t+1,2*r,2*e+1),p.push(ut||[],t+1,2*r+1,2*e),p.push(ft||[],t+1,2*r+1,2*e+1))}else h&&(ht=t)}return ht};r.prototype.getTile=function(n,t,i){var y=this.options,l=y.extent,a=y.debug,p=1<<n,f,v,w;if(t=(t%p+p)%p,f=u(n,t,i),this.tiles[f])return e.tile(this.tiles[f],l);a>1&&console.log("drilling down to z%d-%d-%d",n,t,i);for(var r,o=n,h=t,c=i;!r&&o>0;)o--,h=Math.floor(h/2),c=Math.floor(c/2),r=this.tiles[u(o,h,c)];return!r||!r.source?null:(a>1&&console.log("found parent tile z%d-%d-%d",o,h,c),s(r,l,y.buffer))?e.tile(r,l):(a>1&&console.time("drilling down"),v=this.splitTile(r.source,o,h,c,n,t,i),(a>1&&console.timeEnd("drilling down"),null!==v)&&(w=1<<n-v,f=u(v,Math.floor(t/w),Math.floor(i/w))),this.tiles[f]?e.tile(this.tiles[f],l):null)}},{"./clip":15,"./convert":16,"./tile":20,"./transform":21,"./wrap":22}],19:[function(n,t){"use strict";function i(n,t){var u,f,h,o,c=t*t,l=n.length,i=0,e=l-1,s=[];for(n[i][2]=1,n[e][2]=1;e;){for(f=0,u=i+1;u<e;u++)(h=r(n[u],n[i],n[e]))>f&&(o=u,f=h);f>c?(n[o][2]=f,s.push(i),s.push(o),i=o):(e=s.pop(),i=s.pop())}}function r(n,t,i){var f=t[0],e=t[1],s=i[0],h=i[1],c=n[0],l=n[1],r=s-f,u=h-e,o;return(0!==r||0!==u)&&(o=((c-f)*r+(l-e)*u)/(r*r+u*u),o>1?(f=s,e=h):o>0&&(f+=r*o,e+=u*o)),r=c-f,u=l-e,r*r+u*u}t.exports=i},{}],20:[function(n,t){"use strict";function i(n,t,i,u,f,e){for(var h,c,o={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:i,y:u,z2:t,transformed:!1,min:[2,1],max:[-1,0]},s=0;s<n.length;s++)o.numFeatures++,r(o,n[s],f,e),h=n[s].min,c=n[s].max,h[0]<o.min[0]&&(o.min[0]=h[0]),h[1]<o.min[1]&&(o.min[1]=h[1]),c[0]>o.max[0]&&(o.max[0]=c[0]),c[1]>o.max[1]&&(o.max[1]=c[1]);return o}function r(n,t,i,r){var f,s,e,a,h=t.geometry,o=t.type,c=[],y=i*i,l,v;if(1===o)for(f=0;f<h.length;f++)c.push(h[f]),n.numPoints++,n.numSimplified++;else for(f=0;f<h.length;f++)if(e=h[f],!r&&(2===o&&e.dist<i||3===o&&e.area<y))n.numPoints+=e.length;else{for(l=[],s=0;s<e.length;s++)a=e[s],(r||a[2]>y)&&(l.push(a),n.numSimplified++),n.numPoints++;3===o&&u(l,e.outer);c.push(l)}c.length&&(v={geometry:c,type:o,tags:t.tags||null},null!==t.id&&(v.id=t.id),n.features.push(v))}function u(n,t){f(n)<0===t&&n.reverse()}function f(n){for(var t,i,u=0,r=0,f=n.length,e=f-1;r<f;e=r++)t=n[r],i=n[e],u+=(i[0]-t[0])*(t[1]+i[1]);return u}t.exports=i},{}],21:[function(n,t,i){"use strict";function u(n,t){var s,u,o;if(n.transformed)return n;for(var i,f,h=n.z2,c=n.x,l=n.y,e=0;e<n.features.length;e++)if(s=n.features[e],u=s.geometry,1===s.type)for(i=0;i<u.length;i++)u[i]=r(u[i],t,h,c,l);else for(i=0;i<u.length;i++)for(o=u[i],f=0;f<o.length;f++)o[f]=r(o[f],t,h,c,l);return n.transformed=!0,n}function r(n,t,i,r,u){return[Math.round(t*(n[0]*i-r)),Math.round(t*(n[1]*i-u))]}i.tile=u;i.point=r},{}],22:[function(n,t){"use strict";function f(n,t,u){var f=n,e=i(n,1,-1-t,t,0,u,-1,2),o=i(n,1,1-t,2+t,0,u,-1,2);return(e||o)&&(f=i(n,1,-t,1+t,0,u,-1,2)||[],e&&(f=r(e,1).concat(f)),o&&(f=f.concat(r(o,-1)))),f}function r(n,t){for(var f,i,h,o,s=[],r=0;r<n.length;r++){if(i=n[r],h=i.type,1===h)f=u(i.geometry,t);else for(f=[],o=0;o<i.geometry.length;o++)f.push(u(i.geometry[o],t));s.push(e(i.tags,h,f,i.id))}return s}function u(n,t){var r=[],i;for(r.area=n.area,r.dist=n.dist,i=0;i<n.length;i++)r.push([n[i][0]+t,n[i][1],n[i][2]]);return r}var i=n("./clip"),e=n("./feature");t.exports=f},{"./clip":15,"./feature":17}],23:[function(n,t){"use strict";function i(n,t,i){var e=this.cells=[],u,f,o,s,a,h,c,l;if(n instanceof ArrayBuffer){for(this.arrayBuffer=n,u=new Int32Array(this.arrayBuffer),n=u[0],t=u[1],i=u[2],this.d=t+2*i,f=0;f<this.d*this.d;f++)o=u[r+f],s=u[r+f+1],e.push(o===s?null:u.subarray(o,s));a=u[r+e.length];h=u[r+e.length+1];this.keys=u.subarray(a,h);this.bboxes=u.subarray(h);this.insert=this._insertReadonly}else{for(this.d=t+2*i,c=0;c<this.d*this.d;c++)e.push([]);this.keys=[];this.bboxes=[]}this.n=t;this.extent=n;this.padding=i;this.scale=t/n;this.uid=0;l=i/t*n;this.min=-l;this.max=n+l}t.exports=i;var r=3;i.prototype.insert=function(n,t,i,r,u){this._forEachCell(t,i,r,u,this._insertCell,this.uid++);this.keys.push(n);this.bboxes.push(t);this.bboxes.push(i);this.bboxes.push(r);this.bboxes.push(u)};i.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer.";};i.prototype._insertCell=function(n,t,i,r,u,f){this.cells[u].push(f)};i.prototype.query=function(n,t,i,r){var f=this.min,e=this.max,u,o;return n<=f&&t<=f&&e<=i&&e<=r?Array.prototype.slice.call(this.keys):(u=[],o={},this._forEachCell(n,t,i,r,this._queryCell,u,o),u)};i.prototype._queryCell=function(n,t,i,r,u,f,e){var c=this.cells[u],o,s;if(null!==c)for(var a=this.keys,h=this.bboxes,l=0;l<c.length;l++)o=c[l],void 0===e[o]&&(s=4*o,n<=h[s+2]&&t<=h[s+3]&&i>=h[s+0]&&r>=h[s+1]?(e[o]=!0,f.push(a[o])):e[o]=!1)};i.prototype._forEachCell=function(n,t,i,r,u,f,e){for(var o,h,c=this._convertToCellCoord(n),l=this._convertToCellCoord(t),a=this._convertToCellCoord(i),v=this._convertToCellCoord(r),s=c;s<=a;s++)for(o=l;o<=v;o++)if(h=this.d*o+s,u.call(this,n,t,i,r,h,f,e))return};i.prototype._convertToCellCoord=function(n){return Math.max(0,Math.min(this.d-1,Math.floor(n*this.scale)+this.padding))};i.prototype.toArrayBuffer=function(){var n,t,i,e;if(this.arrayBuffer)return this.arrayBuffer;for(var u=this.cells,o=r+this.cells.length+1+1,s=0,f=0;f<this.cells.length;f++)s+=this.cells[f].length;for(n=new Int32Array(o+s+this.keys.length+this.bboxes.length),n[0]=this.extent,n[1]=this.n,n[2]=this.padding,t=o,i=0;i<u.length;i++)e=u[i],n[r+i]=t,n.set(e,t),t+=e.length;return n[r+u.length]=t,n.set(this.keys,t),t+=this.keys.length,n[r+u.length+1]=t,n.set(this.bboxes,t),t+=this.bboxes.length,n.buffer}},{}],24:[function(n,t,i){i.read=function(n,t,i,r,u){var f,o,l=8*u-r-1,a=(1<<l)-1,v=a>>1,e=-7,s=i?u-1:0,c=i?-1:1,h=n[t+s];for(s+=c,f=h&(1<<-e)-1,h>>=-e,e+=l;e>0;f=256*f+n[t+s],s+=c,e-=8);for(o=f&(1<<-e)-1,f>>=-e,e+=r;e>0;o=256*o+n[t+s],s+=c,e-=8);if(0===f)f=1-v;else{if(f===a)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,r);f-=v}return(h?-1:1)*o*Math.pow(2,f-r)};i.write=function(n,t,i,r,u,f){var e,o,s,l=8*f-u-1,a=(1<<l)-1,h=a>>1,y=23===u?Math.pow(2,-24)-Math.pow(2,-77):0,c=r?0:f-1,v=r?1:-1,p=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,e=a):(e=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-e))<1&&(e--,s*=2),t+=e+h>=1?y/s:y*Math.pow(2,1-h),t*s>=2&&(e++,s/=2),e+h>=a?(o=0,e=a):e+h>=1?(o=(t*s-1)*Math.pow(2,u),e+=h):(o=t*Math.pow(2,h-1)*Math.pow(2,u),e=0));u>=8;n[i+c]=255&o,c+=v,o/=256,u-=8);for(e=e<<u|o,l+=u;l>0;n[i+c]=255&e,c+=v,e/=256,l-=8);n[i+c-v]|=128*p}},{}],25:[function(n,t){"use strict";function r(n,t,r,u,f){return new i(n,t,r,u,f)}function i(n,t,i,r,o){t=t||u;i=i||f;o=o||Array;this.nodeSize=r||64;this.points=n;this.ids=new o(n.length);this.coords=new o(2*n.length);for(var s=0;s<n.length;s++)this.ids[s]=s,this.coords[2*s]=t(n[s]),this.coords[2*s+1]=i(n[s]);e(this.ids,this.coords,this.nodeSize,0,this.ids.length-1,0)}function u(n){return n[0]}function f(n){return n[1]}var e=n("./sort"),o=n("./range"),s=n("./within");t.exports=r;i.prototype={range:function(n,t,i,r){return o(this.ids,this.coords,n,t,i,r,this.nodeSize)},within:function(n,t,i){return s(this.ids,this.coords,n,t,i,this.nodeSize)}}},{"./range":26,"./sort":27,"./within":28}],26:[function(n,t){"use strict";function i(n,t,i,r,u,f,e){for(var s,h,c,l,w,o=[0,n.length-1,0],a=[];o.length;){var p=o.pop(),v=o.pop(),y=o.pop();if(v-y<=e)for(c=y;c<=v;c++)s=t[2*c],h=t[2*c+1],s>=i&&s<=u&&h>=r&&h<=f&&a.push(n[c]);else l=Math.floor((y+v)/2),s=t[2*l],h=t[2*l+1],s>=i&&s<=u&&h>=r&&h<=f&&a.push(n[l]),w=(p+1)%2,(0===p?i<=s:r<=h)&&(o.push(y),o.push(l-1),o.push(w)),(0===p?u>=s:f>=h)&&(o.push(l+1),o.push(v),o.push(w))}return a}t.exports=i},{}],27:[function(n,t){"use strict";function r(n,t,i,u,e,o){if(!(e-u<=i)){var s=Math.floor((u+e)/2);f(n,t,s,u,e,o%2);r(n,t,i,u,s-1,o+1);r(n,t,i,s+1,e,o+1)}}function f(n,t,r,u,e,o){for(;e>u;){if(e-u>600){var h=e-u+1,v=r-u+1,y=Math.log(h),l=.5*Math.exp(2*y/3),p=.5*Math.sqrt(y*l*(h-l)/h)*(v-h/2<0?-1:1);f(n,t,r,Math.max(u,Math.floor(r-v*l/h+p)),Math.min(e,Math.floor(r+(h-v)*l/h+p)),o)}var a=t[2*r+o],c=u,s=e;for(i(n,t,u,r),t[2*e+o]>a&&i(n,t,u,e);c<s;){for(i(n,t,c,s),c++,s--;t[2*c+o]<a;)c++;for(;t[2*s+o]>a;)s--}t[2*u+o]===a?i(n,t,u,s):(s++,i(n,t,s,e));s<=r&&(u=s+1);r<=s&&(e=s-1)}}function i(n,t,i,r){u(n,i,r);u(t,2*i,2*r);u(t,2*i+1,2*r+1)}function u(n,t,i){var r=n[t];n[t]=n[i];n[i]=r}t.exports=r},{}],28:[function(n,t){"use strict";function r(n,t,r,u,f,e){for(var s,w,o=[0,n.length-1,0],a=[],b=f*f;o.length;){var v=o.pop(),c=o.pop(),l=o.pop();if(c-l<=e)for(s=l;s<=c;s++)i(t[2*s],t[2*s+1],r,u)<=b&&a.push(n[s]);else{var h=Math.floor((l+c)/2),y=t[2*h],p=t[2*h+1];i(y,p,r,u)<=b&&a.push(n[h]);w=(v+1)%2;(0===v?r-f<=y:u-f<=p)&&(o.push(l),o.push(h-1),o.push(w));(0===v?r+f>=y:u+f>=p)&&(o.push(h+1),o.push(c),o.push(w))}}return a}function i(n,t,i,r){var u=n-i,f=t-r;return u*u+f*f}t.exports=r},{}],29:[function(n,t){function a(n){return!!n&&"object"==typeof n}function v(n,t){for(var i=-1,r=n.length;++i<r;)if(t(n[i],i,n))return!0;return!1}function u(n,t,i,r,f,e){return n===t||(null==n||null==t||!k(n)&&!a(t)?n!==n&&t!==t:y(n,t,u,i,r,f,e))}function y(n,t,u,o,c,a,v){var d=f(n),it=f(t),y=h,k=h,nt,tt,g,ft;d||(y=l.call(n),y==s?y=i:y!=i&&(d=e(n)));it||(k=l.call(t),k==s?k=i:k!=i&&(it=e(t)));var rt=y==i,et=k==i,ut=y==k;if(ut&&!d&&!rt)return w(n,t,y);if(!c&&(nt=rt&&r.call(n,"__wrapped__"),tt=et&&r.call(t,"__wrapped__"),nt||tt))return u(nt?n.value():n,tt?t.value():t,o,c,a,v);if(!ut)return!1;for(a||(a=[]),v||(v=[]),g=a.length;g--;)if(a[g]==n)return v[g]==t;return a.push(n),v.push(t),ft=(d?p:b)(n,t,u,o,c,a,v),a.pop(),v.pop(),ft}function p(n,t,i,r,u,f,e){var s=-1,c=n.length,l=t.length;if(c!=l&&!(u&&l>c))return!1;for(;++s<c;){var o=n[s],h=t[s],a=r?r(u?h:o,u?o:h,s):void 0;if(void 0!==a){if(a)continue;return!1}if(u){if(!v(t,function(n){return o===n||i(o,n,r,u,f,e)}))return!1}else if(o!==h&&!i(o,h,r,u,f,e))return!1}return!0}function w(n,t,i){switch(i){case d:case g:return+n==+t;case nt:return n.name==t.name&&n.message==t.message;case tt:return n!=+n?t!=+t:n==+t;case it:case rt:return n==t+""}return!1}function b(n,t,i,u,f,e,s){var y=o(n),p=y.length,c,h,v,l,a;if(p!=o(t).length&&!f)return!1;for(c=p;c--;)if(h=y[c],!(f?h in t:r.call(t,h)))return!1;for(v=f;++c<p;){h=y[c];var w=n[h],b=t[h],k=u?u(f?b:w,f?w:b,h):void 0;if(!(void 0===k?i(w,b,u,f,e,s):k))return!1;v||(v="constructor"==h)}return!v&&(l=n.constructor,a=t.constructor,l!=a&&"constructor"in n&&"constructor"in t&&!("function"==typeof l&&l instanceof l&&"function"==typeof a&&a instanceof a))?!1:!0}function k(n){var t=typeof n;return!!n&&("object"==t||"function"==t)}var f=n("lodash.isarray"),e=n("lodash.istypedarray"),o=n("lodash.keys"),s="[object Arguments]",h="[object Array]",d="[object Boolean]",g="[object Date]",nt="[object Error]",tt="[object Number]",i="[object Object]",it="[object RegExp]",rt="[object String]",c=Object.prototype,r=c.hasOwnProperty,l=c.toString;t.exports=u},{"lodash.isarray":33,"lodash.istypedarray":35,"lodash.keys":36}],30:[function(n,t){function i(n,t,i){if("function"!=typeof n)return r;if(void 0===t)return n;switch(i){case 1:return function(i){return n.call(t,i)};case 3:return function(i,r,u){return n.call(t,i,r,u)};case 4:return function(i,r,u,f){return n.call(t,i,r,u,f)};case 5:return function(i,r,u,f,e){return n.call(t,i,r,u,f,e)}}return function(){return n.apply(t,arguments)}}function r(n){return n}t.exports=i},{}],31:[function(n,t){function u(n){return!!n&&"object"==typeof n}function f(n,t){var i=null==n?void 0:n[t];if(s(i))return i}function e(n){return o(n)&&a.call(n)==h}function o(n){var t=typeof n;return!!n&&("object"==t||"function"==t)}function s(n){return null!=n&&(e(n)?v.test(r.call(n)):u(n)&&c.test(n))}var h="[object Function]",c=/^\[object .+?Constructor\]$/,i=Object.prototype,r=Function.prototype.toString,l=i.hasOwnProperty,a=i.toString,v=RegExp("^"+r.call(l).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=f},{}],32:[function(n,t){function u(n){return e(n)&&p.call(n,"callee")&&(!w.call(n,"callee")||r.call(n)==a)}function f(n){return null!=n&&s(n.length)&&!o(n)}function e(n){return c(n)&&f(n)}function o(n){var t=h(n)?r.call(n):"";return t==v||t==y}function s(n){return"number"==typeof n&&n>-1&&n%1==0&&n<=l}function h(n){var t=typeof n;return!!n&&("object"==t||"function"==t)}function c(n){return!!n&&"object"==typeof n}var l=9007199254740991,a="[object Arguments]",v="[object Function]",y="[object GeneratorFunction]",i=Object.prototype,p=i.hasOwnProperty,r=i.toString,w=i.propertyIsEnumerable;t.exports=u},{}],33:[function(n,t){function i(n){return!!n&&"object"==typeof n}function e(n,t){var i=null==n?void 0:n[t];if(c(i))return i}function o(n){return"number"==typeof n&&n>-1&&n%1==0&&n<=b}function s(n){return h(n)&&f.call(n)==a}function h(n){var t=typeof n;return!!n&&("object"==t||"function"==t)}function c(n){return null!=n&&(s(n)?p.test(u.call(n)):i(n)&&v.test(n))}var l="[object Array]",a="[object Function]",v=/^\[object .+?Constructor\]$/,r=Object.prototype,u=Function.prototype.toString,y=r.hasOwnProperty,f=r.toString,p=RegExp("^"+u.call(y).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),w=e(Array,"isArray"),b=9007199254740991,k=w||function(n){return i(n)&&o(n.length)&&f.call(n)==l};t.exports=k},{}],34:[function(n,t){function i(n,t,i,f){i="function"==typeof i?u(i,f,3):void 0;var e=i?i(n,t):void 0;return void 0===e?r(n,t,i):!!e}var r=n("lodash._baseisequal"),u=n("lodash._bindcallback");t.exports=i},{"lodash._baseisequal":29,"lodash._bindcallback":30}],35:[function(n,t){function f(n){return"number"==typeof n&&n>-1&&n%1==0&&n<=s}function e(n){return!!n&&"object"==typeof n}function o(n){return e(n)&&f(n.length)&&!!i[u.call(n)]}var s=9007199254740991,i={},r,u;i["[object Float32Array]"]=i["[object Float64Array]"]=i["[object Int8Array]"]=i["[object Int16Array]"]=i["[object Int32Array]"]=i["[object Uint8Array]"]=i["[object Uint8ClampedArray]"]=i["[object Uint16Array]"]=i["[object Uint32Array]"]=!0;i["[object Arguments]"]=i["[object Array]"]=i["[object ArrayBuffer]"]=i["[object Boolean]"]=i["[object DataView]"]=i["[object Date]"]=i["[object Error]"]=i["[object Function]"]=i["[object Map]"]=i["[object Number]"]=i["[object Object]"]=i["[object RegExp]"]=i["[object Set]"]=i["[object String]"]=i["[object WeakMap]"]=!1;r=Object.prototype;u=r.toString;t.exports=o},{}],36:[function(n,t){function l(n){return function(t){if(null!=t)return t[n]}}function a(n){return null!=n&&i(b(n))}function r(n,t){return n="number"==typeof n||p.test(n)?+n:-1,t=null==t?c:t,n>-1&&n%1==0&&n<t}function i(n){return"number"==typeof n&&n>-1&&n%1==0&&n<=c}function u(n){for(var t,f=v(n),h=f.length,u=h&&n.length,a=!!u&&i(u)&&(o(n)||e(n)),c=-1,l=[];++c<h;)t=f[c],(a&&r(t,u)||s.call(n,t))&&l.push(t);return l}function f(n){var t=typeof n;return!!n&&("object"==t||"function"==t)}function v(n){var t,u;if(null==n)return[];f(n)||(n=Object(n));t=n.length;t=t&&i(t)&&(o(n)||e(n))&&t||0;for(var l=n.constructor,h=-1,a="function"==typeof l&&l.prototype===n,c=Array(t),v=t>0;++h<t;)c[h]=h+"";for(u in n)v&&r(u,t)||"constructor"==u&&(a||!s.call(n,u))||c.push(u);return c}var y=n("lodash._getnative"),e=n("lodash.isarguments"),o=n("lodash.isarray"),p=/^\d+$/,w=Object.prototype,s=w.hasOwnProperty,h=y(Object,"keys"),c=9007199254740991,b=l("length"),k=h?function(n){var t=null==n?void 0:n.constructor;return"function"==typeof t&&t.prototype===n||"function"!=typeof n&&a(n)?u(n):f(n)?h(n):[]}:u;t.exports=k},{"lodash._getnative":31,"lodash.isarguments":32,"lodash.isarray":33}],37:[function(n,t){"use strict";function i(n){return!!(u()&&f()&&e()&&o()&&s()&&h()&&c()&&l(n&&n.failIfMajorPerformanceCaveat))}function u(){return"undefined"!=typeof window&&"undefined"!=typeof document}function f(){return Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray}function e(){return Function.prototype&&Function.prototype.bind}function o(){return Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions}function s(){return"JSON"in window&&"parse"in JSON&&"stringify"in JSON}function h(){return"Worker"in window}function c(){return"Uint8ClampedArray"in window}function l(n){return void 0===r[n]&&(r[n]=a(n)),r[n]}function a(n){var t=document.createElement("canvas"),r=Object.create(i.webGLContextAttributes);return r.failIfMajorPerformanceCaveat=n,t.probablySupportsContext?t.probablySupportsContext("webgl",r)||t.probablySupportsContext("experimental-webgl",r):t.supportsContext?t.supportsContext("webgl",r)||t.supportsContext("experimental-webgl",r):t.getContext("webgl",r)||t.getContext("experimental-webgl",r)}"undefined"!=typeof t&&t.exports?t.exports=i:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=i);var r={};i.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}},{}],38:[function(n,t){"use strict";function i(n){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(n)?n:new Uint8Array(n||0);this.pos=0;this.type=0;this.length=this.buf.length}function a(n,t,i){var f,r,e=i.buf;if((r=e[i.pos++],f=(112&r)>>4,r<128)||(r=e[i.pos++],f|=(127&r)<<3,r<128)||(r=e[i.pos++],f|=(127&r)<<10,r<128)||(r=e[i.pos++],f|=(127&r)<<17,r<128)||(r=e[i.pos++],f|=(127&r)<<24,r<128)||(r=e[i.pos++],f|=(1&r)<<31,r<128))return u(n,f,t);throw new Error("Expected varint not more than 10 bytes");}function r(n){return n.type===i.Bytes?n.readVarint()+n.pos:n.pos+1}function u(n,t,i){return i?4294967296*t+(n>>>0):4294967296*(t>>>0)+(n>>>0)}function v(n,t){var i,r;if(n>=0?(i=n%4294967296|0,r=n/4294967296|0):(i=~(-n%4294967296),r=~(-n/4294967296),4294967295^i?i=i+1|0:(i=0,r=r+1|0)),n>=0x10000000000000000||n<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10);y(i,r,t);p(r,t)}function y(n,t,i){i.buf[i.pos++]=127&n|128;n>>>=7;i.buf[i.pos++]=127&n|128;n>>>=7;i.buf[i.pos++]=127&n|128;n>>>=7;i.buf[i.pos++]=127&n|128;n>>>=7;i.buf[i.pos]=127&n}function p(n,t){var i=(7&n)<<4;t.buf[t.pos++]|=i|((n>>>=3)?128:0);n&&(t.buf[t.pos++]=127&n|((n>>>=7)?128:0),n&&(t.buf[t.pos++]=127&n|((n>>>=7)?128:0),n&&(t.buf[t.pos++]=127&n|((n>>>=7)?128:0),n&&(t.buf[t.pos++]=127&n|((n>>>=7)?128:0),n&&(t.buf[t.pos++]=127&n)))))}function c(n,t,i){var u=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.ceil(Math.log(t)/(7*Math.LN2)),r;for(i.realloc(u),r=i.pos-1;r>=n;r--)i.buf[r+u]=i.buf[r]}function w(n,t){for(var i=0;i<n.length;i++)t.writeVarint(n[i])}function b(n,t){for(var i=0;i<n.length;i++)t.writeSVarint(n[i])}function k(n,t){for(var i=0;i<n.length;i++)t.writeFloat(n[i])}function d(n,t){for(var i=0;i<n.length;i++)t.writeDouble(n[i])}function g(n,t){for(var i=0;i<n.length;i++)t.writeBoolean(n[i])}function nt(n,t){for(var i=0;i<n.length;i++)t.writeFixed32(n[i])}function tt(n,t){for(var i=0;i<n.length;i++)t.writeSFixed32(n[i])}function it(n,t){for(var i=0;i<n.length;i++)t.writeFixed64(n[i])}function rt(n,t){for(var i=0;i<n.length;i++)t.writeSFixed64(n[i])}function o(n,t){return(n[t]|n[t+1]<<8|n[t+2]<<16)+16777216*n[t+3]}function f(n,t,i){n[i]=t;n[i+1]=t>>>8;n[i+2]=t>>>16;n[i+3]=t>>>24}function l(n,t){return(n[t]|n[t+1]<<8|n[t+2]<<16)+(n[t+3]<<24)}function ut(n,t,i){for(var e,s,c,h="",u=t;u<i;){var f=n[u],r=null,o=f>239?4:f>223?3:f>191?2:1;if(u+o>i)break;1===o?f<128&&(r=f):2===o?128==(192&(e=n[u+1]))&&(r=(31&f)<<6|63&e)<=127&&(r=null):3===o?(e=n[u+1],s=n[u+2],128==(192&e)&&128==(192&s)&&((r=(15&f)<<12|(63&e)<<6|63&s)<=2047||r>=55296&&r<=57343)&&(r=null)):4===o&&(e=n[u+1],s=n[u+2],c=n[u+3],128==(192&e)&&128==(192&s)&&128==(192&c)&&((r=(15&f)<<18|(63&e)<<12|(63&s)<<6|63&c)<=65535||r>=1114112)&&(r=null));null===r?(r=65533,o=1):r>65535&&(r-=65536,h+=String.fromCharCode(r>>>10&1023|55296),r=56320|1023&r);h+=String.fromCharCode(r);u+=o}return h}function ft(n,t,i){for(var r,u,f=0;f<t.length;f++){if((r=t.charCodeAt(f))>55295&&r<57344){if(!u){r>56319||f+1===t.length?(n[i++]=239,n[i++]=191,n[i++]=189):u=r;continue}if(r<56320){n[i++]=239;n[i++]=191;n[i++]=189;u=r;continue}r=u-55296<<10|r-56320|65536;u=null}else u&&(n[i++]=239,n[i++]=191,n[i++]=189,u=null);r<128?n[i++]=r:(r<2048?n[i++]=r>>6|192:(r<65536?n[i++]=r>>12|224:(n[i++]=r>>18|240,n[i++]=r>>12&63|128),n[i++]=r>>6&63|128),n[i++]=63&r|128)}return i}var e,s,h;t.exports=i;e=n("ieee754");i.Varint=0;i.Fixed64=1;i.Bytes=2;i.Fixed32=5;s=4294967296;h=1/s;i.prototype={destroy:function(){this.buf=null},readFields:function(n,t,i){for(i=i||this.length;this.pos<i;){var r=this.readVarint(),u=r>>3,f=this.pos;this.type=7&r;n(u,t,this);this.pos===f&&this.skip(r)}return t},readMessage:function(n,t){return this.readFields(n,t,this.readVarint()+this.pos)},readFixed32:function(){var n=o(this.buf,this.pos);return this.pos+=4,n},readSFixed32:function(){var n=l(this.buf,this.pos);return this.pos+=4,n},readFixed64:function(){var n=o(this.buf,this.pos)+o(this.buf,this.pos+4)*s;return this.pos+=8,n},readSFixed64:function(){var n=o(this.buf,this.pos)+l(this.buf,this.pos+4)*s;return this.pos+=8,n},readFloat:function(){var n=e.read(this.buf,this.pos,!0,23,4);return this.pos+=4,n},readDouble:function(){var n=e.read(this.buf,this.pos,!0,52,8);return this.pos+=8,n},readVarint:function(n){var i,t,r=this.buf;return t=r[this.pos++],i=127&t,t<128?i:(t=r[this.pos++],i|=(127&t)<<7,t<128?i:(t=r[this.pos++],i|=(127&t)<<14,t<128?i:(t=r[this.pos++],i|=(127&t)<<21,t<128?i:(t=r[this.pos],i|=(15&t)<<28,a(i,n,this)))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var n=this.readVarint();return n%2==1?(n+1)/-2:n/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var n=this.readVarint()+this.pos,t=ut(this.buf,this.pos,n);return this.pos=n,t},readBytes:function(){var n=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,n);return this.pos=n,t},readPackedVarint:function(n,t){var i=r(this);for(n=n||[];this.pos<i;)n.push(this.readVarint(t));return n},readPackedSVarint:function(n){var t=r(this);for(n=n||[];this.pos<t;)n.push(this.readSVarint());return n},readPackedBoolean:function(n){var t=r(this);for(n=n||[];this.pos<t;)n.push(this.readBoolean());return n},readPackedFloat:function(n){var t=r(this);for(n=n||[];this.pos<t;)n.push(this.readFloat());return n},readPackedDouble:function(n){var t=r(this);for(n=n||[];this.pos<t;)n.push(this.readDouble());return n},readPackedFixed32:function(n){var t=r(this);for(n=n||[];this.pos<t;)n.push(this.readFixed32());return n},readPackedSFixed32:function(n){var t=r(this);for(n=n||[];this.pos<t;)n.push(this.readSFixed32());return n},readPackedFixed64:function(n){var t=r(this);for(n=n||[];this.pos<t;)n.push(this.readFixed64());return n},readPackedSFixed64:function(n){var t=r(this);for(n=n||[];this.pos<t;)n.push(this.readSFixed64());return n},skip:function(n){var t=7&n;if(t===i.Varint)for(;this.buf[this.pos++]>127;);else if(t===i.Bytes)this.pos=this.readVarint()+this.pos;else if(t===i.Fixed32)this.pos+=4;else{if(t!==i.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(n,t){this.writeVarint(n<<3|t)},realloc:function(n){for(var i,t=this.length||16;t<this.pos+n;)t*=2;t!==this.length&&(i=new Uint8Array(t),i.set(this.buf),this.buf=i,this.length=t)},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(n){this.realloc(4);f(this.buf,n,this.pos);this.pos+=4},writeSFixed32:function(n){this.realloc(4);f(this.buf,n,this.pos);this.pos+=4},writeFixed64:function(n){this.realloc(8);f(this.buf,-1&n,this.pos);f(this.buf,Math.floor(n*h),this.pos+4);this.pos+=8},writeSFixed64:function(n){this.realloc(8);f(this.buf,-1&n,this.pos);f(this.buf,Math.floor(n*h),this.pos+4);this.pos+=8},writeVarint:function(n){if((n=+n||0)>268435455||n<0)return void v(n,this);this.realloc(4);this.buf[this.pos++]=127&n|(n>127?128:0);n<=127||(this.buf[this.pos++]=127&(n>>>=7)|(n>127?128:0),n<=127||(this.buf[this.pos++]=127&(n>>>=7)|(n>127?128:0),n<=127||(this.buf[this.pos++]=n>>>7&127)))},writeSVarint:function(n){this.writeVarint(n<0?2*-n-1:2*n)},writeBoolean:function(n){this.writeVarint(Boolean(n))},writeString:function(n){var i,t;n=String(n);this.realloc(4*n.length);this.pos++;i=this.pos;this.pos=ft(this.buf,n,this.pos);t=this.pos-i;t>=128&&c(i,t,this);this.pos=i-1;this.writeVarint(t);this.pos+=t},writeFloat:function(n){this.realloc(4);e.write(this.buf,n,this.pos,!0,23,4);this.pos+=4},writeDouble:function(n){this.realloc(8);e.write(this.buf,n,this.pos,!0,52,8);this.pos+=8},writeBytes:function(n){var i=n.length,t;for(this.writeVarint(i),this.realloc(i),t=0;t<i;t++)this.buf[this.pos++]=n[t]},writeRawMessage:function(n,t){var r,i;this.pos++;r=this.pos;n(t,this);i=this.pos-r;i>=128&&c(r,i,this);this.pos=r-1;this.writeVarint(i);this.pos+=i},writeMessage:function(n,t,r){this.writeTag(n,i.Bytes);this.writeRawMessage(t,r)},writePackedVarint:function(n,t){this.writeMessage(n,w,t)},writePackedSVarint:function(n,t){this.writeMessage(n,b,t)},writePackedBoolean:function(n,t){this.writeMessage(n,g,t)},writePackedFloat:function(n,t){this.writeMessage(n,k,t)},writePackedDouble:function(n,t){this.writeMessage(n,d,t)},writePackedFixed32:function(n,t){this.writeMessage(n,nt,t)},writePackedSFixed32:function(n,t){this.writeMessage(n,tt,t)},writePackedFixed64:function(n,t){this.writeMessage(n,it,t)},writePackedSFixed64:function(n,t){this.writeMessage(n,rt,t)},writeBytesField:function(n,t){this.writeTag(n,i.Bytes);this.writeBytes(t)},writeFixed32Field:function(n,t){this.writeTag(n,i.Fixed32);this.writeFixed32(t)},writeSFixed32Field:function(n,t){this.writeTag(n,i.Fixed32);this.writeSFixed32(t)},writeFixed64Field:function(n,t){this.writeTag(n,i.Fixed64);this.writeFixed64(t)},writeSFixed64Field:function(n,t){this.writeTag(n,i.Fixed64);this.writeSFixed64(t)},writeVarintField:function(n,t){this.writeTag(n,i.Varint);this.writeVarint(t)},writeSVarintField:function(n,t){this.writeTag(n,i.Varint);this.writeSVarint(t)},writeStringField:function(n,t){this.writeTag(n,i.Bytes);this.writeString(t)},writeFloatField:function(n,t){this.writeTag(n,i.Fixed32);this.writeFloat(t)},writeDoubleField:function(n,t){this.writeTag(n,i.Fixed64);this.writeDouble(t)},writeBooleanField:function(n,t){this.writeVarintField(n,Boolean(t))}}},{ieee754:24}],39:[function(n,t){function c(){throw new Error("setTimeout has not been defined");}function l(){throw new Error("clearTimeout has not been defined");}function a(n){if(u===setTimeout)return setTimeout(n,0);if((u===c||!u)&&setTimeout)return u=setTimeout,setTimeout(n,0);try{return u(n,0)}catch(t){try{return u.call(null,n,0)}catch(t){return u.call(this,n,0)}}}function p(n){if(f===clearTimeout)return clearTimeout(n);if((f===l||!f)&&clearTimeout)return f=clearTimeout,clearTimeout(n);try{return f(n)}catch(t){try{return f.call(null,n)}catch(t){return f.call(this,n)}}}function w(){s&&o&&(s=!1,o.length?e=o.concat(e):h=-1,e.length&&v())}function v(){var t,n;if(!s){for(t=a(w),s=!0,n=e.length;n;){for(o=e,e=[];++h<n;)o&&o[h].run();h=-1;n=e.length}o=null;s=!1;p(t)}}function y(n,t){this.fun=n;this.array=t}function r(){}var i=t.exports={},u,f;!function(){try{u="function"==typeof setTimeout?setTimeout:c}catch(n){u=c}try{f="function"==typeof clearTimeout?clearTimeout:l}catch(n){f=l}}();var e=[],s=!1,o,h=-1;i.nextTick=function(n){var i=new Array(arguments.length-1),t;if(arguments.length>1)for(t=1;t<arguments.length;t++)i[t-1]=arguments[t];e.push(new y(n,i));1!==e.length||s||a(v)};y.prototype.run=function(){this.fun.apply(null,this.array)};i.title="browser";i.browser=!0;i.env={};i.argv=[];i.version="";i.versions={};i.on=r;i.addListener=r;i.once=r;i.off=r;i.removeListener=r;i.removeAllListeners=r;i.emit=r;i.prependListener=r;i.prependOnceListener=r;i.listeners=function(){return[]};i.binding=function(){throw new Error("process.binding is not supported");};i.cwd=function(){return"/"};i.chdir=function(){throw new Error("process.chdir is not supported");};i.umask=function(){return 0}},{}],40:[function(n,t){"use strict";function r(n,t,f,e,o){for(f=f||0,e=e||n.length-1,o=o||u;e>f;){if(e-f>600){var h=e-f+1,v=t-f+1,y=Math.log(h),l=.5*Math.exp(2*y/3),p=.5*Math.sqrt(y*l*(h-l)/h)*(v-h/2<0?-1:1);r(n,t,Math.max(f,Math.floor(t-v*l/h+p)),Math.min(e,Math.floor(t+(h-v)*l/h+p)),o)}var a=n[t],c=f,s=e;for(i(n,f,t),o(n[e],a)>0&&i(n,f,e);c<s;){for(i(n,c,s),c++,s--;o(n[c],a)<0;)c++;for(;o(n[s],a)>0;)s--}0===o(n[f],a)?i(n,f,s):(s++,i(n,s,e));s<=t&&(f=s+1);t<=s&&(e=s-1)}}function i(n,t,i){var r=n[t];n[t]=n[i];n[i]=r}function u(n,t){return n<t?-1:n>t?1:0}t.exports=r},{}],41:[function(n,t){"use strict";function l(n){return new f(n)}function f(n){this.options=u(Object.create(this.options),n);this.trees=new Array(this.options.maxZoom+1)}function a(n,t,i,r,u){return{x:n,y:t,zoom:1/0,id:r,properties:u,parentId:-1,numPoints:i}}function v(n,t){var u=n.geometry.coordinates;return{x:i(u[0]),y:r(u[1]),zoom:1/0,id:t,parentId:-1}}function e(n){return{type:"Feature",properties:o(n),geometry:{type:"Point",coordinates:[y(n.x),p(n.y)]}}}function o(n){var t=n.numPoints,i=t>=1e4?Math.round(t/1e3)+"k":t>=1e3?Math.round(t/100)/10+"k":t;return u(u({},n.properties),{cluster:!0,cluster_id:n.id,point_count:t,point_count_abbreviated:i})}function i(n){return n/360+.5}function r(n){var i=Math.sin(n*Math.PI/180),t=.5-.25*Math.log((1+i)/(1-i))/Math.PI;return t<0?0:t>1?1:t}function y(n){return 360*(n-.5)}function p(n){var t=(180-360*n)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}function u(n,t){for(var i in t)n[i]=t[i];return n}function s(n){return n.x}function h(n){return n.y}var c=n("kdbush");t.exports=l;f.prototype={options:{minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,reduce:null,initial:function(){return{}},map:function(n){return n}},load:function(n){var r=this.options.log,u,t,i,f;for(r&&console.time("total time"),u="prepare "+n.length+" points",r&&console.time(u),this.points=n,t=n.map(v),r&&console.timeEnd(u),i=this.options.maxZoom;i>=this.options.minZoom;i--)f=+Date.now(),this.trees[i+1]=c(t,s,h,this.options.nodeSize,Float32Array),t=this._cluster(t,i),r&&console.log("z%d: %d clusters in %dms",i,t.length,+Date.now()-f);return this.trees[this.options.minZoom]=c(t,s,h,this.options.nodeSize,Float32Array),r&&console.timeEnd("total time"),this},getClusters:function(n,t){for(var u,o=this.trees[this._limitZoom(t)],s=o.range(i(n[0]),r(n[3]),i(n[2]),r(n[1])),h=[],f=0;f<s.length;f++)u=o.points[s[f]],h.push(u.numPoints?e(u):this.points[u.id]);return h},getChildren:function(n,t){for(var i,u=this.trees[t+1].points[n],s=this.options.radius/(this.options.extent*Math.pow(2,t)),f=this.trees[t+1].within(u.x,u.y,s),o=[],r=0;r<f.length;r++)i=this.trees[t+1].points[f[r]],i.parentId===n&&o.push(i.numPoints?e(i):this.points[i.id]);return o},getLeaves:function(n,t,i,r){i=i||10;r=r||0;var u=[];return this._appendLeaves(u,n,t,i,r,0),u},getTile:function(n,t,i){var u=this.trees[this._limitZoom(n)],r=Math.pow(2,n),h=this.options.extent,c=this.options.radius,f=c/h,o=(i-f)/r,s=(i+1+f)/r,e={features:[]};return this._addTileFeatures(u.range((t-f)/r,o,(t+1+f)/r,s),u.points,t,i,r,e),0===t&&this._addTileFeatures(u.range(1-f/r,o,1,s),u.points,r,i,r,e),t===r-1&&this._addTileFeatures(u.range(0,o,f/r,s),u.points,-1,i,r,e),e.features.length?e:null},getClusterExpansionZoom:function(n,t){for(;t<this.options.maxZoom;){var i=this.getChildren(n,t);if(t++,1!==i.length)break;n=i[0].properties.cluster_id}return t},_appendLeaves:function(n,t,i,r,u,f){for(var o,s=this.getChildren(t,i),e=0;e<s.length;e++)if(o=s[e].properties,o.cluster?f+o.point_count<=u?f+=o.point_count:f=this._appendLeaves(n,o.cluster_id,i+1,r,u,f):f<u?f++:n.push(s[e]),n.length===r)break;return f},_addTileFeatures:function(n,t,i,r,u,f){for(var e,s=0;s<n.length;s++)e=t[n[s]],f.features.push({type:1,geometry:[[Math.round(this.options.extent*(e.x*u-i)),Math.round(this.options.extent*(e.y*u-r))]],tags:e.numPoints?o(e):this.points[e.id].properties})},_limitZoom:function(n){return Math.max(this.options.minZoom,Math.min(n,this.options.maxZoom+1))},_cluster:function(n,t){for(var i,o,r,s,h=[],p=this.options.radius/(this.options.extent*Math.pow(2,t)),f=0;f<n.length;f++)if(i=n[f],!(i.zoom<=t)){i.zoom=t;var c=this.trees[t+1],l=c.within(i.x,i.y,p),u=i.numPoints||1,v=i.x*u,y=i.y*u,e=null;for(this.options.reduce&&(e=this.options.initial(),this._accumulate(e,i)),o=0;o<l.length;o++)r=c.points[l[o]],t<r.zoom&&(s=r.numPoints||1,r.zoom=t,v+=r.x*s,y+=r.y*s,u+=s,r.parentId=f,this.options.reduce&&this._accumulate(e,r));1===u?h.push(i):(i.parentId=f,h.push(a(v/u,y/u,u,f,e)))}return h},_accumulate:function(n,t){var i=t.numPoints?t.properties:this.options.map(this.points[t.id].properties);this.options.reduce(n,i)}}},{kdbush:25}],42:[function(n,t){"use strict";function i(n,t){if(!(this instanceof i))return new i(n,t);if(this.data=n||[],this.length=this.data.length,this.compare=t||r,this.length>0)for(var u=this.length>>1;u>=0;u--)this._down(u)}function r(n,t){return n<t?-1:n>t?1:0}t.exports=i;i.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,e=this.length,s=e>>1,o=t[n];n<s;){var i=1+(n<<1),r=i+1,u=t[i];if(r<e&&f(t[r],u)<0&&(i=r,u=t[r]),f(u,o)>=0)break;t[n]=u;n=i}t[n]=o}}},{}],43:[function(n,t){t.exports="function"==typeof Object.create?function(n,t){n.super_=t;n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}})}:function(n,t){n.super_=t;var i=function(){};i.prototype=t.prototype;n.prototype=new i;n.prototype.constructor=n}},{}],44:[function(n,t){t.exports=function(n){return n&&"object"==typeof n&&"function"==typeof n.copy&&"function"==typeof n.fill&&"function"==typeof n.readUInt8}},{}],45:[function(n,t,i){(function(t,r){function f(n,t){var r={seen:[],stylize:ft};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),w(t)?r.showHidden=t:t&&i._extend(r,t),u(r.showHidden)&&(r.showHidden=!1),u(r.depth)&&(r.depth=2),u(r.colors)&&(r.colors=!1),u(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=ut),s(r,n,r.depth)}function ut(n,t){var i=f.styles[t];return i?"\x1b["+f.colors[i][0]+"m"+n+"\x1b["+f.colors[i][1]+"m":n}function ft(n){return n}function et(n){var t={};return n.forEach(function(n){t[n]=!0}),t}function s(n,t,r){var e,w,u,k,d,g;if(n.customInspect&&t&&v(t.inspect)&&t.inspect!==i.inspect&&(!t.constructor||t.constructor.prototype!==t))return e=t.inspect(r,n),c(e)||(e=s(n,e,r)),e;if(w=ot(n,t),w)return w;if(u=Object.keys(t),k=et(u),n.showHidden&&(u=Object.getOwnPropertyNames(t)),a(t)&&(u.indexOf("message")>=0||u.indexOf("description")>=0))return y(t);if(0===u.length){if(v(t))return d=t.name?": "+t.name:"",n.stylize("[Function"+d+"]","special");if(l(t))return n.stylize(RegExp.prototype.toString.call(t),"regexp");if(b(t))return n.stylize(Date.prototype.toString.call(t),"date");if(a(t))return y(t)}var f="",o=!1,h=["{","}"];return((nt(t)&&(o=!0,h=["[","]"]),v(t))&&(f=" [Function"+(t.name?": "+t.name:"")+"]"),l(t)&&(f=" "+RegExp.prototype.toString.call(t)),b(t)&&(f=" "+Date.prototype.toUTCString.call(t)),a(t)&&(f=" "+y(t)),0===u.length&&(!o||0==t.length))?h[0]+f+h[1]:r<0?l(t)?n.stylize(RegExp.prototype.toString.call(t),"regexp"):n.stylize("[Object]","special"):(n.seen.push(t),g=o?st(n,t,r,k,u):u.map(function(i){return p(n,t,r,k,i,o)}),n.seen.pop(),ht(g,f,h))}function ot(n,t){if(u(t))return n.stylize("undefined","undefined");if(c(t)){var i="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return n.stylize(i,"string")}return tt(t)?n.stylize(""+t,"number"):w(t)?n.stylize(""+t,"boolean"):h(t)?n.stylize("null","null"):void 0}function y(n){return"["+Error.prototype.toString.call(n)+"]"}function st(n,t,i,r,u){for(var f=[],e=0,o=t.length;e<o;++e)it(t,String(e))?f.push(p(n,t,i,r,String(e),!0)):f.push("");return u.forEach(function(u){u.match(/^\d+$/)||f.push(p(n,t,i,r,u,!0))}),f}function p(n,t,i,r,f,e){var o,c,l;if(l=Object.getOwnPropertyDescriptor(t,f)||{value:t[f]},l.get?c=l.set?n.stylize("[Getter/Setter]","special"):n.stylize("[Getter]","special"):l.set&&(c=n.stylize("[Setter]","special")),it(r,f)||(o="["+f+"]"),c||(n.seen.indexOf(l.value)<0?(c=h(i)?s(n,l.value,null):s(n,l.value,i-1),c.indexOf("\n")>-1&&(c=e?c.split("\n").map(function(n){return"  "+n}).join("\n").substr(2):"\n"+c.split("\n").map(function(n){return"   "+n}).join("\n"))):c=n.stylize("[Circular]","special")),u(o)){if(e&&f.match(/^\d+$/))return c;o=JSON.stringify(""+f);o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=n.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=n.stylize(o,"string"))}return o+": "+c}function ht(n,t,i){var r=0;return n.reduce(function(n,t){return r++,t.indexOf("\n")>=0&&r++,n+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?i[0]+(""===t?"":t+"\n ")+" "+n.join(",\n  ")+" "+i[1]:i[0]+t+" "+n.join(", ")+" "+i[1]}function nt(n){return Array.isArray(n)}function w(n){return"boolean"==typeof n}function h(n){return null===n}function ct(n){return null==n}function tt(n){return"number"==typeof n}function c(n){return"string"==typeof n}function lt(n){return"symbol"==typeof n}function u(n){return void 0===n}function l(n){return e(n)&&"[object RegExp]"===k(n)}function e(n){return"object"==typeof n&&null!==n}function b(n){return e(n)&&"[object Date]"===k(n)}function a(n){return e(n)&&("[object Error]"===k(n)||n instanceof Error)}function v(n){return"function"==typeof n}function at(n){return null===n||"boolean"==typeof n||"number"==typeof n||"string"==typeof n||"symbol"==typeof n||void 0===n}function k(n){return Object.prototype.toString.call(n)}function d(n){return n<10?"0"+n.toString(10):n.toString(10)}function vt(){var n=new Date,t=[d(n.getHours()),d(n.getMinutes()),d(n.getSeconds())].join(":");return[n.getDate(),rt[n.getMonth()],t].join(" ")}function it(n,t){return Object.prototype.hasOwnProperty.call(n,t)}var yt=/%[sdj%]/g,o,g,rt;i.format=function(n){var u,t;if(!c(n)){for(u=[],t=0;t<arguments.length;t++)u.push(f(arguments[t]));return u.join(" ")}for(var t=1,i=arguments,o=i.length,s=String(n).replace(yt,function(n){if("%%"===n)return"%";if(t>=o)return n;switch(n){case"%s":return String(i[t++]);case"%d":return Number(i[t++]);case"%j":try{return JSON.stringify(i[t++])}catch(n){return"[Circular]"}default:return n}}),r=i[t];t<o;r=i[++t])s+=h(r)||!e(r)?" "+r:" "+f(r);return s};i.deprecate=function(n,f){function o(){if(!e){if(t.throwDeprecation)throw new Error(f);t.traceDeprecation?console.trace(f):console.error(f);e=!0}return n.apply(this,arguments)}if(u(r.process))return function(){return i.deprecate(n,f).apply(this,arguments)};if(!0===t.noDeprecation)return n;var e=!1;return o};o={};i.debuglog=function(n){if(u(g)&&(g=t.env.NODE_DEBUG||""),n=n.toUpperCase(),!o[n])if(new RegExp("\\b"+n+"\\b","i").test(g)){var r=t.pid;o[n]=function(){var t=i.format.apply(i,arguments);console.error("%s %d: %s",n,r,t)}}else o[n]=function(){};return o[n]};i.inspect=f;f.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};f.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"};i.isArray=nt;i.isBoolean=w;i.isNull=h;i.isNullOrUndefined=ct;i.isNumber=tt;i.isString=c;i.isSymbol=lt;i.isUndefined=u;i.isRegExp=l;i.isObject=e;i.isDate=b;i.isError=a;i.isFunction=v;i.isPrimitive=at;i.isBuffer=n("./support/isBuffer");rt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];i.log=function(){console.log("%s - %s",vt(),i.format.apply(i,arguments))};i.inherits=n("inherits");i._extend=function(n,t){if(!t||!e(t))return n;for(var i=Object.keys(t),r=i.length;r--;)n[i[r]]=t[i[r]];return n}}).call(this,n("_process"),typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"./support/isBuffer":44,_process:39,inherits:43}],46:[function(n,t){function i(n){var t=new v;return o(n,t),t.finish()}function e(n){var r={},t;for(t in n)r[t]=new f(n[t].features),r[t].name=t;return i({layers:r})}function o(n,t){for(var i in n.layers)t.writeMessage(3,s,n.layers[i])}function s(n,t){var i,r,u,f;for(t.writeVarintField(15,n.version||1),t.writeStringField(1,n.name||""),t.writeVarintField(5,n.extent||4096),r={keys:[],values:[],keycache:{},valuecache:{}},i=0;i<n.length;i++)r.feature=n.feature(i),t.writeMessage(2,h,r);for(u=r.keys,i=0;i<u.length;i++)t.writeStringField(3,u[i]);for(f=r.values,i=0;i<f.length;i++)t.writeMessage(4,a,f[i])}function h(n,t){var i=n.feature;void 0!==i.id&&t.writeVarintField(1,i.id);t.writeMessage(2,c,n);t.writeVarintField(3,i.type);t.writeMessage(4,l,i)}function c(n,t){var s=n.feature,h=n.keys,c=n.values,l=n.keycache,a=n.valuecache,r,u,i,f,o,e;for(r in s.properties)u=l[r],void 0===u&&(h.push(r),u=h.length-1,l[r]=u),t.writeVarint(u),i=s.properties[r],f=typeof i,"string"!==f&&"boolean"!==f&&"number"!==f&&(i=JSON.stringify(i)),o=f+":"+i,e=a[o],void 0===e&&(c.push(i),e=c.length-1,a[o]=e),t.writeVarint(e)}function r(n,t){return(t<<3)+(7&n)}function u(n){return n<<1^n>>31}function l(n,t){for(var i,o,f,s,h,c=n.loadGeometry(),l=n.type,a=0,v=0,y=c.length,e=0;e<y;e++)for(i=c[e],o=1,1===l&&(o=i.length),t.writeVarint(r(1,o)),f=0;f<i.length;f++)1===f&&1!==l&&t.writeVarint(r(2,i.length-1)),s=i[f].x-a,h=i[f].y-v,t.writeVarint(u(s)),t.writeVarint(u(h)),a+=s,v+=h}function a(n,t){var i=typeof n;"string"===i?t.writeStringField(1,n):"boolean"===i?t.writeBooleanField(7,n):"number"===i&&(n%1!=0?t.writeDoubleField(3,n):n<0?t.writeSVarintField(6,n):t.writeVarintField(5,n))}var v=n("pbf"),f=n("./lib/geojson_wrapper");t.exports=i;t.exports.fromVectorTileJs=i;t.exports.fromGeojsonVt=e;t.exports.GeoJSONWrapper=f},{"./lib/geojson_wrapper":47,pbf:38}],47:[function(n,t){"use strict";function r(n){this.features=n;this.length=n.length}function i(n){this.id="number"==typeof n.id?n.id:void 0;this.type=n.type;this.rawGeometry=1===n.type?[n.geometry]:n.geometry;this.properties=n.tags;this.extent=4096}var u=n("@mapbox/point-geometry"),f=n("@mapbox/vector-tile").VectorTileFeature;t.exports=r;r.prototype.feature=function(n){return new i(this.features[n])};i.prototype.loadGeometry=function(){var r=this.rawGeometry,n;for(this.geometry=[],n=0;n<r.length;n++){for(var i=r[n],f=[],t=0;t<i.length;t++)f.push(new u(i[t][0],i[t][1]));this.geometry.push(f)}return this.geometry};i.prototype.bbox=function(){var o,t,n;this.geometry||this.loadGeometry();for(var s=this.geometry,i=1/0,r=-1/0,u=1/0,f=-1/0,e=0;e<s.length;e++)for(o=s[e],t=0;t<o.length;t++)n=o[t],i=Math.min(i,n.x),r=Math.max(r,n.x),u=Math.min(u,n.y),f=Math.max(f,n.y);return[i,u,r,f]};i.prototype.toGeoJSON=f.prototype.toGeoJSON},{"@mapbox/point-geometry":2,"@mapbox/vector-tile":6}],48:[function(n,t){var f=arguments[3],i=arguments[4],u=arguments[5],r=JSON.stringify;t.exports=function(n,t){function b(n){var r,t;a[n]=!0;for(r in i[n][1])t=i[n][1][r],a[t]||b(t)}for(var c,s,l,y,a,p,w,e,h=Object.keys(u),o=0,v=h.length;o<v;o++)if(s=h[o],c=u[s].exports,c===n||c&&c.default===n){e=s;break}if(!e){e=Math.floor(Math.pow(16,8)*Math.random()).toString(16);for(var k={},o=0,v=h.length;o<v;o++)s=h[o],k[s]=s;i[e]=[Function(["require","module","exports"],"("+n+")(self)"),k]}l=Math.floor(Math.pow(16,8)*Math.random()).toString(16);y={};y[e]=e;i[l]=[Function(["require"],"var f = require("+r(e)+");(f.default ? f.default : f)(self);"),y];a={};b(l);var g="("+f+")({"+Object.keys(a).map(function(n){return r(n)+":["+i[n][0]+","+r(i[n][1])+"]"}).join(",")+"},{},["+r(l)+"])",nt=window.URL||window.webkitURL||window.mozURL||window.msURL,d=new Blob([g],{type:"text/javascript"});return t&&t.bare?d:(p=nt.createObjectURL(d),w=new Worker(p),w.objectURL=p,w)}},{}],49:[function(n,t){t.exports.RADIUS=6378137;t.exports.FLATTENING=1/298.257223563;t.exports.POLAR_RADIUS=6356752.3142},{}],50:[function(n,t){t.exports={version:"0.41.0"}},{}],51:[function(n,t){"use strict";var i=n("../util/util");t.exports={deserialize:function(n,t){var f={},u,e,o,r,c;if(!t)return f;for(u=0,e=n;u<e.length;u+=1)if(o=e[u],r=o.layerIds.map(function(n){return t.getLayer(n)}).filter(Boolean),0!==r.length)for(var l=r[0].createBucket(i.extend({layers:r},o)),s=0,h=r;s<h.length;s+=1)c=h[s],f[c.id]=l;return f}}},{"../util/util":252}],52:[function(n,t){"use strict";function r(n,t,i,r,u){n.emplaceBack(2*t+(r+1)/2,2*i+(u+1)/2)}var o=n("../segment"),s=o.SegmentVector,h=n("../../gl/vertex_buffer"),c=n("../../gl/index_buffer"),l=n("../program_configuration"),a=l.ProgramConfigurationSet,v=n("../vertex_array_type"),y=n("../index_array_type"),u=y.TriangleIndexArray,p=n("../load_geometry"),f=n("../extent"),e={layoutAttributes:[{name:"a_pos",components:2,type:"Int16"}],indexArrayType:u,paintAttributes:[{property:"circle-color"},{property:"circle-radius"},{property:"circle-blur"},{property:"circle-opacity"},{property:"circle-stroke-color"},{property:"circle-stroke-width"},{property:"circle-stroke-opacity"}]},w=v(e.layoutAttributes),i=function(n){this.zoom=n.zoom;this.overscaling=n.overscaling;this.layers=n.layers;this.index=n.index;this.layoutVertexArray=new w(n.layoutVertexArray);this.indexArray=new u(n.indexArray);this.segments=new s(n.segments);this.programConfigurations=new a(this.constructor.programInterface,n.layers,n.zoom,n.programConfigurations)};i.prototype.populate=function(n,t){for(var e,i=this,u=0,o=n;u<o.length;u+=1){var f=o[u],r=f.feature,s=f.index,h=f.sourceLayerIndex;i.layers[0]._featureFilter({zoom:i.zoom},r)&&(e=p(r),i.addFeature(r,e),t.featureIndex.insert(r,e,s,h,i.index))}};i.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length};i.prototype.serialize=function(n){return{zoom:this.zoom,layerIds:this.layers.map(function(n){return n.id}),layoutVertexArray:this.layoutVertexArray.serialize(n),indexArray:this.indexArray.serialize(n),programConfigurations:this.programConfigurations.serialize(n),segments:this.segments.get()}};i.prototype.upload=function(n){this.layoutVertexBuffer=new h(n,this.layoutVertexArray);this.indexBuffer=new c(n,this.indexArray);this.programConfigurations.upload(n)};i.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())};i.prototype.addFeature=function(n,t){for(var s,u,i=this,h=0,l=t;h<l.length;h+=1)for(var y=l[h],c=0,a=y;c<a.length;c+=1){var v=a[c],e=v.x,o=v.y;e<0||e>=f||o<0||o>=f||(s=i.segments.prepareSegment(4,i.layoutVertexArray,i.indexArray),u=s.vertexLength,r(i.layoutVertexArray,e,o,-1,-1),r(i.layoutVertexArray,e,o,1,-1),r(i.layoutVertexArray,e,o,1,1),r(i.layoutVertexArray,e,o,-1,1),i.indexArray.emplaceBack(u,u+1,u+2),i.indexArray.emplaceBack(u,u+3,u+2),s.vertexLength+=4,s.primitiveLength+=2)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,n)};i.programInterface=e;t.exports=i},{"../../gl/index_buffer":71,"../../gl/vertex_buffer":72,"../extent":58,"../index_array_type":60,"../load_geometry":61,"../program_configuration":63,"../segment":65,"../vertex_array_type":66}],53:[function(n,t){"use strict";var h=n("../segment"),u=h.SegmentVector,c=n("../../gl/vertex_buffer"),f=n("../../gl/index_buffer"),l=n("../program_configuration"),a=l.ProgramConfigurationSet,v=n("../vertex_array_type"),e=n("../index_array_type"),o=e.LineIndexArray,s=e.TriangleIndexArray,y=n("../load_geometry"),p=n("earcut"),w=n("../../util/classify_rings"),b=500,r={layoutAttributes:[{name:"a_pos",components:2,type:"Int16"}],indexArrayType:s,indexArrayType2:o,paintAttributes:[{property:"fill-color"},{property:"fill-outline-color"},{property:"fill-opacity"}]},k=v(r.layoutAttributes),i=function(n){this.zoom=n.zoom;this.overscaling=n.overscaling;this.layers=n.layers;this.index=n.index;this.layoutVertexArray=new k(n.layoutVertexArray);this.indexArray=new s(n.indexArray);this.indexArray2=new o(n.indexArray2);this.programConfigurations=new a(r,n.layers,n.zoom,n.programConfigurations);this.segments=new u(n.segments);this.segments2=new u(n.segments2)};i.prototype.populate=function(n,t){for(var e,i=this,u=0,o=n;u<o.length;u+=1){var f=o[u],r=f.feature,s=f.index,h=f.sourceLayerIndex;i.layers[0]._featureFilter({zoom:i.zoom},r)&&(e=y(r),i.addFeature(r,e),t.featureIndex.insert(r,e,s,h,i.index))}};i.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length};i.prototype.serialize=function(n){return{zoom:this.zoom,layerIds:this.layers.map(function(n){return n.id}),layoutVertexArray:this.layoutVertexArray.serialize(n),indexArray:this.indexArray.serialize(n),indexArray2:this.indexArray2.serialize(n),programConfigurations:this.programConfigurations.serialize(n),segments:this.segments.get(),segments2:this.segments2.get()}};i.prototype.upload=function(n){this.layoutVertexBuffer=new c(n,this.layoutVertexArray);this.indexBuffer=new f(n,this.indexArray);this.indexBuffer2=new f(n,this.indexArray2);this.programConfigurations.upload(n)};i.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())};i.prototype.addFeature=function(n,t){for(var i,h,s,u,e,o,r=this,c=0,g=w(t,b);c<g.length;c+=1){for(var l=g[c],a=0,v=0,nt=l;v<nt.length;v+=1)a+=nt[v].length;for(var y=r.segments.prepareSegment(a,r.layoutVertexArray,r.indexArray),k=y.vertexLength,f=[],tt=[],d=0,it=l;d<it.length;d+=1)if(i=it[d],0!==i.length){for(i!==l[0]&&tt.push(f.length/2),h=r.segments2.prepareSegment(i.length,r.layoutVertexArray,r.indexArray2),s=h.vertexLength,r.layoutVertexArray.emplaceBack(i[0].x,i[0].y),r.indexArray2.emplaceBack(s+i.length-1,s),f.push(i[0].x),f.push(i[0].y),u=1;u<i.length;u++)r.layoutVertexArray.emplaceBack(i[u].x,i[u].y),r.indexArray2.emplaceBack(s+u-1,s+u),f.push(i[u].x),f.push(i[u].y);h.vertexLength+=i.length;h.primitiveLength+=i.length}for(e=p(f,tt),o=0;o<e.length;o+=3)r.indexArray.emplaceBack(k+e[o],k+e[o+1],k+e[o+2]);y.vertexLength+=a;y.primitiveLength+=e.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,n)};i.programInterface=r;t.exports=i},{"../../gl/index_buffer":71,"../../gl/vertex_buffer":72,"../../util/classify_rings":234,"../index_array_type":60,"../load_geometry":61,"../program_configuration":63,"../segment":65,"../vertex_array_type":66,earcut:12}],54:[function(n,t){"use strict";function r(n,t,i,r,u,e,o,s){n.emplaceBack(t,i,2*Math.floor(r*f)+o,u*f*2,e*f*2,Math.round(s))}function c(n,t){return n.x===t.x&&(n.x<0||n.x>h)||n.y===t.y&&(n.y<0||n.y>h)}var e=n("../segment"),l=e.SegmentVector,o=e.MAX_VERTEX_ARRAY_LENGTH,a=n("../../gl/vertex_buffer"),v=n("../../gl/index_buffer"),y=n("../program_configuration"),p=y.ProgramConfigurationSet,w=n("../vertex_array_type"),b=n("../index_array_type"),s=b.TriangleIndexArray,k=n("../load_geometry"),h=n("../extent"),d=n("earcut"),g=n("../../util/classify_rings"),nt=500,u={layoutAttributes:[{name:"a_pos",components:2,type:"Int16"},{name:"a_normal",components:3,type:"Int16"},{name:"a_edgedistance",components:1,type:"Int16"}],indexArrayType:s,paintAttributes:[{property:"fill-extrusion-base"},{property:"fill-extrusion-height"},{property:"fill-extrusion-color"}]},f=Math.pow(2,13),tt=w(u.layoutAttributes),i=function(n){this.zoom=n.zoom;this.overscaling=n.overscaling;this.layers=n.layers;this.index=n.index;this.layoutVertexArray=new tt(n.layoutVertexArray);this.indexArray=new s(n.indexArray);this.programConfigurations=new p(u,n.layers,n.zoom,n.programConfigurations);this.segments=new l(n.segments)};i.prototype.populate=function(n,t){for(var e,i=this,u=0,o=n;u<o.length;u+=1){var f=o[u],r=f.feature,s=f.index,h=f.sourceLayerIndex;i.layers[0]._featureFilter({zoom:i.zoom},r)&&(e=k(r),i.addFeature(r,e),t.featureIndex.insert(r,e,s,h,i.index))}};i.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length};i.prototype.serialize=function(n){return{zoom:this.zoom,layerIds:this.layers.map(function(n){return n.id}),layoutVertexArray:this.layoutVertexArray.serialize(n),indexArray:this.indexArray.serialize(n),programConfigurations:this.programConfigurations.serialize(n),segments:this.segments.get()}};i.prototype.upload=function(n){this.layoutVertexBuffer=new a(n,this.layoutVertexArray);this.indexBuffer=new v(n,this.indexArray);this.programConfigurations.upload(n)};i.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())};i.prototype.addFeature=function(n,t){for(var p,l,a,e,s,f,h,w,rt,b,v,y,i=this,ut=0,ht=g(t,nt);ut<ht.length;ut+=1){for(var k=ht[ut],tt=0,ft=0,ct=k;ft<ct.length;ft+=1)tt+=ct[ft].length;for(var u=i.segments.prepareSegment(4,i.layoutVertexArray,i.indexArray),et=0,lt=k;et<lt.length;et+=1)if(p=lt[et],0!==p.length)for(l=0,a=0;a<p.length;a++)e=p[a],a>=1&&(s=p[a-1],c(e,s)||(u.vertexLength+4>o&&(u=i.segments.prepareSegment(4,i.layoutVertexArray,i.indexArray)),f=e.sub(s)._perp()._unit(),r(i.layoutVertexArray,e.x,e.y,f.x,f.y,0,0,l),r(i.layoutVertexArray,e.x,e.y,f.x,f.y,0,1,l),l+=s.dist(e),r(i.layoutVertexArray,s.x,s.y,f.x,f.y,0,0,l),r(i.layoutVertexArray,s.x,s.y,f.x,f.y,0,1,l),h=u.vertexLength,i.indexArray.emplaceBack(h,h+1,h+2),i.indexArray.emplaceBack(h+1,h+2,h+3),u.vertexLength+=4,u.primitiveLength+=2));u.vertexLength+tt>o&&(u=i.segments.prepareSegment(tt,i.layoutVertexArray,i.indexArray));for(var it=[],at=[],ot=u.vertexLength,st=0,vt=k;st<vt.length;st+=1)if(w=vt[st],0!==w.length)for(w!==k[0]&&at.push(it.length/2),rt=0;rt<w.length;rt++)b=w[rt],r(i.layoutVertexArray,b.x,b.y,0,0,1,1,0),it.push(b.x),it.push(b.y);for(v=d(it,at),y=0;y<v.length;y+=3)i.indexArray.emplaceBack(ot+v[y],ot+v[y+1],ot+v[y+2]);u.primitiveLength+=v.length/3;u.vertexLength+=tt}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,n)};i.programInterface=u;t.exports=i},{"../../gl/index_buffer":71,"../../gl/vertex_buffer":72,"../../util/classify_rings":234,"../extent":58,"../index_array_type":60,"../load_geometry":61,"../program_configuration":63,"../segment":65,"../vertex_array_type":66,earcut:12}],55:[function(n,t){"use strict";var i=n("./circle_bucket"),u={layoutAttributes:i.programInterface.layoutAttributes,indexArrayType:i.programInterface.indexArrayType,paintAttributes:[{property:"heatmap-weight"}]},r=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}(i);r.programInterface=u;t.exports=r},{"./circle_bucket":52}],56:[function(n,t){"use strict";function r(n,t,i,r,f,e,s){n.emplaceBack(t.x,t.y,r?1:0,f?1:-1,Math.round(o*i.x)+128,Math.round(o*i.y)+128,1+(0===e?0:e<0?-1:1)|(s*u&63)<<2,s*u>>6)}var s=n("../segment"),h=s.SegmentVector,c=n("../../gl/vertex_buffer"),l=n("../../gl/index_buffer"),a=n("../program_configuration"),v=a.ProgramConfigurationSet,y=n("../vertex_array_type"),p=n("../index_array_type"),e=p.TriangleIndexArray,w=n("../load_geometry"),b=n("../extent"),k=n("@mapbox/vector-tile").VectorTileFeature.types,o=63,d=Math.cos(Math.PI/180*37.5),g=15,u=.5,nt=Math.pow(2,14)/u,f={layoutAttributes:[{name:"a_pos_normal",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],paintAttributes:[{property:"line-color"},{property:"line-blur"},{property:"line-opacity"},{property:"line-gap-width",name:"gapwidth"},{property:"line-offset"},{property:"line-width"},{property:"line-width",name:"floorwidth",useIntegerZoom:!0}],indexArrayType:e},tt=y(f.layoutAttributes),i=function(n){this.zoom=n.zoom;this.overscaling=n.overscaling;this.layers=n.layers;this.index=n.index;this.layoutVertexArray=new tt(n.layoutVertexArray);this.indexArray=new e(n.indexArray);this.programConfigurations=new v(f,n.layers,n.zoom,n.programConfigurations);this.segments=new h(n.segments)};i.prototype.populate=function(n,t){for(var e,i=this,u=0,o=n;u<o.length;u+=1){var f=o[u],r=f.feature,s=f.index,h=f.sourceLayerIndex;i.layers[0]._featureFilter({zoom:i.zoom},r)&&(e=w(r),i.addFeature(r,e),t.featureIndex.insert(r,e,s,h,i.index))}};i.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length};i.prototype.serialize=function(n){return{zoom:this.zoom,layerIds:this.layers.map(function(n){return n.id}),layoutVertexArray:this.layoutVertexArray.serialize(n),indexArray:this.indexArray.serialize(n),programConfigurations:this.programConfigurations.serialize(n),segments:this.segments.get()}};i.prototype.upload=function(n){this.layoutVertexBuffer=new c(n,this.layoutVertexArray);this.indexBuffer=new l(n,this.indexArray);this.programConfigurations.upload(n)};i.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())};i.prototype.addFeature=function(n,t){for(var f,e=this,i=this.layers[0].layout,o=this.layers[0].getLayoutValue("line-join",{zoom:this.zoom},n),s=i["line-cap"],h=i["line-miter-limit"],c=i["line-round-limit"],r=0,u=t;r<u.length;r+=1)f=u[r],e.addLine(f,n,o,s,h,c)};i.prototype.addLine=function(n,t,i,r,u,f){for(var w,tt,v,yt,ht,pt,l,gt,ni,rt,wt,at,kt,vt,e=this,ut="Polygon"===k[t.type],y=n.length;y>=2&&n[y-1].equals(n[y-2]);)y--;for(w=0;w<y-1&&n[w].equals(n[w+1]);)w++;if(!(y<(ut?3:2))){"bevel"===i&&(u=1.05);var ft=g*(b/(512*this.overscaling)),ti=n[w],c=this.segments.prepareSegment(10*y,this.layoutVertexArray,this.indexArray);this.distance=0;var o,et,ot,ii=r,ri=ut?"butt":r,it=!0,nt=void 0,a=void 0,h=void 0,s=void 0;for(this.e1=this.e2=this.e3=-1,ut&&(o=n[y-2],s=ti.sub(o)._unit()._perp()),tt=w;tt<y;tt++)if(!(a=ut&&tt===y-1?n[w+1]:n[tt+1])||!n[tt].equals(a)){s&&(h=s);o&&(nt=o);o=n[tt];s=a?a.sub(o)._unit()._perp():h;h=h||s;v=h.add(s);0===v.x&&0===v.y||v._unit();var st=v.x*s.x+v.y*s.y,p=0!==st?1/st:1/0,dt=st<d&&nt&&a;if(dt&&tt>w&&(yt=o.dist(nt),yt>2*ft&&(ht=o.sub(o.sub(nt)._mult(ft/yt)._round()),e.distance+=ht.dist(nt),e.addCurrentVertex(ht,e.distance,h.mult(1),0,0,!1,c),nt=ht)),pt=nt&&a,l=pt?i:a?ii:ri,pt&&"round"===l&&(p<f?l="miter":p<=2&&(l="fakeround")),"miter"===l&&p>u&&(l="bevel"),"bevel"===l&&(p>2&&(l="flipbevel"),p<u&&(l="miter")),nt&&(e.distance+=o.dist(nt)),"miter"===l)v._mult(p),e.addCurrentVertex(o,e.distance,v,0,0,!1,c);else if("flipbevel"===l)p>100?v=s.clone().mult(-1):(gt=h.x*s.y-h.y*s.x>0?-1:1,ni=p*h.add(s).mag()/h.sub(s).mag(),v._perp()._mult(ni*gt)),e.addCurrentVertex(o,e.distance,v,0,0,!1,c),e.addCurrentVertex(o,e.distance,v.mult(-1),0,0,!1,c);else if("bevel"===l||"fakeround"===l){if(rt=h.x*s.y-h.y*s.x>0,wt=-Math.sqrt(p*p-1),rt?(ot=0,et=wt):(et=0,ot=wt),it||e.addCurrentVertex(o,e.distance,h,et,ot,!1,c),"fakeround"===l){for(var ct=Math.floor(8*(.5-(st-.5))),lt=void 0,bt=0;bt<ct;bt++)lt=s.mult((bt+1)/(ct+1))._add(h)._unit(),e.addPieSliceVertex(o,e.distance,lt,rt,c);for(e.addPieSliceVertex(o,e.distance,v,rt,c),at=ct-1;at>=0;at--)lt=h.mult((at+1)/(ct+1))._add(s)._unit(),e.addPieSliceVertex(o,e.distance,lt,rt,c)}a&&e.addCurrentVertex(o,e.distance,s,-et,-ot,!1,c)}else"butt"===l?(it||e.addCurrentVertex(o,e.distance,h,0,0,!1,c),a&&e.addCurrentVertex(o,e.distance,s,0,0,!1,c)):"square"===l?(it||(e.addCurrentVertex(o,e.distance,h,1,1,!1,c),e.e1=e.e2=-1),a&&e.addCurrentVertex(o,e.distance,s,-1,-1,!1,c)):"round"===l&&(it||(e.addCurrentVertex(o,e.distance,h,0,0,!1,c),e.addCurrentVertex(o,e.distance,h,1,1,!0,c),e.e1=e.e2=-1),a&&(e.addCurrentVertex(o,e.distance,s,-1,-1,!0,c),e.addCurrentVertex(o,e.distance,s,0,0,!1,c)));dt&&tt<y-1&&(kt=o.dist(a),kt>2*ft&&(vt=o.add(a.sub(o)._mult(ft/kt)._round()),e.distance+=vt.dist(o),e.addCurrentVertex(vt,e.distance,s.mult(1),0,0,!1,c),o=vt));it=!1}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t)}};i.prototype.addCurrentVertex=function(n,t,i,u,f,e,o){var s,h=this.layoutVertexArray,c=this.indexArray;s=i.clone();u&&s._sub(i.perp()._mult(u));r(h,n,s,e,!1,u,t);this.e3=o.vertexLength++;this.e1>=0&&this.e2>=0&&(c.emplaceBack(this.e1,this.e2,this.e3),o.primitiveLength++);this.e1=this.e2;this.e2=this.e3;s=i.mult(-1);f&&s._sub(i.perp()._mult(f));r(h,n,s,e,!0,-f,t);this.e3=o.vertexLength++;this.e1>=0&&this.e2>=0&&(c.emplaceBack(this.e1,this.e2,this.e3),o.primitiveLength++);this.e1=this.e2;this.e2=this.e3;t>nt/2&&(this.distance=0,this.addCurrentVertex(n,this.distance,i,u,f,e,o))};i.prototype.addPieSliceVertex=function(n,t,i,u,f){i=i.mult(u?-1:1);var e=this.layoutVertexArray,o=this.indexArray;r(e,n,i,!1,u,0,t);this.e3=f.vertexLength++;this.e1>=0&&this.e2>=0&&(o.emplaceBack(this.e1,this.e2,this.e3),f.primitiveLength++);u?this.e2=this.e3:this.e1=this.e3};i.programInterface=f;t.exports=i},{"../../gl/index_buffer":71,"../../gl/vertex_buffer":72,"../extent":58,"../index_array_type":60,"../load_geometry":61,"../program_configuration":63,"../segment":65,"../vertex_array_type":66,"@mapbox/vector-tile":6}],57:[function(n,t){"use strict";function o(n,t,i,r,u,f,e,o){n.emplaceBack(t,i,Math.round(64*r),Math.round(64*u),f,e,o?o[0]:void 0,o?o[1]:void 0)}function w(n,t,i,r){var f=2*Math.PI,u=wt((i+f)%f/f*255,10*r);n.emplaceBack(t.x,t.y,u);n.emplaceBack(t.x,t.y,u);n.emplaceBack(t.x,t.y,u);n.emplaceBack(t.x,t.y,u)}function s(n,t,i,r,u,f){return n.emplaceBack(t.x,t.y,i.x,i.y,Math.round(r.x),Math.round(r.y),10*u,10*f)}function b(n,t,i,r,u){if("source"===i.functionType)return[10*n.getLayoutValue(r,{},u)];if("composite"===i.functionType){var f=i.coveringZoomRange;return[10*n.getLayoutValue(r,{zoom:f[0]},u),10*n.getLayoutValue(r,{zoom:f[1]},u)]}return null}var h=n("@mapbox/point-geometry"),ht=n("../segment"),ct=ht.SegmentVector,k=n("../../gl/vertex_buffer"),lt=n("../../gl/index_buffer"),at=n("../program_configuration"),vt=at.ProgramConfigurationSet,d=n("../vertex_array_type"),g=n("../index_array_type"),nt=g.TriangleIndexArray,yt=g.LineIndexArray,e=n("../extent"),pt=n("../../shaders/encode_attribute"),wt=pt.packUint8ToFloat,l=n("../../symbol/anchor"),bt=n("../../symbol/get_anchors"),tt=n("../../util/token"),it=n("../../symbol/quads"),kt=it.getGlyphQuads,dt=it.getIconQuads,a=n("../../symbol/shaping"),gt=a.shapeText,ni=a.shapeIcon,r=a.WritingMode,ti=n("../../symbol/transform_text"),ii=n("../../symbol/mergelines"),ri=n("../../symbol/clip_line"),v=n("../../util/util"),y=n("../../util/script_detection"),ui=n("../load_geometry"),rt=n("../../symbol/collision_feature"),fi=n("../../util/find_pole_of_inaccessibility"),ei=n("../../util/classify_rings"),oi=n("@mapbox/vector-tile").VectorTileFeature.types,p=n("../../util/struct_array"),si=n("../../util/verticalize_punctuation"),hi=n("../../symbol/symbol_size"),ut=hi.getSizeData,c=p({members:[{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Float32",name:"placementZoom"},{type:"Uint8",name:"vertical"}]}),ft=p({members:[{type:"Float32",name:"offsetX"}]}),et=p({members:[{type:"Int16",name:"x"},{type:"Int16",name:"y"}]}),ot=[{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"}],st=[{name:"a_projected_pos",components:3,type:"Float32"}],f={text:{layoutAttributes:ot,dynamicLayoutAttributes:st,indexArrayType:nt,paintAttributes:[{property:"text-color",name:"fill_color"},{property:"text-halo-color",name:"halo_color"},{property:"text-halo-width",name:"halo_width"},{property:"text-halo-blur",name:"halo_blur"},{property:"text-opacity",name:"opacity"}]},icon:{layoutAttributes:ot,dynamicLayoutAttributes:st,indexArrayType:nt,paintAttributes:[{property:"icon-color",name:"fill_color"},{property:"icon-halo-color",name:"halo_color"},{property:"icon-halo-width",name:"halo_width"},{property:"icon-halo-blur",name:"halo_blur"},{property:"icon-opacity",name:"opacity"}]},collisionBox:{layoutAttributes:[{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"},{name:"a_data",components:2,type:"Uint8"}],indexArrayType:yt}},u=function(n,t,i,r){var u,f,e;this.programInterface=n;u=d(n.layoutAttributes);f=n.indexArrayType;(this.layoutVertexArray=new u(r&&r.layoutVertexArray),this.indexArray=new f(r&&r.indexArray),this.programConfigurations=new vt(n,t,i,r&&r.programConfigurations),this.segments=new ct(r&&r.segments),n.dynamicLayoutAttributes)&&(e=d(n.dynamicLayoutAttributes),this.dynamicLayoutVertexArray=new e(r&&r.dynamicLayoutVertexArray))},i;u.prototype.serialize=function(n){return{layoutVertexArray:this.layoutVertexArray.serialize(n),indexArray:this.indexArray.serialize(n),programConfigurations:this.programConfigurations.serialize(n),segments:this.segments.get(),dynamicLayoutVertexArray:this.dynamicLayoutVertexArray&&this.dynamicLayoutVertexArray.serialize(n)}};u.prototype.upload=function(n){this.layoutVertexBuffer=new k(n,this.layoutVertexArray);this.indexBuffer=new lt(n,this.indexArray);this.programConfigurations.upload(n);this.programInterface.dynamicLayoutAttributes&&(this.dynamicLayoutVertexBuffer=new k(n,this.dynamicLayoutVertexArray,!0))};u.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer&&this.dynamicLayoutVertexBuffer.destroy())};i=function(n){if(this.collisionBoxArray=n.collisionBoxArray,this.zoom=n.zoom,this.overscaling=n.overscaling,this.layers=n.layers,this.index=n.index,this.sdfIcons=n.sdfIcons,this.iconsNeedLinear=n.iconsNeedLinear,this.pixelRatio=n.pixelRatio,n.text)this.text=new u(f.text,n.layers,n.zoom,n.text),this.icon=new u(f.icon,n.layers,n.zoom,n.icon),this.collisionBox=new u(f.collisionBox,n.layers,n.zoom,n.collisionBox),this.textSizeData=n.textSizeData,this.iconSizeData=n.iconSizeData,this.placedGlyphArray=new c(n.placedGlyphArray),this.placedIconArray=new c(n.placedIconArray),this.glyphOffsetArray=new ft(n.glyphOffsetArray),this.lineVertexArray=new et(n.lineVertexArray);else{var t=this.layers[0];this.textSizeData=ut(this.zoom,t,"text-size");this.iconSizeData=ut(this.zoom,t,"icon-size")}};i.prototype.populate=function(n,t){var g=this,u=this.layers[0],e=u.layout,h=e["text-font"],p=(!u.isLayoutValueFeatureConstant("text-field")||e["text-field"])&&h,w=!u.isLayoutValueFeatureConstant("icon-image")||e["icon-image"],i,f,a,v;if(this.features=[],p||w){for(var nt=t.iconDependencies,b=t.glyphDependencies,k=b[h]=b[h]||{},o={zoom:this.zoom},c=0,d=n;c<d.length;c+=1){var l=d[c],r=l.feature,it=l.index,rt=l.sourceLayerIndex;if(u._featureFilter(o,r)&&(i=void 0,p&&(i=u.getLayoutValue("text-field",o,r),u.isLayoutValueFeatureConstant("text-field")&&(i=tt(r.properties,i)),i=ti(i,u,o,r)),f=void 0,(w&&(f=u.getLayoutValue("icon-image",o,r),u.isLayoutValueFeatureConstant("icon-image")&&(f=tt(r.properties,f))),i||f)&&(a={text:i,icon:f,index:it,sourceLayerIndex:rt,geometry:ui(r),properties:r.properties,type:oi[r.type]},void 0!==r.id&&(a.id=r.id),g.features.push(a),f&&(nt[f]=!0),i)))for(var ut="map"===e["text-rotation-alignment"]&&"line"===e["symbol-placement"],ft=y.allowsVerticalWritingMode(i),s=0;s<i.length;s++)(k[i.charCodeAt(s)]=!0,ut&&ft)&&(v=si.lookup[i.charAt(s)],v&&(k[v.charCodeAt(0)]=!0))}"line"===e["symbol-placement"]&&(this.features=ii(this.features))}};i.prototype.isEmpty=function(){return 0===this.icon.layoutVertexArray.length&&0===this.text.layoutVertexArray.length&&0===this.collisionBox.layoutVertexArray.length};i.prototype.serialize=function(n){return{zoom:this.zoom,layerIds:this.layers.map(function(n){return n.id}),sdfIcons:this.sdfIcons,iconsNeedLinear:this.iconsNeedLinear,textSizeData:this.textSizeData,iconSizeData:this.iconSizeData,placedGlyphArray:this.placedGlyphArray.serialize(n),placedIconArray:this.placedIconArray.serialize(n),glyphOffsetArray:this.glyphOffsetArray.serialize(n),lineVertexArray:this.lineVertexArray.serialize(n),text:this.text.serialize(n),icon:this.icon.serialize(n),collisionBox:this.collisionBox.serialize(n)}};i.prototype.upload=function(n){this.text.upload(n);this.icon.upload(n);this.collisionBox.upload(n)};i.prototype.destroy=function(){this.text.destroy();this.icon.destroy();this.collisionBox.destroy()};i.prototype.prepare=function(n,t,i,u){var f=this,w,a,c;this.symbolInstances=[];w=512*this.overscaling;this.tilePixelRatio=e/w;this.compareText={};this.iconsNeedLinear=!1;for(var s=this.layers[0].layout,g=24*s["text-line-height"],b=s["text-font"].join(","),nt="map"===s["text-rotation-alignment"]&&"line"===s["symbol-placement"],tt=n[b]||{},it=t[b]||{},p=0,k=f.features;p<k.length;p+=1){var o=k[p],l={},h=o.text;if(h){var rt=f.layers[0].getLayoutValue("text-offset",{zoom:f.zoom},o).map(function(n){return 24*n}),ut=24*f.layers[0].getLayoutValue("text-letter-spacing",{zoom:f.zoom},o),ft=y.allowsLetterSpacing(h)?ut:0,et=f.layers[0].getLayoutValue("text-anchor",{zoom:f.zoom},o),ot=f.layers[0].getLayoutValue("text-justify",{zoom:f.zoom},o),st="line"!==s["symbol-placement"]?24*f.layers[0].getLayoutValue("text-max-width",{zoom:f.zoom},o):0,d=function(n,t){return gt(n,tt,st,g,et,ot,ft,rt,24,t)};l[r.horizontal]=d(h,r.horizontal);y.allowsVerticalWritingMode(h)&&nt&&(l[r.vertical]=d(h,r.vertical))}a=void 0;o.icon&&(c=i[o.icon],c&&(a=ni(u[o.icon],f.layers[0].getLayoutValue("icon-offset",{zoom:f.zoom},o),f.layers[0].getLayoutValue("icon-anchor",{zoom:f.zoom},o)),void 0===f.sdfIcons?f.sdfIcons=c.sdf:f.sdfIcons!==c.sdf&&v.warnOnce("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),c.pixelRatio!==f.pixelRatio?f.iconsNeedLinear=!0:0===s["icon-rotate"]&&f.layers[0].isLayoutValueFeatureConstant("icon-rotate")||(f.iconsNeedLinear=!0)));(l[r.horizontal]||a)&&f.addFeature(o,l,a,it)}};i.prototype.addFeature=function(n,t,i,u){var o=this,et=this.layers[0].getLayoutValue("text-size",{zoom:this.zoom+1},n),lt=this.layers[0].getLayoutValue("icon-size",{zoom:this.zoom+1},n),at=this.layers[0].getLayoutValue("text-offset",{zoom:this.zoom},n),vt=this.layers[0].getLayoutValue("icon-offset",{zoom:this.zoom},n),w=this.layers[0].getLayoutValue("text-size",{zoom:18},n),h,b,d,g,c,nt,tt,it,a,rt,v,y,ut,p;void 0===w&&(w=et);var f=this.layers[0].layout,yt=et/24,pt=this.tilePixelRatio*yt,wt=this.tilePixelRatio*w/24,kt=this.tilePixelRatio*lt,ot=this.tilePixelRatio*f["symbol-spacing"],dt=f["symbol-avoid-edges"],gt=f["text-padding"]*this.tilePixelRatio,ni=f["icon-padding"]*this.tilePixelRatio,ti=f["text-max-angle"]/180*Math.PI,ii="map"===f["text-rotation-alignment"]&&"line"===f["symbol-placement"],ui="map"===f["icon-rotation-alignment"]&&"line"===f["symbol-placement"],oi=f["text-allow-overlap"]||f["icon-allow-overlap"]||f["text-ignore-placement"]||f["icon-ignore-placement"],si=f["symbol-placement"],hi=ot/2,s=function(r,f){var s=!(f.x<0||f.x>e||f.y<0||f.y>e),h;(!dt||s)&&(h=s||oi,o.addSymbolInstance(f,r,t,i,o.layers[0],h,o.collisionBoxArray,n.index,n.sourceLayerIndex,o.index,pt,gt,ii,at,kt,ni,ui,vt,{zoom:o.zoom},n,u))};if("line"===si)for(h=0,b=ri(n.geometry,0,0,e,e);h<b.length;h+=1)for(var st=b[h],ci=bt(st,ot,ti,t[r.vertical]||t[r.horizontal],i,24,wt,o.overscaling,e),k=0,ht=ci;k<ht.length;k+=1)d=ht[k],g=t[r.horizontal],g&&o.anchorIsTooClose(g.text,hi,d)||s(st,d);else if("Polygon"===n.type)for(c=0,nt=ei(n.geometry,0);c<nt.length;c+=1)tt=nt[c],it=fi(tt,16),s(tt[0],new l(it.x,it.y,0));else if("LineString"===n.type)for(a=0,rt=n.geometry;a<rt.length;a+=1)v=rt[a],s(v,new l(v[0].x,v[0].y,0));else if("Point"===n.type)for(y=0,ut=n.geometry;y<ut.length;y+=1)for(var li=ut[y],ft=0,ct=li;ft<ct.length;ft+=1)p=ct[ft],s([p],new l(p.x,p.y,0))};i.prototype.anchorIsTooClose=function(n,t,i){var r=this.compareText,f,u;if(n in r){for(f=r[n],u=f.length-1;u>=0;u--)if(i.dist(f[u])<t)return!0}else r[n]=[];return r[n].push(i),!1};i.prototype.place=function(n,t){var e=this,h,p,d,ht,ct;this.text=new u(f.text,this.layers,this.zoom);this.icon=new u(f.icon,this.layers,this.zoom);this.collisionBox=new u(f.collisionBox,this.layers,this.zoom);this.placedGlyphArray=new c;this.placedIconArray=new c;this.glyphOffsetArray=new ft;this.lineVertexArray=new et;var y=this.layers[0],r=y.layout,g=n.maxScale,lt="map"===r["text-rotation-alignment"]&&"line"===r["symbol-placement"],at="map"===r["icon-rotation-alignment"]&&"line"===r["symbol-placement"];if(r["text-allow-overlap"]||r["icon-allow-overlap"]||r["text-ignore-placement"]||r["icon-ignore-placement"]){var nt=n.angle,tt=Math.sin(nt),it=Math.cos(nt);this.symbolInstances.sort(function(n,t){return(tt*n.anchor.x+it*n.anchor.y|0)-(tt*t.anchor.x+it*t.anchor.y|0)||t.featureIndex-n.featureIndex})}for(h=0,p=e.symbolInstances;h<p.length;h+=1){var i=p[h],rt={boxStartIndex:i.textBoxStartIndex,boxEndIndex:i.textBoxEndIndex},ut={boxStartIndex:i.iconBoxStartIndex,boxEndIndex:i.iconBoxEndIndex},l=!(i.textBoxStartIndex===i.textBoxEndIndex),a=!(i.iconBoxStartIndex===i.iconBoxEndIndex),ot=r["text-optional"]||!l,st=r["icon-optional"]||!a,o=l?n.placeCollisionFeature(rt,r["text-allow-overlap"],r["symbol-avoid-edges"]):n.minScale,s=a?n.placeCollisionFeature(ut,r["icon-allow-overlap"],r["symbol-avoid-edges"]):n.minScale;if(ot||st?!st&&o?o=Math.max(s,o):!ot&&s&&(s=Math.max(s,o)):s=o=Math.max(s,o),l||a){for(var w=i.line,k=e.lineVertexArray.length,v=0;v<w.length;v++)e.lineVertexArray.emplaceBack(w[v].x,w[v].y);d=e.lineVertexArray.length-k;l&&(n.insertCollisionFeature(rt,o,r["text-ignore-placement"]),o<=g)&&(ht=b(y,e.zoom,e.textSizeData,"text-size",i.feature),e.addSymbols(e.text,i.glyphQuads,o,ht,r["text-keep-upright"],i.textOffset,lt,n.angle,i.feature,i.writingModes,i.anchor,k,d,e.placedGlyphArray));a&&(n.insertCollisionFeature(ut,s,r["icon-ignore-placement"]),s<=g)&&(ct=b(y,e.zoom,e.iconSizeData,"icon-size",i.feature),e.addSymbols(e.icon,i.iconQuads,s,ct,r["icon-keep-upright"],i.iconOffset,at,n.angle,i.feature,0,i.anchor,k,d,e.placedIconArray))}}t&&this.addToDebugBuffers(n)};i.prototype.addSymbols=function(n,t,i,u,f,e,s,h,c,l,a,v,y,p){for(var k,vt=this,ut=n.indexArray,g=n.layoutVertexArray,yt=n.dynamicLayoutVertexArray,pt=this.zoom,ft=Math.max(Math.log(i)/Math.LN2+pt,0),et=this.glyphOffsetArray.length,nt=(a.angle+h+2*Math.PI)%(2*Math.PI),wt=nt>Math.PI/4&&nt<=3*Math.PI/4||nt>5*Math.PI/4&&nt<=7*Math.PI/4,ot=Boolean(l&r.vertical)&&wt,it=0,st=t;it<st.length;it+=1)if(k=st[it],!s||!f||k.writingMode===r.vertical===ot){var ht=k.tl,ct=k.tr,lt=k.bl,at=k.br,b=k.tex,rt=n.segments.prepareSegment(4,n.layoutVertexArray,n.indexArray),d=rt.vertexLength,tt=k.glyphOffset[1];o(g,a.x,a.y,ht.x,tt+ht.y,b.x,b.y,u);o(g,a.x,a.y,ct.x,tt+ct.y,b.x+b.w,b.y,u);o(g,a.x,a.y,lt.x,tt+lt.y,b.x,b.y+b.h,u);o(g,a.x,a.y,at.x,tt+at.y,b.x+b.w,b.y+b.h,u);w(yt,a,0,ft);ut.emplaceBack(d,d+1,d+2);ut.emplaceBack(d+1,d+2,d+3);rt.vertexLength+=4;rt.primitiveLength+=2;vt.glyphOffsetArray.emplaceBack(k.glyphOffset[0])}p.emplaceBack(a.x,a.y,et,this.glyphOffsetArray.length-et,v,y,a.segment,u?u[0]:0,u?u[1]:0,e[0],e[1],ft,ot);n.programConfigurations.populatePaintArrays(n.layoutVertexArray.length,c)};i.prototype.addToDebugBuffers=function(n){for(var i,a,v,y,t,f=this,u=this.collisionBox,e=u.layoutVertexArray,o=u.indexArray,c=-n.angle,l=n.yStretch,k=0,g=f.symbolInstances;k<g.length;k+=1)for(i=g[k],i.textCollisionFeature={boxStartIndex:i.textBoxStartIndex,boxEndIndex:i.textBoxEndIndex},i.iconCollisionFeature={boxStartIndex:i.iconBoxStartIndex,boxEndIndex:i.iconBoxEndIndex},a=0;a<2;a++)if(v=i[0===a?"textCollisionFeature":"iconCollisionFeature"],v)for(y=v.boxStartIndex;y<v.boxEndIndex;y++)if(t=f.collisionBoxArray.get(y),!(1===n.perspectiveRatio&&t.maxScale<1)){var p=t.anchorPoint,nt=new h(t.x1,t.y1*l)._rotate(c),tt=new h(t.x2,t.y1*l)._rotate(c),it=new h(t.x1,t.y2*l)._rotate(c),rt=new h(t.x2,t.y2*l)._rotate(c),w=Math.max(0,Math.min(25,f.zoom+Math.log(t.maxScale)/Math.LN2)),b=Math.max(0,Math.min(25,f.zoom+Math.log(t.placementScale)/Math.LN2)),d=u.segments.prepareSegment(4,u.layoutVertexArray,u.indexArray),r=d.vertexLength;s(e,p,i.anchor,nt,w,b);s(e,p,i.anchor,tt,w,b);s(e,p,i.anchor,rt,w,b);s(e,p,i.anchor,it,w,b);o.emplaceBack(r,r+1);o.emplaceBack(r+1,r+2);o.emplaceBack(r+2,r+3);o.emplaceBack(r+3,r);d.vertexLength+=4;d.primitiveLength+=4}};i.prototype.addSymbolInstance=function(n,t,u,f,e,o,s,h,c,l,a,y,p,w,b,k,d,g,nt,tt,it){var ut,ft,ct=[],ot=[],lt,et,at,st,vt,ht,yt;for(lt in u)et=parseInt(lt,10),u[et]&&(ot=ot.concat(o?kt(n,u[et],e,p,nt,tt,it):[]),ut=new rt(s,t,n,h,c,l,u[et],a,y,p,!1));at=ut?ut.boxStartIndex:this.collisionBoxArray.length;st=ut?ut.boxEndIndex:this.collisionBoxArray.length;f&&(ct=o?dt(n,f,e,d,u[r.horizontal],nt,tt):[],ft=new rt(s,t,n,h,c,l,f,b,k,d,!0));vt=ft?ft.boxStartIndex:this.collisionBoxArray.length;ht=ft?ft.boxEndIndex:this.collisionBoxArray.length;st>i.MAX_INSTANCES&&v.warnOnce("Too many symbols being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907");ht>i.MAX_INSTANCES&&v.warnOnce("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907");yt=(u[r.vertical]?r.vertical:0)|(u[r.horizontal]?r.horizontal:0);this.symbolInstances.push({textBoxStartIndex:at,textBoxEndIndex:st,iconBoxStartIndex:vt,iconBoxEndIndex:ht,glyphQuads:ot,iconQuads:ct,textOffset:w,iconOffset:g,anchor:n,line:t,featureIndex:h,feature:tt,writingModes:yt})};i.programInterfaces=f;i.MAX_INSTANCES=65535;i.addDynamicAttributes=w;t.exports=i},{"../../gl/index_buffer":71,"../../gl/vertex_buffer":72,"../../shaders/encode_attribute":97,"../../symbol/anchor":196,"../../symbol/clip_line":198,"../../symbol/collision_feature":200,"../../symbol/get_anchors":202,"../../symbol/mergelines":203,"../../symbol/quads":205,"../../symbol/shaping":206,"../../symbol/symbol_size":207,"../../symbol/transform_text":208,"../../util/classify_rings":234,"../../util/find_pole_of_inaccessibility":240,"../../util/script_detection":247,"../../util/struct_array":249,"../../util/token":251,"../../util/util":252,"../../util/verticalize_punctuation":254,"../extent":58,"../index_array_type":60,"../load_geometry":61,"../program_configuration":63,"../segment":65,"../vertex_array_type":66,"@mapbox/point-geometry":2,"@mapbox/vector-tile":6}],58:[function(n,t){"use strict";t.exports=8192},{}],59:[function(n,t){"use strict";function e(n,t){return t-n}var p=n("@mapbox/point-geometry"),o=n("./load_geometry"),r=n("./extent"),s=n("../style-spec/feature_filter"),h=n("../util/struct_array"),u=n("grid-index"),c=n("../util/dictionary_coder"),l=n("@mapbox/vector-tile"),a=n("pbf"),v=n("../util/vectortile_to_geojson"),y=n("../util/util").arraysIntersect,f=h({members:[{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]}),i=function(n,t,i,e){this.coord=n;this.overscaling=t;this.x=n.x;this.y=n.y;this.z=n.z-Math.log(t)/Math.LN2;this.grid=i||new u(r,16,0);this.featureIndexArray=e||new f};i.deserialize=function(n,t,r){var e=new i(n.coord,n.overscaling,new u(n.grid),new f(n.featureIndexArray));return e.rawTileData=t,e.bucketLayerIDs=n.bucketLayerIDs,e.setCollisionTile(r),e};i.prototype.insert=function(n,t,i,r,u){var c=this,l=this.featureIndexArray.length,o,e;for(this.featureIndexArray.emplaceBack(i,r,u),o=0;o<t.length;o++){for(var h=t[o],f=[1/0,1/0,-1/0,-1/0],s=0;s<h.length;s++)e=h[s],f[0]=Math.min(f[0],e.x),f[1]=Math.min(f[1],e.y),f[2]=Math.max(f[2],e.x),f[3]=Math.max(f[3],e.y);c.grid.insert(l,f[0],f[1],f[2],f[3])}};i.prototype.setCollisionTile=function(n){this.collisionTile=n};i.prototype.serialize=function(n){var t=this.grid.toArrayBuffer();return n&&n.push(t),{coord:this.coord,overscaling:this.overscaling,grid:t,featureIndexArray:this.featureIndexArray.serialize(n),bucketLayerIDs:this.bucketLayerIDs}};i.prototype.query=function(n,t){var g,o,u,nt,tt;this.vtLayers||(this.vtLayers=new l.VectorTile(new a(this.rawTileData)).layers,this.sourceLayerCoder=new c(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]));for(var h={},v=n.params||{},y=r/n.tileSize/n.scale,it=s(v.filter),i=n.queryGeometry,f=n.additionalRadius*y,p=1/0,w=1/0,b=-1/0,k=-1/0,d=0;d<i.length;d++)for(g=i[d],o=0;o<g.length;o++)u=g[o],p=Math.min(p,u.x),w=Math.min(w,u.y),b=Math.max(b,u.x),k=Math.max(k,u.y);return nt=this.grid.query(p-f,w-f,b+f,k+f),nt.sort(e),this.filterMatching(h,nt,this.featureIndexArray,i,it,v.layers,t,n.bearing,y),tt=this.collisionTile.queryRenderedSymbols(i,n.scale),tt.sort(),this.filterMatching(h,tt,this.collisionTile.collisionBoxArray,i,it,v.layers,t,n.bearing,y),h};i.prototype.filterMatching=function(n,t,i,r,u,f,e,s,h){for(var rt,l,b,k,g,nt,a,p,it,tt,c=this,w=0;w<t.length;w++)if(l=t[w],l!==rt&&(rt=l,b=i.get(l),k=c.bucketLayerIDs[b.bucketIndex],!f||y(f,k))){var ut=c.sourceLayerCoder.decode(b.sourceLayerIndex),ft=c.vtLayers[ut],d=ft.feature(b.featureIndex);if(u({zoom:c.coord.z},d))for(g=null,nt=0;nt<k.length;nt++)a=k[nt],f&&f.indexOf(a)<0||(p=e[a],p&&("symbol"===p.type||(g||(g=o(d)),p.queryIntersectsFeature(r,d,g,c.z,s,h)))&&(it=new v(d,c.z,c.x,c.y),it.layer=p.serialize(),tt=n[a],void 0===tt&&(tt=n[a]=[]),tt.push({featureIndex:l,feature:it})))}};i.prototype.hasLayer=function(n){for(var f,e=this,t=0,r=e.bucketLayerIDs;t<r.length;t+=1)for(var o=r[t],i=0,u=o;i<u.length;i+=1)if(f=u[i],n===f)return!0;return!1};t.exports=i},{"../style-spec/feature_filter":144,"../util/dictionary_coder":236,"../util/struct_array":249,"../util/util":252,"../util/vectortile_to_geojson":253,"./extent":58,"./load_geometry":61,"@mapbox/point-geometry":2,"@mapbox/vector-tile":6,"grid-index":23,pbf:38}],60:[function(n,t){"use strict";function i(n){return r({members:[{type:"Uint16",name:"vertices",components:n}]})}var r=n("../util/struct_array");t.exports={LineIndexArray:i(2),TriangleIndexArray:i(3)}},{"../util/struct_array":249}],61:[function(n,t){"use strict";function r(n){return{min:-1*Math.pow(2,n-1),max:Math.pow(2,n-1)-1}}var u=n("../util/util"),f=n("./extent"),i=r(16);t.exports=function(n){for(var s,r,t,h=f/n.extent,e=n.loadGeometry(),o=0;o<e.length;o++)for(s=e[o],r=0;r<s.length;r++)t=s[r],t.x=Math.round(t.x*h),t.y=Math.round(t.y*h),(t.x<i.min||t.x>i.max||t.y<i.min||t.y>i.max)&&u.warnOnce("Geometry exceeds allowed extent, reduce your vector tile buffer size");return e}},{"../util/util":252,"./extent":58}],62:[function(n,t){"use strict";var i=n("../util/struct_array"),r=i({members:[{name:"a_pos",type:"Int16",components:2}]});t.exports=r},{"../util/struct_array":249}],63:[function(n,t){"use strict";function o(n){return[h(255*n[0],255*n[1]),h(255*n[2],255*n[3])]}var s=n("./vertex_array_type"),h=n("../shaders/encode_attribute").packUint8ToFloat,c=n("../gl/vertex_buffer"),u=function(n,t,i,r){this.name=n;this.type=t;this.property=i;this.useIntegerZoom=r},f,e,i,r;u.prototype.defines=function(){return["#define HAS_UNIFORM_u_"+this.name]};u.prototype.populatePaintArray=function(){};u.prototype.setUniforms=function(n,t,i,r){var u=r.zoom,f=i.getPaintValue(this.property,{zoom:this.useIntegerZoom?Math.floor(u):u});"color"===this.type?n.uniform4fv(t.uniforms["u_"+this.name],f):n.uniform1f(t.uniforms["u_"+this.name],f)};f=function(n,t,i){this.name=n;this.type=t;this.property=i};f.prototype.defines=function(){return[]};f.prototype.populatePaintArray=function(n,t,i,r,u,f){var h=this,c=n.getPaintValue(this.property,{zoom:0},f),l,e,a,s,v;if("color"===this.type)for(l=o(c),e=r;e<u;e++)a=t.get(e),a["a_"+h.name+"0"]=l[0],a["a_"+h.name+"1"]=l[1];else{for(s=r;s<u;s++)t.get(s)["a_"+h.name]=c;v=i[this.property];v.max=Math.max(v.max,c)}};f.prototype.setUniforms=function(n,t){n.uniform1f(t.uniforms["a_"+this.name+"_t"],0)};e=function(n,t,i,r,u){this.name=n;this.type=t;this.property=i;this.useIntegerZoom=r;this.zoom=u};e.prototype.defines=function(){return[]};e.prototype.populatePaintArray=function(n,t,i,r,u,f){var e=this,c=n.getPaintValue(this.property,{zoom:this.zoom},f),l=n.getPaintValue(this.property,{zoom:this.zoom+1},f),s,h,v,y;if("color"===this.type)for(var p=o(c),w=o(l),a=r;a<u;a++)s=t.get(a),s["a_"+e.name+"0"]=p[0],s["a_"+e.name+"1"]=p[1],s["a_"+e.name+"2"]=w[0],s["a_"+e.name+"3"]=w[1];else{for(h=r;h<u;h++)v=t.get(h),v["a_"+e.name+"0"]=c,v["a_"+e.name+"1"]=l;y=i[this.property];y.max=Math.max(y.max,c,l)}};e.prototype.setUniforms=function(n,t,i,r){var u=r.zoom,f=i.getPaintInterpolationFactor(this.property,this.useIntegerZoom?Math.floor(u):u,this.zoom,this.zoom+1);n.uniform1f(t.uniforms["a_"+this.name+"_t"],f)};i=function(){this.binders={};this.cacheKey=""};i.createDynamic=function(n,t,r){for(var h=new i,a=[],v=0,p=n.paintAttributes||[];v<p.length;v+=1){var y=p[v],c=y.property,w=y.useIntegerZoom||!1,o=y.name||c.replace(t.type+"-","").replace(/-/g,"_"),l=t._paintSpecifications[c].type;t.isPaintValueFeatureConstant(c)?(h.binders[o]=new u(o,l,c,w),h.cacheKey+="/u_"+o):t.isPaintValueZoomConstant(c)?(h.binders[o]=new f(o,l,c),h.cacheKey+="/a_"+o,a.push({name:"a_"+o,type:"Float32",components:"color"===l?2:1})):(h.binders[o]=new e(o,l,c,w,r),h.cacheKey+="/z_"+o,a.push({name:"a_"+o,type:"Float32",components:"color"===l?4:2}))}return h.PaintVertexArray=s(a),h.interface=n,h.layer=t,h};i.createBasicFill=function(){var n=new i;return n.binders.color=new u("color","color","fill-color",!1),n.cacheKey+="/u_color",n.binders.opacity=new u("opacity","number","fill-opacity",!1),n.cacheKey+="/u_opacity",n};i.prototype.createPaintPropertyStatistics=function(){var n=this,t={},i;for(i in n.binders)t[n.binders[i].property]={max:-1/0};return t};i.prototype.populatePaintArray=function(n,t){var i=this,r=this.paintVertexArray,u,f;if(0!==r.bytesPerElement){u=r.length;r.resize(n);for(f in i.binders)i.binders[f].populatePaintArray(i.layer,r,i.paintPropertyStatistics,u,n,t)}};i.prototype.defines=function(){var t=this,n=[],i;for(i in t.binders)n.push.apply(n,t.binders[i].defines());return n};i.prototype.setUniforms=function(n,t,i,r){var u=this,f;for(f in u.binders)u.binders[f].setUniforms(n,t,i,r)};i.prototype.serialize=function(n){return 0===this.paintVertexArray.length?null:{array:this.paintVertexArray.serialize(n),type:this.paintVertexArray.constructor.serialize(),statistics:this.paintPropertyStatistics}};i.deserialize=function(n,t,r,u){var f=i.createDynamic(n,t,r);return u&&(f.PaintVertexArray=s(u.type.members),f.paintVertexArray=new f.PaintVertexArray(u.array),f.paintPropertyStatistics=u.statistics),f};i.prototype.upload=function(n){this.paintVertexArray&&(this.paintVertexBuffer=new c(n,this.paintVertexArray))};i.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()};r=function(n,t,r,u){var a=this,e,h,o,s,c,l,f;if(this.programConfigurations={},u)for(e=0,h=t;e<h.length;e+=1)o=h[e],a.programConfigurations[o.id]=i.deserialize(n,o,r,u[o.id]);else for(s=0,c=t;s<c.length;s+=1)l=c[s],f=i.createDynamic(n,l,r),f.paintVertexArray=new f.PaintVertexArray,f.paintPropertyStatistics=f.createPaintPropertyStatistics(),a.programConfigurations[l.id]=f};r.prototype.populatePaintArrays=function(n,t){var i=this,r;for(r in i.programConfigurations)i.programConfigurations[r].populatePaintArray(n,t)};r.prototype.serialize=function(n){var r=this,u={},t,i;for(t in r.programConfigurations)i=r.programConfigurations[t].serialize(n),i&&(u[t]=i);return u};r.prototype.get=function(n){return this.programConfigurations[n]};r.prototype.upload=function(n){var t=this,i;for(i in t.programConfigurations)t.programConfigurations[i].upload(n)};r.prototype.destroy=function(){var n=this,t;for(t in n.programConfigurations)n.programConfigurations[t].destroy()};t.exports={ProgramConfiguration:i,ProgramConfigurationSet:r}},{"../gl/vertex_buffer":72,"../shaders/encode_attribute":97,"./vertex_array_type":66}],64:[function(n,t){"use strict";var i=n("../util/struct_array"),r=i({members:[{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]});t.exports=r},{"../util/struct_array":249}],65:[function(n,t){"use strict";var u=n("../util/util"),f=u.warnOnce,r=Math.pow(2,16)-1,i=function(n){void 0===n&&(n=[]);this.segments=n};i.prototype.prepareSegment=function(n,i,u){var e=this.segments[this.segments.length-1];return n>r&&f("Max vertices per segment is "+r+": bucket requested "+n),(!e||e.vertexLength+n>t.exports.MAX_VERTEX_ARRAY_LENGTH)&&(e={vertexOffset:i.length,primitiveOffset:u.length,vertexLength:0,primitiveLength:0},this.segments.push(e)),e};i.prototype.get=function(){return this.segments};i.prototype.destroy=function(){for(var t,r,u=this,n=0,i=u.segments;n<i.length;n+=1){t=i[n];for(r in t.vaos)t.vaos[r].destroy()}};t.exports={SegmentVector:i,MAX_VERTEX_ARRAY_LENGTH:r}},{"../util/util":252}],66:[function(n,t){"use strict";function i(n){return r({members:n,alignment:4})}var r=n("../util/struct_array");t.exports=i},{"../util/struct_array":249}],67:[function(n,t){"use strict";var i=function(n,t,i){this.column=n;this.row=t;this.zoom=i};i.prototype.clone=function(){return new i(this.column,this.row,this.zoom)};i.prototype.zoomTo=function(n){return this.clone()._zoomTo(n)};i.prototype.sub=function(n){return this.clone()._sub(n)};i.prototype._zoomTo=function(n){var t=Math.pow(2,n-this.zoom);return this.column*=t,this.row*=t,this.zoom=n,this};i.prototype._sub=function(n){return n=n.zoomTo(this.zoom),this.column-=n.column,this.row-=n.row,this};t.exports=i},{}],68:[function(n,t){"use strict";var r=n("../util/util").wrap,i=function(n,t){if(isNaN(n)||isNaN(t))throw new Error("Invalid LngLat object: ("+n+", "+t+")");if(this.lng=+n,this.lat=+t,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90");};i.prototype.wrap=function(){return new i(r(this.lng,-180,180),this.lat)};i.prototype.toArray=function(){return[this.lng,this.lat]};i.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"};i.prototype.toBounds=function(t){var r=360*t/40075017,u=r/Math.cos(Math.PI/180*this.lat);return new(n("./lng_lat_bounds"))(new i(this.lng-u,this.lat-r),new i(this.lng+u,this.lat+r))};i.convert=function(n){if(n instanceof i)return n;if(Array.isArray(n)&&2===n.length)return new i(Number(n[0]),Number(n[1]));if(!Array.isArray(n)&&"object"==typeof n&&null!==n)return new i(Number(n.lng),Number(n.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]");};t.exports=i},{"../util/util":252,"./lng_lat_bounds":69}],69:[function(n,t){"use strict";var r=n("./lng_lat"),i=function(n,t){n&&(t?this.setSouthWest(n).setNorthEast(t):4===n.length?this.setSouthWest([n[0],n[1]]).setNorthEast([n[2],n[3]]):this.setSouthWest(n[0]).setNorthEast(n[1]))};i.prototype.setNorthEast=function(n){return this._ne=n instanceof r?new r(n.lng,n.lat):r.convert(n),this};i.prototype.setSouthWest=function(n){return this._sw=n instanceof r?new r(n.lng,n.lat):r.convert(n),this};i.prototype.extend=function(n){var t,u,f=this._sw,e=this._ne;if(n instanceof r)t=n,u=n;else{if(!(n instanceof i))return Array.isArray(n)?n.every(Array.isArray)?this.extend(i.convert(n)):this.extend(r.convert(n)):this;if(t=n._sw,u=n._ne,!t||!u)return this}return f||e?(f.lng=Math.min(t.lng,f.lng),f.lat=Math.min(t.lat,f.lat),e.lng=Math.max(u.lng,e.lng),e.lat=Math.max(u.lat,e.lat)):(this._sw=new r(t.lng,t.lat),this._ne=new r(u.lng,u.lat)),this};i.prototype.getCenter=function(){return new r((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)};i.prototype.getSouthWest=function(){return this._sw};i.prototype.getNorthEast=function(){return this._ne};i.prototype.getNorthWest=function(){return new r(this.getWest(),this.getNorth())};i.prototype.getSouthEast=function(){return new r(this.getEast(),this.getSouth())};i.prototype.getWest=function(){return this._sw.lng};i.prototype.getSouth=function(){return this._sw.lat};i.prototype.getEast=function(){return this._ne.lng};i.prototype.getNorth=function(){return this._ne.lat};i.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]};i.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"};i.convert=function(n){return!n||n instanceof i?n:new i(n)};t.exports=i},{"./lng_lat":68}],70:[function(n,t){"use strict";var o=n("./lng_lat"),f=n("@mapbox/point-geometry"),h=n("./coordinate"),c=n("../util/util"),l=n("../style-spec/util/interpolate"),a=n("../source/tile_coord"),v=n("../data/extent"),s=n("@mapbox/gl-matrix"),e=s.vec4,u=s.mat4,y=s.mat2,i=function(n,t,i){this.tileSize=512;this._renderWorldCopies=void 0===i||i;this._minZoom=n||0;this._maxZoom=t||22;this.latRange=[-85.05113,85.05113];this.width=0;this.height=0;this._center=new o(0,0);this.zoom=0;this.angle=0;this._fov=.64350110879328437;this._pitch=0;this._unmodified=!0},r={minZoom:{},maxZoom:{},renderWorldCopies:{},worldSize:{},centerPoint:{},size:{},bearing:{},pitch:{},fov:{},zoom:{},center:{},unmodified:{},x:{},y:{},point:{}};r.minZoom.get=function(){return this._minZoom};r.minZoom.set=function(n){this._minZoom!==n&&(this._minZoom=n,this.zoom=Math.max(this.zoom,n))};r.maxZoom.get=function(){return this._maxZoom};r.maxZoom.set=function(n){this._maxZoom!==n&&(this._maxZoom=n,this.zoom=Math.min(this.zoom,n))};r.renderWorldCopies.get=function(){return this._renderWorldCopies};r.worldSize.get=function(){return this.tileSize*this.scale};r.centerPoint.get=function(){return this.size._div(2)};r.size.get=function(){return new f(this.width,this.height)};r.bearing.get=function(){return-this.angle/Math.PI*180};r.bearing.set=function(n){var t=-c.wrap(n,-180,180)*Math.PI/180;this.angle!==t&&(this._unmodified=!1,this.angle=t,this._calcMatrices(),this.rotationMatrix=y.create(),y.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))};r.pitch.get=function(){return this._pitch/Math.PI*180};r.pitch.set=function(n){var t=c.clamp(n,0,60)/180*Math.PI;this._pitch!==t&&(this._unmodified=!1,this._pitch=t,this._calcMatrices())};r.fov.get=function(){return this._fov/Math.PI*180};r.fov.set=function(n){n=Math.max(.01,Math.min(60,n));this._fov!==n&&(this._unmodified=!1,this._fov=n/180*Math.PI,this._calcMatrices())};r.zoom.get=function(){return this._zoom};r.zoom.set=function(n){var t=Math.min(Math.max(n,this.minZoom),this.maxZoom);this._zoom!==t&&(this._unmodified=!1,this._zoom=t,this.scale=this.zoomScale(t),this.tileZoom=Math.floor(t),this.zoomFraction=t-this.tileZoom,this._constrain(),this._calcMatrices())};r.center.get=function(){return this._center};r.center.set=function(n){n.lat===this._center.lat&&n.lng===this._center.lng||(this._unmodified=!1,this._center=n,this._constrain(),this._calcMatrices())};i.prototype.coveringZoomLevel=function(n){return(n.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/n.tileSize))};i.prototype.getVisibleWrappedCoordinates=function(n){for(var r=this.pointCoordinate(new f(0,0),0),u=this.pointCoordinate(new f(this.width,0),0),e=Math.floor(r.column),o=Math.floor(u.column),i=[n],t=e;t<=o;t++)0!==t&&i.push(new a(n.z,n.x,n.y,t));return i};i.prototype.coveringTiles=function(n){var t=this.coveringZoomLevel(n),u=t;if(void 0!==n.minzoom&&t<n.minzoom)return[];void 0!==n.maxzoom&&t>n.maxzoom&&(t=n.maxzoom);var i=this.pointCoordinate(this.centerPoint,t),r=new f(i.column-.5,i.row-.5),e=[this.pointCoordinate(new f(0,0),t),this.pointCoordinate(new f(this.width,0),t),this.pointCoordinate(new f(this.width,this.height),t),this.pointCoordinate(new f(0,this.height),t)];return a.cover(t,e,n.reparseOverscaled?u:t,this._renderWorldCopies).sort(function(n,t){return r.dist(n)-r.dist(t)})};i.prototype.resize=function(n,t){this.width=n;this.height=t;this.pixelsToGLUnits=[2/n,-2/t];this._constrain();this._calcMatrices()};r.unmodified.get=function(){return this._unmodified};i.prototype.zoomScale=function(n){return Math.pow(2,n)};i.prototype.scaleZoom=function(n){return Math.log(n)/Math.LN2};i.prototype.project=function(n){return new f(this.lngX(n.lng),this.latY(n.lat))};i.prototype.unproject=function(n){return new o(this.xLng(n.x),this.yLat(n.y))};r.x.get=function(){return this.lngX(this.center.lng)};r.y.get=function(){return this.latY(this.center.lat)};r.point.get=function(){return new f(this.x,this.y)};i.prototype.lngX=function(n){return(180+n)*this.worldSize/360};i.prototype.latY=function(n){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+n*Math.PI/360)))*this.worldSize/360};i.prototype.xLng=function(n){return 360*n/this.worldSize-180};i.prototype.yLat=function(n){var t=180-360*n/this.worldSize;return 360/Math.PI*Math.atan(Math.exp(t*Math.PI/180))-90};i.prototype.setLocationAtPoint=function(n,t){var i=this.pointCoordinate(t)._sub(this.pointCoordinate(this.centerPoint));this.center=this.coordinateLocation(this.locationCoordinate(n)._sub(i));this._renderWorldCopies&&(this.center=this.center.wrap())};i.prototype.locationPoint=function(n){return this.coordinatePoint(this.locationCoordinate(n))};i.prototype.pointLocation=function(n){return this.coordinateLocation(this.pointCoordinate(n))};i.prototype.locationCoordinate=function(n){return new h(this.lngX(n.lng)/this.tileSize,this.latY(n.lat)/this.tileSize,this.zoom).zoomTo(this.tileZoom)};i.prototype.coordinateLocation=function(n){var t=n.zoomTo(this.zoom);return new o(this.xLng(t.column*this.tileSize),this.yLat(t.row*this.tileSize))};i.prototype.pointCoordinate=function(n,t){var i,r;void 0===t&&(t=this.tileZoom);i=[n.x,n.y,0,1];r=[n.x,n.y,1,1];e.transformMat4(i,i,this.pixelMatrixInverse);e.transformMat4(r,r,this.pixelMatrixInverse);var u=i[3],f=r[3],a=i[0]/u,v=r[0]/f,y=i[1]/u,p=r[1]/f,o=i[2]/u,s=r[2]/f,c=o===s?0:(0-o)/(s-o);return new h(l(a,v,c)/this.tileSize,l(y,p,c)/this.tileSize,this.zoom)._zoomTo(t)};i.prototype.coordinatePoint=function(n){var i=n.zoomTo(this.zoom),t=[i.column*this.tileSize,i.row*this.tileSize,0,1];return e.transformMat4(t,t,this.pixelMatrix),new f(t[0]/t[3],t[1]/t[3])};i.prototype.calculatePosMatrix=function(n,t){var f=n.toCoordinate(t),r=this.worldSize/this.zoomScale(f.zoom),i=u.identity(new Float64Array(16));return u.translate(i,i,[f.column*r,f.row*r,0]),u.scale(i,i,[r/v,r/v,1]),u.multiply(i,this.projMatrix,i),new Float32Array(i)};i.prototype.cameraToTileDistance=function(n){var i=this.calculatePosMatrix(n.coord,n.sourceMaxZoom),t=[n.tileSize/2,n.tileSize/2,0,1];return e.transformMat4(t,t,i),t[3]};i.prototype._constrain=function(){var a,v,y,p,s,w,h;if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var c,l,e,o,n=-90,t=90,i=-180,r=180,u=this.size,b=this._unmodified;if(this.latRange&&(a=this.latRange,n=this.latY(a[1]),t=this.latY(a[0]),c=t-n<u.y?u.y/(t-n):0),this.lngRange&&(v=this.lngRange,i=this.lngX(v[0]),r=this.lngX(v[1]),l=r-i<u.x?u.x/(r-i):0),y=Math.max(l||0,c||0),y)return this.center=this.unproject(new f(l?(r+i)/2:this.x,c?(t+n)/2:this.y)),this.zoom+=this.scaleZoom(y),this._unmodified=b,void(this._constraining=!1);this.latRange&&(p=this.y,s=u.y/2,p-s<n&&(o=n+s),p+s>t&&(o=t-s));this.lngRange&&(w=this.x,h=u.x/2,w-h<i&&(e=i+h),w+h>r&&(e=r-h));void 0===e&&void 0===o||(this.center=this.unproject(new f(void 0!==e?e:this.x,void 0!==o?o:this.y)));this._unmodified=b;this._constraining=!1}};i.prototype._calcMatrices=function(){var i;if(this.height){this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var t=this._fov/2,r=Math.PI/2+this._pitch,f=Math.sin(t)*this.cameraToCenterDistance/Math.sin(Math.PI-r-t),e=Math.cos(Math.PI/2-this._pitch)*f+this.cameraToCenterDistance,o=1.01*e,n=new Float64Array(16);if(u.perspective(n,this._fov,this.width/this.height,1,o),u.scale(n,n,[1,-1,1]),u.translate(n,n,[0,0,-this.cameraToCenterDistance]),u.rotateX(n,n,this._pitch),u.rotateZ(n,n,this.angle),u.translate(n,n,[-this.x,-this.y,0]),i=this.worldSize/(12756274*Math.PI*Math.abs(Math.cos(this.center.lat*(Math.PI/180)))),u.scale(n,n,[1,1,i,1]),this.projMatrix=n,n=u.create(),u.scale(n,n,[this.width/2,-this.height/2,1]),u.translate(n,n,[1,-1,0]),this.pixelMatrix=u.multiply(new Float64Array(16),n,this.projMatrix),!(n=u.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=n}};Object.defineProperties(i.prototype,r);t.exports=i},{"../data/extent":58,"../source/tile_coord":113,"../style-spec/util/interpolate":152,"../util/util":252,"./coordinate":67,"./lng_lat":68,"@mapbox/gl-matrix":1,"@mapbox/point-geometry":2}],71:[function(n,t){"use strict";var i=function(n,t){this.gl=n;this.buffer=n.createBuffer();void 0===n.extVertexArrayObject&&(n.extVertexArrayObject=n.getExtension("OES_vertex_array_object"));n.extVertexArrayObject&&n.extVertexArrayObject.bindVertexArrayOES(null);n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,this.buffer);n.bufferData(n.ELEMENT_ARRAY_BUFFER,t.arrayBuffer,n.STATIC_DRAW);delete t.arrayBuffer};i.prototype.bind=function(){this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,this.buffer)};i.prototype.destroy=function(){this.buffer&&(this.gl.deleteBuffer(this.buffer),delete this.buffer)};t.exports=i},{}],72:[function(n,t){"use strict";var r={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},i=function(n,t,i){this.length=t.length;this.attributes=t.members;this.itemSize=t.bytesPerElement;this.dynamicDraw=i;this.gl=n;this.buffer=n.createBuffer();this.gl.bindBuffer(n.ARRAY_BUFFER,this.buffer);this.gl.bufferData(n.ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW);this.dynamicDraw||delete t.arrayBuffer};i.prototype.bind=function(){this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.buffer)};i.prototype.updateData=function(n){this.bind();this.gl.bufferSubData(this.gl.ARRAY_BUFFER,0,n.arrayBuffer)};i.prototype.enableAttributes=function(n,t){for(var f,r,u=this,i=0;i<this.attributes.length;i++)f=u.attributes[i],r=t.attributes[f.name],void 0!==r&&n.enableVertexAttribArray(r)};i.prototype.setVertexAttribPointers=function(n,t,i){for(var u,o,f=this,e=0;e<this.attributes.length;e++)u=f.attributes[e],o=t.attributes[u.name],void 0!==o&&n.vertexAttribPointer(o,u.components,n[r[u.type]],!1,f.itemSize,u.offset+f.itemSize*(i||0))};i.prototype.destroy=function(){this.buffer&&(this.gl.deleteBuffer(this.buffer),delete this.buffer)};t.exports=i},{}],73:[function(n,t){"use strict";var r=n("mapbox-gl-supported"),u=n("./util/browser"),f=n("../package.json").version,e=n("./ui/map"),o=n("./ui/control/navigation_control"),s=n("./ui/control/geolocate_control"),h=n("./ui/control/attribution_control"),c=n("./ui/control/scale_control"),l=n("./ui/control/fullscreen_control"),a=n("./ui/popup"),v=n("./ui/marker"),y=n("./style/style"),p=n("./geo/lng_lat"),w=n("./geo/lng_lat_bounds"),b=n("@mapbox/point-geometry"),k=n("./util/evented"),i=n("./util/config"),d=n("./source/rtl_text_plugin");t.exports={version:f,supported:r,workerCount:Math.max(Math.floor(u.hardwareConcurrency/2),1),setRTLTextPlugin:d.setRTLTextPlugin,Map:e,NavigationControl:o,GeolocateControl:s,AttributionControl:h,ScaleControl:c,FullscreenControl:l,Popup:a,Marker:v,Style:y,LngLat:p,LngLatBounds:w,Point:b,Evented:k,config:i,get accessToken(){return i.ACCESS_TOKEN},set accessToken(n){i.ACCESS_TOKEN=n}}},{"../package.json":50,"./geo/lng_lat":68,"./geo/lng_lat_bounds":69,"./source/rtl_text_plugin":108,"./style/style":182,"./ui/control/attribution_control":211,"./ui/control/fullscreen_control":212,"./ui/control/geolocate_control":213,"./ui/control/navigation_control":215,"./ui/control/scale_control":216,"./ui/map":226,"./ui/marker":227,"./ui/popup":228,"./util/browser":231,"./util/config":235,"./util/evented":239,"@mapbox/point-geometry":2,"mapbox-gl-supported":37}],74:[function(n,t){"use strict";function r(n,t,r){var f,s;if(!r.isOpacityZero(n.transform.zoom)){var u=n.gl,h=n.transform,c=h.tileSize,l=r.paint["background-color"],e=r.paint["background-pattern"],a=r.paint["background-opacity"],y=e||1!==l[3]||1!==a?"translucent":"opaque";if(n.renderPass===y){if(u.disable(u.STENCIL_TEST),n.setDepthSublayer(0),e){if(i.isPatternMissing(e,n))return;f=n.useProgram("fillPattern",n.basicFillProgramConfiguration);i.prepare(e,n,f);n.tileExtentPatternVAO.bind(u,f,n.tileExtentBuffer)}else f=n.useProgram("fill",n.basicFillProgramConfiguration),u.uniform4fv(f.uniforms.u_color,l),n.tileExtentVAO.bind(u,f,n.tileExtentBuffer);u.uniform1f(f.uniforms.u_opacity,a);for(var p=h.coveringTiles({tileSize:c}),o=0,v=p;o<v.length;o+=1)s=v[o],e&&i.setTile({coord:s,tileSize:c},n,f),u.uniformMatrix4fv(f.uniforms.u_matrix,!1,n.transform.calculatePosMatrix(s)),u.drawArrays(u.TRIANGLE_STRIP,0,n.tileExtentBuffer.length)}}}var i=n("./pattern");t.exports=r},{"./pattern":91}],75:[function(n,t){"use strict";function i(n,t,i,u){var f,s,h,e,l;if("translucent"===n.renderPass&&!i.isOpacityZero(n.transform.zoom))for(f=n.gl,n.setDepthSublayer(0),n.depthMask(!1),f.disable(f.STENCIL_TEST),s=0;s<u.length;s++){var a=u[s],c=t.getTile(a),o=c.getBucket(i);o&&(h=o.programConfigurations.get(i.id),e=n.useProgram("circle",h),(h.setUniforms(f,e,i,{zoom:n.transform.zoom}),f.uniform1f(e.uniforms.u_camera_to_center_distance,n.transform.cameraToCenterDistance),f.uniform1i(e.uniforms.u_scale_with_map,"map"===i.paint["circle-pitch-scale"]?1:0),"map"===i.paint["circle-pitch-alignment"])?(f.uniform1i(e.uniforms.u_pitch_with_map,1),l=r(c,1,n.transform.zoom),f.uniform2f(e.uniforms.u_extrude_scale,l,l)):(f.uniform1i(e.uniforms.u_pitch_with_map,0),f.uniform2fv(e.uniforms.u_extrude_scale,n.transform.pixelsToGLUnits)),f.uniformMatrix4fv(e.uniforms.u_matrix,!1,n.translatePosMatrix(a.posMatrix,c,i.paint["circle-translate"],i.paint["circle-translate-anchor"])),e.draw(f,f.TRIANGLES,i.id,o.layoutVertexBuffer,o.indexBuffer,o.segments,h))}}var r=n("../source/pixels_to_tile_units");t.exports=i},{"../source/pixels_to_tile_units":105}],76:[function(n,t){"use strict";function i(n,t,i,r){var u=n.gl,f,o,c;for(u.enable(u.STENCIL_TEST),f=n.useProgram("collisionBox"),u.activeTexture(u.TEXTURE1),n.frameHistory.bind(u),u.uniform1i(f.uniforms.u_fadetexture,1),o=0;o<r.length;o++){var h=r[o],e=t.getTile(h),s=e.getBucket(i);s&&(u.uniformMatrix4fv(f.uniforms.u_matrix,!1,h.posMatrix),n.enableTileClippingMask(h),n.lineWidth(1),u.uniform1f(f.uniforms.u_scale,Math.pow(2,n.transform.zoom-e.coord.z)),u.uniform1f(f.uniforms.u_zoom,10*n.transform.zoom),c=Math.max(0,Math.min(25,e.coord.z+Math.log(e.collisionTile.maxScale)/Math.LN2)),u.uniform1f(f.uniforms.u_maxzoom,10*c),u.uniform1f(f.uniforms.u_collision_y_stretch,e.collisionTile.yStretch),u.uniform1f(f.uniforms.u_pitch,n.transform.pitch/180*Math.PI),u.uniform1f(f.uniforms.u_camera_to_center_distance,n.transform.cameraToCenterDistance),f.draw(u,u.LINES,i.id,s.collisionBox.layoutVertexBuffer,s.collisionBox.indexBuffer,s.collisionBox.segments))}}t.exports=i},{}],77:[function(n,t){"use strict";function r(n,t,i){for(var r=0;r<i.length;r++)u(n,t,i[r])}function u(n,t,i){var r=n.gl,a,u,y,b;r.disable(r.STENCIL_TEST);n.lineWidth(1*e.devicePixelRatio);a=i.posMatrix;u=n.useProgram("debug");r.uniformMatrix4fv(u.uniforms.u_matrix,!1,a);r.uniform4f(u.uniforms.u_color,1,0,0,1);n.debugVAO.bind(r,u,n.debugBuffer);r.drawArrays(r.LINE_STRIP,0,n.debugBuffer.length);for(var p=f(i.toString(),50,200,5),k=new l,v=0;v<p.length;v+=2)k.emplaceBack(p[v],p[v+1]);y=new h(r,k);(new c).bind(r,u,y);r.uniform4f(u.uniforms.u_color,1,1,1,1);for(var nt=t.getTile(i).tileSize,d=s/(Math.pow(2,n.transform.zoom-i.z)*nt),g=[[-1,-1],[-1,1],[1,-1],[1,1]],w=0;w<g.length;w++)b=g[w],r.uniformMatrix4fv(u.uniforms.u_matrix,!1,o.translate([],a,[d*b[0],d*b[1],0])),r.drawArrays(r.LINES,0,y.length);r.uniform4f(u.uniforms.u_color,0,0,0,1);r.uniformMatrix4fv(u.uniforms.u_matrix,!1,a);r.drawArrays(r.LINES,0,y.length)}function f(n,t,r,u){u=u||1;for(var f,a,e,h,c,o,v=[],s=0,l=n.length;s<l;s++)if(e=i[n[s]]){for(o=null,f=0,a=e[1].length;f<a;f+=2)-1===e[1][f]&&-1===e[1][f+1]?o=null:(h=t+e[1][f]*u,c=r-e[1][f+1]*u,o&&v.push(o.x,o.y,h,c),o={x:h,y:c});t+=e[0]*u}return v}var e=n("../util/browser"),o=n("@mapbox/gl-matrix").mat4,s=n("../data/extent"),h=n("../gl/vertex_buffer"),c=n("./vertex_array_object"),l=n("../data/pos_array"),i;t.exports=r;i={" ":[16,[]],"!":[10,[5,21,5,7,-1,-1,5,2,4,1,5,0,6,1,5,2]],'"':[16,[4,21,4,14,-1,-1,12,21,12,14]],"#":[21,[11,25,4,-7,-1,-1,17,25,10,-7,-1,-1,4,12,18,12,-1,-1,3,6,17,6]],$:[20,[8,25,8,-4,-1,-1,12,25,12,-4,-1,-1,17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],"%":[24,[21,21,3,0,-1,-1,8,21,10,19,10,17,9,15,7,14,5,14,3,16,3,18,4,20,6,21,8,21,10,20,13,19,16,19,19,20,21,21,-1,-1,17,7,15,6,14,4,14,2,16,0,18,0,20,1,21,3,21,5,19,7,17,7]],"&":[26,[23,12,23,13,22,14,21,14,20,13,19,11,17,6,15,3,13,1,11,0,7,0,5,1,4,2,3,4,3,6,4,8,5,9,12,13,13,14,14,16,14,18,13,20,11,21,9,20,8,18,8,16,9,13,11,10,16,3,18,1,20,0,22,0,23,1,23,2]],"'":[10,[5,19,4,20,5,21,6,20,6,18,5,16,4,15]],"(":[14,[11,25,9,23,7,20,5,16,4,11,4,7,5,2,7,-2,9,-5,11,-7]],")":[14,[3,25,5,23,7,20,9,16,10,11,10,7,9,2,7,-2,5,-5,3,-7]],"*":[16,[8,21,8,9,-1,-1,3,18,13,12,-1,-1,13,18,3,12]],"+":[26,[13,18,13,0,-1,-1,4,9,22,9]],",":[10,[6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],"-":[26,[4,9,22,9]],".":[10,[5,2,4,1,5,0,6,1,5,2]],"/":[22,[20,25,2,-7]],0:[20,[9,21,6,20,4,17,3,12,3,9,4,4,6,1,9,0,11,0,14,1,16,4,17,9,17,12,16,17,14,20,11,21,9,21]],1:[20,[6,17,8,18,11,21,11,0]],2:[20,[4,16,4,17,5,19,6,20,8,21,12,21,14,20,15,19,16,17,16,15,15,13,13,10,3,0,17,0]],3:[20,[5,21,16,21,10,13,13,13,15,12,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],4:[20,[13,21,3,7,18,7,-1,-1,13,21,13,0]],5:[20,[15,21,5,21,4,12,5,13,8,14,11,14,14,13,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],6:[20,[16,18,15,20,12,21,10,21,7,20,5,17,4,12,4,7,5,3,7,1,10,0,11,0,14,1,16,3,17,6,17,7,16,10,14,12,11,13,10,13,7,12,5,10,4,7]],7:[20,[17,21,7,0,-1,-1,3,21,17,21]],8:[20,[8,21,5,20,4,18,4,16,5,14,7,13,11,12,14,11,16,9,17,7,17,4,16,2,15,1,12,0,8,0,5,1,4,2,3,4,3,7,4,9,6,11,9,12,13,13,15,14,16,16,16,18,15,20,12,21,8,21]],9:[20,[16,14,15,11,13,9,10,8,9,8,6,9,4,11,3,14,3,15,4,18,6,20,9,21,10,21,13,20,15,18,16,14,16,9,15,4,13,1,10,0,8,0,5,1,4,3]],":":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,5,2,4,1,5,0,6,1,5,2]],";":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],"<":[24,[20,18,4,9,20,0]],"=":[26,[4,12,22,12,-1,-1,4,6,22,6]],">":[24,[4,18,20,9,4,0]],"?":[18,[3,16,3,17,4,19,5,20,7,21,11,21,13,20,14,19,15,17,15,15,14,13,13,12,9,10,9,7,-1,-1,9,2,8,1,9,0,10,1,9,2]],"@":[27,[18,13,17,15,15,16,12,16,10,15,9,14,8,11,8,8,9,6,11,5,14,5,16,6,17,8,-1,-1,12,16,10,14,9,11,9,8,10,6,11,5,-1,-1,18,16,17,8,17,6,19,5,21,5,23,7,24,10,24,12,23,15,22,17,20,19,18,20,15,21,12,21,9,20,7,19,5,17,4,15,3,12,3,9,4,6,5,4,7,2,9,1,12,0,15,0,18,1,20,2,21,3,-1,-1,19,16,18,8,18,6,19,5]],A:[18,[9,21,1,0,-1,-1,9,21,17,0,-1,-1,4,7,14,7]],B:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,-1,-1,4,11,13,11,16,10,17,9,18,7,18,4,17,2,16,1,13,0,4,0]],C:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5]],D:[21,[4,21,4,0,-1,-1,4,21,11,21,14,20,16,18,17,16,18,13,18,8,17,5,16,3,14,1,11,0,4,0]],E:[19,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11,-1,-1,4,0,17,0]],F:[18,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11]],G:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,18,8,-1,-1,13,8,18,8]],H:[22,[4,21,4,0,-1,-1,18,21,18,0,-1,-1,4,11,18,11]],I:[8,[4,21,4,0]],J:[16,[12,21,12,5,11,2,10,1,8,0,6,0,4,1,3,2,2,5,2,7]],K:[21,[4,21,4,0,-1,-1,18,21,4,7,-1,-1,9,12,18,0]],L:[17,[4,21,4,0,-1,-1,4,0,16,0]],M:[24,[4,21,4,0,-1,-1,4,21,12,0,-1,-1,20,21,12,0,-1,-1,20,21,20,0]],N:[22,[4,21,4,0,-1,-1,4,21,18,0,-1,-1,18,21,18,0]],O:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21]],P:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,14,17,12,16,11,13,10,4,10]],Q:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21,-1,-1,12,4,18,-2]],R:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,4,11,-1,-1,11,11,18,0]],S:[20,[17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],T:[16,[8,21,8,0,-1,-1,1,21,15,21]],U:[22,[4,21,4,6,5,3,7,1,10,0,12,0,15,1,17,3,18,6,18,21]],V:[18,[1,21,9,0,-1,-1,17,21,9,0]],W:[24,[2,21,7,0,-1,-1,12,21,7,0,-1,-1,12,21,17,0,-1,-1,22,21,17,0]],X:[20,[3,21,17,0,-1,-1,17,21,3,0]],Y:[18,[1,21,9,11,9,0,-1,-1,17,21,9,11]],Z:[20,[17,21,3,0,-1,-1,3,21,17,21,-1,-1,3,0,17,0]],"[":[14,[4,25,4,-7,-1,-1,5,25,5,-7,-1,-1,4,25,11,25,-1,-1,4,-7,11,-7]],"\\":[14,[0,21,14,-3]],"]":[14,[9,25,9,-7,-1,-1,10,25,10,-7,-1,-1,3,25,10,25,-1,-1,3,-7,10,-7]],"^":[16,[6,15,8,18,10,15,-1,-1,3,12,8,17,13,12,-1,-1,8,17,8,0]],_:[16,[0,-2,16,-2]],"`":[10,[6,21,5,20,4,18,4,16,5,15,6,16,5,17]],a:[19,[15,14,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],b:[19,[4,21,4,0,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],c:[18,[15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],d:[19,[15,21,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],e:[18,[3,8,15,8,15,10,14,12,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],f:[12,[10,21,8,21,6,20,5,17,5,0,-1,-1,2,14,9,14]],g:[19,[15,14,15,-2,14,-5,13,-6,11,-7,8,-7,6,-6,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],h:[19,[4,21,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],i:[8,[3,21,4,20,5,21,4,22,3,21,-1,-1,4,14,4,0]],j:[10,[5,21,6,20,7,21,6,22,5,21,-1,-1,6,14,6,-3,5,-6,3,-7,1,-7]],k:[17,[4,21,4,0,-1,-1,14,14,4,4,-1,-1,8,8,15,0]],l:[8,[4,21,4,0]],m:[30,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0,-1,-1,15,10,18,13,20,14,23,14,25,13,26,10,26,0]],n:[19,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],o:[19,[8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3,16,6,16,8,15,11,13,13,11,14,8,14]],p:[19,[4,14,4,-7,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],q:[19,[15,14,15,-7,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],r:[13,[4,14,4,0,-1,-1,4,8,5,11,7,13,9,14,12,14]],s:[17,[14,11,13,13,10,14,7,14,4,13,3,11,4,9,6,8,11,7,13,6,14,4,14,3,13,1,10,0,7,0,4,1,3,3]],t:[12,[5,21,5,4,6,1,8,0,10,0,-1,-1,2,14,9,14]],u:[19,[4,14,4,4,5,1,7,0,10,0,12,1,15,4,-1,-1,15,14,15,0]],v:[16,[2,14,8,0,-1,-1,14,14,8,0]],w:[22,[3,14,7,0,-1,-1,11,14,7,0,-1,-1,11,14,15,0,-1,-1,19,14,15,0]],x:[17,[3,14,14,0,-1,-1,14,14,3,0]],y:[16,[2,14,8,0,-1,-1,14,14,8,0,6,-4,4,-6,2,-7,1,-7]],z:[17,[14,14,3,0,-1,-1,3,14,14,14,-1,-1,3,0,14,0]],"{":[14,[9,25,7,24,6,23,5,21,5,19,6,17,7,16,8,14,8,12,6,10,-1,-1,7,24,6,22,6,20,7,18,8,17,9,15,9,13,8,11,4,9,8,7,9,5,9,3,8,1,7,0,6,-2,6,-4,7,-6,-1,-1,6,8,8,6,8,4,7,2,6,1,5,-1,5,-3,6,-5,7,-6,9,-7]],"|":[8,[4,25,4,-7]],"}":[14,[5,25,7,24,8,23,9,21,9,19,8,17,7,16,6,14,6,12,8,10,-1,-1,7,24,8,22,8,20,7,18,6,17,5,15,5,13,6,11,10,9,6,7,5,5,5,3,6,1,7,0,8,-2,8,-4,7,-6,-1,-1,8,8,6,6,6,4,7,2,8,1,9,-1,9,-3,8,-5,7,-6,5,-7]],"~":[24,[3,6,3,8,4,11,6,12,8,12,10,11,14,8,16,7,18,7,20,8,21,10,-1,-1,3,8,4,10,6,11,8,11,10,10,14,7,16,6,18,6,20,7,21,10,21,12]]}},{"../data/extent":58,"../data/pos_array":62,"../gl/vertex_buffer":72,"../util/browser":231,"./vertex_array_object":96,"@mapbox/gl-matrix":1}],78:[function(n,t){"use strict";function f(n,t,i,u){var f,s;i.isOpacityZero(n.transform.zoom)||(f=n.gl,f.enable(f.STENCIL_TEST),s=!i.paint["fill-pattern"]&&i.isPaintValueFeatureConstant("fill-color")&&i.isPaintValueFeatureConstant("fill-opacity")&&1===i.paint["fill-color"][3]&&1===i.paint["fill-opacity"]?"opaque":"translucent",n.renderPass===s&&(n.setDepthSublayer(1),n.depthMask("opaque"===n.renderPass),r(n,t,i,u,e)),"translucent"===n.renderPass&&i.paint["fill-antialias"]&&(n.lineWidth(2),n.depthMask(!1),n.setDepthSublayer(i.getPaintProperty("fill-outline-color")?2:0),r(n,t,i,u,o)))}function r(n,t,r,u,f){if(!i.isPatternMissing(r.paint["fill-pattern"],n))for(var s=!0,e=0,h=u;e<h.length;e+=1){var o=h[e],c=t.getTile(o),l=c.getBucket(r);l&&(n.enableTileClippingMask(o),f(n,t,r,c,o,l,s),s=!1)}}function e(n,t,i,r,f,e,o){var s=n.gl,h=e.programConfigurations.get(i.id);u("fill",i.paint["fill-pattern"],n,h,i,r,f,o).draw(s,s.TRIANGLES,i.id,e.layoutVertexBuffer,e.indexBuffer,e.segments,h)}function o(n,t,i,r,f,e,o){var s=n.gl,h=e.programConfigurations.get(i.id),l=i.paint["fill-pattern"]&&!i.getPaintProperty("fill-outline-color"),c=u("fillOutline",l,n,h,i,r,f,o);s.uniform2f(c.uniforms.u_world,s.drawingBufferWidth,s.drawingBufferHeight);c.draw(s,s.LINES,i.id,e.layoutVertexBuffer,e.indexBuffer2,e.segments2,h)}function u(n,t,r,u,f,e,o,s){var h,c=r.currentProgram;return t?(h=r.useProgram(n+"Pattern",u),(s||h!==c)&&(u.setUniforms(r.gl,h,f,{zoom:r.transform.zoom}),i.prepare(f.paint["fill-pattern"],r,h)),i.setTile(e,r,h)):(h=r.useProgram(n,u),(s||h!==c)&&u.setUniforms(r.gl,h,f,{zoom:r.transform.zoom})),r.gl.uniformMatrix4fv(h.uniforms.u_matrix,!1,r.translatePosMatrix(o.posMatrix,e,f.paint["fill-translate"],f.paint["fill-translate-anchor"])),h}var i=n("./pattern");t.exports=f},{"./pattern":91}],79:[function(n,t){"use strict";function e(n,t,i,r){var u,f;if(!i.isOpacityZero(n.transform.zoom))if("3d"===n.renderPass)for(u=n.gl,u.disable(u.STENCIL_TEST),u.enable(u.DEPTH_TEST),n.clearColor(),n.depthMask(!0),f=0;f<r.length;f++)s(n,t,i,r[f]);else"translucent"===n.renderPass&&o(n,i)}function o(n,t){var e=t.viewportFrame,i,r,u;e&&(i=n.gl,r=n.useProgram("extrusionTexture"),i.disable(i.STENCIL_TEST),i.disable(i.DEPTH_TEST),i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,e.texture),i.uniform1f(r.uniforms.u_opacity,t.paint["fill-extrusion-opacity"]),i.uniform1i(r.uniforms.u_image,0),u=f.create(),f.ortho(u,0,n.width,n.height,0,0,1),i.uniformMatrix4fv(r.uniforms.u_matrix,!1,u),i.uniform2f(r.uniforms.u_world,i.drawingBufferWidth,i.drawingBufferHeight),n.viewportVAO.bind(i,r,n.viewportBuffer),i.drawArrays(i.TRIANGLE_STRIP,0,4))}function s(n,t,i,u){var o=t.getTile(u),e=o.getBucket(i);if(e){var s=n.gl,c=i.paint["fill-extrusion-pattern"],l=e.programConfigurations.get(i.id),f=n.useProgram(c?"fillExtrusionPattern":"fillExtrusion",l);if(l.setUniforms(s,f,i,{zoom:n.transform.zoom}),c){if(r.isPatternMissing(c,n))return;r.prepare(c,n,f);r.setTile(o,n,f);s.uniform1f(f.uniforms.u_height_factor,-Math.pow(2,u.z)/o.tileSize/8)}n.gl.uniformMatrix4fv(f.uniforms.u_matrix,!1,n.translatePosMatrix(u.posMatrix,o,i.paint["fill-extrusion-translate"],i.paint["fill-extrusion-translate-anchor"]));h(f,n);f.draw(s,s.TRIANGLES,i.id,e.layoutVertexBuffer,e.indexBuffer,e.segments,l)}}function h(n,t){var r=t.gl,i=t.style.light,f=i.calculated.position,e=[f.x,f.y,f.z],o=u.create();"viewport"===i.calculated.anchor&&u.fromRotation(o,-t.transform.angle);c.transformMat3(e,e,o);r.uniform3fv(n.uniforms.u_lightpos,e);r.uniform1f(n.uniforms.u_lightintensity,i.calculated.intensity);r.uniform3fv(n.uniforms.u_lightcolor,i.calculated.color.slice(0,3))}var i=n("@mapbox/gl-matrix"),r=n("./pattern"),u=i.mat3,f=i.mat4,c=i.vec3;t.exports=e},{"./pattern":91,"@mapbox/gl-matrix":1}],80:[function(n,t){"use strict";function u(n,t,i,r){var u,c,l,v,o;if(!n.isOpaquePass&&!i.isOpacityZero(n.transform.zoom)){for(u=n.gl,n.setDepthSublayer(0),n.depthMask(!1),u.disable(u.STENCIL_TEST),f(u,n,i),u.clearColor(0,0,0,0),u.clear(u.COLOR_BUFFER_BIT),u.blendFunc(u.ONE,u.ONE),c=0;c<r.length;c++)if(l=r[c],!t.hasRenderableParent(l)&&(v=t.getTile(l),o=v.getBucket(i),o)){var y=o.programConfigurations.get(i.id),h=n.useProgram("heatmap",y),p=n.transform,a=p.zoom;y.setUniforms(u,h,i,{zoom:a});u.uniform1f(h.uniforms.u_radius,i.getPaintValue("heatmap-radius",{zoom:a}));u.uniform1f(h.uniforms.u_extrude_scale,s(v,1,a));u.uniform1f(h.uniforms.u_intensity,i.getPaintValue("heatmap-intensity",{zoom:a}));u.uniformMatrix4fv(h.uniforms.u_matrix,!1,l.posMatrix);h.draw(u,u.TRIANGLES,i.id,o.layoutVertexBuffer,o.indexBuffer,o.segments,y)}e(u,n,i)}}function f(n,t,r){n.activeTexture(n.TEXTURE1);n.viewport(0,0,t.width/4,t.height/4);var u=r.heatmapTexture,f=r.heatmapFbo;u?(n.bindTexture(n.TEXTURE_2D,u),n.bindFramebuffer(n.FRAMEBUFFER,f)):(u=r.heatmapTexture=n.createTexture(),n.bindTexture(n.TEXTURE_2D,u),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),f=r.heatmapFbo=n.createFramebuffer(),i(n,t,u,f))}function i(n,t,r,u){n.texImage2D(n.TEXTURE_2D,0,n.RGBA,t.width/4,t.height/4,0,n.RGBA,t.extTextureHalfFloat?t.extTextureHalfFloat.HALF_FLOAT_OES:n.UNSIGNED_BYTE,null);n.bindFramebuffer(n.FRAMEBUFFER,u);n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,r,0);t.extTextureHalfFloat&&n.checkFramebufferStatus(n.FRAMEBUFFER)!==n.FRAMEBUFFER_COMPLETE&&(t.extTextureHalfFloat=null,i(n,t,r,u))}function e(n,t,i){var f,u,s,e;n.bindFramebuffer(n.FRAMEBUFFER,null);n.activeTexture(n.TEXTURE2);f=i.colorRampTexture;f||(f=i.colorRampTexture=new o(n,i.colorRamp,n.RGBA));f.bind(n.LINEAR,n.CLAMP_TO_EDGE);n.blendFunc(n.ONE,n.ONE_MINUS_SRC_ALPHA);u=t.useProgram("heatmapTexture");n.viewport(0,0,t.width,t.height);n.activeTexture(n.TEXTURE0);n.bindTexture(n.TEXTURE_2D,i.heatmapTexture);s=i.getPaintValue("heatmap-opacity",{zoom:t.transform.zoom});n.uniform1f(u.uniforms.u_opacity,s);n.uniform1i(u.uniforms.u_image,1);n.uniform1i(u.uniforms.u_color_ramp,2);e=r.create();r.ortho(e,0,t.width,t.height,0,0,1);n.uniformMatrix4fv(u.uniforms.u_matrix,!1,e);n.disable(n.DEPTH_TEST);n.uniform2f(u.uniforms.u_world,n.drawingBufferWidth,n.drawingBufferHeight);t.viewportVAO.bind(n,u,t.viewportBuffer);n.drawArrays(n.TRIANGLE_STRIP,0,4);n.enable(n.DEPTH_TEST)}var r=n("@mapbox/gl-matrix").mat4,o=n("./texture"),s=n("../source/pixels_to_tile_units");t.exports=u},{"../source/pixels_to_tile_units":105,"./texture":94,"@mapbox/gl-matrix":1}],81:[function(n,t){"use strict";function r(n,t,r,f,e,o,s,h,c){var b,k,p,a,l=t.gl,v=e.paint["line-dasharray"],y=e.paint["line-pattern"],w,d,g,tt;if(h||c){if(w=1/i(r,1,t.transform.tileZoom),v)b=t.lineAtlas.getDash(v.from,"round"===e.layout["line-cap"]),k=t.lineAtlas.getDash(v.to,"round"===e.layout["line-cap"]),d=b.width*v.fromScale,g=k.width*v.toScale,l.uniform2f(n.uniforms.u_patternscale_a,w/d,-b.height/2),l.uniform2f(n.uniforms.u_patternscale_b,w/g,-k.height/2),l.uniform1f(n.uniforms.u_sdfgamma,t.lineAtlas.width/(256*Math.min(d,g)*u.devicePixelRatio)/2);else if(y){if(p=t.imageManager.getPattern(y.from),a=t.imageManager.getPattern(y.to),!p||!a)return;l.uniform2f(n.uniforms.u_pattern_size_a,p.displaySize[0]*y.fromScale/w,a.displaySize[1]);l.uniform2f(n.uniforms.u_pattern_size_b,a.displaySize[0]*y.toScale/w,a.displaySize[1]);var nt=t.imageManager.getPixelSize(),it=nt.width,rt=nt.height;l.uniform2fv(n.uniforms.u_texsize,[it,rt])}l.uniform2f(n.uniforms.u_gl_units_to_pixels,1/t.transform.pixelsToGLUnits[0],1/t.transform.pixelsToGLUnits[1])}h&&(v?(l.uniform1i(n.uniforms.u_image,0),l.activeTexture(l.TEXTURE0),t.lineAtlas.bind(l),l.uniform1f(n.uniforms.u_tex_y_a,b.y),l.uniform1f(n.uniforms.u_tex_y_b,k.y),l.uniform1f(n.uniforms.u_mix,v.t)):y&&(l.uniform1i(n.uniforms.u_image,0),l.activeTexture(l.TEXTURE0),t.imageManager.bind(l),l.uniform2fv(n.uniforms.u_pattern_tl_a,p.tl),l.uniform2fv(n.uniforms.u_pattern_br_a,p.br),l.uniform2fv(n.uniforms.u_pattern_tl_b,a.tl),l.uniform2fv(n.uniforms.u_pattern_br_b,a.br),l.uniform1f(n.uniforms.u_fade,y.t)));t.enableTileClippingMask(o);tt=t.translatePosMatrix(o.posMatrix,r,e.paint["line-translate"],e.paint["line-translate-anchor"]);l.uniformMatrix4fv(n.uniforms.u_matrix,!1,tt);l.uniform1f(n.uniforms.u_ratio,1/i(r,1,t.transform.zoom));n.draw(l,l.TRIANGLES,e.id,f.layoutVertexBuffer,f.indexBuffer,f.segments,s)}var u=n("../util/browser"),i=n("../source/pixels_to_tile_units");t.exports=function(n,t,i,u){var e;if("translucent"===n.renderPass&&!i.isOpacityZero(n.transform.zoom)&&(n.setDepthSublayer(0),n.depthMask(!1),e=n.gl,e.enable(e.STENCIL_TEST),!(i.paint["line-width"]<=0)))for(var l,w=i.paint["line-dasharray"]?"lineSDF":i.paint["line-pattern"]?"linePattern":"line",a=!0,o=0,v=u;o<v.length;o+=1){var y=v[o],f=t.getTile(y),s=f.getBucket(i);if(s){var h=s.programConfigurations.get(i.id),b=n.currentProgram,c=n.useProgram(w,h),p=a||c!==b,k=l!==f.coord.z;p&&h.setUniforms(n.gl,c,i,{zoom:n.transform.zoom});r(c,n,f,s,i,y,h,p,k);l=f.coord.z;a=!1}}}},{"../source/pixels_to_tile_units":105,"../util/browser":231}],82:[function(n,t){"use strict";function i(n,t,i,o){var a,l,g,b,k,it;if("translucent"===n.renderPass&&!i.isOpacityZero(n.transform.zoom)){var h=n.gl,p=t.getSource(),c=n.useProgram("raster");h.disable(h.DEPTH_TEST);n.depthMask(!1);h.disable(h.STENCIL_TEST);h.uniform1f(c.uniforms.u_brightness_low,i.paint["raster-brightness-min"]);h.uniform1f(c.uniforms.u_brightness_high,i.paint["raster-brightness-max"]);h.uniform1f(c.uniforms.u_saturation_factor,f(i.paint["raster-saturation"]));h.uniform1f(c.uniforms.u_contrast_factor,u(i.paint["raster-contrast"]));h.uniform3fv(c.uniforms.u_spin_weights,r(i.paint["raster-hue-rotate"]));h.uniform1f(c.uniforms.u_buffer_scale,1);h.uniform1i(c.uniforms.u_image0,0);h.uniform1i(c.uniforms.u_image1,1);for(var rt=o.length&&o[0].z,w=0,d=o;w<d.length;w+=1){a=d[w];n.setDepthSublayer(a.z-rt);l=t.getTile(a);g=n.transform.calculatePosMatrix(a,t.getSource().maxzoom);l.registerFadeDuration(n.style.animationLoop,i.paint["raster-fade-duration"]);h.uniformMatrix4fv(c.uniforms.u_matrix,!1,g);var v=t.findLoadedParent(a,0,{}),nt=e(l,v,t,i,n.transform),y=void 0,tt=void 0;(h.activeTexture(h.TEXTURE0),l.texture.bind(h.LINEAR,h.CLAMP_TO_EDGE,h.LINEAR_MIPMAP_NEAREST),h.activeTexture(h.TEXTURE1),v?(v.texture.bind(h.LINEAR,h.CLAMP_TO_EDGE,h.LINEAR_MIPMAP_NEAREST),y=Math.pow(2,v.coord.z-l.coord.z),tt=[l.coord.x*y%1,l.coord.y*y%1]):l.texture.bind(h.LINEAR,h.CLAMP_TO_EDGE,h.LINEAR_MIPMAP_NEAREST),h.uniform2fv(c.uniforms.u_tl_parent,tt||[0,0]),h.uniform1f(c.uniforms.u_scale_parent,y||1),h.uniform1f(c.uniforms.u_fade_t,nt.mix),h.uniform1f(c.uniforms.u_opacity,nt.opacity*i.paint["raster-opacity"]),p instanceof s)?(b=p.boundsBuffer,p.boundsVAO.bind(h,c,b),h.drawArrays(h.TRIANGLE_STRIP,0,b.length)):l.maskedBoundsBuffer&&l.maskedIndexBuffer&&l.segments?c.draw(h,h.TRIANGLES,i.id,l.maskedBoundsBuffer,l.maskedIndexBuffer,l.segments):(k=n.rasterBoundsBuffer,it=n.rasterBoundsVAO,it.bind(h,c,k),h.drawArrays(h.TRIANGLE_STRIP,0,k.length))}h.depthFunc(h.LEQUAL)}}function r(n){n*=Math.PI/180;var i=Math.sin(n),t=Math.cos(n);return[(2*t+1)/3,(-Math.sqrt(3)*i-t+1)/3,(Math.sqrt(3)*i-t+1)/3]}function u(n){return n>0?1/(1-n):1+n}function f(n){return n>0?1-1/(1.001-n):-n}function e(n,t,i,r,u){var f=r.paint["raster-fade-duration"];if(f>0){var e=Date.now(),s=(e-n.timeAdded)/f,v=t?(e-t.timeAdded)/f:-1,h=i.getSource(),c=u.coveringZoomLevel({tileSize:h.tileSize,roundZoom:h.roundZoom}),l=!t||Math.abs(t.coord.z-c)>Math.abs(n.coord.z-c),a=l&&n.refreshedUponExpiration?1:o.clamp(l?s:1-v,0,1);return n.refreshedUponExpiration&&s>=1&&(n.refreshedUponExpiration=!1),t?{opacity:1,mix:1-a}:{opacity:a,mix:0}}return{opacity:1,mix:0}}var o=n("../util/util"),s=n("../source/image_source");t.exports=i},{"../source/image_source":103,"../util/util":252}],83:[function(n,t){"use strict";function f(n,t,i,u){if("translucent"===n.renderPass){var e=!(i.layout["text-allow-overlap"]||i.layout["icon-allow-overlap"]||i.layout["text-ignore-placement"]||i.layout["icon-ignore-placement"]),f=n.gl;e?f.disable(f.STENCIL_TEST):f.enable(f.STENCIL_TEST);n.setDepthSublayer(0);n.depthMask(!1);i.isOpacityZero(n.transform.zoom,"icon-opacity")||r(n,t,i,u,!1,i.paint["icon-translate"],i.paint["icon-translate-anchor"],i.layout["icon-rotation-alignment"],i.layout["icon-pitch-alignment"],i.layout["icon-keep-upright"]);i.isOpacityZero(n.transform.zoom,"text-opacity")||r(n,t,i,u,!0,i.paint["text-translate"],i.paint["text-translate-anchor"],i.layout["text-rotation-alignment"],i.layout["text-pitch-alignment"],i.layout["text-keep-upright"]);t.map.showCollisionBoxes&&s(n,t,i,u)}}function r(n,t,r,u,f,s,c,l,v,y){var p=n.gl,ot=n.transform,tt="map"===l,k="map"===v,st=tt&&"line"===r.layout["symbol-placement"],yt=tt&&!k&&!st,ht=k,w,it,rt,nt,ct,lt;for(ht?p.enable(p.DEPTH_TEST):p.disable(p.DEPTH_TEST),it=0,rt=u;it<rt.length;it+=1){var g=rt[it],b=t.getTile(g),d=b.getBucket(r);if(d&&(nt=f?d.text:d.icon,nt&&nt.segments.get().length)){var ut=nt.programConfigurations.get(r.id),ft=f||d.sdfIcons,pt=f?d.textSizeData:d.iconSizeData;(w||(w=n.useProgram(ft?"symbolSDF":"symbolIcon",ut),ut.setUniforms(p,w,r,{zoom:n.transform.zoom}),e(w,n,r,f,yt,k,pt)),p.activeTexture(p.TEXTURE0),p.uniform1i(w.uniforms.u_texture,0),f)?(b.glyphAtlasTexture.bind(p.LINEAR,p.CLAMP_TO_EDGE),p.uniform2fv(w.uniforms.u_texsize,b.glyphAtlasTexture.size)):(ct=!r.isLayoutValueFeatureConstant("icon-size")||!r.isLayoutValueZoomConstant("icon-size")||1!==r.getLayoutValue("icon-size",{zoom:ot.zoom})||d.iconsNeedLinear,lt=k||0!==ot.pitch,b.iconAtlasTexture.bind(ft||n.options.rotating||n.options.zooming||ct||lt?p.LINEAR:p.NEAREST,p.CLAMP_TO_EDGE),p.uniform2fv(w.uniforms.u_texsize,b.iconAtlasTexture.size));n.enableTileClippingMask(g);p.uniformMatrix4fv(w.uniforms.u_matrix,!1,n.translatePosMatrix(g.posMatrix,b,s,c));var et=h(b,1,n.transform.zoom),at=i.getLabelPlaneMatrix(g.posMatrix,k,tt,n.transform,et),vt=i.getGlCoordMatrix(g.posMatrix,k,tt,n.transform,et);p.uniformMatrix4fv(w.uniforms.u_gl_coord_matrix,!1,n.translatePosMatrix(vt,b,s,c,!0));st?(p.uniformMatrix4fv(w.uniforms.u_label_plane_matrix,!1,a),i.updateLineLabels(d,g.posMatrix,n,f,at,vt,k,y,et,r)):p.uniformMatrix4fv(w.uniforms.u_label_plane_matrix,!1,at);p.uniform1f(w.uniforms.u_collision_y_stretch,b.collisionTile.yStretch);o(w,ut,n,r,b,nt,f,ft,k)}}ht||p.enable(p.DEPTH_TEST)}function e(n,t,i,r,u,f,e){var o=t.gl,s=t.transform,l,a,h;o.uniform1i(n.uniforms.u_pitch_with_map,f?1:0);o.uniform1f(n.uniforms.u_is_text,r?1:0);o.activeTexture(o.TEXTURE1);t.frameHistory.bind(o);o.uniform1i(n.uniforms.u_fadetexture,1);o.uniform1f(n.uniforms.u_pitch,s.pitch/180*Math.PI);l="constant"===e.functionType||"source"===e.functionType;a="constant"===e.functionType||"camera"===e.functionType;o.uniform1i(n.uniforms.u_is_size_zoom_constant,l?1:0);o.uniform1i(n.uniforms.u_is_size_feature_constant,a?1:0);o.uniform1f(n.uniforms.u_camera_to_center_distance,s.cameraToCenterDistance);h=c.evaluateSizeForZoom(e,s,i,r);void 0!==h.uSizeT&&o.uniform1f(n.uniforms.u_size_t,h.uSizeT);void 0!==h.uSize&&o.uniform1f(n.uniforms.u_size,h.uSize);o.uniform1f(n.uniforms.u_aspect_ratio,s.width/s.height);o.uniform1i(n.uniforms.u_rotate_symbol,u?1:0)}function o(n,t,i,r,f,e,o,s,h){var c=i.gl,l=i.transform;if(s){var a=(o?"text":"icon")+"-halo-width",v=!r.isPaintValueFeatureConstant(a)||r.paint[a],y=h?Math.cos(l._pitch)*l.cameraToCenterDistance:1;c.uniform1f(n.uniforms.u_gamma_scale,y);v&&(c.uniform1f(n.uniforms.u_is_halo,1),u(e,r,c,n));c.uniform1f(n.uniforms.u_is_halo,0)}u(e,r,c,n)}function u(n,t,i,r){r.draw(i,i.TRIANGLES,t.id,n.layoutVertexBuffer,n.indexBuffer,n.segments,n.programConfigurations.get(t.id),n.dynamicLayoutVertexBuffer)}var s=n("./draw_collision_debug"),h=n("../source/pixels_to_tile_units"),i=n("../symbol/projection"),c=n("../symbol/symbol_size"),l=n("@mapbox/gl-matrix").mat4,a=l.identity(new Float32Array(16));t.exports=f},{"../source/pixels_to_tile_units":105,"../symbol/projection":204,"../symbol/symbol_size":207,"./draw_collision_debug":76,"@mapbox/gl-matrix":1}],84:[function(n,t){"use strict";var i=function(){this.changeTimes=new Float64Array(256);this.changeOpacities=new Uint8Array(256);this.opacities=new Uint8ClampedArray(256);this.array=new Uint8Array(this.opacities.buffer);this.previousZoom=0;this.firstFrame=!0};i.prototype.record=function(n,t,i){var u=this,r,e,f;if(this.firstFrame&&(n=0,this.firstFrame=!1),t=Math.floor(10*t),t<this.previousZoom)for(r=t+1;r<=this.previousZoom;r++)u.changeTimes[r]=n,u.changeOpacities[r]=u.opacities[r];else for(r=t;r>this.previousZoom;r--)u.changeTimes[r]=n,u.changeOpacities[r]=u.opacities[r];for(r=0;r<256;r++)e=n-u.changeTimes[r],f=255*(i?e/i:1),u.opacities[r]=r<=t?u.changeOpacities[r]+f:u.changeOpacities[r]-f;this.changed=!0;this.previousZoom=t};i.prototype.isVisible=function(n){return 0!==this.opacities[Math.floor(10*n)]};i.prototype.bind=function(n){this.texture?(n.bindTexture(n.TEXTURE_2D,this.texture),this.changed&&(n.texSubImage2D(n.TEXTURE_2D,0,0,0,256,1,n.ALPHA,n.UNSIGNED_BYTE,this.array),this.changed=!1)):(this.texture=n.createTexture(),n.bindTexture(n.TEXTURE_2D,this.texture),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.NEAREST),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.NEAREST),n.texImage2D(n.TEXTURE_2D,0,n.ALPHA,256,1,0,n.ALPHA,n.UNSIGNED_BYTE,this.array))};t.exports=i},{}],85:[function(n,t){"use strict";function u(n){var e=i.create({width:0,height:0}),l={},u=new f(0,0,{autoResize:!0}),s,h,a,c,t,o;for(s in n){h=n[s];a=l[s]={};for(c in h)t=h[+c],t&&0!==t.bitmap.width&&0!==t.bitmap.height&&(o=u.packOne(t.bitmap.width+2*r,t.bitmap.height+2*r),i.resize(e,{width:u.w,height:u.h}),i.copy(t.bitmap,e,{x:0,y:0},{x:o.x+r,y:o.y+r},t.bitmap),a[c]={rect:o,metrics:t.metrics})}return u.shrink(),i.resize(e,{width:u.w,height:u.h}),{image:e,positions:l}}var f=n("@mapbox/shelf-pack"),e=n("../util/image"),i=e.AlphaImage,r=1;t.exports={makeGlyphAtlas:u}},{"../util/image":242,"@mapbox/shelf-pack":3}],86:[function(n,t){"use strict";var u=n("../style/load_glyph_range"),f=n("@mapbox/tiny-sdf"),r=n("../util/is_char_in_unicode_block"),e=n("../util/util"),o=e.asyncAll,s=n("../util/image"),h=s.AlphaImage,i=function(n,t){this.requestTransform=n;this.localIdeographFontFamily=t;this.entries={}};i.prototype.setURL=function(n){this.url=n};i.prototype.getGlyphs=function(n,t){var i=this,s=[],f,r,e,h;for(f in n)for(r=0,e=n[f];r<e.length;r+=1)h=e[r],s.push({stack:f,id:h});o(s,function(n,t){var f=n.stack,e=n.id,r=i.entries[f],s,o,h;if(r||(r=i.entries[f]={glyphs:{},requests:{}}),s=r.glyphs[e],void 0!==s)return void t(null,{stack:f,id:e,glyph:s});if(s=i._tinySDF(r,f,e))return void t(null,{stack:f,id:e,glyph:s});if(o=Math.floor(e/256),256*o>65535)return void t(new Error("glyphs > 65535 not supported"));h=r.requests[o];h||(h=r.requests[o]=[],u(f,o,i.url,i.requestTransform,function(n,t){var u,i,f;if(t)for(u in t)r.glyphs[+u]=t[+u];for(i=0,f=h;i<f.length;i+=1)f[i](n,t);delete r.requests[o]}));h.push(function(n,i){n?t(n):i&&t(null,{stack:f,id:e,glyph:i[e]||null})})},function(n,i){if(n)t(n);else if(i){for(var r={},u=0,e=i;u<e.length;u+=1){var f=e[u],o=f.stack,s=f.id,h=f.glyph;(r[o]||(r[o]={}))[s]=h}t(null,r)}})};i.prototype._tinySDF=function(n,t,i){var o=this.localIdeographFontFamily,e,u;if(o&&(r["CJK Unified Ideographs"](i)||r["Hangul Syllables"](i)))return e=n.tinySDF,e||(u="400",/bold/i.test(t)?u="900":/medium/i.test(t)?u="500":/light/i.test(t)&&(u="200"),e=n.tinySDF=new f(24,3,8,.25,o,u)),{id:i,bitmap:h.create({width:30,height:30},e.draw(String.fromCharCode(i))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}};t.exports=i},{"../style/load_glyph_range":178,"../util/image":242,"../util/is_char_in_unicode_block":244,"../util/util":252,"@mapbox/tiny-sdf":4}],87:[function(n,t){"use strict";function u(n,t){var u=t.pixelRatio,r={x:n.x+i,y:n.y+i,w:n.w-2*i,h:n.h-2*i};return{pixelRatio:u,textureRect:r,tl:[r.x,r.y],br:[r.x+r.w,r.y+r.h],displaySize:[r.w/u,r.h/u]}}function f(n){var o=r.create({width:0,height:0}),c={},t=new e(0,0,{autoResize:!0}),h,f,s;for(h in n)f=n[h],s=t.packOne(f.data.width+2*i,f.data.height+2*i),r.resize(o,{width:t.w,height:t.h}),r.copy(f.data,o,{x:0,y:0},{x:s.x+i,y:s.y+i},f.data),c[h]=u(s,f);return t.shrink(),r.resize(o,{width:t.w,height:t.h}),{image:o,positions:c}}var e=n("@mapbox/shelf-pack"),o=n("../util/image"),r=o.RGBAImage,i=1;t.exports={imagePosition:u,makeImageAtlas:f}},{"../util/image":242,"@mapbox/shelf-pack":3}],88:[function(n,t){"use strict";var f=n("@mapbox/shelf-pack"),e=n("../util/image"),r=e.RGBAImage,o=n("./image_atlas"),s=o.imagePosition,h=n("./texture"),u=1,i=function(){this.images={};this.loaded=!1;this.requestors=[];this.shelfPack=new f(64,64,{autoResize:!0});this.patterns={};this.atlasImage=r.create({width:64,height:64});this.dirty=!0};i.prototype.isLoaded=function(){return this.loaded};i.prototype.setLoaded=function(n){var r=this,t,i;if(this.loaded!==n&&(this.loaded=n,n)){for(t=0,i=r.requestors;t<i.length;t+=1){var u=i[t],f=u.ids,e=u.callback;r._notify(f,e)}this.requestors=[]}};i.prototype.getImage=function(n){return this.images[n]};i.prototype.addImage=function(n,t){this.images[n]=t};i.prototype.removeImage=function(n){delete this.images[n];var t=this.patterns[n];t&&(this.shelfPack.unref(t.bin),delete this.patterns[n])};i.prototype.getImages=function(n,t){var e=this,u=!0,i,r,f;if(!this.isLoaded())for(i=0,r=n;i<r.length;i+=1)f=r[i],e.images[f]||(u=!1);this.isLoaded()||u?this._notify(n,t):this.requestors.push({ids:n,callback:t})};i.prototype._notify=function(n,t){for(var r,u,o=this,f={},i=0,e=n;i<e.length;i+=1)r=e[i],u=o.images[r],u&&(f[r]=u);t(null,f)};i.prototype.getPixelSize=function(){return{width:this.shelfPack.w,height:this.shelfPack.h}};i.prototype.getPattern=function(n){var v=this.patterns[n],i,a;if(v)return v.position;if(i=this.getImage(n),!i)return null;var y=i.data.width+2*u,p=i.data.height+2*u,f=this.shelfPack.packOne(y,p);if(!f)return null;r.resize(this.atlasImage,this.getPixelSize());var t=i.data,e=this.atlasImage,o=f.x+u,h=f.y+u,c=t.width,l=t.height;return r.copy(t,e,{x:0,y:0},{x:o,y:h},{width:c,height:l}),r.copy(t,e,{x:0,y:l-1},{x:o,y:h-1},{width:c,height:1}),r.copy(t,e,{x:0,y:0},{x:o,y:h+l},{width:c,height:1}),r.copy(t,e,{x:c-1,y:0},{x:o-1,y:h},{width:1,height:l}),r.copy(t,e,{x:0,y:0},{x:o+c,y:h},{width:1,height:l}),this.dirty=!0,a=s(f,i),this.patterns[n]={bin:f,position:a},a};i.prototype.bind=function(n){this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new h(n,this.atlasImage,n.RGBA);this.atlasTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)};t.exports=i},{"../util/image":242,"./image_atlas":87,"./texture":94,"@mapbox/shelf-pack":3}],89:[function(n,t){"use strict";var r=n("../util/util"),i=function(n,t){this.width=n;this.height=t;this.nextRow=0;this.bytes=4;this.data=new Uint8Array(this.width*this.height*this.bytes);this.positions={}};i.prototype.getDash=function(n,t){var i=n.join(",")+String(t);return this.positions[i]||(this.positions[i]=this.addDash(n,t)),this.positions[i]};i.prototype.addDash=function(n,t){var y=this,i=t?7:0,b=2*i+1,o,s,v,w,nt;if(this.nextRow+b>this.height)return r.warnOnce("LineAtlas out of space"),null;for(o=0,s=0;s<n.length;s++)o+=n[s];for(var h=this.width/o,p=h/2,k=n.length%2==1,c=-i;c<=i;c++)for(var tt=y.nextRow+i+c,it=y.width*tt,d=k?-n[n.length-1]:0,f=n[0],l=1,u=0;u<this.width;u++){for(;f<u/h;)d=f,f+=n[l],k&&l===n.length-1&&(f+=n[0]),l++;var rt=Math.abs(u-d*h),ut=Math.abs(u-f*h),e=Math.min(rt,ut),g=l%2==1,a=void 0;t?(v=i?c/i*(p+1):0,g?(w=p-Math.abs(v),a=Math.sqrt(e*e+w*w)):a=p-Math.sqrt(e*e+v*v)):a=(g?1:-1)*e;y.data[3+4*(it+u)]=Math.max(0,Math.min(255,a+128))}return nt={y:(this.nextRow+i+.5)/this.height,height:2*i/this.height,width:o},this.nextRow+=b,this.dirty=!0,nt};i.prototype.bind=function(n){this.texture?(n.bindTexture(n.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,n.texSubImage2D(n.TEXTURE_2D,0,0,0,this.width,this.height,n.RGBA,n.UNSIGNED_BYTE,this.data))):(this.texture=n.createTexture(),n.bindTexture(n.TEXTURE_2D,this.texture),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.REPEAT),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.REPEAT),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,this.width,this.height,0,n.RGBA,n.UNSIGNED_BYTE,this.data))};t.exports=i},{"../util/util":252}],90:[function(n,t){"use strict";var o=n("../util/browser"),v=n("@mapbox/gl-matrix").mat4,y=n("./frame_history"),s=n("../source/source_cache"),r=n("../data/extent"),h=n("../source/pixels_to_tile_units"),c=n("../util/util"),f=n("../gl/vertex_buffer"),u=n("./vertex_array_object"),p=n("../data/raster_bounds_array"),e=n("../data/pos_array"),w=n("../data/program_configuration"),l=w.ProgramConfiguration,b=n("../shaders"),k=n("./program"),d=n("./render_texture"),g=n("./tile_mask"),a={symbol:n("./draw_symbol"),circle:n("./draw_circle"),heatmap:n("./draw_heatmap"),line:n("./draw_line"),fill:n("./draw_fill"),"fill-extrusion":n("./draw_fill_extrusion"),raster:n("./draw_raster"),background:n("./draw_background"),debug:n("./draw_debug")},i=function(n,t){this.gl=n;this.transform=t;this._tileTextures={};this.frameHistory=new y;this.setup();this.numSublayers=s.maxUnderzooming+s.maxOverzooming+1;this.depthEpsilon=1/Math.pow(2,16);this.lineWidthRange=n.getParameter(n.ALIASED_LINE_WIDTH_RANGE);this.basicFillProgramConfiguration=l.createBasicFill();this.emptyProgramConfiguration=new l};i.prototype.resize=function(n,t){var u=this,f=this.gl,i,r,e;if(this.width=n*o.devicePixelRatio,this.height=t*o.devicePixelRatio,f.viewport(0,0,this.width,this.height),this.style)for(i=0,r=u.style._order;i<r.length;i+=1)e=r[i],u.style._layers[e].resize(f);this.depthRbo&&(this.gl.deleteRenderbuffer(this.depthRbo),this.depthRbo=null)};i.prototype.setup=function(){var n=this.gl,i,t,o,s;n.enable(n.BLEND);n.blendFunc(n.ONE,n.ONE_MINUS_SRC_ALPHA);n.enable(n.STENCIL_TEST);n.enable(n.DEPTH_TEST);n.depthFunc(n.LEQUAL);this._depthMask=!1;n.depthMask(!1);i=new e;i.emplaceBack(0,0);i.emplaceBack(r,0);i.emplaceBack(0,r);i.emplaceBack(r,r);this.tileExtentBuffer=new f(n,i);this.tileExtentVAO=new u;this.tileExtentPatternVAO=new u;t=new e;t.emplaceBack(0,0);t.emplaceBack(r,0);t.emplaceBack(r,r);t.emplaceBack(0,r);t.emplaceBack(0,0);this.debugBuffer=new f(n,t);this.debugVAO=new u;o=new p;o.emplaceBack(0,0,0,0);o.emplaceBack(r,0,r,0);o.emplaceBack(0,r,0,r);o.emplaceBack(r,r,r,r);this.rasterBoundsBuffer=new f(n,o);this.rasterBoundsVAO=new u;s=new e;s.emplaceBack(0,0);s.emplaceBack(1,0);s.emplaceBack(0,1);s.emplaceBack(1,1);this.viewportBuffer=new f(n,s);this.viewportVAO=new u;this.extTextureFilterAnisotropic=n.getExtension("EXT_texture_filter_anisotropic")||n.getExtension("MOZ_EXT_texture_filter_anisotropic")||n.getExtension("WEBKIT_EXT_texture_filter_anisotropic");this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=n.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT));this.extTextureHalfFloat=n.getExtension("OES_texture_half_float");this.extTextureHalfFloat&&n.getExtension("OES_texture_half_float_linear")};i.prototype.clearColor=function(){var n=this.gl;n.clearColor(0,0,0,0);n.clear(n.COLOR_BUFFER_BIT)};i.prototype.clearStencil=function(){var n=this.gl;n.clearStencil(0);n.stencilMask(255);n.clear(n.STENCIL_BUFFER_BIT)};i.prototype.clearDepth=function(){var n=this.gl;n.clearDepth(1);this.depthMask(!0);n.clear(n.DEPTH_BUFFER_BIT)};i.prototype._renderTileClippingMasks=function(n){var i=this,t=this.gl,o,r,u,f,s,e;for(t.colorMask(!1,!1,!1,!1),this.depthMask(!1),t.disable(t.DEPTH_TEST),t.enable(t.STENCIL_TEST),t.stencilMask(255),t.stencilOp(t.KEEP,t.KEEP,t.REPLACE),o=1,this._tileClippingMaskIDs={},r=0,u=n;r<u.length;r+=1)f=u[r],s=i._tileClippingMaskIDs[f.id]=o++,t.stencilFunc(t.ALWAYS,s,255),e=i.useProgram("fill",i.basicFillProgramConfiguration),t.uniformMatrix4fv(e.uniforms.u_matrix,!1,f.posMatrix),i.tileExtentVAO.bind(t,e,i.tileExtentBuffer),t.drawArrays(t.TRIANGLE_STRIP,0,i.tileExtentBuffer.length);t.stencilMask(0);t.colorMask(!0,!0,!0,!0);this.depthMask(!0);t.enable(t.DEPTH_TEST)};i.prototype.enableTileClippingMask=function(n){var t=this.gl;t.stencilFunc(t.EQUAL,this._tileClippingMaskIDs[n.id],255)};i.prototype.render=function(n,t){var i=this,tt,b,u,k,it,r,v,f,l,y,e,s,p,w;this.style=n;this.options=t;this.lineAtlas=n.lineAtlas;this.imageManager=n.imageManager;this.glyphManager=n.glyphManager;this.frameHistory.record(Date.now(),this.transform.zoom,n.getTransition().duration);for(tt in i.style.sourceCaches)b=i.style.sourceCaches[tt],b.used&&b.prepare(i.gl);u=this.style._order;k=c.filterObject(this.style.sourceCaches,function(n){return"raster"===n._source.type});for(it in k)!function(n){var t=k[n],r=t.getVisibleCoordinates(),u=r.map(function(n){return t.getTile(n)});g(u,i.gl)}(it);this.renderPass="3d";for(var o,rt=!0,h=[],nt=0;nt<u.length;nt++)r=i.style._layers[u[nt]],r.has3DPass()&&!r.isHidden(i.transform.zoom)&&(r.source!==(o&&o.id)&&(o=i.style.sourceCaches[r.source],h=[],o&&(i.clearStencil(),h=o.getVisibleCoordinates()),h.reverse()),h.length)&&(i._setup3DRenderbuffer(),v=r.viewportFrame||new d(i),r.viewportFrame=v,v.bindWithDepth(i.depthRbo),rt&&(i.clearDepth(),rt=!1),i.renderLayer(i,o,r,h),v.unbind());for(this.clearColor(),this.clearDepth(),this.showOverdrawInspector(t.showOverdrawInspector),this.depthRange=(n._order.length+2)*this.numSublayers*this.depthEpsilon,this.renderPass="opaque",l=[],this.currentLayer=u.length-1,this._showOverdrawInspector||this.gl.disable(this.gl.BLEND),this.currentLayer;this.currentLayer>=0;this.currentLayer--)y=i.style._layers[u[i.currentLayer]],y.source!==(f&&f.id)&&(f=i.style.sourceCaches[y.source],l=[],f&&(i.clearStencil(),l=f.getVisibleCoordinates(),f.getSource().isTileClipped&&i._renderTileClippingMasks(l))),i.renderLayer(i,f,y,l);for(this.renderPass="translucent",s=[],this.gl.enable(this.gl.BLEND),this.currentLayer=0,this.currentLayer;this.currentLayer<u.length;this.currentLayer++)p=i.style._layers[u[i.currentLayer]],p.source!==(e&&e.id)&&(e=i.style.sourceCaches[p.source],s=[],e&&(i.clearStencil(),s=e.getVisibleCoordinates(),e.getSource().isTileClipped&&i._renderTileClippingMasks(s)),s.reverse()),i.renderLayer(i,e,p,s);this.options.showTileBoundaries&&(w=this.style.sourceCaches[Object.keys(this.style.sourceCaches)[0]],w&&a.debug(this,w,w.getVisibleCoordinates()))};i.prototype._setup3DRenderbuffer=function(){if(!this.depthRbo){var n=this.gl;this.depthRbo=n.createRenderbuffer();n.bindRenderbuffer(n.RENDERBUFFER,this.depthRbo);n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_COMPONENT16,this.width,this.height);n.bindRenderbuffer(n.RENDERBUFFER,null)}this.depthRboAttached=!0};i.prototype.depthMask=function(n){n!==this._depthMask&&(this._depthMask=n,this.gl.depthMask(n))};i.prototype.renderLayer=function(n,t,i,r){i.isHidden(this.transform.zoom)||("background"===i.type||r.length)&&(this.id=i.id,a[i.type](n,t,i,r))};i.prototype.setDepthSublayer=function(n){var t=1-((1+this.currentLayer)*this.numSublayers+n)*this.depthEpsilon,i=t-1+this.depthRange;this.gl.depthRange(i,t)};i.prototype.translatePosMatrix=function(n,t,i,r,u){var f,e,o,c,s;return!i[0]&&!i[1]?n:(f=u?"map"===r?this.transform.angle:0:"viewport"===r?-this.transform.angle:0,f&&(e=Math.sin(f),o=Math.cos(f),i=[i[0]*o-i[1]*e,i[0]*e+i[1]*o]),c=[u?i[0]:h(t,i[0],this.transform.zoom),u?i[1]:h(t,i[1],this.transform.zoom),0],s=new Float32Array(16),v.translate(s,n,c),s)};i.prototype.saveTileTexture=function(n){var t=this._tileTextures[n.size[0]];t?t.push(n):this._tileTextures[n.size[0]]=[n]};i.prototype.getTileTexture=function(n){var t=this._tileTextures[n];return t&&t.length>0?t.pop():null};i.prototype.lineWidth=function(n){this.gl.lineWidth(c.clamp(n,this.lineWidthRange[0],this.lineWidthRange[1]))};i.prototype.showOverdrawInspector=function(n){if(n||this._showOverdrawInspector){this._showOverdrawInspector=n;var t=this.gl;n?(t.blendFunc(t.CONSTANT_COLOR,t.ONE),t.blendColor(1/8,1/8,1/8,0),t.clearColor(0,0,0,1),t.clear(t.COLOR_BUFFER_BIT)):t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA)}};i.prototype._createProgramCached=function(n,t){this.cache=this.cache||{};var i=""+n+(t.cacheKey||"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[i]||(this.cache[i]=new k(this.gl,b[n],t,this._showOverdrawInspector)),this.cache[i]};i.prototype.useProgram=function(n,t){var r=this.gl,i=this._createProgramCached(n,t||this.emptyProgramConfiguration);return this.currentProgram!==i&&(r.useProgram(i.program),this.currentProgram=i),i};t.exports=i},{"../data/extent":58,"../data/pos_array":62,"../data/program_configuration":63,"../data/raster_bounds_array":64,"../gl/vertex_buffer":72,"../shaders":98,"../source/pixels_to_tile_units":105,"../source/source_cache":110,"../util/browser":231,"../util/util":252,"./draw_background":74,"./draw_circle":75,"./draw_debug":77,"./draw_fill":78,"./draw_fill_extrusion":79,"./draw_heatmap":80,"./draw_line":81,"./draw_raster":82,"./draw_symbol":83,"./frame_history":84,"./program":92,"./render_texture":93,"./tile_mask":95,"./vertex_array_object":96,"@mapbox/gl-matrix":1}],91:[function(n,t,i){"use strict";var r=n("../source/pixels_to_tile_units");i.isPatternMissing=function(n,t){if(!n)return!1;var i=t.imageManager.getPattern(n.from),r=t.imageManager.getPattern(n.to);return!i||!r};i.prepare=function(n,t,i){var r=t.gl,u=t.imageManager.getPattern(n.from),f=t.imageManager.getPattern(n.to);r.uniform1i(i.uniforms.u_image,0);r.uniform2fv(i.uniforms.u_pattern_tl_a,u.tl);r.uniform2fv(i.uniforms.u_pattern_br_a,u.br);r.uniform2fv(i.uniforms.u_pattern_tl_b,f.tl);r.uniform2fv(i.uniforms.u_pattern_br_b,f.br);var e=t.imageManager.getPixelSize(),o=e.width,s=e.height;r.uniform2fv(i.uniforms.u_texsize,[o,s]);r.uniform1f(i.uniforms.u_mix,n.t);r.uniform2fv(i.uniforms.u_pattern_size_a,u.displaySize);r.uniform2fv(i.uniforms.u_pattern_size_b,f.displaySize);r.uniform1f(i.uniforms.u_scale_a,n.fromScale);r.uniform1f(i.uniforms.u_scale_b,n.toScale);r.activeTexture(r.TEXTURE0);t.imageManager.bind(r)};i.setTile=function(n,t,i){var u=t.gl;u.uniform1f(i.uniforms.u_tile_units_to_pixels,1/r(n,1,t.transform.tileZoom));var f=Math.pow(2,n.coord.z),e=n.tileSize*Math.pow(2,t.transform.tileZoom)/f,o=e*(n.coord.x+n.coord.w*f),s=e*n.coord.y;u.uniform2f(i.uniforms.u_pixel_coord_upper,o>>16,s>>16);u.uniform2f(i.uniforms.u_pixel_coord_lower,65535&o,65535&s)}},{"../source/pixels_to_tile_units":105}],92:[function(n,t){"use strict";var u=n("../util/browser"),i=n("../shaders"),f=n("../data/program_configuration"),o=f.ProgramConfiguration,e=n("./vertex_array_object"),r=function(n,t,r,f){var e=this,s,h,p,o,c,l,w,a,v;this.gl=n;this.program=n.createProgram();s=r.defines().concat("#define DEVICE_PIXEL_RATIO "+u.devicePixelRatio.toFixed(1));f&&s.push("#define OVERDRAW_INSPECTOR;");var b=s.concat(i.prelude.fragmentSource,t.fragmentSource).join("\n"),k=s.concat(i.prelude.vertexSource,t.vertexSource).join("\n"),y=n.createShader(n.FRAGMENT_SHADER);for(n.shaderSource(y,b),n.compileShader(y),n.attachShader(this.program,y),h=n.createShader(n.VERTEX_SHADER),n.shaderSource(h,k),n.compileShader(h),n.attachShader(this.program,h),p=r.interface?r.interface.layoutAttributes:[],o=0;o<p.length;o++)n.bindAttribLocation(e.program,o,p[o].name);for(n.linkProgram(this.program),this.numAttributes=n.getProgramParameter(this.program,n.ACTIVE_ATTRIBUTES),this.attributes={},this.uniforms={},c=0;c<this.numAttributes;c++)l=n.getActiveAttrib(e.program,c),l&&(e.attributes[l.name]=n.getAttribLocation(e.program,l.name));for(w=n.getProgramParameter(this.program,n.ACTIVE_UNIFORMS),a=0;a<w;a++)v=n.getActiveUniform(e.program,a),v&&(e.uniforms[v.name]=n.getUniformLocation(e.program,v.name))};r.prototype.draw=function(n,t,i,r,u,f,o,s){for(var h,a,c,p=this,v=(c={},c[n.LINES]=2,c[n.TRIANGLES]=3,c)[t],l=0,y=f.get();l<y.length;l+=1)h=y[l],a=h.vaos||(h.vaos={}),(a[i]||(a[i]=new e)).bind(n,p,r,u,o&&o.paintVertexBuffer,h.vertexOffset,s),n.drawElements(t,h.primitiveLength*v,n.UNSIGNED_SHORT,h.primitiveOffset*v*2)};t.exports=r},{"../data/program_configuration":63,"../shaders":98,"../util/browser":231,"./vertex_array_object":96}],93:[function(n,t){"use strict";var i=function(n){var t=this.gl=n.gl,i=this.texture=t.createTexture(),r;t.bindTexture(t.TEXTURE_2D,i);t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE);t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE);t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR);t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR);t.texImage2D(t.TEXTURE_2D,0,t.RGBA,n.width,n.height,0,t.RGBA,t.UNSIGNED_BYTE,null);t.bindTexture(t.TEXTURE_2D,null);r=this.fbo=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,r);t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,i,0)};i.prototype.bindWithDepth=function(n){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,this.fbo);this.attachedRbo!==n&&(t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,n),this.attachedRbo=n)};i.prototype.unbind=function(){var n=this.gl;n.bindFramebuffer(n.FRAMEBUFFER,null)};t.exports=i},{}],94:[function(n,t){"use strict";var i=n("../util/window"),u=i.HTMLImageElement,f=i.HTMLCanvasElement,e=i.HTMLVideoElement,o=i.ImageData,r=function(n,t,i){this.gl=n;var r=t.width,u=t.height;this.size=[r,u];this.format=i;this.texture=n.createTexture();this.update(t)};r.prototype.update=function(n){var i=n.width,r=n.height,s,t;this.size=[i,r];s=this;t=s.gl;t.bindTexture(t.TEXTURE_2D,this.texture);t.pixelStorei(t.UNPACK_ALIGNMENT,1);this.format===t.RGBA&&t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0);n instanceof u||n instanceof f||n instanceof e||n instanceof o?t.texImage2D(t.TEXTURE_2D,0,this.format,this.format,t.UNSIGNED_BYTE,n):t.texImage2D(t.TEXTURE_2D,0,this.format,i,r,0,this.format,t.UNSIGNED_BYTE,n.data)};r.prototype.bind=function(n,t,i){var u=this,r=u.gl;r.bindTexture(r.TEXTURE_2D,this.texture);n!==this.filter&&(r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,n),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,i||n),this.filter=n);t!==this.wrap&&(r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,t),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,t),this.wrap=t)};r.prototype.destroy=function(){this.gl.deleteTexture(this.texture);this.texture=null};t.exports=r},{"../util/window":233}],95:[function(n,t){"use strict";function i(n,t,u,f,e){for(var s,l,h,c,a,o=0;o<u.length;o++){if(s=u[o],f.isLessThan(s.coord))break;if(t.id===s.coord.id)return;if(s.coord.isChildOf(t)){for(l=t.children(1/0),h=0;h<l.length;h++)i(n,l[h],u.slice(o),f,e);return}}c=t.z-n.z;a=new r(c,t.x-(n.x<<c),t.y-(n.y<<c)).id;e[a]=e[a]||!0}var r=n("../source/tile_coord");t.exports=function(n,t){for(var f=n.sort(function(n,t){return n.coord.isLessThan(t.coord)?-1:t.coord.isLessThan(n.coord)?1:0}),u=0;u<f.length;u++){var o={},e=f[u],s=f.slice(u+1);i(e.coord.wrapped(),e.coord,s,new r(0,0,0,e.coord.w+1),o);e.setMask(o,t)}}},{"../source/tile_coord":113}],96:[function(n,t){"use strict";var i=function(){this.boundProgram=null;this.boundVertexBuffer=null;this.boundVertexBuffer2=null;this.boundIndexBuffer=null;this.boundVertexOffset=null;this.boundDynamicVertexBuffer=null;this.vao=null};i.prototype.bind=function(n,t,i,r,u,f,e){void 0===n.extVertexArrayObject&&(n.extVertexArrayObject=n.getExtension("OES_vertex_array_object"));var o=!this.vao||this.boundProgram!==t||this.boundVertexBuffer!==i||this.boundVertexBuffer2!==u||this.boundIndexBuffer!==r||this.boundVertexOffset!==f||this.boundDynamicVertexBuffer!==e;!n.extVertexArrayObject||o?(this.freshBind(n,t,i,r,u,f,e),this.gl=n):(n.extVertexArrayObject.bindVertexArrayOES(this.vao),e&&e.bind())};i.prototype.freshBind=function(n,t,i,r,u,f,e){var s,h=t.numAttributes,o;if(n.extVertexArrayObject)this.vao&&this.destroy(),this.vao=n.extVertexArrayObject.createVertexArrayOES(),n.extVertexArrayObject.bindVertexArrayOES(this.vao),s=0,this.boundProgram=t,this.boundVertexBuffer=i,this.boundVertexBuffer2=u,this.boundIndexBuffer=r,this.boundVertexOffset=f,this.boundDynamicVertexBuffer=e;else for(s=n.currentNumAttributes||0,o=h;o<s;o++)n.disableVertexAttribArray(o);i.enableAttributes(n,t);u&&u.enableAttributes(n,t);e&&e.enableAttributes(n,t);i.bind();i.setVertexAttribPointers(n,t,f);u&&(u.bind(),u.setVertexAttribPointers(n,t,f));e&&(e.bind(),e.setVertexAttribPointers(n,t,f));r&&r.bind();n.currentNumAttributes=h};i.prototype.destroy=function(){this.vao&&(this.gl.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)};t.exports=i},{}],97:[function(n,t,i){"use strict";var r=n("../util/util");i.packUint8ToFloat=function(n,t){return n=r.clamp(Math.floor(n),0,255),t=r.clamp(Math.floor(t),0,255),256*n+t}},{"../util/util":252}],98:[function(n,t){"use strict";var i={prelude:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n\n#if !defined(lowp)\n#define lowp\n#endif\n\n#if !defined(mediump)\n#define mediump\n#endif\n\n#if !defined(highp)\n#define highp\n#endif\n\n#endif\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n\n#if !defined(lowp)\n#define lowp\n#endif\n\n#if !defined(mediump)\n#define mediump\n#endif\n\n#if !defined(highp)\n#define highp\n#endif\n\n#endif\n\n// Unpack a pair of values that have been packed into a single float.\n// The packed values are assumed to be 8-bit unsigned integers, and are\n// packed like so:\n// packedValue = floor(input[0]) * 256 + input[1],\nvec2 unpack_float(const float packedValue) {\n    int packedIntValue = int(packedValue);\n    int v0 = packedIntValue / 256;\n    return vec2(v0, packedIntValue - v0 * 256);\n}\n\n\n// To minimize the number of attributes needed, we encode a 4-component\n// color into a pair of floats (i.e. a vec2) as follows:\n// [ floor(color.r * 255) * 256 + color.g * 255,\n//   floor(color.b * 255) * 256 + color.g * 255 ]\nvec4 decode_color(const vec2 encodedColor) {\n    return vec4(\n        unpack_float(encodedColor[0]) / 255.0,\n        unpack_float(encodedColor[1]) / 255.0\n    );\n}\n\n// Unpack a pair of paint values and interpolate between them.\nfloat unpack_mix_vec2(const vec2 packedValue, const float t) {\n    return mix(packedValue[0], packedValue[1], t);\n}\n\n// Unpack a pair of paint values and interpolate between them.\nvec4 unpack_mix_vec4(const vec4 packedColors, const float t) {\n    vec4 minColor = decode_color(vec2(packedColors[0], packedColors[1]));\n    vec4 maxColor = decode_color(vec2(packedColors[2], packedColors[3]));\n    return mix(minColor, maxColor, t);\n}\n\n// The offset depends on how many pixels are between the world origin and the edge of the tile:\n// vec2 offset = mod(pixel_coord, size)\n//\n// At high zoom levels there are a ton of pixels between the world origin and the edge of the tile.\n// The glsl spec only guarantees 16 bits of precision for highp floats. We need more than that.\n//\n// The pixel_coord is passed in as two 16 bit values:\n// pixel_coord_upper = floor(pixel_coord / 2^16)\n// pixel_coord_lower = mod(pixel_coord, 2^16)\n//\n// The offset is calculated in a series of steps that should preserve this precision:\nvec2 get_pattern_pos(const vec2 pixel_coord_upper, const vec2 pixel_coord_lower,\n    const vec2 pattern_size, const float tile_units_to_pixels, const vec2 pos) {\n\n    vec2 offset = mod(mod(mod(pixel_coord_upper, pattern_size) * 256.0, pattern_size) * 256.0 + pixel_coord_lower, pattern_size);\n    return (tile_units_to_pixels * pos + offset) / pattern_size;\n}\n"},circle:{fragmentSource:"#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\n\nvarying vec3 v_data;\n\nvoid main() {\n    #pragma mapbox: initialize highp vec4 color\n    #pragma mapbox: initialize mediump float radius\n    #pragma mapbox: initialize lowp float blur\n    #pragma mapbox: initialize lowp float opacity\n    #pragma mapbox: initialize highp vec4 stroke_color\n    #pragma mapbox: initialize mediump float stroke_width\n    #pragma mapbox: initialize lowp float stroke_opacity\n\n    vec2 extrude = v_data.xy;\n    float extrude_length = length(extrude);\n\n    lowp float antialiasblur = v_data.z;\n    float antialiased_blur = -max(blur, antialiasblur);\n\n    float opacity_t = smoothstep(0.0, antialiased_blur, extrude_length - 1.0);\n\n    float color_t = stroke_width < 0.01 ? 0.0 : smoothstep(\n        antialiased_blur,\n        0.0,\n        extrude_length - radius / (radius + stroke_width)\n    );\n\n    gl_FragColor = opacity_t * mix(color * opacity, stroke_color * stroke_opacity, color_t);\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform bool u_scale_with_map;\nuniform bool u_pitch_with_map;\nuniform vec2 u_extrude_scale;\nuniform highp float u_camera_to_center_distance;\n\nattribute vec2 a_pos;\n\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\n\nvarying vec3 v_data;\n\nvoid main(void) {\n    #pragma mapbox: initialize highp vec4 color\n    #pragma mapbox: initialize mediump float radius\n    #pragma mapbox: initialize lowp float blur\n    #pragma mapbox: initialize lowp float opacity\n    #pragma mapbox: initialize highp vec4 stroke_color\n    #pragma mapbox: initialize mediump float stroke_width\n    #pragma mapbox: initialize lowp float stroke_opacity\n\n    // unencode the extrusion vector that we snuck into the a_pos vector\n    vec2 extrude = vec2(mod(a_pos, 2.0) * 2.0 - 1.0);\n\n    // multiply a_pos by 0.5, since we had it * 2 in order to sneak\n    // in extrusion data\n    vec2 circle_center = floor(a_pos * 0.5);\n    if (u_pitch_with_map) {\n        vec2 corner_position = circle_center;\n        if (u_scale_with_map) {\n            corner_position += extrude * (radius + stroke_width) * u_extrude_scale;\n        } else {\n            // Pitching the circle with the map effectively scales it with the map\n            // To counteract the effect for pitch-scale: viewport, we rescale the\n            // whole circle based on the pitch scaling effect at its central point\n            vec4 projected_center = u_matrix * vec4(circle_center, 0, 1);\n            corner_position += extrude * (radius + stroke_width) * u_extrude_scale * (projected_center.w / u_camera_to_center_distance);\n        }\n\n        gl_Position = u_matrix * vec4(corner_position, 0, 1);\n    } else {\n        gl_Position = u_matrix * vec4(circle_center, 0, 1);\n\n        if (u_scale_with_map) {\n            gl_Position.xy += extrude * (radius + stroke_width) * u_extrude_scale * u_camera_to_center_distance;\n        } else {\n            gl_Position.xy += extrude * (radius + stroke_width) * u_extrude_scale * gl_Position.w;\n        }\n    }\n\n    // This is a minimum blur distance that serves as a faux-antialiasing for\n    // the circle. since blur is a ratio of the circle's size and the intent is\n    // to keep the blur at roughly 1px, the two are inversely related.\n    lowp float antialiasblur = 1.0 / DEVICE_PIXEL_RATIO / (radius + stroke_width);\n\n    v_data = vec3(extrude.x, extrude.y, antialiasblur);\n}\n"},heatmap:{fragmentSource:"#pragma mapbox: define highp float weight\n\nuniform highp float u_intensity;\nuniform highp float u_radius;\nvarying vec2 v_extrude;\n\n// Gaussian kernel coefficient: 1 / sqrt(2 * PI)\n#define GAUSS_COEF 0.3989422804014327\n\nvoid main() {\n    #pragma mapbox: initialize highp float weight\n\n    // Kernel density estimation with a Gaussian kernel of size 5x5\n    float d = -0.5 * 3.0 * 3.0 * dot(v_extrude, v_extrude);\n    float val = weight * u_intensity * GAUSS_COEF * exp(d);\n\n    gl_FragColor = vec4(val, 1.0, 1.0, 1.0);\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#pragma mapbox: define highp float weight\n\nuniform mat4 u_matrix;\nuniform float u_extrude_scale;\nuniform float u_radius;\nuniform float u_opacity;\nuniform float u_intensity;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_extrude;\n\n// Effective \"0\" in the kernel density texture to adjust the kernel size to;\n// this empirically chosen number minimizes artifacts on overlapping kernels\n// for typical heatmap cases (assuming clustered source)\nconst highp float ZERO = 1.0 / 255.0 / 16.0;\n\n// Gaussian kernel coefficient: 1 / sqrt(2 * PI)\n#define GAUSS_COEF 0.3989422804014327\n\nvoid main(void) {\n    #pragma mapbox: initialize highp float weight\n\n    // unencode the extrusion vector that we snuck into the a_pos vector\n    vec2 unscaled_extrude = vec2(mod(a_pos, 2.0) * 2.0 - 1.0);\n\n    // This 'extrude' comes in ranging from [-1, -1], to [1, 1].  We'll use\n    // it to produce the vertices of a square mesh framing the point feature\n    // we're adding to the kernel density texture.  We'll also pass it as\n    // a varying, so that the fragment shader can determine the distance of\n    // each fragment from the point feature.\n    // Before we do so, we need to scale it up sufficiently so that the\n    // kernel falls effectively to zero at the edge of the mesh.\n    // That is, we want to know S such that\n    // weight * u_intensity * GAUSS_COEF * exp(-0.5 * 3.0^2 * S^2) == ZERO\n    // Which solves to:\n    // S = sqrt(-2.0 * log(ZERO / (weight * u_intensity * GAUSS_COEF))) / 3.0\n    float S = sqrt(-2.0 * log(ZERO / weight / u_intensity / GAUSS_COEF)) / 3.0;\n\n    // Pass the varying in units of u_radius\n    v_extrude = S * unscaled_extrude;\n\n    // Scale by u_radius and the zoom-based scale factor to produce actual\n    // mesh position\n    vec2 extrude = v_extrude * u_radius * u_extrude_scale;\n\n    // multiply a_pos by 0.5, since we had it * 2 in order to sneak\n    // in extrusion data\n    vec4 pos = vec4(floor(a_pos * 0.5) + extrude, 0, 1);\n\n    gl_Position = u_matrix * pos;\n}\n"},heatmapTexture:{fragmentSource:"uniform sampler2D u_image;\nuniform sampler2D u_color_ramp;\nuniform float u_opacity;\nvarying vec2 v_pos;\n\nvoid main() {\n    float t = texture2D(u_image, v_pos).r;\n    vec4 color = texture2D(u_color_ramp, vec2(t, 0.5));\n    gl_FragColor = color * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(0.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_world;\nattribute vec2 a_pos;\nvarying vec2 v_pos;\n\nvoid main() {\n    gl_Position = u_matrix * vec4(a_pos * u_world, 0, 1);\n\n    v_pos.x = a_pos.x;\n    v_pos.y = 1.0 - a_pos.y;\n}\n"},collisionBox:{fragmentSource:"uniform float u_zoom;\n// u_maxzoom is derived from the maximum scale considered by the CollisionTile\n// Labels with placement zoom greater than this value will not be placed,\n// regardless of perspective effects.\nuniform float u_maxzoom;\nuniform sampler2D u_fadetexture;\n\n// v_max_zoom is a collision-box-specific value that controls when line-following\n// collision boxes are used.\nvarying float v_max_zoom;\nvarying float v_placement_zoom;\nvarying float v_perspective_zoom_adjust;\nvarying vec2 v_fade_tex;\n\nvoid main() {\n\n    float alpha = 0.5;\n\n    // Green = no collisions, label is showing\n    gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0) * alpha;\n\n    // Red = collision, label hidden\n    if (texture2D(u_fadetexture, v_fade_tex).a < 1.0) {\n        gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0) * alpha;\n    }\n\n    // Faded black = this collision box is not used at this zoom (for curved labels)\n    if (u_zoom >= v_max_zoom + v_perspective_zoom_adjust) {\n        gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0) * alpha * 0.25;\n    }\n\n    // Faded blue = the placement scale for this label is beyond the CollisionTile\n    // max scale, so it's impossible for this label to show without collision detection\n    // being run again (the label's glyphs haven't even been added to the symbol bucket)\n    if (v_placement_zoom >= u_maxzoom) {\n        gl_FragColor = vec4(0.0, 0.0, 1.0, 1.0) * alpha * 0.2;\n    }\n}\n",vertexSource:"attribute vec2 a_pos;\nattribute vec2 a_anchor_pos;\nattribute vec2 a_extrude;\nattribute vec2 a_data;\n\nuniform mat4 u_matrix;\nuniform float u_scale;\nuniform float u_pitch;\nuniform float u_collision_y_stretch;\nuniform float u_camera_to_center_distance;\n\nvarying float v_max_zoom;\nvarying float v_placement_zoom;\nvarying float v_perspective_zoom_adjust;\nvarying vec2 v_fade_tex;\n\nvoid main() {\n    vec4 projectedPoint = u_matrix * vec4(a_anchor_pos, 0, 1);\n    highp float camera_to_anchor_distance = projectedPoint.w;\n    highp float collision_perspective_ratio = 1.0 + 0.5 * ((camera_to_anchor_distance / u_camera_to_center_distance) - 1.0);\n\n    highp float incidence_stretch  = camera_to_anchor_distance / (u_camera_to_center_distance * cos(u_pitch));\n    highp float collision_adjustment = max(1.0, incidence_stretch / u_collision_y_stretch);\n\n    gl_Position = u_matrix * vec4(a_pos + a_extrude * collision_perspective_ratio * collision_adjustment / u_scale, 0.0, 1.0);\n\n    v_max_zoom = a_data.x;\n    v_placement_zoom = a_data.y;\n\n    v_perspective_zoom_adjust = floor(log2(collision_perspective_ratio * collision_adjustment) * 10.0);\n    v_fade_tex = vec2((v_placement_zoom + v_perspective_zoom_adjust) / 255.0, 0.0);\n}\n"},debug:{fragmentSource:"uniform highp vec4 u_color;\n\nvoid main() {\n    gl_FragColor = u_color;\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\nvoid main() {\n    gl_Position = u_matrix * vec4(a_pos, 0, 1);\n}\n"},fill:{fragmentSource:"#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n    #pragma mapbox: initialize highp vec4 color\n    #pragma mapbox: initialize lowp float opacity\n\n    gl_FragColor = color * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n    #pragma mapbox: initialize highp vec4 color\n    #pragma mapbox: initialize lowp float opacity\n\n    gl_Position = u_matrix * vec4(a_pos, 0, 1);\n}\n"},fillOutline:{fragmentSource:"#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_pos;\n\nvoid main() {\n    #pragma mapbox: initialize highp vec4 outline_color\n    #pragma mapbox: initialize lowp float opacity\n\n    float dist = length(v_pos - gl_FragCoord.xy);\n    float alpha = 1.0 - smoothstep(0.0, 1.0, dist);\n    gl_FragColor = outline_color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\nuniform vec2 u_world;\n\nvarying vec2 v_pos;\n\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n    #pragma mapbox: initialize highp vec4 outline_color\n    #pragma mapbox: initialize lowp float opacity\n\n    gl_Position = u_matrix * vec4(a_pos, 0, 1);\n    v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},fillOutlinePattern:{fragmentSource:"uniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform vec2 u_texsize;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n    #pragma mapbox: initialize lowp float opacity\n\n    vec2 imagecoord = mod(v_pos_a, 1.0);\n    vec2 pos = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, imagecoord);\n    vec4 color1 = texture2D(u_image, pos);\n\n    vec2 imagecoord_b = mod(v_pos_b, 1.0);\n    vec2 pos2 = mix(u_pattern_tl_b / u_texsize, u_pattern_br_b / u_texsize, imagecoord_b);\n    vec4 color2 = texture2D(u_image, pos2);\n\n    // find distance to outline for alpha interpolation\n\n    float dist = length(v_pos - gl_FragCoord.xy);\n    float alpha = 1.0 - smoothstep(0.0, 1.0, dist);\n\n\n    gl_FragColor = mix(color1, color2, u_mix) * alpha * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_world;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n    #pragma mapbox: initialize lowp float opacity\n\n    gl_Position = u_matrix * vec4(a_pos, 0, 1);\n\n    v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_a * u_pattern_size_a, u_tile_units_to_pixels, a_pos);\n    v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_b * u_pattern_size_b, u_tile_units_to_pixels, a_pos);\n\n    v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},fillPattern:{fragmentSource:"uniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform vec2 u_texsize;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n    #pragma mapbox: initialize lowp float opacity\n\n    vec2 imagecoord = mod(v_pos_a, 1.0);\n    vec2 pos = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, imagecoord);\n    vec4 color1 = texture2D(u_image, pos);\n\n    vec2 imagecoord_b = mod(v_pos_b, 1.0);\n    vec2 pos2 = mix(u_pattern_tl_b / u_texsize, u_pattern_br_b / u_texsize, imagecoord_b);\n    vec4 color2 = texture2D(u_image, pos2);\n\n    gl_FragColor = mix(color1, color2, u_mix) * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n    #pragma mapbox: initialize lowp float opacity\n\n    gl_Position = u_matrix * vec4(a_pos, 0, 1);\n\n    v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_a * u_pattern_size_a, u_tile_units_to_pixels, a_pos);\n    v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_b * u_pattern_size_b, u_tile_units_to_pixels, a_pos);\n}\n"},fillExtrusion:{fragmentSource:"varying vec4 v_color;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define highp vec4 color\n\nvoid main() {\n    #pragma mapbox: initialize lowp float base\n    #pragma mapbox: initialize lowp float height\n    #pragma mapbox: initialize highp vec4 color\n\n    gl_FragColor = v_color;\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec3 u_lightcolor;\nuniform lowp vec3 u_lightpos;\nuniform lowp float u_lightintensity;\n\nattribute vec2 a_pos;\nattribute vec3 a_normal;\nattribute float a_edgedistance;\n\nvarying vec4 v_color;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n\n#pragma mapbox: define highp vec4 color\n\nvoid main() {\n    #pragma mapbox: initialize lowp float base\n    #pragma mapbox: initialize lowp float height\n    #pragma mapbox: initialize highp vec4 color\n\n    base = max(0.0, base);\n    height = max(0.0, height);\n\n    float ed = a_edgedistance; // use each attrib in order to not trip a VAO assert\n    float t = mod(a_normal.x, 2.0);\n\n    gl_Position = u_matrix * vec4(a_pos, t > 0.0 ? height : base, 1);\n\n    // Relative luminance (how dark/bright is the surface color?)\n    float colorvalue = color.r * 0.2126 + color.g * 0.7152 + color.b * 0.0722;\n\n    v_color = vec4(0.0, 0.0, 0.0, 1.0);\n\n    // Add slight ambient lighting so no extrusions are totally black\n    vec4 ambientlight = vec4(0.03, 0.03, 0.03, 1.0);\n    color += ambientlight;\n\n    // Calculate cos(theta), where theta is the angle between surface normal and diffuse light ray\n    float directional = clamp(dot(a_normal / 16384.0, u_lightpos), 0.0, 1.0);\n\n    // Adjust directional so that\n    // the range of values for highlight/shading is narrower\n    // with lower light intensity\n    // and with lighter/brighter surface colors\n    directional = mix((1.0 - u_lightintensity), max((1.0 - colorvalue + u_lightintensity), 1.0), directional);\n\n    // Add gradient along z axis of side surfaces\n    if (a_normal.y != 0.0) {\n        directional *= clamp((t + base) * pow(height / 150.0, 0.5), mix(0.7, 0.98, 1.0 - u_lightintensity), 1.0);\n    }\n\n    // Assign final color based on surface + ambient light color, diffuse light directional, and light color\n    // with lower bounds adjusted to hue of light\n    // so that shading is tinted with the complementary (opposite) color to the light color\n    v_color.r += clamp(color.r * directional * u_lightcolor.r, mix(0.0, 0.3, 1.0 - u_lightcolor.r), 1.0);\n    v_color.g += clamp(color.g * directional * u_lightcolor.g, mix(0.0, 0.3, 1.0 - u_lightcolor.g), 1.0);\n    v_color.b += clamp(color.b * directional * u_lightcolor.b, mix(0.0, 0.3, 1.0 - u_lightcolor.b), 1.0);\n}\n"},fillExtrusionPattern:{fragmentSource:"uniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform vec2 u_texsize;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec4 v_lighting;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n\nvoid main() {\n    #pragma mapbox: initialize lowp float base\n    #pragma mapbox: initialize lowp float height\n\n    vec2 imagecoord = mod(v_pos_a, 1.0);\n    vec2 pos = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, imagecoord);\n    vec4 color1 = texture2D(u_image, pos);\n\n    vec2 imagecoord_b = mod(v_pos_b, 1.0);\n    vec2 pos2 = mix(u_pattern_tl_b / u_texsize, u_pattern_br_b / u_texsize, imagecoord_b);\n    vec4 color2 = texture2D(u_image, pos2);\n\n    vec4 mixedColor = mix(color1, color2, u_mix);\n\n    gl_FragColor = mixedColor * v_lighting;\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\nuniform float u_height_factor;\n\nuniform vec3 u_lightcolor;\nuniform lowp vec3 u_lightpos;\nuniform lowp float u_lightintensity;\n\nattribute vec2 a_pos;\nattribute vec3 a_normal;\nattribute float a_edgedistance;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec4 v_lighting;\nvarying float v_directional;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n\nvoid main() {\n    #pragma mapbox: initialize lowp float base\n    #pragma mapbox: initialize lowp float height\n\n    base = max(0.0, base);\n    height = max(0.0, height);\n\n    float t = mod(a_normal.x, 2.0);\n    float z = t > 0.0 ? height : base;\n\n    gl_Position = u_matrix * vec4(a_pos, z, 1);\n\n    vec2 pos = a_normal.x == 1.0 && a_normal.y == 0.0 && a_normal.z == 16384.0\n        ? a_pos // extrusion top\n        : vec2(a_edgedistance, z * u_height_factor); // extrusion side\n\n    v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_a * u_pattern_size_a, u_tile_units_to_pixels, pos);\n    v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, u_scale_b * u_pattern_size_b, u_tile_units_to_pixels, pos);\n\n    v_lighting = vec4(0.0, 0.0, 0.0, 1.0);\n    float directional = clamp(dot(a_normal / 16383.0, u_lightpos), 0.0, 1.0);\n    directional = mix((1.0 - u_lightintensity), max((0.5 + u_lightintensity), 1.0), directional);\n\n    if (a_normal.y != 0.0) {\n        directional *= clamp((t + base) * pow(height / 150.0, 0.5), mix(0.7, 0.98, 1.0 - u_lightintensity), 1.0);\n    }\n\n    v_lighting.rgb += clamp(directional * u_lightcolor, mix(vec3(0.0), vec3(0.3), 1.0 - u_lightcolor), vec3(1.0));\n}\n"},extrusionTexture:{fragmentSource:"uniform sampler2D u_image;\nuniform float u_opacity;\nvarying vec2 v_pos;\n\nvoid main() {\n    gl_FragColor = texture2D(u_image, v_pos) * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(0.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_world;\nattribute vec2 a_pos;\nvarying vec2 v_pos;\n\nvoid main() {\n    gl_Position = u_matrix * vec4(a_pos * u_world, 0, 1);\n\n    v_pos.x = a_pos.x;\n    v_pos.y = 1.0 - a_pos.y;\n}\n"},line:{fragmentSource:"#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_width2;\nvarying vec2 v_normal;\nvarying float v_gamma_scale;\n\nvoid main() {\n    #pragma mapbox: initialize highp vec4 color\n    #pragma mapbox: initialize lowp float blur\n    #pragma mapbox: initialize lowp float opacity\n\n    // Calculate the distance of the pixel from the line in pixels.\n    float dist = length(v_normal) * v_width2.s;\n\n    // Calculate the antialiasing fade factor. This is either when fading in\n    // the line in case of an offset line (v_width2.t) or when fading out\n    // (v_width2.s)\n    float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n    float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n    gl_FragColor = color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\nattribute vec4 a_pos_normal;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n\nvoid main() {\n    #pragma mapbox: initialize highp vec4 color\n    #pragma mapbox: initialize lowp float blur\n    #pragma mapbox: initialize lowp float opacity\n    #pragma mapbox: initialize mediump float gapwidth\n    #pragma mapbox: initialize lowp float offset\n    #pragma mapbox: initialize mediump float width\n\n    vec2 a_extrude = a_data.xy - 128.0;\n    float a_direction = mod(a_data.z, 4.0) - 1.0;\n\n    vec2 pos = a_pos_normal.xy;\n\n    // x is 1 if it's a round cap, 0 otherwise\n    // y is 1 if the normal points up, and -1 if it points down\n    mediump vec2 normal = a_pos_normal.zw;\n    v_normal = normal;\n\n    // these transformations used to be applied in the JS and native code bases.\n    // moved them into the shader for clarity and simplicity.\n    gapwidth = gapwidth / 2.0;\n    float halfwidth = width / 2.0;\n    offset = -1.0 * offset;\n\n    float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n    float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + ANTIALIASING;\n\n    // Scale the extrusion vector down to a normal and then up by the line width\n    // of this vertex.\n    mediump vec2 dist = outset * a_extrude * scale;\n\n    // Calculate the offset when drawing a line that is to the side of the actual line.\n    // We do this by creating a vector that points towards the extrude, but rotate\n    // it when we're drawing round end points (a_direction = -1 or 1) since their\n    // extrude vector points in another direction.\n    mediump float u = 0.5 * a_direction;\n    mediump float t = 1.0 - abs(u);\n    mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n    vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n    gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n    // calculate how much the perspective view squishes or stretches the extrude\n    float extrude_length_without_perspective = length(dist);\n    float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n    v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n    v_width2 = vec2(outset, inset);\n}\n"},linePattern:{fragmentSource:"uniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform vec2 u_texsize;\nuniform float u_fade;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n    #pragma mapbox: initialize lowp float blur\n    #pragma mapbox: initialize lowp float opacity\n\n    // Calculate the distance of the pixel from the line in pixels.\n    float dist = length(v_normal) * v_width2.s;\n\n    // Calculate the antialiasing fade factor. This is either when fading in\n    // the line in case of an offset line (v_width2.t) or when fading out\n    // (v_width2.s)\n    float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n    float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n    float x_a = mod(v_linesofar / u_pattern_size_a.x, 1.0);\n    float x_b = mod(v_linesofar / u_pattern_size_b.x, 1.0);\n    float y_a = 0.5 + (v_normal.y * v_width2.s / u_pattern_size_a.y);\n    float y_b = 0.5 + (v_normal.y * v_width2.s / u_pattern_size_b.y);\n    vec2 pos_a = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, vec2(x_a, y_a));\n    vec2 pos_b = mix(u_pattern_tl_b / u_texsize, u_pattern_br_b / u_texsize, vec2(x_b, y_b));\n\n    vec4 color = mix(texture2D(u_image, pos_a), texture2D(u_image, pos_b), u_fade);\n\n    gl_FragColor = color * alpha * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\nattribute vec4 a_pos_normal;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n\nvoid main() {\n    #pragma mapbox: initialize lowp float blur\n    #pragma mapbox: initialize lowp float opacity\n    #pragma mapbox: initialize lowp float offset\n    #pragma mapbox: initialize mediump float gapwidth\n    #pragma mapbox: initialize mediump float width\n\n    vec2 a_extrude = a_data.xy - 128.0;\n    float a_direction = mod(a_data.z, 4.0) - 1.0;\n    float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n    vec2 pos = a_pos_normal.xy;\n\n    // x is 1 if it's a round cap, 0 otherwise\n    // y is 1 if the normal points up, and -1 if it points down\n    mediump vec2 normal = a_pos_normal.zw;\n    v_normal = normal;\n\n    // these transformations used to be applied in the JS and native code bases.\n    // moved them into the shader for clarity and simplicity.\n    gapwidth = gapwidth / 2.0;\n    float halfwidth = width / 2.0;\n    offset = -1.0 * offset;\n\n    float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n    float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + ANTIALIASING;\n\n    // Scale the extrusion vector down to a normal and then up by the line width\n    // of this vertex.\n    mediump vec2 dist = outset * a_extrude * scale;\n\n    // Calculate the offset when drawing a line that is to the side of the actual line.\n    // We do this by creating a vector that points towards the extrude, but rotate\n    // it when we're drawing round end points (a_direction = -1 or 1) since their\n    // extrude vector points in another direction.\n    mediump float u = 0.5 * a_direction;\n    mediump float t = 1.0 - abs(u);\n    mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n    vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n    gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n    // calculate how much the perspective view squishes or stretches the extrude\n    float extrude_length_without_perspective = length(dist);\n    float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n    v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n    v_linesofar = a_linesofar;\n    v_width2 = vec2(outset, inset);\n}\n"},lineSDF:{fragmentSource:"\nuniform sampler2D u_image;\nuniform float u_sdfgamma;\nuniform float u_mix;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n\nvoid main() {\n    #pragma mapbox: initialize highp vec4 color\n    #pragma mapbox: initialize lowp float blur\n    #pragma mapbox: initialize lowp float opacity\n    #pragma mapbox: initialize mediump float width\n    #pragma mapbox: initialize lowp float floorwidth\n\n    // Calculate the distance of the pixel from the line in pixels.\n    float dist = length(v_normal) * v_width2.s;\n\n    // Calculate the antialiasing fade factor. This is either when fading in\n    // the line in case of an offset line (v_width2.t) or when fading out\n    // (v_width2.s)\n    float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n    float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n    float sdfdist_a = texture2D(u_image, v_tex_a).a;\n    float sdfdist_b = texture2D(u_image, v_tex_b).a;\n    float sdfdist = mix(sdfdist_a, sdfdist_b, u_mix);\n    alpha *= smoothstep(0.5 - u_sdfgamma / floorwidth, 0.5 + u_sdfgamma / floorwidth, sdfdist);\n\n    gl_FragColor = color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\nattribute vec4 a_pos_normal;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform vec2 u_patternscale_a;\nuniform float u_tex_y_a;\nuniform vec2 u_patternscale_b;\nuniform float u_tex_y_b;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n\nvoid main() {\n    #pragma mapbox: initialize highp vec4 color\n    #pragma mapbox: initialize lowp float blur\n    #pragma mapbox: initialize lowp float opacity\n    #pragma mapbox: initialize mediump float gapwidth\n    #pragma mapbox: initialize lowp float offset\n    #pragma mapbox: initialize mediump float width\n    #pragma mapbox: initialize lowp float floorwidth\n\n    vec2 a_extrude = a_data.xy - 128.0;\n    float a_direction = mod(a_data.z, 4.0) - 1.0;\n    float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n    vec2 pos = a_pos_normal.xy;\n\n    // x is 1 if it's a round cap, 0 otherwise\n    // y is 1 if the normal points up, and -1 if it points down\n    mediump vec2 normal = a_pos_normal.zw;\n    v_normal = normal;\n\n    // these transformations used to be applied in the JS and native code bases.\n    // moved them into the shader for clarity and simplicity.\n    gapwidth = gapwidth / 2.0;\n    float halfwidth = width / 2.0;\n    offset = -1.0 * offset;\n\n    float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n    float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + ANTIALIASING;\n\n    // Scale the extrusion vector down to a normal and then up by the line width\n    // of this vertex.\n    mediump vec2 dist =outset * a_extrude * scale;\n\n    // Calculate the offset when drawing a line that is to the side of the actual line.\n    // We do this by creating a vector that points towards the extrude, but rotate\n    // it when we're drawing round end points (a_direction = -1 or 1) since their\n    // extrude vector points in another direction.\n    mediump float u = 0.5 * a_direction;\n    mediump float t = 1.0 - abs(u);\n    mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n    vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n    gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n    // calculate how much the perspective view squishes or stretches the extrude\n    float extrude_length_without_perspective = length(dist);\n    float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n    v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n    v_tex_a = vec2(a_linesofar * u_patternscale_a.x / floorwidth, normal.y * u_patternscale_a.y + u_tex_y_a);\n    v_tex_b = vec2(a_linesofar * u_patternscale_b.x / floorwidth, normal.y * u_patternscale_b.y + u_tex_y_b);\n\n    v_width2 = vec2(outset, inset);\n}\n"},raster:{fragmentSource:"uniform float u_fade_t;\nuniform float u_opacity;\nuniform sampler2D u_image0;\nuniform sampler2D u_image1;\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nuniform float u_brightness_low;\nuniform float u_brightness_high;\n\nuniform float u_saturation_factor;\nuniform float u_contrast_factor;\nuniform vec3 u_spin_weights;\n\nvoid main() {\n\n    // read and cross-fade colors from the main and parent tiles\n    vec4 color0 = texture2D(u_image0, v_pos0);\n    vec4 color1 = texture2D(u_image1, v_pos1);\n    if (color0.a > 0.0) {\n        color0.rgb = color0.rgb / color0.a;\n    }\n    if (color1.a > 0.0) {\n        color1.rgb = color1.rgb / color1.a;\n    }\n    vec4 color = mix(color0, color1, u_fade_t);\n    color.a *= u_opacity;\n    vec3 rgb = color.rgb;\n\n    // spin\n    rgb = vec3(\n        dot(rgb, u_spin_weights.xyz),\n        dot(rgb, u_spin_weights.zxy),\n        dot(rgb, u_spin_weights.yzx));\n\n    // saturation\n    float average = (color.r + color.g + color.b) / 3.0;\n    rgb += (average - rgb) * u_saturation_factor;\n\n    // contrast\n    rgb = (rgb - 0.5) * u_contrast_factor + 0.5;\n\n    // brightness\n    vec3 u_high_vec = vec3(u_brightness_low, u_brightness_low, u_brightness_low);\n    vec3 u_low_vec = vec3(u_brightness_high, u_brightness_high, u_brightness_high);\n\n    gl_FragColor = vec4(mix(u_high_vec, u_low_vec, rgb) * color.a, color.a);\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_tl_parent;\nuniform float u_scale_parent;\nuniform float u_buffer_scale;\n\nattribute vec2 a_pos;\nattribute vec2 a_texture_pos;\n\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nvoid main() {\n    gl_Position = u_matrix * vec4(a_pos, 0, 1);\n    // We are using Int16 for texture position coordinates to give us enough precision for\n    // fractional coordinates. We use 8192 to scale the texture coordinates in the buffer\n    // as an arbitrarily high number to preserve adequate precision when rendering.\n    // This is also the same value as the EXTENT we are using for our tile buffer pos coordinates,\n    // so math for modifying either is consistent.\n    v_pos0 = (((a_texture_pos / 8192.0) - 0.5) / u_buffer_scale ) + 0.5;\n    v_pos1 = (v_pos0 * u_scale_parent) + u_tl_parent;\n}\n"},symbolIcon:{fragmentSource:"uniform sampler2D u_texture;\nuniform sampler2D u_fadetexture;\n\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\n\nvoid main() {\n    #pragma mapbox: initialize lowp float opacity\n\n    lowp float alpha = texture2D(u_fadetexture, v_fade_tex).a * opacity;\n    gl_FragColor = texture2D(u_texture, v_tex) * alpha;\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"const float PI = 3.141592653589793;\n\nattribute vec4 a_pos_offset;\nattribute vec4 a_data;\nattribute vec3 a_projected_pos;\n\nuniform bool u_is_size_zoom_constant;\nuniform bool u_is_size_feature_constant;\nuniform highp float u_size_t; // used to interpolate between zoom stops when size is a composite function\nuniform highp float u_size; // used when size is both zoom and feature constant\nuniform highp float u_camera_to_center_distance;\nuniform highp float u_pitch;\nuniform bool u_rotate_symbol;\nuniform highp float u_aspect_ratio;\nuniform highp float u_collision_y_stretch;\n\n#pragma mapbox: define lowp float opacity\n\nuniform mat4 u_matrix;\nuniform mat4 u_label_plane_matrix;\nuniform mat4 u_gl_coord_matrix;\n\nuniform bool u_is_text;\nuniform bool u_pitch_with_map;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\n\nvoid main() {\n    #pragma mapbox: initialize lowp float opacity\n\n    vec2 a_pos = a_pos_offset.xy;\n    vec2 a_offset = a_pos_offset.zw;\n\n    vec2 a_tex = a_data.xy;\n    vec2 a_size = a_data.zw;\n\n    highp vec2 angle_labelminzoom = unpack_float(a_projected_pos[2]);\n    highp float segment_angle = -angle_labelminzoom[0] / 255.0 * 2.0 * PI;\n    mediump float a_labelminzoom = angle_labelminzoom[1];\n\n    float size;\n    if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {\n        size = mix(a_size[0], a_size[1], u_size_t) / 10.0;\n    } else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {\n        size = a_size[0] / 10.0;\n    } else if (!u_is_size_zoom_constant && u_is_size_feature_constant) {\n        size = u_size;\n    } else {\n        size = u_size;\n    }\n\n    vec4 projectedPoint = u_matrix * vec4(a_pos, 0, 1);\n    highp float camera_to_anchor_distance = projectedPoint.w;\n    // See comments in symbol_sdf.vertex\n    highp float distance_ratio = u_pitch_with_map ?\n        camera_to_anchor_distance / u_camera_to_center_distance :\n        u_camera_to_center_distance / camera_to_anchor_distance;\n    highp float perspective_ratio = 0.5 + 0.5 * distance_ratio;\n\n    size *= perspective_ratio;\n\n    float fontScale = u_is_text ? size / 24.0 : size;\n\n    highp float symbol_rotation = 0.0;\n    if (u_rotate_symbol) {\n        // See comments in symbol_sdf.vertex\n        vec4 offsetProjectedPoint = u_matrix * vec4(a_pos + vec2(1, 0), 0, 1);\n\n        vec2 a = projectedPoint.xy / projectedPoint.w;\n        vec2 b = offsetProjectedPoint.xy / offsetProjectedPoint.w;\n\n        symbol_rotation = atan((b.y - a.y) / u_aspect_ratio, b.x - a.x);\n    }\n\n    highp float angle_sin = sin(segment_angle + symbol_rotation);\n    highp float angle_cos = cos(segment_angle + symbol_rotation);\n    mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos);\n\n    vec4 projected_pos = u_label_plane_matrix * vec4(a_projected_pos.xy, 0.0, 1.0);\n    gl_Position = u_gl_coord_matrix * vec4(projected_pos.xy / projected_pos.w + rotation_matrix * (a_offset / 64.0 * fontScale), 0.0, 1.0);\n\n    v_tex = a_tex / u_texsize;\n    // See comments in symbol_sdf.vertex\n    highp float incidence_stretch  = camera_to_anchor_distance / (u_camera_to_center_distance * cos(u_pitch));\n    highp float collision_adjustment = max(1.0, incidence_stretch / u_collision_y_stretch);\n\n    highp float collision_perspective_ratio = 1.0 + 0.5*((camera_to_anchor_distance / u_camera_to_center_distance) - 1.0);\n    highp float perspective_zoom_adjust = floor(log2(collision_perspective_ratio * collision_adjustment) * 10.0);\n    v_fade_tex = vec2((a_labelminzoom + perspective_zoom_adjust) / 255.0, 0.0);\n}\n"},symbolSDF:{fragmentSource:"#define SDF_PX 8.0\n#define EDGE_GAMMA 0.105/DEVICE_PIXEL_RATIO\n\nuniform bool u_is_halo;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\n\nuniform sampler2D u_texture;\nuniform sampler2D u_fadetexture;\nuniform highp float u_gamma_scale;\nuniform bool u_is_text;\n\nvarying vec4 v_data0;\nvarying vec2 v_data1;\n\nvoid main() {\n    #pragma mapbox: initialize highp vec4 fill_color\n    #pragma mapbox: initialize highp vec4 halo_color\n    #pragma mapbox: initialize lowp float opacity\n    #pragma mapbox: initialize lowp float halo_width\n    #pragma mapbox: initialize lowp float halo_blur\n\n    vec2 tex = v_data0.xy;\n    vec2 fade_tex = v_data0.zw;\n    float gamma_scale = v_data1.x;\n    float size = v_data1.y;\n\n    float fontScale = u_is_text ? size / 24.0 : size;\n\n    lowp vec4 color = fill_color;\n    highp float gamma = EDGE_GAMMA / (fontScale * u_gamma_scale);\n    lowp float buff = (256.0 - 64.0) / 256.0;\n    if (u_is_halo) {\n        color = halo_color;\n        gamma = (halo_blur * 1.19 / SDF_PX + EDGE_GAMMA) / (fontScale * u_gamma_scale);\n        buff = (6.0 - halo_width / fontScale) / SDF_PX;\n    }\n\n    lowp float dist = texture2D(u_texture, tex).a;\n    lowp float fade_alpha = texture2D(u_fadetexture, fade_tex).a;\n    highp float gamma_scaled = gamma * gamma_scale;\n    highp float alpha = smoothstep(buff - gamma_scaled, buff + gamma_scaled, dist) * fade_alpha;\n\n    gl_FragColor = color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n    gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"const float PI = 3.141592653589793;\n\nattribute vec4 a_pos_offset;\nattribute vec4 a_data;\nattribute vec3 a_projected_pos;\n\n// contents of a_size vary based on the type of property value\n// used for {text,icon}-size.\n// For constants, a_size is disabled.\n// For source functions, we bind only one value per vertex: the value of {text,icon}-size evaluated for the current feature.\n// For composite functions:\n// [ text-size(lowerZoomStop, feature),\n//   text-size(upperZoomStop, feature) ]\nuniform bool u_is_size_zoom_constant;\nuniform bool u_is_size_feature_constant;\nuniform highp float u_size_t; // used to interpolate between zoom stops when size is a composite function\nuniform highp float u_size; // used when size is both zoom and feature constant\n\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\n\nuniform mat4 u_matrix;\nuniform mat4 u_label_plane_matrix;\nuniform mat4 u_gl_coord_matrix;\n\nuniform bool u_is_text;\nuniform bool u_pitch_with_map;\nuniform highp float u_pitch;\nuniform bool u_rotate_symbol;\nuniform highp float u_aspect_ratio;\nuniform highp float u_camera_to_center_distance;\nuniform highp float u_collision_y_stretch;\n\nuniform vec2 u_texsize;\n\nvarying vec4 v_data0;\nvarying vec2 v_data1;\n\nvoid main() {\n    #pragma mapbox: initialize highp vec4 fill_color\n    #pragma mapbox: initialize highp vec4 halo_color\n    #pragma mapbox: initialize lowp float opacity\n    #pragma mapbox: initialize lowp float halo_width\n    #pragma mapbox: initialize lowp float halo_blur\n\n    vec2 a_pos = a_pos_offset.xy;\n    vec2 a_offset = a_pos_offset.zw;\n\n    vec2 a_tex = a_data.xy;\n    vec2 a_size = a_data.zw;\n\n    highp vec2 angle_labelminzoom = unpack_float(a_projected_pos[2]);\n    highp float segment_angle = -angle_labelminzoom[0] / 255.0 * 2.0 * PI;\n    mediump float a_labelminzoom = angle_labelminzoom[1];\n    float size;\n\n    if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {\n        size = mix(a_size[0], a_size[1], u_size_t) / 10.0;\n    } else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {\n        size = a_size[0] / 10.0;\n    } else if (!u_is_size_zoom_constant && u_is_size_feature_constant) {\n        size = u_size;\n    } else {\n        size = u_size;\n    }\n\n    vec4 projectedPoint = u_matrix * vec4(a_pos, 0, 1);\n    highp float camera_to_anchor_distance = projectedPoint.w;\n    // If the label is pitched with the map, layout is done in pitched space,\n    // which makes labels in the distance smaller relative to viewport space.\n    // We counteract part of that effect by multiplying by the perspective ratio.\n    // If the label isn't pitched with the map, we do layout in viewport space,\n    // which makes labels in the distance larger relative to the features around\n    // them. We counteract part of that effect by dividing by the perspective ratio.\n    highp float distance_ratio = u_pitch_with_map ?\n        camera_to_anchor_distance / u_camera_to_center_distance :\n        u_camera_to_center_distance / camera_to_anchor_distance;\n    highp float perspective_ratio = 0.5 + 0.5 * distance_ratio;\n\n    size *= perspective_ratio;\n\n    float fontScale = u_is_text ? size / 24.0 : size;\n\n    highp float symbol_rotation = 0.0;\n    if (u_rotate_symbol) {\n        // Point labels with 'rotation-alignment: map' are horizontal with respect to tile units\n        // To figure out that angle in projected space, we draw a short horizontal line in tile\n        // space, project it, and measure its angle in projected space.\n        vec4 offsetProjectedPoint = u_matrix * vec4(a_pos + vec2(1, 0), 0, 1);\n\n        vec2 a = projectedPoint.xy / projectedPoint.w;\n        vec2 b = offsetProjectedPoint.xy / offsetProjectedPoint.w;\n\n        symbol_rotation = atan((b.y - a.y) / u_aspect_ratio, b.x - a.x);\n    }\n\n    highp float angle_sin = sin(segment_angle + symbol_rotation);\n    highp float angle_cos = cos(segment_angle + symbol_rotation);\n    mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos);\n\n    vec4 projected_pos = u_label_plane_matrix * vec4(a_projected_pos.xy, 0.0, 1.0);\n    gl_Position = u_gl_coord_matrix * vec4(projected_pos.xy / projected_pos.w + rotation_matrix * (a_offset / 64.0 * fontScale), 0.0, 1.0);\n    float gamma_scale = gl_Position.w;\n\n    vec2 tex = a_tex / u_texsize;\n    // incidence_stretch is the ratio of how much y space a label takes up on a tile while drawn perpendicular to the viewport vs\n    //  how much space it would take up if it were drawn flat on the tile\n    // Using law of sines, camera_to_anchor/sin(ground_angle) = camera_to_center/sin(incidence_angle)\n    // sin(incidence_angle) = 1/incidence_stretch\n    // Incidence angle 90 -> head on, sin(incidence_angle) = 1, no incidence stretch\n    // Incidence angle 1 -> very oblique, sin(incidence_angle) =~ 0, lots of incidence stretch\n    // ground_angle = u_pitch + PI/2 -> sin(ground_angle) = cos(u_pitch)\n    // This 2D calculation is only exactly correct when gl_Position.x is in the center of the viewport,\n    //  but it's a close enough approximation for our purposes\n    highp float incidence_stretch  = camera_to_anchor_distance / (u_camera_to_center_distance * cos(u_pitch));\n    // incidence_stretch only applies to the y-axis, but without re-calculating the collision tile, we can't\n    // adjust the size of only one axis. So, we do a crude approximation at placement time to get the aspect ratio\n    // about right, and then do the rest of the adjustment here: there will be some extra padding on the x-axis,\n    // but hopefully not too much.\n    // Never make the adjustment less than 1.0: instead of allowing collisions on the x-axis, be conservative on\n    // the y-axis.\n    highp float collision_adjustment = max(1.0, incidence_stretch / u_collision_y_stretch);\n\n    // Floor to 1/10th zoom to dodge precision issues that can cause partially hidden labels\n    highp float collision_perspective_ratio = 1.0 + 0.5*((camera_to_anchor_distance / u_camera_to_center_distance) - 1.0);\n    highp float perspective_zoom_adjust = floor(log2(collision_perspective_ratio * collision_adjustment) * 10.0);\n    vec2 fade_tex = vec2((a_labelminzoom + perspective_zoom_adjust) / 255.0, 0.0);\n\n    v_data0 = vec4(tex.x, tex.y, fade_tex.x, fade_tex.y);\n    v_data1 = vec2(gamma_scale, size);\n}\n"}},r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,f=function(n){var t=i[n],u={};t.fragmentSource=t.fragmentSource.replace(r,function(n,t,i,r,f){return u[f]=!0,"define"===t?"\n#ifndef HAS_UNIFORM_u_"+f+"\nvarying "+i+" "+r+" "+f+";\n#else\nuniform "+i+" "+r+" u_"+f+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+f+"\n    "+i+" "+r+" "+f+" = u_"+f+";\n#endif\n"});t.vertexSource=t.vertexSource.replace(r,function(n,t,i,r,f){var e="float"===r?"vec2":"vec4";return u[f]?"define"===t?"\n#ifndef HAS_UNIFORM_u_"+f+"\nuniform lowp float a_"+f+"_t;\nattribute "+i+" "+e+" a_"+f+";\nvarying "+i+" "+r+" "+f+";\n#else\nuniform "+i+" "+r+" u_"+f+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+f+"\n    "+f+" = unpack_mix_"+e+"(a_"+f+", a_"+f+"_t);\n#else\n    "+i+" "+r+" "+f+" = u_"+f+";\n#endif\n":"define"===t?"\n#ifndef HAS_UNIFORM_u_"+f+"\nuniform lowp float a_"+f+"_t;\nattribute "+i+" "+e+" a_"+f+";\n#else\nuniform "+i+" "+r+" u_"+f+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+f+"\n    "+i+" "+r+" "+f+" = unpack_mix_"+e+"(a_"+f+", a_"+f+"_t);\n#else\n    "+i+" "+r+" "+f+" = u_"+f+";\n#endif\n"})},u;for(u in i)f(u);t.exports=i},{}],99:[function(n,t){"use strict";var i=n("./image_source"),r=n("../util/window"),u=function(n){function t(t,i,r,u){n.call(this,t,i,r,u);this.options=i;this.animate=void 0===i.animate||i.animate}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.load=function(){if(this.canvas=this.canvas||r.document.getElementById(this.options.canvas),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions())return this.fire("error",new Error("Canvas dimensions cannot be less than or equal to zero."));var n;this.play=function(){void 0===n&&(n=this.map.style.animationLoop.set(1/0),this.map._rerender())};this.pause=function(){void 0!==n&&(n=this.map.style.animationLoop.cancel(n))};this._finishLoading()},t.prototype.getCanvas=function(){return this.canvas},t.prototype.onAdd=function(n){this.map=n;this.load();this.canvas&&this.animate&&this.play()},t.prototype.onRemove=function(){this.pause()},t.prototype.prepare=function(){var n=!1;this.canvas.width!==this.width&&(this.width=this.canvas.width,n=!0);this.canvas.height!==this.height&&(this.height=this.canvas.height,n=!0);this._hasInvalidDimensions()||0!==Object.keys(this.tiles).length&&this._prepareImage(this.map.painter.gl,this.canvas,n)},t.prototype.serialize=function(){return{type:"canvas",canvas:this.canvas,coordinates:this.coordinates}},t.prototype._hasInvalidDimensions=function(){for(var t,i=this,n=0,r=[i.canvas.width,i.canvas.height];n<r.length;n+=1)if(t=r[n],isNaN(t)||t<=0)return!0;return!1},t}(i);t.exports=u},{"../util/window":233,"./image_source":103}],100:[function(n,t){"use strict";function u(n){var t=e.document.createElement("a");return t.href=n,t.href}var f=n("../util/evented"),i=n("../util/util"),e=n("../util/window"),r=n("../data/extent"),o=n("../util/ajax").ResourceType,s=n("../util/browser"),h=function(n){function t(t,u,f,e){n.call(this);this.id=t;this.type="geojson";this.minzoom=0;this.maxzoom=18;this.tileSize=512;this.isTileClipped=!0;this.reparseOverscaled=!0;this.dispatcher=f;this.setEventedParent(e);this._data=u.data;this._options=i.extend({},u);void 0!==u.maxzoom&&(this.maxzoom=u.maxzoom);u.type&&(this.type=u.type);var o=r/this.tileSize;this.workerOptions=i.extend({source:this.id,cluster:u.cluster||!1,geojsonVtOptions:{buffer:(void 0!==u.buffer?u.buffer:128)*o,tolerance:(void 0!==u.tolerance?u.tolerance:.375)*o,extent:r,maxZoom:this.maxzoom},superclusterOptions:{maxZoom:void 0!==u.clusterMaxZoom?Math.min(u.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,extent:r,radius:(u.clusterRadius||50)*o,log:!1}},u.workerOptions)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.load=function(){var n=this;this.fire("dataloading",{dataType:"source"});this._updateWorkerData(function(t){if(t)return void n.fire("error",{error:t});n.fire("data",{dataType:"source",sourceDataType:"metadata"})})},t.prototype.onAdd=function(n){this.map=n;this.load()},t.prototype.setData=function(n){var t=this;return this._data=n,this.fire("dataloading",{dataType:"source"}),this._updateWorkerData(function(n){if(n)return t.fire("error",{error:n});t.fire("data",{dataType:"source",sourceDataType:"content"})}),this},t.prototype._updateWorkerData=function(n){var f=this,t=i.extend({},this.workerOptions),r=this._data;"string"==typeof r?t.request=this.map._transformRequest(u(r),o.Source):t.data=JSON.stringify(r);this.workerID=this.dispatcher.send(this.type+".loadData",t,function(t){f._loaded=!0;n(t)},this.workerID)},t.prototype.loadTile=function(n,t){var i=this,r=void 0===n.workerID||"expired"===n.state?"loadTile":"reloadTile",u={type:this.type,uid:n.uid,coord:n.coord,zoom:n.coord.z,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:s.devicePixelRatio,overscaling:n.coord.z>this.maxzoom?Math.pow(2,n.coord.z-this.maxzoom):1,angle:this.map.transform.angle,pitch:this.map.transform.pitch,cameraToCenterDistance:this.map.transform.cameraToCenterDistance,cameraToTileDistance:this.map.transform.cameraToTileDistance(n),showCollisionBoxes:this.map.showCollisionBoxes};n.workerID=this.dispatcher.send(r,u,function(r,u){if(n.unloadVectorData(),!n.aborted)return r?t(r):(n.loadVectorData(u,i.map.painter),n.redoWhenDone&&(n.redoWhenDone=!1,n.redoPlacement(i)),t(null))},this.workerID)},t.prototype.abortTile=function(n){n.aborted=!0},t.prototype.unloadTile=function(n){n.unloadVectorData();this.dispatcher.send("removeTile",{uid:n.uid,type:this.type,source:this.id},function(){},n.workerID)},t.prototype.onRemove=function(){this.dispatcher.broadcast("removeSource",{type:this.type,source:this.id},function(){})},t.prototype.serialize=function(){return i.extend({},this._options,{type:this.type,data:this._data})},t}(f);t.exports=h},{"../data/extent":58,"../util/ajax":230,"../util/browser":231,"../util/evented":239,"../util/util":252,"../util/window":233}],101:[function(n,t){"use strict";function i(n,t){var s=n.source,r=n.coord,u,o,i;if(!this._geoJSONIndexes[s]||(u=this._geoJSONIndexes[s].getTile(Math.min(r.z,n.maxZoom),r.x,r.y),!u))return t(null,null);o=new f(u.features);i=e(o);0===i.byteOffset&&i.byteLength===i.buffer.byteLength||(i=new Uint8Array(i));t(null,{vectorTile:o,rawData:i.buffer})}var r=n("../util/ajax"),u=n("geojson-rewind"),f=n("./geojson_wrapper"),e=n("vt-pbf"),o=n("supercluster"),s=n("geojson-vt"),h=n("./vector_tile_worker_source"),c=function(n){function t(t,r,u){n.call(this,t,r,i);u&&(this.loadGeoJSON=u);this._geoJSONIndexes={}}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.loadData=function(n,t){var i=this;this.loadGeoJSON(n,function(r,f){if(r||!f)return t(r);if("object"!=typeof f)return t(new Error("Input data is not a valid GeoJSON object."));u(f,!0);try{i._geoJSONIndexes[n.source]=n.cluster?o(n.superclusterOptions).load(f.features):s(f,n.geojsonVtOptions)}catch(r){return t(r)}i.loaded[n.source]={};t(null)})},t.prototype.reloadTile=function(t,i){var r=this.loaded[t.source],u=t.uid;return r&&r[u]?n.prototype.reloadTile.call(this,t,i):this.loadTile(t,i)},t.prototype.loadGeoJSON=function(n,t){if(n.request)r.getJSON(n.request,t);else{if("string"!=typeof n.data)return t(new Error("Input data is not a valid GeoJSON object."));try{return t(null,JSON.parse(n.data))}catch(n){return t(new Error("Input data is not a valid GeoJSON object."))}}},t.prototype.removeSource=function(n){this._geoJSONIndexes[n.source]&&delete this._geoJSONIndexes[n.source]},t}(h);t.exports=c},{"../util/ajax":230,"./geojson_wrapper":102,"./vector_tile_worker_source":115,"geojson-rewind":14,"geojson-vt":18,supercluster:41,"vt-pbf":46}],102:[function(n,t){"use strict";var u=n("@mapbox/point-geometry"),e=n("@mapbox/vector-tile").VectorTileFeature.prototype.toGeoJSON,f=n("../data/extent"),i=function(n){this._feature=n;this.extent=f;this.type=n.type;this.properties=n.tags;"id"in n&&!isNaN(n.id)&&(this.id=parseInt(n.id,10))},r;i.prototype.loadGeometry=function(){var e=this,t,f;if(1===this._feature.type){for(var o=[],n=0,s=e._feature.geometry;n<s.length;n+=1)t=s[n],o.push([new u(t[0],t[1])]);return o}for(var h=[],i=0,c=e._feature.geometry;i<c.length;i+=1){for(var v=c[i],l=[],r=0,a=v;r<a.length;r+=1)f=a[r],l.push(new u(f[0],f[1]));h.push(l)}return h};i.prototype.toGeoJSON=function(n,t,i){return e.call(this,n,t,i)};r=function(n){this.layers={_geojsonTileLayer:this};this.name="_geojsonTileLayer";this.extent=f;this.length=n.length;this._features=n};r.prototype.feature=function(n){return new i(this._features[n])};t.exports=r},{"../data/extent":58,"@mapbox/point-geometry":2,"@mapbox/vector-tile":6}],103:[function(n,t){"use strict";var f=n("../util/util"),r=n("../util/window"),e=n("./tile_coord"),o=n("../geo/lng_lat"),s=n("@mapbox/point-geometry"),h=n("../util/evented"),u=n("../util/ajax"),c=n("../util/browser"),i=n("../data/extent"),l=n("../data/raster_bounds_array"),a=n("../gl/vertex_buffer"),v=n("../render/vertex_array_object"),y=n("../render/texture"),p=function(n){function t(t,i,r,u){n.call(this);this.id=t;this.dispatcher=r;this.coordinates=i.coordinates;this.type="image";this.minzoom=0;this.maxzoom=22;this.tileSize=512;this.tiles={};this.setEventedParent(u);this.options=i;this.textureLoaded=!1}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.load=function(){var n=this;this.fire("dataloading",{dataType:"source"});this.url=this.options.url;u.getImage(this.map._transformRequest(this.url,u.ResourceType.Image),function(t,i){t?n.fire("error",{error:t}):i&&(n.image=c.getImageData(i),n._finishLoading())})},t.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire("data",{dataType:"source",sourceDataType:"metadata"}))},t.prototype.onAdd=function(n){this.map=n;this.load()},t.prototype.setCoordinates=function(n){var r;this.coordinates=n;var h=this.map,u=n.map(function(n){return h.transform.locationCoordinate(o.convert(n)).zoomTo(0)}),t=this.centerCoord=f.getCoordinatesCenter(u);return t.column=Math.floor(t.column),t.row=Math.floor(t.row),this.coord=new e(t.zoom,t.column,t.row),this.minzoom=this.maxzoom=t.zoom,r=u.map(function(n){var r=n.zoomTo(t.zoom);return new s(Math.round((r.column-t.column)*i),Math.round((r.row-t.row)*i))}),this._boundsArray=new l,this._boundsArray.emplaceBack(r[0].x,r[0].y,0,0),this._boundsArray.emplaceBack(r[1].x,r[1].y,i,0),this._boundsArray.emplaceBack(r[3].x,r[3].y,0,i),this._boundsArray.emplaceBack(r[2].x,r[2].y,i,i),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire("data",{dataType:"source",sourceDataType:"content"}),this},t.prototype.prepare=function(){0!==Object.keys(this.tiles).length&&this.image&&this._prepareImage(this.map.painter.gl,this.image)},t.prototype._prepareImage=function(n,t,i){var f=this,e,u;this.boundsBuffer||(this.boundsBuffer=new a(n,this._boundsArray));this.boundsVAO||(this.boundsVAO=new v);this.textureLoaded?i?this.texture.update(t):(t instanceof r.HTMLVideoElement||t instanceof r.ImageData||t instanceof r.HTMLCanvasElement)&&(this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE),n.texSubImage2D(n.TEXTURE_2D,0,0,0,n.RGBA,n.UNSIGNED_BYTE,t)):(this.textureLoaded=!0,this.texture=new y(n,t,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE));for(e in f.tiles)u=f.tiles[e],"loaded"!==u.state&&(u.state="loaded",u.texture=f.texture)},t.prototype.loadTile=function(n,t){this.coord&&this.coord.toString()===n.coord.toString()?(this.tiles[String(n.coord.w)]=n,n.buckets={},t(null)):(n.state="errored",t(null))},t.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},t}(h);t.exports=p},{"../data/extent":58,"../data/raster_bounds_array":64,"../geo/lng_lat":68,"../gl/vertex_buffer":72,"../render/texture":94,"../render/vertex_array_object":96,"../util/ajax":230,"../util/browser":231,"../util/evented":239,"../util/util":252,"../util/window":233,"./tile_coord":113,"@mapbox/point-geometry":2}],104:[function(n,t){"use strict";var r=n("../util/util"),i=n("../util/ajax"),u=n("../util/browser"),f=n("../util/mapbox").normalizeSourceURL;t.exports=function(n,t,e){var o=function(n,t){if(n)return e(n);if(t){var i=r.pick(t,["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds"]);t.vector_layers&&(i.vectorLayers=t.vector_layers,i.vectorLayerIds=i.vectorLayers.map(function(n){return n.id}));e(null,i)}};n.url?i.getJSON(t(f(n.url),i.ResourceType.Source),o):u.frame(function(){return o(null,n)})}},{"../util/ajax":230,"../util/browser":231,"../util/mapbox":246,"../util/util":252}],105:[function(n,t){"use strict";var i=n("../data/extent");t.exports=function(n,t,r){return t*(i/(n.tileSize*Math.pow(2,r-n.coord.z)))}},{"../data/extent":58}],106:[function(n,t,i){"use strict";function r(n,t){var i=n.coord,r=t.coord;return i.z-r.z||i.y-r.y||i.w-r.w||i.x-r.x}function u(n){for(var t,i,r={},e={},u=0,o=n;u<o.length;u+=1){var s=o[u],h=s.queryResults,c=s.wrappedTileID,l=e[c]=e[c]||{};for(t in h)for(var y=h[t],a=l[t]=l[t]||{},p=r[t]=r[t]||[],f=0,v=y;f<v.length;f+=1)i=v[f],a[i.featureIndex]||(a[i.featureIndex]=!0,p.push(i.feature))}return r}var f=n("./tile_coord");i.rendered=function(n,t,i,f,e,o){var c=n.tilesIn(i),s;c.sort(r);for(var l=[],h=0,a=c;h<a.length;h+=1)s=a[h],l.push({wrappedTileID:s.coord.wrapped().id,queryResults:s.tile.queryRenderedFeatures(t,s.queryGeometry,s.scale,f,o)});return u(l)};i.source=function(n,t){for(var i,u,e=n.getRenderableIds().map(function(t){return n.getTileByID(t)}),o=[],s={},r=0;r<e.length;r++)i=e[r],u=new f(Math.min(i.sourceMaxZoom,i.coord.z),i.coord.x,i.coord.y,0).id,s[u]||(s[u]=!0,i.querySourceFeatures(o,t));return o}},{"./tile_coord":113}],107:[function(n,t){"use strict";var i=n("../util/util"),r=n("../util/ajax"),u=n("../util/evented"),f=n("./load_tilejson"),e=n("../util/mapbox").normalizeTileURL,o=n("./tile_bounds"),s=n("../render/texture"),h=function(n){function t(t,r,u,f){n.call(this);this.id=t;this.dispatcher=u;this.setEventedParent(f);this.type="raster";this.minzoom=0;this.maxzoom=22;this.roundZoom=!0;this.scheme="xyz";this.tileSize=512;this._loaded=!1;this._options=i.extend({},r);i.extend(this,i.pick(r,["url","scheme","tileSize"]))}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.load=function(){var n=this;this.fire("dataloading",{dataType:"source"});f(this._options,this.map._transformRequest,function(t,r){t?n.fire("error",t):r&&(i.extend(n,r),r.bounds&&(n.tileBounds=new o(r.bounds,n.minzoom,n.maxzoom)),n.fire("data",{dataType:"source",sourceDataType:"metadata"}),n.fire("data",{dataType:"source",sourceDataType:"content"}))})},t.prototype.onAdd=function(n){this.map=n;this.load()},t.prototype.serialize=function(){return i.extend({},this._options)},t.prototype.hasTile=function(n){return!this.tileBounds||this.tileBounds.contains(n,this.maxzoom)},t.prototype.loadTile=function(n,t){var i=this,u=e(n.coord.url(this.tiles,null,this.scheme),this.url,this.tileSize);n.request=r.getImage(this.map._transformRequest(u,r.ResourceType.Tile),function(r,u){if(delete n.request,n.aborted)n.state="unloaded",t(null);else if(r)n.state="errored",t(r);else if(u){i.map._refreshExpiredTiles&&n.setExpiryData(u);delete u.cacheControl;delete u.expires;var f=i.map.painter.gl;n.texture=i.map.painter.getTileTexture(u.width);n.texture?(n.texture.bind(f.LINEAR,f.CLAMP_TO_EDGE,f.LINEAR_MIPMAP_NEAREST),f.texSubImage2D(f.TEXTURE_2D,0,0,0,f.RGBA,f.UNSIGNED_BYTE,u)):(n.texture=new s(f,u,f.RGBA),n.texture.bind(f.LINEAR,f.CLAMP_TO_EDGE,f.LINEAR_MIPMAP_NEAREST),i.map.painter.extTextureFilterAnisotropic&&f.texParameterf(f.TEXTURE_2D,i.map.painter.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,i.map.painter.extTextureFilterAnisotropicMax));f.generateMipmap(f.TEXTURE_2D);n.state="loaded";t(null)}})},t.prototype.abortTile=function(n){n.request&&(n.request.abort(),delete n.request)},t.prototype.unloadTile=function(n){n.texture&&this.map.painter.saveTileTexture(n.texture)},t}(u);t.exports=h},{"../render/texture":94,"../util/ajax":230,"../util/evented":239,"../util/mapbox":246,"../util/util":252,"./load_tilejson":104,"./tile_bounds":112}],108:[function(n,t){"use strict";var f=n("../util/ajax"),e=n("../util/evented"),u=n("../util/window"),r=!1,i=null;t.exports.evented=new e;t.exports.registerForPluginAvailability=function(n){return i?n({pluginBlobURL:i,errorCallback:t.exports.errorCallback}):t.exports.evented.once("pluginAvailable",n),n};t.exports.createBlobURL=function(n){return u.URL.createObjectURL(new u.Blob([n.data],{type:"text/javascript"}))};t.exports.clearRTLTextPlugin=function(){r=!1;i=null};t.exports.setRTLTextPlugin=function(n,u){if(r)throw new Error("setRTLTextPlugin cannot be called multiple times.");r=!0;t.exports.errorCallback=u;f.getArrayBuffer({url:n},function(n,r){n?u(n):r&&(i=t.exports.createBlobURL(r),t.exports.evented.fire("pluginAvailable",{pluginBlobURL:i,errorCallback:u}))})};t.exports.applyArabicShaping=null;t.exports.processBidirectionalText=null},{"../util/ajax":230,"../util/evented":239,"../util/window":233}],109:[function(n,t,i){"use strict";var u=n("../util/util"),r={vector:n("../source/vector_tile_source"),raster:n("../source/raster_tile_source"),geojson:n("../source/geojson_source"),video:n("../source/video_source"),image:n("../source/image_source"),canvas:n("../source/canvas_source")};i.create=function(n,t,i,f){var e=new r[t.type](n,t,i,f);if(e.id!==n)throw new Error("Expected Source id to be "+n+" instead of "+e.id);return u.bindAll(["load","abort","unload","serialize","prepare"],e),e};i.getType=function(n){return r[n]};i.setType=function(n,t){r[n]=t}},{"../source/canvas_source":99,"../source/geojson_source":100,"../source/image_source":103,"../source/raster_tile_source":107,"../source/vector_tile_source":114,"../source/video_source":116,"../util/util":252}],110:[function(n,t){"use strict";function r(n,t,r){var u=r.zoomTo(Math.min(n.z,t));return new y((u.column-(n.x+n.w*Math.pow(2,n.z)))*i,(u.row-n.y)*i)}function o(n,t){return n%32-t%32}function s(n){return"raster"===n||"image"===n||"video"===n}var h=n("./source").create,c=n("./tile"),l=n("../util/evented"),u=n("./tile_coord"),a=n("../util/lru_cache"),e=n("../geo/coordinate"),v=n("../util/util"),i=n("../data/extent"),y=n("@mapbox/point-geometry"),f=function(n){function t(t,i,r){var u=this;n.call(this);this.id=t;this.dispatcher=r;this.on("data",function(n){"source"===n.dataType&&"metadata"===n.sourceDataType&&(u._sourceLoaded=!0);u._sourceLoaded&&!u._paused&&"source"===n.dataType&&"content"===n.sourceDataType&&(u.reload(),u.transform&&u.update(u.transform))});this.on("error",function(){u._sourceErrored=!0});this._source=h(t,i,r,this);this._tiles={};this._cache=new a(0,this._unloadTile.bind(this));this._timers={};this._cacheTimers={};this._maxTileCacheSize=null;this._isIdRenderable=this._isIdRenderable.bind(this)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.onAdd=function(n){this.map=n;this._maxTileCacheSize=n?n._maxTileCacheSize:null;this._source&&this._source.onAdd&&this._source.onAdd(n)},t.prototype.onRemove=function(n){this._source&&this._source.onRemove&&this._source.onRemove(n)},t.prototype.loaded=function(){var t=this,i,n;if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;for(i in t._tiles)if(n=t._tiles[i],"loaded"!==n.state&&"errored"!==n.state)return!1;return!0},t.prototype.getSource=function(){return this._source},t.prototype.pause=function(){this._paused=!0},t.prototype.resume=function(){if(this._paused){var n=this._shouldReloadOnResume;this._paused=!1;this._shouldReloadOnResume=!1;n&&this.reload();this.transform&&this.update(this.transform)}},t.prototype._loadTile=function(n,t){return this._source.loadTile(n,t)},t.prototype._unloadTile=function(n){if(this._source.unloadTile)return this._source.unloadTile(n)},t.prototype._abortTile=function(n){if(this._source.abortTile)return this._source.abortTile(n)},t.prototype.serialize=function(){return this._source.serialize()},t.prototype.prepare=function(n){var t=this,i;this._source.prepare&&this._source.prepare();for(i in t._tiles)t._tiles[i].upload(n)},t.prototype.getIds=function(){return Object.keys(this._tiles).map(Number).sort(o)},t.prototype.getRenderableIds=function(){return this.getIds().filter(this._isIdRenderable)},t.prototype.hasRenderableParent=function(n){var t=this.findLoadedParent(n,0,{});return!!t&&this._isIdRenderable(t.coord.id)},t.prototype._isIdRenderable=function(n){return this._tiles[n]&&this._tiles[n].hasData()&&!this._coveredTiles[n]},t.prototype.reload=function(){var n=this,t;if(this._paused)return void(this._shouldReloadOnResume=!0);this._cache.reset();for(t in n._tiles)n._reloadTile(t,"reloading")},t.prototype._reloadTile=function(n,t){var i=this._tiles[n];i&&("loading"!==i.state&&(i.state=t),this._loadTile(i,this._tileLoaded.bind(this,i,n,t)))},t.prototype._tileLoaded=function(n,t,i,r){if(r)return n.state="errored",void(404!==r.status?this._source.fire("error",{tile:n,error:r}):this.update(this.transform));n.timeAdded=(new Date).getTime();"expired"===i&&(n.refreshedUponExpiration=!0);this._setTileReloadTimer(t,n);this._source.fire("data",{dataType:"source",tile:n,coord:n.coord});this.map&&(this.map.painter.tileExtentVAO.vao=null)},t.prototype.getTile=function(n){return this.getTileByID(n.id)},t.prototype.getTileByID=function(n){return this._tiles[n]},t.prototype.getZoom=function(n){return n.zoom+n.scaleZoom(n.tileSize/this._source.tileSize)},t.prototype._findLoadedChildren=function(n,t,i){var u=this,s=!1,f,r,o,e;for(f in u._tiles)if(r=u._tiles[f],!(i[f]||!r.hasData()||r.coord.z<=n.z||r.coord.z>t)&&(o=Math.pow(2,Math.min(r.coord.z,u._source.maxzoom)-Math.min(n.z,u._source.maxzoom)),Math.floor(r.coord.x/o)===n.x&&Math.floor(r.coord.y/o)===n.y))for(i[f]=!0,s=!0;r&&r.coord.z-1>n.z;){if(e=r.coord.parent(u._source.maxzoom),!e)break;r=u._tiles[e.id];r&&r.hasData()&&(delete i[f],i[e.id]=!0)}return s},t.prototype.findLoadedParent=function(n,t,i){for(var o,r,f,u=this,e=n.z-1;e>=t;e--){if(o=n.parent(u._source.maxzoom),!o)return;if(n=o,r=String(n.id),f=u._tiles[r],f&&f.hasData())return i[r]=!0,f;if(u._cache.has(r))return i[r]=!0,u._cache.getWithoutRemoving(r)}},t.prototype.updateCacheSize=function(n){var i=Math.ceil(n.width/n.tileSize)+1,r=Math.ceil(n.height/n.tileSize)+1,u=i*r,t=Math.floor(5*u),f="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,t):t;this._cache.setMaxSize(f)},t.prototype.update=function(n){var i=this,r,a,o,w,e,b,h;if(this.transform=n,this._sourceLoaded&&!this._paused){this.updateCacheSize(n);this._coveredTiles={};this.used?this._source.coord?r=n.getVisibleWrappedCoordinates(this._source.coord):(r=n.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(r=r.filter(function(n){return i._source.hasTile(n)}))):r=[];var c=(this._source.roundZoom?Math.round:Math.floor)(this.getZoom(n)),d=Math.max(c-t.maxOverzooming,this._source.minzoom),g=Math.max(c+t.maxUnderzooming,this._source.minzoom),f=this._updateRetainedTiles(r,c),l={};if(s(this._source.type))for(a=Object.keys(f),o=0;o<a.length;o++){var y=a[o],k=u.fromID(+y),p=i._tiles[y];p&&(void 0===p.fadeEndTime||p.fadeEndTime>=Date.now())&&(i._findLoadedChildren(k,g,f)&&(f[y]=!0),w=i.findLoadedParent(k,d,l),w&&i._addTile(w.coord))}for(e in l)f[e]||(i._coveredTiles[e]=!0);for(e in l)f[e]=!0;for(b=v.keysDifference(this._tiles,f),h=0;h<b.length;h++)i._removeTile(b[h])}},t.prototype._updateRetainedTiles=function(n,i){for(var f,r,h,u=this,e={},k={},d=Math.max(i-t.maxOverzooming,this._source.minzoom),c,y,p,w,l,a,b,v,o,s=0;s<n.length;s++)if(f=n[s],r=u._addTile(f),c=!1,r.hasData())e[f.id]=!0;else{if(c=r.wasRequested(),e[f.id]=!0,h=!0,i+1>u._source.maxzoom)y=f.children(u._source.maxzoom)[0],p=u.getTile(y),p&&p.hasData()?e[y.id]=!0:h=!1;else for(w=f.children(u._source.maxzoom),l=0;l<w.length;l++)a=w[l],b=a?u.getTile(a):null,b&&b.hasData()?e[a.id]=!0:h=!1;if(!h)for(v=i-1;v>=d;--v){if(o=f.scaledTo(v,u._source.maxzoom),k[o.id])break;if(k[o.id]=!0,r=u.getTile(o),!r&&c&&(r=u._addTile(o)),r&&(e[o.id]=!0,c=r.wasRequested(),r.hasData()))break}}return e},t.prototype._addTile=function(n){var t=this._tiles[n.id],i,r,u;return t?t:((t=this._cache.get(n.id))&&(t.redoPlacement(this._source),this._cacheTimers[n.id]&&(clearTimeout(this._cacheTimers[n.id]),delete this._cacheTimers[n.id],this._setTileReloadTimer(n.id,t))),i=Boolean(t),i||(r=n.z,u=r>this._source.maxzoom?Math.pow(2,r-this._source.maxzoom):1,t=new c(n,this._source.tileSize*u,this._source.maxzoom),this._loadTile(t,this._tileLoaded.bind(this,t,n.id,t.state))),t?(t.uses++,this._tiles[n.id]=t,i||this._source.fire("dataloading",{tile:t,coord:t.coord,dataType:"source"}),t):null)},t.prototype._setTileReloadTimer=function(n,t){var i=this,r=t.getExpiryTimeout();r&&(this._timers[n]=setTimeout(function(){i._reloadTile(n,"expired");delete i._timers[n]},r))},t.prototype._setCacheInvalidationTimer=function(n,t){var i=this,r=t.getExpiryTimeout();r&&(this._cacheTimers[n]=setTimeout(function(){i._cache.remove(n);delete i._cacheTimers[n]},r))},t.prototype._removeTile=function(n){var t=this._tiles[n],i;!t||(t.uses--,delete this._tiles[n],this._timers[n]&&(clearTimeout(this._timers[n]),delete this._timers[n]),t.uses>0)||((t.stopPlacementThrottler(),t.hasData())?(i=t.coord.wrapped().id,this._cache.add(i,t),this._setCacheInvalidationTimer(i,t)):(t.aborted=!0,this._abortTile(t),this._unloadTile(t)))},t.prototype.clearTiles=function(){var n=this,t;this._shouldReloadOnResume=!1;this._paused=!1;for(t in n._tiles)n._removeTile(t);this._cache.reset()},t.prototype.tilesIn=function(n){for(var t,f,b,c,k=this,d=[],l=this.getIds(),a=1/0,v=1/0,y=-1/0,p=-1/0,g=n[0].zoom,w=0;w<n.length;w++)t=n[w],a=Math.min(a,t.column),v=Math.min(v,t.row),y=Math.max(y,t.column),p=Math.max(p,t.row);for(f=0;f<l.length;f++){var o=k._tiles[l[f]],s=u.fromID(l[f]),h=[r(s,o.sourceMaxZoom,new e(a,v,g)),r(s,o.sourceMaxZoom,new e(y,p,g))];if(h[0].x<i&&h[0].y<i&&h[1].x>=0&&h[1].y>=0){for(b=[],c=0;c<n.length;c++)b.push(r(s,o.sourceMaxZoom,n[c]));d.push({tile:o,coord:s,queryGeometry:[b],scale:Math.pow(2,k.transform.zoom-o.coord.z)})}}return d},t.prototype.redoPlacement=function(){for(var t=this,i=this.getIds(),n=0;n<i.length;n++)t.getTileByID(i[n]).redoPlacement(t._source)},t.prototype.getVisibleCoordinates=function(){for(var t,i=this,r=this.getRenderableIds().map(u.fromID),n=0,f=r;n<f.length;n+=1)t=f[n],t.posMatrix=i.transform.calculatePosMatrix(t,i._source.maxzoom);return r},t}(l);f.maxOverzooming=10;f.maxUnderzooming=3;t.exports=f},{"../data/extent":58,"../geo/coordinate":67,"../util/evented":239,"../util/lru_cache":245,"../util/util":252,"./source":109,"./tile":111,"./tile_coord":113,"@mapbox/point-geometry":2}],111:[function(n,t){"use strict";var r=n("../util/util"),u=n("../data/bucket").deserialize,s=n("../data/bucket/symbol_bucket"),h=n("../data/feature_index"),c=n("@mapbox/vector-tile"),l=n("pbf"),a=n("../util/vectortile_to_geojson"),v=n("../style-spec/feature_filter"),f=n("../symbol/collision_tile"),y=n("../symbol/collision_box"),p=n("../util/throttler"),w=n("../data/raster_bounds_array"),b=n("./tile_coord"),k=n("../data/extent"),e=n("@mapbox/point-geometry"),d=n("../gl/vertex_buffer"),g=n("../gl/index_buffer"),o=n("../render/texture"),nt=n("../data/segment"),tt=nt.SegmentVector,it=n("../data/index_array_type"),rt=it.TriangleIndexArray,ut=3e4,i=function(n,t,i){this.coord=n;this.uid=r.uniqueId();this.uses=0;this.tileSize=t;this.sourceMaxZoom=i;this.buckets={};this.expirationTime=null;this.expiredRequestCount=0;this.state="loading";this.placementThrottler=new p(300,this._immediateRedoPlacement.bind(this))};i.prototype.registerFadeDuration=function(n,t){var i=t+this.timeAdded;i<Date.now()||this.fadeEndTime&&i<this.fadeEndTime||(this.fadeEndTime=i,n.set(this.fadeEndTime-Date.now()))};i.prototype.wasRequested=function(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state};i.prototype.loadVectorData=function(n,t){this.hasData()&&this.unloadVectorData();this.state="loaded";n&&(n.rawTileData&&(this.rawTileData=n.rawTileData),this.collisionBoxArray=new y(n.collisionBoxArray),this.collisionTile=f.deserialize(n.collisionTile,this.collisionBoxArray),this.featureIndex=h.deserialize(n.featureIndex,this.rawTileData,this.collisionTile),this.buckets=u(n.buckets,t.style),n.iconAtlasImage&&(this.iconAtlasImage=n.iconAtlasImage),n.glyphAtlasImage&&(this.glyphAtlasImage=n.glyphAtlasImage))};i.prototype.reloadSymbolData=function(n,t){var i=this,e,o;if("unloaded"!==this.state){this.collisionTile=f.deserialize(n.collisionTile,this.collisionBoxArray);this.featureIndex&&this.featureIndex.setCollisionTile(this.collisionTile);for(e in i.buckets)o=i.buckets[e],o instanceof s&&(o.destroy(),delete i.buckets[e]);r.extend(this.buckets,u(n.buckets,t));n.iconAtlasImage&&(this.iconAtlasImage=n.iconAtlasImage);n.glyphAtlasImage&&(this.glyphAtlasImage=n.glyphAtlasImage)}};i.prototype.unloadVectorData=function(){var n=this,t;for(t in n.buckets)n.buckets[t].destroy();this.buckets={};this.iconAtlasTexture&&this.iconAtlasTexture.destroy();this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy();this.collisionBoxArray=null;this.collisionTile=null;this.featureIndex=null;this.state="unloaded"};i.prototype.redoPlacement=function(n){if("vector"===n.type||"geojson"===n.type){if("loaded"!==this.state)return void(this.redoWhenDone=!0);if(this.collisionTile){var t=n.map.transform.cameraToTileDistance(this);if(this.angle===n.map.transform.angle&&this.pitch===n.map.transform.pitch&&this.showCollisionBoxes===n.map.showCollisionBoxes){if(this.cameraToTileDistance===t&&this.cameraToCenterDistance===n.map.transform.cameraToCenterDistance)return;if(this.pitch<25)return this.cameraToTileDistance=t,void(this.cameraToCenterDistance=n.map.transform.cameraToCenterDistance)}this.angle=n.map.transform.angle;this.pitch=n.map.transform.pitch;this.cameraToCenterDistance=n.map.transform.cameraToCenterDistance;this.cameraToTileDistance=t;this.showCollisionBoxes=n.map.showCollisionBoxes;this.placementSource=n;this.state="reloading";this.placementThrottler.invoke()}}};i.prototype._immediateRedoPlacement=function(){var n=this;this.placementSource.dispatcher.send("redoPlacement",{type:this.placementSource.type,uid:this.uid,source:this.placementSource.id,angle:this.angle,pitch:this.pitch,cameraToCenterDistance:this.cameraToCenterDistance,cameraToTileDistance:this.cameraToTileDistance,showCollisionBoxes:this.showCollisionBoxes},function(t,i){"reloading"===n.state&&(n.state="loaded",n.reloadSymbolData(i,n.placementSource.map.style),n.placementSource.fire("data",{tile:n,coord:n.coord,dataType:"source"}),n.placementSource.map&&(n.placementSource.map.painter.tileExtentVAO.vao=null),n.redoWhenDone&&(n.state="reloading",n.redoWhenDone=!1,n._immediateRedoPlacement()))},this.workerID)};i.prototype.getBucket=function(n){return this.buckets[n.id]};i.prototype.upload=function(n){var i=this,r,t;for(r in i.buckets)t=i.buckets[r],t.uploaded||(t.upload(n),t.uploaded=!0);this.iconAtlasImage&&(this.iconAtlasTexture=new o(n,this.iconAtlasImage,n.RGBA),this.iconAtlasImage=null);this.glyphAtlasImage&&(this.glyphAtlasTexture=new o(n,this.glyphAtlasImage,n.ALPHA),this.glyphAtlasImage=null)};i.prototype.queryRenderedFeatures=function(n,t,i,r,u){var s=this,f,e,o;if(!this.featureIndex)return{};f=0;for(e in n)o=s.getBucket(n[e]),o&&(f=Math.max(f,n[e].queryRadius(o)));return this.featureIndex.query({queryGeometry:t,bearing:u,params:r,scale:i,additionalRadius:f,tileSize:this.tileSize},n)};i.prototype.querySourceFeatures=function(n,t){var i=this,o,r,f,e;if(this.rawTileData&&(this.vtLayers||(this.vtLayers=new c.VectorTile(new l(this.rawTileData)).layers),o=t?t.sourceLayer:"",r=this.vtLayers._geojsonTileLayer||this.vtLayers[o],r))for(var s=v(t&&t.filter),h={z:this.coord.z,x:this.coord.x,y:this.coord.y},u=0;u<r.length;u++)f=r.feature(u),s({zoom:i.coord.z},f)&&(e=new a(f,i.coord.z,i.coord.x,i.coord.y),e.tile=h,n.push(e))};i.prototype.clearMask=function(){this.segments&&(this.segments.destroy(),delete this.segments);this.maskedBoundsBuffer&&(this.maskedBoundsBuffer.destroy(),delete this.maskedBoundsBuffer);this.maskedIndexBuffer&&(this.maskedIndexBuffer.destroy(),delete this.maskedIndexBuffer)};i.prototype.setMask=function(n,t){var y=this,u,s,l,h,o;if(!r.deepEqual(this.mask,n)&&(this.mask=n,this.clearMask(),!r.deepEqual(n,{0:!0}))){for(u=new w,s=new rt,this.segments=new tt,this.segments.prepareSegment(0,u,s),l=Object.keys(n),h=0;h<l.length;h++){var a=b.fromID(+l[h]),c=k>>a.z,i=new e(a.x*c,a.y*c),f=new e(i.x+c,i.y+c),v=y.segments.prepareSegment(4,u,s);u.emplaceBack(i.x,i.y,i.x,i.y);u.emplaceBack(f.x,i.y,f.x,i.y);u.emplaceBack(i.x,f.y,i.x,f.y);u.emplaceBack(f.x,f.y,f.x,f.y);o=v.vertexLength;s.emplaceBack(o,o+1,o+2);s.emplaceBack(o+1,o+2,o+3);v.vertexLength+=4;v.primitiveLength+=2}this.maskedBoundsBuffer=new d(t,u);this.maskedIndexBuffer=new g(t,s)}};i.prototype.hasData=function(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state};i.prototype.setExpiryData=function(n){var i=this.expirationTime,u,f,t,e;n.cacheControl?(u=r.parseCacheControl(n.cacheControl),u["max-age"]&&(this.expirationTime=Date.now()+1e3*u["max-age"])):n.expires&&(this.expirationTime=new Date(n.expires).getTime());this.expirationTime&&(f=Date.now(),t=!1,this.expirationTime>f?t=!1:i?this.expirationTime<i?t=!0:(e=this.expirationTime-i,e?this.expirationTime=f+Math.max(e,ut):t=!0):t=!0,t?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0)};i.prototype.getExpiryTimeout=function(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-(new Date).getTime(),Math.pow(2,31)-1)};i.prototype.stopPlacementThrottler=function(){this.placementThrottler.stop();"reloading"===this.state&&(this.state="loaded")};t.exports=i},{"../data/bucket":51,"../data/bucket/symbol_bucket":57,"../data/extent":58,"../data/feature_index":59,"../data/index_array_type":60,"../data/raster_bounds_array":64,"../data/segment":65,"../gl/index_buffer":71,"../gl/vertex_buffer":72,"../render/texture":94,"../style-spec/feature_filter":144,"../symbol/collision_box":199,"../symbol/collision_tile":201,"../util/throttler":250,"../util/util":252,"../util/vectortile_to_geojson":253,"./tile_coord":113,"@mapbox/point-geometry":2,"@mapbox/vector-tile":6,pbf:38}],112:[function(n,t){"use strict";var r=n("../geo/lng_lat_bounds"),u=n("../util/util").clamp,i=function(n,t,i){this.bounds=r.convert(this.validateBounds(n));this.minzoom=t||0;this.maxzoom=i||24};i.prototype.validateBounds=function(n){return Array.isArray(n)&&4===n.length?[Math.max(-180,n[0]),Math.max(-90,n[1]),Math.min(180,n[2]),Math.min(90,n[3])]:[-180,-90,180,90]};i.prototype.contains=function(n,t){var i=t?Math.min(n.z,t):n.z,r={minX:Math.floor(this.lngX(this.bounds.getWest(),i)),minY:Math.floor(this.latY(this.bounds.getNorth(),i)),maxX:Math.ceil(this.lngX(this.bounds.getEast(),i)),maxY:Math.ceil(this.latY(this.bounds.getSouth(),i))};return n.x>=r.minX&&n.x<r.maxX&&n.y>=r.minY&&n.y<r.maxY};i.prototype.lngX=function(n,t){return(n+180)*(Math.pow(2,t)/360)};i.prototype.latY=function(n,t){var i=u(Math.sin(Math.PI/180*n),-.9999,.9999),r=Math.pow(2,t)/(2*Math.PI);return Math.pow(2,t-1)+.5*Math.log((1+i)/(1-i))*-r};t.exports=i},{"../geo/lng_lat_bounds":69,"../util/util":252}],113:[function(n,t){"use strict";function r(n,t){if(n.row>t.row){var i=n;n=t;t=i}return{x0:n.column,y0:n.row,x1:t.column,y1:t.row,dx:t.column-n.column,dy:t.row-n.row}}function u(n,t,i,r,u){var h=Math.max(i,Math.floor(t.y0)),c=Math.min(r,Math.ceil(t.y1)),e,o,s;(n.x0===t.x0&&n.y0===t.y0?n.x0+t.dy/n.dy*n.dx<t.x1:n.x1-t.dy/n.dy*n.dx<t.x0)&&(e=n,n=t,t=e);for(var l=n.dx/n.dy,a=t.dx/t.dy,v=n.dx>0,y=t.dx<0,f=h;f<c;f++)o=l*Math.max(0,Math.min(n.dy,f+v-n.y0))+n.x0,s=a*Math.max(0,Math.min(t.dy,f+y-t.y0))+t.x0,u(Math.floor(s),Math.ceil(o),f)}function f(n,t,i,f,e,o){var l,s=r(n,t),h=r(t,i),c=r(i,n);s.dy>h.dy&&(l=s,s=h,h=l);s.dy>c.dy&&(l=s,s=c,c=l);h.dy>c.dy&&(l=h,h=c,c=l);s.dy&&u(c,s,f,e,o);h.dy&&u(c,h,f,e,o)}function e(n,t,i){for(var r,f="",u=n;u>0;u--)r=1<<u-1,f+=(t&r?1:0)+(i&r?2:0);return f}var o=n("@mapbox/whoots-js"),s=n("../geo/coordinate"),i=function(n,t,i,r){(void 0===r||isNaN(r))&&(r=0);this.z=+n;this.x=+t;this.y=+i;this.w=+r;(r*=2)<0&&(r=-1*r-1);var u=1<<this.z;this.id=32*(u*u*r+u*this.y+this.x)+this.z;this.posMatrix=null};i.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};i.prototype.toCoordinate=function(n){var t=Math.min(this.z,void 0===n?this.z:n),i=Math.pow(2,t),r=this.y,u=this.x+i*this.w;return new s(u,r,t)};i.prototype.url=function(n,t,i){var r=o.getTileBBox(this.x,this.y,this.z),u=e(this.z,this.x,this.y);return n[(this.x+this.y)%n.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(Math.min(this.z,t||this.z))).replace("{x}",String(this.x)).replace("{y}",String("tms"===i?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",u).replace("{bbox-epsg-3857}",r)};i.prototype.parent=function(n){return 0===this.z?null:this.z>n?new i(this.z-1,this.x,this.y,this.w):new i(this.z-1,Math.floor(this.x/2),Math.floor(this.y/2),this.w)};i.prototype.wrapped=function(){return new i(this.z,this.x,this.y,0)};i.prototype.isLessThan=function(n){return this.w<n.w||!(this.w>n.w)&&(this.z<n.z||!(this.z>n.z)&&(this.x<n.x||!(this.x>n.x)&&this.y<n.y))};i.prototype.children=function(n){if(this.z>=n)return[new i(this.z+1,this.x,this.y,this.w)];var t=this.z+1,r=2*this.x,u=2*this.y;return[new i(t,r,u,this.w),new i(t,r+1,u,this.w),new i(t,r,u+1,this.w),new i(t,r+1,u+1,this.w)]};i.prototype.scaledTo=function(n,t){return this.z>t?new i(n,this.x,this.y,this.w):n<=this.z?new i(n,this.x>>this.z-n,this.y>>this.z-n,this.w):new i(n,this.x<<n-this.z,this.y<<n-this.z,this.w)};i.prototype.isChildOf=function(n){return 0===n.z||n.z<this.z&&n.x===this.x>>this.z-n.z&&n.y===this.y>>this.z-n.z};i.cover=function(n,t,r,u){function s(n,t,f){var s,h,l,c;if(f>=0&&f<=e)for(s=n;s<t;s++)h=Math.floor(s/e),l=(s%e+e)%e,0!==h&&!0!==u||(c=new i(r,l,f,h),o[c.id]=c)}void 0===u&&(u=!0);var e=1<<n,o={};return f(t[0],t[1],t[2],0,e,s),f(t[2],t[3],t[0],0,e,s),Object.keys(o).map(function(n){return o[n]})};i.fromID=function(n){var u=n%32,t=1<<u,f=(n-u)/32,e=f%t,o=(f-e)/t%t,r=Math.floor(f/(t*t));return r%2!=0&&(r=-1*r-1),r/=2,new i(u,e,o,r)};t.exports=i},{"../geo/coordinate":67,"@mapbox/whoots-js":10}],114:[function(n,t){"use strict";var r=n("../util/evented"),i=n("../util/util"),u=n("./load_tilejson"),f=n("../util/mapbox").normalizeTileURL,e=n("./tile_bounds"),o=n("../util/ajax").ResourceType,s=n("../util/browser"),h=function(n){function t(t,r,u,f){if(n.call(this),this.id=t,this.dispatcher=u,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,i.extend(this,i.pick(r,["url","scheme","tileSize"])),this._options=i.extend({type:"vector"},r),512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(f)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.load=function(){var n=this;this.fire("dataloading",{dataType:"source"});u(this._options,this.map._transformRequest,function(t,r){t?n.fire("error",t):r&&(i.extend(n,r),r.bounds&&(n.tileBounds=new e(r.bounds,n.minzoom,n.maxzoom)),n.fire("data",{dataType:"source",sourceDataType:"metadata"}),n.fire("data",{dataType:"source",sourceDataType:"content"}))})},t.prototype.hasTile=function(n){return!this.tileBounds||this.tileBounds.contains(n,this.maxzoom)},t.prototype.onAdd=function(n){this.map=n;this.load()},t.prototype.serialize=function(){return i.extend({},this._options)},t.prototype.loadTile=function(n,t){function i(i,r){if(!n.aborted){if(i)return t(i);this.map._refreshExpiredTiles&&n.setExpiryData(r);n.loadVectorData(r,this.map.painter);n.redoWhenDone&&(n.redoWhenDone=!1,n.redoPlacement(this));t(null);n.reloadCallback&&(this.loadTile(n,n.reloadCallback),n.reloadCallback=null)}}var r=n.coord.z>this.maxzoom?Math.pow(2,n.coord.z-this.maxzoom):1,e=f(n.coord.url(this.tiles,this.maxzoom,this.scheme),this.url),u={request:this.map._transformRequest(e,o.Tile),uid:n.uid,coord:n.coord,zoom:n.coord.z,tileSize:this.tileSize*r,type:this.type,source:this.id,pixelRatio:s.devicePixelRatio,overscaling:r,angle:this.map.transform.angle,pitch:this.map.transform.pitch,cameraToCenterDistance:this.map.transform.cameraToCenterDistance,cameraToTileDistance:this.map.transform.cameraToTileDistance(n),showCollisionBoxes:this.map.showCollisionBoxes};void 0===n.workerID||"expired"===n.state?n.workerID=this.dispatcher.send("loadTile",u,i.bind(this)):"loading"===n.state?n.reloadCallback=t:this.dispatcher.send("reloadTile",u,i.bind(this),n.workerID)},t.prototype.abortTile=function(n){this.dispatcher.send("abortTile",{uid:n.uid,type:this.type,source:this.id},void 0,n.workerID)},t.prototype.unloadTile=function(n){n.unloadVectorData();this.dispatcher.send("removeTile",{uid:n.uid,type:this.type,source:this.id},void 0,n.workerID)},t}(r);t.exports=h},{"../util/ajax":230,"../util/browser":231,"../util/evented":239,"../util/mapbox":246,"../util/util":252,"./load_tilejson":104,"./tile_bounds":112}],115:[function(n,t){"use strict";function r(n,t){var i=u.getArrayBuffer(n.request,function(n,i){n?t(n):i&&t(null,{vectorTile:new f.VectorTile(new e(i.data)),rawData:i.data,cacheControl:i.cacheControl,expires:i.expires})});return function(){i.abort()}}var u=n("../util/ajax"),f=n("@mapbox/vector-tile"),e=n("pbf"),o=n("./worker_tile"),s=n("../util/util"),i=function(n,t,i){this.actor=n;this.layerIndex=t;this.loadVectorData=i||r;this.loading={};this.loaded={}};i.prototype.loadTile=function(n,t){var r=this,i=n.source,f=n.uid,u;this.loading[i]||(this.loading[i]={});u=this.loading[i][f]=new o(n);u.abort=this.loadVectorData(n,function(n,e){if(delete r.loading[i][f],n||!e)return t(n);var h=e.rawData,o={};e.expires&&(o.expires=e.expires);e.cacheControl&&(o.cacheControl=e.cacheControl);u.vectorTile=e.vectorTile;u.parse(e.vectorTile,r.layerIndex,r.actor,function(n,i,r){if(n||!i)return t(n);t(null,s.extend({rawTileData:h},i,o),r)});r.loaded[i]=r.loaded[i]||{};r.loaded[i][f]=u})};i.prototype.reloadTile=function(n,t){function e(n,i){if(this.reloadCallback){var r=this.reloadCallback;delete this.reloadCallback;this.parse(this.vectorTile,f.layerIndex,f.actor,r)}t(n,i)}var r=this.loaded[n.source],u=n.uid,f=this,i;r&&r[u]&&(i=r[u],"parsing"===i.status?i.reloadCallback=t:"done"===i.status&&i.parse(i.vectorTile,this.layerIndex,this.actor,e.bind(i)))};i.prototype.abortTile=function(n){var t=this.loading[n.source],i=n.uid;t&&t[i]&&t[i].abort&&(t[i].abort(),delete t[i])};i.prototype.removeTile=function(n){var t=this.loaded[n.source],i=n.uid;t&&t[i]&&delete t[i]};i.prototype.redoPlacement=function(n,t){var u=this.loaded[n.source],f=this.loading[n.source],i=n.uid,e,r;u&&u[i]?(e=u[i],r=e.redoPlacement(n.angle,n.pitch,n.cameraToCenterDistance,n.cameraToTileDistance,n.showCollisionBoxes),r.result&&t(null,r.result,r.transferables)):f&&f[i]&&(f[i].angle=n.angle)};t.exports=i},{"../util/ajax":230,"../util/util":252,"./worker_tile":118,"@mapbox/vector-tile":6,pbf:38}],116:[function(n,t){"use strict";var i=n("../util/ajax"),r=n("./image_source"),u=function(n){function t(t,i,r,u){n.call(this,t,i,r,u);this.roundZoom=!0;this.type="video";this.options=i}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.load=function(){var n=this,t=this.options;this.urls=t.urls;i.getVideo(t.urls,function(t,i){if(t)n.fire("error",{error:t});else if(i){n.video=i;n.video.loop=!0;var r;n.video.addEventListener("playing",function(){r=n.map.style.animationLoop.set(1/0);n.map._rerender()});n.video.addEventListener("pause",function(){n.map.style.animationLoop.cancel(r)});n.map&&n.video.play();n._finishLoading()}})},t.prototype.getVideo=function(){return this.video},t.prototype.onAdd=function(n){this.map||(this.map=n,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},t.prototype.prepare=function(){0===Object.keys(this.tiles).length||this.video.readyState<2||this._prepareImage(this.map.painter.gl,this.video)},t.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},t}(r);t.exports=u},{"../util/ajax":230,"./image_source":103}],117:[function(n,t){"use strict";var u=n("../util/actor"),f=n("../style/style_layer_index"),e=n("./vector_tile_worker_source"),o=n("./geojson_worker_source"),r=n("./rtl_text_plugin"),i=function(n){var t=this;this.self=n;this.actor=new u(n,this);this.layerIndexes={};this.workerSourceTypes={vector:e,geojson:o};this.workerSources={};this.self.registerWorkerSource=function(n,i){if(t.workerSourceTypes[n])throw new Error('Worker source with name "'+n+'" already registered.');t.workerSourceTypes[n]=i};this.self.registerRTLTextPlugin=function(n){if(r.applyArabicShaping||r.processBidirectionalText)throw new Error("RTL text plugin already registered.");r.applyArabicShaping=n.applyArabicShaping;r.processBidirectionalText=n.processBidirectionalText}};i.prototype.setLayers=function(n,t){this.getLayerIndex(n).replace(t)};i.prototype.updateLayers=function(n,t){this.getLayerIndex(n).update(t.layers,t.removedIds,t.symbolOrder)};i.prototype.loadTile=function(n,t,i){this.getWorkerSource(n,t.type).loadTile(t,i)};i.prototype.reloadTile=function(n,t,i){this.getWorkerSource(n,t.type).reloadTile(t,i)};i.prototype.abortTile=function(n,t){this.getWorkerSource(n,t.type).abortTile(t)};i.prototype.removeTile=function(n,t){this.getWorkerSource(n,t.type).removeTile(t)};i.prototype.removeSource=function(n,t){var i=this.getWorkerSource(n,t.type);void 0!==i.removeSource&&i.removeSource(t)};i.prototype.redoPlacement=function(n,t,i){this.getWorkerSource(n,t.type).redoPlacement(t,i)};i.prototype.loadWorkerSource=function(n,t,i){try{this.self.importScripts(t.url);i()}catch(n){i(n)}};i.prototype.loadRTLTextPlugin=function(n,t,i){try{r.applyArabicShaping||r.processBidirectionalText||(this.self.importScripts(t),r.applyArabicShaping&&r.processBidirectionalText||i(new Error("RTL Text Plugin failed to import scripts from "+t)))}catch(n){i(n)}};i.prototype.getLayerIndex=function(n){var t=this.layerIndexes[n];return t||(t=this.layerIndexes[n]=new f),t};i.prototype.getWorkerSource=function(n,t){var r=this,i;return(this.workerSources[n]||(this.workerSources[n]={}),this.workerSources[n][t])||(i={send:function(t,i,u,f){r.actor.send(t,i,u,f,n)}},this.workerSources[n][t]=new this.workerSourceTypes[t](i,this.getLayerIndex(n))),this.workerSources[n][t]};t.exports=function(n){return new i(n)}},{"../style/style_layer_index":193,"../util/actor":229,"./geojson_worker_source":101,"./rtl_text_plugin":108,"./vector_tile_worker_source":115}],118:[function(n,t){"use strict";function u(n,t){for(var i=0,r=n.layers;i<r.length;i+=1)r[i].recalculate(t)}function f(n,t){return n.filter(function(n){return!n.isEmpty()}).map(function(n){return n.serialize(t)})}var o=n("../data/feature_index"),e=n("../symbol/collision_tile"),s=n("../symbol/collision_box"),h=n("../util/dictionary_coder"),y=n("../data/bucket/symbol_bucket"),i=n("../util/util"),c=n("../render/image_atlas"),l=c.makeImageAtlas,a=n("../render/glyph_atlas"),v=a.makeGlyphAtlas,r=function(n){this.coord=n.coord;this.uid=n.uid;this.zoom=n.zoom;this.pixelRatio=n.pixelRatio;this.tileSize=n.tileSize;this.source=n.source;this.overscaling=n.overscaling;this.angle=n.angle;this.pitch=n.pitch;this.cameraToCenterDistance=n.cameraToCenterDistance;this.cameraToTileDistance=n.cameraToTileDistance;this.showCollisionBoxes=n.showCollisionBoxes};r.prototype.parse=function(n,t,r,c){function ft(){var r=this,t,n;if(w)return c(w);if(g&&nt){for(var a=new e(this.angle,this.pitch,this.cameraToCenterDistance,this.cameraToTileDistance,this.collisionBoxArray),o=v(g),s=l(nt),h=0,y=r.symbolBuckets;h<y.length;h+=1)t=y[h],u(t,r.zoom),t.prepare(g,o.positions,nt,s.positions),t.place(a,r.showCollisionBoxes);this.status="done";n=[o.image.data.buffer,s.image.data.buffer];c(null,{buckets:f(i.values(et),n),featureIndex:p.serialize(n),collisionTile:a.serialize(n),collisionBoxArray:this.collisionBoxArray.serialize(),glyphAtlasImage:o.image,iconAtlasImage:s.image},n)}}var a=this,vt,p,b,k,wt,it,st,d,y,rt,ht,ut,ct,w,g,nt,lt,at;this.status="parsing";this.data=n;this.collisionBoxArray=new s;vt=new h(Object.keys(n.layers).sort());p=new o(this.coord,this.overscaling);p.bucketLayerIDs=[];var et={},ot={featureIndex:p,iconDependencies:{},glyphDependencies:{}},yt=t.familiesBySource[this.source];for(b in yt)if(k=n.layers[b],k){1===k.version&&i.warnOnce('Vector tile source "'+a.source+'" layer "'+b+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var bt=vt.encode(b),pt=[],tt=0;tt<k.length;tt++)wt=k.feature(tt),pt.push({feature:wt,index:tt,sourceLayerIndex:bt});for(it=0,st=yt[b];it<st.length;it+=1)if(d=st[it],y=d[0],!(y.minzoom&&a.zoom<Math.floor(y.minzoom))&&!(y.maxzoom&&a.zoom>=y.maxzoom||y.layout&&"none"===y.layout.visibility)){for(rt=0,ht=d;rt<ht.length;rt+=1)ht[rt].recalculate(a.zoom);(et[y.id]=y.createBucket({index:p.bucketLayerIDs.length,layers:d,zoom:a.zoom,pixelRatio:a.pixelRatio,overscaling:a.overscaling,collisionBoxArray:a.collisionBoxArray})).populate(pt,ot);p.bucketLayerIDs.push(d.map(function(n){return n.id}))}}for(this.symbolBuckets=[],ut=t.symbolOrder.length-1;ut>=0;ut--)ct=et[t.symbolOrder[ut]],ct&&a.symbolBuckets.push(ct);lt=i.mapObject(ot.glyphDependencies,function(n){return Object.keys(n).map(Number)});Object.keys(lt).length?r.send("getGlyphs",{uid:this.uid,stacks:lt},function(n,t){w||(w=n,g=t,ft.call(a))}):g={};at=Object.keys(ot.iconDependencies);at.length?r.send("getImages",{icons:at},function(n,t){w||(w=n,nt=t,ft.call(a))}):nt={};ft.call(this)};r.prototype.redoPlacement=function(n,t,i,r,o){var l=this,c,s;if(this.angle=n,this.pitch=t,this.cameraToCenterDistance=i,this.cameraToTileDistance=r,"done"!==this.status)return{};for(var a=new e(this.angle,this.pitch,this.cameraToCenterDistance,this.cameraToTileDistance,this.collisionBoxArray),h=0,v=l.symbolBuckets;h<v.length;h+=1)c=v[h],u(c,l.zoom),c.place(a,o);return s=[],{result:{buckets:f(this.symbolBuckets,s),collisionTile:a.serialize(s)},transferables:s}};t.exports=r},{"../data/bucket/symbol_bucket":57,"../data/feature_index":59,"../render/glyph_atlas":85,"../render/image_atlas":87,"../symbol/collision_box":199,"../symbol/collision_tile":201,"../util/dictionary_coder":236,"../util/util":252}],119:[function(n,t){"use strict";function i(n,t){var r={},i;for(i in n)"ref"!==i&&(r[i]=n[i]);return u.forEach(function(n){n in t&&(r[n]=t[n])}),r}function r(n){var u,r,t;for(n=n.slice(),u=Object.create(null),r=0;r<n.length;r++)u[n[r].id]=n[r];for(t=0;t<n.length;t++)"ref"in n[t]&&(n[t]=i(n[t],u[n[t].ref]));return n}var u=n("./util/ref_properties");t.exports=r},{"./util/ref_properties":154}],120:[function(n,t){"use strict";function o(n,t,u,f){n=n||{};t=t||{};var e;for(e in n)n.hasOwnProperty(e)&&(t.hasOwnProperty(e)||(u.push({command:i.removeSource,args:[e]}),f[e]=!0));for(e in t)t.hasOwnProperty(e)&&(n.hasOwnProperty(e)?r(n[e],t[e])||("geojson"===n[e].type&&"geojson"===t[e].type?u.push({command:i.setGeoJSONSourceData,args:[e,t[e].data]}):(u.push({command:i.removeSource,args:[e]}),u.push({command:i.addSource,args:[e,t[e]]}),f[e]=!0)):u.push({command:i.addSource,args:[e,t[e]]}))}function u(n,t,i,u,f,e){n=n||{};t=t||{};var o;for(o in n)n.hasOwnProperty(o)&&(r(n[o],t[o])||i.push({command:e,args:[u,o,t[o],f]}));for(o in t)t.hasOwnProperty(o)&&!n.hasOwnProperty(o)&&(r(n[o],t[o])||i.push({command:e,args:[u,o,t[o],f]}))}function f(n){return n.id}function e(n,t){return n[t.id]=t,n}function s(n,t,o){n=n||[];t=t||[];for(var h,l,c,w,s,b=n.map(f),p=t.map(f),d=n.reduce(e,{}),k=t.reduce(e,{}),v=b.slice(),g=Object.create(null),a=0,y=0;a<b.length;a++)h=b[a],k.hasOwnProperty(h)?y++:(o.push({command:i.removeLayer,args:[h]}),v.splice(v.indexOf(h,y),1));for(a=0,y=0;a<p.length;a++)h=p[p.length-1-a],v[v.length-1-a]!==h&&(d.hasOwnProperty(h)?(o.push({command:i.removeLayer,args:[h]}),v.splice(v.lastIndexOf(h,v.length-y),1)):y++,w=v[v.length-a],o.push({command:i.addLayer,args:[k[h],w]}),v.splice(v.length-a,0,h),g[h]=!0);for(a=0;a<p.length;a++)if(h=p[a],l=d[h],c=k[h],!g[h]&&!r(l,c))if(r(l.source,c.source)&&r(l["source-layer"],c["source-layer"])&&r(l.type,c.type)){u(l.layout,c.layout,o,h,null,i.setLayoutProperty);u(l.paint,c.paint,o,h,null,i.setPaintProperty);r(l.filter,c.filter)||o.push({command:i.setFilter,args:[h,c.filter]});r(l.minzoom,c.minzoom)&&r(l.maxzoom,c.maxzoom)||o.push({command:i.setLayerZoomRange,args:[h,c.minzoom,c.maxzoom]});for(s in l)l.hasOwnProperty(s)&&"layout"!==s&&"paint"!==s&&"filter"!==s&&"metadata"!==s&&"minzoom"!==s&&"maxzoom"!==s&&(0===s.indexOf("paint.")?u(l[s],c[s],o,h,s.slice(6),i.setPaintProperty):r(l[s],c[s])||o.push({command:i.setLayerProperty,args:[h,s,c[s]]}));for(s in c)c.hasOwnProperty(s)&&!l.hasOwnProperty(s)&&"layout"!==s&&"paint"!==s&&"filter"!==s&&"metadata"!==s&&"minzoom"!==s&&"maxzoom"!==s&&(0===s.indexOf("paint.")?u(l[s],c[s],o,h,s.slice(6),i.setPaintProperty):r(l[s],c[s])||o.push({command:i.setLayerProperty,args:[h,s,c[s]]}))}else o.push({command:i.removeLayer,args:[h]}),w=v[v.lastIndexOf(h)+1],o.push({command:i.addLayer,args:[c,w]})}function h(n,t){var u,f,e,h;if(!n)return[{command:i.setStyle,args:[t]}];u=[];try{if(!r(n.version,t.version))return[{command:i.setStyle,args:[t]}];r(n.center,t.center)||u.push({command:i.setCenter,args:[t.center]});r(n.zoom,t.zoom)||u.push({command:i.setZoom,args:[t.zoom]});r(n.bearing,t.bearing)||u.push({command:i.setBearing,args:[t.bearing]});r(n.pitch,t.pitch)||u.push({command:i.setPitch,args:[t.pitch]});r(n.sprite,t.sprite)||u.push({command:i.setSprite,args:[t.sprite]});r(n.glyphs,t.glyphs)||u.push({command:i.setGlyphs,args:[t.glyphs]});r(n.transition,t.transition)||u.push({command:i.setTransition,args:[t.transition]});r(n.light,t.light)||u.push({command:i.setLight,args:[t.light]});f={};e=[];o(n.sources,t.sources,e,f);h=[];n.layers&&n.layers.forEach(function(n){f[n.source]?u.push({command:i.removeLayer,args:[n.id]}):h.push(n)});u=u.concat(e);s(h,t.layers,u)}catch(n){console.warn("Unable to compute style diff:",n);u=[{command:i.setStyle,args:[t]}]}return u}var r=n("lodash.isequal"),i={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};t.exports=h;t.exports.operations=i},{"lodash.isequal":34}],121:[function(n,t){"use strict";function r(n,t){for(var u=[],r=arguments.length-2;r-->0;)u[r]=arguments[r+2];this.message=(n?n+": ":"")+i.apply(i,u);null!==t&&void 0!==t&&t.__line__&&(this.line=t.__line__)}var i=n("util").format;t.exports=r},{util:45}],122:[function(n,t){"use strict";function u(n){return{type:n}}function f(n){return Array.isArray(n)?"("+n.map(r).join(", ")+")":"("+r(n.type)+"...)"}var e=n("./types"),r=e.toString,o=n("./parsing_context"),s=n("./evaluation_context"),i=function(n,t,i,r,u){this.key=n;this.name=t;this.type=i;this._evaluate=r;this.args=u};i.prototype.evaluate=function(n){return this._evaluate(n,this.args)};i.prototype.eachChild=function(n){this.args.forEach(n)};i.parse=function(n,t){var y=n[0],u=i.definitions[y],k,p,v,w,h,nt,tt,it,rt;if(!u)return t.error('Unknown expression "'+y+'". If you wanted a literal array, use ["literal", [...]].',0);for(var ut=Array.isArray(u)?u[0]:u.type,c=Array.isArray(u)?[[u[1],u[2]]]:u.overloads.filter(function(t){return!Array.isArray(t[0][0])||t[0][0].length===n.length-1}),e=[],a=1;a<n.length;a++){if(k=n[a],p=void 0,1===c.length&&(v=c[0][0],p=Array.isArray(v)?v[a-1]:v.type),w=t.parse(k,1+e.length,p),!w)return null;e.push(w)}for(var l=null,b=0,d=c;b<d.length;b+=1){var g=d[b],s=g[0],ft=g[1];if(l=new o(t.definitions,t.path,null,t.scope),Array.isArray(s)&&s.length!==e.length)l.error("Expected "+s.length+" arguments, but found "+e.length+" instead.");else{for(h=0;h<e.length;h++)nt=Array.isArray(s)?s[h]:s.type,tt=e[h],l.concat(h+1).checkSubtype(nt,tt.type);if(0===l.errors.length)return new i(t.key,y,ut,ft,e)}}return 1===c.length?t.errors.push.apply(t.errors,l.errors):(it=c.map(function(n){return f(n[0])}).join(" | "),rt=e.map(function(n){return r(n.type)}).join(", "),t.error("Expected arguments of type "+it+", but found ("+rt+") instead.")),null};i.register=function(n,t){i.definitions=t;for(var r in t)n[r]=i};t.exports={CompoundExpression:i,varargs:u}},{"./evaluation_context":135,"./parsing_context":138,"./types":142}],123:[function(n,t){"use strict";var i=n("../types"),u=i.toString,s=i.array,f=i.ValueType,h=i.StringType,c=i.NumberType,l=i.BooleanType,a=i.checkSubtype,v=n("../values"),e=v.typeOf,y=n("../runtime_error"),o={string:h,number:c,boolean:l},r=function(n,t,i){this.key=n;this.type=t;this.input=i};r.parse=function(n,t){var u,h,i,c,e;if(n.length<2||n.length>4)return t.error("Expected 1, 2, or 3 arguments, but found "+(n.length-1)+" instead.");if(n.length>2){if(i=n[1],"string"!=typeof i||!(i in o))return t.error('The item type argument of "array" must be one of string, number, boolean',1);u=o[i]}else u=f;if(n.length>3){if("number"!=typeof n[2]||n[2]<0||n[2]!==Math.floor(n[2]))return t.error('The length argument to "array" must be a positive integer literal',2);h=n[2]}return c=s(u,h),e=t.parse(n[n.length-1],n.length-1,f),e?new r(t.key,c,e):null};r.prototype.evaluate=function(n){var t=this.input.evaluate(n);if(a(this.type,e(t)))throw new y("Expected value to be of type "+u(this.type)+", but found "+u(e(t))+" instead.");return t};r.prototype.eachChild=function(n){n(this.input)};t.exports=r},{"../runtime_error":140,"../types":142,"../values":143}],124:[function(n,t){"use strict";var i=n("../types"),o=i.ObjectType,s=i.ValueType,h=i.StringType,c=i.NumberType,l=i.BooleanType,a=n("../runtime_error"),u=n("../types"),v=u.checkSubtype,f=u.toString,y=n("../values"),e=y.typeOf,p={string:h,number:c,boolean:l,object:o},r=function(n,t,i){this.key=n;this.type=t;this.args=i};r.parse=function(n,t){var u;if(n.length<2)return t.error("Expected at least one argument.");for(var e=n[0],o=p[e],f=[],i=1;i<n.length;i++){if(u=t.parse(n[i],i,s),!u)return null;f.push(u)}return new r(t.key,o,f)};r.prototype.evaluate=function(n){for(var r,t=this,i=0;i<this.args.length;i++){if(r=t.args[i].evaluate(n),!v(t.type,e(r)))return r;if(i===t.args.length-1)throw new a("Expected value to be of type "+f(t.type)+", but found "+f(e(r))+" instead.");}return null};r.prototype.eachChild=function(n){this.args.forEach(n)};t.exports=r},{"../runtime_error":140,"../types":142,"../values":143}],125:[function(n,t){"use strict";var r=n("../types"),f=r.array,e=r.ValueType,o=r.NumberType,u=n("../runtime_error"),i=function(n,t,i,r){this.key=n;this.type=t;this.index=i;this.input=r};i.parse=function(n,t){var u,r,s;return 3!==n.length?t.error("Expected 2 arguments, but found "+(n.length-1)+" instead."):(u=t.parse(n[1],1,o),r=t.parse(n[2],2,f(t.expectedType||e)),!u||!r)?null:(s=r.type,new i(t.key,s.itemType,u,r))};i.prototype.evaluate=function(n){var t=this.index.evaluate(n),i=this.input.evaluate(n);if(t<0||t>=i.length)throw new u("Array index out of bounds: "+t+" > "+i.length+".");if(t!==Math.floor(t))throw new u("Array index must be an integer, but found "+t+" instead.");return i[t]};i.prototype.eachChild=function(n){n(this.index);n(this.input)};t.exports=i},{"../runtime_error":140,"../types":142}],126:[function(n,t){"use strict";var r=n("../types"),u=r.BooleanType,i=function(n,t,i,r){this.key=n;this.type=t;this.branches=i;this.otherwise=r};i.parse=function(n,t){var f,o,r,s,e,h;if(n.length<4)return t.error("Expected at least 3 arguments, but found only "+(n.length-1)+".");if(n.length%2!=0)return t.error("Expected an odd number of arguments.");for(t.expectedType&&"value"!==t.expectedType.kind&&(f=t.expectedType),o=[],r=1;r<n.length-1;r+=2){if((s=t.parse(n[r],r,u),!s)||(e=t.parse(n[r+1],r+1,f),!e))return null;o.push([s,e]);f=f||e.type}return h=t.parse(n[n.length-1],n.length-1,f),h?new i(t.key,f,o,h):null};i.prototype.evaluate=function(n){for(var u=this,t=0,i=u.branches;t<i.length;t+=1){var r=i[t],f=r[0],e=r[1];if(f.evaluate(n))return e.evaluate(n)}return this.otherwise.evaluate(n)};i.prototype.eachChild=function(n){for(var u=this,t=0,i=u.branches;t<i.length;t+=1){var r=i[t],f=r[0],e=r[1];n(f);n(e)}n(this.otherwise)};t.exports=i},{"../types":142}],127:[function(n,t){"use strict";var i=function(n,t,i){this.key=n;this.type=t;this.args=i};i.parse=function(n,t){var r,s,u;if(n.length<2)return t.error("Expectected at least one argument.");r=null;t.expectedType&&"value"!==t.expectedType.kind&&(r=t.expectedType);for(var f=[],e=0,o=n.slice(1);e<o.length;e+=1){if(s=o[e],u=t.parse(s,1+f.length,r),!u)return null;r=r||u.type;f.push(u)}return new i(t.key,r,f)};i.prototype.evaluate=function(n){for(var u=this,i=null,t=0,r=u.args;t<r.length;t+=1)if(null!==(i=r[t].evaluate(n)))break;return i};i.prototype.eachChild=function(n){this.args.forEach(n)};t.exports=i},{}],128:[function(n,t){"use strict";var r=n("../types"),e=r.ColorType,o=r.ValueType,s=r.NumberType,u=n("../values"),h=u.Color,c=u.validateRGBA,l=u.unwrap,f=n("../runtime_error"),a={"to-number":s,"to-color":e},i=function(n,t,i){this.key=n;this.type=t;this.args=i};i.parse=function(n,t){var u;if(n.length<2)return t.error("Expected at least one argument.");for(var e=n[0],s=a[e],f=[],r=1;r<n.length;r++){if(u=t.parse(n[r],r,o),!u)return null;f.push(u)}return new i(t.key,s,f)};i.prototype.evaluate=function(n){var v=this,t,r,i,u,e,a;if("color"===this.type.kind){for(i=0,u=v.args;i<u.length;i+=1)if(t=u[i].evaluate(n),r=null,"string"==typeof t){if(e=n.parseColor(t),e)return e}else if(Array.isArray(t)&&!(r=t.length<3||t.length>4?"Invalid rbga value "+JSON.stringify(t)+": expected an array containing either three or four numeric values.":c(t[0],t[1],t[2],t[3])))return new h(t[0]/255,t[1]/255,t[2]/255,t[3]);throw new f(r||"Could not parse color from value '"+("string"==typeof t?t:JSON.stringify(t))+"'");}for(var o=null,s=0,y=v.args;s<y.length;s+=1)if(null!==(o=y[s].evaluate(n))&&(a=Number(o),!isNaN(a)))return a;throw new f("Could not convert "+JSON.stringify(l(o))+" to number.");};i.prototype.eachChild=function(n){this.args.forEach(n)};t.exports=i},{"../runtime_error":140,"../types":142,"../values":143}],129:[function(n,t){"use strict";function r(n,t,i,r){var u=r-i,f=n-i;return 0===u?0:1===t?f/u:(Math.pow(t,f)-1)/(Math.pow(t,u)-1)}function e(n,t){for(var r,e,o=n.length,u=0,f=o-1,i=0;u<=f;){if(i=Math.floor((u+f)/2),r=n[i],e=n[i+1],t===r||t>r&&t<e)return i;r<t?u=i+1:r>t&&(f=i-1)}return Math.max(i-1,0)}var o=n("@mapbox/unitbezier"),u=n("../../util/interpolate"),f=n("../types"),s=f.toString,h=f.NumberType,c=n("../values"),l=c.Color,i=function(n,t,i,r,u){var o=this,f,e;for(this.key=n,this.type=t,this.interpolation=i,this.input=r,this.labels=[],this.outputs=[],f=0,e=u;f<e.length;f+=1){var s=e[f],h=s[0],c=s[1];o.labels.push(h);o.outputs.push(c)}};i.interpolationFactor=function(n,t,i,u){var e=0,f,s;return"exponential"===n.name?e=r(t,n.base,i,u):"linear"===n.name?e=r(t,1,i,u):"cubic-bezier"===n.name&&(f=n.controlPoints,s=new o(f[0],f[1],f[2],f[3]),e=s.solve(r(t,1,i,u))),e};i.parse=function(n,t){var r=n[1],y=n[2],c=n.slice(3),p,l,o,a,w,e,u,f,v;if(!Array.isArray(r)||0===r.length)return t.error("Expected an interpolation type expression.",1);if("step"===r[0])r={name:"step"};else if("linear"===r[0])r={name:"linear"};else if("exponential"===r[0]){if(p=r[1],"number"!=typeof p)return t.error("Exponential interpolation requires a numeric base.",1,1);r={name:"exponential",base:p}}else{if("cubic-bezier"!==r[0])return t.error("Unknown interpolation type "+String(r[0]),1,0);if(l=r.slice(1),4!==l.length||l.some(function(n){return"number"!=typeof n||n<0||n>1}))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);r={name:"cubic-bezier",controlPoints:l}}if(o="step"===r.name,a=o?5:4,n.length-1<a)return t.error("Expected at least "+a+" arguments, but found only "+(n.length-1)+".");if(w=a%2,(n.length-1)%2!==w)return t.error("Expected an "+(0===w?"even":"odd")+" number of arguments.");if(!(y=t.parse(y,2,h)))return null;for(e=[],u=null,t.expectedType&&"value"!==t.expectedType.kind&&(u=t.expectedType),o&&c.unshift(-1/0),f=0;f<c.length;f+=2){var b=c[f],d=c[f+1],k=o?f+2:f+3,g=o?f+3:f+4;if("number"!=typeof b)return t.error('Input/output pairs for "curve" expressions must be defined using literal numeric values (not computed expressions) for the input values.',k);if(e.length&&e[e.length-1][0]>b)return t.error('Input/output pairs for "curve" expressions must be arranged with input values in strictly ascending order.',k);if(v=t.parse(d,g,u),!v)return null;u=u||v.type;e.push([b,v])}return"step"===r.name||"number"===u.kind||"color"===u.kind||"array"===u.kind&&"number"===u.itemType.kind?new i(t.key,u,r,y,e):t.error("Type "+s(u)+" is not interpolatable, and thus cannot be used as a "+r.name+" curve's output type.")};i.prototype.evaluate=function(n){var t=this.labels,f=this.outputs,o,s,r;if(1===t.length||(o=this.input.evaluate(n),o<=t[0]))return f[0].evaluate(n);if(s=t.length,o>=t[s-1])return f[s-1].evaluate(n);if(r=e(t,o),"step"===this.interpolation.name)return f[r].evaluate(n);var y=t[r],p=t[r+1],h=i.interpolationFactor(this.interpolation,o,y,p),c=f[r].evaluate(n),a=f[r+1].evaluate(n),v=this.type.kind.toLowerCase();return"color"===v?new(Function.prototype.bind.apply(l,[null].concat(u.color(c.value,a.value,h)))):u[v](c,a,h)};i.prototype.eachChild=function(n){var r=this,t,i;for(n(this.input),t=0,i=r.outputs;t<i.length;t+=1)n(i[t])};t.exports=i},{"../../util/interpolate":152,"../types":142,"../values":143,"@mapbox/unitbezier":5}],130:[function(n,t){"use strict";function p(n,t){var r=t[0],u=t[1],f=t[2],i=t[3],e;if(r=r.evaluate(n),u=u.evaluate(n),f=f.evaluate(n),i=i&&i.evaluate(n),e=lt(r,u,f,i),e)throw new ft(e);return new rt(r/255,u/255,f/255,i)}function w(n,t){return n in t}function b(n,t){var i=t[n];return void 0===i?null:i}function k(n,t){return t[0].evaluate(n).length}function s(n,t){var i=t[0],r=t[1];return i.evaluate(n)===r.evaluate(n)}function h(n,t){var i=t[0],r=t[1];return i.evaluate(n)!==r.evaluate(n)}function d(n,t){var i=t[0],r=t[1];return i.evaluate(n)<r.evaluate(n)}function g(n,t){var i=t[0],r=t[1];return i.evaluate(n)>r.evaluate(n)}function nt(n,t){var i=t[0],r=t[1];return i.evaluate(n)<=r.evaluate(n)}function tt(n,t){var i=t[0],r=t[1];return i.evaluate(n)>=r.evaluate(n)}var f=n("../types"),c=f.NullType,i=f.NumberType,r=f.StringType,u=f.BooleanType,a=f.ColorType,v=f.ObjectType,o=f.ValueType,st=f.ErrorType,it=f.array,ht=f.toString,y=n("../values"),ct=y.typeOf,rt=y.Color,lt=y.validateRGBA,ut=n("../compound_expression"),at=ut.CompoundExpression,e=ut.varargs,ft=n("../runtime_error"),vt=n("./let"),yt=n("./var"),pt=n("./literal"),l=n("./assertion"),wt=n("./array"),et=n("./coercion"),bt=n("./at"),kt=n("./match"),dt=n("./case"),gt=n("./curve"),ni=n("./coalesce"),ot={"let":vt,"var":yt,literal:pt,string:l,number:l,boolean:l,object:l,array:wt,"to-number":et,"to-color":et,at:bt,"case":dt,match:kt,coalesce:ni,curve:gt};at.register(ot,{error:[st,[r],function(n,t){var i=t[0];throw new ft(i.evaluate(n));}],"typeof":[r,[o],function(n,t){var i=t[0];return ht(ct(i.evaluate(n)))}],"to-string":[r,[o],function(n,t){var i=t[0],u,r;return(i=i.evaluate(n),u=typeof i,null===i||"string"===u||"number"===u||"boolean"===u)?String(i):i instanceof rt?(r=i.value,"rgba("+255*r[0]+", "+255*r[1]+", "+255*r[2]+", "+r[3]+")"):JSON.stringify(i)}],"to-boolean":[u,[o],function(n,t){var i=t[0];return Boolean(i.evaluate(n))}],"to-rgba":[it(i,4),[a],function(n,t){return t[0].evaluate(n).value}],rgb:[a,[i,i,i],p],rgba:[a,[i,i,i,i],p],length:{type:i,overloads:[[[r],k],[[it(o)],k]]},has:{type:u,overloads:[[[r],function(n,t){return w(t[0].evaluate(n),n.properties())}],[[r,v],function(n,t){var i=t[0],r=t[1];return w(i.evaluate(n),r.evaluate(n))}]]},get:{type:o,overloads:[[[r],function(n,t){return b(t[0].evaluate(n),n.properties())}],[[r,v],function(n,t){var i=t[0],r=t[1];return b(i.evaluate(n),r.evaluate(n))}]]},properties:[v,[],function(n){return n.properties()}],"geometry-type":[r,[],function(n){return n.geometryType()}],id:[o,[],function(n){return n.id()}],zoom:[i,[],function(n){return n.globals.zoom}],"heatmap-density":[i,[],function(n){return n.globals.heatmapDensity||0}],"+":[i,e(i),function(n,t){for(var r=0,i=0,u=t;i<u.length;i+=1)r+=u[i].evaluate(n);return r}],"*":[i,e(i),function(n,t){for(var r=1,i=0,u=t;i<u.length;i+=1)r*=u[i].evaluate(n);return r}],"-":{type:i,overloads:[[[i,i],function(n,t){var i=t[0],r=t[1];return i.evaluate(n)-r.evaluate(n)}],[[i],function(n,t){return-t[0].evaluate(n)}]]},"/":[i,[i,i],function(n,t){var i=t[0],r=t[1];return i.evaluate(n)/r.evaluate(n)}],"%":[i,[i,i],function(n,t){var i=t[0],r=t[1];return i.evaluate(n)%r.evaluate(n)}],ln2:[i,[],function(){return Math.LN2}],pi:[i,[],function(){return Math.PI}],e:[i,[],function(){return Math.E}],"^":[i,[i,i],function(n,t){var i=t[0],r=t[1];return Math.pow(i.evaluate(n),r.evaluate(n))}],log10:[i,[i],function(n,t){var i=t[0];return Math.log10(i.evaluate(n))}],ln:[i,[i],function(n,t){var i=t[0];return Math.log(i.evaluate(n))}],log2:[i,[i],function(n,t){var i=t[0];return Math.log2(i.evaluate(n))}],sin:[i,[i],function(n,t){var i=t[0];return Math.sin(i.evaluate(n))}],cos:[i,[i],function(n,t){var i=t[0];return Math.cos(i.evaluate(n))}],tan:[i,[i],function(n,t){var i=t[0];return Math.tan(i.evaluate(n))}],asin:[i,[i],function(n,t){var i=t[0];return Math.asin(i.evaluate(n))}],acos:[i,[i],function(n,t){var i=t[0];return Math.acos(i.evaluate(n))}],atan:[i,[i],function(n,t){var i=t[0];return Math.atan(i.evaluate(n))}],min:[i,e(i),function(n,t){return Math.min.apply(Math,t.map(function(t){return t.evaluate(n)}))}],max:[i,e(i),function(n,t){return Math.max.apply(Math,t.map(function(t){return t.evaluate(n)}))}],"==":{type:u,overloads:[[[i,i],s],[[r,r],s],[[u,u],s],[[c,c],s]]},"!=":{type:u,overloads:[[[i,i],h],[[r,r],h],[[u,u],h],[[c,c],h]]},">":{type:u,overloads:[[[i,i],g],[[r,r],g]]},"<":{type:u,overloads:[[[i,i],d],[[r,r],d]]},">=":{type:u,overloads:[[[i,i],tt],[[r,r],tt]]},"<=":{type:u,overloads:[[[i,i],nt],[[r,r],nt]]},all:{type:u,overloads:[[[u,u],function(n,t){var i=t[0],r=t[1];return i.evaluate(n)&&r.evaluate(n)}],[e(u),function(n,t){for(var i=0,r=t;i<r.length;i+=1)if(!r[i].evaluate(n))return!1;return!0}]]},any:{type:u,overloads:[[[u,u],function(n,t){var i=t[0],r=t[1];return i.evaluate(n)||r.evaluate(n)}],[e(u),function(n,t){for(var i=0,r=t;i<r.length;i+=1)if(r[i].evaluate(n))return!0;return!1}]]},"!":[u,[u],function(n,t){return!t[0].evaluate(n)}],upcase:[r,[r],function(n,t){return t[0].evaluate(n).toUpperCase()}],downcase:[r,[r],function(n,t){return t[0].evaluate(n).toLowerCase()}],concat:[r,e(r),function(n,t){return t.map(function(t){return t.evaluate(n)}).join("")}]});t.exports=ot},{"../compound_expression":122,"../runtime_error":140,"../types":142,"../values":143,"./array":123,"./assertion":124,"./at":125,"./case":126,"./coalesce":127,"./coercion":128,"./curve":129,"./let":131,"./literal":132,"./match":133,"./var":134}],131:[function(n,t){"use strict";var i=function(n,t,i){this.key=n;this.type=i.type;this.bindings=[].concat(t);this.result=i};i.prototype.evaluate=function(n){n.pushScope(this.bindings);var t=this.result.evaluate(n);return n.popScope(),t};i.prototype.eachChild=function(n){for(var r=this,t=0,i=r.bindings;t<i.length;t+=1)n(i[t][1]);n(this.result)};i.parse=function(n,t){var f,r,u,e,o;if(n.length<4)return t.error("Expected at least 3 arguments, but found "+(n.length-1)+" instead.");for(f=[],r=1;r<n.length-1;r+=2){if(u=n[r],"string"!=typeof u)return t.error("Expected string, but found "+typeof u+" instead.",r);if(/[^a-zA-Z0-9_]/.test(u))return t.error("Variable names must contain only alphanumeric characters or '_'.",r);if(e=t.parse(n[r+1],r+1),!e)return null;f.push([u,e])}return o=t.parse(n[n.length-1],n.length-1,void 0,f),o?new i(t.key,f,o):null};t.exports=i},{}],132:[function(n,t){"use strict";var r=n("../values"),u=r.isValue,f=r.typeOf,i=function(n,t,i){this.key=n;this.type=t;this.value=i};i.parse=function(n,t){if(2!==n.length)return t.error("'literal' expression requires exactly one argument, but found "+(n.length-1)+" instead.");if(!u(n[1]))return t.error("invalid value");var o=n[1],e=f(o),r=t.expectedType;return"array"!==e.kind||0!==e.N||!r||"array"!==r.kind||"number"==typeof r.N&&0!==r.N||(e=r),new i(t.key,e,o)};i.prototype.evaluate=function(){return this.value};i.prototype.eachChild=function(){};t.exports=i},{"../values":143}],133:[function(n,t){"use strict";var u=n("../values"),r=u.typeOf,i=function(n,t,i,r,u,f,e){this.key=n;this.inputType=t;this.type=i;this.input=r;this.cases=u;this.outputs=f;this.otherwise=e};i.parse=function(n,t){var h,e,s,b,f,c,y,u,l,p,w;if(n.length<5)return t.error("Expected at least 4 arguments, but found only "+(n.length-1)+".");if(n.length%2!=1)return t.error("Expected an even number of arguments.");t.expectedType&&"value"!==t.expectedType.kind&&(e=t.expectedType);for(var a={},v=[],o=2;o<n.length-1;o+=2){if(s=n[o],b=n[o+1],Array.isArray(s)||(s=[s]),f=t.concat(o),0===s.length)return f.error("Expected at least one branch label.");for(c=0,y=s;c<y.length;c+=1){if(u=y[c],"number"!=typeof u&&"string"!=typeof u)return f.error("Branch labels must be numbers or strings.");if("number"==typeof u&&Math.abs(u)>Number.MAX_SAFE_INTEGER)return f.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof u&&Math.floor(u)!==u)return f.error("Numeric branch labels must be integer values.");if(h){if(f.checkSubtype(h,r(u)))return null}else h=r(u);if(void 0!==a[String(u)])return f.error("Branch labels must be unique.");a[String(u)]=v.length}if(l=t.parse(b,o,e),!l)return null;e=e||l.type;v.push(l)}return(p=t.parse(n[1],1,h),!p)?null:(w=t.parse(n[n.length-1],n.length-1,e),w?new i(t.key,h,e,p,a,v,w):null)};i.prototype.evaluate=function(n){var t=this.input.evaluate(n);return(this.outputs[this.cases[t]]||this.otherwise).evaluate(n)};i.prototype.eachChild=function(n){n(this.input);this.outputs.forEach(n);n(this.otherwise)};t.exports=i},{"../values":143}],134:[function(n,t){"use strict";var i=function(n,t,i){this.key=n;this.type=i;this.name=t};i.parse=function(n,t){if(2!==n.length||"string"!=typeof n[1])return t.error("'var' expression requires exactly one string literal argument.");var r=n[1];return t.scope.has(r)?new i(t.key,r,t.scope.get(r).type):t.error('Unknown variable "'+r+'". Make sure "'+r+'" has been bound in an enclosing "let" expression before using it.',1)};i.prototype.evaluate=function(n){return n.scope.get(this.name).evaluate(n)};i.prototype.eachChild=function(){};t.exports=i},{}],135:[function(n,t){"use strict";var r=n("./scope"),u=n("../util/parse_color"),f=n("./values"),e=f.Color,o=["Unknown","Point","LineString","Polygon"],i=function(){this.scope=new r;this._parseColorCache={}};i.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null};i.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?o[this.feature.type]:this.feature.type:null};i.prototype.properties=function(){return this.feature&&this.feature.properties||{}};i.prototype.pushScope=function(n){this.scope=this.scope.concat(n)};i.prototype.popScope=function(){this.scope=this.scope.parent};i.prototype.parseColor=function(n){var i=this._parseColorCache[n],t;return i||(t=u(n),i=this._parseColorCache[n]=t?new e(t[0],t[1],t[2],t[3]):null),i};t.exports=i},{"../util/parse_color":153,"./scope":141,"./values":143}],136:[function(n,t){"use strict";function c(n){return Array.isArray(n)&&n.length>0&&"string"==typeof n[0]&&n[0]in e}function l(n,t,i,h){var d,c,b,w,g,nt,k,l;return(void 0===h&&(h={}),d=new y(e,[],a(t)),c=d.parse(n),!c)?{result:"error",errors:d.errors}:(w=new p,!1===h.handleErrors?b=function(n,t){return w.globals=n,w.feature=t,c.evaluate(w)}:(g={},nt=v(t),b=function(n,t){w.globals=n;w.feature=t;try{var i=c.evaluate(w);return s(null===i||void 0===i?nt:i)}catch(n){return g[n.message]||(g[n.message]=!0,"undefined"!=typeof console&&console.warn(n.message)),s(nt)}}),k=o.isFeatureConstant(c),!k&&"property"===i&&!t["property-function"])?{result:"error",errors:[new r("","property expressions not supported")]}:o.isGlobalPropertyConstant(c,["zoom"])?{result:"success",context:i,isZoomConstant:!0,isFeatureConstant:k,evaluate:b,parsed:c}:"filter"===i?{result:"success",context:"filter",isZoomConstant:!1,isFeatureConstant:k,evaluate:b,parsed:c}:(l=u(c),l?l instanceof f?"step"!==l.interpolation.name&&"piecewise-constant"===t.function?{result:"error",errors:[new r(l.key,'interpolation type must be "step" for this property')]}:{result:"success",context:"property",isZoomConstant:!1,isFeatureConstant:k,evaluate:b,parsed:c,interpolation:l.interpolation,zoomStops:l.labels}:{result:"error",errors:[new r(l.key,l.error)]}:{result:"error",errors:[new r("",'"zoom" expression may only be used as input to a top-level "curve" expression.')]})}function u(n){var i,s,t;if(n instanceof f)return i=n.input,i instanceof b&&"zoom"===i.name?n:null;if(n instanceof d)return u(n.result);if(n instanceof k){for(var r=null,e=0,o=n.args;e<o.length;e+=1)if(s=o[e],t=u(s),t){if(t.error)return t;if(!(t instanceof f)||r)return{key:t.key,error:"Only one zoom-based curve may be used in a style function."};r=t}return r}return null}function a(n){var t={color:nt,string:h,number:tt,"enum":h,boolean:it};return"array"===n.type?ut(t[n.value]||rt,n.length):t[n.type]||null}function v(n){var i=n.default,t;return"color"===n.type&&et(i)?[0,0,0,0]:"color"===n.type?(t=ot(i),new ht(t[0],t[1],t[2],t[3])):void 0===i?null:i}var r=n("./parsing_error"),y=n("./parsing_context"),p=n("./evaluation_context"),w=n("./compound_expression"),b=w.CompoundExpression,f=n("./definitions/curve"),k=n("./definitions/coalesce"),d=n("./definitions/let"),e=n("./definitions"),o=n("./is_constant"),g=n("./values"),s=g.unwrap;t.exports.createExpression=l;t.exports.isExpression=c;var i=n("./types"),nt=i.ColorType,h=i.StringType,tt=i.NumberType,it=i.BooleanType,rt=i.ValueType,ut=i.array,ft=n("../function"),et=ft.isFunction,ot=n("../util/parse_color"),st=n("./values"),ht=st.Color},{"../function":145,"../util/parse_color":153,"./compound_expression":122,"./definitions":130,"./definitions/coalesce":127,"./definitions/curve":129,"./definitions/let":131,"./evaluation_context":135,"./is_constant":137,"./parsing_context":138,"./parsing_error":139,"./types":142,"./values":143}],137:[function(n,t){"use strict";function i(n){if(n instanceof u&&("get"===n.name&&1===n.args.length||"has"===n.name&&1===n.args.length||"properties"===n.name||"geometry-type"===n.name||"id"===n.name))return!1;var t=!0;return n.eachChild(function(n){t&&!i(n)&&(t=!1)}),t}function r(n,t){if(n instanceof u&&t.indexOf(n.name)>=0)return!1;var i=!0;return n.eachChild(function(n){i&&!r(n,t)&&(i=!1)}),i}var f=n("./compound_expression"),u=f.CompoundExpression;t.exports={isFeatureConstant:i,isGlobalPropertyConstant:r}},{"./compound_expression":122}],138:[function(n,t){"use strict";function u(t){var f=n("./compound_expression"),e=f.CompoundExpression,u=n("./is_constant"),o=u.isGlobalPropertyConstant,s=u.isFeatureConstant,i;return t instanceof n("./definitions/var")?!1:t instanceof e&&"error"===t.name?!1:(i=!0,t.eachChild(function(n){n instanceof r||(i=!1)}),!!i&&s(t)&&o(t,["zoom","heatmap-density"]))}var f=n("./scope"),e=n("./types"),o=e.checkSubtype,s=n("./parsing_error"),r=n("./definitions/literal"),i=function(n,t,i,r,u){void 0===t&&(t=[]);void 0===r&&(r=new f);void 0===u&&(u=[]);this.definitions=n;this.path=t;this.key=t.map(function(n){return"["+n+"]"}).join("");this.scope=r;this.errors=u;this.expectedType=i};i.prototype.parse=function(t,i,f,e){var s=this,c,a,o,h,l,v,y;if(i&&(s=s.concat(i,f,e)),null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return s.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');if(c=t[0],"string"!=typeof c)return s.error("Expression name must be a string, but found "+typeof c+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;if(a=s.definitions[c],a){if((o=a.parse(t,s),!o)||(h=s.expectedType,l=o.type,h&&(("string"===h.kind||"number"===h.kind||"boolean"===h.kind)&&"value"===l.kind?o=new(n("./definitions/assertion"))(o.key,h,[o]):"color"===h.kind&&("value"===l.kind||"string"===l.kind)&&(v=n("./definitions/coercion"),o=new v(o.key,h,[o])),s.checkSubtype(h,o.type))))return null;if(!(o instanceof r)&&u(o)){y=new(n("./evaluation_context"));try{o=new r(o.key,o.type,o.evaluate(y))}catch(t){return s.error(t.message),null}}return o}return s.error('Unknown expression "'+c+'". If you wanted a literal array, use ["literal", [...]].',0)}return void 0===t?s.error("'undefined' value invalid. Use null instead."):"object"==typeof t?s.error('Bare objects invalid. Use ["literal", {...}] instead.'):s.error("Expected an array, but found "+typeof t+" instead.")};i.prototype.concat=function(n,t,r){var u="number"==typeof n?this.path.concat(n):this.path,f=r?this.scope.concat(r):this.scope;return new i(this.definitions,u,t||null,f,this.errors)};i.prototype.error=function(n){for(var r,i=[],t=arguments.length-1;t-->0;)i[t]=arguments[t+1];r=""+this.key+i.map(function(n){return"["+n+"]"}).join("");this.errors.push(new s(r,n))};i.prototype.checkSubtype=function(n,t){var i=o(n,t);return i&&this.error(i),i};t.exports=i},{"./compound_expression":122,"./definitions/assertion":124,"./definitions/coercion":128,"./definitions/literal":132,"./definitions/var":134,"./evaluation_context":135,"./is_constant":137,"./parsing_error":139,"./scope":141,"./types":142}],139:[function(n,t){"use strict";var i=function(n){function t(t,i){n.call(this,i);this.message=i;this.key=t}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(Error);t.exports=i},{}],140:[function(n,t){"use strict";var i=function(n){this.name="ExpressionEvaluationError";this.message=n};i.prototype.toJSON=function(){return this.message};t.exports=i},{}],141:[function(n,t){"use strict";var i=function(n,t){var f=this,i,r;for(void 0===t&&(t=[]),this.parent=n,this.bindings={},i=0,r=t;i<r.length;i+=1){var u=r[i],e=u[0],o=u[1];f.bindings[e]=o}};i.prototype.concat=function(n){return new i(this,n)};i.prototype.get=function(n){if(this.bindings[n])return this.bindings[n];if(this.parent)return this.parent.get(n);throw new Error(n+" not found in scope.");};i.prototype.has=function(n){return!!this.bindings[n]||!!this.parent&&this.parent.has(n)};t.exports=i},{}],142:[function(n,t){"use strict";function u(n,t){return{kind:"array",itemType:n,N:t}}function i(n){if("array"===n.kind){var t=i(n.itemType);return"number"==typeof n.N?"array<"+t+", "+n.N+">":"value"===n.itemType.kind?"array":"array<"+t+">"}return n.kind}function r(n,t){var u,f,e;if("error"===t.kind)return null;if("array"===n.kind){if("array"===t.kind&&!r(n.itemType,t.itemType)&&("number"!=typeof n.N||n.N===t.N))return null}else{if(n.kind===t.kind)return null;if("value"===n.kind)for(u=0,f=a;u<f.length;u+=1)if(e=f[u],!r(e,t))return null}return"Expected "+i(n)+" but found "+i(t)+" instead."}var f={kind:"null"},e={kind:"number"},o={kind:"string"},s={kind:"boolean"},h={kind:"color"},c={kind:"object"},l={kind:"value"},a=[f,e,o,s,h,c,u(l)];t.exports={NullType:f,NumberType:e,StringType:o,BooleanType:s,ColorType:h,ObjectType:c,ValueType:l,array:u,ErrorType:{kind:"error"},toString:i,checkSubtype:r}},{}],143:[function(n,t){"use strict";function o(n,t,i,r){return("number"==typeof n&&n>=0&&n<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof i&&i>=0&&i<=255)?void 0===r||"number"==typeof r&&r>=0&&r<=1?null:"Invalid rgba value ["+[n,t,i,r].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof r?[n,t,i,r]:[n,t,i]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function u(n){var t,i,f;if(null===n||"string"==typeof n||"boolean"==typeof n||"number"==typeof n||n instanceof r)return!0;if(Array.isArray(n)){for(t=0,i=n;t<i.length;t+=1)if(!u(i[t]))return!1;return!0}if("object"==typeof n){for(f in n)if(!u(n[f]))return!1;return!0}return!1}function f(n){var s,u;if(null===n)return h;if("string"==typeof n)return l;if("boolean"==typeof n)return a;if("number"==typeof n)return c;if(n instanceof r)return v;if(Array.isArray(n)){for(var t,w=n.length,i=0,o=n;i<o.length;i+=1){if(s=o[i],u=f(s),t){if(t===u)continue;t=e;break}t=u}return p(t||e,w)}return y}function s(n){return n instanceof r?n.value:n}var i=n("./types"),h=i.NullType,c=i.NumberType,l=i.StringType,a=i.BooleanType,v=i.ColorType,y=i.ObjectType,e=i.ValueType,p=i.array,r=function(n,t,i,r){void 0===r&&(r=1);this.value=[n,t,i,r]};t.exports={Color:r,validateRGBA:o,isValue:u,typeOf:f,unwrap:s}},{"./types":142}],144:[function(n,t){"use strict";function i(n){var t,r,u;if(!Array.isArray(n)||0===n.length)return!1;switch(n[0]){case"has":return n.length>=2&&"$id"!==n[1]&&"$type"!==n[1];case"in":case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3===n.length&&(Array.isArray(n[1])||Array.isArray(n[2]));case"any":case"all":for(t=0,r=n.slice(1);t<r.length;t+=1)if(u=r[t],!i(u)&&"boolean"!=typeof u)return!1;return!0;default:return!0}}function a(n){if(!n)return function(){return!0};if(!i(n))return new Function("g","f","var p = (f && f.properties || {}); return "+o(n));var t=p(n,l,"filter");if("success"===t.result)return t.evaluate;throw new Error(t.errors.map(function(n){return n.key+": "+n.message}).join(", "));}function o(n){if(!n)return"true";var t=n[0];return n.length<=1?"any"===t?"false":"true":"("+("=="===t?r(n[1],n[2],"===",!1):"!="===t?r(n[1],n[2],"!==",!1):"<"===t||">"===t||"<="===t||">="===t?r(n[1],n[2],t,!0):"any"===t?u(n.slice(1),"||"):"all"===t?u(n.slice(1),"&&"):"none"===t?f(u(n.slice(1),"||")):"in"===t?h(n[1],n.slice(2)):"!in"===t?f(h(n[1],n.slice(2))):"has"===t?c(n[1]):"!has"===t?f(c(n[1])):"true")+")"}function s(n){return"$type"===n?"f.type":"$id"===n?"f.id":"p["+JSON.stringify(n)+"]"}function r(n,t,i,r){var u=s(n),f="$type"===n?e.indexOf(t):JSON.stringify(t);return(r?"typeof "+u+"=== typeof "+f+"&&":"")+u+i+f}function u(n,t){return n.map(o).join(t)}function h(n,t){"$type"===n&&(t=t.map(function(n){return e.indexOf(n)}));var i=JSON.stringify(t.sort(v)),r=s(n);return t.length<=200?i+".indexOf("+r+") !== -1":"function(v, a, i, j) {while (i <= j) { var m = (i + j) >> 1;    if (a[m] === v) return true; if (a[m] > v) j = m - 1; else i = m + 1;}return false; }("+r+", "+i+",0,"+(t.length-1)+")"}function c(n){return"$id"===n?'"id" in f':JSON.stringify(n)+" in p"}function f(n){return"!("+n+")"}function v(n,t){return n<t?-1:n>t?1:0}var y=n("../expression"),p=y.createExpression,e,l;t.exports=a;t.exports.isExpressionFilter=i;e=["Unknown","Point","LineString","Polygon"];l={type:"boolean","default":!1,"function":!0,"property-function":!0}},{"../expression":136}],145:[function(n,t){"use strict";function c(n){return"object"==typeof n&&null!==n&&!Array.isArray(n)}function f(n){return n}function e(n,t,u){var vt="color"===t.type,it=n.stops&&"object"==typeof n.stops[0][0],yt=it||void 0!==n.property,pt=it||!yt,c=n.type||("interpolated"===t.function?"exponential":"interval"),s,k,g,nt,rt,ut,y,ft,w,tt,b,ht,at;if(vt&&(n=p({},n),n.stops&&(n.stops=n.stops.map(function(n){return[n[0],r(n[1])]})),n.default=n.default?r(n.default):r(t.default)),"exponential"===c)s=o;else if("interval"===c)s=a;else if("categorical"===c){for(s=l,k=Object.create(null),nt=0,rt=n.stops;nt<rt.length;nt+=1)ut=rt[nt],k[ut[0]]=ut[1];g=typeof n.stops[0][0]}else{if("identity"!==c)throw new Error('Unknown function type "'+c+'"');s=v}if(n.colorSpace&&"rgb"!==n.colorSpace){if(!h[n.colorSpace])throw new Error("Unknown color space: "+n.colorSpace);for(ft=h[n.colorSpace],n=JSON.parse(JSON.stringify(n)),w=0;w<n.stops.length;w++)n.stops[w]=[n.stops[w][0],ft.forward(n.stops[w][1])];y=ft.reverse}else y=f;if(it){for(var d={},ct=[],et=0;et<n.stops.length;et++)tt=n.stops[et],b=tt[0].zoom,void 0===d[b]&&(d[b]={zoom:b,type:n.type,property:n.property,"default":n.default,stops:[]},ct.push(b)),d[b].stops.push([tt[0].value,tt[1]]);for(var ot=[],st=0,lt=ct;st<lt.length;st+=1)ht=lt[st],ot.push([d[ht].zoom,e(d[ht],t)]);return{isFeatureConstant:!1,interpolation:{name:"linear"},zoomStops:ot.map(function(n){return n[0]}),evaluate:function(i,r){var u=i.zoom;return y(o({stops:ot,base:n.base},t,u).evaluate(u,r))}}}return pt?(at="heatmap-color"===u?function(i){var r=i.heatmapDensity;return y(s(n,t,r,k,g))}:function(i){var r=i.zoom;return y(s(n,t,r,k,g))},{isFeatureConstant:!0,isZoomConstant:!1,interpolation:"exponential"===c?{name:"exponential",base:void 0!==n.base?n.base:1}:{name:"step"},zoomStops:n.stops.map(function(n){return n[0]}),evaluate:at}):{isFeatureConstant:!1,isZoomConstant:!0,evaluate:function(r,u){var f=u&&u.properties?u.properties[n.property]:void 0;return void 0===f?i(n.default,t.default):y(s(n,t,f,k,g))}}}function i(n,t,i){return void 0!==n?n:void 0!==t?t:void 0!==i?i:void 0}function l(n,t,r,u,f){return i(typeof r===f?u[r]:void 0,n.default,t.default)}function a(n,t,r){var f,e;return"number"!==u(r)?i(n.default,t.default):(f=n.stops.length,1===f)?n.stops[0][1]:r<=n.stops[0][0]?n.stops[0][1]:r>=n.stops[f-1][0]?n.stops[f-1][1]:(e=s(n.stops,r),n.stops[e][1])}function o(n,t,r){var v=void 0!==n.base?n.base:1,e;if("number"!==u(r))return i(n.default,t.default);if((e=n.stops.length,1===e)||r<=n.stops[0][0])return n.stops[0][1];if(r>=n.stops[e-1][0])return n.stops[e-1][1];var o=s(n.stops,r),c=y(r,v,n.stops[o][0],n.stops[o+1][0]),h=n.stops[o][1],l=n.stops[o+1][1],a=w[t.type]||f;return"function"==typeof h.evaluate?{evaluate:function(){for(var i,r,n=[],t=arguments.length;t--;)n[t]=arguments[t];return i=h.evaluate.apply(void 0,n),r=l.evaluate.apply(void 0,n),void 0!==i&&void 0!==r?a(i,r,c):void 0}}:a(h,l,c)}function v(n,t,f){return"color"===t.type?f=r(f):u(f)===t.type||"enum"===t.type&&t.values[f]||(f=void 0),i(f,n.default,t.default)}function s(n,t){for(var r,e,o=n.length,u=0,f=o-1,i=0;u<=f;){if(i=Math.floor((u+f)/2),r=n[i][0],e=n[i+1][0],t===r||t>r&&t<e)return i;r<t?u=i+1:r>t&&(f=i-1)}return Math.max(i-1,0)}function y(n,t,i,r){var u=r-i,f=n-i;return 0===u?0:1===t?f/u:(Math.pow(t,f)-1)/(Math.pow(t,u)-1)}var h=n("../util/color_spaces"),r=n("../util/parse_color"),p=n("../util/extend"),u=n("../util/get_type"),w=n("../util/interpolate");t.exports={createFunction:e,isFunction:c}},{"../util/color_spaces":149,"../util/extend":150,"../util/get_type":151,"../util/interpolate":152,"../util/parse_color":153}],146:[function(n,t){"use strict";function i(n){var r=typeof n;if("number"===r||"boolean"===r||"string"===r||void 0===n||null===n)return JSON.stringify(n);if(Array.isArray(n)){for(var e="[",u=0,o=n;u<o.length;u+=1)e+=i(o[u])+",";return e+"]"}for(var f=Object.keys(n).sort(),s="{",t=0;t<f.length;t++)s+=JSON.stringify(f[t])+":"+i(n[f[t]])+",";return s+"}"}function r(n){for(var r="",t=0,u=f;t<u.length;t+=1)r+="/"+i(n[u[t]]);return r}function u(n){for(var f,u,e,o,t={},i=0;i<n.length;i++)f=r(n[i]),u=t[f],u||(u=t[f]=[]),u.push(n[i]);e=[];for(o in t)e.push(t[o]);return e}var f=n("./util/ref_properties");t.exports=u},{"./util/ref_properties":154}],147:[function(n,t){"use strict";t.exports=n("./v8.json")},{"./v8.json":148}],148:[function(n,t){t.exports={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number","default":0,period:360,units:"degrees"},pitch:{type:"number","default":0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_tile","source_geojson","source_video","source_image","source_canvas"],source_tile:{type:{required:!0,type:"enum",values:{vector:{},raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,"default":[-180,-85.0511,180,85.0511]},minzoom:{type:"number","default":0},maxzoom:{type:"number","default":22},tileSize:{type:"number","default":512,units:"pixels"},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number","default":18},buffer:{type:"number","default":128,maximum:512,minimum:0},tolerance:{type:"number","default":.375},cluster:{type:"boolean","default":!1},clusterRadius:{type:"number","default":50,minimum:0},clusterMaxZoom:{type:"number"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_canvas:{type:{required:!0,type:"enum",values:{canvas:{}}},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}},animate:{type:"boolean","default":"true"},canvas:{type:"string",required:!0}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},background:{}}},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"},"paint.*":{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},"default":"visible"}},layout_fill:{visibility:{type:"enum",values:{visible:{},none:{}},"default":"visible"}},layout_circle:{visibility:{type:"enum",values:{visible:{},none:{}},"default":"visible"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},"default":"visible"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},"default":"visible"}},layout_line:{"line-cap":{type:"enum","function":"piecewise-constant","zoom-function":!0,values:{butt:{},round:{},square:{}},"default":"butt"},"line-join":{type:"enum","function":"piecewise-constant","zoom-function":!0,"property-function":!0,values:{bevel:{},round:{},miter:{}},"default":"miter"},"line-miter-limit":{type:"number","default":2,"function":"interpolated","zoom-function":!0,requires:[{"line-join":"miter"}]},"line-round-limit":{type:"number","default":1.05,"function":"interpolated","zoom-function":!0,requires:[{"line-join":"round"}]},visibility:{type:"enum",values:{visible:{},none:{}},"default":"visible"}},layout_symbol:{"symbol-placement":{type:"enum","function":"piecewise-constant","zoom-function":!0,values:{point:{},line:{}},"default":"point"},"symbol-spacing":{type:"number","default":250,minimum:1,"function":"interpolated","zoom-function":!0,units:"pixels",requires:[{"symbol-placement":"line"}]},"symbol-avoid-edges":{type:"boolean","function":"piecewise-constant","zoom-function":!0,"default":!1},"icon-allow-overlap":{type:"boolean","function":"piecewise-constant","zoom-function":!0,"default":!1,requires:["icon-image"]},"icon-ignore-placement":{type:"boolean","function":"piecewise-constant","zoom-function":!0,"default":!1,requires:["icon-image"]},"icon-optional":{type:"boolean","function":"piecewise-constant","zoom-function":!0,"default":!1,requires:["icon-image","text-field"]},"icon-rotation-alignment":{type:"enum","function":"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{},auto:{}},"default":"auto",requires:["icon-image"]},"icon-size":{type:"number","default":1,minimum:0,"function":"interpolated","zoom-function":!0,"property-function":!0,units:"factor of the original icon size",requires:["icon-image"]},"icon-text-fit":{type:"enum","function":"piecewise-constant","zoom-function":!0,values:{none:{},width:{},height:{},both:{}},"default":"none",requires:["icon-image","text-field"]},"icon-text-fit-padding":{type:"array",value:"number",length:4,"default":[0,0,0,0],units:"pixels","function":"interpolated","zoom-function":!0,requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}]},"icon-image":{type:"string","function":"piecewise-constant","zoom-function":!0,"property-function":!0,tokens:!0},"icon-rotate":{type:"number","default":0,period:360,"function":"interpolated","zoom-function":!0,"property-function":!0,units:"degrees",requires:["icon-image"]},"icon-padding":{type:"number","default":2,minimum:0,"function":"interpolated","zoom-function":!0,units:"pixels",requires:["icon-image"]},"icon-keep-upright":{type:"boolean","function":"piecewise-constant","zoom-function":!0,"default":!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":"line"}]},"icon-offset":{type:"array",value:"number",length:2,"default":[0,0],"function":"interpolated","zoom-function":!0,"property-function":!0,requires:["icon-image"]},"icon-anchor":{type:"enum","function":"piecewise-constant","zoom-function":!0,"property-function":!0,values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},"default":"center",requires:["icon-image"]},"icon-pitch-alignment":{type:"enum","function":"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{},auto:{}},"default":"auto",requires:["icon-image"]},"text-pitch-alignment":{type:"enum","function":"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{},auto:{}},"default":"auto",requires:["text-field"]},"text-rotation-alignment":{type:"enum","function":"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{},auto:{}},"default":"auto",requires:["text-field"]},"text-field":{type:"string","function":"piecewise-constant","zoom-function":!0,"property-function":!0,"default":"",tokens:!0},"text-font":{type:"array",value:"string","function":"piecewise-constant","zoom-function":!0,"default":["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"]},"text-size":{type:"number","default":16,minimum:0,units:"pixels","function":"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-max-width":{type:"number","default":10,minimum:0,units:"ems","function":"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-line-height":{type:"number","default":1.2,units:"ems","function":"interpolated","zoom-function":!0,requires:["text-field"]},"text-letter-spacing":{type:"number","default":0,units:"ems","function":"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-justify":{type:"enum","function":"piecewise-constant","zoom-function":!0,"property-function":!0,values:{left:{},center:{},right:{}},"default":"center",requires:["text-field"]},"text-anchor":{type:"enum","function":"piecewise-constant","zoom-function":!0,"property-function":!0,values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},"default":"center",requires:["text-field"]},"text-max-angle":{type:"number","default":45,units:"degrees","function":"interpolated","zoom-function":!0,requires:["text-field",{"symbol-placement":"line"}]},"text-rotate":{type:"number","default":0,period:360,units:"degrees","function":"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-padding":{type:"number","default":2,minimum:0,units:"pixels","function":"interpolated","zoom-function":!0,requires:["text-field"]},"text-keep-upright":{type:"boolean","function":"piecewise-constant","zoom-function":!0,"default":!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":"line"}]},"text-transform":{type:"enum","function":"piecewise-constant","zoom-function":!0,"property-function":!0,values:{none:{},uppercase:{},lowercase:{}},"default":"none",requires:["text-field"]},"text-offset":{type:"array",value:"number",units:"ems","function":"interpolated","zoom-function":!0,"property-function":!0,length:2,"default":[0,0],requires:["text-field"]},"text-allow-overlap":{type:"boolean","function":"piecewise-constant","zoom-function":!0,"default":!1,requires:["text-field"]},"text-ignore-placement":{type:"boolean","function":"piecewise-constant","zoom-function":!0,"default":!1,requires:["text-field"]},"text-optional":{type:"boolean","function":"piecewise-constant","zoom-function":!0,"default":!1,requires:["text-field","icon-image"]},visibility:{type:"enum",values:{visible:{},none:{}},"default":"visible"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},"default":"visible"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},"in":{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},"function":{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number","default":1,minimum:0},property:{type:"string","default":"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},"default":"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},"default":"rgb"},"default":{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:22,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},expression_name:{type:"enum",values:{let:{group:"Variable binding"},"var":{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},"case":{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},curve:{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},"typeof":{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Zoom"},"heatmap-density":{group:"Heatmap"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"}}},light:{anchor:{type:"enum","default":"viewport",values:{map:{},viewport:{}},transition:!1,"zoom-function":!0,"property-function":!1,"function":"piecewise-constant"},position:{type:"array","default":[1.15,210,30],length:3,value:"number",transition:!0,"function":"interpolated","zoom-function":!0,"property-function":!1},color:{type:"color","default":"#ffffff","function":"interpolated","zoom-function":!0,"property-function":!1,transition:!0},intensity:{type:"number","default":.5,minimum:0,maximum:1,"function":"interpolated","zoom-function":!0,"property-function":!1,transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_background"],paint_fill:{"fill-antialias":{type:"boolean","function":"piecewise-constant","zoom-function":!0,"default":!0},"fill-opacity":{type:"number","function":"interpolated","zoom-function":!0,"property-function":!0,"default":1,minimum:0,maximum:1,transition:!0},"fill-color":{type:"color","default":"#000000","function":"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-pattern"}]},"fill-outline-color":{type:"color","function":"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}]},"fill-translate":{type:"array",value:"number",length:2,"default":[0,0],"function":"interpolated","zoom-function":!0,transition:!0,units:"pixels"},"fill-translate-anchor":{type:"enum","function":"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},"default":"map",requires:["fill-translate"]},"fill-pattern":{type:"string","function":"piecewise-constant","zoom-function":!0,transition:!0}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number","function":"interpolated","zoom-function":!0,"property-function":!1,"default":1,minimum:0,maximum:1,transition:!0},"fill-extrusion-color":{type:"color","default":"#000000","function":"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-extrusion-pattern"}]},"fill-extrusion-translate":{type:"array",value:"number",length:2,"default":[0,0],"function":"interpolated","zoom-function":!0,transition:!0,units:"pixels"},"fill-extrusion-translate-anchor":{type:"enum","function":"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},"default":"map",requires:["fill-extrusion-translate"]},"fill-extrusion-pattern":{type:"string","function":"piecewise-constant","zoom-function":!0,transition:!0},"fill-extrusion-height":{type:"number","function":"interpolated","zoom-function":!0,"property-function":!0,"default":0,minimum:0,units:"meters",transition:!0},"fill-extrusion-base":{type:"number","function":"interpolated","zoom-function":!0,"property-function":!0,"default":0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"]}},paint_line:{"line-opacity":{type:"number","function":"interpolated","zoom-function":!0,"property-function":!0,"default":1,minimum:0,maximum:1,transition:!0},"line-color":{type:"color","default":"#000000","function":"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"line-pattern"}]},"line-translate":{type:"array",value:"number",length:2,"default":[0,0],"function":"interpolated","zoom-function":!0,transition:!0,units:"pixels"},"line-translate-anchor":{type:"enum","function":"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},"default":"map",requires:["line-translate"]},"line-width":{type:"number","default":1,minimum:0,"function":"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-gap-width":{type:"number","default":0,minimum:0,"function":"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-offset":{type:"number","default":0,"function":"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-blur":{type:"number","default":0,minimum:0,"function":"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-dasharray":{type:"array",value:"number","function":"piecewise-constant","zoom-function":!0,minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}]},"line-pattern":{type:"string","function":"piecewise-constant","zoom-function":!0,transition:!0}},paint_circle:{"circle-radius":{type:"number","default":5,minimum:0,"function":"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"circle-color":{type:"color","default":"#000000","function":"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-blur":{type:"number","default":0,"function":"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-opacity":{type:"number","default":1,minimum:0,maximum:1,"function":"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-translate":{type:"array",value:"number",length:2,"default":[0,0],"function":"interpolated","zoom-function":!0,transition:!0,units:"pixels"},"circle-translate-anchor":{type:"enum","function":"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},"default":"map",requires:["circle-translate"]},"circle-pitch-scale":{type:"enum","function":"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},"default":"map"},"circle-pitch-alignment":{type:"enum","function":"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},"default":"viewport"},"circle-stroke-width":{type:"number","default":0,minimum:0,"function":"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"circle-stroke-color":{type:"color","default":"#000000","function":"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-stroke-opacity":{type:"number","default":1,minimum:0,maximum:1,"function":"interpolated","zoom-function":!0,"property-function":!0,transition:!0}},paint_heatmap:{"heatmap-radius":{type:"number","default":30,minimum:1,"function":"interpolated","zoom-function":!0,"property-function":!1,transition:!0,units:"pixels"},"heatmap-weight":{type:"number","default":1,minimum:0,"function":"interpolated","zoom-function":!0,"property-function":!0,transition:!1},"heatmap-intensity":{type:"number","default":1,minimum:0,"function":"interpolated","zoom-function":!0,"property-function":!1,transition:!0},"heatmap-color":{type:"color","default":{stops:[[0,"rgba(0, 0, 255, 0)"],[.1,"royalblue"],[.3,"cyan"],[.5,"lime"],[.7,"yellow"],[1,"red"]]},"function":"interpolated","zoom-function":!0,"property-function":!1,transition:!0},"heatmap-opacity":{type:"number","default":1,minimum:0,maximum:1,"function":"interpolated","zoom-function":!0,"property-function":!1,transition:!0}},paint_symbol:{"icon-opacity":{type:"number","default":1,minimum:0,maximum:1,"function":"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-color":{type:"color","default":"#000000","function":"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-halo-color":{type:"color","default":"rgba(0, 0, 0, 0)","function":"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-halo-width":{type:"number","default":0,minimum:0,"function":"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-halo-blur":{type:"number","default":0,minimum:0,"function":"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-translate":{type:"array",value:"number",length:2,"default":[0,0],"function":"interpolated","zoom-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-translate-anchor":{type:"enum","function":"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},"default":"map",requires:["icon-image","icon-translate"]},"text-opacity":{type:"number","default":1,minimum:0,maximum:1,"function":"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-color":{type:"color","default":"#000000","function":"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-halo-color":{type:"color","default":"rgba(0, 0, 0, 0)","function":"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-halo-width":{type:"number","default":0,minimum:0,"function":"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-halo-blur":{type:"number","default":0,minimum:0,"function":"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-translate":{type:"array",value:"number",length:2,"default":[0,0],"function":"interpolated","zoom-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-translate-anchor":{type:"enum","function":"piecewise-constant","zoom-function":!0,values:{map:{},viewport:{}},"default":"map",requires:["text-field","text-translate"]}},paint_raster:{"raster-opacity":{type:"number","default":1,minimum:0,maximum:1,"function":"interpolated","zoom-function":!0,transition:!0},"raster-hue-rotate":{type:"number","default":0,period:360,"function":"interpolated","zoom-function":!0,transition:!0,units:"degrees"},"raster-brightness-min":{type:"number","function":"interpolated","zoom-function":!0,"default":0,minimum:0,maximum:1,transition:!0},"raster-brightness-max":{type:"number","function":"interpolated","zoom-function":!0,"default":1,minimum:0,maximum:1,transition:!0},"raster-saturation":{type:"number","default":0,minimum:-1,maximum:1,"function":"interpolated","zoom-function":!0,transition:!0},"raster-contrast":{type:"number","default":0,minimum:-1,maximum:1,"function":"interpolated","zoom-function":!0,transition:!0},"raster-fade-duration":{type:"number","default":300,minimum:0,"function":"interpolated","zoom-function":!0,transition:!0,units:"milliseconds"}},paint_background:{"background-color":{type:"color","default":"#000000","function":"interpolated","zoom-function":!0,transition:!0,requires:[{"!":"background-pattern"}]},"background-pattern":{type:"string","function":"piecewise-constant","zoom-function":!0,transition:!0},"background-opacity":{type:"number","default":1,minimum:0,maximum:1,"function":"interpolated","zoom-function":!0,transition:!0}},transition:{duration:{type:"number","default":300,minimum:0,units:"milliseconds"},delay:{type:"number","default":0,minimum:0,units:"milliseconds"}}}},{}],149:[function(n,t){"use strict";function r(n){return n>w?Math.pow(n,1/3):n/v+a}function u(n){return n>i?n*n*n:v*(n-a)}function f(n){return 255*(n<=.0031308?12.92*n:1.055*Math.pow(n,1/2.4)-.055)}function e(n){return n/=255,n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function o(n){var t=e(n[0]),i=e(n[1]),u=e(n[2]),o=r((.4124564*t+.3575761*i+.1804375*u)/h),f=r((.2126729*t+.7151522*i+.072175*u)/c);return[116*f-16,500*(o-f),200*(f-r((.0193339*t+.119192*i+.9503041*u)/l)),n[3]]}function s(n){var t=(n[0]+16)/116,i=isNaN(n[1])?t:t+n[1]/500,r=isNaN(n[2])?t:t-n[2]/200;return t=c*u(t),i=h*u(i),r=l*u(r),[f(3.2404542*i-1.5371385*t-.4985314*r),f(-.969266*i+1.8760108*t+.041556*r),f(.0556434*i-.2040259*t+1.0572252*r),n[3]]}function y(n){var t=o(n),f=t[0],i=t[1],r=t[2],u=Math.atan2(r,i)*k;return[u<0?u+360:u,Math.sqrt(i*i+r*r),f,n[3]]}function p(n){var t=n[0]*b,i=n[1];return s([n[2],Math.cos(t)*i,Math.sin(t)*i,n[3]])}var h=.95047,c=1,l=1.08883,a=4/29,i=6/29,v=3*i*i,w=i*i*i,b=Math.PI/180,k=180/Math.PI;t.exports={lab:{forward:o,reverse:s},hcl:{forward:y,reverse:p}}},{}],150:[function(n,t){"use strict";t.exports=function(n){for(var i,u,f,e,r=[],t=arguments.length-1;t-->0;)r[t]=arguments[t+1];for(i=0,u=r;i<u.length;i+=1){f=u[i];for(e in f)n[e]=f[e]}return n}},{}],151:[function(n,t){"use strict";t.exports=function(n){return n instanceof Number?"number":n instanceof String?"string":n instanceof Boolean?"boolean":Array.isArray(n)?"array":null===n?"null":typeof n}},{}],152:[function(n,t){"use strict";function i(n,t,i){return n*(1-i)+t*i}t.exports=i;i.number=i;i.vec2=function(n,t,r){return[i(n[0],t[0],r),i(n[1],t[1],r)]};i.color=function(n,t,r){return[i(n[0],t[0],r),i(n[1],t[1],r),i(n[2],t[2],r),i(n[3],t[3],r)]};i.array=function(n,t,r){return n.map(function(n,u){return i(n,t[u],r)})}},{}],153:[function(n,t){"use strict";var i=n("csscolorparser").parseCSSColor;t.exports=function(n){if("string"==typeof n){var t=i(n);return t?[t[0]/255*t[3],t[1]/255*t[3],t[2]/255*t[3],t[3]]:void 0}if(Array.isArray(n))return n}},{csscolorparser:11}],154:[function(n,t){"use strict";t.exports=["type","source","source-layer","minzoom","maxzoom","filter","layout"]},{}],155:[function(n,t){"use strict";function i(n){return n instanceof Number||n instanceof String||n instanceof Boolean?n.valueOf():n}function r(n){return Array.isArray(n)?n.map(r):i(n)}t.exports=i;t.exports.deep=r},{}],156:[function(n,t){"use strict";var i=n("../error/validation_error"),f=n("../util/get_type"),r=n("../util/extend"),u=n("../util/unbundle_jsonlint"),e=n("../expression"),o=e.isExpression,s=n("../function"),h=s.isFunction;t.exports=function(t){var y=n("./validate_function"),p=n("./validate_expression"),w=n("./validate_object"),c={"*":function(){return[]},array:n("./validate_array"),boolean:n("./validate_boolean"),number:n("./validate_number"),color:n("./validate_color"),constants:n("./validate_constants"),"enum":n("./validate_enum"),filter:n("./validate_filter"),"function":n("./validate_function"),layer:n("./validate_layer"),object:n("./validate_object"),source:n("./validate_source"),light:n("./validate_light"),string:n("./validate_string")},e=t.value,s=t.valueSpec,l=t.key,a=t.styleSpec,v=t.style;if("string"===f(e)&&"@"===e[0]){if(a.$version>7)return[new i(l,e,"constants have been deprecated as of v8")];if(!(e in v.constants))return[new i(l,e,'constant "%s" not found',e)];t=r({},t,{value:v.constants[e]})}return s.function&&h(u(e))?y(t):s.function&&o(u.deep(e))?p(t):s.type&&c[s.type]?c[s.type](t):w(r({},t,{valueSpec:s.type?a[s.type]:s}))}},{"../error/validation_error":121,"../expression":136,"../function":145,"../util/extend":150,"../util/get_type":151,"../util/unbundle_jsonlint":155,"./validate_array":157,"./validate_boolean":158,"./validate_color":159,"./validate_constants":160,"./validate_enum":161,"./validate_expression":162,"./validate_filter":163,"./validate_function":164,"./validate_layer":166,"./validate_light":168,"./validate_number":169,"./validate_object":170,"./validate_source":173,"./validate_string":174}],157:[function(n,t){"use strict";var i=n("../util/get_type"),u=n("./validate"),r=n("../error/validation_error");t.exports=function(n){var t=n.value,f=n.valueSpec,l=n.style,c=n.styleSpec,o=n.key,a=n.arrayElementValidator||u,s,h,e;if("array"!==i(t))return[new r(o,t,"array expected, %s found",i(t))];if(f.length&&t.length!==f.length)return[new r(o,t,"array length %d expected, length %d found",f.length,t.length)];if(f["min-length"]&&t.length<f["min-length"])return[new r(o,t,"array length at least %d expected, length %d found",f["min-length"],t.length)];for(s={type:f.value},c.$version<7&&(s.function=f.function),"object"===i(f.value)&&(s=f.value),h=[],e=0;e<t.length;e++)h=h.concat(a({array:t,arrayIndex:e,value:t[e],valueSpec:s,style:l,styleSpec:c,key:o+"["+e+"]"}));return h}},{"../error/validation_error":121,"../util/get_type":151,"./validate":156}],158:[function(n,t){"use strict";var i=n("../util/get_type"),r=n("../error/validation_error");t.exports=function(n){var t=n.value,f=n.key,u=i(t);return"boolean"!==u?[new r(f,t,"boolean expected, %s found",u)]:[]}},{"../error/validation_error":121,"../util/get_type":151}],159:[function(n,t){"use strict";var i=n("../error/validation_error"),r=n("../util/get_type"),u=n("csscolorparser").parseCSSColor;t.exports=function(n){var f=n.key,t=n.value,e=r(t);return"string"!==e?[new i(f,t,"color expected, %s found",e)]:null===u(t)?[new i(f,t,'color expected, "%s" found',t)]:[]}},{"../error/validation_error":121,"../util/get_type":151,csscolorparser:11}],160:[function(n,t){"use strict";var i=n("../error/validation_error"),r=n("../util/get_type");t.exports=function(n){var f=n.key,t=n.value,e,o,u;if(n.styleSpec.$version>7)return t?[new i(f,t,"constants have been deprecated as of v8")]:[];if(e=r(t),"object"!==e)return[new i(f,t,"object expected, %s found",e)];o=[];for(u in t)"@"!==u[0]&&o.push(new i(f+"."+u,t[u],'constants must start with "@"'));return o}},{"../error/validation_error":121,"../util/get_type":151}],161:[function(n,t){"use strict";var i=n("../error/validation_error"),r=n("../util/unbundle_jsonlint");t.exports=function(n){var e=n.key,t=n.value,u=n.valueSpec,f=[];return Array.isArray(u.values)?-1===u.values.indexOf(r(t))&&f.push(new i(e,t,"expected one of [%s], %s found",u.values.join(", "),JSON.stringify(t))):-1===Object.keys(u.values).indexOf(r(t))&&f.push(new i(e,t,"expected one of [%s], %s found",Object.keys(u.values).join(", "),JSON.stringify(t))),f}},{"../error/validation_error":121,"../util/unbundle_jsonlint":155}],162:[function(n,t){"use strict";var i=n("../error/validation_error"),r=n("../expression"),u=r.createExpression,f=n("../util/unbundle_jsonlint");t.exports=function(n){var t=u(f.deep(n.value),n.valueSpec,n.expressionContext);return"success"===t.result?[]:t.errors.map(function(t){return new i(""+n.key+t.key,n.value,t.message)})}},{"../error/validation_error":121,"../expression":136,"../util/unbundle_jsonlint":155}],163:[function(n,t){"use strict";var i=n("../error/validation_error"),e=n("./validate_expression"),f=n("./validate_enum"),r=n("../util/get_type"),u=n("../util/unbundle_jsonlint"),o=n("../util/extend"),s=n("../feature_filter"),h=s.isExpressionFilter;t.exports=function c(n){var a,t=n.value,l=n.key,p=n.styleSpec,s=[],v,y;if("array"!==r(t))return[new i(l,t,"array expected, %s found",r(t))];if(h(u.deep(t)))return e(o({},n,{expressionContext:"filter",valueSpec:{value:"boolean"}}));if(t.length<1)return[new i(l,t,"filter array must have at least 1 element")];switch(s=s.concat(f({key:l+"[0]",value:t[0],valueSpec:p.filter_operator,style:n.style,styleSpec:n.styleSpec})),u(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&"$type"===u(t[1])&&s.push(new i(l,t,'"$type" cannot be use with operator "%s"',t[0]));case"==":case"!=":3!==t.length&&s.push(new i(l,t,'filter array for operator "%s" must have 3 elements',t[0]));case"in":case"!in":for(t.length>=2&&"string"!==(a=r(t[1]))&&s.push(new i(l+"[1]",t[1],"string expected, %s found",a)),v=2;v<t.length;v++)a=r(t[v]),"$type"===u(t[1])?s=s.concat(f({key:l+"["+v+"]",value:t[v],valueSpec:p.geometry_type,style:n.style,styleSpec:n.styleSpec})):"string"!==a&&"number"!==a&&"boolean"!==a&&s.push(new i(l+"["+v+"]",t[v],"string, number, or boolean expected, %s found",a));break;case"any":case"all":case"none":for(y=1;y<t.length;y++)s=s.concat(c({key:l+"["+y+"]",value:t[y],style:n.style,styleSpec:n.styleSpec}));break;case"has":case"!has":a=r(t[1]);2!==t.length?s.push(new i(l,t,'filter array for "%s" operator must have 2 elements',t[0])):"string"!==a&&s.push(new i(l+"[1]",t[1],"string expected, %s found",a))}return s}},{"../error/validation_error":121,"../feature_filter":144,"../util/extend":150,"../util/get_type":151,"../util/unbundle_jsonlint":155,"./validate_enum":161,"./validate_expression":162}],164:[function(n,t){"use strict";var i=n("../error/validation_error"),r=n("../util/get_type"),f=n("./validate"),e=n("./validate_object"),o=n("./validate_array"),s=n("./validate_number"),u=n("../util/unbundle_jsonlint");t.exports=function(n){function k(n){if("identity"===t)return[new i(n.key,n.value,'identity function may not have a "stops" property')];var u=[],f=n.value;return u=u.concat(o({key:n.key,value:f,valueSpec:n.valueSpec,style:n.style,styleSpec:n.styleSpec,arrayElementValidator:d})),"array"===r(f)&&0===f.length&&u.push(new i(n.key,f,"array must have at least one stop")),u}function d(n){var h=[],t=n.value,o=n.key;if("array"!==r(t))return[new i(o,t,"array expected, %s found",r(t))];if(2!==t.length)return[new i(o,t,"array length %d expected, length %d found",2,t.length)];if(b){if("object"!==r(t[0]))return[new i(o,t,"object expected, %s found",r(t[0]))];if(void 0===t[0].zoom)return[new i(o,t,"object stop key must have zoom")];if(void 0===t[0].value)return[new i(o,t,"object stop key must have value")];if(a&&a>u(t[0].zoom))return[new i(o,t[0].zoom,"stop zoom values must appear in ascending order")];u(t[0].zoom)!==a&&(a=u(t[0].zoom),l=void 0,y={});h=h.concat(e({key:o+"[0]",value:t[0],valueSpec:{zoom:{}},style:n.style,styleSpec:n.styleSpec,objectElementValidators:{zoom:s,value:w}}))}else h=h.concat(w({key:o+"[0]",value:t[0],valueSpec:{},style:n.style,styleSpec:n.styleSpec},t));return h.concat(f({key:o+"[1]",value:t[1],valueSpec:v,style:n.style,styleSpec:n.styleSpec}))}function w(n,f){var e=r(n.value),o=u(n.value),s=null!==n.value?n.value:f,h;if(c){if(e!==c)return[new i(n.key,s,"%s stop domain type must match previous stop domain type %s",e,c)]}else c=e;return"number"!==e&&"string"!==e&&"boolean"!==e?[new i(n.key,s,"stop domain value must be a number, string, or boolean")]:"number"!==e&&"categorical"!==t?(h="number expected, %s found",v["property-function"]&&void 0===t&&(h+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new i(n.key,s,h,e)]):"categorical"!==t||"number"!==e||isFinite(o)&&Math.floor(o)===o?"categorical"!==t&&"number"===e&&void 0!==l&&o<l?[new i(n.key,s,"stop domain values must appear in ascending order")]:(l=o,"categorical"===t&&o in y?[new i(n.key,s,"stop domain values must be unique")]:(y[o]=!0,[])):[new i(n.key,s,"integer expected, found %s",o)]}function g(n){return f({key:n.key,value:n.value,valueSpec:v,style:n.style,styleSpec:n.styleSpec})}var c,l,a,v=n.valueSpec,t=u(n.value.type),y={},p="categorical"!==t&&void 0===n.value.property,nt=!p,b="array"===r(n.value.stops)&&"array"===r(n.value.stops[0])&&"object"===r(n.value.stops[0][0]),h=e({key:n.key,value:n.value,valueSpec:n.styleSpec.function,style:n.style,styleSpec:n.styleSpec,objectElementValidators:{stops:k,"default":g}});return"identity"===t&&p&&h.push(new i(n.key,n.value,'missing required property "property"')),"identity"===t||n.value.stops||h.push(new i(n.key,n.value,'missing required property "stops"')),"exponential"===t&&"piecewise-constant"===n.valueSpec.function&&h.push(new i(n.key,n.value,"exponential functions not supported")),n.styleSpec.$version>=8&&(nt&&!n.valueSpec["property-function"]?h.push(new i(n.key,n.value,"property functions not supported")):p&&!n.valueSpec["zoom-function"]&&h.push(new i(n.key,n.value,"zoom functions not supported"))),"categorical"!==t&&!b||void 0!==n.value.property||h.push(new i(n.key,n.value,'"property" property is required')),h}},{"../error/validation_error":121,"../util/get_type":151,"../util/unbundle_jsonlint":155,"./validate":156,"./validate_array":157,"./validate_number":169,"./validate_object":170}],165:[function(n,t){"use strict";var i=n("../error/validation_error"),r=n("./validate_string");t.exports=function(n){var u=n.value,f=n.key,t=r(n);return t.length?t:(-1===u.indexOf("{fontstack}")&&t.push(new i(f,u,'"glyphs" url must include a "{fontstack}" token')),-1===u.indexOf("{range}")&&t.push(new i(f,u,'"glyphs" url must include a "{range}" token')),t)}},{"../error/validation_error":121,"./validate_string":174}],166:[function(n,t){"use strict";var i=n("../error/validation_error"),r=n("../util/unbundle_jsonlint"),u=n("./validate_object"),e=n("./validate_filter"),o=n("./validate_paint_property"),s=n("./validate_layout_property"),f=n("../util/extend");t.exports=function(n){var h=[],t=n.value,c=n.key,a=n.style,g=n.styleSpec,l,b,d,v,k,y,p,w;if(t.type||t.ref||h.push(new i(c,t,'either "type" or "ref" is required')),l=r(t.type),b=r(t.ref),t.id)for(d=r(t.id),v=0;v<n.arrayIndex;v++)k=a.layers[v],r(k.id)===d&&h.push(new i(c,t.id,'duplicate layer id "%s", previously used at line %d',t.id,k.id.__line__));return"ref"in t?(["type","source","source-layer","filter","layout"].forEach(function(n){n in t&&h.push(new i(c,t[n],'"%s" is prohibited for ref layers',n))}),a.layers.forEach(function(n){r(n.id)===b&&(y=n)}),y?y.ref?h.push(new i(c,t.ref,"ref cannot reference another ref layer")):l=r(y.type):h.push(new i(c,t.ref,'ref layer "%s" not found',b))):"background"!==l&&(t.source?(p=a.sources&&a.sources[t.source],w=p&&r(p.type),p?"vector"===w&&"raster"===l?h.push(new i(c,t.source,'layer "%s" requires a raster source',t.id)):"raster"===w&&"raster"!==l?h.push(new i(c,t.source,'layer "%s" requires a vector source',t.id)):"vector"!==w||t["source-layer"]||h.push(new i(c,t,'layer "%s" must specify a "source-layer"',t.id)):h.push(new i(c,t.source,'source "%s" not found',t.source))):h.push(new i(c,t,'missing required property "source"'))),h=h.concat(u({key:c,value:t,valueSpec:g.layer,style:n.style,styleSpec:n.styleSpec,objectElementValidators:{"*":function(){return[]},filter:e,layout:function(n){return u({layer:t,key:n.key,value:n.value,style:n.style,styleSpec:n.styleSpec,objectElementValidators:{"*":function(n){return s(f({layerType:l},n))}}})},paint:function(n){return u({layer:t,key:n.key,value:n.value,style:n.style,styleSpec:n.styleSpec,objectElementValidators:{"*":function(n){return o(f({layerType:l},n))}}})}}}))}},{"../error/validation_error":121,"../util/extend":150,"../util/unbundle_jsonlint":155,"./validate_filter":163,"./validate_layout_property":167,"./validate_object":170,"./validate_paint_property":171}],167:[function(n,t){"use strict";var i=n("./validate_property");t.exports=function(n){return i(n,"layout")}},{"./validate_property":172}],168:[function(n,t){"use strict";var i=n("../error/validation_error"),u=n("../util/get_type"),r=n("./validate");t.exports=function(n){var f=n.value,o=n.styleSpec,s=o.light,c=n.style,e=[],l=u(f),t,h;if(void 0===f)return e;if("object"!==l)return e.concat([new i("light",f,"object expected, %s found",l)]);for(t in f)h=t.match(/^(.*)-transition$/),e=h&&s[h[1]]&&s[h[1]].transition?e.concat(r({key:t,value:f[t],valueSpec:o.transition,style:c,styleSpec:o})):s[t]?e.concat(r({key:t,value:f[t],valueSpec:s[t],style:c,styleSpec:o})):e.concat([new i(t,f[t],'unknown property "%s"',t)]);return e}},{"../error/validation_error":121,"../util/get_type":151,"./validate":156}],169:[function(n,t){"use strict";var r=n("../util/get_type"),i=n("../error/validation_error");t.exports=function(n){var f=n.key,t=n.value,u=n.valueSpec,e=r(t);return"number"!==e?[new i(f,t,"number expected, %s found",e)]:"minimum"in u&&t<u.minimum?[new i(f,t,"%s is less than the minimum value %s",t,u.minimum)]:"maximum"in u&&t>u.maximum?[new i(f,t,"%s is greater than the maximum value %s",t,u.maximum)]:[]}},{"../error/validation_error":121,"../util/get_type":151}],170:[function(n,t){"use strict";var i=n("../error/validation_error"),u=n("../util/get_type"),r=n("./validate");t.exports=function(n){var o=n.key,t=n.value,f=n.valueSpec||{},l=n.objectElementValidators||{},y=n.style,p=n.styleSpec,s=[],v=u(t),e,c;if("object"!==v)return[new i(o,t,"object expected, %s found",v)];for(e in t){var a=e.split(".")[0],w=f[a]||f["*"],h=void 0;if(l[a])h=l[a];else if(f[a])h=r;else if(l["*"])h=l["*"];else{if(!f["*"]){s.push(new i(o,t[e],'unknown property "%s"',e));continue}h=r}s=s.concat(h({key:(o?o+".":o)+e,value:t[e],valueSpec:w,style:y,styleSpec:p,object:t,objectKey:e},t))}for(c in f)f[c].required&&void 0===f[c].default&&void 0===t[c]&&s.push(new i(o,t,'missing required property "%s"',c));return s}},{"../error/validation_error":121,"../util/get_type":151,"./validate":156}],171:[function(n,t){"use strict";var i=n("./validate_property");t.exports=function(n){return i(n,"paint")}},{"./validate_property":172}],172:[function(n,t){"use strict";var r=n("./validate"),i=n("../error/validation_error"),u=n("../util/get_type");t.exports=function(n,t){var s=n.key,h=n.style,c=n.styleSpec,f=n.value,e=n.objectKey,l=c[t+"_"+n.layerType],a,o,y,v;return l?(a=e.match(/^(.*)-transition$/),"paint"===t&&a&&l[a[1]]&&l[a[1]].transition)?r({key:s,value:f,valueSpec:c.transition,style:h,styleSpec:c}):(o=n.valueSpec||l[e],!o)?[new i(s,f,'unknown property "%s"',e)]:"string"===u(f)&&o["property-function"]&&!o.tokens&&(y=/^{([^}]+)}$/.exec(f))?[new i(s,f,'"%s" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": %s` }`.',e,JSON.stringify(y[1]))]:(v=[],"symbol"===n.layerType&&"text-field"===e&&h&&!h.glyphs&&v.push(new i(s,f,'use of "text-field" requires a style "glyphs" property')),v.concat(r({key:n.key,value:f,valueSpec:o,style:h,styleSpec:c,expressionContext:"property"}))):[]}},{"../error/validation_error":121,"../util/get_type":151,"./validate":156}],173:[function(n,t){"use strict";var r=n("../error/validation_error"),u=n("../util/unbundle_jsonlint"),i=n("./validate_object"),f=n("./validate_enum");t.exports=function(n){var t=n.value,o=n.key,e=n.styleSpec,s=n.style,l,h,c;if(!t.type)return[new r(o,t,'"type" is required')];l=u(t.type);h=[];switch(l){case"vector":case"raster":if(h=h.concat(i({key:o,value:t,valueSpec:e.source_tile,style:n.style,styleSpec:e})),"url"in t)for(c in t)["type","url","tileSize"].indexOf(c)<0&&h.push(new r(o+"."+c,t[c],'a source with a "url" property may not include a "%s" property',c));return h;case"geojson":return i({key:o,value:t,valueSpec:e.source_geojson,style:s,styleSpec:e});case"video":return i({key:o,value:t,valueSpec:e.source_video,style:s,styleSpec:e});case"image":return i({key:o,value:t,valueSpec:e.source_image,style:s,styleSpec:e});case"canvas":return i({key:o,value:t,valueSpec:e.source_canvas,style:s,styleSpec:e});default:return f({key:o+".type",value:t.type,valueSpec:{values:["vector","raster","geojson","video","image","canvas"]},style:s,styleSpec:e})}}},{"../error/validation_error":121,"../util/unbundle_jsonlint":155,"./validate_enum":161,"./validate_object":170}],174:[function(n,t){"use strict";var i=n("../util/get_type"),r=n("../error/validation_error");t.exports=function(n){var t=n.value,f=n.key,u=i(t);return"string"!==u?[new r(f,t,"string expected, %s found",u)]:[]}},{"../error/validation_error":121,"../util/get_type":151}],175:[function(n,t){"use strict";function i(n,t){t=t||o;var i=[];return i=i.concat(e({key:"",value:n,valueSpec:t.$root,styleSpec:t,style:n,objectElementValidators:{glyphs:s,"*":function(){return[]}}})),t.$version>7&&n.constants&&(i=i.concat(f({key:"constants",value:n.constants,style:n,styleSpec:t}))),u(i)}function u(n){return[].concat(n).sort(function(n,t){return n.line-t.line})}function r(n){return function(){return u(n.apply(this,arguments))}}var f=n("./validate/validate_constants"),e=n("./validate/validate"),o=n("./reference/latest"),s=n("./validate/validate_glyphs_url");i.source=r(n("./validate/validate_source"));i.light=r(n("./validate/validate_light"));i.layer=r(n("./validate/validate_layer"));i.filter=r(n("./validate/validate_filter"));i.paintProperty=r(n("./validate/validate_paint_property"));i.layoutProperty=r(n("./validate/validate_layout_property"));t.exports=i},{"./reference/latest":147,"./validate/validate":156,"./validate/validate_constants":160,"./validate/validate_filter":163,"./validate/validate_glyphs_url":165,"./validate/validate_layer":166,"./validate/validate_layout_property":167,"./validate/validate_light":168,"./validate/validate_paint_property":171,"./validate/validate_source":173}],176:[function(n,t){"use strict";var i=function(){this.n=0;this.times=[]};i.prototype.stopped=function(){return this.times=this.times.filter(function(n){return n.time>=(new Date).getTime()}),!this.times.length};i.prototype.set=function(n){return this.times.push({id:this.n,time:n+(new Date).getTime()}),this.n++};i.prototype.cancel=function(n){this.times=this.times.filter(function(t){return t.id!==n})};t.exports=i},{}],177:[function(n,t){"use strict";var o=n("../style-spec/reference/latest"),r=n("../util/util"),s=n("../util/evented"),u=n("./validate_style"),f=n("./style_declaration"),h=n("./style_transition"),e="-transition",c=["anchor","color","position","intensity"],i=o.light,l=function(n){function t(t){n.call(this);this.set(t)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.set=function(n){var s=this,e,o,t;if(!this._validate(u.light,n)){for(this._declarations={},this._transitions={},this._transitionOptions={},this.calculated={},n=r.extend({anchor:i.anchor.default,color:i.color.default,position:i.position.default,intensity:i.intensity.default},n),e=0,o=c;e<o.length;e+=1)t=o[e],s._declarations[t]=new f(i[t],n[t],t);return this}},t.prototype.getLight=function(){return{anchor:this.getLightProperty("anchor"),color:this.getLightProperty("color"),position:this.getLightProperty("position"),intensity:this.getLightProperty("intensity")}},t.prototype.getLightProperty=function(n){return r.endsWith(n,e)?this._transitionOptions[n]:this._declarations[n]&&this._declarations[n].value},t.prototype.getLightValue=function(n,t){if("position"===n){var u=this._transitions[n].calculate(t),i=r.sphericalToCartesian(u);return{x:i[0],y:i[1],z:i[2]}}return this._transitions[n].calculate(t)},t.prototype.setLight=function(n){var s=this,t,o;if(!this._validate(u.light,n))for(t in n)o=n[t],r.endsWith(t,e)?s._transitionOptions[t]=o:null===o||void 0===o?delete s._declarations[t]:s._declarations[t]=new f(i[t],o,t)},t.prototype.recalculate=function(n){var t=this,i;for(i in t._declarations)t.calculated[i]=t.getLightValue(i,{zoom:n})},t.prototype._applyLightDeclaration=function(n,t,u,o,s){var c=u.transition?this._transitions[n]:void 0,a=i[n],v,l;(null!==t&&void 0!==t||(t=new f(a,a.default,n)),c&&c.declaration.json===t.json)||(v=r.extend({duration:300,delay:0},o,this.getLightProperty(n+e)),l=this._transitions[n]=new h(a,t,c,v),l.instant()||(l.loopID=s.set(l.endTime-Date.now())),c&&s.cancel(c.loopID))},t.prototype.updateLightTransitions=function(n,t,i){var r,u=this;for(r in u._declarations)u._applyLightDeclaration(r,u._declarations[r],n,t,i)},t.prototype._validate=function(n,t){return u.emitErrors(this,n.call(u,r.extend({value:t,style:{glyphs:!0,sprite:!0},styleSpec:o})))},t}(s);t.exports=l},{"../style-spec/reference/latest":147,"../util/evented":239,"../util/util":252,"./style_declaration":183,"./style_transition":194,"./validate_style":195}],178:[function(n,t){"use strict";var r=n("../util/mapbox"),u=r.normalizeGlyphsURL,i=n("../util/ajax"),f=n("./parse_glyph_pbf");t.exports=function(n,t,r,e,o){var s=256*t,h=s+255,c=e(u(r).replace("{fontstack}",n).replace("{range}",s+"-"+h),i.ResourceType.Glyphs);i.getArrayBuffer(c,function(n,t){var r;if(n)o(n);else if(t){for(var u={},i=0,e=f(t.data);i<e.length;i+=1)r=e[i],u[r.id]=r;o(null,u)}})}},{"../util/ajax":230,"../util/mapbox":246,"./parse_glyph_pbf":180}],179:[function(n,t){"use strict";var i=n("../util/ajax"),r=n("../util/browser"),e=n("../util/mapbox"),u=e.normalizeSpriteURL,o=n("../util/image"),f=o.RGBAImage;t.exports=function(n,t,e){function c(){var u,t,i;if(o)e(o);else if(s&&h){u=r.getImageData(h);t={};for(i in s){var n=s[i],c=n.width,l=n.height,v=n.x,y=n.y,p=n.sdf,w=n.pixelRatio,a=f.create({width:c,height:l});f.copy(u,a,{x:v,y:y},{x:0,y:0},{width:c,height:l});t[i]={data:a,pixelRatio:w,sdf:p}}e(null,t)}}var s,h,o,l=r.devicePixelRatio>1?"@2x":"";i.getJSON(t(u(n,l,".json"),i.ResourceType.SpriteJSON),function(n,t){o||(o=n,s=t,c())});i.getImage(t(u(n,l,".png"),i.ResourceType.SpriteImage),function(n,t){o||(o=n,h=t,c())})}},{"../util/ajax":230,"../util/browser":231,"../util/image":242,"../util/mapbox":246}],180:[function(n,t){"use strict";function r(n,t,i){1===n&&i.readMessage(u,t)}function u(n,t,r){if(3===n){var u=r.readMessage(f,{}),h=u.id,c=u.bitmap,e=u.width,s=u.height,l=u.left,a=u.top,v=u.advance;t.push({id:h,bitmap:o.create({width:e+2*i,height:s+2*i},c),metrics:{width:e,height:s,left:l,top:a,advance:v}})}}function f(n,t,i){1===n?t.id=i.readVarint():2===n?t.bitmap=i.readBytes():3===n?t.width=i.readVarint():4===n?t.height=i.readVarint():5===n?t.left=i.readSVarint():6===n?t.top=i.readSVarint():7===n&&(t.advance=i.readVarint())}var e=n("../util/image"),o=e.AlphaImage,s=n("pbf"),i=3;t.exports=function(n){return new s(n).readFields(r,[])};t.exports.GLYPH_PBF_BORDER=i},{"../util/image":242,pbf:38}],181:[function(n,t){"use strict";function i(n,t,i){return t.isPaintValueFeatureConstant(n)?t.paint[n]:i.programConfigurations.get(t.id).paintPropertyStatistics[n].max}function r(n){return Math.sqrt(n[0]*n[0]+n[1]*n[1])}function u(n,t,i,r,u){var o,s,e;if(!t[0]&&!t[1])return n;for(o=f.convert(t),"viewport"===i&&o._rotate(-r),s=[],e=0;e<n.length;e++){for(var c=n[e],l=[],h=0;h<c.length;h++)l.push(c[h].sub(o._mult(u)));s.push(l)}return s}var f=n("@mapbox/point-geometry");t.exports={getMaximumPaintValue:i,translateDistance:r,translate:u}},{"@mapbox/point-geometry":2}],182:[function(n,t){"use strict";var l=n("../util/evented"),f=n("./style_layer"),a=n("./load_sprite"),v=n("../render/image_manager"),y=n("../render/glyph_manager"),p=n("./light"),w=n("../render/line_atlas"),i=n("../util/util"),e=n("../util/ajax"),o=n("../util/mapbox"),b=n("../util/browser"),k=n("../util/dispatcher"),d=n("./animation_loop"),r=n("./validate_style"),g=n("../source/source").getType,nt=n("../source/source").setType,s=n("../source/query_features"),tt=n("../source/source_cache"),ot=n("../source/geojson_source"),it=n("../style-spec/reference/latest"),rt=n("../util/global_worker_pool"),h=n("../style-spec/deref"),u=n("../style-spec/diff"),c=n("../source/rtl_text_plugin"),ut=i.pick(u.operations,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),ft=i.pick(u.operations,["setCenter","setZoom","setBearing","setPitch"]),et=function(n){function t(t,r){var u=this,f;void 0===r&&(r={});n.call(this);this.map=t;this.animationLoop=t&&t.animationLoop||new d;this.dispatcher=new k(rt(),this);this.imageManager=new v;this.glyphManager=new y(t._transformRequest,r.localIdeographFontFamily);this.lineAtlas=new w(256,512);this._layers={};this._order=[];this.sourceCaches={};this.zoomHistory={};this._loaded=!1;i.bindAll(["_redoPlacement"],this);this._resetUpdates();f=this;this._rtlTextPluginCallback=c.registerForPluginAvailability(function(n){f.dispatcher.broadcast("loadRTLTextPlugin",n.pluginBlobURL,n.errorCallback);for(var t in f.sourceCaches)f.sourceCaches[t].reload()});this.on("data",function(n){var i,t,f,r;if("source"===n.dataType&&"metadata"===n.sourceDataType&&(i=u.sourceCaches[n.sourceId],i&&(t=i.getSource(),t&&t.vectorLayerIds)))for(f in u._layers)r=u._layers[f],r.source===t.id&&u._validateLayer(r)})}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.loadURL=function(n,t){var i=this,r,u;void 0===t&&(t={});this.fire("dataloading",{dataType:"style"});r="boolean"==typeof t.validate?t.validate:!o.isMapboxURL(n);n=o.normalizeStyleURL(n,t.accessToken);u=this.map._transformRequest(n,e.ResourceType.Style);e.getJSON(u,function(n,t){n?i.fire("error",{error:n}):t&&i._load(t,r)})},t.prototype.loadJSON=function(n,t){var i=this;void 0===t&&(t={});this.fire("dataloading",{dataType:"style"});b.frame(function(){i._load(n,!1!==t.validate)})},t.prototype._load=function(n,t){var i=this,o,s,e,c,u;if(!t||!r.emitErrors(this,r(n))){this._loaded=!0;this.stylesheet=n;this.updatePaintProperties();for(o in n.sources)i.addSource(o,n.sources[o],{validate:!1});for(n.sprite?a(n.sprite,this.map._transformRequest,function(n,t){if(n)i.fire("error",n);else if(t)for(var r in t)i.imageManager.addImage(r,t[r]);i.imageManager.setLoaded(!0);i.fire("data",{dataType:"style"})}):this.imageManager.setLoaded(!0),this.glyphManager.setURL(n.glyphs),s=h(this.stylesheet.layers),this._order=s.map(function(n){return n.id}),this._layers={},e=0,c=s;e<c.length;e+=1)u=c[e],u=f.create(u),u.setEventedParent(i,{layer:{id:u.id}}),i._layers[u.id]=u;this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order));this.light=new p(this.stylesheet.light);this.fire("data",{dataType:"style"});this.fire("style.load")}},t.prototype._validateLayer=function(n){var r=this.sourceCaches[n.source],i,t;r&&(i=n.sourceLayer,i&&(t=r.getSource(),("geojson"===t.type||t.vectorLayerIds&&-1===t.vectorLayerIds.indexOf(i))&&this.fire("error",{error:new Error('Source layer "'+i+'" does not exist on source "'+t.id+'" as specified by style layer "'+n.id+'"')})))},t.prototype.loaded=function(){var n=this,t;if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(t in n.sourceCaches)if(!n.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()},t.prototype._serializeLayers=function(n){var t=this;return n.map(function(n){return t._layers[n].serialize()})},t.prototype._applyPaintPropertyUpdates=function(n){var t=this,i,f,r,e,u,o;if(this._loaded){n=n||{transition:!0};i=this.stylesheet.transition||{};f=this._updatedAllPaintProps?this._layers:this._updatedPaintProps;for(r in f)if(e=t._layers[r],u=t._updatedPaintProps[r],t._updatedAllPaintProps||u.all)e.updatePaintTransitions(n,i,t.animationLoop,t.zoomHistory);else for(o in u)t._layers[r].updatePaintTransition(o,n,i,t.animationLoop,t.zoomHistory);this.light.updateLightTransitions(n,i,this.animationLoop)}},t.prototype._recalculate=function(n){var t=this,f,r,u,e,i;if(this._loaded){for(f in t.sourceCaches)t.sourceCaches[f].used=!1;for(this._updateZoomHistory(n),r=0,u=t._order;r<u.length;r+=1)e=u[r],i=t._layers[e],i.recalculate(n),!i.isHidden(n)&&i.source&&(t.sourceCaches[i.source].used=!0);this.light.recalculate(n);Math.floor(this.z)!==Math.floor(n)&&this.animationLoop.set(300);this.z=n}},t.prototype._updateZoomHistory=function(n){var t=this.zoomHistory;void 0===t.lastIntegerZoom&&(t.lastIntegerZoom=Math.floor(n),t.lastIntegerZoomTime=0,t.lastZoom=n);Math.floor(t.lastZoom)<Math.floor(n)?(t.lastIntegerZoom=Math.floor(n),t.lastIntegerZoomTime=Date.now()):Math.floor(t.lastZoom)>Math.floor(n)&&(t.lastIntegerZoom=Math.floor(n+1),t.lastIntegerZoomTime=Date.now());t.lastZoom=n},t.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading");},t.prototype.update=function(n){var t=this,r,u,i,f;if(this._changed){r=Object.keys(this._updatedLayers);u=Object.keys(this._removedLayers);(r.length||u.length||this._updatedSymbolOrder)&&this._updateWorkerLayers(r,u);for(i in t._updatedSources)f=t._updatedSources[i],"reload"===f?t._reloadSource(i):"clear"===f&&t._clearSource(i);this._applyPaintPropertyUpdates(n);this._resetUpdates();this.fire("data",{dataType:"style"})}},t.prototype._updateWorkerLayers=function(n,t){var i=this,r=this._updatedSymbolOrder?this._order.filter(function(n){return"symbol"===i._layers[n].type}):null;this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(n),removedIds:t,symbolOrder:r})},t.prototype._resetUpdates=function(){this._changed=!1;this._updatedLayers={};this._removedLayers={};this._updatedSymbolOrder=!1;this._updatedSources={};this._updatedPaintProps={};this._updatedAllPaintProps=!1},t.prototype.setState=function(n){var e=this,t,f;if((this._checkLoaded(),r.emitErrors(this,r(n)))||(n=i.clone(n),n.layers=h(n.layers),t=u(this.serialize(),n).filter(function(n){return!(n.command in ft)}),0===t.length))return!1;if(f=t.filter(function(n){return!(n.command in ut)}),f.length>0)throw new Error("Unimplemented: "+f.map(function(n){return n.command}).join(", ")+".");return t.forEach(function(n){"setTransition"!==n.command&&e[n.command].apply(e,n.args)}),this.stylesheet=n,!0},t.prototype.addImage=function(n,t){if(this.imageManager.getImage(n))return this.fire("error",{error:new Error("An image with this name already exists.")});this.imageManager.addImage(n,t);this.fire("data",{dataType:"style"})},t.prototype.removeImage=function(n){if(!this.imageManager.getImage(n))return this.fire("error",{error:new Error("No image with this name exists.")});this.imageManager.removeImage(n);this.fire("data",{dataType:"style"})},t.prototype.addSource=function(n,t,i){var f=this,u;if(this._checkLoaded(),void 0!==this.sourceCaches[n])throw new Error("There is already a source with this ID");if(!t.type)throw new Error("The type property must be defined, but the only the following properties were given: "+Object.keys(t).join(", ")+".");["vector","raster","geojson","video","image","canvas"].indexOf(t.type)>=0&&this._validate(r.source,"sources."+n,t,null,i)||(u=this.sourceCaches[n]=new tt(n,t,this.dispatcher),u.style=this,u.setEventedParent(this,function(){return{isSourceLoaded:f.loaded(),source:u.serialize(),sourceId:n}}),u.onAdd(this.map),this._changed=!0)},t.prototype.removeSource=function(n){if(this._checkLoaded(),void 0===this.sourceCaches[n])throw new Error("There is no source with this ID");var t=this.sourceCaches[n];delete this.sourceCaches[n];delete this._updatedSources[n];t.fire("data",{sourceDataType:"metadata",dataType:"source",sourceId:n});t.setEventedParent(null);t.clearTiles();t.onRemove&&t.onRemove(this.map);this._changed=!0},t.prototype.setGeoJSONSourceData=function(n,t){this._checkLoaded();this.sourceCaches[n].getSource().setData(t);this._changed=!0},t.prototype.getSource=function(n){return this.sourceCaches[n]&&this.sourceCaches[n].getSource()},t.prototype.addLayer=function(n,t,u){var e,o,s,h;if(this._checkLoaded(),e=n.id,"object"==typeof n.source&&(this.addSource(e,n.source),n=i.clone(n),n=i.extend(n,{source:e})),!this._validate(r.layer,"layers."+e,n,{arrayIndex:-1},u)){if(o=f.create(n),this._validateLayer(o),o.setEventedParent(this,{layer:{id:e}}),s=t?this._order.indexOf(t):this._order.length,t&&-1===s)return void this.fire("error",{message:new Error('Layer with id "'+t+'" does not exist on this map.')});(this._order.splice(s,0,e),this._layers[e]=o,this._removedLayers[e]&&o.source)&&(h=this._removedLayers[e],delete this._removedLayers[e],h.type!==o.type?this._updatedSources[o.source]="clear":(this._updatedSources[o.source]="reload",this.sourceCaches[o.source].pause()));this._updateLayer(o);"symbol"===o.type&&(this._updatedSymbolOrder=!0);this.updatePaintProperties(e)}},t.prototype.moveLayer=function(n,t){var i,r,u;if(this._checkLoaded(),this._changed=!0,i=this._layers[n],!i)return void this.fire("error",{error:new Error("The layer '"+n+"' does not exist in the map's style and cannot be moved.")});r=this._order.indexOf(n);this._order.splice(r,1);u=t?this._order.indexOf(t):this._order.length;this._order.splice(u,0,n);"symbol"===i.type&&(this._updatedSymbolOrder=!0,i.source&&!this._updatedSources[i.source]&&(this._updatedSources[i.source]="reload",this.sourceCaches[i.source].pause()))},t.prototype.removeLayer=function(n){var t,i;if(this._checkLoaded(),t=this._layers[n],!t)return void this.fire("error",{error:new Error("The layer '"+n+"' does not exist in the map's style and cannot be removed.")});t.setEventedParent(null);i=this._order.indexOf(n);this._order.splice(i,1);"symbol"===t.type&&(this._updatedSymbolOrder=!0);this._changed=!0;this._removedLayers[n]=t;delete this._layers[n];delete this._updatedLayers[n];delete this._updatedPaintProps[n]},t.prototype.getLayer=function(n){return this._layers[n]},t.prototype.setLayerZoomRange=function(n,t,i){this._checkLoaded();var r=this.getLayer(n);if(!r)return void this.fire("error",{error:new Error("The layer '"+n+"' does not exist in the map's style and cannot have zoom extent.")});r.minzoom===t&&r.maxzoom===i||(null!=t&&(r.minzoom=t),null!=i&&(r.maxzoom=i),this._updateLayer(r))},t.prototype.setFilter=function(n,t){this._checkLoaded();var u=this.getLayer(n);if(!u)return void this.fire("error",{error:new Error("The layer '"+n+"' does not exist in the map's style and cannot be filtered.")});null!==t&&void 0!==t&&this._validate(r.filter,"layers."+u.id+".filter",t)||i.deepEqual(u.filter,t)||(u.filter=i.clone(t),this._updateLayer(u))},t.prototype.getFilter=function(n){return i.clone(this.getLayer(n).filter)},t.prototype.setLayoutProperty=function(n,t,r){this._checkLoaded();var u=this.getLayer(n);if(!u)return void this.fire("error",{error:new Error("The layer '"+n+"' does not exist in the map's style and cannot be styled.")});i.deepEqual(u.getLayoutProperty(t),r)||(u.setLayoutProperty(t,r),this._updateLayer(u))},t.prototype.getLayoutProperty=function(n,t){return this.getLayer(n).getLayoutProperty(t)},t.prototype.setPaintProperty=function(n,t,r){var u,f;if(this._checkLoaded(),u=this.getLayer(n),!u)return void this.fire("error",{error:new Error("The layer '"+n+"' does not exist in the map's style and cannot be styled.")});i.deepEqual(u.getPaintProperty(t),r)||(f=u.isPaintValueFeatureConstant(t),u.setPaintProperty(t,r),u.isPaintValueFeatureConstant(t)&&f||this._updateLayer(u),this.updatePaintProperties(n,t))},t.prototype.getPaintProperty=function(n,t){return this.getLayer(n).getPaintProperty(t)},t.prototype.getTransition=function(){return i.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},t.prototype.updatePaintProperties=function(n,t){if(this._changed=!0,n){var i=this._updatedPaintProps;i[n]||(i[n]={});i[n][t||"all"]=!0}else this._updatedAllPaintProps=!0},t.prototype.serialize=function(){var n=this;return i.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:i.mapObject(this.sourceCaches,function(n){return n.serialize()}),layers:this._order.map(function(t){return n._layers[t].serialize()})},function(n){return void 0!==n})},t.prototype._updateLayer=function(n){this._updatedLayers[n.id]=!0;n.source&&!this._updatedSources[n.source]&&(this._updatedSources[n.source]="reload",this.sourceCaches[n.source].pause());this._changed=!0},t.prototype._flattenRenderedFeatures=function(n){for(var s,u,t,f,h,c=this,e=[],i=this._order.length-1;i>=0;i--)for(var l=c._order[i],r=0,o=n;r<o.length;r+=1)if(s=o[r],u=s[l],u)for(t=0,f=u;t<f.length;t+=1)h=f[t],e.push(h);return e},t.prototype.queryRenderedFeatures=function(n,t,i,u){var f=this,o,e,h,c,l,a,v,y;if(t&&t.filter&&this._validate(r.filter,"queryRenderedFeatures.filter",t.filter),o={},t&&t.layers){if(!Array.isArray(t.layers))return this.fire("error",{error:"parameters.layers must be an Array."}),[];for(e=0,h=t.layers;e<h.length;e+=1){if(c=h[e],l=f._layers[c],!l)return f.fire("error",{error:"The layer '"+c+"' does not exist in the map's style and cannot be queried for features."}),[];o[l.source]=!0}}a=[];for(v in f.sourceCaches)(!t.layers||o[v])&&(y=s.rendered(f.sourceCaches[v],f._layers,n,t,i,u),a.push(y));return this._flattenRenderedFeatures(a)},t.prototype.querySourceFeatures=function(n,t){t&&t.filter&&this._validate(r.filter,"querySourceFeatures.filter",t.filter);var i=this.sourceCaches[n];return i?s.source(i,t):[]},t.prototype.addSourceType=function(n,t,i){return g(n)?i(new Error('A source type called "'+n+'" already exists.')):(nt(n,t),t.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:n,url:t.workerSourceURL},i):i(null,null))},t.prototype.getLight=function(){return this.light.getLight()},t.prototype.setLight=function(n,t){var f,r,u,e;this._checkLoaded();f=this.light.getLight();r=!1;for(u in n)if(!i.deepEqual(n[u],f[u])){r=!0;break}r&&(e=this.stylesheet.transition||{},this.light.setLight(n),this.light.updateLightTransitions(t||{transition:!0},e,this.animationLoop))},t.prototype._validate=function(n,t,u,f,e){return(!e||!1!==e.validate)&&r.emitErrors(this,n.call(r,i.extend({key:t,style:this.serialize(),value:u,styleSpec:it},f)))},t.prototype._remove=function(){var n=this,t;c.evented.off("pluginAvailable",this._rtlTextPluginCallback);for(t in n.sourceCaches)n.sourceCaches[t].clearTiles();this.dispatcher.remove()},t.prototype._clearSource=function(n){this.sourceCaches[n].clearTiles()},t.prototype._reloadSource=function(n){this.sourceCaches[n].resume();this.sourceCaches[n].reload()},t.prototype._updateSources=function(n){var t=this,i;for(i in t.sourceCaches)t.sourceCaches[i].update(n)},t.prototype._redoPlacement=function(){var n=this,t;for(t in n.sourceCaches)n.sourceCaches[t].redoPlacement()},t.prototype.getImages=function(n,t,i){this.imageManager.getImages(t.icons,i)},t.prototype.getGlyphs=function(n,t,i){this.glyphManager.getGlyphs(t.stacks,i)},t}(l);t.exports=et},{"../render/glyph_manager":86,"../render/image_manager":88,"../render/line_atlas":89,"../source/geojson_source":100,"../source/query_features":106,"../source/rtl_text_plugin":108,"../source/source":109,"../source/source_cache":110,"../style-spec/deref":119,"../style-spec/diff":120,"../style-spec/reference/latest":147,"../util/ajax":230,"../util/browser":231,"../util/dispatcher":237,"../util/evented":239,"../util/global_worker_pool":241,"../util/mapbox":246,"../util/util":252,"./animation_loop":176,"./light":177,"./load_sprite":179,"./style_layer":184,"./validate_style":195}],183:[function(n,t){"use strict";function f(n,t,i){if(o(n))return s(n,t,i);if(h(n)){var r=c(n,t,"property");if("success"!==r.result)throw new Error(r.errors.map(function(n){return n.key+": "+n.message}).join(", "));if("property"===r.context)return r;throw new Error("Incorrect expression context "+r.context);}return"string"==typeof n&&"color"===t.type&&(n=e(n)),{result:"success",context:"property",isFeatureConstant:!0,isZoomConstant:!0,evaluate:function(){return n}}}var e=n("../style-spec/util/parse_color"),r=n("../style-spec/function"),o=r.isFunction,s=r.createFunction,u=n("../style-spec/expression"),h=u.isExpression,c=u.createExpression,l=n("../util/util"),a=n("../style-spec/expression/definitions/curve"),i=function(n,t,i){this.value=l.clone(t);this.json=JSON.stringify(this.value);this.minimum=n.minimum;this.expression=f(this.value,n,i)};i.prototype.calculate=function(n,t){var i=this.expression.evaluate(n,t);return void 0!==this.minimum&&i<this.minimum?this.minimum:i};i.prototype.interpolationFactor=function(n,t,i){return this.expression.isZoomConstant?0:a.interpolationFactor(this.expression.interpolation,n,t,i)};t.exports=i},{"../style-spec/expression":136,"../style-spec/expression/definitions/curve":129,"../style-spec/function":145,"../style-spec/util/parse_color":153,"../util/util":252}],184:[function(n,t){"use strict";function o(n){return n.value}var i=n("../util/util"),c=n("./style_transition"),u=n("./style_declaration"),f=n("../style-spec/reference/latest"),r=n("./validate_style"),l=n("./../style-spec/util/parse_color"),a=n("../util/evented"),e="-transition",s=function(n){function t(t){var i=this,r,u,e;n.call(this);this.id=t.id;this.metadata=t.metadata;this.type=t.type;this.minzoom=t.minzoom;this.maxzoom=t.maxzoom;"background"!==t.type&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter);this.paint={};this.layout={};this._featureFilter=function(){return!0};this._paintSpecifications=f["paint_"+this.type];this._layoutSpecifications=f["layout_"+this.type];this._paintTransitions={};this._paintTransitionOptions={};this._paintDeclarations={};this._layoutDeclarations={};this._layoutFunctions={};e={validate:!1};for(r in t.paint)i.setPaintProperty(r,t.paint[r],e);for(u in t.layout)i.setLayoutProperty(u,t.layout[u],e);for(r in i._paintSpecifications)i.paint[r]=i.getPaintValue(r,{zoom:0});for(u in i._layoutSpecifications)i._updateLayoutValue(u)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.setLayoutProperty=function(n,t,i){if(null==t)delete this._layoutDeclarations[n];else{var f="layers."+this.id+".layout."+n;if(this._validate(r.layoutProperty,f,n,t,i))return;this._layoutDeclarations[n]=new u(this._layoutSpecifications[n],t,n)}this._updateLayoutValue(n)},t.prototype.getLayoutProperty=function(n){return this._layoutDeclarations[n]&&this._layoutDeclarations[n].value},t.prototype.getLayoutValue=function(n,t,i){var u=this._layoutSpecifications[n],r=this._layoutDeclarations[n];return r&&(r.expression.isFeatureConstant||i)?r.calculate(t,i):u.default},t.prototype.setPaintProperty=function(n,t,f){var o="layers."+this.id+".paint."+n;if(i.endsWith(n,e))if(null===t||void 0===t)delete this._paintTransitionOptions[n];else{if(this._validate(r.paintProperty,o,n,t,f))return;this._paintTransitionOptions[n]=t}else if(null===t||void 0===t)delete this._paintDeclarations[n];else{if(this._validate(r.paintProperty,o,n,t,f))return;this._paintDeclarations[n]=new u(this._paintSpecifications[n],t,n)}},t.prototype.getPaintProperty=function(n){return i.endsWith(n,e)?this._paintTransitionOptions[n]:this._paintDeclarations[n]&&this._paintDeclarations[n].value},t.prototype.getPaintValue=function(n,t,i){var r=this._paintSpecifications[n],u=this._paintTransitions[n];return u&&(u.declaration.expression.isFeatureConstant||i)?u.calculate(t,i):"color"===r.type&&r.default?l(r.default):r.default},t.prototype.getPaintInterpolationFactor=function(n,t,i,r){var u=this._paintDeclarations[n];return u?u.interpolationFactor(t,i,r):0},t.prototype.isPaintValueFeatureConstant=function(n){var t=this._paintDeclarations[n];return!t||t.expression.isFeatureConstant},t.prototype.isPaintValueZoomConstant=function(n){var t=this._paintDeclarations[n];return!t||t.expression.isZoomConstant},t.prototype.isHidden=function(n){return!!(this.minzoom&&n<this.minzoom)||!!(this.maxzoom&&n>=this.maxzoom)||"none"===this.layout.visibility},t.prototype.updatePaintTransitions=function(n,t,i,r){var u,f=this;for(u in f._paintDeclarations)f._applyPaintDeclaration(u,f._paintDeclarations[u],n,t,i,r);for(u in f._paintTransitions)u in f._paintDeclarations||f._applyPaintDeclaration(u,null,n,t,i,r)},t.prototype.updatePaintTransition=function(n,t,i,r,u){var f=this._paintDeclarations[n];this._applyPaintDeclaration(n,f,t,i,r,u)},t.prototype.recalculate=function(n){var t=this,i,r;for(i in t._paintTransitions)t.paint[i]=t.getPaintValue(i,{zoom:n});for(r in t._layoutFunctions)t.layout[r]=t.getLayoutValue(r,{zoom:n})},t.prototype.serialize=function(){var n={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:i.mapObject(this._layoutDeclarations,o),paint:i.mapObject(this._paintDeclarations,o)};return i.filterObject(n,function(n,t){return!(void 0===n||"layout"===t&&!Object.keys(n).length||"paint"===t&&!Object.keys(n).length)})},t.prototype._applyPaintDeclaration=function(n,t,r,f,o,s){var h=r.transition?this._paintTransitions[n]:void 0,a=this._paintSpecifications[n],v,l;(null!==t&&void 0!==t||(t=new u(a,a.default,n)),h&&h.declaration.json===t.json)||(v=i.extend({duration:300,delay:0},f,this.getPaintProperty(n+e)),l=this._paintTransitions[n]=new c(a,t,h,v,s),o&&(l.instant()||(l.loopID=o.set(l.endTime-Date.now())),h&&o.cancel(h.loopID)))},t.prototype._updateLayoutValue=function(n){var t=this._layoutDeclarations[n];!t||t.expression.isZoomConstant&&t.expression.isFeatureConstant?(delete this._layoutFunctions[n],this.layout[n]=this.getLayoutValue(n,{zoom:0})):this._layoutFunctions[n]=!0},t.prototype._validate=function(n,t,i,u,e){return(!e||!1!==e.validate)&&r.emitErrors(this,n.call(r,{key:t,layerType:this.type,objectKey:i,value:u,styleSpec:f,style:{glyphs:!0,sprite:!0}}))},t.prototype.has3DPass=function(){return!1},t.prototype.resize=function(){},t}(a),h;t.exports=s;h={circle:n("./style_layer/circle_style_layer"),heatmap:n("./style_layer/heatmap_style_layer"),fill:n("./style_layer/fill_style_layer"),"fill-extrusion":n("./style_layer/fill_extrusion_style_layer"),line:n("./style_layer/line_style_layer"),symbol:n("./style_layer/symbol_style_layer"),background:n("./style_layer/background_style_layer"),raster:n("./style_layer/raster_style_layer")};s.create=function(n){return new h[n.type](n)}},{"../style-spec/reference/latest":147,"../util/evented":239,"../util/util":252,"./../style-spec/util/parse_color":153,"./style_declaration":183,"./style_layer/background_style_layer":185,"./style_layer/circle_style_layer":186,"./style_layer/fill_extrusion_style_layer":187,"./style_layer/fill_style_layer":188,"./style_layer/heatmap_style_layer":189,"./style_layer/line_style_layer":190,"./style_layer/raster_style_layer":191,"./style_layer/symbol_style_layer":192,"./style_transition":194,"./validate_style":195}],185:[function(n,t){"use strict";var i=n("../style_layer"),r=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.isOpacityZero=function(n){return 0===this.getPaintValue("background-opacity",{zoom:n})},t}(i);t.exports=r},{"../style_layer":184}],186:[function(n,t){"use strict";var r=n("../style_layer"),u=n("../../data/bucket/circle_bucket"),f=n("../../util/intersection_tests"),e=f.multiPolygonIntersectsBufferedMultiPoint,i=n("../query_utils"),o=i.getMaximumPaintValue,s=i.translateDistance,h=i.translate,c=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.createBucket=function(n){return new u(n)},t.prototype.isOpacityZero=function(n){return this.isPaintValueFeatureConstant("circle-opacity")&&0===this.getPaintValue("circle-opacity",{zoom:n})&&this.isPaintValueFeatureConstant("circle-stroke-width")&&0===this.getPaintValue("circle-stroke-width",{zoom:n})||this.isPaintValueFeatureConstant("circle-stroke-opacity")&&0===this.getPaintValue("circle-stroke-opacity",{zoom:n})},t.prototype.queryRadius=function(n){return o("circle-radius",this,n)+s(this.paint["circle-translate"])},t.prototype.queryIntersectsFeature=function(n,t,i,r,u,f){var o=h(n,this.getPaintValue("circle-translate",{zoom:r},t),this.getPaintValue("circle-translate-anchor",{zoom:r},t),u,f),s=this.getPaintValue("circle-radius",{zoom:r},t)*f;return e(o,i,s)},t}(r);t.exports=c},{"../../data/bucket/circle_bucket":52,"../../util/intersection_tests":243,"../query_utils":181,"../style_layer":184}],187:[function(n,t){"use strict";var r=n("../style_layer"),u=n("../../data/bucket/fill_extrusion_bucket"),f=n("../../util/intersection_tests"),e=f.multiPolygonIntersectsMultiPolygon,i=n("../query_utils"),o=i.translateDistance,s=i.translate,h=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.getPaintValue=function(t,i,r){var u=n.prototype.getPaintValue.call(this,t,i,r);return"fill-extrusion-color"===t&&u&&(u[3]=1),u},t.prototype.createBucket=function(n){return new u(n)},t.prototype.isOpacityZero=function(n){return 0===this.getPaintValue("fill-extrusion-opacity",{zoom:n})},t.prototype.queryRadius=function(){return o(this.paint["fill-extrusion-translate"])},t.prototype.queryIntersectsFeature=function(n,t,i,r,u,f){var o=s(n,this.getPaintValue("fill-extrusion-translate",{zoom:r},t),this.getPaintValue("fill-extrusion-translate-anchor",{zoom:r},t),u,f);return e(o,i)},t.prototype.has3DPass=function(){return 0!==this.paint["fill-extrusion-opacity"]&&"none"!==this.layout.visibility},t.prototype.resize=function(n){if(this.viewportFrame){var t=this.viewportFrame,i=t.texture,r=t.fbo;n.deleteTexture(i);n.deleteFramebuffer(r);this.viewportFrame=null}},t}(r);t.exports=h},{"../../data/bucket/fill_extrusion_bucket":54,"../../util/intersection_tests":243,"../query_utils":181,"../style_layer":184}],188:[function(n,t){"use strict";var r=n("../style_layer"),u=n("../../data/bucket/fill_bucket"),f=n("../../util/intersection_tests"),e=f.multiPolygonIntersectsMultiPolygon,i=n("../query_utils"),o=i.translateDistance,s=i.translate,h=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.getPaintValue=function(t,i,r){var f=this,u;if("fill-outline-color"===t){if(void 0===this.getPaintProperty("fill-outline-color"))return n.prototype.getPaintValue.call(this,"fill-color",i,r);for(u=this._paintTransitions["fill-outline-color"];u;){if(!(u&&u.declaration&&u.declaration.value))return n.prototype.getPaintValue.call(f,"fill-color",i,r);u=u.oldTransition}}return n.prototype.getPaintValue.call(this,t,i,r)},t.prototype.getPaintInterpolationFactor=function(t){for(var i=[],r=arguments.length-1;r-->0;)i[r]=arguments[r+1];return"fill-outline-color"===t&&void 0===this.getPaintProperty("fill-outline-color")?n.prototype.getPaintInterpolationFactor.apply(this,["fill-color"].concat(i)):n.prototype.getPaintInterpolationFactor.apply(this,[t].concat(i))},t.prototype.isPaintValueFeatureConstant=function(t){return"fill-outline-color"===t&&void 0===this.getPaintProperty("fill-outline-color")?n.prototype.isPaintValueFeatureConstant.call(this,"fill-color"):n.prototype.isPaintValueFeatureConstant.call(this,t)},t.prototype.isPaintValueZoomConstant=function(t){return"fill-outline-color"===t&&void 0===this.getPaintProperty("fill-outline-color")?n.prototype.isPaintValueZoomConstant.call(this,"fill-color"):n.prototype.isPaintValueZoomConstant.call(this,t)},t.prototype.createBucket=function(n){return new u(n)},t.prototype.isOpacityZero=function(n){return this.isPaintValueFeatureConstant("fill-opacity")&&0===this.getPaintValue("fill-opacity",{zoom:n})},t.prototype.queryRadius=function(){return o(this.paint["fill-translate"])},t.prototype.queryIntersectsFeature=function(n,t,i,r,u,f){var o=s(n,this.getPaintValue("fill-translate",{zoom:r},t),this.getPaintValue("fill-translate-anchor",{zoom:r},t),u,f);return e(o,i)},t}(r);t.exports=h},{"../../data/bucket/fill_bucket":53,"../../util/intersection_tests":243,"../query_utils":181,"../style_layer":184}],189:[function(n,t){"use strict";var i=n("../style_layer"),r=n("../../data/bucket/heatmap_bucket"),u=n("../../util/image").RGBAImage,f=function(n){function t(t){n.call(this,t);this.colorRampData=new Uint8Array(1024);this.getPaintProperty("heatmap-color")||this.setPaintProperty("heatmap-color",this._paintSpecifications["heatmap-color"].default,"")}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.createBucket=function(n){return new r(n)},t.prototype.isOpacityZero=function(n){return 0===this.getPaintValue("heatmap-opacity",{zoom:n})},t.prototype._applyPaintDeclaration=function(t,i,r,f,e,o){var h=this,a,s,c,l;if(n.prototype._applyPaintDeclaration.call(this,t,i,r,f,e,o),"heatmap-color"===t){for(a=this.colorRampData.length,s=4;s<a;s+=4)c=h.getPaintValue("heatmap-color",{heatmapDensity:s/a,zoom:-1}),l=c[3],h.colorRampData[s+0]=Math.floor(255*c[0]/l),h.colorRampData[s+1]=Math.floor(255*c[1]/l),h.colorRampData[s+2]=Math.floor(255*c[2]/l),h.colorRampData[s+3]=Math.floor(255*l);this.colorRamp=u.create({width:256,height:1},this.colorRampData);this.colorRampTexture=null}},t.prototype.resize=function(n){this.heatmapTexture&&(n.deleteTexture(this.heatmapTexture),this.heatmapTexture=null);this.heatmapFbo&&(n.deleteFramebuffer(this.heatmapFbo),this.heatmapFbo=null)},t}(i);t.exports=f},{"../../data/bucket/heatmap_bucket":55,"../../util/image":242,"../style_layer":184}],190:[function(n,t){"use strict";function u(n,t){return t>0?t+2*n:n}function f(n,t){for(var h=[],c=new e(0,0),f=0;f<n.length;f++){for(var r=n[f],l=[],i=0;i<r.length;i++){var a=r[i-1],o=r[i],v=r[i+1],y=0===i?c:o.sub(a)._unit()._perp(),s=i===r.length-1?c:v.sub(o)._unit()._perp(),u=y._add(s)._unit(),p=u.x*s.x+u.y*s.y;u._mult(1/p);l.push(u._mult(t)._add(o))}h.push(l)}return h}var e=n("@mapbox/point-geometry"),o=n("../style_layer"),s=n("../../data/bucket/line_bucket"),h=n("../../util/intersection_tests"),c=h.multiPolygonIntersectsBufferedMultiLine,i=n("../query_utils"),r=i.getMaximumPaintValue,l=i.translateDistance,a=i.translate,v=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.createBucket=function(n){return new s(n)},t.prototype.isOpacityZero=function(n){return this.isPaintValueFeatureConstant("line-opacity")&&0===this.getPaintValue("line-opacity",{zoom:n})},t.prototype.queryRadius=function(n){var t=n,i=u(r("line-width",this,t),r("line-gap-width",this,t)),f=r("line-offset",this,t);return i/2+Math.abs(f)+l(this.paint["line-translate"])},t.prototype.queryIntersectsFeature=function(n,t,i,r,e,o){var h=a(n,this.getPaintValue("line-translate",{zoom:r},t),this.getPaintValue("line-translate-anchor",{zoom:r},t),e,o),l=o/2*u(this.getPaintValue("line-width",{zoom:r},t),this.getPaintValue("line-gap-width",{zoom:r},t)),s=this.getPaintValue("line-offset",{zoom:r},t);return s&&(i=f(i,s*o)),c(h,i,l)},t}(o);t.exports=v},{"../../data/bucket/line_bucket":56,"../../util/intersection_tests":243,"../query_utils":181,"../style_layer":184,"@mapbox/point-geometry":2}],191:[function(n,t){"use strict";var i=n("../style_layer"),r=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.isOpacityZero=function(n){return 0===this.getPaintValue("raster-opacity",{zoom:n})},t}(i);t.exports=r},{"../style_layer":184}],192:[function(n,t){"use strict";var i=n("../style_layer"),r=n("../../data/bucket/symbol_bucket"),u=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.getLayoutValue=function(t,i,r){var u=n.prototype.getLayoutValue.call(this,t,i,r);if("auto"!==u)return u;switch(t){case"text-rotation-alignment":case"icon-rotation-alignment":return"line"===this.getLayoutValue("symbol-placement",i,r)?"map":"viewport";case"text-pitch-alignment":return this.getLayoutValue("text-rotation-alignment",i,r);case"icon-pitch-alignment":return this.getLayoutValue("icon-rotation-alignment",i,r);default:return u}},t.prototype.getLayoutDeclaration=function(n){return this._layoutDeclarations[n]},t.prototype.isLayoutValueFeatureConstant=function(n){var t=this._layoutDeclarations[n];return!t||t.expression.isFeatureConstant},t.prototype.isLayoutValueZoomConstant=function(n){var t=this._layoutDeclarations[n];return!t||t.expression.isZoomConstant},t.prototype.createBucket=function(n){return new r(n)},t.prototype.isOpacityZero=function(n,t){return this.isPaintValueFeatureConstant(t)&&0===this.getPaintValue(t,{zoom:n})},t.prototype.queryRadius=function(){return 0},t.prototype.queryIntersectsFeature=function(){return!1},t}(i);t.exports=u},{"../../data/bucket/symbol_bucket":57,"../style_layer":184}],193:[function(n,t){"use strict";var r=n("./style_layer"),u=n("../util/util"),f=n("../style-spec/feature_filter"),e=n("../style-spec/group_by_layout"),i=function(n){n&&this.replace(n)};i.prototype.replace=function(n){var u=this,t,i,r;for(this.symbolOrder=[],t=0,i=n;t<i.length;t+=1)r=i[t],"symbol"===r.type&&u.symbolOrder.push(r.id);this._layerConfigs={};this._layers={};this.update(n,[])};i.prototype.update=function(n,t,i){for(var s,c,l,p,w,k,h,d,v,o=this,y=0,g=n;y<g.length;y+=1)s=g[y],o._layerConfigs[s.id]=s,c=o._layers[s.id]=r.create(s),c.updatePaintTransitions({transition:!1}),c._featureFilter=f(c.filter);for(l=0,p=t;l<p.length;l+=1)w=p[l],delete o._layerConfigs[w],delete o._layers[w];i&&(this.symbolOrder=i);this.familiesBySource={};for(var it=e(u.values(this._layerConfigs)),b=0,nt=it;b<nt.length;b+=1){var rt=nt[b],tt=rt.map(function(n){return o._layers[n.id]}),a=tt[0];a.layout&&"none"===a.layout.visibility||(k=a.source||"",h=o.familiesBySource[k],h||(h=o.familiesBySource[k]={}),d=a.sourceLayer||"_geojsonTileLayer",v=h[d],v||(v=h[d]=[]),v.push(tt))}};t.exports=i},{"../style-spec/feature_filter":144,"../style-spec/group_by_layout":146,"../util/util":252,"./style_layer":184}],194:[function(n,t){"use strict";function u(n,t,i){if(void 0!==n&&void 0!==t)return{from:n.to,fromScale:n.toScale,to:t.to,toScale:t.toScale,t:i}}var f=n("../util/util"),r=n("../style-spec/util/interpolate"),e={lastIntegerZoom:0,lastIntegerZoomTime:0,lastZoom:0},i=function(n,t,i,f,o){this.declaration=t;this.startTime=this.endTime=(new Date).getTime();this.oldTransition=i;this.duration=f.duration||0;this.delay=f.delay||0;this.zoomTransitioned="piecewise-constant"===n.function&&n.transition;this.interp=this.zoomTransitioned?u:r[n.type];this.zoomHistory=o||e;this.instant()||(this.endTime=this.startTime+this.duration+this.delay);i&&i.endTime<=this.startTime&&delete i.oldTransition};i.prototype.instant=function(){return!this.oldTransition||!this.interp||0===this.duration&&0===this.delay};i.prototype.calculate=function(n,t,i){var r=this._calculateTargetValue(n,t),u,e;return this.instant()?r:(i=i||Date.now())>=this.endTime?r:(u=this.oldTransition.calculate(n,t,this.startTime),e=f.easeCubicInOut((i-this.startTime-this.delay)/this.duration),this.interp(u,r,e))};i.prototype._calculateTargetValue=function(n,t){if(!this.zoomTransitioned)return this.declaration.calculate(n,t);var i=n.zoom,u=this.zoomHistory.lastIntegerZoom,o=i>u?2:.5,f=this.declaration.calculate({zoom:i>u?i-1:i+1},t),e=this.declaration.calculate({zoom:i},t),s=Math.min((Date.now()-this.zoomHistory.lastIntegerZoomTime)/this.duration,1),h=Math.abs(i-u),c=r(s,1,h);if(void 0!==f&&void 0!==e)return{from:f,fromScale:o,to:e,toScale:1,t:c}};t.exports=i},{"../style-spec/util/interpolate":152,"../util/util":252}],195:[function(n,t){"use strict";t.exports=n("../style-spec/validate_style.min");t.exports.emitErrors=function(n,t){var i,r,u,f;if(t&&t.length){for(i=0,r=t;i<r.length;i+=1)u=r[i],f=u.message,n.fire("error",{error:new Error(f)});return!0}return!1}},{"../style-spec/validate_style.min":175}],196:[function(n,t){"use strict";var i=n("@mapbox/point-geometry"),r=function(n){function t(t,i,r,u){n.call(this,t,i);this.angle=r;void 0!==u&&(this.segment=u)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.clone=function(){return new t(this.x,this.y,this.angle,this.segment)},t}(i);t.exports=r},{"@mapbox/point-geometry":2}],197:[function(n,t){"use strict";function i(n,t,i,r,u){var s,h,o;if(void 0===t.segment)return!0;for(var a=t,f=t.segment+1,e=0;e>-i/2;){if(--f<0)return!1;e-=n[f].dist(a);a=n[f]}for(e+=n[f].dist(n[f+1]),f++,s=[],h=0;e<i/2;){var v=n[f-1],c=n[f],l=n[f+1];if(!l)return!1;for(o=v.angleTo(c)-c.angleTo(l),o=Math.abs((o+3*Math.PI)%(2*Math.PI)-Math.PI),s.push({distance:e,angleDelta:o}),h+=o;e-s[0].distance>r;)h-=s.shift().angleDelta;if(h>u)return!1;f++;e+=c.dist(l)}return!0}t.exports=i},{}],198:[function(n,t){"use strict";function r(n,t,r,u,f){for(var e,o,l=[],h=0;h<n.length;h++)for(var a=n[h],s=void 0,c=0;c<a.length-1;c++)e=a[c],o=a[c+1],e.x<t&&o.x<t||(e.x<t?e=new i(t,e.y+(o.y-e.y)*((t-e.x)/(o.x-e.x)))._round():o.x<t&&(o=new i(t,e.y+(o.y-e.y)*((t-e.x)/(o.x-e.x)))._round()),e.y<r&&o.y<r||(e.y<r?e=new i(e.x+(o.x-e.x)*((r-e.y)/(o.y-e.y)),r)._round():o.y<r&&(o=new i(e.x+(o.x-e.x)*((r-e.y)/(o.y-e.y)),r)._round()),e.x>=u&&o.x>=u||(e.x>=u?e=new i(u,e.y+(o.y-e.y)*((u-e.x)/(o.x-e.x)))._round():o.x>=u&&(o=new i(u,e.y+(o.y-e.y)*((u-e.x)/(o.x-e.x)))._round()),e.y>=f&&o.y>=f||(e.y>=f?e=new i(e.x+(o.x-e.x)*((f-e.y)/(o.y-e.y)),f)._round():o.y>=f&&(o=new i(e.x+(o.x-e.x)*((f-e.y)/(o.y-e.y)),f)._round()),s&&e.equals(s[s.length-1])||(s=[e],l.push(s)),s.push(o)))));return l}var i=n("@mapbox/point-geometry");t.exports=r},{"@mapbox/point-geometry":2}],199:[function(n,t){"use strict";var r=n("../util/struct_array"),u=n("@mapbox/point-geometry"),i=r({members:[{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"offsetX"},{type:"Int16",name:"offsetY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Float32",name:"unadjustedMaxScale"},{type:"Float32",name:"maxScale"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"},{type:"Int16",name:"bbox0"},{type:"Int16",name:"bbox1"},{type:"Int16",name:"bbox2"},{type:"Int16",name:"bbox3"},{type:"Float32",name:"placementScale"}]});Object.defineProperty(i.prototype.StructType.prototype,"anchorPoint",{get:function(){return new u(this.anchorPointX,this.anchorPointY)}});t.exports=i},{"../util/struct_array":249,"@mapbox/point-geometry":2}],200:[function(n,t){"use strict";var i=function(n,t,i,r,u,f,e,o,s,h,c){var y=e.top*o-s,p=e.bottom*o+s,w=e.left*o-s,b=e.right*o+s,l,a,v,k;(this.boxStartIndex=n.length,h)?(l=p-y,a=b-w,l>0&&((l=Math.max(10*o,l),c)?(v=t[i.segment+1].sub(t[i.segment])._unit()._mult(a),k=[i.sub(v),i.add(v)],this._addLineCollisionBoxes(n,k,i,0,a,l,r,u,f)):this._addLineCollisionBoxes(n,t,i,i.segment,a,l,r,u,f))):n.emplaceBack(i.x,i.y,0,0,w,y,b,p,1/0,1/0,r,u,f,0,0,0,0,0);this.boxEndIndex=n.length};i.prototype._addLineCollisionBoxes=function(n,t,i,r,u,f,e,o,s){var b=f/2,k=Math.floor(u/b),g=Math.floor(k/2),nt=-f/2,tt=i,h=r+1,c=nt,d=-u/2,rt=d-u/8,y,a,v,l;do{if(--h<0){if(c>d)return;h=0;break}c-=t[h].dist(tt);tt=t[h]}while(c>rt);for(y=t[h].dist(t[h+1]),a=-g;a<k+g;a++)if(v=a*b,l=d+v,v<0&&(l+=v),v>u&&(l+=v-u),!(l<c)){for(;c+y<l;){if(c+=y,++h+1>=t.length)return;y=t[h].dist(t[h+1])}var ut=l-c,it=t[h],ft=t[h+1],p=ft.sub(it)._unit()._mult(ut)._add(it)._round(),et=Math.max(Math.abs(l-nt)-b/2,0),w=u/2/et;(a<0||a>=k)&&(w=Math.min(w,.99));n.emplaceBack(p.x,p.y,p.x-i.x,p.y-i.y,-f/2,-f/2,f/2,f/2,w,w,e,o,s,0,0,0,0,0)}};t.exports=i},{}],201:[function(n,t){"use strict";var r=n("@mapbox/point-geometry"),i=n("../data/extent"),f=n("grid-index"),e=n("../util/intersection_tests"),u=function(n,t,r,u,e,o,s){void 0===o&&(o=new f(i,12,6));void 0===s&&(s=new f(i,12,0));this.angle=n;this.pitch=t;this.cameraToCenterDistance=r;this.cameraToTileDistance=u;this.grid=o;this.ignoredGrid=s;this.perspectiveRatio=1+.5*(u/r-1);this.minScale=.5/this.perspectiveRatio;this.maxScale=2/this.perspectiveRatio;var h=Math.sin(this.angle),c=Math.cos(this.angle);this.rotationMatrix=[c,-h,h,c];this.reverseRotationMatrix=[c,h,-h,c];this.yStretch=Math.max(1,u/(r*Math.cos(t/180*Math.PI)));this.collisionBoxArray=e;0===e.length&&(e.emplaceBack(),e.emplaceBack(0,0,0,0,0,-i,0,i,1/0,1/0,0,0,0,0,0,0,0,0,0),e.emplaceBack(i,0,0,0,0,-i,0,i,1/0,1/0,0,0,0,0,0,0,0,0,0),e.emplaceBack(0,0,0,0,-i,0,i,0,1/0,1/0,0,0,0,0,0,0,0,0,0),e.emplaceBack(0,i,0,0,-i,0,i,0,1/0,1/0,0,0,0,0,0,0,0,0,0));this.tempCollisionBox=e.get(0);this.edges=[e.get(1),e.get(2),e.get(3),e.get(4)]};u.deserialize=function(n,t){return new u(n.angle,n.pitch,n.cameraToCenterDistance,n.cameraToTileDistance,t,new f(n.grid),new f(n.ignoredGrid))};u.prototype.serialize=function(n){var t=this.grid.toArrayBuffer(),i=this.ignoredGrid.toArrayBuffer();return n&&(n.push(t),n.push(i)),{angle:this.angle,pitch:this.pitch,cameraToCenterDistance:this.cameraToCenterDistance,cameraToTileDistance:this.cameraToTileDistance,grid:t,ignoredGrid:i}};u.prototype.placeCollisionFeature=function(n,t,i){for(var g,c,nt,lt,e,w,tt,f=this,it=this.collisionBoxArray,o=this.minScale,b=this.rotationMatrix,s=this.yStretch,k=n.boxStartIndex;k<n.boxEndIndex;k++){var u=it.get(k),d=u.anchorPoint._matMult(b),rt=d.x,ut=d.y,ft=rt+u.x1*f.perspectiveRatio,et=ut+u.y1*s*f.perspectiveRatio,ot=rt+u.x2*f.perspectiveRatio,st=ut+u.y2*s*f.perspectiveRatio;u.bbox0=ft;u.bbox1=et;u.bbox2=ot;u.bbox3=st;var h=new r(u.offsetX,u.offsetY)._matMult(b),ht=h.x*h.x,ct=h.y*h.y,at=ct*s*s,vt=Math.sqrt((ht+at)/(ht+ct))||1;if(u.maxScale=u.unadjustedMaxScale*vt,!t)for(g=f.grid.query(ft,et,ot,st),c=0;c<g.length;c++)if(nt=it.get(g[c]),lt=nt.anchorPoint._matMult(b),(o=f.getPlacementScale(o,d,u,lt,nt))>=f.maxScale)return o;if(i){if(e=void 0,f.angle){var l=f.reverseRotationMatrix,a=new r(u.x1,u.y1).matMult(l),v=new r(u.x2,u.y1).matMult(l),y=new r(u.x1,u.y2).matMult(l),p=new r(u.x2,u.y2).matMult(l);e=f.tempCollisionBox;e.anchorPointX=u.anchorPoint.x;e.anchorPointY=u.anchorPoint.y;e.x1=Math.min(a.x,v.x,y.x,p.x);e.y1=Math.min(a.y,v.x,y.x,p.x);e.x2=Math.max(a.x,v.x,y.x,p.x);e.y2=Math.max(a.y,v.x,y.x,p.x);e.maxScale=u.maxScale}else e=u;for(w=0;w<this.edges.length;w++)if(tt=f.edges[w],(o=f.getPlacementScale(o,u.anchorPoint,e,tt.anchorPoint,tt))>=f.maxScale)return o}}return o};u.prototype.queryRenderedSymbols=function(n,t){var o={},b=[],d,a,u;if(0===n.length||0===this.grid.keys.length&&0===this.ignoredGrid.keys.length)return b;for(var ct=this.collisionBoxArray,nt=this.rotationMatrix,tt=this.yStretch,it=[],s=1/0,h=1/0,c=-1/0,l=-1/0,k=0;k<n.length;k++)for(d=n[k],a=0;a<d.length;a++)u=d[a].matMult(nt),s=Math.min(s,u.x),h=Math.min(h,u.y),c=Math.max(c,u.x),l=Math.max(l,u.y),it.push(u);for(var v=this.grid.query(s,h,c,l),rt=this.ignoredGrid.query(s,h,c,l),g=0;g<rt.length;g++)v.push(rt[g]);for(var f=t/this.perspectiveRatio,ut=Math.pow(2,Math.ceil(Math.log(f)/Math.LN2*10)/10),y=0;y<v.length;y++){var i=ct.get(v[y]),p=i.sourceLayerIndex,ft=i.featureIndex;if(void 0===o[p]&&(o[p]={}),!o[p][ft]&&!(ut<i.placementScale||ut>i.maxScale)){var w=i.anchorPoint.matMult(nt),et=w.x+i.x1/f,ot=w.y+i.y1/f*tt,st=w.x+i.x2/f,ht=w.y+i.y2/f*tt,lt=[new r(et,ot),new r(st,ot),new r(st,ht),new r(et,ht)];e.polygonIntersectsPolygon(it,lt)&&(o[p][ft]=!0,b.push(v[y]))}}return b};u.prototype.getPlacementScale=function(n,t,i,r,u){var c=t.x-r.x,l=t.y-r.y,e=(u.x1-i.x2)/c,o=(u.x2-i.x1)/c,s=(u.y1-i.y2)*this.yStretch/l,h=(u.y2-i.y1)*this.yStretch/l;(isNaN(e)||isNaN(o))&&(e=o=1);(isNaN(s)||isNaN(h))&&(s=h=1);var f=Math.min(Math.max(e,o),Math.max(s,h)),a=u.maxScale,v=i.maxScale;return f>a&&(f=a),f>v&&(f=v),f>n&&f>=u.placementScale&&(n=f),n};u.prototype.insertCollisionFeature=function(n,t,i){for(var r,f=this,e=i?this.ignoredGrid:this.grid,o=this.collisionBoxArray,u=n.boxStartIndex;u<n.boxEndIndex;u++)r=o.get(u),r.placementScale=t,t<f.maxScale&&(1===f.perspectiveRatio||r.maxScale>=1)&&e.insert(u,r.bbox0,r.bbox1,r.bbox2,r.bbox3)};t.exports=u},{"../data/extent":58,"../util/intersection_tests":243,"@mapbox/point-geometry":2,"grid-index":23}],202:[function(n,t){"use strict";function u(n,t,r,u,f,e,o,s,h){var v=u?.6*e*o:0,c=Math.max(u?u.right-u.left:0,f?f.right-f.left:0),l=0===n[0].x||n[0].x===h||0===n[0].y||n[0].y===h,a;return t-c*o<t/4&&(t=c*o+t/4),a=2*e,i(n,l?t/2*s%t:(c/2+a)*o*s%t,t,v,r,c*o,l,!1,h)}function i(n,t,u,o,s,h,c,l,a){for(var g,rt=h/2,ut=0,p=0;p<n.length-1;p++)ut+=n[p].dist(n[p+1]);for(var w=0,v=t-u,b=[],y=0;y<n.length-1;y++){for(var k=n[y],d=n[y+1],nt=k.dist(d),et=d.angleTo(k);v+u<w+nt;){v+=u;var ft=(v-w)/nt,tt=r(k.x,d.x,ft),it=r(k.y,d.y,ft);tt>=0&&tt<a&&it>=0&&it<a&&v-rt>=0&&v+rt<=ut&&(g=new f(tt,it,et,y),g._round(),o&&!e(n,g,h,o,s)||b.push(g))}w+=nt}return l||b.length||c||(b=i(n,w/2,u,o,s,h,c,!0,a)),b}var r=n("../style-spec/util/interpolate"),f=n("../symbol/anchor"),e=n("./check_max_angle");t.exports=u},{"../style-spec/util/interpolate":152,"../symbol/anchor":196,"./check_max_angle":197}],203:[function(n,t){"use strict";t.exports=function(n){function v(i){t.push(n[i]);c++}function y(n,i,r){var f=u[n];return delete u[n],u[i]=f,t[f].geometry[0].pop(),t[f].geometry[0]=t[f].geometry[0].concat(r[0]),f}function p(n,i,r){var u=f[i];return delete f[i],f[n]=u,t[u].geometry[0].shift(),t[u].geometry[0]=r[0].concat(t[u].geometry[0]),u}function h(n,t,i){var r=i?t[0][t[0].length-1]:t[0][0];return n+":"+r.x+":"+r.y}for(var i,r,l,a,f={},u={},t=[],c=0,e=0;e<n.length;e++){var w=n[e],o=w.geometry,s=w.text;s?(i=h(s,o),r=h(s,o,!0),i in u&&r in f&&u[i]!==f[r]?(l=p(i,r,o),a=y(i,r,t[l].geometry),delete f[i],delete u[r],u[h(s,t[a].geometry,!0)]=a,t[l].geometry=null):i in u?y(i,r,o):r in f?p(i,r,o):(v(e),f[i]=c-1,u[r]=c-1)):v(e)}return t.filter(function(n){return n.geometry})}},{}],204:[function(n,t){"use strict";function y(n,t,r,u,f){var e=i.identity(new Float32Array(16));return t?(i.identity(e),i.scale(e,e,[1/f,1/f,1]),r||i.rotateZ(e,e,u.angle)):(i.scale(e,e,[u.width/2,-u.height/2,1]),i.translate(e,e,[1,-1,0]),i.multiply(e,e,n)),e}function p(n,t,r,u,f){var e=i.identity(new Float32Array(16));return t?(i.multiply(e,e,n),i.scale(e,e,[f,f,1]),r||i.rotateZ(e,e,-u.angle)):(i.scale(e,e,[1,-1,1]),i.translate(e,e,[-1,-1,0]),i.scale(e,e,[2/u.width,2/u.height,1])),e}function r(n,t){var i=[n.x,n.y,0,1],r;return c.transformMat4(i,i,t),r=i[3],{point:new u(i[0]/r,i[1]/r),signedDistanceFromCamera:r}}function w(n,t,i,r){var u=n[0]/n[3],f=n[1]/n[3];return u>=-i[0]&&u<=i[0]&&f>=-i[1]&&f<=i[1]&&r.frameHistory.isVisible(t)}function b(n,t,i,f,o,h,a,v,y,p){var tt=f?n.textSizeData:n.iconSizeData,ct=l.evaluateSizeForZoom(tt,i.transform,p,f),lt=[512/i.width+1,512/i.height+1],k=f?n.text.dynamicLayoutVertexArray:n.icon.dynamicLayoutVertexArray,b,d;k.clear();for(var it=n.lineVertexArray,rt=f?n.placedGlyphArray:n.placedIconArray,g=0;g<rt.length;g++)if(b=rt.get(g),d=[b.anchorX,b.anchorY,0,1],c.transformMat4(d,d,t),w(d,b.placementZoom,lt,i)){var at=d[3],ut=1+.5*(at/i.transform.cameraToCenterDistance-1),ft=l.evaluateSizeForFeature(tt,ct,b),et=a?ft*ut:ft/ut,nt=new u(b.anchorX,b.anchorY),ot=r(nt,o).point,st={},ht=e(b,et,!1,v,t,o,h,n.glyphOffsetArray,it,k,ot,nt,st);(ht.notEnoughRoom||ht.needsFlipping&&e(b,et,!0,v,t,o,h,n.glyphOffsetArray,it,k,ot,nt,st).notEnoughRoom)&&s(b.numGlyphs,k)}else s(b.numGlyphs,k);f?n.text.dynamicLayoutVertexBuffer.updateData(k.serialize()):n.icon.dynamicLayoutVertexBuffer.updateData(k.serialize())}function e(n,t,i,e,s,h,c,l,v,y,p,w,b){var k,d=t/24,g=n.lineOffsetX*t,nt=n.lineOffsetY*t,tt,et,ot,it,yt,bt,ct,at;if(n.numGlyphs>1){var vt=n.glyphStartIndex+n.numGlyphs,dt=l.get(n.glyphStartIndex).offsetX,gt=l.get(vt-1).offsetX,rt=n.lineStartIndex,ut=n.lineStartIndex+n.lineLength,ft=f(d*dt,g,nt,i,p,w,n.segment,rt,ut,v,h,b);if(!ft)return{notEnoughRoom:!0};if(tt=f(d*gt,g,nt,i,p,w,n.segment,rt,ut,v,h,b),!tt)return{notEnoughRoom:!0};if(et=r(ft.point,c).point,ot=r(tt.point,c).point,e&&!i&&(n.vertical?et.y<ot.y:et.x>ot.x))return{needsFlipping:!0};for(k=[ft],it=n.glyphStartIndex+1;it<vt-1;it++)yt=l.get(it),k.push(f(d*yt.offsetX,g,nt,i,p,w,n.segment,rt,ut,v,h,b));k.push(tt)}else{if(e&&!i){var st=r(w,s).point,ht=v.get(n.lineStartIndex+n.segment+1),pt=r(ht,s),wt=pt.signedDistanceFromCamera>0?pt.point:o(w,new u(ht.x,ht.y),st,1,s);if(n.vertical?wt.y>st.y:wt.x<st.x)return{needsFlipping:!0}}if(bt=l.get(n.glyphStartIndex),ct=f(d*bt.offsetX,g,nt,i,p,w,n.segment,n.lineStartIndex,n.lineStartIndex+n.lineLength,v,h,b),!ct)return{notEnoughRoom:!0};k=[ct]}for(var ni=n.placementZoom,lt=0,kt=k;lt<kt.length;lt+=1)at=kt[lt],a(y,at.point,at.angle,ni);return{}}function o(n,t,i,u,f){var o=r(n.add(n.sub(t)._unit()),f).point,e=i.sub(o);return i.add(e._mult(u/e.mag()))}function f(n,t,i,f,e,s,h,c,l,a,v,y){var rt=f?n-t:n+t,w=rt>0?1:-1,nt=0,it;f&&(w*=-1,nt=Math.PI);w<0&&(nt+=Math.PI);for(var p=w>0?c+h:c+h+1,b=e,k=e,d=0,g=0,tt=Math.abs(rt);d+g<=tt;){if((p+=w)<c||p>=l)return null;(k=b,void 0===(b=y[p]))&&(it=r(a.get(p),v),b=it.signedDistanceFromCamera>0?y[p]=it.point:o(0===d?s:new u(a.get(p-w).x,a.get(p-w).y),new u(a.get(p).x,a.get(p).y),k,tt-d+1,v));d+=g;g=k.dist(b)}var et=(tt-d)/g,ut=b.sub(k),ft=ut.mult(et)._add(k);return ft._add(ut._unit()._perp()._mult(i*w)),{point:ft,angle:nt+Math.atan2(b.y-k.y,b.x-k.x)}}function s(n,t){for(var i=0;i<n;i++)a(t,v,0,25)}var u=n("@mapbox/point-geometry"),h=n("@mapbox/gl-matrix"),i=h.mat4,c=h.vec4,l=n("./symbol_size"),k=n("../data/bucket/symbol_bucket"),a=k.addDynamicAttributes,v;t.exports={updateLineLabels:b,getLabelPlaneMatrix:y,getGlCoordMatrix:p};v=new u(-1/0,-1/0)},{"../data/bucket/symbol_bucket":57,"./symbol_size":207,"@mapbox/gl-matrix":1,"@mapbox/point-geometry":2}],205:[function(n,t){"use strict";function r(n,t,r,u,f,e,o){var a,v,y,p,h=t.image,s=r.layout,nt=t.top-1/h.pixelRatio,tt=t.left-1/h.pixelRatio,it=t.bottom+1/h.pixelRatio,rt=t.right+1/h.pixelRatio,d;if("none"!==s["icon-text-fit"]&&f){var ut=rt-tt,ft=it-nt,w=s["text-size"]/24,c=f.left*w,wt=f.right*w,l=f.top*w,bt=f.bottom*w,et=wt-c,ot=bt-l,st=s["icon-text-fit-padding"][0],ht=s["icon-text-fit-padding"][1],ct=s["icon-text-fit-padding"][2],lt=s["icon-text-fit-padding"][3],b="width"===s["icon-text-fit"]?.5*(ot-ft):0,k="height"===s["icon-text-fit"]?.5*(et-ut):0,at="width"===s["icon-text-fit"]||"both"===s["icon-text-fit"]?et:ut,vt="height"===s["icon-text-fit"]||"both"===s["icon-text-fit"]?ot:ft;a=new i(c+k-lt,l+b-st);v=new i(c+k+ht+at,l+b-st);y=new i(c+k+ht+at,l+b+ct+vt);p=new i(c+k-lt,l+b+ct+vt)}else a=new i(tt,nt),v=new i(rt,nt),y=new i(rt,it),p=new i(tt,it);if(d=r.getLayoutValue("icon-rotate",e,o)*Math.PI/180,d){var yt=Math.sin(d),pt=Math.cos(d),g=[pt,-yt,yt,pt];a._matMult(g);v._matMult(g);p._matMult(g);y._matMult(g)}return[{tl:a,tr:v,bl:p,br:y,tex:{x:h.textureRect.x-1,y:h.textureRect.y-1,w:h.textureRect.w+2,h:h.textureRect.h+2},writingMode:void 0,glyphOffset:[0,0]}]}function u(n,t,r,u,f,o,s){for(var h,c,l,b=r.getLayoutValue("text-rotate",f,o)*Math.PI/180,ut=r.getLayoutValue("text-offset",f,o).map(function(n){return 24*n}),ft=t.positionedGlyphs,et=[],k=0;k<ft.length;k++)if(h=ft[k],c=s[h.glyph],c&&(l=c.rect,l)){var ot=e+1,a=c.metrics.advance/2,vt=u?[h.x+a,h.y]:[0,0],st=u?[0,0]:[h.x+a+ut[0],h.y+ut[1]],d=c.metrics.left-ot-a+st[0],g=-c.metrics.top-ot+st[1],ht=d+l.w,ct=g+l.h,nt=new i(d,g),tt=new i(ht,g),it=new i(d,ct),rt=new i(ht,ct);if(u&&h.vertical){var v=new i(-a,a),y=-Math.PI/2,p=new i(5,0);nt._rotateAround(y,v)._add(p);tt._rotateAround(y,v)._add(p);it._rotateAround(y,v)._add(p);rt._rotateAround(y,v)._add(p)}if(b){var lt=Math.sin(b),at=Math.cos(b),w=[at,-lt,lt,at];nt._matMult(w);tt._matMult(w);it._matMult(w);rt._matMult(w)}et.push({tl:nt,tr:tt,bl:it,br:rt,tex:l,writingMode:t.writingMode,glyphOffset:vt})}return et}var i=n("@mapbox/point-geometry"),f=n("../style/parse_glyph_pbf"),e=f.GLYPH_PBF_BORDER;t.exports={getIconQuads:r,getGlyphQuads:u}},{"../style/parse_glyph_pbf":180,"@mapbox/point-geometry":2}],206:[function(n,t){"use strict";function l(n,t){for(var f,r=[],i=0,u=0,e=t;u<e.length;u+=1)f=e[u],r.push(n.substring(i,f)),i=f;return i<n.length&&r.push(n.substring(i,n.length)),r}function a(n,t,i,r,f,e,o,h,c,a){var v=n.trim();a===u.vertical&&(v=d(v));var y,w=[],b={positionedGlyphs:w,text:v,top:h[1],bottom:h[1],left:h[0],right:h[0],writingMode:a},k=g.processBidirectionalText;return y=k?k(v,s(v,o,i,t)):l(v,s(v,o,i,t)),p(b,t,y,r,f,e,a,o,c),!!w.length&&b}function v(n,t,i,r){for(var e,u=0,f=0;f<n.length;f++)e=r[n.charCodeAt(f)],e&&(u+=e.metrics.advance+t);return u/Math.max(1,Math.ceil(u/i))}function f(n,t,i,r){var u=Math.pow(n-t,2);return r?n<t?u/2:2*u:u+Math.abs(i)*i}function y(n,t){var i=0;return 10===n&&(i-=1e4),40!==n&&65288!==n||(i+=50),41!==t&&65289!==t||(i+=50),i}function e(n,t,i,r,u,e){for(var c=null,o=f(t,i,u,e),s=0,l=r;s<l.length;s+=1){var h=l[s],v=t-h.x,a=f(v,i,u,e)+h.badness;a<=o&&(c=h,o=a)}return{index:n,x:t,priorBreak:c,badness:o}}function o(n){return n?o(n.priorBreak).concat(n.index):[]}function s(n,t,u,f){var h,p;if(!u)return[];if(!n)return[];for(var l=[],w=v(n,t,u,f),a=0,s=0;s<n.length;s++)h=n.charCodeAt(s),p=f[h],p&&!r[h]&&(a+=p.metrics.advance+t),s<n.length-1&&(i[h]||c.charAllowsIdeographicBreaking(h))&&l.push(e(s+1,a,w,l,y(h,n.charCodeAt(s+1)),!1));return o(e(n.length,a,w,l,0,!0))}function h(n){var t=.5,i=.5;switch(n){case"right":case"top-right":case"bottom-right":t=1;break;case"left":case"top-left":case"bottom-left":t=0}switch(n){case"bottom":case"bottom-right":case"bottom-left":i=1;break;case"top":case"top-right":case"top-left":i=0}return{horizontalAlign:t,verticalAlign:i}}function p(n,t,i,r,f,e,o,s,l){for(var y,tt,d,k,it,et,rt,v=0,g=-17,p=0,a=n.positionedGlyphs,ut="right"===e?1:"left"===e?0:.5,nt=0,ft=i;nt<ft.length;nt+=1)if(y=ft[nt],y=y.trim(),y.length){for(tt=a.length,d=0;d<y.length;d++)k=y.charCodeAt(d),it=t[k],it&&(c.charHasUprightVerticalOrientation(k)&&o!==u.horizontal?(a.push({glyph:k,x:v,y:0,vertical:!0}),v+=l+s):(a.push({glyph:k,x:v,y:g,vertical:!1}),v+=it.metrics.advance+s));a.length!==tt&&(et=v-s,p=Math.max(et,p),w(a,t,tt,a.length-1,ut));v=0;g+=r}else g+=r;var ot=h(f),st=ot.horizontalAlign,ht=ot.verticalAlign;b(a,ut,st,ht,p,r,i.length);rt=i.length*r;n.top+=-ht*rt;n.bottom=n.top+rt;n.left+=-st*p;n.right=n.left+p}function w(n,t,i,r,u){var f;if(u&&(f=t[n[r].glyph],f))for(var o=f.metrics.advance,s=(n[r].x+o)*u,e=i;e<=r;e++)n[e].x-=s}function b(n,t,i,r,u,f,e){for(var s=(t-i)*u,h=(-r*e+.5)*f,o=0;o<n.length;o++)n[o].x+=s,n[o].y+=h}function k(n,t,i){var r=h(i),e=r.horizontalAlign,o=r.verticalAlign,s=t[0],c=t[1],u=s-n.displaySize[0]*e,l=u+n.displaySize[0],f=c-n.displaySize[1]*o;return{image:n,top:f,bottom:f+n.displaySize[1],left:u,right:l}}var c=n("../util/script_detection"),d=n("../util/verticalize_punctuation"),g=n("../source/rtl_text_plugin"),u={horizontal:1,vertical:2},r,i;t.exports={shapeText:a,shapeIcon:k,WritingMode:u};r={};r[9]=!0;r[10]=!0;r[11]=!0;r[12]=!0;r[13]=!0;r[32]=!0;i={};i[10]=!0;i[32]=!0;i[38]=!0;i[40]=!0;i[41]=!0;i[43]=!0;i[45]=!0;i[47]=!0;i[173]=!0;i[183]=!0;i[8203]=!0;i[8208]=!0;i[8211]=!0;i[8231]=!0},{"../source/rtl_text_plugin":108,"../util/script_detection":247,"../util/verticalize_punctuation":254}],207:[function(n,t){"use strict";function r(n,t,i){var e=t.getLayoutDeclaration(i),s=!e||e.expression.isFeatureConstant,r,u,f,o;if(!e||e.expression.isZoomConstant)return s?{functionType:"constant",layoutSize:t.getLayoutValue(i,{zoom:n+1})}:{functionType:"source"};for(r=e.expression.zoomStops,u=0;u<r.length&&r[u]<=n;)u++;for(u=Math.max(0,u-1),f=u;f<r.length&&r[f]<n+1;)f++;return f=Math.min(r.length-1,f),o=[r[u],r[f]],s?{functionType:"camera",layoutSize:t.getLayoutValue(i,{zoom:n+1}),coveringZoomRange:o,coveringStopValues:[t.getLayoutValue(i,{zoom:r[u]}),t.getLayoutValue(i,{zoom:r[f]})]}:{functionType:"composite",coveringZoomRange:o}}function u(n,t,i){var r=t;return"source"===n.functionType?i.lowerSize/10:"composite"===n.functionType?e.number(i.lowerSize/10,i.upperSize/10,r.uSizeT):r.uSize}function f(n,t,r,u){var f={},e,o;if("composite"===n.functionType)e=r.getLayoutDeclaration(u?"text-size":"icon-size"),o=e.interpolationFactor(t.zoom,n.coveringZoomRange[0],n.coveringZoomRange[1]),f.uSizeT=i.clamp(o,0,1);else if("camera"===n.functionType){var h=r.getLayoutDeclaration(u?"text-size":"icon-size"),c=h.interpolationFactor(t.zoom,n.coveringZoomRange[0],n.coveringZoomRange[1]),s=n.coveringStopValues[0],l=n.coveringStopValues[1];f.uSize=s+(l-s)*i.clamp(c,0,1)}else"constant"===n.functionType&&(f.uSize=n.layoutSize);return f}var e=n("../style-spec/util/interpolate"),i=n("../util/util");t.exports={getSizeData:r,evaluateSizeForFeature:u,evaluateSizeForZoom:f}},{"../style-spec/util/interpolate":152,"../util/util":252}],208:[function(n,t){"use strict";var i=n("../source/rtl_text_plugin");t.exports=function(n,t,r,u){var f=t.getLayoutValue("text-transform",r,u);return"uppercase"===f?n=n.toLocaleUpperCase():"lowercase"===f&&(n=n.toLocaleLowerCase()),i.applyArabicShaping&&(n=i.applyArabicShaping(n)),n}},{"../source/rtl_text_plugin":108}],209:[function(n,t){"use strict";var i=n("../util/dom"),u=n("@mapbox/point-geometry"),r={scrollZoom:n("./handler/scroll_zoom"),boxZoom:n("./handler/box_zoom"),dragRotate:n("./handler/drag_rotate"),dragPan:n("./handler/drag_pan"),keyboard:n("./handler/keyboard"),doubleClickZoom:n("./handler/dblclick_zoom"),touchZoomRotate:n("./handler/touch_zoom_rotate")};t.exports=function(n,t){function v(n){e("mouseout",n)}function y(t){n.doubleClickZoom.isActive()||n.stop();a=i.mousePos(f,t);e("mousedown",t);l=!0}function p(t){var i=n.dragRotate&&n.dragRotate.isActive();c&&!i&&e("contextmenu",c);c=null;l=!1;e("mouseup",t)}function w(t){if(!(n.dragPan&&n.dragPan.isActive()||n.dragRotate&&n.dragRotate.isActive())){for(var i=t.toElement||t.target;i&&i!==f;)i=i.parentNode;i===f&&e("mousemove",t)}}function b(t){n.stop();h("touchstart",t);!t.touches||t.touches.length>1||(s?(clearTimeout(s),s=null,e("dblclick",t)):s=setTimeout(nt,300))}function k(n){h("touchmove",n)}function d(n){h("touchend",n)}function g(n){h("touchcancel",n)}function nt(){s=null}function tt(n){i.mousePos(f,n).equals(a)&&e("click",n)}function it(n){e("dblclick",n);n.preventDefault()}function rt(t){var i=n.dragRotate&&n.dragRotate.isActive();l||i?l&&(c=t):e("contextmenu",t);t.preventDefault()}function e(t,r){var u=i.mousePos(f,r);return n.fire(t,{lngLat:n.unproject(u),point:u,originalEvent:r})}function h(t,r){var e=i.touchPos(f,r),o=e.reduce(function(n,t,i,r){return n.add(t.div(r.length))},new u(0,0));return n.fire(t,{lngLat:n.unproject(o),point:o,lngLats:e.map(function(t){return n.unproject(t)},this),points:e,originalEvent:r})}var f=n.getCanvasContainer(),c=null,l=!1,a=null,s=null,o;for(o in r)n[o]=new r[o](n,t),t.interactive&&t[o]&&n[o].enable(t[o]);f.addEventListener("mouseout",v,!1);f.addEventListener("mousedown",y,!1);f.addEventListener("mouseup",p,!1);f.addEventListener("mousemove",w,!1);f.addEventListener("touchstart",b,!1);f.addEventListener("touchend",d,!1);f.addEventListener("touchmove",k,!1);f.addEventListener("touchcancel",g,!1);f.addEventListener("click",tt,!1);f.addEventListener("dblclick",it,!1);f.addEventListener("contextmenu",rt,!1)}},{"../util/dom":238,"./handler/box_zoom":218,"./handler/dblclick_zoom":219,"./handler/drag_pan":220,"./handler/drag_rotate":221,"./handler/keyboard":222,"./handler/scroll_zoom":223,"./handler/touch_zoom_rotate":224,"@mapbox/point-geometry":2}],210:[function(n,t){"use strict";var i=n("../util/util"),r=n("../style-spec/util/interpolate"),e=n("../util/browser"),u=n("../geo/lng_lat"),o=n("../geo/lng_lat_bounds"),f=n("@mapbox/point-geometry"),s=n("../util/evented"),h=function(n){function t(t,i){n.call(this);this.moving=!1;this.transform=t;this._bearingSnap=i.bearingSnap}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.getCenter=function(){return this.transform.center},t.prototype.setCenter=function(n,t){return this.jumpTo({center:n},t)},t.prototype.panBy=function(n,t,r){return n=f.convert(n).mult(-1),this.panTo(this.transform.center,i.extend({offset:n},t),r)},t.prototype.panTo=function(n,t,r){return this.easeTo(i.extend({center:n},t),r)},t.prototype.getZoom=function(){return this.transform.zoom},t.prototype.setZoom=function(n,t){return this.jumpTo({zoom:n},t),this},t.prototype.zoomTo=function(n,t,r){return this.easeTo(i.extend({zoom:n},t),r)},t.prototype.zoomIn=function(n,t){return this.zoomTo(this.getZoom()+1,n,t),this},t.prototype.zoomOut=function(n,t){return this.zoomTo(this.getZoom()-1,n,t),this},t.prototype.getBearing=function(){return this.transform.bearing},t.prototype.setBearing=function(n,t){return this.jumpTo({bearing:n},t),this},t.prototype.rotateTo=function(n,t,r){return this.easeTo(i.extend({bearing:n},t),r)},t.prototype.resetNorth=function(n,t){return this.rotateTo(0,i.extend({duration:1e3},n),t),this},t.prototype.snapToNorth=function(n,t){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(n,t):this},t.prototype.getPitch=function(){return this.transform.pitch},t.prototype.setPitch=function(n,t){return this.jumpTo({pitch:n},t),this},t.prototype.fitBounds=function(n,t,r){var e;if((t=i.extend({padding:{top:0,bottom:0,right:0,left:0},offset:[0,0],maxZoom:this.transform.maxZoom},t),"number"==typeof t.padding)&&(e=t.padding,t.padding={top:e,bottom:e,right:e,left:e}),!i.deepEqual(Object.keys(t.padding).sort(function(n,t){return n<t?-1:n>t?1:0}),["bottom","left","right","top"]))return i.warnOnce("options.padding must be a positive number, or an Object with keys 'bottom', 'left', 'right', 'top'"),this;n=o.convert(n);var s=[t.padding.left-t.padding.right,t.padding.top-t.padding.bottom],p=Math.min(t.padding.right,t.padding.left),w=Math.min(t.padding.top,t.padding.bottom);t.offset=[t.offset[0]+s[0],t.offset[1]+s[1]];var h=f.convert(t.offset),u=this.transform,c=u.project(n.getNorthWest()),l=u.project(n.getSouthEast()),a=l.sub(c),v=(u.width-2*p-2*Math.abs(h.x))/a.x,y=(u.height-2*w-2*Math.abs(h.y))/a.y;return y<0||v<0?(i.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset."),this):(t.center=u.unproject(c.add(l).div(2)),t.zoom=Math.min(u.scaleZoom(u.scale*Math.min(v,y)),t.maxZoom),t.bearing=0,t.linear?this.easeTo(t,r):this.flyTo(t,r))},t.prototype.jumpTo=function(n,t){this.stop();var i=this.transform,r=!1,f=!1,e=!1;return"zoom"in n&&i.zoom!==+n.zoom&&(r=!0,i.zoom=+n.zoom),void 0!==n.center&&(i.center=u.convert(n.center)),"bearing"in n&&i.bearing!==+n.bearing&&(f=!0,i.bearing=+n.bearing),"pitch"in n&&i.pitch!==+n.pitch&&(e=!0,i.pitch=+n.pitch),this.fire("movestart",t).fire("move",t),r&&this.fire("zoomstart",t).fire("zoom",t).fire("zoomend",t),f&&this.fire("rotate",t),e&&this.fire("pitchstart",t).fire("pitch",t).fire("pitchend",t),this.fire("moveend",t)},t.prototype.easeTo=function(n,t){var l=this;this.stop();n=i.extend({offset:[0,0],duration:500,easing:i.ease},n);!1===n.animate&&(n.duration=0);n.smoothEasing&&0!==n.duration&&(n.easing=this._smoothOutEasing(n.duration));var e=this.transform,o=this.getZoom(),s=this.getBearing(),a=this.getPitch(),h="zoom"in n?+n.zoom:o,v="bearing"in n?this._normalizeBearing(n.bearing,s):s,y="pitch"in n?+n.pitch:a,p=e.centerPoint.add(f.convert(n.offset)),w=e.pointLocation(p),b=u.convert(n.center||w);this._normalizeCenter(b);var c,k,d=e.project(w),nt=e.project(b).sub(d),g=e.zoomScale(h-o);return n.around&&(c=u.convert(n.around),k=e.locationPoint(c)),this.zooming=h!==o,this.rotating=s!==v,this.pitching=y!==a,this._prepareEase(t,n.noMoveStart),clearTimeout(this._onEaseEnd),this._ease(function(n){if(this.zooming&&(e.zoom=r(o,h,n)),this.rotating&&(e.bearing=r(s,v,n)),this.pitching&&(e.pitch=r(a,y,n)),c)e.setLocationAtPoint(c,k);else{var u=e.zoomScale(e.zoom-o),f=h>o?Math.min(2,g):Math.max(.5,g),l=Math.pow(f,1-n),i=e.unproject(d.add(nt.mult(n*l)).mult(u));e.setLocationAtPoint(e.renderWorldCopies?i.wrap():i,p)}this._fireMoveEvents(t)},function(){n.delayEndEvents?l._onEaseEnd=setTimeout(function(){return l._easeToEnd(t)},n.delayEndEvents):l._easeToEnd(t)},n),this},t.prototype._prepareEase=function(n,t){this.moving=!0;t||this.fire("movestart",n);this.zooming&&this.fire("zoomstart",n);this.pitching&&this.fire("pitchstart",n)},t.prototype._fireMoveEvents=function(n){this.fire("move",n);this.zooming&&this.fire("zoom",n);this.rotating&&this.fire("rotate",n);this.pitching&&this.fire("pitch",n)},t.prototype._easeToEnd=function(n){var t=this.zooming,i=this.pitching;this.moving=!1;this.zooming=!1;this.rotating=!1;this.pitching=!1;t&&this.fire("zoomend",n);i&&this.fire("pitchend",n);this.fire("moveend",n)},t.prototype.flyTo=function(n,t){function k(n){var t=(h*h-s*s+(n?-1:1)*p*p*c*c)/(2*(n?h:s)*p*c);return Math.log(Math.sqrt(t*t+1)-t)}function d(n){return(Math.exp(n)-Math.exp(-n))/2}function v(n){return(Math.exp(n)+Math.exp(-n))/2}function vt(n){return d(n)/v(n)}var yt=this,ot,st,lt,at;this.stop();n=i.extend({offset:[0,0],speed:1.2,curve:1.42,easing:i.ease},n);var e=this.transform,a=this.getZoom(),y=this.getBearing(),b=this.getPitch(),g="zoom"in n?i.clamp(+n.zoom,e.minZoom,e.maxZoom):a,nt="bearing"in n?this._normalizeBearing(n.bearing,y):y,tt="pitch"in n?+n.pitch:b,pt=e.zoomScale(g-a),it=e.centerPoint.add(f.convert(n.offset)),rt=e.pointLocation(it),ut=u.convert(n.center||rt);this._normalizeCenter(ut);var ft=e.project(rt),et=e.project(ut).sub(ft),o=n.curve,s=Math.max(e.width,e.height),h=s/pt,c=et.mag();"minZoom"in n&&(ot=i.clamp(Math.min(n.minZoom,a,g),e.minZoom,e.maxZoom),st=s/e.zoomScale(ot-a),o=Math.sqrt(st/c*2));var p=o*o,l=k(0),ht=function(n){return v(l)/v(l+o*n)},ct=function(n){return s*((v(l)*vt(l+o*n)-d(l))/p)/c},w=(k(1)-l)/o;if(Math.abs(c)<1e-6||!isFinite(w)){if(Math.abs(s-h)<1e-6)return this.easeTo(n,t);lt=h<s?-1:1;w=Math.abs(Math.log(h/s))/o;ct=function(){return 0};ht=function(n){return Math.exp(lt*o*n)}}return"duration"in n?n.duration=+n.duration:(at="screenSpeed"in n?+n.screenSpeed/o:+n.speed,n.duration=1e3*w/at),n.maxDuration&&n.duration>n.maxDuration&&(n.duration=0),this.zooming=!0,this.rotating=y!==nt,this.pitching=tt!==b,this._prepareEase(t,!1),this._ease(function(n){var u=n*w,f=1/ht(u),i;e.zoom=a+e.scaleZoom(f);this.rotating&&(e.bearing=r(y,nt,n));this.pitching&&(e.pitch=r(b,tt,n));i=e.unproject(ft.add(et.mult(ct(u))).mult(f));e.setLocationAtPoint(e.renderWorldCopies?i.wrap():i,it);this._fireMoveEvents(t)},function(){return yt._easeToEnd(t)},n),this},t.prototype.isEasing=function(){return!!this._abortFn},t.prototype.isMoving=function(){return this.moving},t.prototype.stop=function(){return this._abortFn&&(this._abortFn(),this._finishEase()),this},t.prototype._ease=function(n,t,i){this._finishFn=t;this._abortFn=e.timed(function(t){n.call(this,i.easing(t));1===t&&this._finishEase()},!1===i.animate?0:i.duration,this)},t.prototype._finishEase=function(){delete this._abortFn;var n=this._finishFn;delete this._finishFn;n.call(this)},t.prototype._normalizeBearing=function(n,t){n=i.wrap(n,-180,180);var r=Math.abs(n-t);return Math.abs(n-360-t)<r&&(n-=360),Math.abs(n+360-t)<r&&(n+=360),n},t.prototype._normalizeCenter=function(n){var t=this.transform,i;t.renderWorldCopies&&!t.lngRange&&(i=n.lng-t.center.lng,n.lng+=i>180?-360:i<-180?360:0)},t.prototype._smoothOutEasing=function(n){var r=i.ease;if(this._prevEase){var t=this._prevEase,f=(Date.now()-t.start)/t.duration,e=t.easing(f+.01)-t.easing(f),u=.27/Math.sqrt(e*e+.0001)*.01,o=Math.sqrt(.0729-u*u);r=i.bezier(u,o,.25,1)}return this._prevEase={start:(new Date).getTime(),duration:n,easing:r},r},t}(s);t.exports=h},{"../geo/lng_lat":68,"../geo/lng_lat_bounds":69,"../style-spec/util/interpolate":152,"../util/browser":231,"../util/evented":239,"../util/util":252,"@mapbox/point-geometry":2}],211:[function(n,t){"use strict";var r=n("../../util/dom"),u=n("../../util/util"),f=n("../../util/config"),i=function(n){this.options=n;u.bindAll(["_updateEditLink","_updateData","_updateCompact"],this)};i.prototype.getDefaultPosition=function(){return"bottom-right"};i.prototype.onAdd=function(n){var t=this.options&&this.options.compact;return this._map=n,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),t&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===t&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container};i.prototype.onRemove=function(){r.remove(this._container);this._map.off("sourcedata",this._updateData);this._map.off("moveend",this._updateEditLink);this._map.off("resize",this._updateCompact);this._map=void 0};i.prototype._updateEditLink=function(){var n=this._editLink,t,i;n||(n=this._editLink=this._container.querySelector(".mapbox-improve-map"));t=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:f.ACCESS_TOKEN}];n&&(i=t.reduce(function(n,i,r){return i.value&&(n+=i.key+"="+i.value+(r<t.length-1?"&":"")),n},"?"),n.href="https://www.mapbox.com/feedback/"+i+(this._map._hash?this._map._hash.getHashString(!0):""))};i.prototype._updateData=function(n){n&&"metadata"===n.sourceDataType&&(this._updateAttributions(),this._updateEditLink())};i.prototype._updateAttributions=function(){var n,i,r,u,t;if(this._map.style){n=[];this._map.style.stylesheet&&(i=this._map.style.stylesheet,this.styleOwner=i.owner,this.styleId=i.id);r=this._map.style.sourceCaches;for(u in r)t=r[u].getSource(),t.attribution&&n.indexOf(t.attribution)<0&&n.push(t.attribution);n.sort(function(n,t){return n.length-t.length});n=n.filter(function(t,i){for(var r=i+1;r<n.length;r++)if(n[r].indexOf(t)>=0)return!1;return!0});this._container.innerHTML=n.join(" | ");this._editLink=null}};i.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact")};t.exports=i},{"../../util/config":235,"../../util/dom":238,"../../util/util":252}],212:[function(n,t){"use strict";var u=n("../../util/dom"),f=n("../../util/util"),i=n("../../util/window"),r=function(){this._fullscreen=!1;f.bindAll(["_onClickFullscreen","_changeIcon"],this);"onfullscreenchange"in i.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in i.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in i.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in i.document&&(this._fullscreenchange="MSFullscreenChange");this._className="mapboxgl-ctrl"};r.prototype.onAdd=function(n){return this._map=n,this._mapContainer=this._map.getContainer(),this._container=u.create("div",this._className+" mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._container.style.display="none",f.warnOnce("This device does not support fullscreen mode.")),this._container};r.prototype.onRemove=function(){u.remove(this._container);this._map=null;i.document.removeEventListener(this._fullscreenchange,this._changeIcon)};r.prototype._checkFullscreenSupport=function(){return!!(i.document.fullscreenEnabled||i.document.mozFullScreenEnabled||i.document.msFullscreenEnabled||i.document.webkitFullscreenEnabled)};r.prototype._setupUI=function(){var n=this._fullscreenButton=u.create("button",this._className+"-icon "+this._className+"-fullscreen",this._container);n.setAttribute("aria-label","Toggle fullscreen");n.type="button";this._fullscreenButton.addEventListener("click",this._onClickFullscreen);i.document.addEventListener(this._fullscreenchange,this._changeIcon)};r.prototype._isFullscreen=function(){return this._fullscreen};r.prototype._changeIcon=function(){(i.document.fullscreenElement||i.document.mozFullScreenElement||i.document.webkitFullscreenElement||i.document.msFullscreenElement)===this._mapContainer!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle(this._className+"-shrink"),this._fullscreenButton.classList.toggle(this._className+"-fullscreen"))};r.prototype._onClickFullscreen=function(){this._isFullscreen()?i.document.exitFullscreen?i.document.exitFullscreen():i.document.mozCancelFullScreen?i.document.mozCancelFullScreen():i.document.msExitFullscreen?i.document.msExitFullscreen():i.document.webkitCancelFullScreen&&i.document.webkitCancelFullScreen():this._mapContainer.requestFullscreen?this._mapContainer.requestFullscreen():this._mapContainer.mozRequestFullScreen?this._mapContainer.mozRequestFullScreen():this._mapContainer.msRequestFullscreen?this._mapContainer.msRequestFullscreen():this._mapContainer.webkitRequestFullscreen&&this._mapContainer.webkitRequestFullscreen()};t.exports=r},{"../../util/dom":238,"../../util/util":252,"../../util/window":233}],213:[function(n,t){"use strict";function o(n){void 0!==r?n(r):void 0!==i.navigator.permissions?i.navigator.permissions.query({name:"geolocation"}).then(function(t){r="denied"!==t.state;n(r)}):(r=!!i.navigator.geolocation,n(r))}var s=n("../../util/evented"),u=n("../../util/dom"),i=n("../../util/window"),e=n("../../util/util"),h=n("../../geo/lng_lat"),c=n("../marker"),l={positionOptions:{enableHighAccuracy:!1,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showUserLocation:!0},f="mapboxgl-ctrl",r,a=function(n){function t(t){n.call(this);this.options=e.extend({},l,t);e.bindAll(["_onSuccess","_onError","_finish","_setupUI","_updateCamera","_updateMarker","_onClickGeolocate"],this)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.onAdd=function(n){return this._map=n,this._container=u.create("div",f+" "+f+"-group"),o(this._setupUI),this._container},t.prototype.onRemove=function(){void 0!==this._geolocationWatchID&&(i.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0);this.options.showUserLocation&&this._userLocationDotMarker.remove();u.remove(this._container);this._map=void 0},t.prototype._onSuccess=function(n){if(this.options.trackUserLocation)switch(this._lastKnownPosition=n,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK";this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting");this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error");this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND";this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting");this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error");this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(n);this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(n);this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale");this.fire("geolocate",n);this._finish()},t.prototype._updateCamera=function(n){var t=new h(n.coords.longitude,n.coords.latitude),i=n.coords.accuracy;this._map.fitBounds(t.toBounds(i),this.options.fitBoundsOptions,{geolocateSource:!0})},t.prototype._updateMarker=function(n){n?this._userLocationDotMarker.setLngLat([n.coords.longitude,n.coords.latitude]).addTo(this._map):this._userLocationDotMarker.remove()},t.prototype._onError=function(n){if(this.options.trackUserLocation)if(1===n.code)this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),void 0!==this._geolocationWatchID&&this._clearWatch();else switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR";this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active");this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR";this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active");this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR";this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background");this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error");this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale");this.fire("error",n);this._finish()},t.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId);this._timeoutId=void 0},t.prototype._setupUI=function(n){var t=this;!1!==n&&(this._container.addEventListener("contextmenu",function(n){return n.preventDefault()}),this._geolocateButton=u.create("button",f+"-icon "+f+"-geolocate",this._container),this._geolocateButton.type="button",this._geolocateButton.setAttribute("aria-label","Geolocate"),this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=u.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new c(this._dotElement),this.options.trackUserLocation&&(this._watchState="OFF")),this._geolocateButton.addEventListener("click",this._onClickGeolocate.bind(this)),this.options.trackUserLocation&&this._map.on("movestart",function(n){n.geolocateSource||"ACTIVE_LOCK"!==t._watchState||(t._watchState="BACKGROUND",t._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),t._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),t.fire("trackuserlocationend"))}))},t.prototype._onClickGeolocate=function(){if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE";this.fire("trackuserlocationstart");break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._watchState="OFF";this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting");this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active");this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error");this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background");this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error");this.fire("trackuserlocationend");break;case"BACKGROUND":this._watchState="ACTIVE_LOCK";this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background");this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition);this.fire("trackuserlocationstart")}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}"OFF"===this._watchState&&void 0!==this._geolocationWatchID?this._clearWatch():void 0===this._geolocationWatchID&&(this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._geolocationWatchID=i.navigator.geolocation.watchPosition(this._onSuccess,this._onError,this.options.positionOptions))}else i.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4)},t.prototype._clearWatch=function(){i.navigator.geolocation.clearWatch(this._geolocationWatchID);this._geolocationWatchID=void 0;this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting");this._geolocateButton.setAttribute("aria-pressed","false");this.options.showUserLocation&&this._updateMarker(null)},t}(s);t.exports=a},{"../../geo/lng_lat":68,"../../util/dom":238,"../../util/evented":239,"../../util/util":252,"../../util/window":233,"../marker":227}],214:[function(n,t){"use strict";var r=n("../../util/dom"),u=n("../../util/util"),i=function(){u.bindAll(["_updateLogo"],this)};i.prototype.onAdd=function(n){this._map=n;this._container=r.create("div","mapboxgl-ctrl");var t=r.create("a","mapboxgl-ctrl-logo");return t.target="_blank",t.href="https://www.mapbox.com/",t.setAttribute("aria-label","Mapbox logo"),this._container.appendChild(t),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._container};i.prototype.onRemove=function(){r.remove(this._container);this._map.off("sourcedata",this._updateLogo)};i.prototype.getDefaultPosition=function(){return"bottom-left"};i.prototype._updateLogo=function(n){n&&"metadata"!==n.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")};i.prototype._logoRequired=function(){var n,t;if(this._map.style){n=this._map.style.sourceCaches;for(t in n)if(n[t].getSource().mapbox_logo)return!0;return!1}};t.exports=i},{"../../util/dom":238,"../../util/util":252}],215:[function(n,t){"use strict";var r=n("../../util/dom"),u=n("../../util/util"),f=n("../handler/drag_rotate"),i=function(){var n=this;u.bindAll(["_rotateCompassArrow"],this);this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group");this._container.addEventListener("contextmenu",function(n){return n.preventDefault()});this._zoomInButton=this._createButton("mapboxgl-ctrl-icon mapboxgl-ctrl-zoom-in","Zoom In",function(){return n._map.zoomIn()});this._zoomOutButton=this._createButton("mapboxgl-ctrl-icon mapboxgl-ctrl-zoom-out","Zoom Out",function(){return n._map.zoomOut()});this._compass=this._createButton("mapboxgl-ctrl-icon mapboxgl-ctrl-compass","Reset North",function(){return n._map.resetNorth()});this._compassArrow=r.create("span","mapboxgl-ctrl-compass-arrow",this._compass)};i.prototype._rotateCompassArrow=function(){var n="rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassArrow.style.transform=n};i.prototype.onAdd=function(n){return this._map=n,this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new f(n,{button:"left",element:this._compass,pitchWithRotate:!1}),this._handler.enable(),this._container};i.prototype.onRemove=function(){r.remove(this._container);this._map.off("rotate",this._rotateCompassArrow);delete this._map;this._handler.disable();delete this._handler};i.prototype._createButton=function(n,t,i){var u=r.create("button",n,this._container);return u.type="button",u.setAttribute("aria-label",t),u.addEventListener("click",i),u};t.exports=i},{"../../util/dom":238,"../../util/util":252,"../handler/drag_rotate":221}],216:[function(n,t){"use strict";function f(n,t,i){var u=i&&i.maxWidth||100,s=n._container.clientHeight/2,o=e(n.unproject([0,s]),n.unproject([u,s])),f,h;i&&"imperial"===i.unit?(f=3.2808*o,f>5280?r(t,u,f/5280,"mi"):r(t,u,f,"ft")):i&&"nautical"===i.unit?(h=o/1852,r(t,u,h,"nm")):r(t,u,o,"m")}function r(n,t,i,r){var u=o(i),f=u/i;"m"===r&&u>=1e3&&(u/=1e3,r="km");n.style.width=t*f+"px";n.innerHTML=u+r}function e(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 6371e3*Math.acos(Math.min(f,1))}function o(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}var u=n("../../util/dom"),s=n("../../util/util"),i=function(n){this.options=n;s.bindAll(["_onMove"],this)};i.prototype.getDefaultPosition=function(){return"bottom-left"};i.prototype._onMove=function(){f(this._map,this._container,this.options)};i.prototype.onAdd=function(n){return this._map=n,this._container=u.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",n.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container};i.prototype.onRemove=function(){u.remove(this._container);this._map.off("move",this._onMove);this._map=void 0};t.exports=i},{"../../util/dom":238,"../../util/util":252}],217:[function(){"use strict"},{}],218:[function(n,t){"use strict";var r=n("../../util/dom"),f=n("../../geo/lng_lat_bounds"),e=n("../../util/util"),u=n("../../util/window"),i=function(n){this._map=n;this._el=n.getCanvasContainer();this._container=n.getContainer();e.bindAll(["_onMouseDown","_onMouseMove","_onMouseUp","_onKeyDown"],this)};i.prototype.isEnabled=function(){return!!this._enabled};i.prototype.isActive=function(){return!!this._active};i.prototype.enable=function(){this.isEnabled()||(this._map.dragPan&&this._map.dragPan.disable(),this._el.addEventListener("mousedown",this._onMouseDown,!1),this._map.dragPan&&this._map.dragPan.enable(),this._enabled=!0)};i.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onMouseDown),this._enabled=!1)};i.prototype._onMouseDown=function(n){n.shiftKey&&0===n.button&&(u.document.addEventListener("mousemove",this._onMouseMove,!1),u.document.addEventListener("keydown",this._onKeyDown,!1),u.document.addEventListener("mouseup",this._onMouseUp,!1),r.disableDrag(),this._startPos=r.mousePos(this._el,n),this._active=!0)};i.prototype._onMouseMove=function(n){var t=this._startPos,i=r.mousePos(this._el,n);this._box||(this._box=r.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",n));var u=Math.min(t.x,i.x),e=Math.max(t.x,i.x),f=Math.min(t.y,i.y),o=Math.max(t.y,i.y);r.setTransform(this._box,"translate("+u+"px,"+f+"px)");this._box.style.width=e-u+"px";this._box.style.height=o-f+"px"};i.prototype._onMouseUp=function(n){if(0===n.button){var t=this._startPos,i=r.mousePos(this._el,n),u=(new f).extend(this._map.unproject(t)).extend(this._map.unproject(i));this._finish();t.x===i.x&&t.y===i.y?this._fireEvent("boxzoomcancel",n):this._map.fitBounds(u,{linear:!0}).fire("boxzoomend",{originalEvent:n,boxZoomBounds:u})}};i.prototype._onKeyDown=function(n){27===n.keyCode&&(this._finish(),this._fireEvent("boxzoomcancel",n))};i.prototype._finish=function(){this._active=!1;u.document.removeEventListener("mousemove",this._onMouseMove,!1);u.document.removeEventListener("keydown",this._onKeyDown,!1);u.document.removeEventListener("mouseup",this._onMouseUp,!1);this._container.classList.remove("mapboxgl-crosshair");this._box&&(r.remove(this._box),this._box=null);r.enableDrag()};i.prototype._fireEvent=function(n,t){return this._map.fire(n,{originalEvent:t})};t.exports=i},{"../../geo/lng_lat_bounds":69,"../../util/dom":238,"../../util/util":252,"../../util/window":233}],219:[function(n,t){"use strict";var r=n("../../util/util"),i=function(n){this._map=n;r.bindAll(["_onDblClick","_onZoomEnd"],this)};i.prototype.isEnabled=function(){return!!this._enabled};i.prototype.isActive=function(){return!!this._active};i.prototype.enable=function(){this.isEnabled()||(this._map.on("dblclick",this._onDblClick),this._enabled=!0)};i.prototype.disable=function(){this.isEnabled()&&(this._map.off("dblclick",this._onDblClick),this._enabled=!1)};i.prototype._onDblClick=function(n){this._active=!0;this._map.on("zoomend",this._onZoomEnd);this._map.zoomTo(this._map.getZoom()+(n.originalEvent.shiftKey?-1:1),{around:n.lngLat},n)};i.prototype._onZoomEnd=function(){this._active=!1;this._map.off("zoomend",this._onZoomEnd)};t.exports=i},{"../../util/util":252}],220:[function(n,t){"use strict";var f=n("../../util/dom"),e=n("../../util/util"),r=n("../../util/window"),u=.3,s=e.bezier(0,0,u,1),o=1400,h=2500,i=function(n){this._map=n;this._el=n.getCanvasContainer();e.bindAll(["_onDown","_onMove","_onUp","_onTouchEnd","_onMouseUp"],this)};i.prototype.isEnabled=function(){return!!this._enabled};i.prototype.isActive=function(){return!!this._active};i.prototype.enable=function(){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-drag-pan"),this._el.addEventListener("mousedown",this._onDown),this._el.addEventListener("touchstart",this._onDown),this._enabled=!0)};i.prototype.disable=function(){this.isEnabled()&&(this._el.classList.remove("mapboxgl-touch-drag-pan"),this._el.removeEventListener("mousedown",this._onDown),this._el.removeEventListener("touchstart",this._onDown),this._enabled=!1)};i.prototype._onDown=function(n){this._ignoreEvent(n)||this.isActive()||(n.touches?(r.document.addEventListener("touchmove",this._onMove),r.document.addEventListener("touchend",this._onTouchEnd)):(r.document.addEventListener("mousemove",this._onMove),r.document.addEventListener("mouseup",this._onMouseUp)),r.addEventListener("blur",this._onMouseUp),this._active=!1,this._startPos=this._pos=f.mousePos(this._el,n),this._inertia=[[Date.now(),this._pos]])};i.prototype._onMove=function(n){if(!this._ignoreEvent(n)){this.isActive()||(this._active=!0,this._map.moving=!0,this._fireEvent("dragstart",n),this._fireEvent("movestart",n));var t=f.mousePos(this._el,n),i=this._map;i.stop();this._drainInertiaBuffer();this._inertia.push([Date.now(),t]);i.transform.setLocationAtPoint(i.transform.pointLocation(this._pos),t);this._fireEvent("drag",n);this._fireEvent("move",n);this._pos=t;n.preventDefault()}};i.prototype._onUp=function(n){var a=this,f,t,r,i,l,y;if(this.isActive()){if(this._active=!1,this._fireEvent("dragend",n),this._drainInertiaBuffer(),f=function(){a._map.moving=!1;a._fireEvent("moveend",n)},t=this._inertia,t.length<2)return void f();var e=t[t.length-1],c=t[0],p=e[1].sub(c[1]),v=(e[0]-c[0])/1e3;if(0===v||e[1].equals(c[1]))return void f();r=p.mult(u/v);i=r.mag();i>o&&(i=o,r._unit()._mult(i));l=i/(h*u);y=r.mult(-l/2);this._map.panBy(y,{duration:1e3*l,easing:s,noMoveStart:!0},{originalEvent:n})}};i.prototype._onMouseUp=function(n){this._ignoreEvent(n)||(this._onUp(n),r.document.removeEventListener("mousemove",this._onMove),r.document.removeEventListener("mouseup",this._onMouseUp),r.removeEventListener("blur",this._onMouseUp))};i.prototype._onTouchEnd=function(n){this._ignoreEvent(n)||(this._onUp(n),r.document.removeEventListener("touchmove",this._onMove),r.document.removeEventListener("touchend",this._onTouchEnd))};i.prototype._fireEvent=function(n,t){return this._map.fire(n,{originalEvent:t})};i.prototype._ignoreEvent=function(n){var t=this._map;return!(!t.boxZoom||!t.boxZoom.isActive())||!(!t.dragRotate||!t.dragRotate.isActive())||(n.touches?n.touches.length>1:!!n.ctrlKey||"mousemove"!==n.type&&n.button&&0!==n.button)};i.prototype._drainInertiaBuffer=function(){for(var n=this._inertia,t=Date.now();n.length>0&&t-n[0][0]>160;)n.shift()};t.exports=i},{"../../util/dom":238,"../../util/util":252,"../../util/window":233}],221:[function(n,t){"use strict";var u=n("../../util/dom"),e=n("../../util/util"),r=n("../../util/window"),f=.25,s=e.bezier(0,0,f,1),o=180,h=720,i=function(n,t){this._map=n;this._el=t.element||n.getCanvasContainer();this._button=t.button||"right";this._bearingSnap=t.bearingSnap||0;this._pitchWithRotate=!1!==t.pitchWithRotate;e.bindAll(["_onDown","_onMove","_onUp"],this)};i.prototype.isEnabled=function(){return!!this._enabled};i.prototype.isActive=function(){return!!this._active};i.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onDown),this._enabled=!0)};i.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onDown),this._enabled=!1)};i.prototype._onDown=function(n){if(!(this._map.boxZoom&&this._map.boxZoom.isActive()||this._map.dragPan&&this._map.dragPan.isActive()||this.isActive())){if("right"===this._button){var i=n.ctrlKey?0:2,t=n.button;if(void 0!==r.InstallTrigger&&2===n.button&&n.ctrlKey&&r.navigator.platform.toUpperCase().indexOf("MAC")>=0&&(t=0),t!==i)return}else if(n.ctrlKey||0!==n.button)return;u.disableDrag();r.document.addEventListener("mousemove",this._onMove,{capture:!0});r.document.addEventListener("mouseup",this._onUp);r.addEventListener("blur",this._onUp);this._active=!1;this._inertia=[[Date.now(),this._map.getBearing()]];this._startPos=this._pos=u.mousePos(this._el,n);this._center=this._map.transform.centerPoint;n.preventDefault()}};i.prototype._onMove=function(n){var t;this.isActive()||(this._active=!0,this._map.moving=!0,this._fireEvent("rotatestart",n),this._fireEvent("movestart",n),this._pitchWithRotate&&this._fireEvent("pitchstart",n));t=this._map;t.stop();var f=this._pos,i=u.mousePos(this._el,n),o=.8*(f.x-i.x),s=-.5*(f.y-i.y),e=t.getBearing()-o,h=t.getPitch()-s,r=this._inertia,c=r[r.length-1];this._drainInertiaBuffer();r.push([Date.now(),t._normalizeBearing(e,c[1])]);t.transform.bearing=e;this._pitchWithRotate&&(this._fireEvent("pitch",n),t.transform.pitch=h);this._fireEvent("rotate",n);this._fireEvent("move",n);this._pos=i};i.prototype._onUp=function(n){var e=this,l,v;if(r.document.removeEventListener("mousemove",this._onMove,{capture:!0}),r.document.removeEventListener("mouseup",this._onUp),r.removeEventListener("blur",this._onUp),u.enableDrag(),this.isActive()){this._active=!1;this._fireEvent("rotateend",n);this._drainInertiaBuffer();var t=this._map,y=t.getBearing(),i=this._inertia,p=function(){Math.abs(y)<e._bearingSnap?t.resetNorth({noMoveStart:!0},{originalEvent:n}):(e._map.moving=!1,e._fireEvent("moveend",n));e._pitchWithRotate&&e._fireEvent("pitchend",n)};if(i.length<2)return void p();var w=i[0],b=i[i.length-1],d=i[i.length-2],c=t._normalizeBearing(y,d[1]),a=b[1]-w[1],g=a<0?-1:1,k=(b[0]-w[0])/1e3;if(0===a||0===k)return void p();l=Math.abs(a*(f/k));l>o&&(l=o);v=l/(h*f);c+=g*l*(v/2);Math.abs(t._normalizeBearing(c,0))<this._bearingSnap&&(c=t._normalizeBearing(0,c));t.rotateTo(c,{duration:1e3*v,easing:s,noMoveStart:!0},{originalEvent:n})}};i.prototype._fireEvent=function(n,t){return this._map.fire(n,{originalEvent:t})};i.prototype._drainInertiaBuffer=function(){for(var n=this._inertia,t=Date.now();n.length>0&&t-n[0][0]>160;)n.shift()};t.exports=i},{"../../util/dom":238,"../../util/util":252,"../../util/window":233}],222:[function(n,t){"use strict";function u(n){return n*(2-n)}var f=n("../../util/util"),r=100,e=15,o=10,i=function(n){this._map=n;this._el=n.getCanvasContainer();f.bindAll(["_onKeyDown"],this)};i.prototype.isEnabled=function(){return!!this._enabled};i.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("keydown",this._onKeyDown,!1),this._enabled=!0)};i.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("keydown",this._onKeyDown),this._enabled=!1)};i.prototype._onKeyDown=function(n){if(!(n.altKey||n.ctrlKey||n.metaKey)){var i=0,f=0,s=0,h=0,c=0;switch(n.keyCode){case 61:case 107:case 171:case 187:i=1;break;case 189:case 109:case 173:i=-1;break;case 37:n.shiftKey?f=-1:(n.preventDefault(),h=-1);break;case 39:n.shiftKey?f=1:(n.preventDefault(),h=1);break;case 38:n.shiftKey?s=1:(n.preventDefault(),c=-1);break;case 40:n.shiftKey?s=-1:(c=1,n.preventDefault());break;default:return}var t=this._map,l=t.getZoom(),a={duration:300,delayEndEvents:500,easing:u,zoom:i?Math.round(l)+i*(n.shiftKey?2:1):l,bearing:t.getBearing()+f*e,pitch:t.getPitch()+s*o,offset:[-h*r,-c*r],center:t.getCenter()};t.easeTo(a,{originalEvent:n})}};t.exports=i},{"../../util/util":252}],223:[function(n,t){"use strict";var e=n("../../util/dom"),o=n("../../util/util"),f=n("../../util/browser"),r=n("../../util/window"),u=r.navigator.userAgent.toLowerCase(),s=-1!==u.indexOf("firefox"),h=-1!==u.indexOf("safari")&&-1===u.indexOf("chrom"),i=function(n){this._map=n;this._el=n.getCanvasContainer();o.bindAll(["_onWheel","_onTimeout"],this)};i.prototype.isEnabled=function(){return!!this._enabled};i.prototype.enable=function(n){this.isEnabled()||(this._el.addEventListener("wheel",this._onWheel,!1),this._el.addEventListener("mousewheel",this._onWheel,!1),this._enabled=!0,this._aroundCenter=n&&"center"===n.around)};i.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("wheel",this._onWheel),this._el.removeEventListener("mousewheel",this._onWheel),this._enabled=!1)};i.prototype._onWheel=function(n){var t=0,i,u;"wheel"===n.type?(t=n.deltaY,s&&n.deltaMode===r.WheelEvent.DOM_DELTA_PIXEL&&(t/=f.devicePixelRatio),n.deltaMode===r.WheelEvent.DOM_DELTA_LINE&&(t*=40)):"mousewheel"===n.type&&(t=-n.wheelDeltaY,h&&(t/=3));i=f.now();u=i-(this._time||0);this._pos=e.mousePos(this._el,n);this._time=i;0!==t&&t%4.000244140625==0?this._type="wheel":0!==t&&Math.abs(t)<4?this._type="trackpad":u>400?(this._type=null,this._lastValue=t,this._timeout=setTimeout(this._onTimeout,40)):this._type||(this._type=Math.abs(u*t)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,t+=this._lastValue));n.shiftKey&&t&&(t/=4);this._type&&this._zoom(-t,n);n.preventDefault()};i.prototype._onTimeout=function(){this._type="wheel";this._zoom(-this._lastValue)};i.prototype._zoom=function(n,t){var i,r,u,f;0!==n&&(i=this._map,r=2/(1+Math.exp(-Math.abs(n/100))),n<0&&0!==r&&(r=1/r),u=i.ease?i.ease.to:i.transform.scale,f=i.transform.scaleZoom(u*r),i.zoomTo(f,{duration:"wheel"===this._type?200:0,around:this._aroundCenter?i.getCenter():i.unproject(this._pos),delayEndEvents:200,smoothEasing:!0},{originalEvent:t}))};t.exports=i},{"../../util/browser":231,"../../util/dom":238,"../../util/util":252,"../../util/window":233}],224:[function(n,t){"use strict";var r=n("../../util/dom"),o=n("../../util/util"),u=n("../../util/window"),f=.15,s=o.bezier(0,0,f,1),h=12,e=2.5,c=.15,l=10,i=function(n){this._map=n;this._el=n.getCanvasContainer();o.bindAll(["_onStart","_onMove","_onEnd"],this)};i.prototype.isEnabled=function(){return!!this._enabled};i.prototype.enable=function(n){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-zoom-rotate"),this._el.addEventListener("touchstart",this._onStart,!1),this._enabled=!0,this._aroundCenter=n&&"center"===n.around)};i.prototype.disable=function(){this.isEnabled()&&(this._el.classList.remove("mapboxgl-touch-zoom-rotate"),this._el.removeEventListener("touchstart",this._onStart),this._enabled=!1)};i.prototype.disableRotation=function(){this._rotationDisabled=!0};i.prototype.enableRotation=function(){this._rotationDisabled=!1};i.prototype._onStart=function(n){if(2===n.touches.length){var t=r.mousePos(this._el,n.touches[0]),i=r.mousePos(this._el,n.touches[1]);this._startVec=t.sub(i);this._startScale=this._map.transform.scale;this._startBearing=this._map.transform.bearing;this._gestureIntent=void 0;this._inertia=[];u.document.addEventListener("touchmove",this._onMove,!1);u.document.addEventListener("touchend",this._onEnd,!1)}};i.prototype._onMove=function(n){var i,a;if(2===n.touches.length){var e=r.mousePos(this._el,n.touches[0]),o=r.mousePos(this._el,n.touches[1]),s=e.add(o).div(2),u=e.sub(o),f=u.mag()/this._startVec.mag(),h=this._rotationDisabled?0:180*u.angleWith(this._startVec)/Math.PI,t=this._map;this._gestureIntent?(i={duration:0,around:t.unproject(s)},"rotate"===this._gestureIntent&&(i.bearing=this._startBearing+h),"zoom"!==this._gestureIntent&&"rotate"!==this._gestureIntent||(i.zoom=t.transform.scaleZoom(this._startScale*f)),t.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),f,s]),t.easeTo(i,{originalEvent:n})):(a=Math.abs(1-f)>c,Math.abs(h)>l?this._gestureIntent="rotate":a&&(this._gestureIntent="zoom"),this._gestureIntent&&(this._startVec=u,this._startScale=t.transform.scale,this._startBearing=t.transform.bearing));n.preventDefault()}};i.prototype._onEnd=function(n){var r,t,i,a,o;if(u.document.removeEventListener("touchmove",this._onMove),u.document.removeEventListener("touchend",this._onEnd),this._drainInertiaBuffer(),r=this._inertia,t=this._map,r.length<2)return void t.snapToNorth({},{originalEvent:n});var c=r[r.length-1],v=r[0],l=t.transform.scaleZoom(this._startScale*c[1]),y=t.transform.scaleZoom(this._startScale*v[1]),w=l-y,p=(c[0]-v[0])/1e3,b=c[2];if(0===p||l===y)return void t.snapToNorth({},{originalEvent:n});i=w*f/p;Math.abs(i)>e&&(i=i>0?e:-e);a=1e3*Math.abs(i/(h*f));o=l+i*a/2e3;o<0&&(o=0);t.easeTo({zoom:o,duration:a,easing:s,around:this._aroundCenter?t.getCenter():t.unproject(b)},{originalEvent:n})};i.prototype._drainInertiaBuffer=function(){for(var n=this._inertia,t=Date.now();n.length>2&&t-n[0][0]>160;)n.shift()};t.exports=i},{"../../util/dom":238,"../../util/util":252,"../../util/window":233}],225:[function(n,t){"use strict";var u=n("../util/util"),r=n("../util/window"),i=function(){u.bindAll(["_onHashChange","_updateHash"],this)};i.prototype.addTo=function(n){return this._map=n,r.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this};i.prototype.remove=function(){return r.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),delete this._map,this};i.prototype.getHashString=function(n){var f=this._map.getCenter(),r=Math.round(100*this._map.getZoom())/100,t=Math.max(0,Math.ceil(Math.log(r)/Math.LN2)),e=Math.round(f.lng*Math.pow(10,t))/Math.pow(10,t),o=Math.round(f.lat*Math.pow(10,t))/Math.pow(10,t),s=this._map.getBearing(),u=this._map.getPitch(),i="";return i+=n?"#/"+e+"/"+o+"/"+r:"#"+r+"/"+o+"/"+e,(s||u)&&(i+="/"+Math.round(10*s)/10),u&&(i+="/"+Math.round(u)),i};i.prototype._onHashChange=function(){var n=r.location.hash.replace("#","").split("/");return n.length>=3&&(this._map.jumpTo({center:[+n[2],+n[1]],zoom:+n[0],bearing:+(n[3]||0),pitch:+(n[4]||0)}),!0)};i.prototype._updateHash=function(){var n=this.getHashString();r.history.replaceState("","",n)};t.exports=i},{"../util/util":252,"../util/window":233}],226:[function(n,t){"use strict";function s(n){n.parentNode&&n.parentNode.removeChild(n)}var r=n("../util/util"),e=n("../util/browser"),u=n("../util/window"),a=n("../util/window"),v=a.HTMLImageElement,f=n("../util/dom"),c=n("../util/ajax"),y=n("../style/style"),p=n("../style/animation_loop"),w=n("../render/painter"),b=n("../geo/transform"),k=n("./hash"),d=n("./bind_handlers"),g=n("./camera"),nt=n("../geo/lng_lat"),h=n("../geo/lng_lat_bounds"),i=n("@mapbox/point-geometry"),tt=n("./control/attribution_control"),it=n("./control/logo_control"),rt=n("mapbox-gl-supported");n("./events");var o=0,l=22,ut={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:o,maxZoom:l,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,bearingSnap:7,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,transformRequest:null},ft=function(n){function t(t){var e=this,o,i,f;if(t=r.extend({},ut,t),null!=t.minZoom&&null!=t.maxZoom&&t.minZoom>t.maxZoom)throw new Error("maxZoom must be greater than minZoom");if(o=new b(t.minZoom,t.maxZoom,t.renderWorldCopies),n.call(this,o,t),this._interactive=t.interactive,this._maxTileCacheSize=t.maxTileCacheSize,this._failIfMajorPerformanceCaveat=t.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=t.preserveDrawingBuffer,this._trackResize=t.trackResize,this._bearingSnap=t.bearingSnap,this._refreshExpiredTiles=t.refreshExpiredTiles,i=t.transformRequest,this._transformRequest=i?function(n,t){return i(n,t)||{url:n}}:function(n){return{url:n}},"string"==typeof t.container){if(f=u.document.getElementById(t.container),!f)throw new Error("Container '"+t.container+"' not found.");this._container=f}else this._container=t.container;this.animationLoop=new p;t.maxBounds&&this.setMaxBounds(t.maxBounds);r.bindAll(["_onWindowOnline","_onWindowResize","_contextLost","_contextRestored","_update","_render","_onData","_onDataLoading"],this);this._setupContainer();this._setupPainter();this.on("move",this._update.bind(this,!1));this.on("zoom",this._update.bind(this,!0));this.on("moveend",function(){e.animationLoop.set(300);e._rerender()});void 0!==u&&(u.addEventListener("online",this._onWindowOnline,!1),u.addEventListener("resize",this._onWindowResize,!1));d(this,t);this._hash=t.hash&&(new k).addTo(this);this._hash&&this._hash._onHashChange()||this.jumpTo({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch});this.resize();t.style&&this.setStyle(t.style,{localIdeographFontFamily:t.localIdeographFontFamily});t.attributionControl&&this.addControl(new tt);this.addControl(new it,t.logoPosition);this.on("style.load",function(){this.transform.unmodified&&this.jumpTo(this.style.stylesheet);this.style.update({transition:!1})});this.on("data",this._onData);this.on("dataloading",this._onDataLoading)}n&&(t.__proto__=n);t.prototype=Object.create(n&&n.prototype);t.prototype.constructor=t;var a={showTileBoundaries:{},showCollisionBoxes:{},showOverdrawInspector:{},repaint:{},vertices:{}};return t.prototype.addControl=function(n,t){void 0===t&&n.getDefaultPosition&&(t=n.getDefaultPosition());void 0===t&&(t="top-right");var r=n.onAdd(this),i=this._controlPositions[t];return-1!==t.indexOf("bottom")?i.insertBefore(r,i.firstChild):i.appendChild(r),this},t.prototype.removeControl=function(n){return n.onRemove(this),this},t.prototype.resize=function(){var i=this._containerDimensions(),n=i[0],t=i[1];return this._resizeCanvas(n,t),this.transform.resize(n,t),this.painter.resize(n,t),this.fire("movestart").fire("move").fire("resize").fire("moveend")},t.prototype.getBounds=function(){var n=new h(this.transform.pointLocation(new i(0,this.transform.height)),this.transform.pointLocation(new i(this.transform.width,0)));return(this.transform.angle||this.transform.pitch)&&(n.extend(this.transform.pointLocation(new i(this.transform.size.x,0))),n.extend(this.transform.pointLocation(new i(0,this.transform.size.y)))),n},t.prototype.getMaxBounds=function(){return this.transform.latRange&&2===this.transform.latRange.length&&this.transform.lngRange&&2===this.transform.lngRange.length?new h([this.transform.lngRange[0],this.transform.latRange[0]],[this.transform.lngRange[1],this.transform.latRange[1]]):null},t.prototype.setMaxBounds=function(n){if(n){var t=h.convert(n);this.transform.lngRange=[t.getWest(),t.getEast()];this.transform.latRange=[t.getSouth(),t.getNorth()];this.transform._constrain();this._update()}else null!==n&&void 0!==n||(this.transform.lngRange=null,this.transform.latRange=null,this._update());return this},t.prototype.setMinZoom=function(n){if((n=null===n||void 0===n?o:n)>=o&&n<=this.transform.maxZoom)return this.transform.minZoom=n,this._update(),this.getZoom()<n&&this.setZoom(n),this;throw new Error("minZoom must be between "+o+" and the current maxZoom, inclusive");},t.prototype.getMinZoom=function(){return this.transform.minZoom},t.prototype.setMaxZoom=function(n){if((n=null===n||void 0===n?l:n)>=this.transform.minZoom)return this.transform.maxZoom=n,this._update(),this.getZoom()>n&&this.setZoom(n),this;throw new Error("maxZoom must be greater than the current minZoom");},t.prototype.getMaxZoom=function(){return this.transform.maxZoom},t.prototype.project=function(n){return this.transform.locationPoint(nt.convert(n))},t.prototype.unproject=function(n){return this.transform.pointLocation(i.convert(n))},t.prototype.on=function(t,i,u){var f=this,e,o;if(void 0===u)return n.prototype.on.call(this,t,i);e=function(){var e,n,s,o;return"mouseenter"===t||"mouseover"===t?(e=!1,{layer:i,listener:u,delegates:{mousemove:function(n){var o=f.getLayer(i)?f.queryRenderedFeatures(n.point,{layers:[i]}):[];o.length?e||(e=!0,u.call(f,r.extend({features:o},n,{type:t}))):e=!1},mouseout:function(){e=!1}}}):"mouseleave"===t||"mouseout"===t?(n=!1,{layer:i,listener:u,delegates:{mousemove:function(e){(f.getLayer(i)?f.queryRenderedFeatures(e.point,{layers:[i]}):[]).length?n=!0:n&&(n=!1,u.call(f,r.extend({},e,{type:t})))},mouseout:function(i){n&&(n=!1,u.call(f,r.extend({},i,{type:t})))}}}):(s=function(n){var t=f.getLayer(i)?f.queryRenderedFeatures(n.point,{layers:[i]}):[];t.length&&u.call(f,r.extend({features:t},n))},{layer:i,listener:u,delegates:(o={},o[t]=s,o)})}();this._delegatedListeners=this._delegatedListeners||{};this._delegatedListeners[t]=this._delegatedListeners[t]||[];this._delegatedListeners[t].push(e);for(o in e.delegates)f.on(o,e.delegates[o]);return this},t.prototype.off=function(t,i,r){var s=this,e,u,f,o;if(void 0===r)return n.prototype.off.call(this,t,i);if(this._delegatedListeners&&this._delegatedListeners[t])for(e=this._delegatedListeners[t],u=0;u<e.length;u++)if(f=e[u],f.layer===i&&f.listener===r){for(o in f.delegates)s.off(o,f.delegates[o]);return e.splice(u,1),s}return this},t.prototype.queryRenderedFeatures=function(){for(var u,r,n=[],t=arguments.length;t--;)n[t]=arguments[t];return r={},2===n.length?(u=arguments[0],r=arguments[1]):1===n.length&&function(n){return n instanceof i||Array.isArray(n)}(n[0])?u=n[0]:1===n.length&&(r=n[0]),this.style?this.style.queryRenderedFeatures(this._makeQueryGeometry(u),r,this.transform.zoom,this.transform.angle):[]},t.prototype._makeQueryGeometry=function(n){var u=this,r,t;return void 0===n&&(n=[i.convert([0,0]),i.convert([this.transform.width,this.transform.height])]),n instanceof i||"number"==typeof n[0]?r=[i.convert(n)]:(t=[i.convert(n[0]),i.convert(n[1])],r=[t[0],new i(t[1].x,t[0].y),t[1],new i(t[0].x,t[1].y),t[0]]),r.map(function(n){return u.transform.pointCoordinate(n)})},t.prototype.querySourceFeatures=function(n,t){return this.style.querySourceFeatures(n,t)},t.prototype.setStyle=function(n,t){if((!t||!1!==t.diff&&!t.localIdeographFontFamily)&&this.style&&n&&"object"==typeof n)try{return this.style.setState(n)&&this._update(!0),this}catch(n){r.warnOnce("Unable to perform style diff: "+(n.message||n.error||n)+".  Rebuilding the style from scratch.")}return this.style&&(this.style.setEventedParent(null),this.style._remove(),this.off("rotate",this.style._redoPlacement),this.off("pitch",this.style._redoPlacement),this.off("move",this.style._redoPlacement)),n?(this.style=new y(this,t||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof n?this.style.loadURL(n):this.style.loadJSON(n),this.on("rotate",this.style._redoPlacement),this.on("pitch",this.style._redoPlacement),this.on("move",this.style._redoPlacement),this):(delete this.style,this)},t.prototype.getStyle=function(){if(this.style)return this.style.serialize()},t.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():r.warnOnce("There is no style added to the map.")},t.prototype.addSource=function(n,t){return this.style.addSource(n,t),this._update(!0),this},t.prototype.isSourceLoaded=function(n){var t=this.style&&this.style.sourceCaches[n];return void 0===t?void this.fire("error",{error:new Error("There is no source with ID '"+n+"'")}):t.loaded()},t.prototype.areTilesLoaded=function(){var i=this.style&&this.style.sourceCaches,r,u,n,f,t;for(r in i){u=i[r];n=u._tiles;for(f in n)if(t=n[f],"loaded"!==t.state&&"errored"!==t.state)return!1}return!0},t.prototype.addSourceType=function(n,t,i){return this.style.addSourceType(n,t,i)},t.prototype.removeSource=function(n){return this.style.removeSource(n),this._update(!0),this},t.prototype.getSource=function(n){return this.style.getSource(n)},t.prototype.addImage=function(n,t,i){var r,u;if(void 0===i&&(i={}),r=i.pixelRatio,void 0===r&&(r=1),u=i.sdf,void 0===u&&(u=!1),t instanceof v)t=e.getImageData(t);else if(void 0===t.width||void 0===t.height)return this.fire("error",{error:new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")});this.style.addImage(n,{data:t,pixelRatio:r,sdf:u})},t.prototype.removeImage=function(n){this.style.removeImage(n)},t.prototype.loadImage=function(n,t){c.getImage(this._transformRequest(n,c.ResourceType.Image),t)},t.prototype.addLayer=function(n,t){return this.style.addLayer(n,t),this._update(!0),this},t.prototype.moveLayer=function(n,t){return this.style.moveLayer(n,t),this._update(!0),this},t.prototype.removeLayer=function(n){return this.style.removeLayer(n),this._update(!0),this},t.prototype.getLayer=function(n){return this.style.getLayer(n)},t.prototype.setFilter=function(n,t){return this.style.setFilter(n,t),this._update(!0),this},t.prototype.setLayerZoomRange=function(n,t,i){return this.style.setLayerZoomRange(n,t,i),this._update(!0),this},t.prototype.getFilter=function(n){return this.style.getFilter(n)},t.prototype.setPaintProperty=function(n,t,i){return this.style.setPaintProperty(n,t,i),this._update(!0),this},t.prototype.getPaintProperty=function(n,t){return this.style.getPaintProperty(n,t)},t.prototype.setLayoutProperty=function(n,t,i){return this.style.setLayoutProperty(n,t,i),this._update(!0),this},t.prototype.getLayoutProperty=function(n,t){return this.style.getLayoutProperty(n,t)},t.prototype.setLight=function(n){return this.style.setLight(n),this._update(!0),this},t.prototype.getLight=function(){return this.style.getLight()},t.prototype.getContainer=function(){return this._container},t.prototype.getCanvasContainer=function(){return this._canvasContainer},t.prototype.getCanvas=function(){return this._canvas},t.prototype._containerDimensions=function(){var n=0,t=0;return this._container&&(n=this._container.offsetWidth||400,t=this._container.offsetHeight||300),[n,t]},t.prototype._setupContainer=function(){var n=this._container,t,i,r,u;n.classList.add("mapboxgl-map");(this._missingCSSContainer=f.create("div","mapboxgl-missing-css",n)).innerHTML="Missing Mapbox GL JS CSS";t=this._canvasContainer=f.create("div","mapboxgl-canvas-container",n);this._interactive&&t.classList.add("mapboxgl-interactive");this._canvas=f.create("canvas","mapboxgl-canvas",t);this._canvas.style.position="absolute";this._canvas.addEventListener("webglcontextlost",this._contextLost,!1);this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1);this._canvas.setAttribute("tabindex","0");this._canvas.setAttribute("aria-label","Map");i=this._containerDimensions();this._resizeCanvas(i[0],i[1]);r=this._controlContainer=f.create("div","mapboxgl-control-container",n);u=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(function(n){u[n]=f.create("div","mapboxgl-ctrl-"+n,r)})},t.prototype._resizeCanvas=function(n,t){var i=u.devicePixelRatio||1;this._canvas.width=i*n;this._canvas.height=i*t;this._canvas.style.width=n+"px";this._canvas.style.height=t+"px"},t.prototype._setupPainter=function(){var n=r.extend({failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer},rt.webGLContextAttributes),t=this._canvas.getContext("webgl",n)||this._canvas.getContext("experimental-webgl",n);if(!t)return void this.fire("error",{error:new Error("Failed to initialize WebGL")});this.painter=new w(t,this.transform)},t.prototype._contextLost=function(n){n.preventDefault();this._frameId&&(e.cancelFrame(this._frameId),this._frameId=null);this.fire("webglcontextlost",{originalEvent:n})},t.prototype._contextRestored=function(n){this._setupPainter();this.resize();this._update();this.fire("webglcontextrestored",{originalEvent:n})},t.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!(!this.style||!this.style.loaded())},t.prototype._update=function(n){return this.style?(this._styleDirty=this._styleDirty||n,this._sourcesDirty=!0,this._rerender(),this):this},t.prototype._render=function(){return this.style&&this._styleDirty&&(this._styleDirty=!1,this.style.update(),this.style._recalculate(this.transform.zoom)),this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.rotating,zooming:this.zooming}),this.fire("render"),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire("load")),this._frameId=null,this.animationLoop.stopped()||(this._styleDirty=!0),(this._sourcesDirty||this._repaint||this._styleDirty)&&this._rerender(),this},t.prototype.remove=function(){this._hash&&this._hash.remove();e.cancelFrame(this._frameId);this._frameId=null;this.setStyle(null);void 0!==u&&(u.removeEventListener("resize",this._onWindowResize,!1),u.removeEventListener("online",this._onWindowOnline,!1));var n=this.painter.gl.getExtension("WEBGL_lose_context");n&&n.loseContext();s(this._canvasContainer);s(this._controlContainer);s(this._missingCSSContainer);this._container.classList.remove("mapboxgl-map");this.fire("remove")},t.prototype._rerender=function(){this.style&&!this._frameId&&(this._frameId=e.frame(this._render))},t.prototype._onWindowOnline=function(){this._update()},t.prototype._onWindowResize=function(){this._trackResize&&this.stop().resize()._update()},a.showTileBoundaries.get=function(){return!!this._showTileBoundaries},a.showTileBoundaries.set=function(n){this._showTileBoundaries!==n&&(this._showTileBoundaries=n,this._update())},a.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},a.showCollisionBoxes.set=function(n){this._showCollisionBoxes!==n&&(this._showCollisionBoxes=n,this.style._redoPlacement())},a.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},a.showOverdrawInspector.set=function(n){this._showOverdrawInspector!==n&&(this._showOverdrawInspector=n,this._update())},a.repaint.get=function(){return!!this._repaint},a.repaint.set=function(n){this._repaint=n;this._update()},a.vertices.get=function(){return!!this._vertices},a.vertices.set=function(n){this._vertices=n;this._update()},t.prototype._onData=function(n){this._update("style"===n.dataType);this.fire(n.dataType+"data",n)},t.prototype._onDataLoading=function(n){this.fire(n.dataType+"dataloading",n)},Object.defineProperties(t.prototype,a),t}(g);t.exports=ft},{"../geo/lng_lat":68,"../geo/lng_lat_bounds":69,"../geo/transform":70,"../render/painter":90,"../style/animation_loop":176,"../style/style":182,"../util/ajax":230,"../util/browser":231,"../util/dom":238,"../util/util":252,"../util/window":233,"./bind_handlers":209,"./camera":210,"./control/attribution_control":211,"./control/logo_control":214,"./events":217,"./hash":225,"@mapbox/point-geometry":2,"mapbox-gl-supported":37}],227:[function(n,t){"use strict";var r=n("../util/dom"),u=n("../geo/lng_lat"),f=n("@mapbox/point-geometry"),e=n("../util/smart_wrap"),o=n("../util/util"),s=o.bindAll,i=function(n,t){this._offset=f.convert(t&&t.offset||[0,0]);s(["_update","_onMapClick"],this);n||(n=r.create("div"));n.classList.add("mapboxgl-marker");this._element=n;this._popup=null};i.prototype.addTo=function(n){return this.remove(),this._map=n,n.getCanvasContainer().appendChild(this._element),n.on("move",this._update),n.on("moveend",this._update),this._update(),this._map.on("click",this._onMapClick),this};i.prototype.remove=function(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),delete this._map),r.remove(this._element),this._popup&&this._popup.remove(),this};i.prototype.getLngLat=function(){return this._lngLat};i.prototype.setLngLat=function(n){return this._lngLat=u.convert(n),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this};i.prototype.getElement=function(){return this._element};i.prototype.setPopup=function(n){return this._popup&&(this._popup.remove(),this._popup=null),n&&("offset"in n.options||(n.options.offset=this._offset),this._popup=n,this._popup.setLngLat(this._lngLat)),this};i.prototype._onMapClick=function(n){var t=n.originalEvent.target,i=this._element;this._popup&&(t===i||i.contains(t))&&this.togglePopup()};i.prototype.getPopup=function(){return this._popup};i.prototype.togglePopup=function(){var n=this._popup;return n?(n.isOpen()?n.remove():n.addTo(this._map),this):this};i.prototype._update=function(n){this._map&&(this._map.transform.renderWorldCopies&&(this._lngLat=e(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset),n&&"moveend"!==n.type||(this._pos=this._pos.round()),r.setTransform(this._element,"translate(-50%, -50%) translate("+this._pos.x+"px, "+this._pos.y+"px)"))};t.exports=i},{"../geo/lng_lat":68,"../util/dom":238,"../util/smart_wrap":248,"../util/util":252,"@mapbox/point-geometry":2}],228:[function(n,t){"use strict";function f(n){var t,r;return n?"number"==typeof n?(t=Math.round(Math.sqrt(.5*Math.pow(n,2))),{top:new i(0,n),"top-left":new i(t,t),"top-right":new i(-t,t),bottom:new i(0,-n),"bottom-left":new i(t,-t),"bottom-right":new i(-t,-t),left:new i(n,0),right:new i(-n,0)}):n instanceof i||Array.isArray(n)?(r=i.convert(n),{top:r,"top-left":r,"top-right":r,bottom:r,"bottom-left":r,"bottom-right":r,left:r,right:r}):{top:i.convert(n.top||[0,0]),"top-left":i.convert(n["top-left"]||[0,0]),"top-right":i.convert(n["top-right"]||[0,0]),bottom:i.convert(n.bottom||[0,0]),"bottom-left":i.convert(n["bottom-left"]||[0,0]),"bottom-right":i.convert(n["bottom-right"]||[0,0]),left:i.convert(n.left||[0,0]),right:i.convert(n.right||[0,0])}:f(new i(0,0))}var e=n("../util/util"),o=n("../util/evented"),r=n("../util/dom"),s=n("../geo/lng_lat"),i=n("@mapbox/point-geometry"),u=n("../util/window"),h=n("../util/smart_wrap"),c={closeButton:!0,closeOnClick:!0},l=function(n){function t(t){n.call(this);this.options=e.extend(Object.create(c),t);e.bindAll(["_update","_onClickClose"],this)}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.addTo=function(n){return this._map=n,this._map.on("move",this._update),this.options.closeOnClick&&this._map.on("click",this._onClickClose),this._update(),this},t.prototype.isOpen=function(){return!!this._map},t.prototype.remove=function(){return this._content&&r.remove(this._content),this._container&&(r.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("click",this._onClickClose),delete this._map),this.fire("close"),this},t.prototype.getLngLat=function(){return this._lngLat},t.prototype.setLngLat=function(n){return this._lngLat=s.convert(n),this._pos=null,this._update(),this},t.prototype.setText=function(n){return this.setDOMContent(u.document.createTextNode(n))},t.prototype.setHTML=function(n){var t,i=u.document.createDocumentFragment(),r=u.document.createElement("body");for(r.innerHTML=n;;){if(!(t=r.firstChild))break;i.appendChild(t)}return this.setDOMContent(i)},t.prototype.setDOMContent=function(n){return this._createContent(),this._content.appendChild(n),this._update(),this},t.prototype._createContent=function(){this._content&&r.remove(this._content);this._content=r.create("div","mapboxgl-popup-content",this._container);this.options.closeButton&&(this._closeButton=r.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClickClose))},t.prototype._update=function(){var i,u,l;if(this._map&&this._lngLat&&this._content){this._container||(this._container=r.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=r.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content));this._map.transform.renderWorldCopies&&(this._lngLat=h(this._lngLat,this._pos,this._map.transform));var t=this._pos=this._map.project(this._lngLat),n=this.options.anchor,e=f(this.options.offset);n||(i=this._container.offsetWidth,u=this._container.offsetHeight,n=t.y+e.bottom.y<u?["top"]:t.y>this._map.transform.height-u?["bottom"]:[],t.x<i/2?n.push("left"):t.x>this._map.transform.width-i/2&&n.push("right"),n=0===n.length?"bottom":n.join("-"));var o=t.add(e[n]).round(),s={top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"},c=this._container.classList;for(l in s)c.remove("mapboxgl-popup-anchor-"+l);c.add("mapboxgl-popup-anchor-"+n);r.setTransform(this._container,s[n]+" translate("+o.x+"px,"+o.y+"px)")}},t.prototype._onClickClose=function(){this.remove()},t}(o);t.exports=l},{"../geo/lng_lat":68,"../util/dom":238,"../util/evented":239,"../util/smart_wrap":248,"../util/util":252,"../util/window":233,"@mapbox/point-geometry":2}],229:[function(n,t){"use strict";var r=n("./util"),i=function(n,t,i){this.target=n;this.parent=t;this.mapId=i;this.callbacks={};this.callbackID=0;r.bindAll(["receive"],this);this.target.addEventListener("message",this.receive,!1)};i.prototype.send=function(n,t,i,r,u){var f=i?this.mapId+":"+this.callbackID++:null;i&&(this.callbacks[f]=i);this.target.postMessage({targetMapId:u,sourceMapId:this.mapId,type:n,id:String(f),data:t},r)};i.prototype.receive=function(n){var i,f=this,t=n.data,o=t.id,r,u,e;t.targetMapId&&this.mapId!==t.targetMapId||(r=function(n,t,i){f.target.postMessage({sourceMapId:f.mapId,type:"<response>",id:String(o),error:n?String(n):null,data:t},i)},"<response>"===t.type?(i=this.callbacks[t.id],delete this.callbacks[t.id],i&&t.error?i(new Error(t.error)):i&&i(null,t.data)):void 0!==t.id&&this.parent[t.type]?this.parent[t.type](t.sourceMapId,t.data,r):void 0!==t.id&&this.parent.getWorkerSource?(u=t.type.split("."),e=this.parent.getWorkerSource(t.sourceMapId,u[0]),e[u[1]](t.data,r)):this.parent[t.type](t.data))};i.prototype.remove=function(){this.target.removeEventListener("message",this.receive,!1)};t.exports=i},{"./util":252}],230:[function(n,t,i){"use strict";function f(n){var t=new r.XMLHttpRequest,i;t.open("GET",n.url,!0);for(i in n.headers)t.setRequestHeader(i,n.headers[i]);return t.withCredentials="include"===n.credentials,t}function s(n){var t=r.document.createElement("a");return t.href=n,t.protocol===r.document.location.protocol&&t.host===r.document.location.host}var r=n("./window"),e={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"},u,o;i.ResourceType=e;"function"==typeof Object.freeze&&Object.freeze(e);u=function(n){function t(t,i){n.call(this,t);this.status=i}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t}(Error);i.getJSON=function(n,t){var i=f(n);return i.setRequestHeader("Accept","application/json"),i.onerror=function(){t(new Error(i.statusText))},i.onload=function(){if(i.status>=200&&i.status<300&&i.response){var n;try{n=JSON.parse(i.response)}catch(n){return t(n)}t(null,n)}else t(new u(i.statusText,i.status))},i.send(),i};i.getArrayBuffer=function(n,t){var i=f(n);return i.responseType="arraybuffer",i.onerror=function(){t(new Error(i.statusText))},i.onload=function(){var n=i.response;if(0===n.byteLength&&200===i.status)return t(new Error("http status 200 returned without content."));i.status>=200&&i.status<300&&i.response?t(null,{data:n,cacheControl:i.getResponseHeader("Cache-Control"),expires:i.getResponseHeader("Expires")}):t(new u(i.statusText,i.status))},i.send(),i};o="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";i.getImage=function(n,t){return i.getArrayBuffer(n,function(n,i){var u,f,e;n?t(n):i&&(u=new r.Image,f=r.URL||r.webkitURL,u.onload=function(){t(null,u);f.revokeObjectURL(u.src)},e=new r.Blob([new Uint8Array(i.data)],{type:"image/png"}),u.cacheControl=i.cacheControl,u.expires=i.expires,u.src=i.data.byteLength?f.createObjectURL(e):o)})};i.getVideo=function(n,t){var i=r.document.createElement("video"),u,f;for(i.onloadstart=function(){t(null,i)},u=0;u<n.length;u++)f=r.document.createElement("source"),s(n[u])||(i.crossOrigin="Anonymous"),f.src=n[u],i.appendChild(f);return i}},{"./window":233}],231:[function(n,t){"use strict";var i=n("./window"),r=i.performance&&i.performance.now?i.performance.now.bind(i.performance):Date.now.bind(Date),u=i.requestAnimationFrame||i.mozRequestAnimationFrame||i.webkitRequestAnimationFrame||i.msRequestAnimationFrame,e=i.cancelAnimationFrame||i.mozCancelAnimationFrame||i.webkitCancelAnimationFrame||i.msCancelAnimationFrame,f;t.exports={now:r,frame:function(n){return u(n)},cancelFrame:function(n){return e(n)},timed:function(n,t,i){function f(){if(!e){var s=r();s>=o+t?n.call(i,1):(n.call(i,(s-o)/t),u(f))}}if(!t)return n.call(i,1),null;var e=!1,o=r();return u(f),function(){e=!0}},getImageData:function(n){var t=i.document.createElement("canvas"),r=t.getContext("2d");if(!r)throw new Error("failed to create canvas 2d context");return t.width=n.width,t.height=n.height,r.drawImage(n,0,0,n.width,n.height),r.getImageData(0,0,n.width,n.height)},hardwareConcurrency:i.navigator.hardwareConcurrency||4,get devicePixelRatio(){return i.devicePixelRatio},supportsWebp:!1};f=i.document.createElement("img");f.onload=function(){t.exports.supportsWebp=!0};f.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="},{"./window":233}],232:[function(n,t){"use strict";var r=n("webworkify"),i=n("../window"),u=i.URL.createObjectURL(new r(n("../../source/worker"),{bare:!0}));t.exports=function(){return new i.Worker(u)}},{"../../source/worker":117,"../window":233,webworkify:48}],233:[function(n,t){"use strict";t.exports=self},{}],234:[function(n,t){"use strict";function i(n,t){return t.area-n.area}var r=n("quickselect"),u=n("./util").calculateSignedArea;t.exports=function(n,t){var l=n.length,s,c,f,o,h,e;if(l<=1)return[n];for(f=[],o=0;o<l;o++)h=u(n[o]),0!==h&&(n[o].area=Math.abs(h),void 0===c&&(c=h<0),c===h<0?(s&&f.push(s),s=[n[o]]):s.push(n[o]));if(s&&f.push(s),t>1)for(e=0;e<f.length;e++)f[e].length<=t||(r(f[e],t,1,f[e].length-1,i),f[e]=f[e].slice(0,t));return f}},{"./util":252,quickselect:40}],235:[function(n,t){"use strict";t.exports={API_URL:"https://api.mapbox.com",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null}},{}],236:[function(n,t){"use strict";var i=function(n){var r=this,t,i;for(this._stringToNumber={},this._numberToString=[],t=0;t<n.length;t++)i=n[t],r._stringToNumber[i]=t,r._numberToString[t]=i};i.prototype.encode=function(n){return this._stringToNumber[n]};i.prototype.decode=function(n){return this._numberToString[n]};t.exports=i},{}],237:[function(n,t){"use strict";var r=n("./util"),u=n("./actor"),i=function(n,t){var o=this,f,i,s,e;for(this.workerPool=n,this.actors=[],this.currentActor=0,this.id=r.uniqueId(),f=this.workerPool.acquire(this.id),i=0;i<f.length;i++)s=f[i],e=new u(s,t,o.id),e.name="Worker "+i,o.actors.push(e)};i.prototype.broadcast=function(n,t,i){i=i||function(){};r.asyncAll(this.actors,function(i,r){i.send(n,t,r)},i)};i.prototype.send=function(n,t,i,r,u){return("number"!=typeof r||isNaN(r))&&(r=this.currentActor=(this.currentActor+1)%this.actors.length),this.actors[r].send(n,t,i,u),r};i.prototype.remove=function(){this.actors.forEach(function(n){n.remove()});this.actors=[];this.workerPool.release(this.id)};t.exports=i},{"./actor":229,"./util":252}],238:[function(n,t,i){"use strict";function o(n){for(var t=0;t<n.length;t++)if(n[t]in f)return n[t];return n[0]}var s=n("@mapbox/point-geometry"),r=n("./window"),f,u,h,c,e;i.create=function(n,t,i){var u=r.document.createElement(n);return t&&(u.className=t),i&&i.appendChild(u),u};f=r.document.documentElement.style;u=o(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);i.disableDrag=function(){u&&(h=f[u],f[u]="none")};i.enableDrag=function(){u&&(f[u]=h)};c=o(["transform","WebkitTransform"]);i.setTransform=function(n,t){n.style[c]=t};e=function(n){n.preventDefault();n.stopPropagation();r.removeEventListener("click",e,!0)};i.suppressClick=function(){r.addEventListener("click",e,!0);r.setTimeout(function(){r.removeEventListener("click",e,!0)},0)};i.mousePos=function(n,t){var i=n.getBoundingClientRect();return t=t.touches?t.touches[0]:t,new s(t.clientX-i.left-n.clientLeft,t.clientY-i.top-n.clientTop)};i.touchPos=function(n,t){for(var u=n.getBoundingClientRect(),f=[],r="touchend"===t.type?t.changedTouches:t.touches,i=0;i<r.length;i++)f.push(new s(r[i].clientX-u.left-n.clientLeft,r[i].clientY-u.top-n.clientTop));return f};i.remove=function(n){n.parentNode&&n.parentNode.removeChild(n)}},{"./window":233,"@mapbox/point-geometry":2}],239:[function(n,t){"use strict";function f(n,t,i){i[n]=i[n]||[];i[n].push(t)}function r(n,t,i){if(i&&i[n]){var r=i[n].indexOf(t);-1!==r&&i[n].splice(r,1)}}var u=n("./util"),i=function(){};i.prototype.on=function(n,t){return this._listeners=this._listeners||{},f(n,t,this._listeners),this};i.prototype.off=function(n,t){return r(n,t,this._listeners),r(n,t,this._oneTimeListeners),this};i.prototype.once=function(n,t){return this._oneTimeListeners=this._oneTimeListeners||{},f(n,t,this._oneTimeListeners),this};i.prototype.fire=function(n,t){var o=this,s,f,e,i;if(this.listens(n)){for(t=u.extend({},t,{type:n,target:this}),s=this._listeners&&this._listeners[n]?this._listeners[n].slice():[],f=0;f<s.length;f++)s[f].call(o,t);for(e=this._oneTimeListeners&&this._oneTimeListeners[n]?this._oneTimeListeners[n].slice():[],i=0;i<e.length;i++)e[i].call(o,t),r(n,e[i],o._oneTimeListeners);this._eventedParent&&this._eventedParent.fire(n,u.extend({},t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData))}else u.endsWith(n,"error")&&console.error(t&&t.error||t||"Empty error event");return this};i.prototype.listens=function(n){return this._listeners&&this._listeners[n]&&this._listeners[n].length>0||this._oneTimeListeners&&this._oneTimeListeners[n]&&this._oneTimeListeners[n].length>0||this._eventedParent&&this._eventedParent.listens(n)};i.prototype.setEventedParent=function(n,t){return this._eventedParent=n,this._eventedParentData=t,this};t.exports=i},{"./util":252}],240:[function(n,t){"use strict";function u(n,t){return t.max-n.max}function i(n,t,i,u){this.p=new r(n,t);this.h=i;this.d=f(this.p,u);this.max=this.d+this.h*Math.SQRT2}function f(n,t){for(var i,r,u=!1,f=1/0,e=0;e<t.length;e++)for(var o=t[e],h=0,c=o.length,l=c-1;h<c;l=h++)i=o[h],r=o[l],i.y>n.y!=r.y>n.y&&n.x<(r.x-i.x)*(n.y-i.y)/(r.y-i.y)+i.x&&(u=!u),f=Math.min(f,s(n,i,r));return(u?1:-1)*Math.sqrt(f)}function e(n){for(var u=0,s=0,h=0,f=n[0],e=0,c=f.length,l=c-1;e<c;l=e++){var t=f[e],r=f[l],o=t.x*r.y-r.x*t.y;s+=(t.x+r.x)*o;h+=(t.y+r.y)*o;u+=3*o}return new i(s/u,h/u,0,n)}var o=n("tinyqueue"),r=n("@mapbox/point-geometry"),s=n("./intersection_tests").distToSegmentSquared;t.exports=function(n,t,f){var c,d,g,v,nt,h;void 0===t&&(t=1);void 0===f&&(f=!1);for(var y=1/0,p=1/0,w=-1/0,b=-1/0,tt=n[0],a=0;a<tt.length;a++)c=tt[a],(!a||c.x<y)&&(y=c.x),(!a||c.y<p)&&(p=c.y),(!a||c.x>w)&&(w=c.x),(!a||c.y>b)&&(b=c.y);var it=w-y,rt=b-p,k=Math.min(it,rt),s=k/2,l=new o(null,u);if(0===k)return new r(y,p);for(d=y;d<w;d+=k)for(g=p;g<b;g+=k)l.push(new i(d+s,g+s,s,n));for(v=e(n),nt=l.length;l.length;)h=l.pop(),(h.d>v.d||!v.d)&&(v=h,f&&console.log("found best %d after %d probes",Math.round(1e4*h.d)/1e4,nt)),h.max-v.d<=t||(s=h.h/2,l.push(new i(h.p.x-s,h.p.y-s,s,n)),l.push(new i(h.p.x+s,h.p.y-s,s,n)),l.push(new i(h.p.x-s,h.p.y+s,s,n)),l.push(new i(h.p.x+s,h.p.y+s,s,n)),nt+=4);return f&&(console.log("num probes: "+nt),console.log("best distance: "+v.d)),v.p}},{"./intersection_tests":243,"@mapbox/point-geometry":2,tinyqueue:42}],241:[function(n,t){"use strict";var r=n("./worker_pool"),i;t.exports=function(){return i||(i=new r),i}},{"./worker_pool":255}],242:[function(n,t){"use strict";function u(n,t,i){var r=n.width,u=n.height;if(i){if(i.length!==r*u*t)throw new RangeError("mismatched image size");}else i=new Uint8Array(r*u*t);return{width:r,height:u,data:i}}function e(n,t,i){var r=t.width,e=t.height,o;if(r===n.width&&e===n.height)return n;o=u({width:r,height:e},i);f(n,o,{x:0,y:0},{x:0,y:0},{width:Math.min(n.width,r),height:Math.min(n.height,e)},i);n.width=r;n.height=e;n.data=o.data}function f(n,t,i,r,u,f){if(0===u.width||0===u.height)return t;if(u.width>n.width||u.height>n.height||i.x>n.width-u.width||i.y>n.height-u.height)throw new RangeError("out of range source coordinates for image copy");if(u.width>t.width||u.height>t.height||r.x>t.width-u.width||r.y>t.height-u.height)throw new RangeError("out of range destination coordinates for image copy");for(var s=n.data,h=t.data,e=0;e<u.height;e++)for(var c=((i.y+e)*n.width+i.x)*f,l=((r.y+e)*t.width+r.x)*f,o=0;o<u.width*f;o++)h[l+o]=s[c+o];return t}var r=function(){},i;r.create=function(n,t){return u(n,1,t)};r.resize=function(n,t){e(n,t,1)};r.copy=function(n,t,i,r,u){f(n,t,i,r,u,1)};i=function(){};i.create=function(n,t){return u(n,4,t)};i.resize=function(n,t){e(n,t,4)};i.copy=function(n,t,i,r,u){f(n,t,i,r,u,4)};t.exports={AlphaImage:r,RGBAImage:i}},{}],243:[function(n,t){"use strict";function s(n,t){for(var f,r=0;r<n.length;r++)if(i(t,n[r]))return!0;for(f=0;f<t.length;f++)if(i(n,t[f]))return!0;return!!u(n,t)}function h(n,t,r){for(var s,e,h,o,c,u=0;u<n.length;u++)for(s=n[u],e=0;e<t.length;e++)for(h=t[e],o=0;o<h.length;o++)if((c=h[o],i(s,c))||f(c,s,r))return!0;return!1}function c(n,t){var i,c,r,f,o,s,h;if(1===n.length&&1===n[0].length)return e(t,n[0][0]);for(i=0;i<t.length;i++)for(c=t[i],r=0;r<c.length;r++)if(e(n,c[r]))return!0;for(f=0;f<n.length;f++){for(o=n[f],s=0;s<o.length;s++)if(e(t,o[s]))return!0;for(h=0;h<t.length;h++)if(u(o,t[h]))return!0}return!1}function l(n,t,r){for(var f,e,o,s,u=0;u<t.length;u++)for(f=t[u],e=0;e<n.length;e++){if(o=n[e],o.length>=3)for(s=0;s<f.length;s++)if(i(o,f[s]))return!0;if(a(o,f,r))return!0}return!1}function a(n,t,i){var r,e;if(n.length>1){if(u(n,t))return!0;for(r=0;r<t.length;r++)if(f(t[r],n,i))return!0}for(e=0;e<n.length;e++)if(f(n[e],t,i))return!0;return!1}function u(n,t){var i,u,f;if(0===n.length||0===t.length)return!1;for(i=0;i<n.length-1;i++)for(var e=n[i],o=n[i+1],r=0;r<t.length-1;r++)if(u=t[r],f=t[r+1],v(e,o,u,f))return!0;return!1}function v(n,t,i,u){return r(n,i,u)!==r(t,i,u)&&r(n,t,i)!==r(n,t,u)}function f(n,t,i){var u=i*i,r;if(1===t.length)return n.distSqr(t[0])<u;for(r=1;r<t.length;r++)if(o(n,t[r-1],t[r])<u)return!0;return!1}function o(n,t,i){var u=t.distSqr(i),r;return 0===u?n.distSqr(t):(r=((n.x-t.x)*(i.x-t.x)+(n.y-t.y)*(i.y-t.y))/u,r<0?n.distSqr(t):r>1?n.distSqr(i):n.distSqr(i.sub(t)._mult(r)._add(t)))}function e(n,t){for(var r,i,u,o,s,f=!1,e=0;e<n.length;e++)for(r=n[e],o=0,s=r.length-1;o<r.length;s=o++)i=r[o],u=r[s],i.y>t.y!=u.y>t.y&&t.x<(u.x-i.x)*(t.y-i.y)/(u.y-i.y)+i.x&&(f=!f);return f}function i(n,t){for(var i,r,u=!1,f=0,e=n.length-1;f<n.length;e=f++)i=n[f],r=n[e],i.y>t.y!=r.y>t.y&&t.x<(r.x-i.x)*(t.y-i.y)/(r.y-i.y)+i.x&&(u=!u);return u}var y=n("./util"),r=y.isCounterClockwise;t.exports={multiPolygonIntersectsBufferedMultiPoint:h,multiPolygonIntersectsMultiPolygon:c,multiPolygonIntersectsBufferedMultiLine:l,polygonIntersectsPolygon:s,distToSegmentSquared:o}},{"./util":252}],244:[function(n,t){"use strict";var i={"Latin-1 Supplement":function(n){return n>=128&&n<=255},Arabic:function(n){return n>=1536&&n<=1791},"Arabic Supplement":function(n){return n>=1872&&n<=1919},"Arabic Extended-A":function(n){return n>=2208&&n<=2303},"Hangul Jamo":function(n){return n>=4352&&n<=4607},"Unified Canadian Aboriginal Syllabics":function(n){return n>=5120&&n<=5759},"Unified Canadian Aboriginal Syllabics Extended":function(n){return n>=6320&&n<=6399},"General Punctuation":function(n){return n>=8192&&n<=8303},"Letterlike Symbols":function(n){return n>=8448&&n<=8527},"Number Forms":function(n){return n>=8528&&n<=8591},"Miscellaneous Technical":function(n){return n>=8960&&n<=9215},"Control Pictures":function(n){return n>=9216&&n<=9279},"Optical Character Recognition":function(n){return n>=9280&&n<=9311},"Enclosed Alphanumerics":function(n){return n>=9312&&n<=9471},"Geometric Shapes":function(n){return n>=9632&&n<=9727},"Miscellaneous Symbols":function(n){return n>=9728&&n<=9983},"Miscellaneous Symbols and Arrows":function(n){return n>=11008&&n<=11263},"CJK Radicals Supplement":function(n){return n>=11904&&n<=12031},"Kangxi Radicals":function(n){return n>=12032&&n<=12255},"Ideographic Description Characters":function(n){return n>=12272&&n<=12287},"CJK Symbols and Punctuation":function(n){return n>=12288&&n<=12351},Hiragana:function(n){return n>=12352&&n<=12447},Katakana:function(n){return n>=12448&&n<=12543},Bopomofo:function(n){return n>=12544&&n<=12591},"Hangul Compatibility Jamo":function(n){return n>=12592&&n<=12687},Kanbun:function(n){return n>=12688&&n<=12703},"Bopomofo Extended":function(n){return n>=12704&&n<=12735},"CJK Strokes":function(n){return n>=12736&&n<=12783},"Katakana Phonetic Extensions":function(n){return n>=12784&&n<=12799},"Enclosed CJK Letters and Months":function(n){return n>=12800&&n<=13055},"CJK Compatibility":function(n){return n>=13056&&n<=13311},"CJK Unified Ideographs Extension A":function(n){return n>=13312&&n<=19903},"Yijing Hexagram Symbols":function(n){return n>=19904&&n<=19967},"CJK Unified Ideographs":function(n){return n>=19968&&n<=40959},"Yi Syllables":function(n){return n>=40960&&n<=42127},"Yi Radicals":function(n){return n>=42128&&n<=42191},"Hangul Jamo Extended-A":function(n){return n>=43360&&n<=43391},"Hangul Syllables":function(n){return n>=44032&&n<=55215},"Hangul Jamo Extended-B":function(n){return n>=55216&&n<=55295},"Private Use Area":function(n){return n>=57344&&n<=63743},"CJK Compatibility Ideographs":function(n){return n>=63744&&n<=64255},"Arabic Presentation Forms-A":function(n){return n>=64336&&n<=65023},"Vertical Forms":function(n){return n>=65040&&n<=65055},"CJK Compatibility Forms":function(n){return n>=65072&&n<=65103},"Small Form Variants":function(n){return n>=65104&&n<=65135},"Arabic Presentation Forms-B":function(n){return n>=65136&&n<=65279},"Halfwidth and Fullwidth Forms":function(n){return n>=65280&&n<=65519}};t.exports=i},{}],245:[function(n,t){"use strict";var i=function(n,t){this.max=n;this.onRemove=t;this.reset()};i.prototype.reset=function(){var n=this,t;for(t in n.data)n.onRemove(n.data[t]);return this.data={},this.order=[],this};i.prototype.add=function(n,t){if(this.has(n))this.order.splice(this.order.indexOf(n),1),this.data[n]=t,this.order.push(n);else if(this.data[n]=t,this.order.push(n),this.order.length>this.max){var i=this.get(this.order[0]);i&&this.onRemove(i)}return this};i.prototype.has=function(n){return n in this.data};i.prototype.keys=function(){return this.order};i.prototype.get=function(n){if(!this.has(n))return null;var t=this.data[n];return delete this.data[n],this.order.splice(this.order.indexOf(n),1),t};i.prototype.getWithoutRemoving=function(n){return this.has(n)?this.data[n]:null};i.prototype.remove=function(n){if(!this.has(n))return this;var t=this.data[n];return delete this.data[n],this.onRemove(t),this.order.splice(this.order.indexOf(n),1),this};i.prototype.setMaxSize=function(n){var t=this,i;for(this.max=n;this.order.length>this.max;)i=t.get(t.order[0]),i&&t.onRemove(i);return this};t.exports=i},{}],246:[function(n,t,i){"use strict";function f(n,t){var i=u(o.API_URL);if(n.protocol=i.protocol,n.authority=i.authority,"/"!==i.path&&(n.path=""+i.path+n.path),!o.REQUIRE_ACCESS_TOKEN)return e(n);if(!(t=t||o.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+h);if("s"===t[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+h);return n.params.push("access_token="+t),e(n)}function r(n){return 0===n.indexOf("mapbox:")}function a(n){for(var t=0;t<n.length;t++)0===n[t].indexOf("access_token=tk.")&&(n[t]="access_token="+(o.ACCESS_TOKEN||""))}function u(n){var t=n.match(l);if(!t)throw new Error("Unable to parse URL object");return{protocol:t[1],authority:t[2],path:t[3]||"/",params:t[4]?t[4].split("&"):[]}}function e(n){var t=n.params.length?"?"+n.params.join("&"):"";return n.protocol+"://"+n.authority+n.path+t}var o=n("./config"),s=n("./browser"),h="See https://www.mapbox.com/api-documentation/#access-tokens",c,l;i.isMapboxURL=r;i.normalizeStyleURL=function(n,t){if(!r(n))return n;var i=u(n);return i.path="/styles/v1"+i.path,f(i,t)};i.normalizeGlyphsURL=function(n,t){if(!r(n))return n;var i=u(n);return i.path="/fonts/v1"+i.path,f(i,t)};i.normalizeSourceURL=function(n,t){if(!r(n))return n;var i=u(n);return i.path="/v4/"+i.authority+".json",i.params.push("secure"),f(i,t)};i.normalizeSpriteURL=function(n,t,i,o){var s=u(n);return r(n)?(s.path="/styles/v1"+s.path+"/sprite"+t+i,f(s,o)):(s.path+=""+t+i,e(s))};c=/(\.(png|jpg)\d*)(?=$)/;i.normalizeTileURL=function(n,t,i){if(!t||!r(t))return n;var f=u(n),o=s.devicePixelRatio>=2||512===i?"@2x":"",h=s.supportsWebp?".webp":"$1";return f.path=f.path.replace(c,""+o+h),a(f.params),e(f)};l=/^(\w+):\/\/([^\/?]*)(\/[^?]+)?\??(.+)?/},{"./browser":231,"./config":235}],247:[function(n,t,i){"use strict";var r=n("./is_char_in_unicode_block");t.exports.allowsIdeographicBreaking=function(n){for(var u,t=0,r=n;t<r.length;t+=1)if(u=r[t],!i.charAllowsIdeographicBreaking(u.charCodeAt(0)))return!1;return!0};t.exports.allowsVerticalWritingMode=function(n){for(var u,t=0,r=n;t<r.length;t+=1)if(u=r[t],i.charHasUprightVerticalOrientation(u.charCodeAt(0)))return!0;return!1};t.exports.allowsLetterSpacing=function(n){for(var u,t=0,r=n;t<r.length;t+=1)if(u=r[t],!i.charAllowsLetterSpacing(u.charCodeAt(0)))return!1;return!0};t.exports.charAllowsLetterSpacing=function(n){return!r.Arabic(n)&&!r["Arabic Supplement"](n)&&!r["Arabic Extended-A"](n)&&!r["Arabic Presentation Forms-A"](n)&&!r["Arabic Presentation Forms-B"](n)};t.exports.charAllowsIdeographicBreaking=function(n){return!(n<11904)&&(!!r["Bopomofo Extended"](n)||!!r.Bopomofo(n)||!!r["CJK Compatibility Forms"](n)||!!r["CJK Compatibility Ideographs"](n)||!!r["CJK Compatibility"](n)||!!r["CJK Radicals Supplement"](n)||!!r["CJK Strokes"](n)||!!r["CJK Symbols and Punctuation"](n)||!!r["CJK Unified Ideographs Extension A"](n)||!!r["CJK Unified Ideographs"](n)||!!r["Enclosed CJK Letters and Months"](n)||!!r["Halfwidth and Fullwidth Forms"](n)||!!r.Hiragana(n)||!!r["Ideographic Description Characters"](n)||!!r["Kangxi Radicals"](n)||!!r["Katakana Phonetic Extensions"](n)||!!r.Katakana(n)||!!r["Vertical Forms"](n)||!!r["Yi Radicals"](n)||!!r["Yi Syllables"](n))};i.charHasUprightVerticalOrientation=function(n){return 746===n||747===n||!(n<4352)&&(!!r["Bopomofo Extended"](n)||!!r.Bopomofo(n)||!(!r["CJK Compatibility Forms"](n)||n>=65097&&n<=65103)||!!r["CJK Compatibility Ideographs"](n)||!!r["CJK Compatibility"](n)||!!r["CJK Radicals Supplement"](n)||!!r["CJK Strokes"](n)||!(!r["CJK Symbols and Punctuation"](n)||n>=12296&&n<=12305||n>=12308&&n<=12319||12336===n)||!!r["CJK Unified Ideographs Extension A"](n)||!!r["CJK Unified Ideographs"](n)||!!r["Enclosed CJK Letters and Months"](n)||!!r["Hangul Compatibility Jamo"](n)||!!r["Hangul Jamo Extended-A"](n)||!!r["Hangul Jamo Extended-B"](n)||!!r["Hangul Jamo"](n)||!!r["Hangul Syllables"](n)||!!r.Hiragana(n)||!!r["Ideographic Description Characters"](n)||!!r.Kanbun(n)||!!r["Kangxi Radicals"](n)||!!r["Katakana Phonetic Extensions"](n)||!(!r.Katakana(n)||12540===n)||!(!r["Halfwidth and Fullwidth Forms"](n)||65288===n||65289===n||65293===n||n>=65306&&n<=65310||65339===n||65341===n||65343===n||n>=65371&&n<=65503||65507===n||n>=65512&&n<=65519)||!(!r["Small Form Variants"](n)||n>=65112&&n<=65118||n>=65123&&n<=65126)||!!r["Unified Canadian Aboriginal Syllabics"](n)||!!r["Unified Canadian Aboriginal Syllabics Extended"](n)||!!r["Vertical Forms"](n)||!!r["Yijing Hexagram Symbols"](n)||!!r["Yi Syllables"](n)||!!r["Yi Radicals"](n))};i.charHasNeutralVerticalOrientation=function(n){return!(!r["Latin-1 Supplement"](n)||167!==n&&169!==n&&174!==n&&177!==n&&188!==n&&189!==n&&190!==n&&215!==n&&247!==n)||!(!r["General Punctuation"](n)||8214!==n&&8224!==n&&8225!==n&&8240!==n&&8241!==n&&8251!==n&&8252!==n&&8258!==n&&8263!==n&&8264!==n&&8265!==n&&8273!==n)||!!r["Letterlike Symbols"](n)||!!r["Number Forms"](n)||!(!r["Miscellaneous Technical"](n)||!(n>=8960&&n<=8967||n>=8972&&n<=8991||n>=8996&&n<=9e3||9003===n||n>=9085&&n<=9114||n>=9150&&n<=9165||9167===n||n>=9169&&n<=9179||n>=9186&&n<=9215))||!(!r["Control Pictures"](n)||9251===n)||!!r["Optical Character Recognition"](n)||!!r["Enclosed Alphanumerics"](n)||!!r["Geometric Shapes"](n)||!(!r["Miscellaneous Symbols"](n)||n>=9754&&n<=9759)||!(!r["Miscellaneous Symbols and Arrows"](n)||!(n>=11026&&n<=11055||n>=11088&&n<=11097||n>=11192&&n<=11243))||!!r["CJK Symbols and Punctuation"](n)||!!r.Katakana(n)||!!r["Private Use Area"](n)||!!r["CJK Compatibility Forms"](n)||!!r["Small Form Variants"](n)||!!r["Halfwidth and Fullwidth Forms"](n)||8734===n||8756===n||8757===n||n>=9984&&n<=10087||n>=10102&&n<=10131||65532===n||65533===n};i.charHasRotatedVerticalOrientation=function(n){return!(i.charHasUprightVerticalOrientation(n)||i.charHasNeutralVerticalOrientation(n))}},{"./is_char_in_unicode_block":244}],248:[function(n,t){"use strict";var i=n("../geo/lng_lat");t.exports=function(n,t,r){var u;if(n=new i(n.lng,n.lat),t){var f=new i(n.lng-360,n.lat),e=new i(n.lng+360,n.lat),o=r.locationPoint(n).distSqr(t);r.locationPoint(f).distSqr(t)<o?n=f:r.locationPoint(e).distSqr(t)<o&&(n=e)}for(;Math.abs(n.lng-r.center.lng)>180;){if(u=r.locationPoint(n),u.x>=0&&u.y>=0&&u.x<=r.width&&u.y<=r.height)break;n.lng>r.center.lng?n.lng-=360:n.lng+=360}return n}},{"../geo/lng_lat":68}],249:[function(n,t){"use strict";function s(n){var p=JSON.stringify(n),y,nt,o,s,c,t;if(u[p])return u[p];var w=void 0===n.alignment?1:n.alignment,v=0,b=0,k=["Uint8"],d=n.members.map(function(n){k.indexOf(n.type)<0&&k.push(n.type);var t=r(n.type),u=v=e(v,Math.max(w,t)),i=n.components||1;return b=Math.max(b,t),v+=t*i,{name:n.name,type:n.type,components:i,offset:u}}),g=e(v,Math.max(b,w)),f=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}(a);for(f.prototype.alignment=w,f.prototype.size=g,y=0,nt=d;y<nt.length;y+=1)for(o=nt[y],s=0;s<o.components;s++){if(c=o.name,o.components>1&&(c+=s),c in f.prototype)throw new Error(c+" is a reserved name and cannot be used as a member name.");Object.defineProperty(f.prototype,c,l(o,s))}return t=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}(i),t.prototype.members=d,t.prototype.StructType=f,t.prototype.bytesPerElement=g,t.prototype.emplaceBack=h(d,g),t.prototype._usedTypes=k,u[p]=t,t}function e(n,t){return Math.ceil(n/t)*t}function r(n){return o[n].BYTES_PER_ELEMENT}function f(n){return n.toLowerCase()}function h(n,t){for(var u,i,o,c,v,l=[],s=[],e="var i = this.length;\nthis.resize(this.length + 1);\n",h=0,a=n;h<a.length;h+=1)for(u=a[h],i=r(u.type),l.indexOf(i)<0&&(l.push(i),e+="var o"+i.toFixed(0)+" = i * "+(t/i).toFixed(0)+";\n"),o=0;o<u.components;o++)c="v"+s.length,v="o"+i.toFixed(0)+" + "+(u.offset/i+o).toFixed(0),e+="this."+f(u.type)+"["+v+"] = "+c+";\n",s.push(c);return e+="return i;",new Function(s.toString(),e)}function c(n,t){var i="this._pos"+r(n.type).toFixed(0),u=(n.offset/r(n.type)+t).toFixed(0),e=i+" + "+u;return"this._structArray."+f(n.type)+"["+e+"]"}function l(n,t){var i=c(n,t);return{get:new Function("return "+i+";"),set:new Function("x",i+" = x;")}}var u;t.exports=s;var o={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},a=function(n,t){this._structArray=n;this._pos1=t*this.size;this._pos2=this._pos1/2;this._pos4=this._pos1/4;this._pos8=this._pos1/8},v=128,y=5,i=function(n){this.isTransferred=!1;void 0!==n?(this.arrayBuffer=n.arrayBuffer,this.length=n.length,this.capacity=this.arrayBuffer.byteLength/this.bytesPerElement,this._refreshViews()):(this.capacity=-1,this.resize(0))};i.serialize=function(){return{members:this.prototype.members,alignment:this.prototype.StructType.prototype.alignment}};i.prototype.serialize=function(n){return this._trim(),n&&(this.isTransferred=!0,n.push(this.arrayBuffer)),{length:this.length,arrayBuffer:this.arrayBuffer}};i.prototype.get=function(n){return new this.StructType(this,n)};i.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())};i.prototype.clear=function(){this.length=0};i.prototype.resize=function(n){if(this.length=n,n>this.capacity){this.capacity=Math.max(n,Math.floor(this.capacity*y),v);this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var t=this.uint8;this._refreshViews();t&&this.uint8.set(t)}};i.prototype._refreshViews=function(){for(var i,n=this,t=0,r=n._usedTypes;t<r.length;t+=1)i=r[t],n[f(i)]=new o[i](n.arrayBuffer)};i.prototype.toArray=function(n,t){for(var u,f=this,r=[],i=n;i<t;i++)u=f.get(i),r.push(u);return r};u={}},{}],250:[function(n,t){"use strict";var i=n("./browser"),r=function(n,t){this.frequency=n;this.throttledFunction=t;this.lastInvocation=0};r.prototype.invoke=function(){var n=this,t;this.pendingInvocation||(t=0===this.lastInvocation?0:this.lastInvocation+this.frequency-i.now(),t<=0?(this.lastInvocation=i.now(),this.throttledFunction()):this.pendingInvocation=setTimeout(function(){n.pendingInvocation=void 0;n.lastInvocation=i.now();n.throttledFunction()},t))};r.prototype.stop=function(){this.pendingInvocation&&(clearTimeout(this.pendingInvocation),this.pendingInvocation=void 0)};t.exports=r},{"./browser":231}],251:[function(n,t){"use strict";function i(n,t){return t.replace(/{([^{}]+)}/g,function(t,i){return i in n?String(n[i]):""})}t.exports=i},{}],252:[function(n,t,i){"use strict";var f=n("@mapbox/unitbezier"),e=n("../geo/coordinate"),o=n("@mapbox/point-geometry"),u,r;i.easeCubicInOut=function(n){if(n<=0)return 0;if(n>=1)return 1;var t=n*n,i=t*n;return 4*(n<.5?i:3*(n-t)+i-.75)};i.bezier=function(n,t,i,r){var u=new f(n,t,i,r);return function(n){return u.solve(n)}};i.ease=i.bezier(.25,.1,.25,1);i.clamp=function(n,t,i){return Math.min(i,Math.max(t,n))};i.wrap=function(n,t,i){var r=i-t,u=((n-t)%r+r)%r+t;return u===t?i:u};i.asyncAll=function(n,t,i){if(!n.length)return i(null,[]);var f=n.length,r=new Array(n.length),u=null;n.forEach(function(n,e){t(n,function(n,t){n&&(u=n);r[e]=t;0==--f&&i(u,r)})})};i.values=function(n){var t=[],i;for(i in n)t.push(n[i]);return t};i.keysDifference=function(n,t){var r=[],i;for(i in n)i in t||r.push(i);return r};i.extend=function(n){for(var i,u,f,e,r=[],t=arguments.length-1;t-->0;)r[t]=arguments[t+1];for(i=0,u=r;i<u.length;i+=1){f=u[i];for(e in f)n[e]=f[e]}return n};i.pick=function(n,t){for(var r,u={},i=0;i<t.length;i++)r=t[i],r in n&&(u[r]=n[r]);return u};u=1;i.uniqueId=function(){return u++};i.bindAll=function(n,t){n.forEach(function(n){t[n]&&(t[n]=t[n].bind(t))})};i.getCoordinatesCenter=function(n){for(var i=1/0,r=1/0,u=-1/0,f=-1/0,t=0;t<n.length;t++)i=Math.min(i,n[t].column),r=Math.min(r,n[t].row),u=Math.max(u,n[t].column),f=Math.max(f,n[t].row);var o=u-i,s=f-r,h=Math.max(o,s),c=Math.max(0,Math.floor(-Math.log(h)/Math.LN2));return new e((i+u)/2,(r+f)/2,0).zoomTo(c)};i.endsWith=function(n,t){return-1!==n.indexOf(t,n.length-t.length)};i.mapObject=function(n,t,i){var f=this,u={},r;for(r in n)u[r]=t.call(i||f,n[r],r,n);return u};i.filterObject=function(n,t,i){var f=this,u={},r;for(r in n)t.call(i||f,n[r],r,n)&&(u[r]=n[r]);return u};i.deepEqual=function(n,t){var r,u;if(Array.isArray(n)){if(!Array.isArray(t)||n.length!==t.length)return!1;for(r=0;r<n.length;r++)if(!i.deepEqual(n[r],t[r]))return!1;return!0}if("object"==typeof n&&null!==n&&null!==t){if("object"!=typeof t||Object.keys(n).length!==Object.keys(t).length)return!1;for(u in n)if(!i.deepEqual(n[u],t[u]))return!1;return!0}return n===t};i.clone=function(n){return Array.isArray(n)?n.map(i.clone):"object"==typeof n&&n?i.mapObject(n,i.clone):n};i.arraysIntersect=function(n,t){for(var i=0;i<n.length;i++)if(t.indexOf(n[i])>=0)return!0;return!1};r={};i.warnOnce=function(n){r[n]||("undefined"!=typeof console&&console.warn(n),r[n]=!0)};i.isCounterClockwise=function(n,t,i){return(i.y-n.y)*(t.x-n.x)>(t.y-n.y)*(i.x-n.x)};i.calculateSignedArea=function(n){for(var u=0,t=0,f=n.length,e=f-1,i=void 0,r=void 0;t<f;e=t++)i=n[t],r=n[e],u+=(r.x-i.x)*(i.y+r.y);return u};i.isClosedPolygon=function(n){if(n.length<4)return!1;var t=n[0],r=n[n.length-1];return!(Math.abs(t.x-r.x)>0||Math.abs(t.y-r.y)>0)&&Math.abs(i.calculateSignedArea(n))>.01};i.sphericalToCartesian=function(n){var r=n[0],t=n[1],i=n[2];return t+=90,t*=Math.PI/180,i*=Math.PI/180,[r*Math.cos(t)*Math.sin(i),r*Math.sin(t)*Math.sin(i),r*Math.cos(i)]};i.parseCacheControl=function(n){var t={},i;return(n.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,function(n,i,r,u){var f=r||u;return t[i]=!f||f.toLowerCase(),""}),t["max-age"])&&(i=parseInt(t["max-age"],10),isNaN(i)?delete t["max-age"]:t["max-age"]=i),t}},{"../geo/coordinate":67,"@mapbox/point-geometry":2,"@mapbox/unitbezier":5}],253:[function(n,t){"use strict";var i=function(n,t,i,r){this.type="Feature";this._vectorTileFeature=n;n._z=t;n._x=i;n._y=r;this.properties=n.properties;null!=n.id&&(this.id=n.id)},r={geometry:{}};r.geometry.get=function(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry};r.geometry.set=function(n){this._geometry=n};i.prototype.toJSON=function(){var t=this,i={geometry:this.geometry},n;for(n in t)"_geometry"!==n&&"_vectorTileFeature"!==n&&(i[n]=t[n]);return i};Object.defineProperties(i.prototype,r);t.exports=i},{}],254:[function(n,t){"use strict";var i=n("./script_detection");t.exports=function(n){for(var f,e,u="",r=0;r<n.length;r++)f=n.charCodeAt(r+1)||null,e=n.charCodeAt(r-1)||null,u+=(!f||!i.charHasRotatedVerticalOrientation(f)||t.exports.lookup[n[r+1]])&&(!e||!i.charHasRotatedVerticalOrientation(e)||t.exports.lookup[n[r-1]])&&t.exports.lookup[n[r]]?t.exports.lookup[n[r]]:n[r];return u};t.exports.lookup={"!":"︕","#":"＃",$:"＄","%":"％","&":"＆","(":"︵",")":"︶","*":"＊","+":"＋",",":"︐","-":"︲",".":"・","/":"／",":":"︓",";":"︔","<":"︿","=":"＝",">":"﹀","?":"︖","@":"＠","[":"﹇","\\":"＼","]":"﹈","^":"＾",_:"︳","`":"｀","{":"︷","|":"―","}":"︸","~":"～","¢":"￠","£":"￡","¥":"￥","¦":"￤","¬":"￢","¯":"￣","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"￦","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","！":"︕","（":"︵","）":"︶","，":"︐","－":"︲","．":"・","：":"︓","；":"︔","＜":"︿","＞":"﹀","？":"︖","［":"﹇","］":"﹈","＿":"︳","｛":"︷","｜":"―","｝":"︸","｟":"︵","｠":"︶","｡":"︒","｢":"﹁","｣":"﹂"}},{"./script_detection":247}],255:[function(n,t){"use strict";var r=n("./web_worker"),i=function(){this.active={}};i.prototype.acquire=function(t){var u=this,i;if(!this.workers)for(i=n("../").workerCount,this.workers=[];this.workers.length<i;)u.workers.push(new r);return this.active[t]=!0,this.workers.slice()};i.prototype.release=function(n){delete this.active[n];0===Object.keys(this.active).length&&(this.workers.forEach(function(n){n.terminate()}),this.workers=null)};t.exports=i},{"../":73,"./web_worker":232}]},{},[73])(73)});!function(n){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this;t.MapboxDraw=n()}}(function(){return function n(t,i,r){function u(f,o){var h,c,s;if(!i[f]){if(!t[f]){if(h="function"==typeof require&&require,!o&&h)return h(f,!0);if(e)return e(f,!0);c=new Error("Cannot find module '"+f+"'");throw c.code="MODULE_NOT_FOUND",c;}s=i[f]={exports:{}};t[f][0].call(s.exports,function(n){var i=t[f][1][n];return u(i||n)},s,s.exports,n,t,i,r)}return i[f].exports}for(var e="function"==typeof require&&require,f=0;f<r.length;f++)u(r[f]);return u}({1:[function(n,t){"use strict";var i=n("./src/setup"),r=n("./src/options"),u=n("./src/api"),f=n("./src/constants"),e=function(n,t){var e,o;return n=r(n),e={options:n},t=u(e,t),e.api=t,o=i(e),t.onAdd=o.onAdd,t.onRemove=o.onRemove,t.types=f.types,t.options=n,t};t.exports=function(n){e(n,this)};t.exports.modes=n("./src/modes")},{"./src/api":23,"./src/constants":24,"./src/modes":57,"./src/options":62,"./src/setup":64}],2:[function(n,t){function u(n){var t,i=0;switch(n.type){case"Polygon":return f(n.coordinates);case"MultiPolygon":for(t=0;t<n.coordinates.length;t++)i+=f(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+=u(n.geometries[t]);return i}}function f(n){var r=0,t;if(n&&n.length>0)for(r+=Math.abs(i(n[0])),t=1;t<n.length;t++)r-=Math.abs(i(n[t]));return r}function i(n){var h,c,l,u,f,o,t,s=0,i=n.length;if(i>2){for(t=0;t<i;t++)t===i-2?(u=i-2,f=i-1,o=0):t===i-1?(u=i-1,f=0,o=1):(u=t,f=t+1,o=t+2),h=n[u],c=n[f],l=n[o],s+=(r(l[0])-r(h[0]))*Math.sin(r(c[1]));s=s*e.RADIUS*e.RADIUS/2}return s}function r(n){return n*Math.PI/180}var e=n("wgs84");t.exports.geometry=u;t.exports.ring=i},{wgs84:21}],3:[function(n,t){function i(n){if(!n||!n.type)return null;var t=r[n.type];return t?"geometry"===t?{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:n}]}:"feature"===t?{type:"FeatureCollection",features:[n]}:"featurecollection"===t?n:void 0:null}t.exports=i;var r={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featurecollection"}},{}],4:[function(n,t){function i(n,t){var i,f,e;if("object"==typeof n)i=n;else{if("string"!=typeof n)return[{message:"Expected string or object as input",line:0}];try{i=r.parse(n)}catch(n){return f=n.message.match(/line (\d+)/),e=parseInt(f[1],10),[{line:e-1,message:n.message,error:n}]}}return[].concat(u.hint(i,t))}var r=n("jsonlint-lines"),u=n("./object");t.exports.hint=i},{"./object":5,"jsonlint-lines":15}],5:[function(n,t){function r(n,t){function c(n){if(t&&!1===t.noDuplicateMembers||!n.__duplicateProperties__||r.push({message:"An object contained duplicate members, making parsing ambigous: "+n.__duplicateProperties__.join(", "),line:n.__line__}),!u(n,"type","string"))if(a[n.type])n&&a[n.type](n);else{var i=ut[n.type.toLowerCase()];void 0!==i?r.push({message:"Expected "+i+" but got "+n.type+" (case sensitive)",line:n.__line__}):r.push({message:"The type "+n.type+" is unknown",line:n.__line__})}}function s(n,t){return n.every(function(n){return null!==n&&typeof n===t})}function u(n,t,i){if(void 0===n[t])return r.push({message:'"'+t+'" member required',line:n.__line__});if("array"===i){if(!Array.isArray(n[t]))return r.push({message:'"'+t+'" member should be an array, but is an '+typeof n[t]+" instead",line:n.__line__})}else{if("object"===i&&n[t]&&"Object"!==n[t].constructor.name)return r.push({message:'"'+t+'" member should be '+i+", but is an "+n[t].constructor.name+" instead",line:n.__line__});if(i&&typeof n[t]!==i)return r.push({message:'"'+t+'" member should be '+i+", but is an "+typeof n[t]+" instead",line:n.__line__})}}function p(n){if(f(n),e(n),void 0!==n.properties&&r.push({message:'FeatureCollection object cannot contain a "properties" member',line:n.__line__}),void 0!==n.coordinates&&r.push({message:'FeatureCollection object cannot contain a "coordinates" member',line:n.__line__}),!u(n,"features","array")){if(!s(n.features,"object"))return r.push({message:"Every feature must be an object",line:n.__line__});n.features.forEach(y)}}function v(n,i){if(!Array.isArray(n))return r.push({message:"position should be an array, is a "+typeof n+" instead",line:n.__line__||i});if(n.length<2)return r.push({message:"position must have 2 or more elements",line:n.__line__||i});if(n.length>3)return r.push({message:"position should not have more than 3 elements",level:"message",line:n.__line__||i});if(!s(n,"number"))return r.push({message:"each element in a position must be a number",line:n.__line__||i});if(t&&t.precisionWarning){if(h===l)return h+=1,r.push({message:"truncated warnings: we've encountered coordinate precision warning "+l+" times, no more warnings will be reported",level:"message",line:n.__line__||i});h<l&&n.forEach(function(t){var u=0,f=String(t).split(".")[1];if(void 0!==f&&(u=f.length),u>rt)return h+=1,r.push({message:"precision of coordinates should be reduced",level:"message",line:n.__line__||i})})}}function o(n,t,i,u){if(void 0===u&&void 0!==n.__line__&&(u=n.__line__),0===i)return v(n,u);if(1===i&&t)if("LinearRing"===t){if(!Array.isArray(n[n.length-1]))return r.push({message:"a number was found where a coordinate array should have been found: this needs to be nested more deeply",line:u}),!0;if(n.length<4&&r.push({message:"a LinearRing of coordinates needs to have four or more positions",line:u}),n.length&&(n[n.length-1].length!==n[0].length||!n[n.length-1].every(function(t,i){return n[0][i]===t})))return r.push({message:"the first and last positions in a LinearRing of coordinates must be the same",line:u}),!0}else if("Line"===t&&n.length<2)return r.push({message:"a line needs to have two or more coordinates to be valid",line:u});if(Array.isArray(n))return n.map(function(n){return o(n,t,i-1,n.__line__||u)}).some(function(n){return n});r.push({message:"a number was found where a coordinate array should have been found: this needs to be nested more deeply",line:u})}function f(n){n.crs&&("object"==typeof n.crs&&n.crs.properties&&"urn:ogc:def:crs:OGC:1.3:CRS84"===n.crs.properties.name?r.push({message:"old-style crs member is not recommended, this object is equivalent to the default and should be removed",line:n.__line__}):r.push({message:"old-style crs member is not recommended",line:n.__line__}))}function e(n){if(n.bbox)return Array.isArray(n.bbox)?(s(n.bbox,"number")||r.push({message:"each element in a bbox member must be a number",line:n.bbox.__line__}),4!==n.bbox.length&&6!==n.bbox.length&&r.push({message:"bbox must contain 4 elements (for 2D) or 6 elements (for 3D)",line:n.bbox.__line__}),r.length):void r.push({message:"bbox member must be an array of numbers, but is a "+typeof n.bbox,line:n.__line__})}function w(n){void 0!==n.properties&&r.push({message:'geometry object cannot contain a "properties" member',line:n.__line__});void 0!==n.geometry&&r.push({message:'geometry object cannot contain a "geometry" member',line:n.__line__});void 0!==n.features&&r.push({message:'geometry object cannot contain a "features" member',line:n.__line__})}function b(n){f(n);e(n);w(n);u(n,"coordinates","array")||v(n.coordinates)}function k(n){f(n);e(n);u(n,"coordinates","array")||o(n.coordinates,"LinearRing",2)||i(n,r)}function d(n){f(n);e(n);u(n,"coordinates","array")||o(n.coordinates,"LinearRing",3)||i(n,r)}function g(n){f(n);e(n);u(n,"coordinates","array")||o(n.coordinates,"Line",1)}function nt(n){f(n);e(n);u(n,"coordinates","array")||o(n.coordinates,"Line",2)}function tt(n){f(n);e(n);u(n,"coordinates","array")||o(n.coordinates,"",1)}function it(n){f(n);e(n);u(n,"geometries","array")||(s(n.geometries,"object")||r.push({message:"The geometries array in a GeometryCollection must contain only geometry objects",line:n.__line__}),1===n.geometries.length&&r.push({message:"GeometryCollection with a single geometry should be avoided in favor of single part or a single object of multi-part type",line:n.geometries.__line__}),n.geometries.forEach(function(t){t&&("GeometryCollection"===t.type&&r.push({message:"GeometryCollection should avoid nested geometry collections",line:n.geometries.__line__}),c(t))}))}function y(n){f(n);e(n);void 0!==n.id&&"string"!=typeof n.id&&"number"!=typeof n.id&&r.push({message:'Feature "id" member must have a string or number value',line:n.__line__});void 0!==n.features&&r.push({message:'Feature object cannot contain a "features" member',line:n.__line__});void 0!==n.coordinates&&r.push({message:'Feature object cannot contain a "coordinates" member',line:n.__line__});"Feature"!==n.type&&r.push({message:"GeoJSON features must have a type=feature member",line:n.__line__});u(n,"properties","object");u(n,"geometry","object")||n.geometry&&c(n.geometry)}var r=[],h=0,l=10,rt=6,a={Point:b,Feature:y,MultiPoint:tt,LineString:g,MultiLineString:nt,FeatureCollection:p,GeometryCollection:it,Polygon:k,MultiPolygon:d},ut=Object.keys(a).reduce(function(n,t){return n[t.toLowerCase()]=t,n},{});return"object"!=typeof n||null===n||void 0===n?(r.push({message:"The root of a GeoJSON object must be an object.",line:0}),r):(c(n),r.forEach(function(n){({}).hasOwnProperty.call(n,"line")&&void 0===n.line&&delete n.line}),r)}var i=n("./rhr");t.exports.hint=r},{"./rhr":6}],6:[function(n,t){function i(n){return n*Math.PI/180}function r(n){var f=0,r,u,t;if(n.length>2)for(t=0;t<n.length-1;t++)r=n[t],u=n[t+1],f+=i(u[0]-r[0])*(2+Math.sin(i(r[1]))+Math.sin(i(u[1])));return f>=0}function u(n){return n&&n.length>0&&(r(n[0])||!n.slice(1,n.length).every(r))?!1:!0}function f(n){return"Polygon"===n.type?u(n.coordinates):"MultiPolygon"===n.type?n.coordinates.every(u):void 0}t.exports=function(n,t){f(n)||t.push({message:"Polygons and MultiPolygons should follow the right-hand rule",level:"message",line:n.__line__})}},{}],7:[function(){},{}],8:[function(n,t){function i(){if(!(this instanceof i))return new i;this._bbox=[1/0,1/0,-1/0,-1/0];this._valid=!1}t.exports=i;i.prototype.include=function(n){return this._valid=!0,this._bbox[0]=Math.min(this._bbox[0],n[0]),this._bbox[1]=Math.min(this._bbox[1],n[1]),this._bbox[2]=Math.max(this._bbox[2],n[0]),this._bbox[3]=Math.max(this._bbox[3],n[1]),this};i.prototype.union=function(n){return this._valid=!0,this._bbox[0]=Math.min(this._bbox[0],n[0]),this._bbox[1]=Math.min(this._bbox[1],n[1]),this._bbox[2]=Math.max(this._bbox[2],n[2]),this._bbox[3]=Math.max(this._bbox[3],n[3]),this};i.prototype.bbox=function(){return this._valid?this._bbox:null};i.prototype.contains=function(n){return this._valid?this._bbox[0]<=n[0]&&this._bbox[1]<=n[1]&&this._bbox[2]>=n[0]&&this._bbox[3]>=n[1]:null};i.prototype.polygon=function(){return this._valid?{type:"Polygon",coordinates:[[[this._bbox[0],this._bbox[1]],[this._bbox[2],this._bbox[1]],[this._bbox[2],this._bbox[3]],[this._bbox[0],this._bbox[3]],[this._bbox[0],this._bbox[1]]]]}:null}},{}],9:[function(n,t){t.exports=function(n){function t(n){return Array.isArray(n)&&n.length&&"number"==typeof n[0]?[n]:n.reduce(function(n,i){return Array.isArray(i)&&Array.isArray(i[0])?n.concat(t(i)):(n.push(i),n)},[])}return t(n)}},{}],10:[function(n,t){var i=n("geojson-normalize"),r=n("geojson-flatten"),u=n("./flatten");t.exports=function(n){if(!n)return[];var f=r(i(n)),t=[];return f.features.forEach(function(n){n.geometry&&(t=t.concat(u(n.geometry.coordinates)))}),t}},{"./flatten":9,"geojson-flatten":12,"geojson-normalize":13}],11:[function(n,t){function i(n){for(var i=f(),u=r(n),t=0;t<u.length;t++)i.include(u[t]);return i}var r=n("geojson-coords"),u=n("traverse"),f=n("extent");t.exports=function(n){return i(n).bbox()};t.exports.polygon=function(n){return i(n).polygon()};t.exports.bboxify=function(n){return u(n).map(function(n){n&&"string"==typeof n.type&&(n.bbox=i(n).bbox(),this.update(n))})}},{extent:8,"geojson-coords":10,traverse:20}],12:[function(n,t){function i(n){switch(n&&n.type||null){case"FeatureCollection":return n.features=n.features.reduce(function(n,t){return n.concat(i(t))},[]),n;case"Feature":return i(n.geometry).map(function(t){return{type:"Feature",properties:JSON.parse(JSON.stringify(n.properties)),geometry:t}});case"MultiPoint":return n.coordinates.map(function(n){return{type:"Point",coordinates:n}});case"MultiPolygon":return n.coordinates.map(function(n){return{type:"Polygon",coordinates:n}});case"MultiLineString":return n.coordinates.map(function(n){return{type:"LineString",coordinates:n}});case"GeometryCollection":return n.geometries;case"Point":case"Polygon":case"LineString":return[n];default:return n}}t.exports=i},{}],13:[function(n,t,i){arguments[4][3][0].apply(i,arguments)},{dup:3}],14:[function(n,t){var i=t.exports=function(n,t){var u,r,h,e,o;if(t||(t=16),void 0===n&&(n=128),n<=0)return"0";for(u=Math.log(Math.pow(2,n))/Math.log(t),r=2;u===1/0;r*=2)u=Math.log(Math.pow(2,n/r))/Math.log(t)*r;for(var s=u-Math.floor(u),f="",r=0;r<Math.floor(u);r++)e=Math.floor(Math.random()*t).toString(t),f=e+f;return s&&(h=Math.pow(t,s),e=Math.floor(Math.random()*h).toString(t),f=e+f),o=parseInt(f,t),o!==1/0&&o>=Math.pow(2,n)?i(n,t):f};i.rack=function(n,t,r){var u=function(u){var o=0,e;do{if(o++>10){if(!r)throw new Error("too many ID collisions, use more bits");n+=r}e=i(n,t)}while(Object.hasOwnProperty.call(f,e));return f[e]=u,e},f=u.hats={};return u.get=function(n){return u.hats[n]},u.set=function(n,t){return u.hats[n]=t,u},u.bits=n||128,u.base=t||16,u}},{}],15:[function(n,t,i){(function(r){var u=function(){function h(){this.yy={}}var n=function(n,t,i,r){for(i=i||{},r=n.length;r--;i[n[r]]=t);return i},i=[1,12],r=[1,13],u=[1,9],f=[1,10],e=[1,11],o=[1,14],s=[1,15],t=[14,18,22,24],c=[18,22],a=[22,24],l={trace:function(){},yy:{},symbols_:{error:2,JSONString:3,STRING:4,JSONNumber:5,NUMBER:6,JSONNullLiteral:7,NULL:8,JSONBooleanLiteral:9,TRUE:10,FALSE:11,JSONText:12,JSONValue:13,EOF:14,JSONObject:15,JSONArray:16,"{":17,"}":18,JSONMemberList:19,JSONMember:20,":":21,",":22,"[":23,"]":24,JSONElementList:25,$accept:0,$end:1},terminals_:{2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},productions_:[0,[3,1],[5,1],[7,1],[9,1],[9,1],[12,2],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[15,2],[15,3],[20,3],[19,1],[19,3],[16,2],[16,3],[25,1],[25,3]],performAction:function(n,t,i,r,u,f){var e=f.length-1;switch(u){case 1:this.$=n.replace(/\\(\\|")/g,"$1").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\v/g,"\v").replace(/\\f/g,"\f").replace(/\\b/g,"\b");break;case 2:this.$=Number(n);break;case 3:this.$=null;break;case 4:this.$=!0;break;case 5:this.$=!1;break;case 6:return this.$=f[e-1];case 13:this.$={};Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 14:case 19:this.$=f[e-1];Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 15:this.$=[f[e-2],f[e]];break;case 16:this.$={};this.$[f[e][0]]=f[e][1];break;case 17:this.$=f[e-2];void 0!==f[e-2][f[e][0]]&&(this.$.__duplicateProperties__||Object.defineProperty(this.$,"__duplicateProperties__",{value:[],enumerable:!1}),this.$.__duplicateProperties__.push(f[e][0]));f[e-2][f[e][0]]=f[e][1];break;case 18:this.$=[];Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 20:this.$=[f[e]];break;case 21:this.$=f[e-2];f[e-2].push(f[e])}},table:[{3:5,4:i,5:6,6:r,7:3,8:u,9:4,10:f,11:e,12:1,13:2,15:7,16:8,17:o,23:s},{1:[3]},{14:[1,16]},n(t,[2,7]),n(t,[2,8]),n(t,[2,9]),n(t,[2,10]),n(t,[2,11]),n(t,[2,12]),n(t,[2,3]),n(t,[2,4]),n(t,[2,5]),n([14,18,21,22,24],[2,1]),n(t,[2,2]),{3:20,4:i,18:[1,17],19:18,20:19},{3:5,4:i,5:6,6:r,7:3,8:u,9:4,10:f,11:e,13:23,15:7,16:8,17:o,23:s,24:[1,21],25:22},{1:[2,6]},n(t,[2,13]),{18:[1,24],22:[1,25]},n(c,[2,16]),{21:[1,26]},n(t,[2,18]),{22:[1,28],24:[1,27]},n(a,[2,20]),n(t,[2,14]),{3:20,4:i,20:29},{3:5,4:i,5:6,6:r,7:3,8:u,9:4,10:f,11:e,13:30,15:7,16:8,17:o,23:s},n(t,[2,19]),{3:5,4:i,5:6,6:r,7:3,8:u,9:4,10:f,11:e,13:31,15:7,16:8,17:o,23:s},n(c,[2,17]),n(c,[2,15]),n(a,[2,21])],defaultActions:{16:[2,6]},parseError:function(n,t){function i(n,t){this.message=n;this.hash=t}if(!t.recoverable)throw i.prototype=Error,new i(n,t);this.trace(n)},parse:function(n){var ft=this,u=[0],o=[null],t=[],l=this.table,d="",a=0,g=0,nt=0,et=t.slice.call(arguments,1),i=Object.create(this.lexer),s={yy:{}},v,y,tt,r,b,h,f,it,p,e,rt,w,ut,c,k;for(v in this.yy)Object.prototype.hasOwnProperty.call(this.yy,v)&&(s.yy[v]=this.yy[v]);for(i.setInput(n,s.yy),s.yy.lexer=i,s.yy.parser=this,void 0===i.yylloc&&(i.yylloc={}),y=i.yylloc,t.push(y),tt=i.options&&i.options.ranges,this.parseError="function"==typeof s.yy.parseError?s.yy.parseError:Object.getPrototypeOf(this).parseError,ut=function(){var n;return n=i.lex()||1,"number"!=typeof n&&(n=ft.symbols_[n]||n),n},c={};;){if(h=u[u.length-1],this.defaultActions[h]?f=this.defaultActions[h]:(null!==r&&void 0!==r||(r=ut()),f=l[h]&&l[h][r]),void 0===f||!f.length||!f[0]){k="";w=[];for(p in l[h])this.terminals_[p]&&p>2&&w.push("'"+this.terminals_[p]+"'");k=i.showPosition?"Parse error on line "+(a+1)+":\n"+i.showPosition()+"\nExpecting "+w.join(", ")+", got '"+(this.terminals_[r]||r)+"'":"Parse error on line "+(a+1)+": Unexpected "+(1==r?"end of input":"'"+(this.terminals_[r]||r)+"'");this.parseError(k,{text:i.match,token:this.terminals_[r]||r,line:i.yylineno,loc:y,expected:w})}if(f[0]instanceof Array&&f.length>1)throw new Error("Parse Error: multiple actions possible at state: "+h+", token: "+r);switch(f[0]){case 1:u.push(r);o.push(i.yytext);t.push(i.yylloc);u.push(f[1]);r=null;b?(r=b,b=null):(g=i.yyleng,d=i.yytext,a=i.yylineno,y=i.yylloc,nt>0&&nt--);break;case 2:if(e=this.productions_[f[1]][1],c.$=o[o.length-e],c._$={first_line:t[t.length-(e||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(e||1)].first_column,last_column:t[t.length-1].last_column},tt&&(c._$.range=[t[t.length-(e||1)].range[0],t[t.length-1].range[1]]),void 0!==(it=this.performAction.apply(c,[d,g,a,s.yy,f[1],o,t].concat(et))))return it;e&&(u=u.slice(0,-2*e),o=o.slice(0,-1*e),t=t.slice(0,-1*e));u.push(this.productions_[f[1]][0]);o.push(c.$);t.push(c._$);rt=l[u[u.length-2]][u[u.length-1]];u.push(rt);break;case 3:return!0}}return!0}},v=function(){return{EOF:1,parseError:function(n,t){if(!this.yy.parser)throw new Error(n);this.yy.parser.parseError(n,t)},setInput:function(n,t){return this.yy=t||this.yy||{},this._input=n,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var n=this._input[0];return this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n,n.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),n},unput:function(n){var i=n.length,t=n.split(/(?:\r\n?|\n)/g),r,u;return this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i,r=this.match.split(/(?:\r\n?|\n)/g),this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),t.length-1&&(this.yylineno-=t.length-1),u=this.yylloc.range,this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:t?(t.length===r.length?this.yylloc.first_column:0)+r[r.length-t.length].length-t[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[u[0],u[0]+this.yyleng-i]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(n){this.unput(this.match.slice(n))},pastInput:function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var n=this.match;return n.length<20&&(n+=this._input.substr(0,20-n.length)),(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var n=this.pastInput(),t=new Array(n.length+1).join("-");return n+this.upcomingInput()+"\n"+t+"^"},test_match:function(n,t){var u,i,r,f;if(this.options.backtrack_lexer&&(r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(r.yylloc.range=this.yylloc.range.slice(0))),i=n[0].match(/(?:\r\n?|\n).*/g),i&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+n[0].length},this.yytext+=n[0],this.match+=n[0],this.matches=n,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(n[0].length),this.matched+=n[0],u=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),u)return u;if(this._backtrack){for(f in r)this[f]=r[f];return!1}return!1},next:function(){var r,n,u,f,i,t;if(this.done)return this.EOF;for(this._input||(this.done=!0),this._more||(this.yytext="",this.match=""),i=this._currentRules(),t=0;t<i.length;t++)if((u=this._input.match(this.rules[i[t]]))&&(!n||u[0].length>n[0].length)){if(n=u,f=t,this.options.backtrack_lexer){if(!1!==(r=this.test_match(u,i[t])))return r;if(this._backtrack){n=!1;continue}return!1}if(!this.options.flex)break}return n?!1!==(r=this.test_match(n,i[f]))&&r:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var n=this.next();return n||this.lex()},begin:function(n){this.conditionStack.push(n)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(n){return n=this.conditionStack.length-1-Math.abs(n||0),n>=0?this.conditionStack[n]:"INITIAL"},pushState:function(n){this.begin(n)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(n,t,i){switch(i){case 1:return 6;case 2:return t.yytext=t.yytext.substr(1,t.yyleng-2),4;case 3:return 17;case 4:return 18;case 5:return 23;case 6:return 24;case 7:return 22;case 8:return 21;case 9:return 10;case 10:return 11;case 11:return 8;case 12:return 14;case 13:return"INVALID"}},rules:[/^(?:\s+)/,/^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,/^(?:"(?:\\[\\"bfnrt\/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,/^(?:\{)/,/^(?:\})/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?::)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:null\b)/,/^(?:$)/,/^(?:.)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}}}();return l.lexer=v,h.prototype=l,l.Parser=h,new h}();void 0!==n&&void 0!==i&&(i.parser=u,i.Parser=u.Parser,i.parse=function(){return u.parse.apply(u,arguments)},i.main=function(t){t[1]||(console.log("Usage: "+t[0]+" FILE"),r.exit(1));var u=n("fs").readFileSync(n("path").normalize(t[1]),"utf8");return i.parser.parse(u)},void 0!==t&&n.main===t&&i.main(r.argv.slice(1)))}).call(this,n("_process"))},{_process:19,fs:7,path:17}],16:[function(n,t,i){(function(n){function lr(n,t){for(var r,i=-1,f=null==n?0:n.length,e=0,u=[];++i<f;)r=n[i],t(r,i,n)&&(u[e++]=r);return u}function ar(n,t){for(var i=-1,r=t.length,u=n.length;++i<r;)n[u+i]=t[i];return n}function vr(n,t){for(var i=-1,r=null==n?0:n.length;++i<r;)if(t(n[i],i,n))return!0;return!1}function yr(n,t){for(var i=-1,r=Array(n);++i<n;)r[i]=t(i);return r}function pr(n,t){return n.has(t)}function wr(n,t){if(null!=n)return n[t]}function br(n){var i=-1,t=Array(n.size);return n.forEach(function(n,r){t[++i]=[r,n]}),t}function kr(n){var i=-1,t=Array(n.size);return n.forEach(function(n){t[++i]=n}),t}function h(n){var i=-1,r=null==n?0:n.length,t;for(this.clear();++i<r;)t=n[i],this.set(t[0],t[1])}function dr(){this.__data__=k?k(null):{};this.size=0}function gr(n){var t=this.has(n)&&delete this.__data__[n];return this.size-=t?1:0,t}function nu(n){var t=this.__data__,i;return k?(i=t[n],i===ht?void 0:i):u.call(t,n)?t[n]:void 0}function tu(n){var t=this.__data__;return k?void 0!==t[n]:u.call(t,n)}function iu(n,t){var i=this.__data__;return this.size+=this.has(n)?0:1,i[n]=k&&void 0===t?ht:t,this}function f(n){var i=-1,r=null==n?0:n.length,t;for(this.clear();++i<r;)t=n[i],this.set(t[0],t[1])}function ru(){this.__data__=[];this.size=0}function uu(n){var t=this.__data__,i=g(t,n);return!(i<0)&&(i==t.length-1?t.pop():le.call(t,i,1),--this.size,!0)}function fu(n){var t=this.__data__,i=g(t,n);if(!(i<0))return t[i][1]}function eu(n){return g(this.__data__,n)>-1}function ou(n,t){var i=this.__data__,r=g(i,n);return r<0?(++this.size,i.push([n,t])):i[r][1]=t,this}function c(n){var i=-1,r=null==n?0:n.length,t;for(this.clear();++i<r;)t=n[i],this.set(t[0],t[1])}function su(){this.size=0;this.__data__={hash:new h,map:new(b||f),string:new h}}function hu(n){var t=nt(this,n).delete(n);return this.size-=t?1:0,t}function cu(n){return nt(this,n).get(n)}function lu(n){return nt(this,n).has(n)}function au(n,t){var i=nt(this,n),r=i.size;return i.set(n,t),this.size+=i.size==r?0:1,this}function d(n){var t=-1,i=null==n?0:n.length;for(this.__data__=new c;++t<i;)this.add(n[t])}function vu(n){return this.__data__.set(n,ht),this}function yu(n){return this.__data__.has(n)}function s(n){var t=this.__data__=new f(n);this.size=t.size}function pu(){this.__data__=new f;this.size=0}function wu(n){var t=this.__data__,i=t.delete(n);return this.size=t.size,i}function bu(n){return this.__data__.get(n)}function ku(n){return this.__data__.has(n)}function du(n,t){var i=this.__data__,r;if(i instanceof f){if(r=i.__data__,!b||r.length<df-1)return r.push([n,t]),this.size=++i.size,this;i=this.__data__=new c(r)}return i.set(n,t),this.size=i.size,this}function gu(n,t){var r=st(n),f=!r&&de(n),e=!r&&!f&&kt(n),s=!r&&!f&&!e&&cr(n),h=r||f||e||s,o=h?yr(n.length,String):[],c=o.length,i;for(i in n)!t&&!u.call(n,i)||h&&("length"==i||e&&("offset"==i||"parent"==i)||s&&("buffer"==i||"byteLength"==i||"byteOffset"==i)||hf(i,c))||o.push(i);return o}function g(n,t){for(var i=n.length;i--;)if(ii(n[i][0],t))return i;return-1}function nf(n,t,i){var r=t(n);return st(n)?r:ar(r,i(n))}function p(n){return null==n?void 0===n?ue:te:a&&a in Object(n)?sf(n):vf(n)}function dt(n){return w(n)&&p(n)==it}function gt(n,t,i,r,u){return n===t||(null==n||null==t||!w(n)&&!w(t)?n!==n&&t!==t:tf(n,t,i,r,gt,u))}function tf(n,t,i,r,f,e){var l=st(n),d=st(t),h=l?ct:o(n),c=d?ct:o(t),p,w,b,k;h=h==it?y:h;c=c==it?y:c;var a=h==y,g=c==y,v=h==c;if(v&&kt(n)){if(!kt(t))return!1;l=!0;a=!1}return v&&!a?(e||(e=new s),l||cr(n)?ni(n,t,i,r,f,e):ef(n,t,h,i,r,f,e)):!(i&tt)&&(p=a&&u.call(n,"__wrapped__"),w=g&&u.call(t,"__wrapped__"),p||w)?(b=p?n.value():n,k=w?t.value():t,e||(e=new s),f(b,k,i,r,e)):!!v&&(e||(e=new s),of(n,t,i,r,f,e))}function rf(n){return!(!fi(n)||lf(n))&&(ri(n)?ce:fe).test(l(n))}function uf(n){return w(n)&&ui(n.length)&&!!r[p(n)]}function ff(n){var i,t;if(!af(n))return ve(n);i=[];for(t in Object(n))u.call(n,t)&&"constructor"!=t&&i.push(t);return i}function ni(n,t,i,r,u,f){var y=i&tt,c=n.length,p=t.length,l,e,s,v;if(c!=p&&!(y&&p>c))return!1;if(l=f.get(n),l&&f.get(t))return l==t;var o=-1,h=!0,a=i&ei?new d:void 0;for(f.set(n,t),f.set(t,n);++o<c;){if(e=n[o],s=t[o],r&&(v=y?r(s,e,o,t,n,f):r(e,s,o,n,t,f)),void 0!==v){if(v)continue;h=!1;break}if(a){if(!vr(t,function(n,t){if(!pr(a,t)&&(e===n||u(e,n,i,r,f)))return a.push(t)})){h=!1;break}}else if(e!==s&&!u(e,s,i,r,f)){h=!1;break}}return f.delete(n),f.delete(t),h}function ef(n,t,i,r,u,f,e){var o,h,s,c;switch(i){case ft:if(n.byteLength!=t.byteLength||n.byteOffset!=t.byteOffset)return!1;n=n.buffer;t=t.buffer;case pi:return!(n.byteLength!=t.byteLength||!f(new fr(n),new fr(t)));case si:case hi:case ai:return ii(+n,+t);case ci:return n.name==t.name&&n.message==t.message;case vi:case yi:return n==t+"";case rt:o=br;case ut:return(h=r&tt,o||(o=kr),n.size!=t.size&&!h)?!1:(s=e.get(n),s)?s==t:(r|=ei,e.set(n,t),c=ni(o(n),o(t),r,u,f,e),e.delete(n),c);case re:if(bt)return bt.call(n)==bt.call(t)}return!1}function of(n,t,i,r,f,e){var y=i&tt,w=ti(n),b=w.length,s,o,k,h,p,c,l,d,a,v;if(b!=ti(t).length&&!y)return!1;for(s=b;s--;)if(o=w[s],!(y?o in t:u.call(t,o)))return!1;if(k=e.get(n),k&&e.get(t))return k==t;for(h=!0,e.set(n,t),e.set(t,n),p=y;++s<b;){if(o=w[s],c=n[o],l=t[o],r&&(d=y?r(l,c,o,t,n,e):r(c,l,o,n,t,e)),!(void 0===d?c===l||f(c,l,i,r,e):d)){h=!1;break}p||(p="constructor"==o)}return h&&!p&&(a=n.constructor,v=t.constructor,a!=v&&"constructor"in n&&"constructor"in t&&!("function"==typeof a&&a instanceof a&&"function"==typeof v&&v instanceof v)&&(h=!1)),e.delete(n),e.delete(t),h}function ti(n){return nf(n,wf,hr)}function nt(n,t){var i=n.__data__;return cf(t)?i["string"==typeof t?"string":"hash"]:i.map}function v(n,t){var i=wr(n,t);if(rf(i))return i}function sf(n){var i=u.call(n,a),r=n[a],t;try{n[a]=void 0}catch(n){}return t=rr.call(n),i?n[a]=r:delete n[a],t}function hf(n,t){return!!(t=null==t?oi:t)&&("number"==typeof n||ee.test(n))&&n>-1&&n%1==0&&n<t}function cf(n){var t=typeof n;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==n:null===n}function lf(n){return!!ir&&ir in n}function af(n){var t=n&&n.constructor;return n===("function"==typeof t&&t.prototype||et)}function vf(n){return rr.call(n)}function l(n){if(null!=n){try{return tr.call(n)}catch(n){}try{return n+""}catch(n){}}return""}function ii(n,t){return n===t||n!==n&&t!==t}function yf(n){return null!=n&&ui(n.length)&&!ri(n)}function pf(n,t){return gt(n,t)}function ri(n){if(!fi(n))return!1;var t=p(n);return t==li||t==ne||t==gf||t==ie}function ui(n){return"number"==typeof n&&n>-1&&n%1==0&&n<=oi}function fi(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)}function w(n){return null!=n&&"object"==typeof n}function wf(n){return yf(n)?gu(n):ff(n)}function bf(){return[]}function kf(){return!1}var df=200,ht="__lodash_hash_undefined__",tt=1,ei=2,oi=9007199254740991,it="[object Arguments]",ct="[object Array]",gf="[object AsyncFunction]",si="[object Boolean]",hi="[object Date]",ci="[object Error]",li="[object Function]",ne="[object GeneratorFunction]",rt="[object Map]",ai="[object Number]",te="[object Null]",y="[object Object]",ie="[object Proxy]",vi="[object RegExp]",ut="[object Set]",yi="[object String]",re="[object Symbol]",ue="[object Undefined]",pi="[object ArrayBuffer]",ft="[object DataView]",fe=/^\[object .+?Constructor\]$/,ee=/^(?:0|[1-9]\d*)$/,r={},hr,o;r["[object Float32Array]"]=r["[object Float64Array]"]=r["[object Int8Array]"]=r["[object Int16Array]"]=r["[object Int32Array]"]=r["[object Uint8Array]"]=r["[object Uint8ClampedArray]"]=r["[object Uint16Array]"]=r["[object Uint32Array]"]=!0;r[it]=r[ct]=r[pi]=r[si]=r[ft]=r[hi]=r[ci]=r[li]=r[rt]=r[ai]=r[y]=r[vi]=r[ut]=r[yi]=r["[object WeakMap]"]=!1;var wi="object"==typeof n&&n&&n.Object===Object&&n,oe="object"==typeof self&&self&&self.Object===Object&&self,e=wi||oe||Function("return this")(),bi="object"==typeof i&&i&&!i.nodeType&&i,ki=bi&&"object"==typeof t&&t&&!t.nodeType&&t,di=ki&&ki.exports===bi,lt=di&&wi.process,gi=function(){try{return lt&&lt.binding&&lt.binding("util")}catch(n){}}(),nr=gi&&gi.isTypedArray,se=Array.prototype,he=Function.prototype,et=Object.prototype,at=e["__core-js_shared__"],tr=he.toString,u=et.hasOwnProperty,ir=function(){var n=/[^.]+$/.exec(at&&at.keys&&at.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}(),rr=et.toString,ce=RegExp("^"+tr.call(u).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ur=di?e.Buffer:void 0,ot=e.Symbol,fr=e.Uint8Array,er=et.propertyIsEnumerable,le=se.splice,a=ot?ot.toStringTag:void 0,or=Object.getOwnPropertySymbols,ae=ur?ur.isBuffer:void 0,ve=function(n,t){return function(i){return n(t(i))}}(Object.keys,Object),vt=v(e,"DataView"),b=v(e,"Map"),yt=v(e,"Promise"),pt=v(e,"Set"),wt=v(e,"WeakMap"),k=v(Object,"create"),ye=l(vt),pe=l(b),we=l(yt),be=l(pt),ke=l(wt),sr=ot?ot.prototype:void 0,bt=sr?sr.valueOf:void 0;h.prototype.clear=dr;h.prototype.delete=gr;h.prototype.get=nu;h.prototype.has=tu;h.prototype.set=iu;f.prototype.clear=ru;f.prototype.delete=uu;f.prototype.get=fu;f.prototype.has=eu;f.prototype.set=ou;c.prototype.clear=su;c.prototype.delete=hu;c.prototype.get=cu;c.prototype.has=lu;c.prototype.set=au;d.prototype.add=d.prototype.push=vu;d.prototype.has=yu;s.prototype.clear=pu;s.prototype.delete=wu;s.prototype.get=bu;s.prototype.has=ku;s.prototype.set=du;hr=or?function(n){return null==n?[]:(n=Object(n),lr(or(n),function(t){return er.call(n,t)}))}:bf;o=p;(vt&&o(new vt(new ArrayBuffer(1)))!=ft||b&&o(new b)!=rt||yt&&"[object Promise]"!=o(yt.resolve())||pt&&o(new pt)!=ut||wt&&"[object WeakMap]"!=o(new wt))&&(o=function(n){var t=p(n),i=t==y?n.constructor:void 0,r=i?l(i):"";if(r)switch(r){case ye:return ft;case pe:return rt;case we:return"[object Promise]";case be:return ut;case ke:return"[object WeakMap]"}return t});var de=dt(function(){return arguments}())?dt:function(n){return w(n)&&u.call(n,"callee")&&!er.call(n,"callee")},st=Array.isArray,kt=ae||kf,cr=nr?function(n){return function(t){return n(t)}}(nr):uf;t.exports=pf}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],17:[function(n,t,i){(function(n){function u(n,t){for(var u,r=0,i=n.length-1;i>=0;i--)u=n[i],"."===u?n.splice(i,1):".."===u?(n.splice(i,1),r++):r&&(n.splice(i,1),r--);if(t)for(;r--;r)n.unshift("..");return n}function t(n,t){if(n.filter)return n.filter(t);for(var r=[],i=0;i<n.length;i++)t(n[i],i,n)&&r.push(n[i]);return r}var e=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,r=function(n){return e.exec(n).slice(1)},f;i.resolve=function(){for(var r,i="",f=!1,e=arguments.length-1;e>=-1&&!f;e--){if(r=e>=0?arguments[e]:n.cwd(),"string"!=typeof r)throw new TypeError("Arguments to path.resolve must be strings");r&&(i=r+"/"+i,f="/"===r.charAt(0))}return i=u(t(i.split("/"),function(n){return!!n}),!f).join("/"),(f?"/":"")+i||"."};i.normalize=function(n){var r=i.isAbsolute(n),e="/"===f(n,-1);return n=u(t(n.split("/"),function(n){return!!n}),!r).join("/"),n||r||(n="."),n&&e&&(n+="/"),(r?"/":"")+n};i.isAbsolute=function(n){return"/"===n.charAt(0)};i.join=function(){var n=Array.prototype.slice.call(arguments,0);return i.normalize(t(n,function(n){if("string"!=typeof n)throw new TypeError("Arguments to path.join must be strings");return n}).join("/"))};i.relative=function(n,t){function s(n){for(var i,t=0;t<n.length&&""===n[t];t++);for(i=n.length-1;i>=0&&""===n[i];i--);return t>i?[]:n.slice(t,i-t+1)}var u,r;n=i.resolve(n).substr(1);t=i.resolve(t).substr(1);for(var f=s(n.split("/")),e=s(t.split("/")),h=Math.min(f.length,e.length),o=h,r=0;r<h;r++)if(f[r]!==e[r]){o=r;break}for(u=[],r=o;r<f.length;r++)u.push("..");return u=u.concat(e.slice(o)),u.join("/")};i.sep="/";i.delimiter=":";i.dirname=function(n){var i=r(n),u=i[0],t=i[1];return u||t?(t&&(t=t.substr(0,t.length-1)),u+t):"."};i.basename=function(n,t){var i=r(n)[2];return t&&i.substr(-1*t.length)===t&&(i=i.substr(0,i.length-t.length)),i};i.extname=function(n){return r(n)[3]};f="b"==="ab".substr(-1)?function(n,t,i){return n.substr(t,i)}:function(n,t,i){return t<0&&(t=n.length+t),n.substr(t,i)}}).call(this,n("_process"))},{_process:19}],18:[function(n,t){"use strict";function i(n,t){this.x=n;this.y=t}t.exports=i;i.prototype={clone:function(){return new i(this.x,this.y)},add:function(n){return this.clone()._add(n)},sub:function(n){return this.clone()._sub(n)},multByPoint:function(n){return this.clone()._multByPoint(n)},divByPoint:function(n){return this.clone()._divByPoint(n)},mult:function(n){return this.clone()._mult(n)},div:function(n){return this.clone()._div(n)},rotate:function(n){return this.clone()._rotate(n)},rotateAround:function(n,t){return this.clone()._rotateAround(n,t)},matMult:function(n){return this.clone()._matMult(n)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(n){return this.x===n.x&&this.y===n.y},dist:function(n){return Math.sqrt(this.distSqr(n))},distSqr:function(n){var t=n.x-this.x,i=n.y-this.y;return t*t+i*i},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(n){return Math.atan2(this.y-n.y,this.x-n.x)},angleWith:function(n){return this.angleWithSep(n.x,n.y)},angleWithSep:function(n,t){return Math.atan2(this.x*t-this.y*n,this.x*n+this.y*t)},_matMult:function(n){var t=n[0]*this.x+n[1]*this.y,i=n[2]*this.x+n[3]*this.y;return this.x=t,this.y=i,this},_add:function(n){return this.x+=n.x,this.y+=n.y,this},_sub:function(n){return this.x-=n.x,this.y-=n.y,this},_mult:function(n){return this.x*=n,this.y*=n,this},_div:function(n){return this.x/=n,this.y/=n,this},_multByPoint:function(n){return this.x*=n.x,this.y*=n.y,this},_divByPoint:function(n){return this.x/=n.x,this.y/=n.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var n=this.y;return this.y=this.x,this.x=-n,this},_rotate:function(n){var t=Math.cos(n),i=Math.sin(n),r=t*this.x-i*this.y,u=i*this.x+t*this.y;return this.x=r,this.y=u,this},_rotateAround:function(n,t){var i=Math.cos(n),r=Math.sin(n),u=t.x+i*(this.x-t.x)-r*(this.y-t.y),f=t.y+r*(this.x-t.x)+i*(this.y-t.y);return this.x=u,this.y=f,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}};i.convert=function(n){return n instanceof i?n:Array.isArray(n)?new i(n[0],n[1]):n}},{}],19:[function(n,t){function c(){throw new Error("setTimeout has not been defined");}function l(){throw new Error("clearTimeout has not been defined");}function a(n){if(u===setTimeout)return setTimeout(n,0);if((u===c||!u)&&setTimeout)return u=setTimeout,setTimeout(n,0);try{return u(n,0)}catch(t){try{return u.call(null,n,0)}catch(t){return u.call(this,n,0)}}}function p(n){if(f===clearTimeout)return clearTimeout(n);if((f===l||!f)&&clearTimeout)return f=clearTimeout,clearTimeout(n);try{return f(n)}catch(t){try{return f.call(null,n)}catch(t){return f.call(this,n)}}}function w(){s&&o&&(s=!1,o.length?e=o.concat(e):h=-1,e.length&&v())}function v(){var t,n;if(!s){for(t=a(w),s=!0,n=e.length;n;){for(o=e,e=[];++h<n;)o&&o[h].run();h=-1;n=e.length}o=null;s=!1;p(t)}}function y(n,t){this.fun=n;this.array=t}function r(){}var u,f,i=t.exports={};!function(){try{u="function"==typeof setTimeout?setTimeout:c}catch(n){u=c}try{f="function"==typeof clearTimeout?clearTimeout:l}catch(n){f=l}}();var o,e=[],s=!1,h=-1;i.nextTick=function(n){var i=new Array(arguments.length-1),t;if(arguments.length>1)for(t=1;t<arguments.length;t++)i[t-1]=arguments[t];e.push(new y(n,i));1!==e.length||s||a(v)};y.prototype.run=function(){this.fun.apply(null,this.array)};i.title="browser";i.browser=!0;i.env={};i.argv=[];i.version="";i.versions={};i.on=r;i.addListener=r;i.once=r;i.off=r;i.removeListener=r;i.removeAllListeners=r;i.emit=r;i.prependListener=r;i.prependOnceListener=r;i.listeners=function(){return[]};i.binding=function(){throw new Error("process.binding is not supported");};i.cwd=function(){return"/"};i.chdir=function(){throw new Error("process.chdir is not supported");};i.umask=function(){return 0}},{}],20:[function(n,t){function i(n){this.value=n}function o(n,t,i){var o=[],r=[],c=!0;return function n(l){function w(){if("object"==typeof a.node&&null!==a.node){a.keys&&a.node_===a.node||(a.keys=f(a.node));a.isLeaf=0==a.keys.length;for(var n=0;n<r.length;n++)if(r[n].node_===l){a.circular=r[n];break}}else a.isLeaf=!0,a.keys=null;a.notLeaf=!a.isLeaf;a.notRoot=!a.isRoot}var b=i?s(l):l,v={},y=!0,a={node:b,node_:l,path:[].concat(o),parent:r[r.length-1],parents:r,key:o.slice(-1)[0],isRoot:0===o.length,level:o.length,circular:null,update:function(n,t){a.isRoot||(a.parent.node[a.key]=n);a.node=n;t&&(y=!1)},"delete":function(n){delete a.parent.node[a.key];n&&(y=!1)},remove:function(n){h(a.parent.node)?a.parent.node.splice(a.key,1):delete a.parent.node[a.key];n&&(y=!1)},keys:null,before:function(n){v.before=n},after:function(n){v.after=n},pre:function(n){v.pre=n},post:function(n){v.post=n},stop:function(){c=!1},block:function(){y=!1}},p;return c?(w(),p=t.call(a,a.node),void 0!==p&&a.update&&a.update(p),v.before&&v.before.call(a,a.node),y?("object"!=typeof a.node||null===a.node||a.circular||(r.push(a),w(),e(a.keys,function(t,r){o.push(t);v.pre&&v.pre.call(a,a.node[t],t);var f=n(a.node[t]);i&&u.call(a.node,t)&&(a.node[t]=f.node);f.isLast=r==a.keys.length-1;f.isFirst=0==r;v.post&&v.post.call(a,f);o.pop()}),r.pop()),v.after&&v.after.call(a,a.node),a):a):a}(n).node}function s(n){var t,r,i;return"object"==typeof n&&null!==n?(h(n)?t=[]:c(n)?t=new Date(n.getTime?n.getTime():n):l(n)?t=new RegExp(n):a(n)?t={message:n.message}:v(n)?t=new Boolean(n):y(n)?t=new Number(n):p(n)?t=new String(n):Object.create&&Object.getPrototypeOf?t=Object.create(Object.getPrototypeOf(n)):n.constructor===Object?t={}:(r=n.constructor&&n.constructor.prototype||n.__proto__||{},i=function(){},i.prototype=r,t=new i),e(f(n),function(i){t[i]=n[i]}),t):n}function r(n){return Object.prototype.toString.call(n)}function c(n){return"[object Date]"===r(n)}function l(n){return"[object RegExp]"===r(n)}function a(n){return"[object Error]"===r(n)}function v(n){return"[object Boolean]"===r(n)}function y(n){return"[object Number]"===r(n)}function p(n){return"[object String]"===r(n)}var w=t.exports=function(n){return new i(n)},u;i.prototype.get=function(n){for(var r,t=this.value,i=0;i<n.length;i++){if(r=n[i],!t||!u.call(t,r)){t=void 0;break}t=t[r]}return t};i.prototype.has=function(n){for(var r,t=this.value,i=0;i<n.length;i++){if(r=n[i],!t||!u.call(t,r))return!1;t=t[r]}return!0};i.prototype.set=function(n,t){for(var f,i=this.value,r=0;r<n.length-1;r++)f=n[r],u.call(i,f)||(i[f]={}),i=i[f];return i[n[r]]=t,t};i.prototype.map=function(n){return o(this.value,n,!0)};i.prototype.forEach=function(n){return this.value=o(this.value,n,!1),this.value};i.prototype.reduce=function(n,t){var r=1===arguments.length,i=r?this.value:t;return this.forEach(function(t){this.isRoot&&r||(i=n.call(this,i,t))}),i};i.prototype.paths=function(){var n=[];return this.forEach(function(){n.push(this.path)}),n};i.prototype.nodes=function(){var n=[];return this.forEach(function(){n.push(this.node)}),n};i.prototype.clone=function(){var n=[],t=[];return function i(r){for(var o,u=0;u<n.length;u++)if(n[u]===r)return t[u];return"object"==typeof r&&null!==r?(o=s(r),n.push(r),t.push(o),e(f(r),function(n){o[n]=i(r[n])}),n.pop(),t.pop(),o):r}(this.value)};var f=Object.keys||function(n){var t=[],i;for(i in n)t.push(i);return t},h=Array.isArray||function(n){return"[object Array]"===Object.prototype.toString.call(n)},e=function(n,t){if(n.forEach)return n.forEach(t);for(var i=0;i<n.length;i++)t(n[i],i,n)};e(f(i.prototype),function(n){w[n]=function(t){var u=[].slice.call(arguments,1),r=new i(t);return r[n].apply(r,u)}});u=Object.hasOwnProperty||function(n,t){return t in n}},{}],21:[function(n,t){t.exports.RADIUS=6378137;t.exports.FLATTENING=1/298.257223563;t.exports.POLAR_RADIUS=6356752.3142},{}],22:[function(n,t){function i(){for(var t,i,u={},n=0;n<arguments.length;n++){t=arguments[n];for(i in t)r.call(t,i)&&(u[i]=t[i])}return u}t.exports=i;var r=Object.prototype.hasOwnProperty},{}],23:[function(n,t){"use strict";var r=n("lodash.isequal"),u=n("@mapbox/geojson-normalize"),f=n("hat"),e=n("./lib/features_at"),o=n("./lib/string_sets_are_equal"),s=n("@mapbox/geojsonhint"),i=n("./constants"),h=n("./lib/string_set"),c={Polygon:n("./feature_types/polygon"),LineString:n("./feature_types/line_string"),Point:n("./feature_types/point"),MultiPolygon:n("./feature_types/multi_feature"),MultiLineString:n("./feature_types/multi_feature"),MultiPoint:n("./feature_types/multi_feature")};t.exports=function(n,t){return t.modes=i.modes,t.getFeatureIdsAt=function(t){return e.click({point:t},null,n).map(function(n){return n.properties.id})},t.getSelectedIds=function(){return n.store.getSelectedIds()},t.getSelected=function(){return{type:i.geojsonTypes.FEATURE_COLLECTION,features:n.store.getSelectedIds().map(function(t){return n.store.get(t)}).map(function(n){return n.toGeoJSON()})}},t.getSelectedPoints=function(){return{type:i.geojsonTypes.FEATURE_COLLECTION,features:n.store.getSelectedCoordinates().map(function(n){return{type:i.geojsonTypes.FEATURE,properties:{},geometry:{type:i.geojsonTypes.POINT,coordinates:n.coordinates}}})}},t.set=function(r){if(void 0===r.type||r.type!==i.geojsonTypes.FEATURE_COLLECTION||!Array.isArray(r.features))throw new Error("Invalid FeatureCollection");var e=n.store.createRenderBatch(),u=n.store.getAllIds().slice(),f=t.add(r),o=new h(f);return u=u.filter(function(n){return!o.has(n)}),u.length&&t.delete(u),e(),f},t.add=function(t){var i=s.hint(t,{precisionWarning:!1}).filter(function(n){return"message"!==n.level}),e,o;if(i.length)throw new Error(i[0].message);return e=JSON.parse(JSON.stringify(u(t))),o=e.features.map(function(t){var u,e,i;if(t.id=t.id||f(),null===t.geometry)throw new Error("Invalid geometry: null");if(void 0===n.store.get(t.id)||n.store.get(t.id).type!==t.geometry.type){if(u=c[t.geometry.type],void 0===u)throw new Error("Invalid geometry type: "+t.geometry.type+".");e=new u(n,t);n.store.add(e)}else i=n.store.get(t.id),i.properties=t.properties,r(i.getCoordinates(),t.geometry.coordinates)||i.incomingCoords(t.geometry.coordinates);return t.id}),n.store.render(),o},t.get=function(t){var i=n.store.get(t);if(i)return i.toGeoJSON()},t.getAll=function(){return{type:i.geojsonTypes.FEATURE_COLLECTION,features:n.store.getAll().map(function(n){return n.toGeoJSON()})}},t.delete=function(r){return n.store.delete(r,{silent:!0}),t.getMode()!==i.modes.DIRECT_SELECT||n.store.getSelectedIds().length?n.store.render():n.events.changeMode(i.modes.SIMPLE_SELECT,void 0,{silent:!0}),t},t.deleteAll=function(){return n.store.delete(n.store.getAllIds(),{silent:!0}),t.getMode()===i.modes.DIRECT_SELECT?n.events.changeMode(i.modes.SIMPLE_SELECT,void 0,{silent:!0}):n.store.render(),t},t.changeMode=function(r){var u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r===i.modes.SIMPLE_SELECT&&t.getMode()===i.modes.SIMPLE_SELECT?o(u.featureIds||[],n.store.getSelectedIds())?t:(n.store.setSelected(u.featureIds,{silent:!0}),n.store.render(),t):r===i.modes.DIRECT_SELECT&&t.getMode()===i.modes.DIRECT_SELECT&&u.featureId===n.store.getSelectedIds()[0]?t:(n.events.changeMode(r,u,{silent:!0}),t)},t.getMode=function(){return n.events.getMode()},t.trash=function(){return n.events.trash({silent:!0}),t},t.combineFeatures=function(){return n.events.combineFeatures({silent:!0}),t},t.uncombineFeatures=function(){return n.events.uncombineFeatures({silent:!0}),t},t.setFeatureProperty=function(i,r,u){return n.store.setFeatureProperty(i,r,u),t},t}},{"./constants":24,"./feature_types/line_string":27,"./feature_types/multi_feature":28,"./feature_types/point":29,"./feature_types/polygon":30,"./lib/features_at":38,"./lib/string_set":48,"./lib/string_sets_are_equal":49,"@mapbox/geojson-normalize":3,"@mapbox/geojsonhint":4,hat:14,"lodash.isequal":16}],24:[function(n,t){"use strict";t.exports={classes:{CONTROL_BASE:"mapboxgl-ctrl",CONTROL_PREFIX:"mapboxgl-ctrl-",CONTROL_BUTTON:"mapbox-gl-draw_ctrl-draw-btn",CONTROL_BUTTON_LINE:"mapbox-gl-draw_line",CONTROL_BUTTON_POLYGON:"mapbox-gl-draw_polygon",CONTROL_BUTTON_POINT:"mapbox-gl-draw_point",CONTROL_BUTTON_TRASH:"mapbox-gl-draw_trash",CONTROL_BUTTON_COMBINE_FEATURES:"mapbox-gl-draw_combine",CONTROL_BUTTON_UNCOMBINE_FEATURES:"mapbox-gl-draw_uncombine",CONTROL_GROUP:"mapboxgl-ctrl-group",ATTRIBUTION:"mapboxgl-ctrl-attrib",ACTIVE_BUTTON:"active",BOX_SELECT:"mapbox-gl-draw_boxselect"},sources:{HOT:"mapbox-gl-draw-hot",COLD:"mapbox-gl-draw-cold"},cursors:{ADD:"add",MOVE:"move",DRAG:"drag",POINTER:"pointer",NONE:"none"},types:{POLYGON:"polygon",LINE:"line_string",POINT:"point"},geojsonTypes:{FEATURE:"Feature",POLYGON:"Polygon",LINE_STRING:"LineString",POINT:"Point",FEATURE_COLLECTION:"FeatureCollection",MULTI_PREFIX:"Multi",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon"},modes:{DRAW_LINE_STRING:"draw_line_string",DRAW_POLYGON:"draw_polygon",DRAW_POINT:"draw_point",SIMPLE_SELECT:"simple_select",DIRECT_SELECT:"direct_select",STATIC:"static"},events:{CREATE:"draw.create",DELETE:"draw.delete",UPDATE:"draw.update",SELECTION_CHANGE:"draw.selectionchange",MODE_CHANGE:"draw.modechange",ACTIONABLE:"draw.actionable",RENDER:"draw.render",COMBINE_FEATURES:"draw.combine",UNCOMBINE_FEATURES:"draw.uncombine"},updateActions:{MOVE:"move",CHANGE_COORDINATES:"change_coordinates"},meta:{FEATURE:"feature",MIDPOINT:"midpoint",VERTEX:"vertex"},activeStates:{ACTIVE:"true",INACTIVE:"false"},LAT_MIN:-90,LAT_RENDERED_MIN:-85,LAT_MAX:90,LAT_RENDERED_MAX:85,LNG_MIN:-270,LNG_MAX:270}},{}],25:[function(n,t){"use strict";var u=n("./lib/mode_handler"),r=n("./lib/get_features_and_set_cursor"),f=n("./lib/features_at"),e=n("./lib/is_click"),o=n("./lib/is_tap"),i=n("./constants"),s=n("./modes/object_to_mode");t.exports=function(n){function a(t,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},f,e;if(h.stop(),f=w[t],void 0===f)throw new Error(t+" is not valid");c=t;e=f(n,r);h=u(e,n);o.silent||n.map.fire(i.events.MODE_CHANGE,{mode:t});n.store.setDirty();n.store.render()}function b(t){var r=!1;Object.keys(t).forEach(function(n){if(void 0===l[n])throw new Error("Invalid action type");l[n]!==t[n]&&(r=!0);l[n]=t[n]});r&&n.map.fire(i.events.ACTIONABLE,{actions:l})}var w=Object.keys(n.options.modes).reduce(function(t,i){return t[i]=s(n.options.modes[i]),t},{}),v={},y={},t={},c=null,h=null,p,l;return t.drag=function(t,r){r({point:t.point,time:(new Date).getTime()})?(n.ui.queueMapClasses({mouse:i.cursors.DRAG}),h.drag(t)):t.originalEvent.stopPropagation()},t.mousedrag=function(n){t.drag(n,function(n){return!e(v,n)})},t.touchdrag=function(n){t.drag(n,function(n){return!o(y,n)})},t.mousemove=function(i){if(1===(void 0!==i.originalEvent.buttons?i.originalEvent.buttons:i.originalEvent.which))return t.mousedrag(i);var u=r(i,n);i.featureTarget=u;h.mousemove(i)},t.mousedown=function(t){v={time:(new Date).getTime(),point:t.point};var i=r(t,n);t.featureTarget=i;h.mousedown(t)},t.mouseup=function(t){var i=r(t,n);t.featureTarget=i;e(v,{point:t.point,time:(new Date).getTime()})?h.click(t):h.mouseup(t)},t.mouseout=function(n){h.mouseout(n)},t.touchstart=function(t){if(t.originalEvent.preventDefault(),n.options.touchEnabled){y={time:(new Date).getTime(),point:t.point};var i=f.touch(t,null,n)[0];t.featureTarget=i;h.touchstart(t)}},t.touchmove=function(i){if(i.originalEvent.preventDefault(),n.options.touchEnabled)return h.touchmove(i),t.touchdrag(i)},t.touchend=function(t){if(t.originalEvent.preventDefault(),n.options.touchEnabled){var i=f.touch(t,null,n)[0];t.featureTarget=i;o(y,{time:(new Date).getTime(),point:t.point})?h.tap(t):h.touchend(t)}},p=function(n){return!(8===n||46===n||n>=48&&n<=57)},t.keydown=function(t){"mapboxgl-canvas"===t.srcElement.classList[0]&&(8!==t.keyCode&&46!==t.keyCode||!n.options.controls.trash?p(t.keyCode)?h.keydown(t):49===t.keyCode&&n.options.controls.point?a(i.modes.DRAW_POINT):50===t.keyCode&&n.options.controls.line_string?a(i.modes.DRAW_LINE_STRING):51===t.keyCode&&n.options.controls.polygon&&a(i.modes.DRAW_POLYGON):(t.preventDefault(),h.trash()))},t.keyup=function(n){p(n.keyCode)&&h.keyup(n)},t.zoomend=function(){n.store.changeZoom()},t.data=function(t){if("style"===t.dataType){var r=n.setup,u=n.map,f=n.options,i=n.store;f.styles.some(function(n){return u.getLayer(n.id)})||(r.addLayers(),i.setDirty(),i.render())}},l={trash:!1,combineFeatures:!1,uncombineFeatures:!1},{start:function(){c=n.options.defaultMode;h=u(w[c](n),n)},changeMode:a,actionable:b,currentModeName:function(){return c},currentModeRender:function(n,t){return h.render(n,t)},fire:function(n,i){t[n]&&t[n](i)},addEventListeners:function(){n.map.on("mousemove",t.mousemove);n.map.on("mousedown",t.mousedown);n.map.on("mouseup",t.mouseup);n.map.on("data",t.data);n.map.on("touchmove",t.touchmove);n.map.on("touchstart",t.touchstart);n.map.on("touchend",t.touchend);n.container.addEventListener("mouseout",t.mouseout);n.options.keybindings&&(n.container.addEventListener("keydown",t.keydown),n.container.addEventListener("keyup",t.keyup))},removeEventListeners:function(){n.map.off("mousemove",t.mousemove);n.map.off("mousedown",t.mousedown);n.map.off("mouseup",t.mouseup);n.map.off("data",t.data);n.map.off("touchmove",t.touchmove);n.map.off("touchstart",t.touchstart);n.map.off("touchend",t.touchend);n.container.removeEventListener("mouseout",t.mouseout);n.options.keybindings&&(n.container.removeEventListener("keydown",t.keydown),n.container.removeEventListener("keyup",t.keyup))},trash:function(n){h.trash(n)},combineFeatures:function(){h.combineFeatures()},uncombineFeatures:function(){h.uncombineFeatures()},getMode:function(){return c}}}},{"./constants":24,"./lib/features_at":38,"./lib/get_features_and_set_cursor":39,"./lib/is_click":40,"./lib/is_tap":42,"./lib/mode_handler":44,"./modes/object_to_mode":60}],26:[function(n,t){"use strict";var u=n("hat"),r=n("../constants"),i=function(n,t){this.ctx=n;this.properties=t.properties||{};this.coordinates=t.geometry.coordinates;this.id=t.id||u();this.type=t.geometry.type};i.prototype.changed=function(){this.ctx.store.featureChanged(this.id)};i.prototype.incomingCoords=function(n){this.setCoordinates(n)};i.prototype.setCoordinates=function(n){this.coordinates=n;this.changed()};i.prototype.getCoordinates=function(){return JSON.parse(JSON.stringify(this.coordinates))};i.prototype.setProperty=function(n,t){this.properties[n]=t};i.prototype.toGeoJSON=function(){return JSON.parse(JSON.stringify({id:this.id,type:r.geojsonTypes.FEATURE,properties:this.properties,geometry:{coordinates:this.getCoordinates(),type:this.type}}))};i.prototype.internal=function(n){var i={id:this.id,meta:r.meta.FEATURE,"meta:type":this.type,active:r.activeStates.INACTIVE,mode:n},t;if(this.ctx.options.userProperties)for(t in this.properties)i["user_"+t]=this.properties[t];return{type:r.geojsonTypes.FEATURE,properties:i,geometry:{coordinates:this.getCoordinates(),type:this.type}}};t.exports=i},{"../constants":24,hat:14}],27:[function(n,t){"use strict";var r=n("./feature"),i=function(n,t){r.call(this,n,t)};i.prototype=Object.create(r.prototype);i.prototype.isValid=function(){return this.coordinates.length>1};i.prototype.addCoordinate=function(n,t,i){this.changed();var r=parseInt(n,10);this.coordinates.splice(r,0,[t,i])};i.prototype.getCoordinate=function(n){var t=parseInt(n,10);return JSON.parse(JSON.stringify(this.coordinates[t]))};i.prototype.removeCoordinate=function(n){this.changed();this.coordinates.splice(parseInt(n,10),1)};i.prototype.updateCoordinate=function(n,t,i){var r=parseInt(n,10);this.coordinates[r]=[t,i];this.changed()};t.exports=i},{"./feature":26}],28:[function(n,t){"use strict";var u=n("./feature"),f=n("../constants"),e=n("hat"),o={MultiPoint:n("./point"),MultiLineString:n("./line_string"),MultiPolygon:n("./polygon")},r=function(n,t,i,r,u){var f=i.split("."),e=parseInt(f[0],10),o=f[1]?f.slice(1).join("."):null;return n[e][t](o,r,u)},i=function(n,t){if(u.call(this,n,t),delete this.coordinates,this.model=o[t.geometry.type],void 0===this.model)throw new TypeError(t.geometry.type+" is not a valid type");this.features=this._coordinatesToFeatures(t.geometry.coordinates)};i.prototype=Object.create(u.prototype);i.prototype._coordinatesToFeatures=function(n){var t=this,i=this.model.bind(this);return n.map(function(n){return new i(t.ctx,{id:e(),type:f.geojsonTypes.FEATURE,properties:{},geometry:{coordinates:n,type:t.type.replace("Multi","")}})})};i.prototype.isValid=function(){return this.features.every(function(n){return n.isValid()})};i.prototype.setCoordinates=function(n){this.features=this._coordinatesToFeatures(n);this.changed()};i.prototype.getCoordinate=function(n){return r(this.features,"getCoordinate",n)};i.prototype.getCoordinates=function(){return JSON.parse(JSON.stringify(this.features.map(function(n){return n.type===f.geojsonTypes.POLYGON?n.getCoordinates():n.coordinates})))};i.prototype.updateCoordinate=function(n,t,i){r(this.features,"updateCoordinate",n,t,i);this.changed()};i.prototype.addCoordinate=function(n,t,i){r(this.features,"addCoordinate",n,t,i);this.changed()};i.prototype.removeCoordinate=function(n){r(this.features,"removeCoordinate",n);this.changed()};i.prototype.getFeatures=function(){return this.features};t.exports=i},{"../constants":24,"./feature":26,"./line_string":27,"./point":29,"./polygon":30,hat:14}],29:[function(n,t){"use strict";var r=n("./feature"),i=function(n,t){r.call(this,n,t)};i.prototype=Object.create(r.prototype);i.prototype.isValid=function(){return"number"==typeof this.coordinates[0]&&"number"==typeof this.coordinates[1]};i.prototype.updateCoordinate=function(n,t,i){this.coordinates=3===arguments.length?[t,i]:[n,t];this.changed()};i.prototype.getCoordinate=function(){return this.getCoordinates()};t.exports=i},{"./feature":26}],30:[function(n,t){"use strict";var r=n("./feature"),i=function(n,t){r.call(this,n,t);this.coordinates=this.coordinates.map(function(n){return n.slice(0,-1)})};i.prototype=Object.create(r.prototype);i.prototype.isValid=function(){return 0!==this.coordinates.length&&this.coordinates.every(function(n){return n.length>2})};i.prototype.incomingCoords=function(n){this.coordinates=n.map(function(n){return n.slice(0,-1)});this.changed()};i.prototype.setCoordinates=function(n){this.coordinates=n;this.changed()};i.prototype.addCoordinate=function(n,t,i){this.changed();var r=n.split(".").map(function(n){return parseInt(n,10)});this.coordinates[r[0]].splice(r[1],0,[t,i])};i.prototype.removeCoordinate=function(n){this.changed();var t=n.split(".").map(function(n){return parseInt(n,10)}),i=this.coordinates[t[0]];i&&(i.splice(t[1],1),i.length<3&&this.coordinates.splice(t[0],1))};i.prototype.getCoordinate=function(n){var t=n.split(".").map(function(n){return parseInt(n,10)}),i=this.coordinates[t[0]];return JSON.parse(JSON.stringify(i[t[1]]))};i.prototype.getCoordinates=function(){return this.coordinates.map(function(n){return n.concat([n[0]])})};i.prototype.updateCoordinate=function(n,t,i){this.changed();var u=n.split("."),r=parseInt(u[0],10),f=parseInt(u[1],10);void 0===this.coordinates[r]&&(this.coordinates[r]=[]);this.coordinates[r][f]=[t,i]};t.exports=i},{"./feature":26}],31:[function(n,t){"use strict";var i=n("../constants");t.exports={isOfMetaType:function(n){return function(t){var i=t.featureTarget;return!!i&&!!i.properties&&i.properties.meta===n}},isShiftMousedown:function(n){return!!n.originalEvent&&!!n.originalEvent.shiftKey&&0===n.originalEvent.button},isActiveFeature:function(n){return!!n.featureTarget&&!!n.featureTarget.properties&&n.featureTarget.properties.active===i.activeStates.ACTIVE&&n.featureTarget.properties.meta===i.meta.FEATURE},isInactiveFeature:function(n){return!!n.featureTarget&&!!n.featureTarget.properties&&n.featureTarget.properties.active===i.activeStates.INACTIVE&&n.featureTarget.properties.meta===i.meta.FEATURE},noTarget:function(n){return void 0===n.featureTarget},isFeature:function(n){return!!n.featureTarget&&!!n.featureTarget.properties&&n.featureTarget.properties.meta===i.meta.FEATURE},isVertex:function(n){var t=n.featureTarget;return!!t&&!!t.properties&&t.properties.meta===i.meta.VERTEX},isShiftDown:function(n){return!!n.originalEvent&&!0===n.originalEvent.shiftKey},isEscapeKey:function(n){return 27===n.keyCode},isEnterKey:function(n){return 13===n.keyCode},"true":function(){return!0}}},{"../constants":24}],32:[function(n,t){"use strict";var h=n("geojson-extent"),i=n("../constants"),r=i.LAT_MIN,u=i.LAT_MAX,f=i.LAT_RENDERED_MIN,e=i.LAT_RENDERED_MAX,o=i.LNG_MIN,s=i.LNG_MAX;t.exports=function(n,t){var c=r,l=u,a=r,v=u,y=s,p=o,i;return n.forEach(function(n){var t=h(n),i=t[1],r=t[3],u=t[0],f=t[2];i>c&&(c=i);r<l&&(l=r);r>a&&(a=r);i<v&&(v=i);u<y&&(y=u);f>p&&(p=f)}),i=t,c+i.lat>e&&(i.lat=e-c),a+i.lat>u&&(i.lat=u-a),l+i.lat<f&&(i.lat=f-l),v+i.lat<r&&(i.lat=r-v),y+i.lng<=o&&(i.lng+=360*Math.ceil(Math.abs(i.lng)/360)),p+i.lng>=s&&(i.lng-=360*Math.ceil(Math.abs(i.lng)/360)),i}},{"../constants":24,"geojson-extent":11}],33:[function(n,t){"use strict";var i=n("../constants");t.exports=function(n,t,r,u){var f=t.geometry.coordinates,e=r.geometry.coordinates;if(f[1]>i.LAT_RENDERED_MAX||f[1]<i.LAT_RENDERED_MIN||e[1]>i.LAT_RENDERED_MAX||e[1]<i.LAT_RENDERED_MIN)return null;var s=u.project([f[0],f[1]]),h=u.project([e[0],e[1]]),o=u.unproject([(s.x+h.x)/2,(s.y+h.y)/2]);return{type:i.geojsonTypes.FEATURE,properties:{meta:i.meta.MIDPOINT,parent:n,lng:o.lng,lat:o.lat,coord_path:r.properties.coord_path},geometry:{type:i.geojsonTypes.POINT,coordinates:[o.lng,o.lat]}}}},{"../constants":24}],34:[function(n,t){"use strict";function r(n){function l(n,i){var o="",r=null;n.forEach(function(n,s){var y=void 0!==i&&null!==i?i+"."+s:String(s),h=u(c,n,y,a(y)),l,v;e.midpoints&&r&&(l=f(c,r,h,e.map),l&&t.push(l));r=h;v=JSON.stringify(n);o!==v&&t.push(h);0===s&&(o=v)})}function a(n){return!!e.selectedPaths&&-1!==e.selectedPaths.indexOf(n)}var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,v=n.geometry,s=v.type,h=v.coordinates,c=n.properties&&n.properties.id,t=[];return s===i.geojsonTypes.POINT?t.push(u(c,h,o,a(o))):s===i.geojsonTypes.POLYGON?h.forEach(function(n,t){l(n,null!==o?o+"."+t:String(t))}):s===i.geojsonTypes.LINE_STRING?l(h,o):0===s.indexOf(i.geojsonTypes.MULTI_PREFIX)&&function(){var u=s.replace(i.geojsonTypes.MULTI_PREFIX,"");h.forEach(function(f,o){var s={type:i.geojsonTypes.FEATURE,properties:n.properties,geometry:{type:u,coordinates:f}};t=t.concat(r(s,e,o))})}(),t}var u=n("./create_vertex"),f=n("./create_midpoint"),i=n("../constants");t.exports=r},{"../constants":24,"./create_midpoint":33,"./create_vertex":35}],35:[function(n,t){"use strict";var i=n("../constants");t.exports=function(n,t,r,u){return{type:i.geojsonTypes.FEATURE,properties:{meta:i.meta.VERTEX,parent:n,coord_path:r,active:u?i.activeStates.ACTIVE:i.activeStates.INACTIVE},geometry:{type:i.geojsonTypes.POINT,coordinates:t}}}},{"../constants":24}],36:[function(n,t){"use strict";t.exports={enable:function(n){setTimeout(function(){n.map&&n.map.doubleClickZoom&&n.map.doubleClickZoom.enable()},0)},disable:function(n){setTimeout(function(){n.map&&n.map.doubleClickZoom&&n.map.doubleClickZoom.disable()},0)}}},{}],37:[function(n,t){"use strict";t.exports=function(n,t){var i=n.x-t.x,r=n.y-t.y;return Math.sqrt(i*i+r*r)}},{}],38:[function(n,t){"use strict";function u(n,t,i){return r(n,t,i,i.options.clickBuffer)}function f(n,t,i){return r(n,t,i,i.options.touchBuffer)}function r(n,t,i,r){var f,u;if(null===i.map)return[];f=n?o(n,r):t;u={};i.options.styles&&(u.layers=i.options.styles.map(function(n){return n.id}));var a=i.map.queryRenderedFeatures(f,u).filter(function(n){return-1!==h.indexOf(n.properties.meta)}),c=new s,l=[];return a.forEach(function(n){var t=n.properties.id;c.has(t)||(c.add(t),l.push(n))}),e(l)}var e=n("./sort_features"),o=n("./map_event_to_bounding_box"),i=n("../constants"),s=n("./string_set"),h=[i.meta.FEATURE,i.meta.MIDPOINT,i.meta.VERTEX];t.exports={click:u,touch:f}},{"../constants":24,"./map_event_to_bounding_box":43,"./sort_features":47,"./string_set":48}],39:[function(n,t){"use strict";var r=n("./features_at"),i=n("../constants");t.exports=function(n,t){var u=r.click(n,null,t),f={mouse:i.cursors.NONE};return u[0]&&(f.mouse=u[0].properties.active===i.activeStates.ACTIVE?i.cursors.MOVE:i.cursors.POINTER,f.feature=u[0].properties.meta),-1!==t.events.currentModeName().indexOf("draw")&&(f.mouse=i.cursors.ADD),t.ui.queueMapClasses(f),t.ui.updateMapClasses(),u[0]}},{"../constants":24,"./features_at":38}],40:[function(n,t){"use strict";var i=n("./euclidean_distance");t.exports=function(n,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},f=null!=r.fineTolerance?r.fineTolerance:4,e=null!=r.grossTolerance?r.grossTolerance:12,o=null!=r.interval?r.interval:500,u;return n.point=n.point||t.point,n.time=n.time||t.time,u=i(n.point,t.point),u<f||u<e&&t.time-n.time<o}},{"./euclidean_distance":37}],41:[function(n,t){"use strict";function i(n,t){return!!n.lngLat&&n.lngLat.lng===t[0]&&n.lngLat.lat===t[1]}t.exports=i},{}],42:[function(n,t){"use strict";var i=n("./euclidean_distance");t.exports=function(n,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},u=null!=r.tolerance?r.tolerance:25,f=null!=r.interval?r.interval:250;return n.point=n.point||t.point,n.time=n.time||t.time,i(n.point,t.point)<u&&t.time-n.time<f}},{"./euclidean_distance":37}],43:[function(n,t){"use strict";function i(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return[[n.point.x-t,n.point.y-t],[n.point.x+t,n.point.y+t]]}t.exports=i},{}],44:[function(n,t){"use strict";var i=function(n,t){var r={drag:[],click:[],mousemove:[],mousedown:[],mouseup:[],mouseout:[],keydown:[],keyup:[],touchstart:[],touchmove:[],touchend:[],tap:[]},u={on:function(n,t,i){if(void 0===r[n])throw new Error("Invalid event type: "+n);r[n].push({selector:t,fn:i})},render:function(n){t.store.featureChanged(n)}},i=function(n,i){for(var o,f=r[n],e=f.length;e--;)if(o=f[e],o.selector(i)){o.fn.call(u,i);t.store.render();t.ui.updateMapClasses();break}};return n.start.call(u),{render:n.render,stop:function(){n.stop&&n.stop()},trash:function(){n.trash&&(n.trash(),t.store.render())},combineFeatures:function(){n.combineFeatures&&n.combineFeatures()},uncombineFeatures:function(){n.uncombineFeatures&&n.uncombineFeatures()},drag:function(n){i("drag",n)},click:function(n){i("click",n)},mousemove:function(n){i("mousemove",n)},mousedown:function(n){i("mousedown",n)},mouseup:function(n){i("mouseup",n)},mouseout:function(n){i("mouseout",n)},keydown:function(n){i("keydown",n)},keyup:function(n){i("keyup",n)},touchstart:function(n){i("touchstart",n)},touchmove:function(n){i("touchmove",n)},touchend:function(n){i("touchend",n)},tap:function(n){i("tap",n)}}};t.exports=i},{}],45:[function(n,t){"use strict";function i(n,t){var i=t.getBoundingClientRect();return new r(n.clientX-i.left-(t.clientLeft||0),n.clientY-i.top-(t.clientTop||0))}var r=n("point-geometry");t.exports=i},{"point-geometry":18}],46:[function(n,t){"use strict";var r=n("./constrain_feature_movement"),i=n("../constants");t.exports=function(n,t){var u=r(n.map(function(n){return n.toGeoJSON()}),t);n.forEach(function(n){var r=n.getCoordinates(),f=function(n){var t={lng:n[0]+u.lng,lat:n[1]+u.lat};return[t.lng,t.lat]},e=function(n){return n.map(function(n){return f(n)})},o=function(n){return n.map(function(n){return e(n)})},t=void 0;n.type===i.geojsonTypes.POINT?t=f(r):n.type===i.geojsonTypes.LINE_STRING||n.type===i.geojsonTypes.MULTI_POINT?t=r.map(f):n.type===i.geojsonTypes.POLYGON||n.type===i.geojsonTypes.MULTI_LINE_STRING?t=r.map(e):n.type===i.geojsonTypes.MULTI_POLYGON&&(t=r.map(o));n.incomingCoords(t)})}},{"../constants":24,"./constrain_feature_movement":32}],47:[function(n,t){"use strict";function u(n,t){var u=r[n.geometry.type]-r[t.geometry.type];return 0===u&&n.geometry.type===i.geojsonTypes.POLYGON?n.area-t.area:u}function f(n){return n.map(function(n){return n.geometry.type===i.geojsonTypes.POLYGON&&(n.area=e.geometry({type:i.geojsonTypes.FEATURE,property:{},geometry:n.geometry})),n}).sort(u).map(function(n){return delete n.area,n})}var e=n("@mapbox/geojson-area"),i=n("../constants"),r={Point:0,LineString:1,Polygon:2};t.exports=f},{"../constants":24,"@mapbox/geojson-area":2}],48:[function(n,t){"use strict";function i(n){if(this._items={},this._length=n?n.length:0,n)for(var t=0,i=n.length;t<i;t++)void 0!==n[t]&&(this._items[n[t]]=t)}i.prototype.add=function(n){return this._length=this._items[n]?this._length:this._length+1,this._items[n]=this._items[n]?this._items[n]:this._length,this};i.prototype.delete=function(n){return this._length=this._items[n]?this._length-1:this._length,delete this._items[n],this};i.prototype.has=function(n){return void 0!==this._items[n]};i.prototype.values=function(){var n=this;return Object.keys(this._items).sort(function(t,i){return n._items[t]-n._items[i]})};i.prototype.clear=function(){return this._length=0,this._items={},this};t.exports=i},{}],49:[function(n,t){"use strict";t.exports=function(n,t){return n.length===t.length&&JSON.stringify(n.map(function(n){return n}).sort())===JSON.stringify(t.map(function(n){return n}).sort())}},{}],50:[function(n,t){"use strict";t.exports=[{id:"gl-draw-polygon-fill-inactive",type:"fill",filter:["all",["==","active","false"],["==","$type","Polygon"],["!=","mode","static"]],paint:{"fill-color":"#3bb2d0","fill-outline-color":"#3bb2d0","fill-opacity":.1}},{id:"gl-draw-polygon-fill-active",type:"fill",filter:["all",["==","active","true"],["==","$type","Polygon"]],paint:{"fill-color":"#fbb03b","fill-outline-color":"#fbb03b","fill-opacity":.1}},{id:"gl-draw-polygon-midpoint",type:"circle",filter:["all",["==","$type","Point"],["==","meta","midpoint"]],paint:{"circle-radius":3,"circle-color":"#fbb03b"}},{id:"gl-draw-polygon-stroke-inactive",type:"line",filter:["all",["==","active","false"],["==","$type","Polygon"],["!=","mode","static"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#3bb2d0","line-width":2}},{id:"gl-draw-polygon-stroke-active",type:"line",filter:["all",["==","active","true"],["==","$type","Polygon"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fbb03b","line-dasharray":[.2,2],"line-width":2}},{id:"gl-draw-line-inactive",type:"line",filter:["all",["==","active","false"],["==","$type","LineString"],["!=","mode","static"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#3bb2d0","line-width":2}},{id:"gl-draw-line-active",type:"line",filter:["all",["==","$type","LineString"],["==","active","true"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fbb03b","line-dasharray":[.2,2],"line-width":2}},{id:"gl-draw-polygon-and-line-vertex-stroke-inactive",type:"circle",filter:["all",["==","meta","vertex"],["==","$type","Point"],["!=","mode","static"]],paint:{"circle-radius":5,"circle-color":"#fff"}},{id:"gl-draw-polygon-and-line-vertex-inactive",type:"circle",filter:["all",["==","meta","vertex"],["==","$type","Point"],["!=","mode","static"]],paint:{"circle-radius":3,"circle-color":"#fbb03b"}},{id:"gl-draw-point-point-stroke-inactive",type:"circle",filter:["all",["==","active","false"],["==","$type","Point"],["==","meta","feature"],["!=","mode","static"]],paint:{"circle-radius":5,"circle-opacity":1,"circle-color":"#fff"}},{id:"gl-draw-point-inactive",type:"circle",filter:["all",["==","active","false"],["==","$type","Point"],["==","meta","feature"],["!=","mode","static"]],paint:{"circle-radius":3,"circle-color":"#3bb2d0"}},{id:"gl-draw-point-stroke-active",type:"circle",filter:["all",["==","$type","Point"],["==","active","true"],["!=","meta","midpoint"]],paint:{"circle-radius":7,"circle-color":"#fff"}},{id:"gl-draw-point-active",type:"circle",filter:["all",["==","$type","Point"],["!=","meta","midpoint"],["==","active","true"]],paint:{"circle-radius":5,"circle-color":"#fbb03b"}},{id:"gl-draw-polygon-fill-static",type:"fill",filter:["all",["==","mode","static"],["==","$type","Polygon"]],paint:{"fill-color":"#404040","fill-outline-color":"#404040","fill-opacity":.1}},{id:"gl-draw-polygon-stroke-static",type:"line",filter:["all",["==","mode","static"],["==","$type","Polygon"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#404040","line-width":2}},{id:"gl-draw-line-static",type:"line",filter:["all",["==","mode","static"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#404040","line-width":2}},{id:"gl-draw-point-static",type:"circle",filter:["all",["==","mode","static"],["==","$type","Point"]],paint:{"circle-radius":5,"circle-color":"#404040"}}]},{}],51:[function(n,t){"use strict";function i(n,t,i){function e(){u=!1;r&&(f.apply(i,r),r=!1)}function f(){u?r=arguments:(u=!0,n.apply(i,arguments),setTimeout(e,t))}var u=void 0,r=void 0;return f}t.exports=i},{}],52:[function(n,t){"use strict";function i(n){return[].concat(n).filter(function(n){return void 0!==n})}t.exports=i},{}],53:[function(n,t){"use strict";var u=n("../lib/common_selectors"),e=u.noTarget,o=u.isOfMetaType,s=u.isInactiveFeature,h=u.isShiftDown,a=n("../lib/create_supplementary_points"),v=n("../lib/constrain_feature_movement"),c=n("../lib/double_click_zoom"),r=n("../constants"),f=n("../lib/common_selectors"),y=n("../lib/move_features"),l=o(r.meta.VERTEX),p=o(r.meta.MIDPOINT),i={};i.fireUpdate=function(){this.map.fire(r.events.UPDATE,{action:r.updateActions.CHANGE_COORDINATES,features:this.getSelected().map(function(n){return n.toGeoJSON()})})};i.fireActionable=function(n){this.setActionableState({combineFeatures:!1,uncombineFeatures:!1,trash:n.selectedCoordPaths.length>0})};i.startDragging=function(n,t){this.map.dragPan.disable();n.canDragMove=!0;n.dragMoveLocation=t.lngLat};i.stopDragging=function(n){this.map.dragPan.enable();n.dragMoving=!1;n.canDragMove=!1;n.dragMoveLocation=null};i.onVertex=function(n,t){var i,r,u;this.startDragging(n,t);i=t.featureTarget.properties;r=n.selectedCoordPaths.indexOf(i.coord_path);h(t)||-1!==r?h(t)&&-1===r&&n.selectedCoordPaths.push(i.coord_path):n.selectedCoordPaths=[i.coord_path];u=this.pathsToCoordinates(n.featureId,n.selectedCoordPaths);this.setSelectedCoordinates(u)};i.onMidpoint=function(n,t){this.startDragging(n,t);var i=t.featureTarget.properties;n.feature.addCoordinate(i.coord_path,i.lng,i.lat);this.fireUpdate();n.selectedCoordPaths=[i.coord_path]};i.pathsToCoordinates=function(n,t){return t.map(function(t){return{feature_id:n,coord_path:t}})};i.onFeature=function(n,t){0===n.selectedCoordPaths.length?this.startDragging(n,t):this.stopDragging(n)};i.dragFeature=function(n,t,i){y(this.getSelected(),i);n.dragMoveLocation=t.lngLat};i.dragVertex=function(n,t,i){for(var e,f=n.selectedCoordPaths.map(function(t){return n.feature.getCoordinate(t)}),s=f.map(function(n){return{type:r.geojsonTypes.FEATURE,properties:{},geometry:{type:r.geojsonTypes.POINT,coordinates:n}}}),o=v(s,i),u=0;u<f.length;u++)e=f[u],n.feature.updateCoordinate(n.selectedCoordPaths[u],e[0]+o.lng,e[1]+o.lat)};i.clickNoTarget=function(){this.changeMode(r.modes.SIMPLE_SELECT)};i.clickInactive=function(){this.changeMode(r.modes.SIMPLE_SELECT)};i.clickActiveFeature=function(n){n.selectedCoordPaths=[];this.clearSelectedCoordinates();n.feature.changed()};i.onSetup=function(n){var t=n.featureId,i=this.getFeature(t),u;if(!i)throw new Error("You must provide a featureId to enter direct_select mode");if(i.type===r.geojsonTypes.POINT)throw new TypeError("direct_select mode doesn't handle point features");return u={featureId:t,feature:i,dragMoveLocation:n.startPos||null,dragMoving:!1,canDragMove:!1,selectedCoordPaths:n.coordPath?[n.coordPath]:[]},this.setSelectedCoordinates(this.pathsToCoordinates(t,u.selectedCoordPaths)),this.setSelected(t),c.disable(this),this.setActionableState({trash:!0}),u};i.onStop=function(){c.enable(this);this.clearSelectedCoordinates()};i.toDisplayFeatures=function(n,t,i){n.featureId===t.properties.id?(t.properties.active=r.activeStates.ACTIVE,i(t),a(t,{map:this.map,midpoints:!0,selectedPaths:n.selectedCoordPaths}).forEach(i)):(t.properties.active=r.activeStates.INACTIVE,i(t));this.fireActionable(n)};i.onTrash=function(n){n.selectedCoordPaths.sort().reverse().forEach(function(t){return n.feature.removeCoordinate(t)});this.map.fire(r.events.UPDATE,{action:r.updateActions.CHANGE_COORDINATES,features:this.getSelected().map(function(n){return n.toGeoJSON()})});n.selectedCoordPaths=[];this.clearSelectedCoordinates();this.fireActionable(n);!1===n.feature.isValid()&&(this.deleteFeature([n.featureId]),this.changeMode(r.modes.SIMPLE_SELECT,{}))};i.onMouseMove=function(n,t){var u=f.isActiveFeature(t),e=l(t),i=0===n.selectedCoordPaths.length;u&&i?this.updateUIClasses({mouse:r.cursors.MOVE}):e&&!i?this.updateUIClasses({mouse:r.cursors.MOVE}):this.updateUIClasses({mouse:r.cursors.NONE});this.stopDragging(n)};i.onMouseOut=function(n){n.dragMoving&&this.fireUpdate()};i.onTouchStart=i.onMouseDown=function(n,t){return l(t)?this.onVertex(n,t):f.isActiveFeature(t)?this.onFeature(n,t):p(t)?this.onMidpoint(n,t):void 0};i.onDrag=function(n,t){if(!0===n.canDragMove){n.dragMoving=!0;t.originalEvent.stopPropagation();var i={lng:t.lngLat.lng-n.dragMoveLocation.lng,lat:t.lngLat.lat-n.dragMoveLocation.lat};n.selectedCoordPaths.length>0?this.dragVertex(n,t,i):this.dragFeature(n,t,i);n.dragMoveLocation=t.lngLat}};i.onClick=function(n,t){return e(t)?this.clickNoTarget(n,t):f.isActiveFeature(t)?this.clickActiveFeature(n,t):s(t)?this.clickInactive(n,t):void this.stopDragging(n)};i.onTap=function(n,t){return e(t)?this.clickNoTarget(n,t):f.isActiveFeature(t)?this.clickActiveFeature(n,t):s(t)?this.clickInactive(n,t):void 0};i.onTouchEnd=i.onMouseUp=function(n){n.dragMoving&&this.fireUpdate();this.stopDragging(n)};t.exports=i},{"../constants":24,"../lib/common_selectors":31,"../lib/constrain_feature_movement":32,"../lib/create_supplementary_points":34,"../lib/double_click_zoom":36,"../lib/move_features":46}],54:[function(n,t){"use strict";function f(n){if(Array.isArray(n)){for(var t=0,i=Array(n.length);t<n.length;t++)i[t]=n[t];return i}return Array.from(n)}var u=n("../lib/common_selectors"),e=n("../lib/is_event_at_coordinates"),o=n("../lib/double_click_zoom"),i=n("../constants"),s=n("../lib/create_vertex"),r={};r.onSetup=function(n){var t,e,c,l;n=n||{};var s=n.featureId,r=void 0,u=void 0,h="forward";if(s){if(!(r=this.getFeature(s)))throw new Error("Could not find a feature with the provided featureId");if(t=n.from,t&&"Feature"===t.type&&t.geometry&&"Point"===t.geometry.type&&(t=t.geometry),t&&"Point"===t.type&&t.coordinates&&2===t.coordinates.length&&(t=t.coordinates),!t||!Array.isArray(t))throw new Error("Please use the `from` property to indicate which point to continue the line from");if(e=r.coordinates.length-1,r.coordinates[e][0]===t[0]&&r.coordinates[e][1]===t[1])u=e+1,(c=r).addCoordinate.apply(c,[u].concat(f(r.coordinates[e])));else{if(r.coordinates[0][0]!==t[0]||r.coordinates[0][1]!==t[1])throw new Error("`from` should match the point at either the start or the end of the provided LineString");h="backwards";u=0;(l=r).addCoordinate.apply(l,[u].concat(f(r.coordinates[0])))}}else r=this.newFeature({type:i.geojsonTypes.FEATURE,properties:{},geometry:{type:i.geojsonTypes.LINE_STRING,coordinates:[]}}),u=0,this.addFeature(r);return this.clearSelectedFeatures(),o.disable(this),this.updateUIClasses({mouse:i.cursors.ADD}),this.activateUIButton(i.types.LINE),this.setActionableState({trash:!0}),{line:r,currentVertexPosition:u,direction:h}};r.clickAnywhere=function(n,t){if(n.currentVertexPosition>0&&e(t,n.line.coordinates[n.currentVertexPosition-1])||"backwards"===n.direction&&e(t,n.line.coordinates[n.currentVertexPosition+1]))return this.changeMode(i.modes.SIMPLE_SELECT,{featureIds:[n.line.id]});this.updateUIClasses({mouse:i.cursors.ADD});n.line.updateCoordinate(n.currentVertexPosition,t.lngLat.lng,t.lngLat.lat);"forward"===n.direction?(n.currentVertexPosition++,n.line.updateCoordinate(n.currentVertexPosition,t.lngLat.lng,t.lngLat.lat)):n.line.addCoordinate(0,t.lngLat.lng,t.lngLat.lat)};r.clickOnVertex=function(n){return this.changeMode(i.modes.SIMPLE_SELECT,{featureIds:[n.line.id]})};r.onMouseMove=function(n,t){n.line.updateCoordinate(n.currentVertexPosition,t.lngLat.lng,t.lngLat.lat);u.isVertex(t)&&this.updateUIClasses({mouse:i.cursors.POINTER})};r.onTap=r.onClick=function(n,t){if(u.isVertex(t))return this.clickOnVertex(n,t);this.clickAnywhere(n,t)};r.onKeyUp=function(n,t){u.isEnterKey(t)?this.changeMode(i.modes.SIMPLE_SELECT,{featureIds:[n.line.id]}):u.isEscapeKey(t)&&(this.deleteFeature([n.line.id],{silent:!0}),this.changeMode(i.modes.SIMPLE_SELECT))};r.onStop=function(n){o.enable(this);this.activateUIButton();void 0!==this.getFeature(n.line.id)&&(n.line.removeCoordinate(""+n.currentVertexPosition),n.line.isValid()?this.map.fire(i.events.CREATE,{features:[n.line.toGeoJSON()]}):(this.deleteFeature([n.line.id],{silent:!0}),this.changeMode(i.modes.SIMPLE_SELECT,{},{silent:!0})))};r.onTrash=function(n){this.deleteFeature([n.line.id],{silent:!0});this.changeMode(i.modes.SIMPLE_SELECT)};r.toDisplayFeatures=function(n,t,r){var u=t.properties.id===n.line.id;if(t.properties.active=u?i.activeStates.ACTIVE:i.activeStates.INACTIVE,!u)return r(t);t.geometry.coordinates.length<2||(t.properties.meta=i.meta.FEATURE,r(s(n.line.id,t.geometry.coordinates["forward"===n.direction?t.geometry.coordinates.length-2:1],""+("forward"===n.direction?t.geometry.coordinates.length-2:1),!1)),r(t))};t.exports=r},{"../constants":24,"../lib/common_selectors":31,"../lib/create_vertex":35,"../lib/double_click_zoom":36,"../lib/is_event_at_coordinates":41}],55:[function(n,t){"use strict";var u=n("../lib/common_selectors"),i=n("../constants"),r={};r.onSetup=function(){var n=this.newFeature({type:i.geojsonTypes.FEATURE,properties:{},geometry:{type:i.geojsonTypes.POINT,coordinates:[]}});return this.addFeature(n),this.clearSelectedFeatures(),this.updateUIClasses({mouse:i.cursors.ADD}),this.activateUIButton(i.types.POINT),this.setActionableState({trash:!0}),{point:n}};r.stopDrawingAndRemove=function(n){this.deleteFeature([n.point.id],{silent:!0});this.changeMode(i.modes.SIMPLE_SELECT)};r.onTap=r.onClick=function(n,t){this.updateUIClasses({mouse:i.cursors.MOVE});n.point.updateCoordinate("",t.lngLat.lng,t.lngLat.lat);this.map.fire(i.events.CREATE,{features:[n.point.toGeoJSON()]});this.changeMode(i.modes.SIMPLE_SELECT,{featureIds:[n.point.id]})};r.onStop=function(n){this.activateUIButton();n.point.getCoordinate().length||this.deleteFeature([n.point.id],{silent:!0})};r.toDisplayFeatures=function(n,t,r){var u=t.properties.id===n.point.id;if(t.properties.active=u?i.activeStates.ACTIVE:i.activeStates.INACTIVE,!u)return r(t)};r.onTrash=r.stopDrawingAndRemove;r.onKeyUp=function(n,t){if(u.isEscapeKey(t)||u.isEnterKey(t))return this.stopDrawingAndRemove(n,t)};t.exports=r},{"../constants":24,"../lib/common_selectors":31}],56:[function(n,t){"use strict";var u=n("../lib/common_selectors"),f=n("../lib/double_click_zoom"),i=n("../constants"),o=n("../lib/is_event_at_coordinates"),e=n("../lib/create_vertex"),r={};r.onSetup=function(){var n=this.newFeature({type:i.geojsonTypes.FEATURE,properties:{},geometry:{type:i.geojsonTypes.POLYGON,coordinates:[[]]}});return this.addFeature(n),this.clearSelectedFeatures(),f.disable(this),this.updateUIClasses({mouse:i.cursors.ADD}),this.activateUIButton(i.types.POLYGON),this.setActionableState({trash:!0}),{polygon:n,currentVertexPosition:0}};r.clickAnywhere=function(n,t){if(n.currentVertexPosition>0&&o(t,n.polygon.coordinates[0][n.currentVertexPosition-1]))return this.changeMode(i.modes.SIMPLE_SELECT,{featureIds:[n.polygon.id]});this.updateUIClasses({mouse:i.cursors.ADD});n.polygon.updateCoordinate("0."+n.currentVertexPosition,t.lngLat.lng,t.lngLat.lat);n.currentVertexPosition++;n.polygon.updateCoordinate("0."+n.currentVertexPosition,t.lngLat.lng,t.lngLat.lat)};r.clickOnVertex=function(n){return this.changeMode(i.modes.SIMPLE_SELECT,{featureIds:[n.polygon.id]})};r.onMouseMove=function(n,t){n.polygon.updateCoordinate("0."+n.currentVertexPosition,t.lngLat.lng,t.lngLat.lat);u.isVertex(t)&&this.updateUIClasses({mouse:i.cursors.POINTER})};r.onTap=r.onClick=function(n,t){return u.isVertex(t)?this.clickOnVertex(n,t):this.clickAnywhere(n,t)};r.onKeyUp=function(n,t){u.isEscapeKey(t)?(this.deleteFeature([n.polygon.id],{silent:!0}),this.changeMode(i.modes.SIMPLE_SELECT)):u.isEnterKey(t)&&this.changeMode(i.modes.SIMPLE_SELECT,{featureIds:[n.polygon.id]})};r.onStop=function(n){this.updateUIClasses({mouse:i.cursors.NONE});f.enable(this);this.activateUIButton();void 0!==this.getFeature(n.polygon.id)&&(n.polygon.removeCoordinate("0."+n.currentVertexPosition),n.polygon.isValid()?this.map.fire(i.events.CREATE,{features:[n.polygon.toGeoJSON()]}):(this.deleteFeature([n.polygon.id],{silent:!0}),this.changeMode(i.modes.SIMPLE_SELECT,{},{silent:!0})))};r.toDisplayFeatures=function(n,t,r){var o=t.properties.id===n.polygon.id,u,f,s;return(t.properties.active=o?i.activeStates.ACTIVE:i.activeStates.INACTIVE,!o)?r(t):0!==t.geometry.coordinates.length&&(u=t.geometry.coordinates[0].length,!(u<3))?((t.properties.meta=i.meta.FEATURE,r(e(n.polygon.id,t.geometry.coordinates[0][0],"0.0",!1)),u>3)&&(f=t.geometry.coordinates[0].length-3,r(e(n.polygon.id,t.geometry.coordinates[0][f],"0."+f,!1))),u<=4&&(s=[[t.geometry.coordinates[0][0][0],t.geometry.coordinates[0][0][1]],[t.geometry.coordinates[0][1][0],t.geometry.coordinates[0][1][1]]],r({type:i.geojsonTypes.FEATURE,properties:t.properties,geometry:{coordinates:s,type:i.geojsonTypes.LINE_STRING}}),3===u))?void 0:r(t):void 0};r.onTrash=function(n){this.deleteFeature([n.polygon.id],{silent:!0});this.changeMode(i.modes.SIMPLE_SELECT)};t.exports=r},{"../constants":24,"../lib/common_selectors":31,"../lib/create_vertex":35,"../lib/double_click_zoom":36,"../lib/is_event_at_coordinates":41}],57:[function(n,t){"use strict";t.exports=["simple_select","direct_select","draw_point","draw_polygon","draw_line_string"].reduce(function(t,i){return t[i]=n("./"+i),t},{});t.exports={simple_select:n("./simple_select"),direct_select:n("./direct_select"),draw_point:n("./draw_point"),draw_polygon:n("./draw_polygon"),draw_line_string:n("./draw_line_string")}},{"./direct_select":53,"./draw_line_string":54,"./draw_point":55,"./draw_polygon":56,"./simple_select":61}],58:[function(n,t){"use strict";var i=t.exports=n("./mode_interface_accessors");i.prototype.onSetup=function(){};i.prototype.onDrag=function(){};i.prototype.onClick=function(){};i.prototype.onMouseMove=function(){};i.prototype.onMouseDown=function(){};i.prototype.onMouseUp=function(){};i.prototype.onMouseOut=function(){};i.prototype.onKeyUp=function(){};i.prototype.onKeyDown=function(){};i.prototype.onTouchStart=function(){};i.prototype.onTouchMove=function(){};i.prototype.onTouchEnd=function(){};i.prototype.onTap=function(){};i.prototype.onStop=function(){};i.prototype.onTrash=function(){};i.prototype.onCombineFeature=function(){};i.prototype.onUncombineFeature=function(){};i.prototype.toDisplayFeatures=function(){throw new Error("You must overwrite toDisplayFeatures");}},{"./mode_interface_accessors":59}],59:[function(n,t){"use strict";var r=n("../constants"),s=n("../lib/features_at"),u=n("../feature_types/point"),f=n("../feature_types/line_string"),e=n("../feature_types/polygon"),o=n("../feature_types/multi_feature"),i=t.exports=function(n){this.map=n.map;this.drawConfig=JSON.parse(JSON.stringify(n.options||{}));this._ctx=n};i.prototype.setSelected=function(n){return this._ctx.store.setSelected(n)};i.prototype.setSelectedCoordinates=function(n){var t=this;this._ctx.store.setSelectedCoordinates(n);n.reduce(function(n,i){return void 0===n[i.feature_id]&&(n[i.feature_id]=!0,t._ctx.store.get(i.feature_id).changed()),n},{})};i.prototype.getSelected=function(){return this._ctx.store.getSelected()};i.prototype.getSelectedIds=function(){return this._ctx.store.getSelectedIds()};i.prototype.isSelected=function(n){return this._ctx.store.isSelected(n)};i.prototype.getFeature=function(n){return this._ctx.store.get(n)};i.prototype.select=function(n){return this._ctx.store.select(n)};i.prototype.deselect=function(n){return this._ctx.store.deselect(n)};i.prototype.deleteFeature=function(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._ctx.store.delete(n,t)};i.prototype.addFeature=function(n){return this._ctx.store.add(n)};i.prototype.clearSelectedFeatures=function(){return this._ctx.store.clearSelected()};i.prototype.clearSelectedCoordinates=function(){return this._ctx.store.clearSelectedCoordinates()};i.prototype.setActionableState=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={trash:n.trash||!1,combineFeatures:n.combineFeatures||!1,uncombineFeatures:n.uncombineFeatures||!1};return this._ctx.events.actionable(t)};i.prototype.changeMode=function(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._ctx.events.changeMode(n,t,i)};i.prototype.updateUIClasses=function(n){return this._ctx.ui.queueMapClasses(n)};i.prototype.activateUIButton=function(n){return this._ctx.ui.setActiveButton(n)};i.prototype.featuresAt=function(n,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"click";if("click"!==i&&"touch"!==i)throw new Error("invalid buffer type");return s[i](n,t,this._ctx)};i.prototype.newFeature=function(n){var t=n.geometry.type;return t===r.geojsonTypes.POINT?new u(this._ctx,n):t===r.geojsonTypes.LINE_STRING?new f(this._ctx,n):t===r.geojsonTypes.POLYGON?new e(this._ctx,n):new o(this._ctx,n)};i.prototype.isInstanceOf=function(n,t){if(n===r.geojsonTypes.POINT)return t instanceof u;if(n===r.geojsonTypes.LINE_STRING)return t instanceof f;if(n===r.geojsonTypes.POLYGON)return t instanceof e;if("MultiFeature"===n)return t instanceof o;throw new Error("Unknown feature class: "+n);};i.prototype.doRender=function(n){return this._ctx.store.featureChanged(n)}},{"../constants":24,"../feature_types/line_string":27,"../feature_types/multi_feature":28,"../feature_types/point":29,"../feature_types/polygon":30,"../lib/features_at":38}],60:[function(n,t){"use strict";var i=n("./mode_interface");t.exports=function(n){var t=Object.keys(n);return function(r){function u(n){return function(t){e[n](f,t)}}var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},f={},e=t.reduce(function(t,i){return t[i]=n[i],t},new i(r));return{start:function(){f=e.onSetup(o);this.on("drag",function(){return!0},u("onDrag"));this.on("click",function(){return!0},u("onClick"));this.on("mousemove",function(){return!0},u("onMouseMove"));this.on("mousedown",function(){return!0},u("onMouseDown"));this.on("mouseup",function(){return!0},u("onMouseUp"));this.on("mouseout",function(){return!0},u("onMouseOut"));this.on("keyup",function(){return!0},u("onKeyUp"));this.on("keydown",function(){return!0},u("onKeyDown"));this.on("touchstart",function(){return!0},u("onTouchStart"));this.on("touchmove",function(){return!0},u("onTouchMove"));this.on("touchend",function(){return!0},u("onTouchEnd"));this.on("tap",function(){return!0},u("onTap"))},stop:function(){e.onStop(f)},trash:function(){e.onTrash(f)},combineFeatures:function(){e.onCombineFeatures(f)},uncombineFeatures:function(){e.onUncombineFeatures(f)},render:function(n,t){e.toDisplayFeatures(f,n,t)}}}}},{"./mode_interface":58}],61:[function(n,t){"use strict";var u=n("../lib/common_selectors"),e=n("../lib/mouse_event_point"),o=n("../lib/create_supplementary_points"),s=n("../lib/string_set"),f=n("../lib/double_click_zoom"),h=n("../lib/move_features"),r=n("../constants"),i={};i.onSetup=function(n){var i=this,t={dragMoveLocation:null,boxSelectStartLocation:null,boxSelectElement:void 0,boxSelecting:!1,canBoxSelect:!1,dragMoveing:!1,canDragMove:!1,initiallySelectedFeatureIds:n.featureIds||[]};return this.setSelected(t.initiallySelectedFeatureIds.filter(function(n){return void 0!==i.getFeature(n)})),this.fireActionable(),this.setActionableState({combineFeatures:!0,uncombineFeatures:!0,trash:!0}),t};i.fireUpdate=function(){this.map.fire(r.events.UPDATE,{action:r.updateActions.MOVE,features:this.getSelected().map(function(n){return n.toGeoJSON()})})};i.fireActionable=function(){var f=this,n=this.getSelected(),e=n.filter(function(n){return f.isInstanceOf("MultiFeature",n)}),t=!1,i,r,u;n.length>1&&(t=!0,i=n[0].type.replace("Multi",""),n.forEach(function(n){n.type.replace("Multi","")!==i&&(t=!1)}));r=e.length>0;u=n.length>0;this.setActionableState({combineFeatures:t,uncombineFeatures:r,trash:u})};i.getUniqueIds=function(n){return n.length?n.map(function(n){return n.properties.id}).filter(function(n){return void 0!==n}).reduce(function(n,t){return n.add(t),n},new s).values():[]};i.stopExtendedInteractions=function(n){n.boxSelectElement&&(n.boxSelectElement.parentNode&&n.boxSelectElement.parentNode.removeChild(n.boxSelectElement),n.boxSelectElement=null);this.map.dragPan.enable();n.boxSelecting=!1;n.canBoxSelect=!1;n.dragMoving=!1;n.canDragMove=!1};i.onStop=function(){f.enable(this)};i.onMouseUp=function(n,t){if(u.true(t))return this.stopExtendedInteractions(n)};i.onMouseMove=function(n){return this.stopExtendedInteractions(n)};i.onMouseOut=function(n){if(n.dragMoving)return this.fireUpdate()};i.onTap=i.onClick=function(n,t){return u.noTarget(t)?this.clickAnywhere(n,t):u.isOfMetaType(r.meta.VERTEX)(t)?this.clickOnVertex(n,t):u.isFeature(t)?this.clickOnFeature(n,t):void 0};i.clickAnywhere=function(n){var i=this,t=this.getSelectedIds();t.length&&(this.clearSelectedFeatures(),t.forEach(function(n){return i.doRender(n)}));f.enable(this);this.stopExtendedInteractions(n)};i.clickOnVertex=function(n,t){this.changeMode(r.modes.DIRECT_SELECT,{featureId:t.featureTarget.properties.parent,coordPath:t.featureTarget.properties.coord_path,startPos:t.lngLat});this.updateUIClasses({mouse:r.cursors.MOVE})};i.startOnActiveFeature=function(n,t){this.stopExtendedInteractions(n);this.map.dragPan.disable();this.doRender(t.featureTarget.properties.id);n.canDragMove=!0;n.dragMoveLocation=t.lngLat};i.clickOnFeature=function(n,t){var h=this;f.disable(this);this.stopExtendedInteractions(n);var e=u.isShiftDown(t),s=this.getSelectedIds(),i=t.featureTarget.properties.id,o=this.isSelected(i);if(!e&&o&&this.getFeature(i).type!==r.geojsonTypes.POINT)return this.changeMode(r.modes.DIRECT_SELECT,{featureId:i});o&&e?(this.deselect(i),this.updateUIClasses({mouse:r.cursors.POINTER}),1===s.length&&f.enable(this)):!o&&e?(this.select(i),this.updateUIClasses({mouse:r.cursors.MOVE})):o||e||(s.forEach(function(n){return h.doRender(n)}),this.setSelected(i),this.updateUIClasses({mouse:r.cursors.MOVE}));this.doRender(i)};i.onMouseDown=function(n,t){return u.isActiveFeature(t)?this.startOnActiveFeature(n,t):this.drawConfig.boxSelect&&u.isShiftMousedown(t)?this.startBoxSelect(n,t):void 0};i.startBoxSelect=function(n,t){this.stopExtendedInteractions(n);this.map.dragPan.disable();n.boxSelectStartLocation=e(t.originalEvent,this.map.getContainer());n.canBoxSelect=!0};i.onTouchStart=function(n,t){if(u.isActiveFeature(t))return this.startOnActiveFeature(n,t)};i.onDrag=function(n,t){return n.canDragMove?this.dragMove(n,t):this.drawConfig.boxSelect&&n.canBoxSelect?this.whileBoxSelect(n,t):void 0};i.whileBoxSelect=function(n,t){n.boxSelecting=!0;this.updateUIClasses({mouse:r.cursors.ADD});n.boxSelectElement||(n.boxSelectElement=document.createElement("div"),n.boxSelectElement.classList.add(r.classes.BOX_SELECT),this.map.getContainer().appendChild(n.boxSelectElement));var i=e(t.originalEvent,this.map.getContainer()),u=Math.min(n.boxSelectStartLocation.x,i.x),s=Math.max(n.boxSelectStartLocation.x,i.x),f=Math.min(n.boxSelectStartLocation.y,i.y),h=Math.max(n.boxSelectStartLocation.y,i.y),o="translate("+u+"px, "+f+"px)";n.boxSelectElement.style.transform=o;n.boxSelectElement.style.WebkitTransform=o;n.boxSelectElement.style.width=s-u+"px";n.boxSelectElement.style.height=h-f+"px"};i.dragMove=function(n,t){n.dragMoving=!0;t.originalEvent.stopPropagation();var i={lng:t.lngLat.lng-n.dragMoveLocation.lng,lat:t.lngLat.lat-n.dragMoveLocation.lat};h(this.getSelected(),i);n.dragMoveLocation=t.lngLat};i.onMouseUp=function(n,t){var u=this;if(n.dragMoving)this.fireUpdate();else if(n.boxSelecting){var f=[n.boxSelectStartLocation,e(t.originalEvent,this.map.getContainer())],o=this.featuresAt(null,f,"click"),i=this.getUniqueIds(o).filter(function(n){return!u.isSelected(n)});i.length&&(this.select(i),i.forEach(function(n){return u.doRender(n)}),this.updateUIClasses({mouse:r.cursors.MOVE}))}this.stopExtendedInteractions(n)};i.toDisplayFeatures=function(n,t,i){t.properties.active=this.isSelected(t.properties.id)?r.activeStates.ACTIVE:r.activeStates.INACTIVE;i(t);this.fireActionable();t.properties.active===r.activeStates.ACTIVE&&t.geometry.type!==r.geojsonTypes.POINT&&o(t).forEach(i)};i.onTrash=function(){this.deleteFeature(this.getSelectedIds());this.fireActionable()};i.onCombineFeatures=function(){var t=this.getSelected(),n,u;if(!(0===t.length||t.length<2)){for(var f=[],i=[],o=t[0].type.replace("Multi",""),e=0;e<t.length;e++){if(n=t[e],n.type.replace("Multi","")!==o)return;n.type.includes("Multi")?n.getCoordinates().forEach(function(n){f.push(n)}):f.push(n.getCoordinates());i.push(n.toGeoJSON())}i.length>1&&(u=this.newFeature({type:r.geojsonTypes.FEATURE,properties:i[0].properties,geometry:{type:"Multi"+o,coordinates:f}}),this.addFeature(u),this.deleteFeature(this.getSelectedIds(),{silent:!0}),this.setSelected([u.id]),this.map.fire(r.events.COMBINE_FEATURES,{createdFeatures:[u.toGeoJSON()],deletedFeatures:i}));this.fireActionable()}};i.onUncombineFeatures=function(){var n=this,t=this.getSelected();if(0!==t.length){for(var i=[],f=[],u=0;u<t.length;u++)!function(r){var u=t[r];n.isInstanceOf("MultiFeature",u)&&(u.getFeatures().forEach(function(t){n.addFeature(t);t.properties=u.properties;i.push(t.toGeoJSON());n.select([t.id])}),n.deleteFeature(u.id,{silent:!0}),f.push(u.toGeoJSON()))}(u);i.length>1&&this.map.fire(r.events.UNCOMBINE_FEATURES,{createdFeatures:i,deletedFeatures:f});this.fireActionable()}};t.exports=i},{"../constants":24,"../lib/common_selectors":31,"../lib/create_supplementary_points":34,"../lib/double_click_zoom":36,"../lib/mouse_event_point":45,"../lib/move_features":46,"../lib/string_set":48}],62:[function(n,t){"use strict";function u(n,t){return n.map(function(n){return n.source?n:i(n,{id:n.id+"."+t,source:"hot"===t?r.sources.HOT:r.sources.COLD})})}var i=n("xtend"),r=n("./constants"),f={defaultMode:r.modes.SIMPLE_SELECT,keybindings:!0,touchEnabled:!0,clickBuffer:2,touchBuffer:25,boxSelect:!0,displayControlsDefault:!0,styles:n("./lib/theme"),modes:n("./modes"),controls:{},userProperties:!1},e={point:!0,line_string:!0,polygon:!0,trash:!0,combine_features:!0,uncombine_features:!0},o={point:!1,line_string:!1,polygon:!1,trash:!1,combine_features:!1,uncombine_features:!1};t.exports=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=i(t);return t.controls||(n.controls={}),n.controls=!1===t.displayControlsDefault?i(o,t.controls):i(e,t.controls),n=i(f,n),n.styles=u(n.styles,"cold").concat(u(n.styles,"hot")),n}},{"./constants":24,"./lib/theme":50,"./modes":57,xtend:22}],63:[function(n,t){"use strict";var i=n("./constants");t.exports=function(){function f(t,i){var r=n.get(t),f=r.internal(u);n.ctx.events.currentModeRender(f,function(t){n.sources[i].push(t)})}function e(){n.isDirty=!1;n.clearChangedIds()}var n=this,u,t,r,o,s,h;if(!n.ctx.map||void 0===n.ctx.map.getSource(i.sources.HOT))return e();u=n.ctx.events.currentModeName();n.ctx.ui.queueMapClasses({mode:u});t=[];r=[];n.isDirty?r=n.getAllIds():(t=n.getChangedIds().filter(function(t){return void 0!==n.get(t)}),r=n.sources.hot.filter(function(i){return i.properties.id&&-1===t.indexOf(i.properties.id)&&void 0!==n.get(i.properties.id)}).map(function(n){return n.properties.id}));n.sources.hot=[];o=n.sources.cold.length;n.sources.cold=n.isDirty?[]:n.sources.cold.filter(function(n){var i=n.properties.id||n.properties.parent;return-1===t.indexOf(i)});s=o!==n.sources.cold.length||r.length>0;(t.forEach(function(n){return f(n,"hot")}),r.forEach(function(n){return f(n,"cold")}),s&&n.ctx.map.getSource(i.sources.COLD).setData({type:i.geojsonTypes.FEATURE_COLLECTION,features:n.sources.cold}),n.ctx.map.getSource(i.sources.HOT).setData({type:i.geojsonTypes.FEATURE_COLLECTION,features:n.sources.hot}),n._emitSelectionChange&&(n.ctx.map.fire(i.events.SELECTION_CHANGE,{features:n.getSelected().map(function(n){return n.toGeoJSON()}),points:n.getSelectedCoordinates().map(function(n){return{type:i.geojsonTypes.FEATURE,properties:{},geometry:{type:i.geojsonTypes.POINT,coordinates:n.coordinates}}})}),n._emitSelectionChange=!1),n._deletedFeaturesToEmit.length)&&(h=n._deletedFeaturesToEmit.map(function(n){return n.toGeoJSON()}),n._deletedFeaturesToEmit=[],n.ctx.map.fire(i.events.DELETE,{features:h}));n.ctx.map.fire(i.events.RENDER,{});e()}},{"./constants":24}],64:[function(n,t){"use strict";var r=n("./events"),u=n("./store"),f=n("./ui"),i=n("./constants");t.exports=function(n){var t=null,e={onRemove:function(){return e.removeLayers(),n.ui.removeButtons(),n.events.removeEventListeners(),n.map=null,n.container=null,n.store=null,t&&t.parentNode&&t.parentNode.removeChild(t),t=null,this},onAdd:function(i){n.map=i;n.events=r(n);n.ui=f(n);n.container=i.getContainer();n.store=new u(n);t=n.ui.addButtons();n.options.boxSelect&&(i.boxZoom.disable(),i.dragPan.disable(),i.dragPan.enable());var s=null,o=function t(){i.off("load",t);clearInterval(s);e.addLayers();n.events.addEventListeners()};return i.loaded()?o():(i.on("load",o),s=setInterval(function(){i.loaded()&&o()},16)),n.events.start(),t},addLayers:function(){n.map.addSource(i.sources.COLD,{data:{type:i.geojsonTypes.FEATURE_COLLECTION,features:[]},type:"geojson"});n.map.addSource(i.sources.HOT,{data:{type:i.geojsonTypes.FEATURE_COLLECTION,features:[]},type:"geojson"});n.options.styles.forEach(function(t){n.map.addLayer(t)});n.store.render()},removeLayers:function(){n.options.styles.forEach(function(t){n.map.removeLayer(t.id)});n.map.removeSource(i.sources.COLD);n.map.removeSource(i.sources.HOT)}};return n.setup=e,e}},{"./constants":24,"./events":25,"./store":65,"./ui":66}],65:[function(n,t){"use strict";function f(n){var i=this,t=this._selectedCoordinates.filter(function(n){return i._selectedFeatureIds.has(n.feature_id)});this._selectedCoordinates.length===t.length||n.silent||(this._emitSelectionChange=!0);this._selectedCoordinates=t}var e=n("./lib/throttle"),r=n("./lib/to_dense_array"),u=n("./lib/string_set"),o=n("./render"),i=t.exports=function(n){this._features={};this._featureIds=new u;this._selectedFeatureIds=new u;this._selectedCoordinates=[];this._changedFeatureIds=new u;this._deletedFeaturesToEmit=[];this._emitSelectionChange=!1;this.ctx=n;this.sources={hot:[],cold:[]};this.render=e(o,16,this);this.isDirty=!1};i.prototype.createRenderBatch=function(){var n=this,i=this.render,t=0;return this.render=function(){t++},function(){n.render=i;t>0&&n.render()}};i.prototype.setDirty=function(){return this.isDirty=!0,this};i.prototype.featureChanged=function(n){return this._changedFeatureIds.add(n),this};i.prototype.getChangedIds=function(){return this._changedFeatureIds.values()};i.prototype.clearChangedIds=function(){return this._changedFeatureIds.clear(),this};i.prototype.getAllIds=function(){return this._featureIds.values()};i.prototype.add=function(n){return this.featureChanged(n.id),this._features[n.id]=n,this._featureIds.add(n.id),this};i.prototype.delete=function(n){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r(n).forEach(function(n){t._featureIds.has(n)&&(t._featureIds.delete(n),t._selectedFeatureIds.delete(n),i.silent||-1===t._deletedFeaturesToEmit.indexOf(t._features[n])&&t._deletedFeaturesToEmit.push(t._features[n]),delete t._features[n],t.isDirty=!0)}),f.call(this,i),this};i.prototype.get=function(n){return this._features[n]};i.prototype.getAll=function(){var n=this;return Object.keys(this._features).map(function(t){return n._features[t]})};i.prototype.select=function(n){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r(n).forEach(function(n){t._selectedFeatureIds.has(n)||(t._selectedFeatureIds.add(n),t._changedFeatureIds.add(n),i.silent||(t._emitSelectionChange=!0))}),this};i.prototype.deselect=function(n){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r(n).forEach(function(n){t._selectedFeatureIds.has(n)&&(t._selectedFeatureIds.delete(n),t._changedFeatureIds.add(n),i.silent||(t._emitSelectionChange=!0))}),f.call(this,i),this};i.prototype.clearSelected=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.deselect(this._selectedFeatureIds.values(),{silent:n.silent}),this};i.prototype.setSelected=function(n){var i=this,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=r(n),this.deselect(this._selectedFeatureIds.values().filter(function(t){return-1===n.indexOf(t)}),{silent:t.silent}),this.select(n.filter(function(n){return!i._selectedFeatureIds.has(n)}),{silent:t.silent}),this};i.prototype.setSelectedCoordinates=function(n){return this._selectedCoordinates=n,this._emitSelectionChange=!0,this};i.prototype.clearSelectedCoordinates=function(){return this._selectedCoordinates=[],this._emitSelectionChange=!0,this};i.prototype.getSelectedIds=function(){return this._selectedFeatureIds.values()};i.prototype.getSelected=function(){var n=this;return this._selectedFeatureIds.values().map(function(t){return n.get(t)})};i.prototype.getSelectedCoordinates=function(){var n=this;return this._selectedCoordinates.map(function(t){return{coordinates:n.get(t.feature_id).getCoordinate(t.coord_path)}})};i.prototype.isSelected=function(n){return this._selectedFeatureIds.has(n)};i.prototype.setFeatureProperty=function(n,t,i){this.get(n).setProperty(t,i);this.featureChanged(n)}},{"./lib/string_set":48,"./lib/throttle":51,"./lib/to_dense_array":52,"./render":63}],66:[function(n,t){"use strict";var r=n("xtend"),i=n("./constants"),u=["mode","feature","mouse"];t.exports=function(n){function l(n){e=r(e,n)}function a(){if(n.container){var t=[],i=[];u.forEach(function(n){e[n]!==s[n]&&(t.push(n+"-"+s[n]),null!==e[n]&&i.push(n+"-"+e[n]))});t.length>0&&n.container.classList.remove.apply(n.container.classList,t);i.length>0&&n.container.classList.add.apply(n.container.classList,i);s=r(s,e)}}function f(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=document.createElement("button");return t.className=i.classes.CONTROL_BUTTON+" "+r.className,t.setAttribute("title",r.title),r.container.appendChild(t),t.addEventListener("click",function(t){if(t.preventDefault(),t.stopPropagation(),t.target===o)return void h();c(n);r.onActivate()},!0),t}function h(){o&&(o.classList.remove(i.classes.ACTIVE_BUTTON),o=null)}function c(n){h();var r=t[n];r&&r&&"trash"!==n&&(r.classList.add(i.classes.ACTIVE_BUTTON),o=r)}function v(){var u=n.options.controls,r=document.createElement("div");return r.className=i.classes.CONTROL_GROUP+" "+i.classes.CONTROL_BASE,u?(u[i.types.LINE]&&(t[i.types.LINE]=f(i.types.LINE,{container:r,className:i.classes.CONTROL_BUTTON_LINE,title:"LineString tool "+(n.options.keybindings?"(l)":""),onActivate:function(){return n.events.changeMode(i.modes.DRAW_LINE_STRING)}})),u[i.types.POLYGON]&&(t[i.types.POLYGON]=f(i.types.POLYGON,{container:r,className:i.classes.CONTROL_BUTTON_POLYGON,title:"Polygon tool "+(n.options.keybindings?"(p)":""),onActivate:function(){return n.events.changeMode(i.modes.DRAW_POLYGON)}})),u[i.types.POINT]&&(t[i.types.POINT]=f(i.types.POINT,{container:r,className:i.classes.CONTROL_BUTTON_POINT,title:"Marker tool "+(n.options.keybindings?"(m)":""),onActivate:function(){return n.events.changeMode(i.modes.DRAW_POINT)}})),u.trash&&(t.trash=f("trash",{container:r,className:i.classes.CONTROL_BUTTON_TRASH,title:"Delete",onActivate:function(){n.events.trash()}})),u.combine_features&&(t.combine_features=f("combineFeatures",{container:r,className:i.classes.CONTROL_BUTTON_COMBINE_FEATURES,title:"Combine",onActivate:function(){n.events.combineFeatures()}})),u.uncombine_features&&(t.uncombine_features=f("uncombineFeatures",{container:r,className:i.classes.CONTROL_BUTTON_UNCOMBINE_FEATURES,title:"Uncombine",onActivate:function(){n.events.uncombineFeatures()}})),r):r}function y(){Object.keys(t).forEach(function(n){var i=t[n];i.parentNode&&i.parentNode.removeChild(i);delete t[n]})}var t={},o=null,s={mode:null,feature:null,mouse:null},e={mode:null,feature:null,mouse:null};return{setActiveButton:c,queueMapClasses:l,updateMapClasses:a,addButtons:v,removeButtons:y}}},{"./constants":24,xtend:22}]},{},[1])(1)});!function(n){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this;t.turf=n()}}(function(){var n;return function n(t,i,r){function u(f,o){var h,c,s;if(!i[f]){if(!t[f]){if(h="function"==typeof require&&require,!o&&h)return h(f,!0);if(e)return e(f,!0);c=new Error("Cannot find module '"+f+"'");throw c.code="MODULE_NOT_FOUND",c;}s=i[f]={exports:{}};t[f][0].call(s.exports,function(n){var i=t[f][1][n];return u(i||n)},s,s.exports,n,t,i,r)}return i[f].exports}for(var e="function"==typeof require&&require,f=0;f<r.length;f++)u(r[f]);return u}({1:[function(n,t){var i=n("@turf/helpers"),u=n("@turf/invariant"),r=n("@turf/meta"),f=n("@turf/clusters"),e={isolines:n("@turf/isolines"),convex:n("@turf/convex"),within:n("@turf/within"),concave:n("@turf/concave"),difference:n("@turf/difference"),dissolve:n("@turf/dissolve"),collect:n("@turf/collect"),flip:n("@turf/flip"),simplify:n("@turf/simplify"),bezier:n("@turf/bezier"),tag:n("@turf/tag"),sample:n("@turf/sample"),envelope:n("@turf/envelope"),square:n("@turf/square"),circle:n("@turf/circle"),midpoint:n("@turf/midpoint"),buffer:n("@turf/buffer"),center:n("@turf/center"),centerOfMass:n("@turf/center-of-mass"),centroid:n("@turf/centroid"),combine:n("@turf/combine"),distance:n("@turf/distance"),explode:n("@turf/explode"),bbox:n("@turf/bbox"),tesselate:n("@turf/tesselate"),bboxPolygon:n("@turf/bbox-polygon"),inside:n("@turf/inside"),intersect:n("@turf/intersect"),nearest:n("@turf/nearest"),planepoint:n("@turf/planepoint"),random:n("@turf/random"),tin:n("@turf/tin"),union:n("@turf/union"),bearing:n("@turf/bearing"),destination:n("@turf/destination"),kinks:n("@turf/kinks"),pointOnSurface:n("@turf/point-on-surface"),area:n("@turf/area"),along:n("@turf/along"),lineDistance:n("@turf/line-distance"),lineSlice:n("@turf/line-slice"),lineSliceAlong:n("@turf/line-slice-along"),pointOnLine:n("@turf/point-on-line"),pointGrid:n("@turf/point-grid"),squareGrid:n("@turf/square-grid"),triangleGrid:n("@turf/triangle-grid"),hexGrid:n("@turf/hex-grid"),idw:n("@turf/idw"),truncate:n("@turf/truncate"),flatten:n("@turf/flatten"),lineIntersect:n("@turf/line-intersect"),mask:n("@turf/mask"),lineChunk:n("@turf/line-chunk"),unkinkPolygon:n("@turf/unkink-polygon"),greatCircle:n("@turf/great-circle"),lineSegment:n("@turf/line-segment"),lineSplit:n("@turf/line-split"),lineArc:n("@turf/line-arc"),polygonToLineString:n("@turf/polygon-to-linestring"),lineStringToPolygon:n("@turf/linestring-to-polygon"),bboxClip:n("@turf/bbox-clip"),lineOverlap:n("@turf/line-overlap"),sector:n("@turf/sector"),rhumbBearing:n("@turf/rhumb-bearing"),rhumbDistance:n("@turf/rhumb-distance"),rhumbDestination:n("@turf/rhumb-destination"),polygonTangents:n("@turf/polygon-tangents"),rewind:n("@turf/rewind"),isobands:n("@turf/isobands"),transformRotate:n("@turf/transform-rotate"),transformScale:n("@turf/transform-scale"),transformTranslate:n("@turf/transform-translate"),lineOffset:n("@turf/line-offset"),polygonize:n("@turf/polygonize"),booleanDisjoint:n("@turf/boolean-disjoint"),booleanContains:n("@turf/boolean-contains"),booleanCrosses:n("@turf/boolean-crosses"),booleanClockwise:n("@turf/boolean-clockwise"),booleanOverlap:n("@turf/boolean-overlap"),booleanPointOnLine:n("@turf/boolean-point-on-line"),booleanEqual:n("@turf/boolean-equal"),booleanWithin:n("@turf/boolean-within"),clone:n("@turf/clone"),cleanCoords:n("@turf/clean-coords"),interpolate:n("@turf/interpolate"),clustersDbscan:n("@turf/clusters-dbscan"),clustersKmeans:n("@turf/clusters-kmeans"),pointToLineDistance:n("@turf/point-to-line-distance"),getCluster:f.getCluster,clusterEach:f.clusterEach,clusterReduce:f.clusterReduce,point:i.point,polygon:i.polygon,lineString:i.lineString,multiPoint:i.multiPoint,multiPolygon:i.multiPolygon,multiLineString:i.multiLineString,feature:i.feature,geometry:i.geometry,featureCollection:i.featureCollection,geometryCollection:i.geometryCollection,radiansToDistance:i.radiansToDistance,distanceToRadians:i.distanceToRadians,distanceToDegrees:i.distanceToDegrees,bearingToAngle:i.bearingToAngle,degrees2radians:i.degrees2radians,radians2degrees:i.radians2degrees,convertDistance:i.convertDistance,isNumber:i.isNumber,round:i.round,convertArea:i.convertArea,getCoord:u.getCoord,getCoords:u.getCoords,geojsonType:u.geojsonType,featureOf:u.featureOf,collectionOf:u.collectionOf,containsNumber:u.containsNumber,getGeom:u.getGeom,getGeomType:u.getGeomType,coordEach:r.coordEach,coordReduce:r.coordReduce,propEach:r.propEach,propReduce:r.propReduce,featureEach:r.featureEach,featureReduce:r.featureReduce,coordAll:r.coordAll,geomEach:r.geomEach,geomReduce:r.geomReduce,flattenEach:r.flattenEach,flattenReduce:r.flattenReduce,segmentReduce:r.segmentReduce,segmentEach:r.segmentEach,lineEach:r.lineEach,lineReduce:r.lineReduce};t.exports=e},{"@turf/along":2,"@turf/area":12,"@turf/bbox":22,"@turf/bbox-clip":16,"@turf/bbox-polygon":20,"@turf/bearing":24,"@turf/bezier":26,"@turf/boolean-clockwise":29,"@turf/boolean-contains":31,"@turf/boolean-crosses":39,"@turf/boolean-disjoint":61,"@turf/boolean-equal":82,"@turf/boolean-overlap":91,"@turf/boolean-point-on-line":157,"@turf/boolean-within":159,"@turf/buffer":167,"@turf/center":206,"@turf/center-of-mass":177,"@turf/centroid":210,"@turf/circle":213,"@turf/clean-coords":218,"@turf/clone":221,"@turf/clusters":242,"@turf/clusters-dbscan":222,"@turf/clusters-kmeans":235,"@turf/collect":245,"@turf/combine":252,"@turf/concave":254,"@turf/convex":267,"@turf/destination":286,"@turf/difference":289,"@turf/dissolve":298,"@turf/distance":373,"@turf/envelope":376,"@turf/explode":381,"@turf/flatten":384,"@turf/flip":387,"@turf/great-circle":390,"@turf/helpers":392,"@turf/hex-grid":393,"@turf/idw":398,"@turf/inside":414,"@turf/interpolate":416,"@turf/intersect":454,"@turf/invariant":458,"@turf/isobands":459,"@turf/isolines":475,"@turf/kinks":485,"@turf/line-arc":487,"@turf/line-chunk":497,"@turf/line-distance":515,"@turf/line-intersect":520,"@turf/line-offset":534,"@turf/line-overlap":539,"@turf/line-segment":584,"@turf/line-slice":598,"@turf/line-slice-along":588,"@turf/line-split":626,"@turf/linestring-to-polygon":685,"@turf/mask":690,"@turf/meta":699,"@turf/midpoint":700,"@turf/nearest":709,"@turf/planepoint":713,"@turf/point-grid":715,"@turf/point-on-line":725,"@turf/point-on-surface":751,"@turf/point-to-line-distance":765,"@turf/polygon-tangents":799,"@turf/polygon-to-linestring":802,"@turf/polygonize":805,"@turf/random":819,"@turf/rewind":821,"@turf/rhumb-bearing":827,"@turf/rhumb-destination":839,"@turf/rhumb-distance":852,"@turf/sample":865,"@turf/sector":867,"@turf/simplify":886,"@turf/square":900,"@turf/square-grid":893,"@turf/tag":904,"@turf/tesselate":907,"@turf/tin":910,"@turf/transform-rotate":912,"@turf/transform-scale":956,"@turf/transform-translate":1008,"@turf/triangle-grid":1024,"@turf/truncate":1029,"@turf/union":1031,"@turf/unkink-polygon":1033,"@turf/within":1048}],2:[function(n,t){var r=n("@turf/distance"),i=n("@turf/helpers").point,u=n("@turf/bearing"),f=n("@turf/destination");t.exports=function(n,t,e){var o,h,s,c,l;if("Feature"===n.type)o=n.geometry.coordinates;else{if("LineString"!==n.type)throw new Error("input must be a LineString Feature or Geometry");o=n.coordinates}for(h=0,s=0;s<o.length&&!(t>=h&&s===o.length-1);s++){if(h>=t)return(c=t-h,c)?(l=u(o[s],o[s-1])-180,f(o[s],c,l,e)):i(o[s]);h+=r(o[s],o[s+1],e)}return i(o[o.length-1])}},{"@turf/bearing":3,"@turf/destination":5,"@turf/distance":8,"@turf/helpers":11}],3:[function(n,t){function i(n,t,i){if(!0===i)return u(n,t);var f=Math.PI/180,a=180/Math.PI,o=r(n),s=r(t),h=f*o[0],c=f*s[0],l=f*o[1],e=f*s[1],v=Math.sin(c-h)*Math.cos(e),y=Math.cos(l)*Math.sin(e)-Math.sin(l)*Math.cos(e)*Math.cos(c-h);return a*Math.atan2(v,y)}function u(n,t){var r=i(t,n);return(r+180)%360}var r=n("@turf/invariant").getCoord;t.exports=i},{"@turf/invariant":4}],4:[function(n,t){function f(n){if(!n)throw new Error("obj is required");var t=r(n);if(t.length>1&&"number"==typeof t[0]&&"number"==typeof t[1])return t;throw new Error("Coordinate is not a valid Point");}function r(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 i(t),t;throw new Error("No valid coordinates");}function i(n){if(n.length>1&&"number"==typeof n[0]&&"number"==typeof n[1])return!0;if(Array.isArray(n[0])&&n[0].length)return i(n[0]);throw new Error("coordinates must only contain numbers");}function e(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 o(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 s(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 u(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 h(n){if(!n)throw new Error("geojson is required");var t=u(n);if(t)return t.type}t.exports={geojsonType:e,collectionOf:s,featureOf:o,getCoord:f,getCoords:r,containsNumber:i,getGeom:u,getGeomType:h}},{}],5:[function(n,t){var r=n("@turf/invariant").getCoord,i=n("@turf/helpers"),u=i.point,f=i.distanceToRadians;t.exports=function(n,t,i,e){var h=Math.PI/180,c=180/Math.PI,l=r(n),y=h*l[0],o=h*l[1],a=h*i,s=f(t,e),v=Math.asin(Math.sin(o)*Math.cos(s)+Math.cos(o)*Math.sin(s)*Math.cos(a)),p=y+Math.atan2(Math.sin(a)*Math.sin(s)*Math.cos(o),Math.cos(s)-Math.sin(o)*Math.sin(v));return u([c*p,c*v])}},{"@turf/helpers":6,"@turf/invariant":7}],6:[function(n,t){function i(n,t,i,r){if(void 0===n)throw new Error("geometry is required");if(t&&t.constructor!==Object)throw new Error("properties must be an Object");if(i&&4!==i.length)throw new Error("bbox must be an Array of 4 numbers");if(r&&-1===["string","number"].indexOf(typeof r))throw new Error("id must be a number or a string");var u={type:"Feature"};return r&&(u.id=r),i&&(u.bbox=i),u.properties=t||{},u.geometry=n,u}function p(n,t,i){if(!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");if(i&&4!==i.length)throw new Error("bbox must be an Array of 4 numbers");var r;switch(n){case"Point":r=f(t).geometry;break;case"LineString":r=o(t).geometry;break;case"Polygon":r=e(t).geometry;break;case"MultiPoint":r=h(t).geometry;break;case"MultiLineString":r=s(t).geometry;break;case"MultiPolygon":r=c(t).geometry;break;default:throw new Error(n+" is invalid");}return i&&(r.bbox=i),r}function f(n,t,u,f){if(!n)throw new Error("No coordinates passed");if(void 0===n.length)throw new Error("Coordinates must be an array");if(n.length<2)throw new Error("Coordinates must be at least 2 numbers long");if(!r(n[0])||!r(n[1]))throw new Error("Coordinates must contain numbers");return i({type:"Point",coordinates:n},t,u,f)}function e(n,t,u,f){var s,e,o;if(!n)throw new Error("No coordinates passed");for(s=0;s<n.length;s++){if(e=n[s],e.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(o=0;o<e[e.length-1].length;o++){if(0===s&&0===o&&!r(e[0][0])||!r(e[0][1]))throw new Error("Coordinates must contain numbers");if(e[e.length-1][o]!==e[0][o])throw new Error("First and last Position are not equivalent.");}}return i({type:"Polygon",coordinates:n},t,u,f)}function o(n,t,u,f){if(!n)throw new Error("No coordinates passed");if(n.length<2)throw new Error("Coordinates must be an array of two or more positions");if(!r(n[0][1])||!r(n[0][1]))throw new Error("Coordinates must contain numbers");return i({type:"LineString",coordinates:n},t,u,f)}function w(n,t,i){if(!n)throw new Error("No features passed");if(!Array.isArray(n))throw new Error("features must be an Array");if(t&&4!==t.length)throw new Error("bbox must be an Array of 4 numbers");if(i&&-1===["string","number"].indexOf(typeof i))throw new Error("id must be a number or a string");var r={type:"FeatureCollection"};return i&&(r.id=i),t&&(r.bbox=t),r.features=n,r}function s(n,t,r,u){if(!n)throw new Error("No coordinates passed");return i({type:"MultiLineString",coordinates:n},t,r,u)}function h(n,t,r,u){if(!n)throw new Error("No coordinates passed");return i({type:"MultiPoint",coordinates:n},t,r,u)}function c(n,t,r,u){if(!n)throw new Error("No coordinates passed");return i({type:"MultiPolygon",coordinates:n},t,r,u)}function b(n,t,r,u){if(!n)throw new Error("geometries is required");if(!Array.isArray(n))throw new Error("geometries must be an Array");return i({type:"GeometryCollection",geometries:n},t,r,u)}function k(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 l(n,t){if(void 0===n||null===n)throw new Error("radians is required");var i=v[t||"kilometers"];if(!i)throw new Error("units is invalid");return n*i}function u(n,t){if(void 0===n||null===n)throw new Error("distance is required");var i=v[t||"kilometers"];if(!i)throw new Error("units is invalid");return n/i}function d(n,t){return a(u(n,t))}function g(n){if(null===n||void 0===n)throw new Error("bearing is required");var t=n%360;return t<0&&(t+=360),t}function a(n){if(null===n||void 0===n)throw new Error("radians is required");return n%(2*Math.PI)*180/Math.PI}function nt(n){if(null===n||void 0===n)throw new Error("degrees is required");return n%360*Math.PI/180}function tt(n,t,i){if(null===n||void 0===n)throw new Error("distance is required");if(!(n>=0))throw new Error("distance must be a positive number");return l(u(n,t),i||"kilometers")}function it(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=y[t||"meters"],!r)throw new Error("invalid original units");if(u=y[i||"kilometers"],!u)throw new Error("invalid final units");return n/r*u}function r(n){return!isNaN(n)&&null!==n&&!Array.isArray(n)}var v={miles:3960,nauticalmiles:3441.145,degrees:57.2957795,radians:1,inches:250905600,yards:6969600,meters:6373e3,metres:6373e3,centimeters:6373e5,centimetres:6373e5,kilometers:6373,kilometres:6373,feet:20908792.65},y={kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,centimetres:1e4,millimeter:1e6,acres:.000247105,miles:386e-9,yards:1.195990046,feet:10.763910417,inches:1550.003100006};t.exports={feature:i,geometry:p,featureCollection:w,geometryCollection:b,point:f,multiPoint:h,lineString:o,multiLineString:s,polygon:e,multiPolygon:c,radiansToDistance:l,distanceToRadians:u,distanceToDegrees:d,radians2degrees:a,degrees2radians:nt,bearingToAngle:g,convertDistance:tt,convertArea:it,round:k,isNumber:r}},{}],7:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],8:[function(n,t){var i=n("@turf/invariant").getCoord,r=n("@turf/helpers").radiansToDistance;t.exports=function(n,t,u){var f=Math.PI/180,e=i(n),o=i(t),h=f*(o[1]-e[1]),c=f*(o[0]-e[0]),l=f*e[1],a=f*o[1],s=Math.pow(Math.sin(h/2),2)+Math.pow(Math.sin(c/2),2)*Math.cos(l)*Math.cos(a);return r(2*Math.atan2(Math.sqrt(s),Math.sqrt(1-s)),u)}},{"@turf/helpers":9,"@turf/invariant":10}],9:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],10:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],11:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],12:[function(n,t){var i=n("@mapbox/geojson-area").geometry,r=n("@turf/meta").geomReduce;t.exports=function(n){return r(n,function(n,t){return n+i(t)},0)}},{"@mapbox/geojson-area":13,"@turf/meta":14}],13:[function(n,t){function u(n){var t,i=0;switch(n.type){case"Polygon":return f(n.coordinates);case"MultiPolygon":for(t=0;t<n.coordinates.length;t++)i+=f(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+=u(n.geometries[t]);return i}}function f(n){var r=0,t;if(n&&n.length>0)for(r+=Math.abs(i(n[0])),t=1;t<n.length;t++)r-=Math.abs(i(n[t]));return r}function i(n){var h,c,l,u,f,o,t,s=0,i=n.length;if(i>2){for(t=0;t<i;t++)t===i-2?(u=i-2,f=i-1,o=0):t===i-1?(u=i-1,f=0,o=1):(u=t,f=t+1,o=t+2),h=n[u],c=n[f],l=n[o],s+=(r(l[0])-r(h[0]))*Math.sin(r(c[1]));s=s*e.RADIUS*e.RADIUS/2}return s}function r(n){return n*Math.PI/180}var e=n("wgs84");t.exports.geometry=u;t.exports.ring=i},{wgs84:15}],14:[function(n,t){function i(n,t,r){var o,y;if(null!==n)for(var a,u,e,v,l,b,f,c,p,w=0,h=0,k=n.type,d="FeatureCollection"===k,g="Feature"===k,nt=d?n.features.length:1,s=0;s<nt;s++)for(o=0,c=d?n.features[s].geometry:g?n.geometry:n,p=!!c&&"GeometryCollection"===c.type,b=p?c.geometries.length:1,a=0;a<b;a++)if(null!==(l=p?c.geometries[a]:c)){f=l.coordinates;y=l.type;switch(w=!r||"Polygon"!==y&&"MultiPolygon"!==y?0:1,y){case null:break;case"Point":t(f,h,s,o);h++;o++;break;case"LineString":case"MultiPoint":for(u=0;u<f.length;u++)t(f[u],h,s,o),h++,o++;break;case"Polygon":case"MultiLineString":for(u=0;u<f.length;u++)for(e=0;e<f[u].length-w;e++)t(f[u][e],h,s,o),h++,o++;break;case"MultiPolygon":for(u=0;u<f.length;u++)for(e=0;e<f[u].length;e++)for(v=0;v<f[u][e].length-w;v++)t(f[u][e][v],h,s,o),h++,o++;break;case"GeometryCollection":for(u=0;u<l.geometries.length;u++)i(l.geometries[u],t,r);break;default:throw new Error("Unknown Geometry Type");}}}function f(n,t,r,u){var f=r;return i(n,function(n,i,u,e){f=0===i&&void 0===r?n:t(f,n,i,u,e)},u),f}function e(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 l(n,t,i){var r=i;return e(n,function(n,u){r=0===u&&void 0===i?n:t(r,n,u)}),r}function o(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 a(n,t,i){var r=i;return o(n,function(n,u){r=0===u&&void 0===i?n:t(r,n,u)}),r}function v(n){var t=[];return i(n,function(n){t.push(n)}),t}function r(n,t){for(var e,o,f,l,i,h,s,r=0,c="FeatureCollection"===n.type,a="Feature"===n.type,v=c?n.features.length:1,u=0;u<v;u++)for(i=c?n.features[u].geometry:a?n.geometry:n,s=c?n.features[u].properties:a?n.properties:{},h=!!i&&"GeometryCollection"===i.type,l=h?i.geometries.length:1,o=0;o<l;o++)if(null!==(f=h?i.geometries[o]:i))switch(f.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":t(f,r,s);r++;break;case"GeometryCollection":for(e=0;e<f.geometries.length;e++)t(f.geometries[e],r,s),r++;break;default:throw new Error("Unknown Geometry Type");}else t(null,r,s),r++}function y(n,t,i){var u=i;return r(n,function(n,r,f){u=0===r&&void 0===i?n:t(u,n,r,f)}),u}function u(n,t){r(n,function(n,i,r){var f=null===n?null:n.type,u;switch(f){case null:case"Point":case"LineString":case"Polygon":return void t(h(n,r),i,0)}switch(f){case"MultiPoint":u="Point";break;case"MultiLineString":u="LineString";break;case"MultiPolygon":u="Polygon"}n.coordinates.forEach(function(n,f){t(h({type:u,coordinates:n},r),i,f)})})}function p(n,t,i){var r=i;return u(n,function(n,u,f){r=0===u&&0===f&&void 0===i?n:t(r,n,u,f)}),r}function s(n,t){u(n,function(n,i){var u=0,r;n.geometry&&(r=n.geometry.type,"Point"!==r&&"MultiPoint"!==r&&f(n,function(r,f){var e=b([r,f],n.properties);return t(e,i,u),u++,f}))})}function w(n,t,i){var r=i;return s(n,function(n,u,f){r=0===u&&void 0===i?n:t(r,n,u,f)}),r}function h(n,t){if(void 0===n)throw new Error("No geometry passed");return{type:"Feature",properties:t||{},geometry:n}}function b(n,t){if(!n)throw new Error("No coordinates passed");if(n.length<2)throw new Error("Coordinates must be an array of two or more positions");return{type:"Feature",properties:t||{},geometry:{type:"LineString",coordinates:n}}}function c(n,t){var r,i,o,u,f,e;if(!n)throw new Error("geojson is required");if(r=n.geometry?n.geometry.type:n.type,!r)throw new Error("invalid geojson");if("FeatureCollection"===r)throw new Error("FeatureCollection is not supported");if("GeometryCollection"===r)throw new Error("GeometryCollection is not supported");if(i=n.geometry?n.geometry.coordinates:n.coordinates,!i)throw new Error("geojson must contain coordinates");switch(r){case"LineString":return void t(i,0,0);case"Polygon":case"MultiLineString":for(o=0,u=0;u<i.length;u++)"MultiLineString"===r&&(o=u),t(i[u],u,o);return;case"MultiPolygon":for(f=0;f<i.length;f++)for(e=0;e<i[f].length;e++)t(i[f][e],e,f);return;default:throw new Error(r+" geometry not supported");}}function k(n,t,i){var r=i;return c(n,function(n,u,f){r=0===u&&void 0===i?n:t(r,n,u,f)}),r}t.exports={coordEach:i,coordReduce:f,propEach:e,propReduce:l,featureEach:o,featureReduce:a,coordAll:v,geomEach:r,geomReduce:y,flattenEach:u,flattenReduce:p,segmentEach:s,segmentReduce:w,lineEach:c,lineReduce:k}},{}],15:[function(n,t){t.exports.RADIUS=6378137;t.exports.FLATTENING=1/298.257223563;t.exports.POLAR_RADIUS=6356752.3142},{}],16:[function(n,t){function r(n,t){for(var i,f=[],r=0;r<n.length;r++)i=u.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&&f.push(i));return f}function f(n){return n.geometry?n.geometry.type:n.type}var i=n("@turf/helpers"),u=n("lineclip"),e=n("@turf/invariant").getCoords,o=i.lineString,s=i.multiLineString,h=i.polygon,c=i.multiPolygon;t.exports=function(n,t){var v=f(n),i=e(n),a=n.properties,l;switch(v){case"LineString":case"MultiLineString":return l=[],"LineString"===v&&(i=[i]),i.forEach(function(n){u(n,t,l)}),1===l.length?o(l[0],a):s(l,a);case"Polygon":return h(r(i,t),a);case"MultiPolygon":return c(i.map(function(n){return r(n,t)}),a);default:throw new Error("geometry "+v+" not supported");}}},{"@turf/helpers":17,"@turf/invariant":18,lineclip:19}],17:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],18:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],19:[function(n,t){"use strict";function r(n,t,r){var e,s,f,h,l,a=n.length,c=i(n[0],t),o=[];for(r||(r=[]),e=1;e<a;e++){for(s=n[e-1],f=n[e],h=l=i(f,t);;){if(!(c|h)){o.push(s);h!==l?(o.push(f),e<a-1&&(r.push(o),o=[])):e===a-1&&o.push(f);break}if(c&h)break;c?(s=u(s,f,c,t),c=i(s,t)):(f=u(s,f,h,t),h=i(f,t))}c=l}return o.length&&r.push(o),r}function f(n,t){for(var f,o,c,s,e,h,r=1;r<=8;r*=2){for(f=[],o=n[n.length-1],c=!(i(o,t)&r),s=0;s<n.length;s++)e=n[s],h=!(i(e,t)&r),h!==c&&f.push(u(o,e,r,t)),h&&f.push(e),o=e,c=h;if(n=f,!n.length)break}return f}function u(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 i(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}t.exports=r;r.polyline=r;r.polygon=f},{}],20:[function(n,t){var i=n("@turf/helpers").polygon;t.exports=function(n){var t=[n[0],n[1]],r=[n[0],n[3]],u=[n[2],n[3]],f=[n[2],n[1]];return i([[t,f,u,r,t]])}},{"@turf/helpers":21}],21:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],22:[function(n,t){var i=n("@turf/meta").coordEach;t.exports=function(n){var t=[1/0,1/0,-1/0,-1/0];return i(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}},{"@turf/meta":23}],23:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],24:[function(n,t,i){arguments[4][3][0].apply(i,arguments)},{"@turf/invariant":25,dup:3}],25:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],26:[function(n,t){var i=n("@turf/helpers").lineString,r=n("./spline.js");t.exports=function(n,t,u){for(var e,o=[],s=new r({points:n.geometry.coordinates.map(function(n){return{x:n[0],y:n[1]}}),duration:t,sharpness:u}),f=0;f<s.duration;f+=10)e=s.pos(f),Math.floor(f/100)%2==0&&o.push([e.x,e.y]);return i(o,n.properties)}},{"./spline.js":28,"@turf/helpers":27}],27:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],28:[function(n,t){var i=function(n){var i,r,t;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++){var i=this.centers[t],r=this.centers[t+1],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};i.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};i.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))}};i.prototype.pos=function(n){var i=n-this.delay,r,t,u;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),u=(this.length-1)*r-t,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]}}(u,this.points[t],this.controls[t][1],this.controls[t+1][0],this.points[t+1]))};t.exports=i},{}],29:[function(n,t){var i=n("@turf/invariant"),r=i.getCoords;t.exports=function(n){var e;if(!n)throw new Error("line is required");if(e=n.geometry?n.geometry.type:n.type,!Array.isArray(n)&&"LineString"!==e)throw new Error("geometry must be a LineString");for(var i,t,u=r(n),o=0,f=1;f<u.length;)i=t||u[0],t=u[f],o+=(t[0]-i[0])*(t[1]+i[1]),f++;return o>0}},{"@turf/invariant":30}],30:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],31:[function(n,t){function l(n,t){for(var r=!1,i=0;i<n.coordinates.length;i++)if(f(n.coordinates[i],t.coordinates)){r=!0;break}return r}function a(n,t){for(var u,r,i=0;i<t.coordinates.length;i++){for(u=!1,r=0;r<n.coordinates.length;r++)if(f(t.coordinates[i],n.coordinates[r])){u=!0;break}if(!u)return!1}return!0}function v(n,t){for(var u=!1,r=0;r<t.coordinates.length;r++)if(i(t.coordinates[r],n,!0)&&(u=!0),!i(t.coordinates[r],n))return!1;return!!u}function y(n,t){for(var i=0;i<t.coordinates.length;i++)if(!r(t.coordinates[i],n,!0))return!1;return!0}function p(n,t){for(var u=!1,r=0;r<t.coordinates.length;r++)if(i({type:"Point",coordinates:t.coordinates[r]},n,!0)&&(u=!0),!i({type:"Point",coordinates:t.coordinates[r]},n,!1))return!1;return u}function w(n,t){var f=!1,i=0,e;if(!o(u(n),u(t)))return!1;for(i;i<t.coordinates.length-1;i++)if(e=k(t.coordinates[i],t.coordinates[i+1]),r({type:"Point",coordinates:e},n,!0)){f=!0;break}return f}function b(n,t){if(!o(u(n),u(t)))return!1;for(var i=0;i<t.coordinates[0].length;i++)if(!r(t.coordinates[0][i],n))return!1;return!0}function o(n,t){return!(n[0]>t[0])&&!(n[2]<t[2])&&!(n[1]>t[1])&&!(n[3]<t[3])}function f(n,t){return n[0]===t[0]&&n[1]===t[1]}function k(n,t){return[(n[0]+t[0])/2,(n[1]+t[1])/2]}var r=n("@turf/inside"),u=n("@turf/bbox"),i=n("@turf/boolean-point-on-line"),e=n("@turf/invariant"),s=e.getGeom,h=e.getCoords,c=e.getGeomType;t.exports=function(n,t){var k=c(n),o=c(t),u=s(n),e=s(t),d=h(n),g=h(t);switch(k){case"Point":switch(o){case"Point":return f(d,g);default:throw new Error("feature2 "+o+" geometry not supported");}case"MultiPoint":switch(o){case"Point":return l(u,e);case"MultiPoint":return a(u,e);default:throw new Error("feature2 "+o+" geometry not supported");}case"LineString":switch(o){case"Point":return i(e,u,!0);case"LineString":return p(u,e);case"MultiPoint":return v(u,e);default:throw new Error("feature2 "+o+" geometry not supported");}case"Polygon":switch(o){case"Point":return r(e,u,!0);case"LineString":return w(u,e);case"Polygon":return b(u,e);case"MultiPoint":return y(u,e);default:throw new Error("feature2 "+o+" geometry not supported");}default:throw new Error("feature1 "+k+" geometry not supported");}}},{"@turf/bbox":32,"@turf/boolean-point-on-line":34,"@turf/inside":36,"@turf/invariant":38}],32:[function(n,t,i){arguments[4][22][0].apply(i,arguments)},{"@turf/meta":33,dup:22}],33:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],34:[function(n,t){function r(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?"start"===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]:"end"===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]:"both"===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]:void 0: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])}var i=n("@turf/invariant").getCoords;t.exports=function(n,t,u){for(var o,s=i(n),e=i(t),f=0;f<e.length-1;f++)if(o=!1,u&&(0===f&&(o="start"),f===e.length-2&&(o="end"),0===f&&f+1===e.length-1&&(o="both")),r(e[f],e[f+1],s,o))return!0;return!1}},{"@turf/invariant":35}],35:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],36:[function(n,t){function i(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 u(n,t){return t[0]<=n[0]&&t[1]<=n[1]&&t[2]>=n[0]&&t[3]>=n[1]}var r=n("@turf/invariant"),f=r.getCoord,e=r.getCoords;t.exports=function(n,t,r){var s,h,c,l;if(!n)throw new Error("point is required");if(!t)throw new Error("polygon is required");var a=f(n),o=e(t),y=t.geometry?t.geometry.type:t.type,v=t.bbox;if(v&&!1===u(a,v))return!1;for("Polygon"===y&&(o=[o]),s=0,h=!1;s<o.length&&!h;s++)if(i(a,o[s][0],r)){for(c=!1,l=1;l<o[s].length&&!c;)i(a,o[s][l],!r)&&(c=!0),l++;c||(h=!0)}return h}},{"@turf/invariant":37}],37:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],38:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],39:[function(n,t){function i(n,t){for(var i,o,r=!1,u=!1,s=n.coordinates.length,e=0;e<s&&!r&&!u;){for(i=0;i<t.coordinates.length-1;i++)o=!0,0!==i&&i!==t.coordinates.length-2||(o=!1),f(t.coordinates[i],t.coordinates[i+1],n.coordinates[e],o)?r=!0:u=!0;e++}return r&&u}function c(n,t){var r,i,u;if(e(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),f(n.coordinates[r],n.coordinates[r+1],t.coordinates[i],u))return!0;return!1}function r(n,t){return e(n,y(t)).features.length>0}function l(n,t){return v(t,n)}function u(n,t){for(var u=!1,i=!1,f=n.coordinates[0].length,r=0;r<f&&u&&i;)l(t,a.point(n.coordinates[0][r]),!0)?u=!0:i=!0,r++;return i&&i}function f(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])}var a=n("@turf/helpers"),v=n("@turf/inside"),e=n("@turf/line-intersect"),y=n("@turf/polygon-to-linestring"),o=n("@turf/invariant"),s=o.getGeom,h=o.getGeomType;t.exports=function(n,t){var l=h(n),o=h(t),f=s(n),e=s(t);switch(l){case"MultiPoint":switch(o){case"LineString":return i(f,e);case"Polygon":return u(f,e);default:throw new Error("feature2 "+o+" geometry not supported");}case"LineString":switch(o){case"MultiPoint":return i(e,f);case"LineString":return c(f,e);case"Polygon":return r(f,e);default:throw new Error("feature2 "+o+" geometry not supported");}case"Polygon":switch(o){case"MultiPoint":return u(e,f);case"LineString":return r(e,f);default:throw new Error("feature2 "+o+" geometry not supported");}default:throw new Error("feature1 "+l+" geometry not supported");}}},{"@turf/helpers":40,"@turf/inside":41,"@turf/invariant":43,"@turf/line-intersect":44,"@turf/polygon-to-linestring":58}],40:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],41:[function(n,t,i){arguments[4][36][0].apply(i,arguments)},{"@turf/invariant":42,dup:36}],42:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],43:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],44:[function(n,t){function u(n,t){var f=r(n),e=r(t),o,y;if(2!==f.length)throw new Error("<intersects> line1 must only contain 2 coordinates");if(2!==e.length)throw new Error("<intersects> line2 must only contain 2 coordinates");var i=f[0][0],u=f[0][1],l=f[1][0],a=f[1][1],s=e[0][0],h=e[0][1],p=e[1][0],w=e[1][1],v=(w-h)*(l-i)-(p-s)*(a-u),b=(p-s)*(u-h)-(w-h)*(i-s),k=(l-i)*(u-h)-(a-u)*(i-s);return 0===v?null:(o=b/v,y=k/v,o>=0&&o<=1&&y>=0&&y<=1)?c([i+o*(l-i),u+o*(a-u)]):null}var s=n("@turf/meta"),h=n("geojson-rbush"),i=n("@turf/helpers"),r=n("@turf/invariant").getCoords,f=n("@turf/line-segment"),c=i.point,e=s.featureEach,o=i.featureCollection;t.exports=function(n,t){var a={},s=[],c,l;return("LineString"===n.type&&(n=i.feature(n)),"LineString"===t.type&&(t=i.feature(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)?(c=u(n,t),c&&s.push(c),o(s)):(l=h(),l.load(f(t)),e(f(n),function(n){e(l.search(n),function(t){var i=u(n,t),f;i&&(f=r(i).join(","),a[f]||(a[f]=!0,s.push(i)))})}),o(s))}},{"@turf/helpers":48,"@turf/invariant":49,"@turf/line-segment":50,"@turf/meta":54,"geojson-rbush":55}],45:[function(n,t,i){arguments[4][20][0].apply(i,arguments)},{"@turf/helpers":46,dup:20}],46:[function(n,t){function i(n,t,i,r){if(void 0===n)throw new Error("geometry is required");if(t&&t.constructor!==Object)throw new Error("properties must be an Object");var u={type:"Feature",properties:t||{},geometry:n};if(i){if(4!==i.length)throw new Error("bbox must be an Array of 4 numbers");u.bbox=i}return r&&(u.id=r),u}function y(n,t,i){if(!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");var r;switch(n){case"Point":r=u(t).geometry;break;case"LineString":r=e(t).geometry;break;case"Polygon":r=f(t).geometry;break;case"MultiPoint":r=s(t).geometry;break;case"MultiLineString":r=o(t).geometry;break;case"MultiPolygon":r=h(t).geometry;break;default:throw new Error(n+" is invalid");}if(i){if(4!==i.length)throw new Error("bbox must be an Array of 4 numbers");r.bbox=i}return r}function u(n,t,r,u){if(!n)throw new Error("No coordinates passed");if(void 0===n.length)throw new Error("Coordinates must be an array");if(n.length<2)throw new Error("Coordinates must be at least 2 numbers long");if("number"!=typeof n[0]||"number"!=typeof n[1])throw new Error("Coordinates must contain numbers");return i({type:"Point",coordinates:n},t,r,u)}function f(n,t,r,u){var o,f,e;if(!n)throw new Error("No coordinates passed");for(o=0;o<n.length;o++){if(f=n[o],f.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(e=0;e<f[f.length-1].length;e++)if(f[f.length-1][e]!==f[0][e])throw new Error("First and last Position are not equivalent.");}return i({type:"Polygon",coordinates:n},t,r,u)}function e(n,t,r,u){if(!n)throw new Error("No coordinates passed");if(n.length<2)throw new Error("Coordinates must be an array of two or more positions");return i({type:"LineString",coordinates:n},t,r,u)}function p(n,t){if(!n)throw new Error("No features passed");if(!Array.isArray(n))throw new Error("features must be an Array");var i={type:"FeatureCollection",features:n};return t&&(i.bbox=t),i}function o(n,t,r,u){if(!n)throw new Error("No coordinates passed");return i({type:"MultiLineString",coordinates:n},t,r,u)}function s(n,t,r,u){if(!n)throw new Error("No coordinates passed");return i({type:"MultiPoint",coordinates:n},t,r,u)}function h(n,t,r,u){if(!n)throw new Error("No coordinates passed");return i({type:"MultiPolygon",coordinates:n},t,r,u)}function w(n,t,r,u){if(!n)throw new Error("geometries is required");if(!Array.isArray(n))throw new Error("geometries must be an Array");return i({type:"GeometryCollection",geometries:n},t,r,u)}function b(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 c(n,t){if(void 0===n||null===n)throw new Error("radians is required");var i=a[t||"kilometers"];if(!i)throw new Error("units is invalid");return n*i}function r(n,t){if(void 0===n||null===n)throw new Error("distance is required");var i=a[t||"kilometers"];if(!i)throw new Error("units is invalid");return n/i}function k(n,t){return l(r(n,t))}function d(n){if(null===n||void 0===n)throw new Error("bearing is required");var t=n%360;return t<0&&(t+=360),t}function l(n){if(null===n||void 0===n)throw new Error("radians is required");return n%(2*Math.PI)*180/Math.PI}function g(n){if(null===n||void 0===n)throw new Error("degrees is required");return n%360*Math.PI/180}function nt(n,t,i){if(null===n||void 0===n)throw new Error("distance is required");if(!(n>=0))throw new Error("distance must be a positive number");return c(r(n,t),i||"kilometers")}function tt(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=v[t||"meters"],!r)throw new Error("invalid original units");if(u=v[i||"kilometers"],!u)throw new Error("invalid final units");return n/r*u}var a={miles:3960,nauticalmiles:3441.145,degrees:57.2957795,radians:1,inches:250905600,yards:6969600,meters:6373e3,metres:6373e3,centimeters:6373e5,centimetres:6373e5,kilometers:6373,kilometres:6373,feet:20908792.65},v={kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,centimetres:1e4,millimeter:1e6,acres:.000247105,miles:386e-9,yards:1.195990046,feet:10.763910417,inches:1550.003100006};t.exports={feature:i,geometry:y,featureCollection:p,geometryCollection:w,point:u,multiPoint:s,lineString:e,multiLineString:o,polygon:f,multiPolygon:h,radiansToDistance:c,distanceToRadians:r,distanceToDegrees:k,radians2degrees:l,degrees2radians:g,bearingToAngle:d,convertDistance:nt,convertArea:tt,round:b}},{}],47:[function(n,t){var i=n("@turf/meta").coordEach;t.exports=function(n){var t=[1/0,1/0,-1/0,-1/0];return i(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}},{"@turf/meta":54}],48:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],49:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],50:[function(n,t){function u(n,t){var i=[],u=n.geometry;switch(u.type){case"Polygon":i=r(u);break;case"LineString":i=[r(u)]}i.forEach(function(i){f(i,n.properties).forEach(function(n){n.id=t.length;t.push(n)})})}function f(n,t){var i=[];return n.reduce(function(n,r){var u=s([n,r],t);return u.bbox=e(n,r),i.push(u),r}),i}function e(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]}var i=n("@turf/helpers"),r=n("@turf/invariant").getCoords,o=n("@turf/meta").flattenEach,s=i.lineString,h=i.featureCollection;t.exports=function(n){if(!n)throw new Error("geojson is required");var t=[];return o(n,function(n){u(n,t)}),h(t)}},{"@turf/helpers":51,"@turf/invariant":52,"@turf/meta":53}],51:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],52:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],53:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],54:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],55:[function(n,t){var r=n("@turf/bbox"),f=n("@turf/helpers").featureCollection,e=n("@turf/meta").featureEach,u=n("@turf/bbox-polygon"),i=n("rbush");t.exports=function(n){var t=i(n);return t.insert=function(n){if(Array.isArray(n)){var t=n;n=u(t);n.bbox=t}else n.bbox=n.bbox?n.bbox:r(n);return i.prototype.insert.call(this,n)},t.load=function(n){var t=[];return Array.isArray(n)?n.forEach(function(n){var i=u(n);i.bbox=n;t.push(i)}):e(n,function(n){n.bbox=n.bbox?n.bbox:r(n);t.push(n)}),i.prototype.load.call(this,t)},t.remove=function(n){if(Array.isArray(n)){var t=n;n=u(t);n.bbox=t}return i.prototype.remove.call(this,n)},t.clear=function(){return i.prototype.clear.call(this)},t.search=function(n){var t=i.prototype.search.call(this,this.toBBox(n));return f(t)},t.collides=function(n){return i.prototype.collides.call(this,this.toBBox(n))},t.all=function(){var n=i.prototype.all.call(this);return f(n)},t.toJSON=function(){return i.prototype.toJSON.call(this)},t.fromJSON=function(n){return i.prototype.fromJSON.call(this,n)},t.toBBox=function(n){var t;return t=n.bbox?n.bbox:Array.isArray(n)&&4===n.length?n:r(n),{minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]}},t}},{"@turf/bbox":47,"@turf/bbox-polygon":45,"@turf/helpers":48,"@turf/meta":54,rbush:57}],56:[function(n,t){"use strict";function r(n,t,f,e,o){for(f=f||0,e=e||n.length-1,o=o||u;e>f;){if(e-f>600){var h=e-f+1,v=t-f+1,y=Math.log(h),l=.5*Math.exp(2*y/3),p=.5*Math.sqrt(y*l*(h-l)/h)*(v-h/2<0?-1:1);r(n,t,Math.max(f,Math.floor(t-v*l/h+p)),Math.min(e,Math.floor(t+(h-v)*l/h+p)),o)}var a=n[t],c=f,s=e;for(i(n,f,t),o(n[e],a)>0&&i(n,f,e);c<s;){for(i(n,c,s),c++,s--;o(n[c],a)<0;)c++;for(;o(n[s],a)>0;)s--}0===o(n[f],a)?i(n,f,s):(s++,i(n,s,e));s<=t&&(f=s+1);t<=s&&(e=s-1)}}function i(n,t,i){var r=n[t];n[t]=n[i];n[i]=r}function u(n,t){return n<t?-1:n>t?1:0}t.exports=r},{}],57:[function(n,t){"use strict";function e(n,t){if(!(this instanceof e))return new e(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 y(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}function i(n,t){u(n,0,n.children.length,t,n)}function u(n,t,i,u,e){e||(e=r(null));e.minX=1/0;e.minY=1/0;e.maxX=-1/0;e.maxY=-1/0;for(var o,s=t;s<i;s++)o=n.children[s],f(e,n.leaf?u(o):o);return e}function f(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 l(n,t){return n.minX-t.minX}function a(n,t){return n.minY-t.minY}function h(n){return(n.maxX-n.minX)*(n.maxY-n.minY)}function o(n){return n.maxX-n.minX+(n.maxY-n.minY)}function p(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))}function w(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)}function c(n,t){return n.minX<=t.minX&&n.minY<=t.minY&&t.maxX<=n.maxX&&t.maxY<=n.maxY}function s(n,t){return t.minX<=n.maxX&&t.minY<=n.maxY&&t.maxX>=n.minX&&t.maxY>=n.minY}function r(n){return{children:n,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function v(n,t,i,r,u){for(var f,e=[t,i];e.length;)i=e.pop(),t=e.pop(),i-t<=r||(f=t+Math.ceil((i-t)/r/2)*r,b(n,f,t,i,u),e.push(t,f,f,i))}t.exports=e;var b=n("quickselect");e.prototype={all:function(){return this._all(this.data,[])},search:function(n){var t=this.data,r=[],h=this.toBBox,u,o,i,f,e;if(!s(n,t))return r;for(e=[];t;){for(u=0,o=t.children.length;u<o;u++)i=t.children[u],f=t.leaf?h(i):i,s(n,f)&&(t.leaf?r.push(i):c(n,f)?this._all(i,r):e.push(i));t=e.pop()}return r},collides:function(n){var t=this.data,o=this.toBBox,i,e,r,u,f;if(!s(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,s(n,u)){if(t.leaf||c(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=r([]),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=y(n,i.children,t)))return i.children.splice(o,1),r.push(i),this._condense(r),this;e||i.leaf||!c(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:l,compareMinY:a,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,u,f){var e,l=u-t+1,o=this._maxEntries,s,h,a,p,c,y;if(l<=o)return e=r(n.slice(t,u+1)),i(e,this.toBBox),e;for(f||(f=Math.ceil(Math.log(l)/Math.log(o)),o=Math.ceil(l/Math.pow(o,f-1))),e=r([]),e.leaf=!1,e.height=f,c=Math.ceil(l/o),y=c*Math.ceil(Math.sqrt(o)),v(n,t,u,y,this.compareMinX),s=t;s<=u;s+=y)for(a=Math.min(s+y-1,u),v(n,s,a,c,this.compareMinY),h=s;h<=a;h+=c)p=Math.min(h+c-1,a),e.children.push(this._build(n,h,p,f-1));return i(e,this.toBBox),e},_chooseSubtree:function(n,t,i,r){for(var o,a,e,l,u,s,f,c;;){if(r.push(t),t.leaf||r.length-1===i)break;for(f=c=1/0,o=0,a=t.children.length;o<a;o++)e=t.children[o],u=h(e),s=p(n,e)-u,s<c?(c=s,f=u<f?u:f,l=e):s===c&&u<f&&(f=u,l=e);t=l||t.children[0]}return t},_insert:function(n,t,i){var o=this.toBBox,u=i?n:o(n),r=[],e=this._chooseSubtree(u,this.data,t,r);for(e.children.push(n),f(e,u);t>=0&&r[t].children.length>this._maxEntries;)this._split(r,t),t--;this._adjustParentBBoxes(u,r,t)},_split:function(n,t){var u=n[t],o=u.children.length,s=this._minEntries,e,f;this._chooseSplitAxis(u,s,o);e=this._chooseSplitIndex(u,s,o);f=r(u.children.splice(e,u.children.length-e));f.height=u.height;f.leaf=u.leaf;i(u,this.toBBox);i(f,this.toBBox);t?n[t-1].children.push(f):this._splitRoot(u,f)},_splitRoot:function(n,t){this.data=r([n,t]);this.data.height=n.height+1;this.data.leaf=!1;i(this.data,this.toBBox)},_chooseSplitIndex:function(n,t,i){for(var c,l,o,e,f,a,s=f=1/0,r=t;r<=i-t;r++)c=u(n,0,r,this.toBBox),l=u(n,r,i,this.toBBox),o=w(c,l),e=h(c)+h(l),o<s?(s=o,a=r,f=e<f?e:f):o===s&&e<f&&(f=e,a=r);return a},_chooseSplitAxis:function(n,t,i){var r=n.leaf?this.compareMinX:l,u=n.leaf?this.compareMinY:a;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 s,h=this.toBBox,c=u(n,0,t,h),l=u(n,i-t,i,h),a=o(c)+o(l),e=t;e<i-t;e++)s=n.children[e],f(c,n.leaf?h(s):s),a+=o(c);for(e=i-t-1;e>=t;e--)s=n.children[e],f(l,n.leaf?h(s):s),a+=o(l);return a},_adjustParentBBoxes:function(n,t,i){for(var r=i;r>=0;r--)f(t[r],n)},_condense:function(n){for(var r,t=n.length-1;t>=0;t--)0===n[t].children.length?t>0?(r=n[t-1].children,r.splice(r.indexOf(n[t]),1)):this.clear():i(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]+"};")}}},{quickselect:56}],58:[function(n,t){function r(n,t){return n.length>1?o(n,t):e(n[0],t)}function u(n){return n.geometry?n.geometry.type:n.type}var f=n("@turf/invariant").getCoords,i=n("@turf/helpers"),e=i.lineString,o=i.multiLineString,s=i.featureCollection;t.exports=function(n,t){var o=u(n),i=f(n),e;if(t=t||n.properties||{},!i.length)throw new Error("polygon must contain coordinates");switch(o){case"Polygon":return r(i,t);case"MultiPolygon":return e=[],i.forEach(function(n){e.push(r(n,t))}),s(e);default:throw new Error("geom "+o+" not supported");}}},{"@turf/helpers":59,"@turf/invariant":60}],59:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],60:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],61:[function(n,t){function o(n,t){switch(n.type){case"Point":switch(t.type){case"Point":return!l(n.coordinates,t.coordinates);case"LineString":return!r(t,n);case"Polygon":return!i(n,t)}break;case"LineString":switch(t.type){case"Point":return!r(n,t);case"LineString":return!s(n,t);case"Polygon":return!u(t,n)}break;case"Polygon":switch(t.type){case"Point":return!i(t,n);case"LineString":return!u(n,t);case"Polygon":return!h(t,n)}}}function r(n,t){for(var i=0;i<n.coordinates.length-1;i++)if(c(n.coordinates[i],n.coordinates[i+1],t.coordinates))return!0;return!1}function s(n,t){return e(n,t).features.length>0}function u(n,t){return e(t,a(n)).features.length>0}function h(n,t){for(var u,r=0;r<n.coordinates[0].length;r++)if(i(n.coordinates[0][r],t))return!0;for(u=0;u<t.coordinates[0].length;u++)if(i(t.coordinates[0][u],n))return!0;return!1}function c(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 0==f*u-e*r&&(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])}function l(n,t){return n[0]===t[0]&&n[1]===t[1]}var i=n("@turf/inside"),f=n("@turf/meta").flattenEach,e=n("@turf/line-intersect"),a=n("@turf/polygon-to-linestring");t.exports=function(n,t){var i;return f(n,function(n){f(t,function(t){if(!1===i)return!1;i=o(n.geometry,t.geometry)})}),i}},{"@turf/inside":62,"@turf/line-intersect":64,"@turf/meta":78,"@turf/polygon-to-linestring":79}],62:[function(n,t,i){arguments[4][36][0].apply(i,arguments)},{"@turf/invariant":63,dup:36}],63:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],64:[function(n,t,i){arguments[4][44][0].apply(i,arguments)},{"@turf/helpers":68,"@turf/invariant":69,"@turf/line-segment":70,"@turf/meta":74,dup:44,"geojson-rbush":75}],65:[function(n,t,i){arguments[4][20][0].apply(i,arguments)},{"@turf/helpers":66,dup:20}],66:[function(n,t,i){arguments[4][46][0].apply(i,arguments)},{dup:46}],67:[function(n,t,i){arguments[4][47][0].apply(i,arguments)},{"@turf/meta":74,dup:47}],68:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],69:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],70:[function(n,t,i){arguments[4][50][0].apply(i,arguments)},{"@turf/helpers":71,"@turf/invariant":72,"@turf/meta":73,dup:50}],71:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],72:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],73:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],74:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],75:[function(n,t,i){arguments[4][55][0].apply(i,arguments)},{"@turf/bbox":67,"@turf/bbox-polygon":65,"@turf/helpers":68,"@turf/meta":74,dup:55,rbush:77}],76:[function(n,t,i){arguments[4][56][0].apply(i,arguments)},{dup:56}],77:[function(n,t,i){arguments[4][57][0].apply(i,arguments)},{dup:57,quickselect:76}],78:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],79:[function(n,t,i){arguments[4][58][0].apply(i,arguments)},{"@turf/helpers":80,"@turf/invariant":81,dup:58}],80:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],81:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],82:[function(n,t){var u=n("geojson-equality"),i=n("@turf/clean-coords"),f=n("@turf/invariant"),r=f.getGeomType;t.exports=function(n,t){if(!n)throw new Error("feature1 is required");if(!t)throw new Error("feature2 is required");return r(n)===r(t)&&new u({precision:6}).compare(i(n),i(t))}},{"@turf/clean-coords":83,"@turf/invariant":86,"geojson-equality":90}],83:[function(n,t){function u(n,t,i){var r={type:t,coordinates:i};return n.bbox&&(r.bbox=n.bbox),r}function e(n,t,i){var r=h.feature(u(n.geometry,t,i),n.properties);return n.id&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r}function r(n){var t=i(n),h,f,e,u,c,r;if(2===t.length&&!o(t[0],t[1]))return t;for(u=[],c=t.length-1,u.push(t[0]),r=1;r<c;r++)h=t[r-1],f=t[r],e=t[r+1],s(h,e,f)||u.push(f);return u.push(e),u}function o(n,t){return n[0]===t[0]&&n[1]===t[1]}function s(n,t,i){var r=i[0],u=i[1],f=n[0],e=n[1],o=t[0],s=t[1],l=r-f,a=u-e,h=o-f,c=s-e;return 0==l*c-a*h&&(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)}var h=n("@turf/helpers"),f=n("@turf/invariant"),i=f.getCoords,c=f.getGeomType;t.exports=function(n,t){var o,f,s;if(!n)throw new Error("geojson is required");o=c(n);f=[];switch(o){case"LineString":f=r(n);break;case"MultiLineString":case"Polygon":i(n).forEach(function(n){f.push(r(n))});break;case"MultiPolygon":i(n).forEach(function(n){var t=[];n.forEach(function(n){t.push(r(n))});f.push(t)});break;case"Point":return n;case"MultiPoint":s={};i(n).forEach(function(n){var t=n.join("-");s.hasOwnProperty(t)||(f.push(n),s[t]=!0)});break;default:throw new Error(o+" geometry not supported");}return n.coordinates?!0===t?(n.coordinates=f,n):u(n,o,f):!0===t?(n.geometry.coordinates=f,n):e(n,o,f)}},{"@turf/helpers":84,"@turf/invariant":85}],84:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],85:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],86:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],87:[function(n,t){function i(n){return null===n||void 0===n}function r(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 s(n,t,s){var h,a,c,l;if(i(n)||i(t)||n.prototype!==t.prototype)return!1;if(e(n))return!!e(t)&&(n=u.call(n),t=u.call(t),o(n,t,s));if(r(n)){if(!r(t)||n.length!==t.length)return!1;for(h=0;h<n.length;h++)if(n[h]!==t[h])return!1;return!0}try{c=f(n);l=f(t)}catch(n){return!1}if(c.length!=l.length)return!1;for(c.sort(),l.sort(),h=c.length-1;h>=0;h--)if(c[h]!=l[h])return!1;for(h=c.length-1;h>=0;h--)if(a=c[h],!o(n[a],t[a],s))return!1;return typeof n==typeof t}var u=Array.prototype.slice,f=n("./lib/keys.js"),e=n("./lib/is_arguments.js"),o=t.exports=function(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:n==t:s(n,t,i))}},{"./lib/is_arguments.js":88,"./lib/keys.js":89}],88:[function(n,t,i){function r(n){return"[object Arguments]"==Object.prototype.toString.call(n)}function u(n){return n&&"object"==typeof n&&"number"==typeof n.length&&Object.prototype.hasOwnProperty.call(n,"callee")&&!Object.prototype.propertyIsEnumerable.call(n,"callee")||!1}var f="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();i=t.exports=f?r:u;i.supported=r;i.unsupported=u},{}],89:[function(n,t,i){function r(n){var t=[],i;for(i in n)t.push(i);return t}i=t.exports="function"==typeof Object.keys?Object.keys:r;i.shim=r},{}],90:[function(n,t){function r(n){return n.coordinates.map(function(t){return{type:n.type.replace("Multi",""),coordinates:t}})}function u(n,t){return n.hasOwnProperty("coordinates")?n.coordinates.length===t.coordinates.length:n.length===t.length}function f(n,t){return e(n,t,{strict:!0})}var e=n("deep-equal"),i=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:f};i.prototype.compare=function(n,t){if(n.type!==t.type||!u(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,f=r(n),e=r(t);return f.every(function(n){return this.some(function(t){return i.compare(n,t)})},e)}}return!1};i.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};i.prototype.compareLine=function(n,t,i,r){var e,f,o;return u(n,t)?(e=this.pseudoNode?n:this.removePseudo(n),f=this.pseudoNode?t:this.removePseudo(t),!r||this.compareCoord(e[0],f[0])||(f=this.fixStartIndex(f,e))?(o=this.compareCoord(e[i],f[i]),this.direction||o?this.comparePath(e,f):!!this.compareCoord(e[i],f[f.length-(1+i)])&&this.comparePath(e.slice().reverse(),f)):void 0):!1};i.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};i.prototype.comparePath=function(n,t){var i=this;return n.every(function(n,t){return i.compareCoord(n,this[t])},t)};i.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};i.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)};i.prototype.compareBBox=function(n,t){return!!(!n.bbox&&!t.bbox||n.bbox&&t.bbox&&this.compareCoord(n.bbox,t.bbox))};i.prototype.removePseudo=function(n){return n};t.exports=i},{"deep-equal":87}],91:[function(n,t){var r=n("@turf/meta"),e=n("@turf/invariant"),o=n("@turf/line-overlap"),s=n("@turf/line-intersect"),h=n("geojson-equality"),u=r.coordAll,i=r.segmentEach,f=e.getGeomType;t.exports=function(n,t){var e,r,c,l;if(!n)throw new Error("feature1 is required");if(!t)throw new Error("feature2 is required");if(e=f(n),e!==f(t))throw new Error("features must be of the same type");if("Point"===e)throw new Error("Point geometry not supported");if(new h({precision:6}).compare(n,t))return!1;r=0;switch(e){case"MultiPoint":c=u(n);l=u(t);c.forEach(function(n){l.forEach(function(t){n[0]===t[0]&&n[1]===t[1]&&r++})});break;case"LineString":case"MultiLineString":i(n,function(n){i(t,function(t){o(n,t).features.length&&r++})});break;case"Polygon":case"MultiPolygon":i(n,function(n){i(t,function(t){s(n,t).features.length&&r++})})}return r>0}},{"@turf/invariant":92,"@turf/line-intersect":93,"@turf/line-overlap":107,"@turf/meta":152,"geojson-equality":156}],92:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],93:[function(n,t,i){arguments[4][44][0].apply(i,arguments)},{"@turf/helpers":97,"@turf/invariant":98,"@turf/line-segment":99,"@turf/meta":103,dup:44,"geojson-rbush":104}],94:[function(n,t,i){arguments[4][20][0].apply(i,arguments)},{"@turf/helpers":95,dup:20}],95:[function(n,t,i){arguments[4][46][0].apply(i,arguments)},{dup:46}],96:[function(n,t,i){arguments[4][47][0].apply(i,arguments)},{"@turf/meta":103,dup:47}],97:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],98:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],99:[function(n,t,i){arguments[4][50][0].apply(i,arguments)},{"@turf/helpers":100,"@turf/invariant":101,"@turf/meta":102,dup:50}],100:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],101:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],102:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],103:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],104:[function(n,t,i){arguments[4][55][0].apply(i,arguments)},{"@turf/bbox":96,"@turf/bbox-polygon":94,"@turf/helpers":97,"@turf/meta":103,dup:55,rbush:106}],105:[function(n,t,i){arguments[4][56][0].apply(i,arguments)},{dup:56}],106:[function(n,t,i){arguments[4][57][0].apply(i,arguments)},{dup:57,quickselect:105}],107:[function(n,t){function e(n,t){var r=f(t),e=f(n),o=e[0],s=e[e.length-1],u=n.geometry.coordinates;return i(r[0],o)?u.unshift(r[1]):i(r[0],s)?u.push(r[1]):i(r[1],o)?u.unshift(r[0]):i(r[1],s)&&u.push(r[0]),n}var o=n("@turf/meta"),i=n("deep-equal"),s=n("geojson-rbush"),h=n("@turf/invariant"),c=n("@turf/line-segment"),r=n("@turf/point-on-line"),u=n("@turf/boolean-point-on-line"),l=n("@turf/helpers").featureCollection,f=h.getCoords,a=o.featureEach,v=o.segmentEach;t.exports=function(n,t,o){var y=[],p,h;return o=o||0,p=s(),p.load(c(n)),v(t,function(n){var t=!1;a(p.search(n),function(s){if(!1===t){var c=f(n).sort(),l=f(s).sort();i(c,l)?(t=!0,h=h?e(h,n):n):(0===o?u(c[0],s)&&u(c[1],s):r(s,c[0]).properties.dist<=o&&r(s,c[1]).properties.dist<=o)?(t=!0,h=h?e(h,n):n):(0===o?u(l[0],n)&&u(l[1],n):r(n,l[0]).properties.dist<=o&&r(n,l[1]).properties.dist<=o)&&(h=h?e(h,s):s)}});!1===t&&h&&(y.push(h),h=void 0)}),h&&y.push(h),l(y)}},{"@turf/boolean-point-on-line":111,"@turf/helpers":113,"@turf/invariant":114,"@turf/line-segment":115,"@turf/meta":119,"@turf/point-on-line":120,"deep-equal":146,"geojson-rbush":149}],108:[function(n,t,i){arguments[4][20][0].apply(i,arguments)},{"@turf/helpers":109,dup:20}],109:[function(n,t,i){arguments[4][46][0].apply(i,arguments)},{dup:46}],110:[function(n,t,i){arguments[4][47][0].apply(i,arguments)},{"@turf/meta":119,dup:47}],111:[function(n,t,i){arguments[4][34][0].apply(i,arguments)},{"@turf/invariant":112,dup:34}],112:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],113:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],114:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],115:[function(n,t,i){arguments[4][50][0].apply(i,arguments)},{"@turf/helpers":116,"@turf/invariant":117,"@turf/meta":118,dup:50}],116:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],117:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],118:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],119:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],120:[function(n,t){var o=n("@turf/meta"),u=n("@turf/helpers"),s=n("@turf/bearing"),i=n("@turf/distance"),h=n("@turf/invariant"),f=n("@turf/destination"),c=n("@turf/line-intersect"),r=u.point,l=h.getCoords,e=u.lineString,a=o.flattenEach;t.exports=function(n,t,u){var v=n.geometry?n.geometry.type:n.type,o,h;if("LineString"!==v&&"MultiLineString"!==v)throw new Error("lines must be LineString or MultiLineString");return o=r([1/0,1/0],{dist:1/0}),h=0,a(n,function(n){for(var a,v,w=l(n),y=0;y<w.length-1;y++){a=r(w[y]);a.properties.dist=i(t,a,u);v=r(w[y+1]);v.properties.dist=i(t,v,u);var b=i(a,v,u),k=Math.max(a.properties.dist,v.properties.dist),d=s(a,v),nt=f(t,k,d+90,u),tt=f(t,k,d-90,u),g=c(e([nt.geometry.coordinates,tt.geometry.coordinates]),e([a.geometry.coordinates,v.geometry.coordinates])),p=null;g.features.length>0&&(p=g.features[0],p.properties.dist=i(t,p,u),p.properties.location=h+i(a,p,u));a.properties.dist<o.properties.dist&&(o=a,o.properties.index=y,o.properties.location=h);v.properties.dist<o.properties.dist&&(o=v,o.properties.index=y+1,o.properties.location=h+b);p&&p.properties.dist<o.properties.dist&&(o=p,o.properties.index=y);h+=b}}),o}},{"@turf/bearing":121,"@turf/destination":123,"@turf/distance":126,"@turf/helpers":129,"@turf/invariant":130,"@turf/line-intersect":131,"@turf/meta":145}],121:[function(n,t,i){arguments[4][3][0].apply(i,arguments)},{"@turf/invariant":122,dup:3}],122:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],123:[function(n,t,i){arguments[4][5][0].apply(i,arguments)},{"@turf/helpers":124,"@turf/invariant":125,dup:5}],124:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],125:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],126:[function(n,t,i){arguments[4][8][0].apply(i,arguments)},{"@turf/helpers":127,"@turf/invariant":128,dup:8}],127:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],128:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],129:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],130:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],131:[function(n,t,i){arguments[4][44][0].apply(i,arguments)},{"@turf/helpers":135,"@turf/invariant":136,"@turf/line-segment":137,"@turf/meta":141,dup:44,"geojson-rbush":142}],132:[function(n,t,i){arguments[4][20][0].apply(i,arguments)},{"@turf/helpers":133,dup:20}],133:[function(n,t,i){arguments[4][46][0].apply(i,arguments)},{dup:46}],134:[function(n,t,i){arguments[4][47][0].apply(i,arguments)},{"@turf/meta":141,dup:47}],135:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],136:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],137:[function(n,t,i){arguments[4][50][0].apply(i,arguments)},{"@turf/helpers":138,"@turf/invariant":139,"@turf/meta":140,dup:50}],138:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],139:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],140:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],141:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],142:[function(n,t,i){arguments[4][55][0].apply(i,arguments)},{"@turf/bbox":134,"@turf/bbox-polygon":132,"@turf/helpers":135,"@turf/meta":141,dup:55,rbush:144}],143:[function(n,t,i){arguments[4][56][0].apply(i,arguments)},{dup:56}],144:[function(n,t,i){arguments[4][57][0].apply(i,arguments)},{dup:57,quickselect:143}],145:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],146:[function(n,t,i){arguments[4][87][0].apply(i,arguments)},{"./lib/is_arguments.js":147,"./lib/keys.js":148,dup:87}],147:[function(n,t,i){arguments[4][88][0].apply(i,arguments)},{dup:88}],148:[function(n,t,i){arguments[4][89][0].apply(i,arguments)},{dup:89}],149:[function(n,t,i){arguments[4][55][0].apply(i,arguments)},{"@turf/bbox":110,"@turf/bbox-polygon":108,"@turf/helpers":113,"@turf/meta":119,dup:55,rbush:151}],150:[function(n,t,i){arguments[4][56][0].apply(i,arguments)},{dup:56}],151:[function(n,t,i){arguments[4][57][0].apply(i,arguments)},{dup:57,quickselect:150}],152:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],153:[function(n,t,i){arguments[4][87][0].apply(i,arguments)},{"./lib/is_arguments.js":154,"./lib/keys.js":155,dup:87}],154:[function(n,t,i){arguments[4][88][0].apply(i,arguments)},{dup:88}],155:[function(n,t,i){arguments[4][89][0].apply(i,arguments)},{dup:89}],156:[function(n,t,i){arguments[4][90][0].apply(i,arguments)},{"deep-equal":153,dup:90}],157:[function(n,t,i){arguments[4][34][0].apply(i,arguments)},{"@turf/invariant":158,dup:34}],158:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],159:[function(n,t){function c(n,t){for(var r=!1,i=0;i<t.coordinates.length;i++)if(e(t.coordinates[i],n.coordinates)){r=!0;break}return r}function l(n,t){for(var u,r,i=0;i<n.coordinates.length;i++){for(u=!1,r=0;r<t.coordinates.length;r++)e(n.coordinates[i],t.coordinates[r])&&(u=!0);if(!u)return!1}return!0}function a(n,t){for(var r=!1,i=0;i<n.coordinates.length;i++){if(!u(n.coordinates[i],t))return!1;r||(r=u(n.coordinates[i],t,!0))}return r}function v(n,t){for(var r,u=!0,f=0;f<n.coordinates.length;f++){if(r=i(n.coordinates[1],t),!r){u=!1;break}r=i(n.coordinates[1],t,!0)}return u&&r}function y(n,t){for(var i=0;i<n.coordinates.length;i++)if(!u(n.coordinates[i],t))return!1;return!0}function p(n,t){var e,u,o;if(!f(r(t),r(n)))return!1;for(e=!1,u=0;u<n.coordinates.length-1;u++){if(!i(n.coordinates[u],t))return!1;(e||(e=i(n.coordinates[u],t,!0)),e)||(o=b(n.coordinates[u],n.coordinates[u+1]),e=i(o,t,!0))}return e}function w(n,t){var e=r(n),u;if(!f(r(t),e))return!1;for(u=0;u<n.coordinates[0].length;u++)if(!i(n.coordinates[0][u],t))return!1;return!0}function f(n,t){return!(n[0]>t[0])&&!(n[2]<t[2])&&!(n[1]>t[1])&&!(n[3]<t[3])}function e(n,t){return n[0]===t[0]&&n[1]===t[1]}function b(n,t){return[(n[0]+t[0])/2,(n[1]+t[1])/2]}var i=n("@turf/inside"),r=n("@turf/bbox"),o=n("@turf/invariant"),u=n("@turf/boolean-point-on-line"),s=o.getGeom,h=o.getGeomType;t.exports=function(n,t){var o=h(n),e=h(t),r=s(n),f=s(t);switch(o){case"Point":switch(e){case"MultiPoint":return c(r,f);case"LineString":return u(r,f,!0);case"Polygon":return i(r,f,!0);default:throw new Error("feature2 "+e+" geometry not supported");}case"MultiPoint":switch(e){case"MultiPoint":return l(r,f);case"LineString":return a(r,f);case"Polygon":return v(r,f);default:throw new Error("feature2 "+e+" geometry not supported");}case"LineString":switch(e){case"LineString":return y(r,f);case"Polygon":return p(r,f);default:throw new Error("feature2 "+e+" geometry not supported");}case"Polygon":switch(e){case"Polygon":return w(r,f);default:throw new Error("feature2 "+e+" geometry not supported");}default:throw new Error("feature1 "+o+" geometry not supported");}}},{"@turf/bbox":160,"@turf/boolean-point-on-line":162,"@turf/inside":164,"@turf/invariant":166}],160:[function(n,t,i){arguments[4][22][0].apply(i,arguments)},{"@turf/meta":161,dup:22}],161:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],162:[function(n,t,i){arguments[4][34][0].apply(i,arguments)},{"@turf/invariant":163,dup:34}],163:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],164:[function(n,t,i){arguments[4][36][0].apply(i,arguments)},{"@turf/invariant":165,dup:36}],165:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],166:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],167:[function(n,t){function i(n,t,r,h){var d=n.properties||{},v="Feature"===n.type?n.geometry:n,y;switch(v.type){case"GeometryCollection":return y=[],c(n,function(n){var u=i(n,t,r,h);u&&y.push(u)}),u(y)}var g=w(b(t,r),"meters"),k=a(n),nt={type:v.type,coordinates:e(v.coordinates,k)},tt=new s.io.GeoJSONReader,it=tt.read(nt),l=it.buffer(g);if(l=(new s.io.GeoJSONWriter).write(l),!f(l.coordinates))return l.coordinates=o(l.coordinates,k),p(l,d)}function f(n){return Array.isArray(n[0])?f(n[0]):isNaN(n[0])}function e(n,t){return"object"!=typeof n[0]?t(n):n.map(function(n){return e(n,t)})}function o(n,t){return"object"!=typeof n[0]?t.invert(n):n.map(function(n){return o(n,t)})}function a(n){var t=y(n).geometry.coordinates.reverse(),i=t.map(function(n){return-n});return v.geoTransverseMercator().center(t).rotate(i).scale(6373e3)}var v=n("d3-geo"),s=n("jsts"),h=n("@turf/meta"),y=n("@turf/center"),r=n("@turf/helpers"),p=r.feature,c=h.geomEach,l=h.featureEach,u=r.featureCollection,w=r.radiansToDistance,b=r.distanceToRadians;t.exports=function(n,t,r,f){if(!n)throw new Error("geojson is required");if(void 0===t)throw new Error("radius is required");if(f<=0)throw new Error("steps must be greater than 0");f=f||64;r=r||"kilometers";var e=[];switch(n.type){case"GeometryCollection":return c(n,function(n){var u=i(n,t,r,f);u&&e.push(u)}),u(e);case"FeatureCollection":return l(n,function(n){var u=i(n,t,r,f);u&&l(u,function(n){n&&e.push(n)})}),u(e)}return i(n,t,r,f)}},{"@turf/center":168,"@turf/helpers":172,"@turf/meta":173,"d3-geo":175,jsts:176}],168:[function(n,t){var i=n("@turf/bbox"),r=n("@turf/helpers").point;t.exports=function(n,t){var u=i(n),f=(u[0]+u[2])/2,e=(u[1]+u[3])/2;return r([f,e],t)}},{"@turf/bbox":169,"@turf/helpers":171}],169:[function(n,t,i){arguments[4][22][0].apply(i,arguments)},{"@turf/meta":170,dup:22}],170:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],171:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],172:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],173:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],174:[function(t,i,r){!function(t,u){"object"==typeof r&&void 0!==i?u(r):"function"==typeof n&&n.amd?n(["exports"],u):u(t.d3=t.d3||{})}(this,function(n){"use strict";function tt(n){return function(t,r){return i(n(t),r)}}function h(n,t){return[n,t]}function c(n,t,i){var f=(t-n)/Math.max(0,i),u=Math.floor(Math.log(f)/Math.LN10),r=f/Math.pow(10,u);return u>=0?(r>=e?10:r>=o?5:r>=s?2:1)*Math.pow(10,u):-Math.pow(10,-u)/(r>=e?10:r>=o?5:r>=s?2:1)}function l(n,t,i){var f=Math.abs(t-n)/Math.max(0,i),r=Math.pow(10,Math.floor(Math.log(f)/Math.LN10)),u=f/r;return u>=e?r*=10:u>=o?r*=5:u>=s&&(r*=2),t<n?-r:r}function it(n){return n.length}var i=function(n,t){return n<t?-1:n>t?1:n>=t?0:NaN},a=function(n){return 1===n.length&&(n=tt(n)),{left:function(t,i,r,u){for(null==r&&(r=0),null==u&&(u=t.length);r<u;){var f=r+u>>>1;n(t[f],i)<0?r=f+1:u=f}return r},right:function(t,i,r,u){for(null==r&&(r=0),null==u&&(u=t.length);r<u;){var f=r+u>>>1;n(t[f],i)>0?u=f:r=f+1}return r}}},v=a(i),u=v.right,rt=v.left,ut=function(n,t){null==t&&(t=h);for(var i=0,r=n.length-1,u=n[0],f=new Array(r<0?0:r);i<r;)f[i]=t(u,u=n[++i]);return f},ft=function(n,t,i){var r,u,f,e,o=n.length,s=t.length,c=new Array(o*s);for(null==i&&(i=h),r=f=0;r<o;++r)for(e=n[r],u=0;u<s;++u,++f)c[f]=i(e,t[u]);return c},et=function(n,t){return t<n?-1:t>n?1:t>=n?0:NaN},t=function(n){return null===n?NaN:+n},y=function(n,i){var r,u,h=n.length,o=0,e=-1,f=0,s=0;if(null==i)for(;++e<h;)isNaN(r=t(n[e]))||(u=r-f,f+=u/++o,s+=u*(r-f));else for(;++e<h;)isNaN(r=t(i(n[e],e,n)))||(u=r-f,f+=u/++o,s+=u*(r-f));if(o>1)return s/(o-1)},p=function(n,t){var i=y(n,t);return i?Math.sqrt(i):i},w=function(n,t){var i,u,f,e=n.length,r=-1;if(null==t){for(;++r<e;)if(null!=(i=n[r])&&i>=i)for(u=f=i;++r<e;)null!=(i=n[r])&&(u>i&&(u=i),f<i&&(f=i))}else for(;++r<e;)if(null!=(i=t(n[r],r,n))&&i>=i)for(u=f=i;++r<e;)null!=(i=t(n[r],r,n))&&(u>i&&(u=i),f<i&&(f=i));return[u,f]},b=Array.prototype,ot=b.slice,st=b.map,f=function(n){return function(){return n}},ht=function(n){return n},k=function(n,t,i){n=+n;t=+t;i=(r=arguments.length)<2?(t=n,n=0,1):r<3?1:+i;for(var u=-1,r=0|Math.max(0,Math.ceil((t-n)/i)),f=new Array(r);++u<r;)f[u]=n+u*i;return f},e=Math.sqrt(50),o=Math.sqrt(10),s=Math.sqrt(2),ct=function(n,t,i){var u,f,r,o=t<n,e=-1;if(o&&(u=n,n=t,t=u),0===(r=c(n,t,i))||!isFinite(r))return[];if(r>0)for(n=Math.ceil(n/r),t=Math.floor(t/r),f=new Array(u=Math.ceil(t-n+1));++e<u;)f[e]=(n+e)*r;else for(n=Math.floor(n*r),t=Math.ceil(t*r),f=new Array(u=Math.ceil(n-t+1));++e<u;)f[e]=(n-e)/r;return o&&f.reverse(),f},d=function(n){return Math.ceil(Math.log(n.length)/Math.LN2)+1},lt=function(){function n(n){for(var c,y=n.length,a=new Array(y),o,p,v,f=0;f<y;++f)a[f]=t(n[f],f,n);var w=i(a),s=w[0],h=w[1],e=r(a,s,h);for(Array.isArray(e)||(e=l(s,h,e),e=k(Math.ceil(s/e)*e,Math.floor(h/e)*e,e)),o=e.length;e[0]<=s;)e.shift(),--o;for(;e[o-1]>h;)e.pop(),--o;for(v=new Array(o+1),f=0;f<=o;++f)p=v[f]=[],p.x0=f>0?e[f-1]:s,p.x1=f<o?e[f]:h;for(f=0;f<y;++f)c=a[f],s<=c&&c<=h&&v[u(e,c,0,o)].push(n[f]);return v}var t=ht,i=w,r=d;return n.value=function(i){return arguments.length?(t="function"==typeof i?i:f(i),n):t},n.domain=function(t){return arguments.length?(i="function"==typeof t?t:f([t[0],t[1]]),n):i},n.thresholds=function(t){return arguments.length?(r="function"==typeof t?t:f(Array.isArray(t)?ot.call(t):t),n):r},n},r=function(n,i,r){if(null==r&&(r=t),u=n.length){if((i=+i)<=0||u<2)return+r(n[0],0,n);if(i>=1)return+r(n[u-1],u-1,n);var u,e=(u-1)*i,f=Math.floor(e),o=+r(n[f],f,n);return o+(+r(n[f+1],f+1,n)-o)*(e-f)}},at=function(n,u,f){return n=st.call(n,t).sort(i),Math.ceil((f-u)/(2*(r(n,.75)-r(n,.25))*Math.pow(n.length,-1/3)))},vt=function(n,t,i){return Math.ceil((i-t)/(3.5*p(n)*Math.pow(n.length,-1/3)))},yt=function(n,t){var i,u,f=n.length,r=-1;if(null==t){for(;++r<f;)if(null!=(i=n[r])&&i>=i)for(u=i;++r<f;)null!=(i=n[r])&&i>u&&(u=i)}else for(;++r<f;)if(null!=(i=t(n[r],r,n))&&i>=i)for(u=i;++r<f;)null!=(i=t(n[r],r,n))&&i>u&&(u=i);return u},pt=function(n,i){var u,e=n.length,f=e,r=-1,o=0;if(null==i)for(;++r<e;)isNaN(u=t(n[r]))?--f:o+=u;else for(;++r<e;)isNaN(u=t(i(n[r],r,n)))?--f:o+=u;if(f)return o/f},wt=function(n,u){var e,s=n.length,f=-1,o=[];if(null==u)for(;++f<s;)isNaN(e=t(n[f]))||o.push(e);else for(;++f<s;)isNaN(e=t(u(n[f],f,n)))||o.push(e);return r(o.sort(i),.5)},bt=function(n){for(var t,i,r,u=n.length,e=-1,f=0;++e<u;)f+=n[e].length;for(i=new Array(f);--u>=0;)for(r=n[u],t=r.length;--t>=0;)i[--f]=r[t];return i},g=function(n,t){var i,u,f=n.length,r=-1;if(null==t){for(;++r<f;)if(null!=(i=n[r])&&i>=i)for(u=i;++r<f;)null!=(i=n[r])&&u>i&&(u=i)}else for(;++r<f;)if(null!=(i=t(n[r],r,n))&&i>=i)for(u=i;++r<f;)null!=(i=t(n[r],r,n))&&u>i&&(u=i);return u},kt=function(n,t){for(var i=t.length,r=new Array(i);i--;)r[i]=n[t[i]];return r},dt=function(n,t){if(e=n.length){var e,o,u=0,f=0,r=n[f];for(null==t&&(t=i);++u<e;)(t(o=n[u],r)<0||0!==t(r,r))&&(r=o,f=u);return 0===t(r,r)?f:void 0}},gt=function(n,t,i){for(var f,u,r=(null==i?n.length:i)-(t=null==t?0:+t);r;)u=Math.random()*r--|0,f=n[r+t],n[r+t]=n[u+t],n[u+t]=f;return n},ni=function(n,t){var r,f=n.length,i=-1,u=0;if(null==t)for(;++i<f;)(r=+n[i])&&(u+=r);else for(;++i<f;)(r=+t(n[i],i,n))&&(u+=r);return u},nt=function(n){var r,t,e;if(!(r=n.length))return[];for(var i=-1,u=g(n,it),f=new Array(u);++i<u;)for(t=-1,e=f[i]=new Array(r);++t<r;)e[t]=n[t][i];return f},ti=function(){return nt(arguments)};n.bisect=u;n.bisectRight=u;n.bisectLeft=rt;n.ascending=i;n.bisector=a;n.cross=ft;n.descending=et;n.deviation=p;n.extent=w;n.histogram=lt;n.thresholdFreedmanDiaconis=at;n.thresholdScott=vt;n.thresholdSturges=d;n.max=yt;n.mean=pt;n.median=wt;n.merge=bt;n.min=g;n.pairs=ut;n.permute=kt;n.quantile=r;n.range=k;n.scan=dt;n.shuffle=gt;n.sum=ni;n.ticks=ct;n.tickIncrement=c;n.tickStep=l;n.transpose=nt;n.variance=y;n.zip=ti;Object.defineProperty(n,"__esModule",{value:!0})})},{}],175:[function(t,i,r){!function(u,f){"object"==typeof r&&void 0!==i?f(r,t("d3-array")):"function"==typeof n&&n.amd?n(["exports","d3-array"],f):f(u.d3=u.d3||{},u.d3)}(this,function(n,t){"use strict";function di(){this.reset()}function ce(n,t,i){var r=n.s=t+i,u=r-t,f=r-u;n.t=t-f+(i-u)}function le(n){return n>1?0:n<-1?e:Math.acos(n)}function d(n){return n>1?a:n<-1?-a:Math.asin(n)}function ae(n){return(n=i(n/2))*n}function h(){}function gi(n,t){n&&ws.hasOwnProperty(n.type)&&ws[n.type](n,t)}function yu(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 ve(n,t){var i=-1,r=n.length;for(t.polygonStart();++i<r;)yu(n[i],t,1);t.polygonEnd()}function fc(){ft.point=oc}function ec(){ye(ss,hs)}function oc(n,t){ft.point=ye;ss=n;hs=t;n*=f;t*=f;hf=n;cf=r(t=t/2+kr);lf=i(t)}function ye(n,t){n*=f;t*=f;t=t/2+kr;var u=n-hf,e=u>=0?1:-1,o=e*u,s=r(t),h=i(t),c=lf*h,l=cf*s+c*r(o),a=c*e*i(o);nu.add(b(a,l));hf=n;cf=s;lf=h}function nr(n){return[b(n[1],n[0]),d(n[2])]}function yt(n){var t=n[0],u=n[1],f=r(u);return[f*r(t),f*i(t),i(u)]}function tr(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function kt(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 pu(n,t){n[0]+=t[0];n[1]+=t[1];n[2]+=t[2]}function ir(n,t){return[n[0]*t,n[1]*t,n[2]*t]}function rr(n){var t=v(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t;n[1]/=t;n[2]/=t}function wu(n,t){vt.push(st=[c=n,l=n]);t<nt&&(nt=t);t>tt&&(tt=t)}function pe(n,t){var v=yt([n*f,t*f]);if(dt){var h=kt(dt,v),p=[h[1],-h[0],0],i=kt(p,h);rr(i);i=nr(i);var e,y=n-wt,u=y>0?1:-1,r=i[0]*s*u,a=o(y)>180;a^(u*wt<r&&r<u*n)?(e=i[1]*s)>tt&&(tt=e):(r=(r+360)%360-180,a^(u*wt<r&&r<u*n)?(e=-i[1]*s)<nt&&(nt=e):(t<nt&&(nt=t),t>tt&&(tt=t)));a?n<wt?g(c,n)>g(c,l)&&(l=n):g(n,l)>g(c,l)&&(c=n):l>=c?(n<c&&(c=n),n>l&&(l=n)):n>wt?g(c,n)>g(c,l)&&(l=n):g(n,l)>g(c,l)&&(c=n)}else vt.push(st=[c=n,l=n]);t<nt&&(nt=t);t>tt&&(tt=t);dt=v;wt=n}function we(){ht.point=pe}function be(){st[0]=c;st[1]=l;ht.point=wu;dt=null}function ke(n,t){if(dt){var i=n-wt;li.add(o(i)>180?i+(i>0?360:-360):i)}else cs=n,ls=t;ft.point(n,t);pe(n,t)}function sc(){ft.lineStart()}function hc(){ke(cs,ls);ft.lineEnd();o(li)>u&&(c=-(l=180));st[0]=c;st[1]=l;dt=null}function g(n,t){return(t-=n)<0?t+360:t}function cc(n,t){return n[0]-t[0]}function de(n,t){return n[0]<=n[1]?n[0]<=t&&t<=n[1]:t<n[0]||n[1]<t}function bu(n,t){n*=f;t*=f;var u=r(t);fi(u*r(n),u*i(n),i(t))}function fi(n,t,i){++hi;lr+=(n-lr)/hi;ar+=(t-ar)/hi;vr+=(i-vr)/hi}function ge(){ut.point=lc}function lc(n,t){n*=f;t*=f;var u=r(t);y=u*r(n);p=u*i(n);w=i(t);ut.point=ac;fi(y,p,w)}function ac(n,t){n*=f;t*=f;var h=r(t),e=h*r(n),o=h*i(n),s=i(t),u=b(v((u=p*s-w*o)*u+(u=w*e-y*s)*u+(u=y*o-p*e)*u),y*e+p*o+w*s);cr+=u;yr+=u*(y+(y=e));pr+=u*(p+(p=o));wr+=u*(w+(w=s));fi(y,p,w)}function no(){ut.point=bu}function vc(){ut.point=pc}function yc(){to(as,vs);ut.point=bu}function pc(n,t){as=n;vs=t;n*=f;t*=f;ut.point=to;var u=r(t);y=u*r(n);p=u*i(n);w=i(t);fi(y,p,w)}function to(n,t){n*=f;t*=f;var k=r(t),e=k*r(n),o=k*i(n),s=i(t),h=p*s-w*o,c=w*e-y*s,l=y*o-p*e,a=v(h*h+c*c+l*l),u=d(a),b=a&&-u/a;af+=b*h;vf+=b*c;yf+=b*l;cr+=u;yr+=u*(y+(y=e));pr+=u*(p+(p=o));wr+=u*(w+(w=s));fi(y,p,w)}function ku(n,t){return[n>e?n-k:n<-e?n+k:n,t]}function du(n,t,i){return(n%=k)?t||i?bs(ro(n),uo(t,i)):ro(n):t||i?uo(t,i):ku}function io(n){return function(t,i){return t+=n,[t>e?t-k:t<-e?t+k:t,i]}}function ro(n){var t=io(n);return t.invert=io(-n),t}function uo(n,t){function s(n,t){var s=r(t),h=r(n)*s,c=i(n)*s,l=i(t),a=l*u+h*f;return[b(c*e-a*o,h*u-l*f),d(a*e+c*o)]}var u=r(n),f=i(n),e=r(t),o=i(t);return s.invert=function(n,t){var s=r(t),h=r(n)*s,c=i(n)*s,l=i(t),a=l*e-c*o;return[b(c*e+l*o,h*u+a*f),d(a*u-h*f)]},s}function fo(n,t,u,f,e,o){var c,s;if(u){var h=r(t),l=i(t),a=f*u;for(null==e?(e=t+f*k,o=t-a/2):(e=eo(h,e),o=eo(h,o),(f>0?e<o:e>o)&&(e+=f*k)),s=e;f>0?s>o:s<o;s-=a)c=nr([h,-l*r(s),-l*i(s)]),n.point(c[0],c[1])}}function eo(n,t){t=yt(t);t[0]-=n;rr(t);var i=le(-t[1]);return((-t[2]<0?-i:i)+k-u)%k}function ur(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 oo(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 gu(n,i,r,f){function s(t,u){return n<=t&&t<=r&&i<=u&&u<=f}function h(t,u,o,s){var h=0,l=0;if(null==t||(h=e(t,o))!==(l=e(u,o))||c(t,u)<0^o>0){do s.point(0===h||3===h?n:r,h>1?f:i);while((h=(h+o+4)%4)!==l)}else s.point(u[0],u[1])}function e(t,f){return o(t[0]-n)<u?f>0?0:3:o(t[0]-r)<u?f>0?2:1:o(t[1]-i)<u?f>0?1:0:f>0?3:2}function l(n,t){return c(n.x,t.x)}function c(n,t){var i=e(n,1),r=e(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 g(n,t){s(n,t)&&e.point(n,t)}function ut(){for(var o=0,s=0,a=c.length;s<a;++s)for(var r,t,h=c[s],l=1,v=h.length,u=h[0],e=u[0],i=u[1];l<v;++l)r=e,t=i,u=h[l],e=u[0],i=u[1],t<=f?i>f&&(e-r)*(f-t)>(i-t)*(n-r)&&++o:i<=f&&(e-r)*(f-t)<(i-t)*(n-r)&&--o;return o}function ft(){e=k;o=[];c=[];p=!0}function et(){var n=ut(),i=p&&n,r=(o=t.merge(o)).length;(i||r)&&(u.polygonStart(),i&&(u.lineStart(),h(null,null,1,u),u.lineEnd()),r&&rh(o,l,n,h,u),u.polygonEnd());e=u;o=c=w=null}function ot(){d.point=nt;c&&c.push(w=[]);b=!0;a=!1;v=y=NaN}function st(){o&&(nt(tt,it),rt&&a&&k.rejoin(),o.push(k.result()));d.point=g;a&&e.lineEnd()}function nt(t,u){var o=s(t,u),h,l;(c&&w.push([t,u]),b)?(tt=t,it=u,rt=o,b=!1,o&&(e.lineStart(),e.point(t,u))):o&&a?e.point(t,u):(h=[v=Math.max(fu,Math.min(ai,v)),y=Math.max(fu,Math.min(ai,y))],l=[t=Math.max(fu,Math.min(ai,t)),u=Math.max(fu,Math.min(ai,u))],ra(h,l,n,i,r,f)?(a||(e.lineStart(),e.point(h[0],h[1])),e.point(l[0],l[1]),o||e.lineEnd(),p=!1):o&&(e.lineStart(),e.point(t,u),p=!1));v=t;y=u;a=o}var o,c,w,tt,it,rt,v,y,a,b,p,e=u,k=ih(),d={point:g,lineStart:ot,lineEnd:st,polygonStart:ft,polygonEnd:et};return d}}function wc(){ti.point=kc;ti.lineEnd=bc}function bc(){ti.point=ti.lineEnd=h}function kc(n,t){n*=f;t*=f;bf=n;iu=i(t);ru=r(t);ti.point=dc}function dc(n,t){n*=f;t*=f;var e=i(t),u=r(t),s=o(n-bf),h=r(s),a=i(s),c=u*a,l=ru*e-iu*u*h,y=iu*e+ru*u*h;ne.add(b(v(c*c+l*l),y));bf=n;iu=e;ru=u}function fr(n,t){return!(!n||!oh.hasOwnProperty(n.type))&&oh[n.type](n,t)}function so(n,t){return 0===vi(n,t)}function ho(n,t){var i=vi(n[0],n[1]);return vi(n[0],t)+vi(t,n[1])<=i+u}function co(n,t){return!!uh(n.map(gc),lo(t))}function gc(n){return n=n.map(lo),n.pop(),n}function lo(n){return[n[0]*f,n[1]*f]}function ao(n,i,r){var f=t.range(n,i-u,r).concat(i);return function(n){return f.map(function(t){return[n,t]})}}function vo(n,i,r){var f=t.range(n,i-u,r).concat(i);return function(n){return f.map(function(t){return[t,n]})}}function yo(){function n(){return{type:"MultiLineString",coordinates:d()}}function d(){return t.range(dr(r/v)*v,i,v).map(b).concat(t.range(dr(e/y)*y,f,y).map(k)).concat(t.range(dr(h/a)*a,s,a).filter(function(n){return o(n%v)>u}).map(g)).concat(t.range(dr(l/w)*w,c,w).filter(function(n){return o(n%y)>u}).map(nt))}var s,h,i,r,c,l,f,e,g,nt,b,k,a=10,w=a,v=90,y=360,p=2.5;return n.lines=function(){return d().map(function(n){return{type:"LineString",coordinates:n}})},n.outline=function(){return{type:"Polygon",coordinates:[b(r).concat(k(f).slice(1),b(i).reverse().slice(1),k(e).reverse().slice(1))]}},n.extent=function(t){return arguments.length?n.extentMajor(t).extentMinor(t):n.extentMinor()},n.extentMajor=function(t){return arguments.length?(r=+t[0][0],i=+t[1][0],e=+t[0][1],f=+t[1][1],r>i&&(t=r,r=i,i=t),e>f&&(t=e,e=f,f=t),n.precision(p)):[[r,e],[i,f]]},n.extentMinor=function(t){return arguments.length?(h=+t[0][0],s=+t[1][0],l=+t[0][1],c=+t[1][1],h>s&&(t=h,h=s,s=t),l>c&&(t=l,l=c,c=t),n.precision(p)):[[h,l],[s,c]]},n.step=function(t){return arguments.length?n.stepMajor(t).stepMinor(t):n.stepMinor()},n.stepMajor=function(t){return arguments.length?(v=+t[0],y=+t[1],n):[v,y]},n.stepMinor=function(t){return arguments.length?(a=+t[0],w=+t[1],n):[a,w]},n.precision=function(t){return arguments.length?(p=+t,g=ao(l,c,90),nt=vo(h,s,p),b=ao(e,f,90),k=vo(r,i,p),n):p},n.extentMajor([[-180,-90+u],[180,90-u]]).extentMinor([[-180,-80-u],[180,80+u]])}function nl(){return yo()()}function tl(){ct.point=il}function il(n,t){ct.point=po;ks=kf=n;ds=df=t}function po(n,t){re.add(df*n-kf*t);kf=n;df=t}function rl(){po(ks,ds)}function ul(n,t){n<ii&&(ii=n);n>yi&&(yi=n);t<eu&&(eu=t);t>ou&&(ou=t)}function pt(n,t){ue+=n;fe+=t;++pi}function wo(){it.point=fl}function fl(n,t){it.point=el;pt(et=n,ot=t)}function el(n,t){var r=n-et,u=t-ot,i=v(r*r+u*u);hu+=i*(et+n)/2;cu+=i*(ot+t)/2;ri+=i;pt(et=n,ot=t)}function bo(){it.point=pt}function ol(){it.point=hl}function sl(){ko(gs,nh)}function hl(n,t){it.point=ko;pt(gs=et=n,nh=ot=t)}function ko(n,t){var r=n-et,u=t-ot,i=v(r*r+u*u);hu+=i*(et+n)/2;cu+=i*(ot+t)/2;ri+=i;i=ot*n-et*t;ee+=i*(et+n);oe+=i*(ot+t);wi+=3*i;pt(et=n,ot=t)}function go(n){this._context=n}function cl(n,t){ui.point=ns;sh=bi=n;hh=ki=t}function ns(n,t){bi-=n;ki-=t;lu.add(v(bi*bi+ki*ki));bi=n;ki=t}function ts(){this._string=[]}function is(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function ll(n){return n.length>1}function al(n,t){return((n=n.x)[0]<0?n[1]-a-u:a-n[1])-((t=t.x)[0]<0?t[1]-a-u:a-t[1])}function vl(n){var f,i=NaN,t=NaN,r=NaN;return{lineStart:function(){n.lineStart();f=1},point:function(s,h){var c=s>0?e:-e,l=o(s-i);o(l-e)<u?(n.point(i,t=(t+h)/2>0?a:-a),n.point(r,t),n.lineEnd(),n.lineStart(),n.point(c,t),n.point(s,t),f=0):r!==c&&l>=e&&(o(i-r)<u&&(i-=r*u),o(s-c)<u&&(s-=c*u),t=yl(i,t,s,h),n.point(r,t),n.lineEnd(),n.lineStart(),n.point(c,t),f=0);n.point(i=s,t=h);r=c},lineEnd:function(){n.lineEnd();i=t=NaN},clean:function(){return 2-f}}}function yl(n,t,f,e){var s,h,c=i(n-f);return o(c)>u?gt((i(t)*(h=r(e))*i(f)-i(e)*(s=r(t))*i(n))/(s*h*c)):(t+e)/2}function pl(n,t,i,r){var f,s;null==n?(f=i*a,r.point(-e,f),r.point(0,f),r.point(e,f),r.point(e,0),r.point(e,-f),r.point(0,-f),r.point(-e,-f),r.point(-e,0),r.point(-e,f)):o(n[0]-t[0])>u?(s=n[0]<t[0]?e:-e,f=i*s/2,r.point(-s,f),r.point(0,f),r.point(s,f)):r.point(t[0],t[1])}function er(n){return function(t){var i=new nf,r;for(r in n)i[r]=n[r];return i.stream=t,i}}function nf(){}function or(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);rt(i,n.stream(su));var r=su.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 tf(n,t,i){return or(n,[[0,0],t],i)}function wl(n){return er({point:function(t,i){t=n(t,i);this.stream.point(t[0],t[1])}})}function bl(n,t){function i(r,f,e,s,h,c,l,a,y,p,w,k,g,nt){var ut=l-r,ft=a-f,st=ut*ut+ft*ft;if(st>4*t&&g--){var it=s+p,rt=h+w,tt=c+k,ht=v(it*it+rt*rt+tt*tt),pt=d(tt/=ht),ct=o(o(tt)-1)<u||o(e-y)<u?(e+y)/2:b(rt,it),lt=n(ct,pt),et=lt[0],ot=lt[1],at=et-r,vt=ot-f,yt=ft*at-ut*vt;(yt*yt/st>t||o((ut*at+ft*vt)/st-.5)>.3||s*p+h*w+c*k<la)&&(i(r,f,e,s,h,c,et,ot,ct,it/=ht,rt/=ht,tt,g,nt),nt.point(et,ot),i(et,ot,ct,it,rt,tt,l,a,y,p,w,k,g,nt))}}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=yt([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],ah,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,ah,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}}function lt(n){return rf(function(){return n})()}function rf(n){function t(n){return n=a(n[0]*f,n[1]*f),[n[0]*i+o,h-n[1]*i]}function lt(n){return(n=a.invert((n[0]-o)/i,(h-n[1])/i))&&[n[0]*s,n[1]*s]}function et(n,t){return n=u(n,t),[n[0]*i+o,h-n[1]*i]}function r(){a=bs(ot=du(tt,it,rt),u);var n=u(g,nt);return o=k-n[0]*i,h=d+n[1]*i,e()}function e(){return c=b=null,t}var u,o,h,ot,a,y,p,w,c,b,i=150,k=480,d=250,g=0,nt=0,tt=0,it=0,rt=0,ut=null,st=lh,l=null,ht=bt,ft=.5,ct=vh(et,ft);return t.stream=function(n){return c&&b===n?c:c=aa(st(ot,ct(ht(b=n))))},t.clipAngle=function(n){return arguments.length?(st=+n?ha(ut=n*f,6*f):(ut=null,lh),e()):ut*s},t.clipExtent=function(n){return arguments.length?(ht=null==n?(l=y=p=w=null,bt):gu(l=+n[0][0],y=+n[0][1],p=+n[1][0],w=+n[1][1]),e()):null==l?null:[[l,y],[p,w]]},t.scale=function(n){return arguments.length?(i=+n,r()):i},t.translate=function(n){return arguments.length?(k=+n[0],d=+n[1],r()):[k,d]},t.center=function(n){return arguments.length?(g=n[0]%360*f,nt=n[1]%360*f,r()):[g*s,nt*s]},t.rotate=function(n){return arguments.length?(tt=n[0]%360*f,it=n[1]%360*f,rt=n.length>2?n[2]%360*f:0,r()):[tt*s,it*s,rt*s]},t.precision=function(n){return arguments.length?(ct=vh(et,ft=n*n),e()):v(ft)},t.fitExtent=function(n,i){return or(t,n,i)},t.fitSize=function(n,i){return tf(t,n,i)},function(){return u=n.apply(this,arguments),t.invert=u.invert&&lt,r()}}function uf(n){var t=0,i=e/3,r=rf(n),u=r(t,i);return u.parallels=function(n){return arguments.length?r(t=n[0]*f,i=n[1]*f):[t*s,i*s]},u}function kl(n){function u(n,r){return[n*t,i(r)/t]}var t=r(n);return u.invert=function(n,i){return[n/t,d(i*t)]},u}function rs(n,t){function c(n,t){var u=v(e-2*f*i(t))/f;return[u*i(n*=f),h-u*r(n)]}var s=i(n),f=(s+i(t))/2,e,h;return o(f)<u?kl(n):(e=1+s*(2*f-s),h=v(e)/f,c.invert=function(n,t){var i=h-t;return[b(n,o(i))/f*ci(i),d((e-(n*n+i*i)*f*f)/(2*f))]},c)}function dl(n){var t=n.length;return{point:function(i,r){for(var u=-1;++u<t;)n[u].point(i,r)},sphere:function(){for(var i=-1;++i<t;)n[i].sphere()},lineStart:function(){for(var i=-1;++i<t;)n[i].lineStart()},lineEnd:function(){for(var i=-1;++i<t;)n[i].lineEnd()},polygonStart:function(){for(var i=-1;++i<t;)n[i].polygonStart()},polygonEnd:function(){for(var i=-1;++i<t;)n[i].polygonEnd()}}}function us(n){return function(t,u){var o=r(t),f=r(u),e=n(o*f);return[e*f*i(t),e*i(u)]}}function ei(n){return function(t,u){var f=v(t*t+u*u),e=n(f),o=i(e),s=r(e);return[b(t*o,f*s),d(f&&u*o/f)]}}function oi(n,t){return[n,gr(wf((a+t)/2))]}function fs(n){function r(){var r=e*s(),h=t(th(t.rotate()).invert([0,0]));return l(null==i?[[h[0]-r,h[1]-r],[h[0]+r,h[1]+r]]:n===oi?[[Math.max(h[0]-r,i),u],[Math.min(h[0]+r,f),o]]:[[i,Math.max(h[1]-r,u)],[f,Math.min(h[1]+r,o)]])}var u,f,o,t=lt(n),h=t.center,s=t.scale,c=t.translate,l=t.clipExtent,i=null;return t.scale=function(n){return arguments.length?(s(n),r()):s()},t.translate=function(n){return arguments.length?(c(n),r()):c()},t.center=function(n){return arguments.length?(h(n),r()):h()},t.clipExtent=function(n){return arguments.length?(null==n?i=u=f=o=null:(i=+n[0][0],u=+n[0][1],f=+n[1][0],o=+n[1][1]),r()):null==i?null:[[i,u],[f,o]]},r()}function sr(n){return wf((a+n)/2)}function es(n,t){function s(n,t){e>0?t<-a+u&&(t=-a+u):t>a-u&&(t=a-u);var o=e/pf(sr(t),f);return[o*i(f*n),e-o*r(f*n)]}var h=r(n),f=n===t?i(n):gr(h/r(t))/gr(sr(t)/sr(n)),e=h*pf(sr(n),f)/f;return f?(s.invert=function(n,t){var i=e-t,r=ci(f)*v(n*n+i*i);return[b(n,o(i))/f*ci(i),2*gt(pf(e/r,1/f))-a]},s):oi}function si(n,t){return[n,t]}function os(n,t){function s(n,t){var u=e-t,o=f*n;return[u*i(o),e-u*r(o)]}var h=r(n),f=n===t?i(n):(h-r(t))/(t-n),e=h/f+n;return o(f)<u?si:(s.invert=function(n,t){var i=e-t;return[b(n,o(i))/f*ci(i),e-ci(f)*v(n*n+i*i)]},s)}function ff(n,t){var u=r(t),f=r(n)*u;return[u*i(n)/f,i(t)/f]}function hr(n,t,i,r){return 1===n&&1===t&&0===i&&0===r?bt:er({point:function(u,f){this.stream.point(u*n+i,f*t+r)}})}function ef(n,t){return[r(t)*i(n),i(t)]}function of(n,t){var u=r(t),f=1+r(n)*u;return[u*i(n)/f,i(t)/f]}function sf(n,t){return[gr(wf((a+t)/2)),-n]}var at=function(){return new di},se,sh,hh,bi,ki,lu,ui,ph,vu,wh,bh,kh,dh,gh,nc,tc,ic,rc,uc;di.prototype={constructor:di,reset:function(){this.s=this.t=0},add:function(n){ce(br,n,this.t);ce(this,br.s,this.s);this.s?this.t+=br.t:this.s=br.t},valueOf:function(){return this.s}};var ss,hs,hf,cf,lf,c,nt,l,tt,wt,cs,ls,dt,vt,st,hi,cr,lr,ar,vr,yr,pr,wr,af,vf,yf,as,vs,y,p,w,br=new di,u=1e-6,e=Math.PI,a=e/2,kr=e/4,k=2*e,s=180/e,f=e/180,o=Math.abs,gt=Math.atan,b=Math.atan2,r=Math.cos,dr=Math.ceil,ys=Math.exp,gr=Math.log,pf=Math.pow,i=Math.sin,ci=Math.sign||function(n){return n>0?1:n<0?-1:0},v=Math.sqrt,wf=Math.tan,ps={Feature:function(n,t){gi(n.geometry,t)},FeatureCollection:function(n,t){for(var i=n.features,r=-1,u=i.length;++r<u;)gi(i[r].geometry,t)}},ws={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){yu(n.coordinates,t,0)},MultiLineString:function(n,t){for(var i=n.coordinates,r=-1,u=i.length;++r<u;)yu(i[r],t,0)},Polygon:function(n,t){ve(n.coordinates,t)},MultiPolygon:function(n,t){for(var i=n.coordinates,r=-1,u=i.length;++r<u;)ve(i[r],t)},GeometryCollection:function(n,t){for(var i=n.geometries,r=-1,u=i.length;++r<u;)gi(i[r],t)}},rt=function(n,t){n&&ps.hasOwnProperty(n.type)?ps[n.type](n,t):gi(n,t)},nu=at(),tu=at(),ft={point:h,lineStart:h,lineEnd:h,polygonStart:function(){nu.reset();ft.lineStart=fc;ft.lineEnd=ec},polygonEnd:function(){var n=+nu;tu.add(n<0?k+n:n);this.lineStart=this.lineEnd=this.point=h},sphere:function(){tu.add(k)}},gl=function(n){return tu.reset(),rt(n,ft),2*tu},li=at(),ht={point:wu,lineStart:we,lineEnd:be,polygonStart:function(){ht.point=ke;ht.lineStart=sc;ht.lineEnd=hc;li.reset();ft.polygonStart()},polygonEnd:function(){ft.polygonEnd();ht.point=wu;ht.lineStart=we;ht.lineEnd=be;nu<0?(c=-(l=180),nt=-(tt=90)):li>u?tt=90:li<-u&&(nt=-90);st[0]=c;st[1]=l}},na=function(n){var r,u,t,i,f,e,o;if(tt=l=-(c=nt=1/0),vt=[],rt(n,ht),u=vt.length){for(vt.sort(cc),r=1,t=vt[0],f=[t];r<u;++r)i=vt[r],de(t,i[0])||de(t,i[1])?(g(t[0],i[1])>g(t[0],t[1])&&(t[1]=i[1]),g(i[0],t[1])>g(t[0],t[1])&&(t[0]=i[0])):f.push(t=i);for(e=-1/0,u=f.length-1,r=0,t=f[u];r<=u;t=i,++r)i=f[r],(o=g(t[1],i[0]))>e&&(e=o,c=i[0],l=t[1])}return vt=st=null,c===1/0||nt===1/0?[[NaN,NaN],[NaN,NaN]]:[[c,nt],[l,tt]]},ut={sphere:h,point:bu,lineStart:ge,lineEnd:no,polygonStart:function(){ut.lineStart=vc;ut.lineEnd=yc},polygonEnd:function(){ut.lineStart=ge;ut.lineEnd=no}},ta=function(n){hi=cr=lr=ar=vr=yr=pr=wr=af=vf=yf=0;rt(n,ut);var t=af,i=vf,r=yf,f=t*t+i*i+r*r;return f<1e-12&&(t=yr,i=pr,r=wr,cr<u&&(t=lr,i=ar,r=vr),(f=t*t+i*i+r*r)<1e-12)?[NaN,NaN]:[b(i,t)*s,d(r/v(f))*s]},ni=function(n){return function(){return n}},bs=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};ku.invert=ku;var bf,iu,ru,ks,ds,kf,df,gs,nh,et,ot,th=function(n){function t(t){return t=n(t[0]*f,t[1]*f),t[0]*=s,t[1]*=s,t}return n=du(n[0]*f,n[1]*f,n.length>2?n[2]*f:0),t.invert=function(t){return t=n.invert(t[0]*f,t[1]*f),t[0]*=s,t[1]*=s,t},t},ia=function(){function o(n,r){t.push(n=i(n,r));n[0]*=s;n[1]*=s}function n(){var n=r.apply(this,arguments),o=u.apply(this,arguments)*f,s=e.apply(this,arguments)*f;return t=[],i=du(-n[0]*f,-n[1]*f,0).invert,fo(h,o,s,1),n={type:"Polygon",coordinates:[t]},t=i=null,n}var t,i,r=ni([0,0]),u=ni(90),e=ni(6),h={point:o};return n.center=function(t){return arguments.length?(r="function"==typeof t?t:ni([+t[0],+t[1]]),n):r},n.radius=function(t){return arguments.length?(u="function"==typeof t?t:ni(+t),n):u},n.precision=function(t){return arguments.length?(e="function"==typeof t?t:ni(+t),n):e},n},ih=function(){var t,n=[];return{point:function(n,i){t.push([n,i])},lineStart:function(){n.push(t=[])},lineEnd:h,rejoin:function(){n.length>1&&n.push(n.pop().concat(n.shift()))},result:function(){var i=n;return n=[],t=null,i}}},ra=function(n,t,i,r,u,f){var e,l=n[0],a=n[1],v=t[0],y=t[1],o=0,s=1,h=v-l,c=y-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}}}}},uu=function(n,t){return o(n[0]-t[0])<u&&o(n[1]-t[1])<u},rh=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(uu(i,f)){for(u.lineStart(),e=0;e<r;++e)u.point((i=n[e])[0],i[1]);return void u.lineEnd()}h.push(t=new ur(i,n,null,!0));s.push(t.o=new ur(i,null,t,!1));h.push(t=new ur(f,n,null,!1));s.push(t.o=new ur(f,null,t,!0))}}),h.length){for(s.sort(t),oo(h),oo(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}f=f.o;o=f.z;c=!c}while(!f.v);u.lineEnd()}}},ai=1e9,fu=-ai,ua=function(){var n,t,e,i=0,r=0,u=960,f=500;return e={stream:function(e){return n&&t===e?n:n=gu(i,r,u,f)(t=e)},extent:function(o){return arguments.length?(i=+o[0][0],r=+o[0][1],u=+o[1][0],f=+o[1][1],n=t=null,e):[[i,r],[u,f]]}}},gf=at(),uh=function(n,t){var s=t[0],ft=t[1],wt=[i(s),-r(s),0],v=0,et=0,h,ot,o,rt,ut;for(gf.reset(),h=0,ot=n.length;h<ot;++h)if(p=(y=n[h]).length)for(var y,p,c=y[p-1],w=c[0],st=c[1]/2+kr,ht=i(st),ct=r(st),g=0;g<p;++g,w=nt,ht=at,ct=vt,c=l){var l=y[g],nt=l[0],lt=l[1]/2+kr,at=i(lt),vt=r(lt),f=nt-w,tt=f>=0?1:-1,it=tt*f,a=it>e,pt=ht*at;(gf.add(b(pt*tt*i(it),ct*vt+pt*r(it))),v+=a?f+tt*k:f,a^w>=s^nt>=s)&&(o=kt(yt(c),yt(l)),rr(o),rt=kt(wt,o),rr(rt),ut=(a^f>=0?-1:1)*d(rt[2]),(ft>ut||ft===ut&&(o[0]||o[1]))&&(et+=a^f>=0?1:-1))}return(v<-u||v<u&&gf<-u)^1&et},ne=at(),ti={sphere:h,point:h,lineStart:wc,lineEnd:h,polygonStart:h,polygonEnd:h},fh=function(n){return ne.reset(),rt(n,ti),+ne},te=[null,null],fa={type:"LineString",coordinates:te},vi=function(n,t){return te[0]=n,te[1]=t,fh(fa)},eh={Feature:function(n,t){return fr(n.geometry,t)},FeatureCollection:function(n,t){for(var i=n.features,r=-1,u=i.length;++r<u;)if(fr(i[r].geometry,t))return!0;return!1}},oh={Sphere:function(){return!0},Point:function(n,t){return so(n.coordinates,t)},MultiPoint:function(n,t){for(var i=n.coordinates,r=-1,u=i.length;++r<u;)if(so(i[r],t))return!0;return!1},LineString:function(n,t){return ho(n.coordinates,t)},MultiLineString:function(n,t){for(var i=n.coordinates,r=-1,u=i.length;++r<u;)if(ho(i[r],t))return!0;return!1},Polygon:function(n,t){return co(n.coordinates,t)},MultiPolygon:function(n,t){for(var i=n.coordinates,r=-1,u=i.length;++r<u;)if(co(i[r],t))return!0;return!1},GeometryCollection:function(n,t){for(var i=n.geometries,r=-1,u=i.length;++r<u;)if(fr(i[r],t))return!0;return!1}},ea=function(n,t){return(n&&eh.hasOwnProperty(n.type)?eh[n.type]:fr)(n,t)},oa=function(n,t){var e=n[0]*f,o=n[1]*f,h=t[0]*f,c=t[1]*f,l=r(o),w=i(o),a=r(c),k=i(c),g=l*r(e),nt=l*i(e),tt=a*r(h),it=a*i(h),u=2*d(v(ae(c-o)+l*a*ae(h-e))),y=i(u),p=u?function(n){var t=i(n*=u)/y,r=i(u-n)/y,f=r*g+t*tt,e=r*nt+t*it,o=r*w+t*k;return[b(e,f)*s,b(o,v(f*f+e*e))*s]}:function(){return[e*s,o*s]};return p.distance=u,p},bt=function(n){return n},ie=at(),re=at(),ct={point:h,lineStart:h,lineEnd:h,polygonStart:function(){ct.lineStart=tl;ct.lineEnd=rl},polygonEnd:function(){ct.lineStart=ct.lineEnd=ct.point=h;ie.add(o(re));re.reset()},result:function(){var n=ie/2;return ie.reset(),n}},ii=1/0,eu=ii,yi=-ii,ou=yi,su={point:ul,lineStart:h,lineEnd:h,polygonStart:h,polygonEnd:h,result:function(){var n=[[ii,eu],[yi,ou]];return yi=ou=-(eu=ii=1/0),n}},ue=0,fe=0,pi=0,hu=0,cu=0,ri=0,ee=0,oe=0,wi=0,it={point:pt,lineStart:wo,lineEnd:bo,polygonStart:function(){it.lineStart=ol;it.lineEnd=sl},polygonEnd:function(){it.point=pt;it.lineStart=wo;it.lineEnd=bo},result:function(){var n=wi?[ee/wi,oe/wi]:ri?[hu/ri,cu/ri]:pi?[ue/pi,fe/pi]:[NaN,NaN];return ue=fe=pi=hu=cu=ri=ee=oe=wi=0,n}};go.prototype={_radius:4.5,pointRadius:function(n){return this._radius=n,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath();this._point=NaN},point:function(n,t){switch(this._point){case 0:this._context.moveTo(n,t);this._point=1;break;case 1:this._context.lineTo(n,t);break;default:this._context.moveTo(n+this._radius,t);this._context.arc(n,t,this._radius,0,k)}},result:h};lu=at();ui={point:h,lineStart:function(){ui.point=cl},lineEnd:function(){se&&ns(sh,hh);ui.point=h},polygonStart:function(){se=!0},polygonEnd:function(){se=null},result:function(){var n=+lu;return lu.reset(),n}};ts.prototype={_radius:4.5,_circle:is(4.5),pointRadius:function(n){return(n=+n)!==this._radius&&(this._radius=n,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z");this._point=NaN},point:function(n,t){switch(this._point){case 0:this._string.push("M",n,",",t);this._point=1;break;case 1:this._string.push("L",n,",",t);break;default:null==this._circle&&(this._circle=is(this._radius));this._string.push("M",n,",",t,this._circle)}},result:function(){if(this._string.length){var n=this._string.join("");return this._string=[],n}return null}};var sa=function(n,t){function i(n){return n&&("function"==typeof f&&u.pointRadius(+f.apply(this,arguments)),rt(n,r(u))),u.result()}var r,u,f=4.5;return i.area=function(n){return rt(n,r(ct)),ct.result()},i.measure=function(n){return rt(n,r(ui)),ui.result()},i.bounds=function(n){return rt(n,r(su)),su.result()},i.centroid=function(n){return rt(n,r(it)),it.result()},i.projection=function(t){return arguments.length?(r=null==t?(n=null,bt):(n=t).stream,i):n},i.context=function(n){return arguments.length?(u=null==n?(t=null,new ts):new go(t=n),"function"!=typeof f&&u.pointRadius(f),i):t},i.pointRadius=function(n){return arguments.length?(f="function"==typeof n?n:(u.pointRadius(+n),+n),i):f},i.projection(n).context(t)},ch=function(n,i,r,u){return function(f,e){function v(t,i){var r=f(t,i);n(t=r[0],i=r[1])&&e.point(t,i)}function d(n,t){var i=f(n,t);y.point(i[0],i[1])}function p(){o.point=d;y.lineStart()}function w(){o.point=v;y.lineEnd()}function b(n,t){c.push([n,t]);var i=f(n,t);a.point(i[0],i[1])}function g(){a.lineStart();c=[]}function nt(){b(c[0][0],c[0][1]);a.lineEnd();var t,r,i,u,f=a.clean(),n=k.result(),o=n.length;if(c.pop(),l.push(c),c=null,o)if(1&f){if(i=n[0],(r=i.length-1)>0){for(s||(e.polygonStart(),s=!0),e.lineStart(),t=0;t<r;++t)e.point((u=i[t])[0],u[1]);e.lineEnd()}}else o>1&&2&f&&n.push(n.pop().concat(n.shift())),h.push(n.filter(ll))}var l,h,c,y=i(e),tt=f.invert(u[0],u[1]),k=ih(),a=i(k),s=!1,o={point:v,lineStart:p,lineEnd:w,polygonStart:function(){o.point=b;o.lineStart=g;o.lineEnd=nt;h=[];l=[]},polygonEnd:function(){o.point=v;o.lineStart=p;o.lineEnd=w;h=t.merge(h);var n=uh(l,tt);h.length?(s||(e.polygonStart(),s=!0),rh(h,al,n,r,e)):n&&(s||(e.polygonStart(),s=!0),e.lineStart(),r(null,null,1,e),e.lineEnd());s&&(e.polygonEnd(),s=!1);h=l=null},sphere:function(){e.polygonStart();e.lineStart();r(null,null,1,e);e.lineEnd();e.polygonEnd()}};return o}},lh=ch(function(){return!0},vl,pl,[-e,-a]),ha=function(n,t){function l(i,r,u,f){fo(f,n,t,u,i,r)}function h(n,t){return r(n)*r(t)>i}function a(n){var t,l,i,o,r;return{lineStart:function(){o=i=!1;r=1},point:function(a,v){var w,p=[a,v],b=h(a,v),d=f?b?0:c(a,v):b?c(a+(a<0?e:-e),v):0,k;(!t&&(o=i=b)&&n.lineStart(),b!==i&&(!(w=s(t,p))||uu(t,w)||uu(p,w))&&(p[0]+=u,p[1]+=u,b=h(p[0],p[1])),b!==i)?(r=0,b?(n.lineStart(),w=s(p,t),n.point(w[0],w[1])):(w=s(t,p),n.point(w[0],w[1]),n.lineEnd()),t=w):y&&t&&f^b&&(d&l||!(k=s(p,t,!0))||(r=0,f?(n.lineStart(),n.point(k[0][0],k[0][1]),n.point(k[1][0],k[1][1]),n.lineEnd()):(n.point(k[1][0],k[1][1]),n.lineEnd(),n.lineStart(),n.point(k[0][0],k[0][1]))));!b||t&&uu(t,p)||n.point(p[0],p[1]);t=p;i=b;l=d},lineEnd:function(){i&&n.lineEnd();t=null},clean:function(){return r|(o&&i)<<1}}}function s(n,t,r){var ot=yt(n),st=yt(t),ut=[1,0,0],a=kt(ot,st),ft=tr(a,a),k=a[0],d=ft-k*k,nt,f,rt;if(!d)return!r&&n;var ht=i*ft/d,ct=-i*k/d,lt=kt(ut,a),s=ir(ut,ht);pu(s,ir(a,ct));var y=lt,w=tr(s,y),g=tr(y,y),et=w*w-g*(tr(s,s)-1);if(!(et<0)){if(nt=v(et),f=ir(y,(-w-nt)/g),pu(f,s),f=nr(f),!r)return f;var b,h=n[0],p=t[0],c=n[1],l=t[1];p<h&&(b=h,h=p,p=b);var tt=p-h,it=o(tt-e)<u,at=it||tt<u;if(!it&&l<c&&(b=c,c=l,l=b),at?it?c+l>0^f[1]<(o(f[0]-h)<u?c:l):c<=f[1]&&f[1]<=l:tt>e^(h<=f[0]&&f[0]<=p))return rt=ir(y,(-w+nt)/g),pu(rt,s),[f,nr(rt)]}}function c(t,i){var u=f?n:e-n,r=0;return t<-u?r|=1:t>u&&(r|=2),i<-u?r|=4:i>u&&(r|=8),r}var i=r(n),f=i>0,y=o(i)>u;return ch(h,a,l,f?[0,-n]:[-e,n-e])},ca=function(n){return{stream:er(n)}};nf.prototype={constructor:nf,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 ah=16,la=r(30*f),vh=function(n,t){return+t?bl(n,t):wl(n)},aa=er({point:function(n,t){this.stream.point(n*f,t*f)}}),au=function(){return uf(rs).scale(155.424).center([0,33.6442])},yh=function(){return au().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])},va=function(){function n(n){var t=n[0],r=n[1];return i=null,c.point(t,r),i||(l.point(t,r),i)||(a.point(t,r),i)}function h(){return e=o=null,n}var e,o,c,l,a,i,t=yh(),r=au().rotate([154,0]).center([-2,58.5]).parallels([55,65]),f=au().rotate([157,0]).center([-3,19.9]).parallels([8,18]),s={point:function(n,t){i=[n,t]}};return n.invert=function(n){var e=t.scale(),o=t.translate(),i=(n[0]-o[0])/e,u=(n[1]-o[1])/e;return(u>=.12&&u<.234&&i>=-.425&&i<-.214?r:u>=.166&&u<.234&&i>=-.214&&i<-.115?f:t).invert(n)},n.stream=function(n){return e&&o===n?e:e=dl([t.stream(o=n),r.stream(n),f.stream(n)])},n.precision=function(n){return arguments.length?(t.precision(n),r.precision(n),f.precision(n),h()):t.precision()},n.scale=function(i){return arguments.length?(t.scale(i),r.scale(.35*i),f.scale(i),n.translate(t.translate())):t.scale()},n.translate=function(n){if(!arguments.length)return t.translate();var i=t.scale(),e=+n[0],o=+n[1];return c=t.translate(n).clipExtent([[e-.455*i,o-.238*i],[e+.455*i,o+.238*i]]).stream(s),l=r.translate([e-.307*i,o+.201*i]).clipExtent([[e-.425*i+u,o+.12*i+u],[e-.214*i-u,o+.234*i-u]]).stream(s),a=f.translate([e-.205*i,o+.212*i]).clipExtent([[e-.214*i+u,o+.166*i+u],[e-.115*i-u,o+.234*i-u]]).stream(s),h()},n.fitExtent=function(t,i){return or(n,t,i)},n.fitSize=function(t,i){return tf(n,t,i)},n.scale(1070)},he=us(function(n){return v(2/(1+n))});he.invert=ei(function(n){return 2*d(n/2)});ph=function(){return lt(he).scale(124.75).clipAngle(179.999)};vu=us(function(n){return(n=le(n))&&n/i(n)});vu.invert=ei(function(n){return n});wh=function(){return lt(vu).scale(79.4188).clipAngle(179.999)};oi.invert=function(n,t){return[n,2*gt(ys(t))-a]};bh=function(){return fs(oi).scale(961/k)};kh=function(){return uf(es).scale(109.5).parallels([30,30])};si.invert=si;dh=function(){return lt(si).scale(152.63)};gh=function(){return uf(os).scale(131.154).center([0,13.9389])};ff.invert=ei(gt);nc=function(){return lt(ff).scale(144.049).clipAngle(60)};tc=function(){function t(){return o=v=null,s}var c,l,a,o,v,s,n=1,i=0,r=0,u=1,f=1,e=bt,h=null,y=bt;return s={stream:function(n){return o&&v===n?o:o=e(y(v=n))},clipExtent:function(n){return arguments.length?(y=null==n?(h=c=l=a=null,bt):gu(h=+n[0][0],c=+n[0][1],l=+n[1][0],a=+n[1][1]),t()):null==h?null:[[h,c],[l,a]]},scale:function(o){return arguments.length?(e=hr((n=+o)*u,n*f,i,r),t()):n},translate:function(o){return arguments.length?(e=hr(n*u,n*f,i=+o[0],r=+o[1]),t()):[i,r]},reflectX:function(o){return arguments.length?(e=hr(n*(u=o?-1:1),n*f,i,r),t()):u<0},reflectY:function(o){return arguments.length?(e=hr(n*u,n*(f=o?-1:1),i,r),t()):f<0},fitExtent:function(n,t){return or(s,n,t)},fitSize:function(n,t){return tf(s,n,t)}}};ef.invert=ei(d);ic=function(){return lt(ef).scale(249.5).clipAngle(90+u)};of.invert=ei(function(n){return 2*gt(n)});rc=function(){return lt(of).scale(250).clipAngle(142)};sf.invert=function(n,t){return[-t,2*gt(ys(n))-a]};uc=function(){var n=fs(sf),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.geoArea=gl;n.geoBounds=na;n.geoCentroid=ta;n.geoCircle=ia;n.geoClipExtent=ua;n.geoContains=ea;n.geoDistance=vi;n.geoGraticule=yo;n.geoGraticule10=nl;n.geoInterpolate=oa;n.geoLength=fh;n.geoPath=sa;n.geoAlbers=yh;n.geoAlbersUsa=va;n.geoAzimuthalEqualArea=ph;n.geoAzimuthalEqualAreaRaw=he;n.geoAzimuthalEquidistant=wh;n.geoAzimuthalEquidistantRaw=vu;n.geoConicConformal=kh;n.geoConicConformalRaw=es;n.geoConicEqualArea=au;n.geoConicEqualAreaRaw=rs;n.geoConicEquidistant=gh;n.geoConicEquidistantRaw=os;n.geoEquirectangular=dh;n.geoEquirectangularRaw=si;n.geoGnomonic=nc;n.geoGnomonicRaw=ff;n.geoIdentity=tc;n.geoProjection=lt;n.geoProjectionMutator=rf;n.geoMercator=bh;n.geoMercatorRaw=oi;n.geoOrthographic=ic;n.geoOrthographicRaw=ef;n.geoStereographic=rc;n.geoStereographicRaw=of;n.geoTransverseMercator=uc;n.geoTransverseMercatorRaw=sf;n.geoRotation=th;n.geoStream=rt;n.geoTransform=ca;Object.defineProperty(n,"__esModule",{value:!0})})},{"d3-array":174}],176:[function(t,i,r){!function(t,u){"object"==typeof r&&void 0!==i?u(r):"function"==typeof n&&n.amd?n(["exports"],u):u(t.jsts=t.jsts||{})}(this,function(n){"use strict";function i(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])}function as(){}function ct(){}function v(){}function sr(){}function ph(){}function ve(){}function ir(){}function ci(n){this.name="RuntimeException";this.message=n;this.stack=(new Error).stack;Error.call(this,n)}function y(n,t){n.prototype=Object.create(t.prototype);n.prototype.constructor=n}function lo(){if(0===arguments.length)ci.call(this);else if(1===arguments.length){var n=arguments[0];ci.call(this,n)}}function c(){}function r(){var n,t,i;if(this.x=null,this.y=null,this.z=null,0===arguments.length)r.call(this,0,0);else if(1===arguments.length)n=arguments[0],r.call(this,n.x,n.y,n.z);else if(2===arguments.length)t=arguments[0],i=arguments[1],r.call(this,t,i,r.NULL_ORDINATE);else if(3===arguments.length){var u=arguments[0],f=arguments[1],e=arguments[2];this.x=u;this.y=f;this.z=e}}function ye(){if(this.dimensionsToTest=2,0===arguments.length)ye.call(this,2);else if(1===arguments.length){var n=arguments[0];if(2!==n&&3!==n)throw new ct("only 2 or 3 dimensions may be specified");this.dimensionsToTest=n}}function wh(){}function yt(){}function gy(n){this.message=n||""}function ei(){}function vs(n){this.message=n||""}function bh(n){this.message=n||""}function u(){this.array_=[];arguments[0]instanceof yt&&this.addAll(arguments[0])}function ii(){var n,t,i;(u.apply(this),0===arguments.length)||(1===arguments.length?(n=arguments[0],this.ensureCapacity(n.length),this.add(n,!0)):2===arguments.length&&(t=arguments[0],i=arguments[1],this.ensureCapacity(t.length),this.add(t,i)))}function p(){var n,u,t,i;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 r?(n=arguments[0],this.init(n.x,n.x,n.y,n.y)):arguments[0]instanceof p&&(u=arguments[0],this.init(u));else if(2===arguments.length)t=arguments[0],i=arguments[1],this.init(t.x,i.x,t.y,i.y);else if(4===arguments.length){var f=arguments[0],e=arguments[1],o=arguments[2],s=arguments[3];this.init(f,e,o,s)}}function ra(){}function vf(){ra.call(this,"Projective point not representable on the Cartesian plane.")}function t(){}function l(n,t){return n.interfaces_&&n.interfaces_().indexOf(t)>-1}function br(){}function eu(n){this.str=n}function vu(n){this.value=n}function kh(){}function f(){var n,t,i,r,u;(this.hi=0,this.lo=0,0===arguments.length)?this.init(0):1===arguments.length?"number"==typeof arguments[0]?(n=arguments[0],this.init(n)):arguments[0]instanceof f?(t=arguments[0],this.init(t)):"string"==typeof arguments[0]&&(i=arguments[0],f.call(this,f.parse(i))):2===arguments.length&&(r=arguments[0],u=arguments[1],this.init(r,u))}function rr(){}function lt(){}function pt(){}function hr(){var h,c,l,n,t,i,u;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)h=arguments[0],this.x=h.x,this.y=h.y,this.w=1;else if(2===arguments.length)"number"==typeof arguments[0]&&"number"==typeof arguments[1]?(c=arguments[0],l=arguments[1],this.x=c,this.y=l,this.w=1):arguments[0]instanceof hr&&arguments[1]instanceof hr?(n=arguments[0],t=arguments[1],this.x=n.y*t.w-t.y*n.w,this.y=t.x*n.w-n.x*t.w,this.w=n.x*t.y-t.x*n.y):arguments[0]instanceof r&&arguments[1]instanceof r&&(i=arguments[0],u=arguments[1],this.x=i.y-u.y,this.y=u.x-i.x,this.w=i.x*u.y-u.x*i.y);else if(3===arguments.length){var k=arguments[0],d=arguments[1],g=arguments[2];this.x=k;this.y=d;this.w=g}else if(4===arguments.length){var f=arguments[0],e=arguments[1],o=arguments[2],s=arguments[3],a=f.y-e.y,v=e.x-f.x,y=f.x*e.y-e.x*f.y,p=o.y-s.y,w=s.x-o.x,b=o.x*s.y-s.x*o.y;this.x=v*b-w*y;this.y=p*y-a*b;this.w=a*w-p*v}}function ua(){}function yu(){}function h(){this.envelope=null;this.factory=null;this.SRID=null;this.userData=null;var n=arguments[0];this.factory=n;this.SRID=n.getSRID()}function pe(){}function oi(){}function fa(){}function ea(){}function oa(){}function sa(){}function w(){}function np(){}function tp(){}function ao(){}function nb(){}function ha(){}function li(){this.array_=[];arguments[0]instanceof yt&&this.addAll(arguments[0])}function tb(n){return null==n?hf:n.color}function at(n){return null==n?null:n.parent}function yf(n,t){null!==n&&(n.color=t)}function ip(n){return null==n?null:n.left}function ib(n){return null==n?null:n.right}function ui(){this.root_=null;this.size_=0}function ca(){}function rb(){}function di(){this.array_=[];arguments[0]instanceof yt&&this.addAll(arguments[0])}function pf(){}function e(){}function wf(){}function vo(){}function nt(){this.geometries=null;var n=arguments[0],t=arguments[1];if(h.call(this,t),null===n&&(n=[]),h.hasNullElements(n))throw new ct("geometries must not contain null elements");this.geometries=n}function cr(){var n=arguments[0],t=arguments[1];nt.call(this,n,t)}function ee(){var t,n,i;(this.geom=null,this.geomFact=null,this.bnRule=null,this.endpointMap=null,1===arguments.length)?(t=arguments[0],ee.call(this,t,oi.MOD2_BOUNDARY_RULE)):2===arguments.length&&(n=arguments[0],i=arguments[1],this.geom=n,this.geomFact=n.getFactory(),this.bnRule=i)}function rp(){this.count=null}function fk(){}function ek(){}function ok(){}function sk(){}function hk(){}function ck(){}function kr(){}function ri(){}function d(){this.points=null;var n=arguments[0],t=arguments[1];h.call(this,t);this.init(n)}function la(){}function bt(){this.coordinates=null;var n=arguments[0],t=arguments[1];h.call(this,t);this.init(n)}function bf(){}function st(){this.shell=null;this.holes=null;var t=arguments[0],n=arguments[1],i=arguments[2];if(h.call(this,i),null===t&&(t=this.getFactory().createLinearRing()),null===n&&(n=[]),h.hasNullElements(n))throw new ct("holes must not contain null elements");if(t.isEmpty()&&h.hasNonEmptyElements(n))throw new ct("shell is empty but holes are not");this.shell=t;this.holes=n}function lr(){var n=arguments[0],t=arguments[1];nt.call(this,n,t)}function gt(){var t,n,i,u;arguments[0]instanceof r&&arguments[1]instanceof g?(t=arguments[0],n=arguments[1],gt.call(this,n.getCoordinateSequenceFactory().create(t),n)):l(arguments[0],lt)&&arguments[1]instanceof g&&(i=arguments[0],u=arguments[1],d.call(this,i,u),this.validateConstruction())}function ai(){var n=arguments[0],t=arguments[1];nt.call(this,n,t)}function dr(){if((this.factory=null,this.isUserDataCopied=!1,0!==arguments.length)&&1===arguments.length){var n=arguments[0];this.factory=n}}function aa(){}function up(){}function fp(){}function ep(){}function gr(){var e,i,t,u,o,f,s,n;if(this.dimension=3,this.coordinates=null,1===arguments.length){if(arguments[0]instanceof Array)e=arguments[0],gr.call(this,e,3);else if(Number.isInteger(arguments[0]))for(i=arguments[0],this.coordinates=new Array(i).fill(null),n=0;n<i;n++)this.coordinates[n]=new r;else if(l(arguments[0],lt)){if(t=arguments[0],null===t)return this.coordinates=new Array(0).fill(null),null;for(this.dimension=t.getDimension(),this.coordinates=new Array(t.size()).fill(null),n=0;n<this.coordinates.length;n++)this.coordinates[n]=t.getCoordinateCopy(n)}}else if(2===arguments.length)if(arguments[0]instanceof Array&&Number.isInteger(arguments[1]))u=arguments[0],o=arguments[1],this.coordinates=u,this.dimension=o,null===u&&(this.coordinates=new Array(0).fill(null));else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1]))for(f=arguments[0],s=arguments[1],this.coordinates=new Array(f).fill(null),this.dimension=s,n=0;n<f;n++)this.coordinates[n]=new r}function oe(){}function lk(n,t){return n===t||n!==n&&t!==t}function ak(n){this.add?n.forEach(this.add,this):n.forEach(function(n){this.set(n[0],n[1])},this)}function vk(n){return this.has(n)&&(this._keys.splice(cf,1),this._values.splice(cf,1),this._itp.forEach(function(n){cf<n[0]&&n[0]--})),cf>-1}function yk(n){if(this.has(n))return this._values[cf]}function pk(n,t){if(this.objectOnly&&t!==Object(t))throw new TypeError("Invalid value used as weak collection key");if(t!==t||0===t)for(cf=n.length;cf--&&!lk(n[cf],t););else cf=n.indexOf(t);return cf>-1}function wk(n){return pk.call(this,this._keys,n)}function bk(n,t){return this.has(n)?this._values[cf]=t:this._values[this._keys.push(n)-1]=t,this}function kk(){(this._keys||0).length=this._values.length=0}function dk(){return op(this._itp,this._keys)}function gk(){return op(this._itp,this._values)}function nd(){return op(this._itp,this._keys,this._values)}function op(n,t,i){var r=[0],u=!1;return n.push(r),{next:function(){var e,f=r[0];return!u&&f<t.length?(e=i?[t[f],i[f]]:t[f],r[0]++):(u=!0,n.splice(n.indexOf(r),1)),{done:u,value:e}}}}function td(){return this._values.length}function id(n,t){for(var i,r=this.entries();;){if(i=r.next(),i.done)break;n.call(t,i.value[1],i.value[0],this)}}function kf(){this.map_=new od}function ft(){var n,i,t;(this.modelType=null,this.scale=null,0===arguments.length)?this.modelType=ft.FLOATING:1===arguments.length&&(arguments[0]instanceof nf?(n=arguments[0],this.modelType=n,n===ft.FIXED&&this.setScale(1)):"number"==typeof arguments[0]?(i=arguments[0],this.modelType=ft.FIXED,this.setScale(i)):arguments[0]instanceof ft&&(t=arguments[0],this.modelType=t.modelType,this.scale=t.scale))}function nf(){this.name=null;var n=arguments[0];this.name=n;nf.nameToTypeMap.put(n,this)}function g(){var n,t,i,r;if(this.precisionModel=null,this.coordinateSequenceFactory=null,this.SRID=null,0===arguments.length)g.call(this,new ft,0);else if(1===arguments.length)l(arguments[0],ua)?(n=arguments[0],g.call(this,new ft,0,n)):arguments[0]instanceof ft&&(t=arguments[0],g.call(this,t,0,g.getDefaultCoordinateSequenceFactory()));else if(2===arguments.length)i=arguments[0],r=arguments[1],g.call(this,i,r,g.getDefaultCoordinateSequenceFactory());else if(3===arguments.length){var u=arguments[0],f=arguments[1],e=arguments[2];this.precisionModel=u;this.coordinateSequenceFactory=e;this.SRID=f}}function sp(n){this.geometryFactory=n||new g}function pi(n){this.parser=new sp(n)}function ht(){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 r;this.intPt[1]=new r;this.pa=this.intPt[0];this.pb=this.intPt[1];this.result=0}function si(){ht.apply(this)}function yo(){}function po(){this.p=null;this.crossingCount=0;this.isPointOnSegment=!1;var n=arguments[0];this.p=n}function s(){}function b(){var n,t,i;if(this.p0=null,this.p1=null,0===arguments.length)b.call(this,new r,new r);else if(1===arguments.length)n=arguments[0],b.call(this,n.p0,n.p1);else if(2===arguments.length)t=arguments[0],i=arguments[1],this.p0=t,this.p1=i;else if(4===arguments.length){var u=arguments[0],f=arguments[1],e=arguments[2],o=arguments[3];b.call(this,new r(u,f),new r(e,o))}}function ot(){var i,n;(this.matrix=null,0===arguments.length)?(this.matrix=Array(3).fill().map(function(){return Array(3)}),this.setAll(e.FALSE)):1===arguments.length&&("string"==typeof arguments[0]?(i=arguments[0],ot.call(this),this.set(i)):arguments[0]instanceof ot&&(n=arguments[0],ot.call(this),this.matrix[t.INTERIOR][t.INTERIOR]=n.matrix[t.INTERIOR][t.INTERIOR],this.matrix[t.INTERIOR][t.BOUNDARY]=n.matrix[t.INTERIOR][t.BOUNDARY],this.matrix[t.INTERIOR][t.EXTERIOR]=n.matrix[t.INTERIOR][t.EXTERIOR],this.matrix[t.BOUNDARY][t.INTERIOR]=n.matrix[t.BOUNDARY][t.INTERIOR],this.matrix[t.BOUNDARY][t.BOUNDARY]=n.matrix[t.BOUNDARY][t.BOUNDARY],this.matrix[t.BOUNDARY][t.EXTERIOR]=n.matrix[t.BOUNDARY][t.EXTERIOR],this.matrix[t.EXTERIOR][t.INTERIOR]=n.matrix[t.EXTERIOR][t.INTERIOR],this.matrix[t.EXTERIOR][t.BOUNDARY]=n.matrix[t.EXTERIOR][t.BOUNDARY],this.matrix[t.EXTERIOR][t.EXTERIOR]=n.matrix[t.EXTERIOR][t.EXTERIOR]))}function df(){this.areaBasePt=null;this.triangleCent3=new r;this.areasum2=0;this.cg3=new r;this.lineCentSum=new r;this.totalLength=0;this.ptCount=0;this.ptCentSum=new r;var n=arguments[0];this.areaBasePt=null;this.add(n)}function va(n){this.message=n||""}function gi(){this.array_=[]}function ys(){this.treeSet=new di;this.list=new u}function gf(){var n,t,i;(this.geomFactory=null,this.inputPts=null,1===arguments.length)?(n=arguments[0],gf.call(this,gf.extractCoordinates(n),n.getFactory())):2===arguments.length&&(t=arguments[0],i=arguments[1],this.inputPts=ys.filterCoordinates(t),this.geomFactory=i)}function ps(){this.origin=null;var n=arguments[0];this.origin=n}function ur(){this.inputGeom=null;this.factory=null;this.pruneEmptyGeometry=!0;this.preserveGeometryCollectionType=!0;this.preserveCollections=!1;this.preserveType=!1}function ws(){var t,i,n,r;(this.snapTolerance=0,this.srcPts=null,this.seg=new b,this.allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof d&&"number"==typeof arguments[1])?(t=arguments[0],i=arguments[1],ws.call(this,t.getCoordinates(),i)):arguments[0]instanceof Array&&"number"==typeof arguments[1]&&(n=arguments[0],r=arguments[1],this.srcPts=n,this._isClosed=ws.isClosed(n),this.snapTolerance=r)}function nr(){this.srcGeom=null;var n=arguments[0];this.srcGeom=n}function dh(){var n,t;if(ur.apply(this),this.snapTolerance=null,this.snapPts=null,this.isSelfSnap=!1,2===arguments.length)n=arguments[0],t=arguments[1],this.snapTolerance=n,this.snapPts=t;else if(3===arguments.length){var i=arguments[0],r=arguments[1],u=arguments[2];this.snapTolerance=i;this.snapPts=r;this.isSelfSnap=u}}function nu(){this.isFirst=!0;this.commonMantissaBitsCount=53;this.commonBits=0;this.commonSignExp=null}function gh(){this.commonCoord=null;this.ccFilter=new ya}function ya(){this.commonBitsX=new nu;this.commonBitsY=new nu}function nc(){this.trans=null;var n=arguments[0];this.trans=n}function wo(){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()}function bo(){if((this.boundaryRule=oi.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 ct("Rule must be non-null");this.boundaryRule=n}}function bs(){}function tc(){}function hp(){this.pts=null;this.data=null;var n=arguments[0],t=arguments[1];this.pts=n;this.data=t}function pa(){}function ne(){this.bounds=null;this.item=null;var n=arguments[0],t=arguments[1];this.bounds=n;this.item=t}function cp(){this._size=null;this.items=null;this._size=0;this.items=new u;this.items.add(null)}function we(){}function wa(){}function tr(){if((this.childBoundables=new u,this.bounds=null,this.level=null,0!==arguments.length)&&1===arguments.length){var n=arguments[0];this.level=n}}function fr(){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()}function ni(){if(this.root=null,this.built=!1,this.itemBoundables=new u,this.nodeCapacity=null,0===arguments.length)ni.call(this,ni.DEFAULT_NODE_CAPACITY);else if(1===arguments.length){var n=arguments[0];c.isTrue(n>1,"Node capacity must be greater than 1");this.nodeCapacity=n}}function rd(){}function ba(){}function kt(){if(0===arguments.length)kt.call(this,kt.DEFAULT_NODE_CAPACITY);else if(1===arguments.length){var n=arguments[0];ni.call(this,n)}}function ic(){var n=arguments[0];tr.call(this,n)}function er(){}function lp(){this.segString=null;this.coord=null;this.segmentIndex=null;this.segmentOctant=null;this._isInterior=null;var n=arguments[0],t=arguments[1],i=arguments[2],u=arguments[3];this.segString=n;this.coord=new r(t);this.segmentIndex=i;this.segmentOctant=u;this._isInterior=!t.equals2D(n.getCoordinate(i))}function ap(){this.nodeMap=new ui;this.edge=null;var n=arguments[0];this.edge=n}function ub(){this.nodeList=null;this.edge=null;this.nodeIt=null;this.currNode=null;this.nextNode=null;this.currSegIndex=0;var n=arguments[0];this.nodeList=n;this.edge=n.getEdge();this.nodeIt=n.iterator();this.readNextNode()}function vp(){}function tf(){this.nodeList=new ap(this);this.pts=null;this.data=null;var n=arguments[0],t=arguments[1];this.pts=n;this.data=t}function rc(){this.tempEnv1=new p;this.tempEnv2=new p;this.overlapSeg1=new b;this.overlapSeg2=new b}function yp(){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}function it(){}function pu(){}function uc(){}function ka(){if((this.segInt=null,0!==arguments.length)&&1===arguments.length){var n=arguments[0];this.setSegmentIntersector(n)}}function be(){if((this.monoChains=new u,this.index=new kt,this.idCounter=0,this.nodedSegStrings=null,this.nOverlaps=0,0!==arguments.length)&&1===arguments.length){var n=arguments[0];ka.call(this,n)}}function fc(){rc.apply(this);this.si=null;var n=arguments[0];this.si=n}function ar(){var t,i,n;(this.pt=null,1===arguments.length)?(t=arguments[0],ci.call(this,t)):2===arguments.length&&(i=arguments[0],n=arguments[1],ci.call(this,ar.msgWithCoord(i,n)),this.name="TopologyException",this.pt=new r(n))}function ec(){}function se(){this.findAllIntersections=!1;this.isCheckEndSegmentsOnly=!1;this.li=null;this.interiorIntersection=null;this.intSegments=null;this.intersections=new u;this.intersectionCount=0;this.keepIntersections=!0;var n=arguments[0];this.li=n;this.interiorIntersection=null}function oc(){this.li=new si;this.segStrings=null;this.findAllIntersections=!1;this.segInt=null;this._isValid=!0;var n=arguments[0];this.segStrings=n}function ko(){this.nv=null;var n=arguments[0];this.nv=new oc(ko.toSegmentStrings(n))}function ks(){this.mapOp=null;var n=arguments[0];this.mapOp=n}function o(){}function vr(){var i,r,t,n;if(this.location=null,1===arguments.length){if(arguments[0]instanceof Array)i=arguments[0],this.init(i.length);else if(Number.isInteger(arguments[0]))r=arguments[0],this.init(1),this.location[o.ON]=r;else if(arguments[0]instanceof vr&&(t=arguments[0],this.init(t.location.length),null!==t))for(n=0;n<this.location.length;n++)this.location[n]=t.location[n]}else if(3===arguments.length){var u=arguments[0],f=arguments[1],e=arguments[2];this.init(3);this.location[o.ON]=u;this.location[o.LEFT]=f;this.location[o.RIGHT]=e}}function ti(){var n,i,r,u;if(this.elt=new Array(2).fill(null),1===arguments.length)Number.isInteger(arguments[0])?(n=arguments[0],this.elt[0]=new vr(n),this.elt[1]=new vr(n)):arguments[0]instanceof ti&&(i=arguments[0],this.elt[0]=new vr(i.elt[0]),this.elt[1]=new vr(i.elt[1]));else if(2===arguments.length)r=arguments[0],u=arguments[1],this.elt[0]=new vr(t.NONE),this.elt[1]=new vr(t.NONE),this.elt[r].setLocation(u);else if(3===arguments.length){var f=arguments[0],e=arguments[1],o=arguments[2];this.elt[0]=new vr(f,e,o);this.elt[1]=new vr(f,e,o)}else if(4===arguments.length){var s=arguments[0],h=arguments[1],c=arguments[2],l=arguments[3];this.elt[0]=new vr(t.NONE,t.NONE,t.NONE);this.elt[1]=new vr(t.NONE,t.NONE,t.NONE);this.elt[s].setLocations(h,c,l)}}function ds(){this.startDe=null;this.maxNodeDegree=-1;this.edges=new u;this.pts=new u;this.label=new ti(t.NONE);this.ring=null;this._isHole=null;this.shell=null;this.holes=new u;this.geometryFactory=null;var n=arguments[0],i=arguments[1];this.geometryFactory=i;this.computePoints(n);this.computeRing()}function da(){var n=arguments[0],t=arguments[1];ds.call(this,n,t)}function sc(){var n=arguments[0],t=arguments[1];ds.call(this,n,t)}function ke(){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}}function te(){ke.apply(this);this.coord=null;this.edges=null;var n=arguments[0],i=arguments[1];this.coord=n;this.edges=i;this.label=new ti(0,t.NONE)}function gs(){this.nodeMap=new ui;this.nodeFact=null;var n=arguments[0];this.nodeFact=n}function rf(){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];rf.call(this,t,i,r,null)}else if(4===arguments.length){var u=arguments[0],f=arguments[1],e=arguments[2],o=arguments[3];rf.call(this,u);this.init(f,e);this.label=o}}function go(){var n,t,i;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];n=arguments[0];t=arguments[1];(rf.call(this,n),this._isForward=t,t)?this.init(n.getCoordinate(0),n.getCoordinate(1)):(i=n.getNumPoints()-1,this.init(n.getCoordinate(i),n.getCoordinate(i-1)));this.computeDirectedLabel()}function ns(){}function uf(){if(this.edges=new u,this.nodes=null,this.edgeEndList=new u,0===arguments.length)this.nodes=new gs(new ns);else if(1===arguments.length){var n=arguments[0];this.nodes=new gs(n)}}function ga(){this.geometryFactory=null;this.shellList=new u;var n=arguments[0];this.geometryFactory=n}function pp(){this.op=null;this.geometryFactory=null;this.ptLocator=null;this.lineEdgesList=new u;this.resultLineList=new u;var n=arguments[0],t=arguments[1],i=arguments[2];this.op=n;this.geometryFactory=t;this.ptLocator=i}function wp(){this.op=null;this.geometryFactory=null;this.resultPointList=new u;var n=arguments[0],t=arguments[1];arguments[2];this.op=n;this.geometryFactory=t}function nv(){}function tu(){this.geom=null;var n=arguments[0];this.geom=n}function ts(){this.edgeMap=new ui;this.edgeList=null;this.ptInAreaLocation=[t.NONE,t.NONE]}function tv(){ts.apply(this);this.resultAreaEdgeList=null;this.label=null;this.SCANNING_FOR_INCOMING=1;this.LINKING_TO_OUTGOING=2}function nh(){ns.apply(this)}function bp(){this.mce=null;this.chainIndex=null;var n=arguments[0],t=arguments[1];this.mce=n;this.chainIndex=t}function ie(){var n,t;if(this.label=null,this.xValue=null,this.eventType=null,this.insertEvent=null,this.deleteEventIndex=null,this.obj=null,2===arguments.length)n=arguments[0],t=arguments[1],this.eventType=ie.DELETE,this.xValue=n,this.insertEvent=t;else if(3===arguments.length){var i=arguments[0],r=arguments[1],u=arguments[2];this.eventType=ie.INSERT;this.label=i;this.xValue=r;this.obj=u}}function iv(){}function de(){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}function rv(){iv.apply(this);this.events=new u;this.nOverlaps=null}function is(){this.min=v.POSITIVE_INFINITY;this.max=v.NEGATIVE_INFINITY}function kp(){}function uv(){is.apply(this);this.item=null;var n=arguments[0],t=arguments[1],i=arguments[2];this.min=n;this.max=t;this.item=i}function fv(){is.apply(this);this.node1=null;this.node2=null;var n=arguments[0],t=arguments[1];this.node1=n;this.node2=t;this.buildExtent(this.node1,this.node2)}function dp(){this.leaves=new u;this.root=null;this.level=0}function wi(){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)}function ev(){this.items=new u}function hc(){this.index=null;var n=arguments[0];if(!l(n,bf))throw new ct("Argument must be Polygonal");this.index=new sv(n)}function ov(){this.counter=null;var n=arguments[0];this.counter=n}function sv(){this.index=new dp;var n=arguments[0];this.init(n)}function gp(){this.coord=null;this.segmentIndex=null;this.dist=null;var n=arguments[0],t=arguments[1],i=arguments[2];this.coord=new r(n);this.segmentIndex=t;this.dist=i}function nw(){this.nodeMap=new ui;this.edge=null;var n=arguments[0];this.edge=n}function cc(){}function tw(){var n,t;this.e=null;this.pts=null;this.startIndex=null;this.env1=new p;this.env2=new p;n=arguments[0];this.e=n;this.pts=n.getCoordinates();t=new cc;this.startIndex=t.getChainStartIndices(this.pts)}function wu(){var n,t;for(this.depth=Array(2).fill().map(function(){return Array(3)}),n=0;n<2;n++)for(t=0;t<3;t++)this.depth[n][t]=wu.NULL_VALUE}function ou(){var n,t,i;(ke.apply(this),this.pts=null,this.env=null,this.eiList=new nw(this),this.name=null,this.mce=null,this._isIsolated=!0,this.depth=new wu,this.depthDelta=0,1===arguments.length)?(n=arguments[0],ou.call(this,n,null)):2===arguments.length&&(t=arguments[0],i=arguments[1],this.pts=t,this.label=i)}function or(){var t,i;if(uf.apply(this),this.parentGeom=null,this.lineEdgeMap=new kf,this.boundaryNodeRule=null,this.useBoundaryDeterminationRule=!0,this.argIndex=null,this.boundaryNodes=null,this._hasTooFewPoints=!1,this.invalidPoint=null,this.areaPtLocator=null,this.ptLocator=new bo,2===arguments.length)t=arguments[0],i=arguments[1],or.call(this,t,i,oi.OGC_SFS_BOUNDARY_RULE);else if(3===arguments.length){var r=arguments[0],n=arguments[1],u=arguments[2];this.argIndex=r;this.parentGeom=n;this.boundaryNodeRule=u;null!==n&&this.add(n)}}function ge(){var n,r,u;if(this.li=new si,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 or(0,n);else if(2===arguments.length)r=arguments[0],u=arguments[1],ge.call(this,r,u,oi.OGC_SFS_BOUNDARY_RULE);else if(3===arguments.length){var t=arguments[0],i=arguments[1],f=arguments[2];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 or(0,t,f);this.arg[1]=new or(1,i,f)}}function no(){this.pts=null;this._orientation=null;var n=arguments[0];this.pts=n;this._orientation=no.orientation(n)}function hv(){this.edges=new u;this.ocaMap=new ui}function a(){this.ptLocator=new bo;this.geomFact=null;this.resultGeom=null;this.graph=null;this.edgeList=new hv;this.resultPolyList=new u;this.resultLineList=new u;this.resultPointList=new u;var n=arguments[0],t=arguments[1];ge.call(this,n,t);this.graph=new uf(new nh);this.geomFact=n.getFactory()}function su(){this.geom=new Array(2).fill(null);this.snapTolerance=null;this.cbr=null;var n=arguments[0],t=arguments[1];this.geom[0]=n;this.geom[1]=t;this.computeSnapTolerance()}function hi(){this.geom=new Array(2).fill(null);var n=arguments[0],t=arguments[1];this.geom[0]=n;this.geom[1]=t}function bu(){this.factory=null;this.interiorPoint=null;this.maxWidth=0;var n=arguments[0];this.factory=n.getFactory();this.add(n)}function th(){this.poly=null;this.centreY=null;this.hiY=v.MAX_VALUE;this.loY=-v.MAX_VALUE;var n=arguments[0];this.poly=n;this.hiY=n.getEnvelopeInternal().getMaxY();this.loY=n.getEnvelopeInternal().getMinY();this.centreY=bu.avg(this.loY,this.hiY)}function cv(){this.centroid=null;this.minDistance=v.MAX_VALUE;this.interiorPoint=null;var n=arguments[0];this.centroid=n.getCentroid().getCoordinate();this.addInterior(n);null===this.interiorPoint&&this.addEndpoints(n)}function lv(){this.centroid=null;this.minDistance=v.MAX_VALUE;this.interiorPoint=null;var n=arguments[0];this.centroid=n.getCentroid().getCoordinate();this.add(n)}function to(){this.tempEnv1=new p;this.selectedSegment=new b}function ff(){this.items=new u;this.subnode=[null,null]}function re(){var n,t,i;(this.min=null,this.max=null,0===arguments.length)?(this.min=0,this.max=0):1===arguments.length?(n=arguments[0],this.init(n.min,n.max)):2===arguments.length&&(t=arguments[0],i=arguments[1],this.init(t,i))}function rs(){}function ud(n,t){var f,i,r,u,e={32:8,64:11}[n];if(u||(f=t<0||1/t<0,isFinite(t)||(u={32:{d:127,c:128,b:0,a:0},64:{d:32752,c:0,b:0,a:0}}[n],f&&(u.d+=1<<n/4-1),i=Math.pow(2,e)-1,r=0)),!u){for(i={32:127,64:1023}[n],r=Math.abs(t);r>=2;)i++,r/=2;for(;r<1&&i>0;)i--,r*=2;i<=0&&(r/=2);32===n&&i>254&&(u={d:f?255:127,c:128,b:0,a:0},i=Math.pow(2,e)-1,r=0)}return i}function lc(){this.pt=0;this.level=0;this.interval=null;var n=arguments[0];this.computeKey(n)}function he(){ff.apply(this);this.interval=null;this.centre=null;this.level=null;var n=arguments[0],t=arguments[1];this.interval=n;this.level=t;this.centre=(n.getMin()+n.getMax())/2}function io(){}function ih(){ff.apply(this)}function rh(){this.root=null;this.minExtent=1;this.root=new ih}function iw(){}function ac(){this.ring=null;this.tree=null;this.crossings=0;this.interval=new re;var n=arguments[0];this.ring=n;this.buildIndex()}function vc(){to.apply(this);this.mcp=null;this.p=null;var n=arguments[0],t=arguments[1];this.mcp=n;this.p=t}function k(){}function vt(){this.p0=null;this.p1=null;this.p2=null;var n=arguments[0],t=arguments[1],i=arguments[2];this.p0=n;this.p1=t;this.p2=i}function ce(){this.input=null;this.extremalPts=null;this.centre=null;this.radius=0;var n=arguments[0];this.input=n}function bi(){var n,t,i;(this.inputGeom=null,this.isConvex=null,this.convexHullPts=null,this.minBaseSeg=new b,this.minWidthPt=null,this.minPtIndex=null,this.minWidth=0,1===arguments.length)?(n=arguments[0],bi.call(this,n,!1)):2===arguments.length&&(t=arguments[0],i=arguments[1],this.inputGeom=t,this.isConvex=i)}function ro(){this.inputGeom=null;this.distanceTolerance=null;var n=arguments[0];this.inputGeom=n}function yc(){ur.apply(this);this.distanceTolerance=null;var n=arguments[0];this.distanceTolerance=n}function ue(){this._orig=null;this._sym=null;this._next=null;var n=arguments[0];this._orig=n}function yr(){this._isMarked=!1;var n=arguments[0];ue.call(this,n)}function uh(){this.vertexMap=new kf}function av(){this._isStart=!1;var n=arguments[0];yr.call(this,n)}function vv(){uh.apply(this)}function pc(){this.result=null;this.factory=null;this.graph=null;this.lines=new u;this.nodeEdgeStack=new gi;this.ringStartEdge=null;this.graph=new vv}function ef(){this.items=new u;this.subnode=new Array(4).fill(null)}function wc(){this.pt=new r;this.level=0;this.env=null;var n=arguments[0];this.computeKey(n)}function le(){ef.apply(this);this.env=null;this.centrex=null;this.centrey=null;this.level=null;var n=arguments[0],t=arguments[1];this.env=n;this.level=t;this.centrex=(n.getMinX()+n.getMaxX())/2;this.centrey=(n.getMinY()+n.getMaxY())/2}function us(){ef.apply(this)}function uo(){this.root=null;this.minExtent=1;this.root=new us}function rw(n){this.geometryFactory=n||new g}function fb(n){this.geometryFactory=n||new g;this.precisionModel=this.geometryFactory.getPrecisionModel();this.parser=new rw(this.geometryFactory)}function eb(){this.parser=new rw(this.geometryFactory)}function ob(n){this.geometryFactory=n||new g;this.precisionModel=this.geometryFactory.getPrecisionModel();this.parser=new sp(this.geometryFactory)}function bc(n){return[n.x,n.y]}function sb(n,t){this.geometryFactory=n||new g;this.ol=t||"undefined"!=typeof ol&&ol}function kc(){var n,t,i,r;(this.noder=null,this.scaleFactor=null,this.offsetX=null,this.offsetY=null,this.isScaled=!1,2===arguments.length)?(n=arguments[0],t=arguments[1],kc.call(this,n,t,0,0)):4===arguments.length&&(i=arguments[0],r=arguments[1],arguments[2],arguments[3],this.noder=i,this.scaleFactor=r,this.isScaled=!this.isIntegerPrecision())}function dc(){var n,t,i;(this.inputGeom=null,this.isClosedEndpointsInInterior=!0,this.nonSimpleLocation=null,1===arguments.length)?(n=arguments[0],this.inputGeom=n):2===arguments.length&&(t=arguments[0],i=arguments[1],this.inputGeom=t,this.isClosedEndpointsInInterior=!i.isInBoundary(2))}function yv(){this.pt=null;this.isClosed=null;this.degree=null;var n=arguments[0];this.pt=n;this.isClosed=!1;this.degree=0}function rt(){var n,t,i;if(this.quadrantSegments=rt.DEFAULT_QUADRANT_SEGMENTS,this.endCapStyle=rt.CAP_ROUND,this.joinStyle=rt.JOIN_ROUND,this.mitreLimit=rt.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this.simplifyFactor=rt.DEFAULT_SIMPLIFY_FACTOR,0!==arguments.length)if(1===arguments.length)n=arguments[0],this.setQuadrantSegments(n);else if(2===arguments.length)t=arguments[0],i=arguments[1],this.setQuadrantSegments(t),this.setEndCapStyle(i);else if(4===arguments.length){var r=arguments[0],u=arguments[1],f=arguments[2],e=arguments[3];this.setQuadrantSegments(r);this.setEndCapStyle(u);this.setJoinStyle(f);this.setMitreLimit(e)}}function uw(){this.minIndex=-1;this.minCoord=null;this.minDe=null;this.orientedDe=null}function pv(){this.array_=[]}function fw(){this.finder=null;this.dirEdgeList=new u;this.nodes=new u;this.rightMostCoord=null;this.env=null;this.finder=new uw}function vi(){this.inputLine=null;this.distanceTol=null;this.isDeleted=null;this.angleOrientation=s.COUNTERCLOCKWISE;var n=arguments[0];this.inputLine=n}function gc(){this.ptList=null;this.precisionModel=null;this.minimimVertexDistance=0;this.ptList=new u}function of(){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 b;this.seg1=new b;this.offset0=new b;this.offset1=new b;this.side=0;this._hasNarrowConcaveAngle=!1;var t=arguments[0],n=arguments[1],i=arguments[2];this.precisionModel=t;this.bufParams=n;this.li=new si;this.filletAngleQuantum=Math.PI/2/n.getQuadrantSegments();n.getQuadrantSegments()>=8&&n.getJoinStyle()===rt.JOIN_ROUND&&(this.closingSegLengthFactor=of.MAX_CLOSING_SEG_LEN_FACTOR);this.init(i)}function nl(){this.distance=0;this.precisionModel=null;this.bufParams=null;var n=arguments[0],t=arguments[1];this.precisionModel=n;this.bufParams=t}function wv(){this.subgraphs=null;this.seg=new b;this.cga=new s;var n=arguments[0];this.subgraphs=n}function bv(){this.upwardSeg=null;this.leftDepth=null;var n=arguments[0],t=arguments[1];this.upwardSeg=new b(n);this.leftDepth=t}function ew(){this.inputGeom=null;this.distance=null;this.curveBuilder=null;this.curveList=new u;var n=arguments[0],t=arguments[1],i=arguments[2];this.inputGeom=n;this.distance=t;this.curveBuilder=i}function tl(){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}function fo(){this.bufParams=null;this.workingPrecisionModel=null;this.workingNoder=null;this.geomFact=null;this.graph=null;this.edgeList=new hv;var n=arguments[0];this.bufParams=n}function il(){this.li=new si;this.segStrings=null;var n=arguments[0];this.segStrings=n}function fh(){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],i=arguments[2];if(this.originalPt=n,this.pt=n,this.scaleFactor=t,this.li=i,t<=0)throw new ct("Scale factor must be non-zero");1!==t&&(this.pt=new r(this.scale(n.x),this.scale(n.y)),this.p0Scaled=new r,this.p1Scaled=new r);this.initCorners(this.pt)}function kv(){this.index=null;var n=arguments[0];this.index=n}function rl(){to.apply(this);this.hotPixel=null;this.parentEdge=null;this.hotPixelVertexIndex=null;this._isNodeAdded=!1;var n=arguments[0],t=arguments[1],i=arguments[2];this.hotPixel=n;this.parentEdge=t;this.hotPixelVertexIndex=i}function ow(){this.li=null;this.interiorIntersections=null;var n=arguments[0];this.li=n;this.interiorIntersections=new u}function sw(){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 si;this.li.setPrecisionModel(n);this.scaleFactor=n.getScale()}function yi(){var n,t,i;(this.argGeom=null,this.distance=null,this.bufParams=new rt,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)}function fs(){this.comps=null;var n=arguments[0];this.comps=n}function pr(){var n,t;if(this.component=null,this.segIndex=null,this.pt=null,2===arguments.length)n=arguments[0],t=arguments[1],pr.call(this,n,pr.INSIDE_AREA,t);else if(3===arguments.length){var i=arguments[0],r=arguments[1],u=arguments[2];this.component=i;this.segIndex=r;this.pt=u}}function es(){this.pts=null;var n=arguments[0];this.pts=n}function ul(){this.locations=null;var n=arguments[0];this.locations=n}function ku(){var n,t;if(this.geom=null,this.terminateDistance=0,this.ptLocator=new bo,this.minDistanceLocation=null,this.minDistance=v.MAX_VALUE,2===arguments.length)n=arguments[0],t=arguments[1],ku.call(this,n,t,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}}function hw(){this.factory=null;this.directedEdges=new u;this.coordinates=null;var n=arguments[0];this.factory=n}function hu(){this._isMarked=!1;this._isVisited=!1;this.data=null}function iu(){var n,t;hu.apply(this);this.parentEdge=null;this.from=null;this.to=null;this.p0=null;this.p1=null;this.sym=null;this.edgeDirection=null;this.quadrant=null;this.angle=null;var i=arguments[0],r=arguments[1],u=arguments[2],f=arguments[3];this.from=i;this.to=r;this.edgeDirection=f;this.p0=i.getCoordinate();this.p1=u;n=this.p1.x-this.p0.x;t=this.p1.y-this.p0.y;this.quadrant=it.quadrant(n,t);this.angle=Math.atan2(t,n)}function fl(){var n=arguments[0],t=arguments[1],i=arguments[2],r=arguments[3];iu.call(this,n,t,i,r)}function sf(){if((hu.apply(this),this.dirEdge=null,0!==arguments.length)&&2===arguments.length){var n=arguments[0],t=arguments[1];this.setDirectedEdges(n,t)}}function cw(){this.outEdges=new u;this.sorted=!1}function fe(){var n,t,i;(hu.apply(this),this.pt=null,this.deStar=null,1===arguments.length)?(n=arguments[0],fe.call(this,n,new cw)):2===arguments.length&&(t=arguments[0],i=arguments[1],this.pt=t,this.deStar=i)}function dv(){sf.apply(this);this.line=null;var n=arguments[0];this.line=n}function lw(){this.nodeMap=new ui}function eh(){this.edges=new li;this.dirEdges=new li;this.nodeMap=new lw}function gv(){eh.apply(this)}function aw(){this.graph=new gv;this.mergedLineStrings=null;this.factory=null;this.edgeStrings=null}function el(){this.edgeRing=null;this.next=null;this.label=-1;var n=arguments[0],t=arguments[1],i=arguments[2],r=arguments[3];iu.call(this,n,t,i,r)}function ny(){sf.apply(this);this.line=null;var n=arguments[0];this.line=n}function sl(){this.geometryFactory=new g;this.geomGraph=null;this.disconnectedRingcoord=null;var n=arguments[0];this.geomGraph=n}function ty(){}function hl(){var t,n;(this.edgeEnds=new u,1===arguments.length)?(t=arguments[0],hl.call(this,null,t)):2===arguments.length&&(n=(arguments[0],arguments[1]),rf.call(this,n.getEdge(),n.getCoordinate(),n.getDirectedCoordinate(),new ti(n.getLabel())),this.insert(n))}function iy(){ts.apply(this)}function ry(){var n=arguments[0],t=arguments[1];te.call(this,n,t)}function cl(){ns.apply(this)}function vw(){this.nodes=new gs(new cl)}function uy(){this.li=new si;this.geomGraph=null;this.nodeGraph=new vw;this.invalidPoint=null;var n=arguments[0];this.geomGraph=n}function yw(){this.graph=null;this.rings=new u;this.totalEnv=new p;this.index=null;this.nestedPt=null;var n=arguments[0];this.graph=n}function tt(){var t,i,n;(this.errorType=null,this.pt=null,1===arguments.length)?(t=arguments[0],tt.call(this,t,null)):2===arguments.length&&(i=arguments[0],n=arguments[1],this.errorType=i,null!==n&&(this.pt=n.copy()))}function ru(){this.parentGeometry=null;this.isSelfTouchingRingFormingHoleValid=!1;this.validErr=null;var n=arguments[0];this.parentGeometry=n}function du(){this.factory=null;this.deList=new u;this.lowestEdge=null;this.ring=null;this.ringPts=null;this.holes=null;this.shell=null;this._isHole=null;this._isProcessed=!1;this._isIncludedSet=!1;this._isIncluded=!1;var n=arguments[0];this.factory=n}function pw(){}function fi(){eh.apply(this);this.factory=null;var n=arguments[0];this.factory=n}function wr(){if(this.lineStringAdder=new fy(this),this.graph=null,this.dangles=new u,this.cutEdges=new u,this.invalidRingLines=new u,this.holeList=null,this.shellList=null,this.polyList=null,this.isCheckingRingsValid=!0,this.extractOnlyPolygonal=null,this.geomFactory=null,0===arguments.length)wr.call(this,!1);else if(1===arguments.length){var n=arguments[0];this.extractOnlyPolygonal=n}}function fy(){this.p=null;var n=arguments[0];this.p=n}function ey(){this.li=new si;this.ptLocator=new bo;this.arg=null;this.nodes=new gs(new cl);this.im=null;this.isolatedEdges=new u;this.invalidPoint=null;var n=arguments[0];this.arg=n}function ll(){this.rectEnv=null;var n=arguments[0];this.rectEnv=n.getEnvelopeInternal()}function ww(){this.li=new si;this.rectEnv=null;this.diagUp0=null;this.diagUp1=null;this.diagDown0=null;this.diagDown1=null;var n=arguments[0];this.rectEnv=n;this.diagUp0=new r(n.getMinX(),n.getMinY());this.diagUp1=new r(n.getMaxX(),n.getMaxY());this.diagDown0=new r(n.getMinX(),n.getMaxY());this.diagDown1=new r(n.getMaxX(),n.getMinY())}function eo(){this._isDone=!1}function oh(){this.rectangle=null;this.rectEnv=null;var n=arguments[0];this.rectangle=n;this.rectEnv=n.getEnvelopeInternal()}function oy(){eo.apply(this);this.rectEnv=null;this._intersects=!1;var n=arguments[0];this.rectEnv=n}function sy(){eo.apply(this);this.rectSeq=null;this.rectEnv=null;this._containsPoint=!1;var n=arguments[0];this.rectSeq=n.getExteriorRing().getCoordinateSequence();this.rectEnv=n.getEnvelopeInternal()}function hy(){eo.apply(this);this.rectEnv=null;this.rectIntersector=null;this.hasIntersection=!1;this.p0=new r;this.p1=new r;var n=arguments[0];this.rectEnv=n.getEnvelopeInternal();this.rectIntersector=new ww(this.rectEnv)}function ut(){var n,t;if(this._relate=null,2===arguments.length)n=arguments[0],t=arguments[1],ge.call(this,n,t),this._relate=new ey(this.arg);else if(3===arguments.length){var i=arguments[0],r=arguments[1],u=arguments[2];ge.call(this,i,r,u);this._relate=new ey(this.arg)}}function uu(){this.geomFactory=null;this.skipEmpty=!1;this.inputGeoms=null;var n=arguments[0];this.geomFactory=uu.extractFactory(n);this.inputGeoms=n}function al(){this.pointGeom=null;this.otherGeom=null;this.geomFact=null;var t=arguments[0],n=arguments[1];this.pointGeom=t;this.otherGeom=n;this.geomFact=n.getFactory()}function oo(){this.sortIndex=-1;this.comps=null;var n=arguments[0],t=arguments[1];this.sortIndex=n;this.comps=t}function cu(){this.inputPolys=null;this.geomFactory=null;var n=arguments[0];this.inputPolys=n;null===this.inputPolys&&(this.inputPolys=new u)}function so(){var n,t,i,r;(this.polygons=new u,this.lines=new u,this.points=new u,this.geomFact=null,1===arguments.length)?l(arguments[0],yt)?(n=arguments[0],this.extract(n)):arguments[0]instanceof h&&(t=arguments[0],this.extract(t)):2===arguments.length&&(i=arguments[0],r=arguments[1],this.geomFact=r,this.extract(i))}function cy(){dr.CoordinateOperation.apply(this);this.targetPM=null;this.removeCollapsed=!0;var n=arguments[0],t=arguments[1];this.targetPM=n;this.removeCollapsed=t}function os(){this.targetPM=null;this.removeCollapsed=!0;this.changePrecisionModel=!1;this.isPointwise=!1;var n=arguments[0];this.targetPM=n}function vl(){this.pts=null;this.usePt=null;this.distanceTolerance=null;this.seg=new b;var n=arguments[0];this.pts=n}function sh(){this.inputGeom=null;this.distanceTolerance=null;this.isEnsureValidTopology=!0;var n=arguments[0];this.inputGeom=n}function yl(){ur.apply(this);this.isEnsureValidTopology=!0;this.distanceTolerance=null;var n=arguments[0],t=arguments[1];this.isEnsureValidTopology=n;this.distanceTolerance=t}function pl(){var n,t;if(this.parent=null,this.index=null,2===arguments.length)n=arguments[0],t=arguments[1],pl.call(this,n,t,null,-1);else if(4===arguments.length){var i=arguments[0],r=arguments[1],u=arguments[2],f=arguments[3];b.call(this,i,r);this.parent=u;this.index=f}}function ae(){var n,t,i;(this.parentLine=null,this.segs=null,this.resultSegs=new u,this.minimumSize=null,1===arguments.length)?(n=arguments[0],ae.call(this,n,2)):2===arguments.length&&(t=arguments[0],i=arguments[1],this.parentLine=t,this.minimumSize=i,this.init())}function hh(){this.index=new uo}function bw(){this.querySeg=null;this.items=new u;var n=arguments[0];this.querySeg=n}function wl(){this.li=new si;this.inputIndex=new hh;this.outputIndex=new hh;this.line=null;this.linePts=null;this.distanceTolerance=0;var n=arguments[0],t=arguments[1];this.inputIndex=n;this.outputIndex=t}function kw(){this.inputIndex=new hh;this.outputIndex=new hh;this.distanceTolerance=0}function ss(){this.inputGeom=null;this.lineSimplifier=new kw;this.linestringMap=null;var n=arguments[0];this.inputGeom=n}function bl(){ur.apply(this);this.linestringMap=null;var n=arguments[0];this.linestringMap=n}function ly(){this.tps=null;var n=arguments[0];this.tps=n}function ch(){this.seg=null;this.segLen=null;this.splitPt=null;this.minimumLen=0;var n=arguments[0];this.seg=n;this.segLen=n.getLength()}function dw(){}function kl(){}function wt(){}function et(){var n,t,i;if(this.p=null,1===arguments.length)n=arguments[0],this.p=new r(n);else if(2===arguments.length)t=arguments[0],i=arguments[1],this.p=new r(t,i);else if(3===arguments.length){var u=arguments[0],f=arguments[1],e=arguments[2];this.p=new r(u,f,e)}}function ho(){this._isOnConstraint=null;this.constraint=null;var n=arguments[0];et.call(this,n)}function dt(){this._rot=null;this.vertex=null;this.next=null;this.data=null}function dl(){this.subdiv=null;this.isUsingTolerance=!1;var n=arguments[0];this.subdiv=n;this.isUsingTolerance=n.getTolerance()>0}function gw(){}function ay(){this.subdiv=null;this.lastEdge=null;var n=arguments[0];this.subdiv=n;this.init()}function lh(){var i,n,r,t;(this.seg=null,1===arguments.length)?"string"==typeof arguments[0]?(i=arguments[0],ci.call(this,i)):arguments[0]instanceof b&&(n=arguments[0],ci.call(this,"Locate failed to converge (at edge: "+n+").  Possible causes include invalid Subdivision topology or very close sites"),this.seg=new b(n)):2===arguments.length&&(r=arguments[0],t=arguments[1],ci.call(this,lh.msgWithSpatial(r,t)),this.seg=new b(t))}function ah(){}function fu(){this.visitedKey=0;this.quadEdges=new u;this.startingEdge=null;this.tolerance=null;this.edgeCoincidenceTolerance=null;this.frameVertex=new Array(3).fill(null);this.frameEnv=null;this.locator=null;this.seg=new b;this.triEdges=new Array(3).fill(null);var t=arguments[0],n=arguments[1];this.tolerance=n;this.edgeCoincidenceTolerance=n/fu.EDGE_COINCIDENCE_TOL_FACTOR;this.createFrame(t);this.startingEdge=this.initSubdiv();this.locator=new ay(this)}function vy(){}function yy(){this.triList=new u}function py(){this.triList=new u}function wy(){this.coordList=new ii;this.triCoords=new u}function hs(){var n,t;if(this.ls=null,this.data=null,2===arguments.length)n=arguments[0],t=arguments[1],this.ls=new b(n,t);else if(3===arguments.length){var i=arguments[0],u=arguments[1],f=arguments[2];this.ls=new b(i,u);this.data=f}else if(6===arguments.length){var e=arguments[0],o=arguments[1],s=arguments[2],h=arguments[3],c=arguments[4],l=arguments[5];hs.call(this,new r(e,o,s),new r(h,c,l))}else if(7===arguments.length){var a=arguments[0],v=arguments[1],y=arguments[2],p=arguments[3],w=arguments[4],k=arguments[5],d=arguments[6];hs.call(this,new r(a,v,y),new r(p,w,k),d)}}function gl(){}function by(){var n,t;if(this.p=null,this.data=null,this.left=null,this.right=null,this.count=null,2===arguments.length)n=arguments[0],t=arguments[1],this.p=new r(n),this.left=null,this.right=null,this.count=1,this.data=t;else if(3===arguments.length){var i=arguments[0],u=arguments[1],f=arguments[2];this.p=new r(i,u);this.left=null;this.right=null;this.count=1;this.data=f}}function cs(){if(this.root=null,this.numberOfNodes=null,this.tolerance=null,0===arguments.length)cs.call(this,0);else if(1===arguments.length){var n=arguments[0];this.tolerance=n}}function ky(){this.tolerance=null;this.matchNode=null;this.matchDist=0;this.p=null;var n=arguments[0],t=arguments[1];this.p=n;this.tolerance=t}function co(){this.initialVertices=null;this.segVertices=null;this.segments=new u;this.subdiv=null;this.incDel=null;this.convexHull=null;this.splitFinder=new kl;this.kdt=null;this.vertexFactory=null;this.computeAreaEnv=null;this.splitPt=null;this.tolerance=null;var t=arguments[0],n=arguments[1];this.initialVertices=new u(t);this.tolerance=n;this.kdt=new cs(n)}function ki(){this.siteCoords=null;this.tolerance=0;this.subdiv=null}function vh(){this.siteCoords=null;this.constraintLines=null;this.tolerance=0;this.subdiv=null;this.constraintVertexMap=new ui}function na(){this.siteCoords=null;this.tolerance=0;this.subdiv=null;this.clipEnv=null;this.diagramEnv=null}function dy(){}var yh,ta,hf,ia,lu,lf,ls,hb,gu,cb,lb,ab,vb,au,af,yb,pb,wb,bb,kb,db,gb,nk,tk,ik,rk,uk;"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)};i(as.prototype,{interfaces_:function(){return[]},getClass:function(){return as}});as.equalsWithTolerance=function(n,t,i){return Math.abs(n-t)<=i};v.isNaN=function(n){return Number.isNaN(n)};v.doubleToLongBits=function(n){return n};v.longBitsToDouble=function(n){return n};v.isInfinite=function(n){return!Number.isFinite(n)};v.MAX_VALUE=Number.MAX_VALUE;ci.prototype=Object.create(Error.prototype);ci.prototype.constructor=Error;y(lo,ci);i(lo.prototype,{interfaces_:function(){return[]},getClass:function(){return lo}});i(c.prototype,{interfaces_:function(){return[]},getClass:function(){return c}});c.shouldNeverReachHere=function(){if(0===arguments.length)c.shouldNeverReachHere(null);else if(1===arguments.length){var n=arguments[0];throw new lo("Should never reach here"+(null!==n?": "+n:""));}};c.isTrue=function(){var t,i,n;if(1===arguments.length)t=arguments[0],c.isTrue(t,null);else if(2===arguments.length&&(i=arguments[0],n=arguments[1],!i))throw null===n?new lo:new lo(n);};c.equals=function(){var n,t;if(2===arguments.length)n=arguments[0],t=arguments[1],c.equals(n,t,null);else if(3===arguments.length){var i=arguments[0],r=arguments[1],u=arguments[2];if(!r.equals(i))throw new lo("Expected "+i+" but encountered "+r+(null!==u?": "+u:""));}};i(r.prototype,{setOrdinate:function(n,t){switch(n){case r.X:this.x=t;break;case r.Y:this.y=t;break;case r.Z:this.z=t;break;default:throw new ct("Invalid ordinate index: "+n);}},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],!!as.equalsWithTolerance(this.x,t.x,i)&&!!as.equalsWithTolerance(this.y,t.y,i)):void 0},getOrdinate:function(n){switch(n){case r.X:return this.x;case r.Y:return this.y;case r.Z:return this.z}throw new ct("Invalid ordinate index: "+n);},equals3D:function(n){return this.x===n.x&&this.y===n.y&&(this.z===n.z||v.isNaN(this.z)&&v.isNaN(n.z))},equals:function(n){return n instanceof r&&this.equals2D(n)},equalInZ:function(n,t){return as.equalsWithTolerance(this.z,n.z,t)},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},clone:function(){try{return null}catch(n){if(n instanceof CloneNotSupportedException)return c.shouldNeverReachHere("this shouldn't happen because this class is Cloneable"),null;throw n;}},copy:function(){return new r(this)},toString:function(){return"("+this.x+", "+this.y+", "+this.z+")"},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)},distance:function(n){var t=this.x-n.x,i=this.y-n.y;return Math.sqrt(t*t+i*i)},hashCode:function(){var n=17;return n=37*n+r.hashCode(this.x),n=37*n+r.hashCode(this.y)},setCoordinate:function(n){this.x=n.x;this.y=n.y;this.z=n.z},interfaces_:function(){return[sr,ph,ir]},getClass:function(){return r}});r.hashCode=function(){if(1===arguments.length){var t=arguments[0],n=v.doubleToLongBits(t);return Math.trunc(n^n>>>32)}};i(ye.prototype,{compare:function(n,t){var i=n,r=t,f=ye.compare(i.x,r.x),u;return 0!==f?f:(u=ye.compare(i.y,r.y),0!==u?u:this.dimensionsToTest<=2?0:ye.compare(i.z,r.z))},interfaces_:function(){return[ve]},getClass:function(){return ye}});ye.compare=function(n,t){return n<t?-1:n>t?1:v.isNaN(n)?v.isNaN(t)?0:-1:v.isNaN(t)?1:0};r.DimensionalComparator=ye;r.serialVersionUID=0x5cbf2c235c7e5800;r.NULL_ORDINATE=v.NaN;r.X=0;r.Y=1;r.Z=2;wh.prototype.hasNext=function(){};wh.prototype.next=function(){};wh.prototype.remove=function(){};yt.prototype.add=function(){};yt.prototype.addAll=function(){};yt.prototype.isEmpty=function(){};yt.prototype.iterator=function(){};yt.prototype.size=function(){};yt.prototype.toArray=function(){};yt.prototype.remove=function(){};gy.prototype=new Error;gy.prototype.name="IndexOutOfBoundsException";ei.prototype=Object.create(yt.prototype);ei.prototype.constructor=ei;ei.prototype.get=function(){};ei.prototype.set=function(){};ei.prototype.isEmpty=function(){};vs.prototype=new Error;vs.prototype.name="NoSuchElementException";bh.prototype=new Error;bh.prototype.name="OperationNotSupported";u.prototype=Object.create(ei.prototype);u.prototype.constructor=u;u.prototype.ensureCapacity=function(){};u.prototype.interfaces_=function(){return[ei,yt]};u.prototype.add=function(n){return 1===arguments.length?this.array_.push(n):this.array_.splice(arguments[0],arguments[1]),!0};u.prototype.clear=function(){this.array_=[]};u.prototype.addAll=function(n){for(var t=n.iterator();t.hasNext();)this.add(t.next());return!0};u.prototype.set=function(n,t){var i=this.array_[n];return this.array_[n]=t,i};u.prototype.iterator=function(){return new yh(this)};u.prototype.get=function(n){if(n<0||n>=this.size())throw new gy;return this.array_[n]};u.prototype.isEmpty=function(){return 0===this.array_.length};u.prototype.size=function(){return this.array_.length};u.prototype.toArray=function(){for(var t=[],n=0,i=this.array_.length;n<i;n++)t.push(this.array_[n]);return t};u.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};yh=function(n){this.arrayList_=n;this.position_=0};yh.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new vs;return this.arrayList_.get(this.position_++)};yh.prototype.hasNext=function(){return this.position_<this.arrayList_.size()};yh.prototype.set=function(n){return this.arrayList_.set(this.position_-1,n)};yh.prototype.remove=function(){this.arrayList_.remove(this.arrayList_.get(this.position_))};y(ii,u);i(ii.prototype,{getCoordinate:function(n){return this.get(n)},addAll:function(){if(2===arguments.length){for(var i=arguments[0],r=arguments[1],n=!1,t=i.iterator();t.hasNext();)this.add(t.next(),r),n=!0;return n}return u.prototype.addAll.apply(this,arguments)},clone:function(){for(var t=u.prototype.clone.call(this),n=0;n<this.size();n++)t.add(n,this.get(n).copy());return t},toCoordinateArray:function(){return this.toArray(ii.coordArrayType)},add:function(){var s,h,c,f,l,a,v,y,o,w,b,n;if(1===arguments.length)s=arguments[0],u.prototype.add.call(this,s);else if(2===arguments.length){if(arguments[0]instanceof Array&&"boolean"==typeof arguments[1])return h=arguments[0],c=arguments[1],this.add(h,c,!0),!0;if(arguments[0]instanceof r&&"boolean"==typeof arguments[1]){if(f=arguments[0],l=arguments[1],!l&&this.size()>=1&&(a=this.get(this.size()-1),a.equals2D(f)))return null;u.prototype.add.call(this,f)}else if(arguments[0]instanceof Object&&"boolean"==typeof arguments[1])return v=arguments[0],y=arguments[1],this.add(v,y),!0}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var i=arguments[0],p=arguments[1],nt=arguments[2];if(nt)for(n=0;n<i.length;n++)this.add(i[n],p);else for(n=i.length-1;n>=0;n--)this.add(i[n],p);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof r){var t=arguments[0],e=arguments[1],tt=arguments[2];if(!tt&&(o=this.size(),o>0&&(t>0&&(w=this.get(t-1),w.equals2D(e))||t<o&&(b=this.get(t),b.equals2D(e)))))return null;u.prototype.add.call(this,t,e)}}else if(4===arguments.length){var it=arguments[0],rt=arguments[1],k=arguments[2],d=arguments[3],g=1;for(k>d&&(g=-1),n=k;n!==d;n+=g)this.add(it[n],rt);return!0}},closeRing:function(){this.size()>0&&this.add(new r(this.get(0)),!1)},interfaces_:function(){return[]},getClass:function(){return ii}});ii.coordArrayType=new Array(0).fill(null);i(p.prototype,{getArea:function(){return this.getWidth()*this.getHeight()},equals:function(n){if(!(n instanceof p))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()},intersection:function(n){if(this.isNull()||n.isNull()||!this.intersects(n))return new p;var t=this.minx>n.minx?this.minx:n.minx,i=this.miny>n.miny?this.miny:n.miny;return new p(t,this.maxx<n.maxx?this.maxx:n.maxx,i,this.maxy<n.maxy?this.maxy:n.maxy)},isNull:function(){return this.maxx<this.minx},getMaxX:function(){return this.maxx},covers:function(){var t,n,i,u;if(1===arguments.length){if(arguments[0]instanceof r)return t=arguments[0],this.covers(t.x,t.y);if(arguments[0]instanceof p)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 i=arguments[0],u=arguments[1],!this.isNull()&&i>=this.minx&&i<=this.maxx&&u>=this.miny&&u<=this.maxy},intersects:function(){var n,t,i,u;if(1===arguments.length){if(arguments[0]instanceof p)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 r)return t=arguments[0],this.intersects(t.x,t.y)}else if(2===arguments.length)return i=arguments[0],u=arguments[1],!this.isNull()&&!(i>this.maxx||i<this.minx||u>this.maxy||u<this.miny)},getMinY:function(){return this.miny},getMinX:function(){return this.minx},expandToInclude:function(){var u,n,t,i;if(1===arguments.length){if(arguments[0]instanceof r)u=arguments[0],this.expandToInclude(u.x,u.y);else if(arguments[0]instanceof p){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],i=arguments[1],this.isNull()?(this.minx=t,this.maxx=t,this.miny=i,this.maxy=i):(t<this.minx&&(this.minx=t),t>this.maxx&&(this.maxx=t),i<this.miny&&(this.miny=i),i>this.maxy&&(this.maxy=i)))},minExtent:function(){if(this.isNull())return 0;var n=this.getWidth(),t=this.getHeight();return n<t?n:t},getWidth:function(){return this.isNull()?0:this.maxx-this.minx},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},translate:function(n,t){return this.isNull()?null:void this.init(this.getMinX()+n,this.getMaxX()+n,this.getMinY()+t,this.getMaxY()+t)},toString:function(){return"Env["+this.minx+" : "+this.maxx+", "+this.miny+" : "+this.maxy+"]"},setToNull:function(){this.minx=0;this.maxx=-1;this.miny=0;this.maxy=-1},getHeight:function(){return this.isNull()?0:this.maxy-this.miny},maxExtent:function(){if(this.isNull())return 0;var n=this.getWidth(),t=this.getHeight();return n>t?n:t},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()}},contains:function(){var n,t,i,u;if(1===arguments.length){if(arguments[0]instanceof p)return n=arguments[0],this.covers(n);if(arguments[0]instanceof r)return t=arguments[0],this.covers(t)}else if(2===arguments.length)return i=arguments[0],u=arguments[1],this.covers(i,u)},centre:function(){return this.isNull()?null:new r((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},init:function(){var n,t,i,u;if(0===arguments.length)this.setToNull();else if(1===arguments.length)arguments[0]instanceof r?(n=arguments[0],this.init(n.x,n.x,n.y,n.y)):arguments[0]instanceof p&&(t=arguments[0],this.minx=t.minx,this.maxx=t.maxx,this.miny=t.miny,this.maxy=t.maxy);else if(2===arguments.length)i=arguments[0],u=arguments[1],this.init(i.x,u.x,i.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)}},getMaxY:function(){return this.maxy},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))},hashCode:function(){var n=17;return n=37*n+r.hashCode(this.minx),n=37*n+r.hashCode(this.maxx),n=37*n+r.hashCode(this.miny),n=37*n+r.hashCode(this.maxy)},interfaces_:function(){return[sr,ir]},getClass:function(){return p}});p.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))}};p.serialVersionUID=0x51845cd552189800;y(vf,ra);i(vf.prototype,{interfaces_:function(){return[]},getClass:function(){return vf}});i(t.prototype,{interfaces_:function(){return[]},getClass:function(){return t}});t.toLocationSymbol=function(n){switch(n){case t.EXTERIOR:return"e";case t.BOUNDARY:return"b";case t.INTERIOR:return"i";case t.NONE:return"-"}throw new ct("Unknown location value: "+n);};t.INTERIOR=0;t.BOUNDARY=1;t.EXTERIOR=2;t.NONE=-1;i(br.prototype,{interfaces_:function(){return[]},getClass:function(){return br}});br.log10=function(n){var t=Math.log(n);return v.isInfinite(t)?t:v.isNaN(t)?t:t/br.LOG_10};br.min=function(n,t,i,r){var u=n;return t<u&&(u=t),i<u&&(u=i),r<u&&(u=r),u};br.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}};br.wrap=function(n,t){return n<0?t- -n%t:n%t};br.max=function(){if(3===arguments.length){var e=arguments[0],t=arguments[1],i=arguments[2],n=e;return t>n&&(n=t),i>n&&(n=i),n}if(4===arguments.length){var o=arguments[0],r=arguments[1],u=arguments[2],f=arguments[3],n=o;return r>n&&(n=r),u>n&&(n=u),f>n&&(n=f),n}};br.average=function(n,t){return(n+t)/2};br.LOG_10=Math.log(10);eu.prototype.append=function(n){this.str+=n};eu.prototype.setCharAt=function(n,t){this.str=this.str.substr(0,n)+t+this.str.substr(n+1)};eu.prototype.toString=function(){return this.str};vu.prototype.intValue=function(){return this.value};vu.prototype.compareTo=function(n){return this.value<n?-1:this.value>n?1:0};vu.isNaN=function(n){return Number.isNaN(n)};kh.isWhitespace=function(n){return n<=32&&n>=0||127==n};kh.toUpperCase=function(n){return n.toUpperCase()};i(f.prototype,{le:function(n){return this.hi<n.hi||this.hi===n.hi&&this.lo<=n.lo},extractSignificantDigits:function(n,t){var i=this.abs(),r=f.magnitude(i.hi),v=f.TEN.pow(r),u,h,o,c,l;i=i.divide(v);i.gt(f.TEN)?(i=i.divide(f.TEN),r+=1):i.lt(f.ONE)&&(i=i.multiply(f.TEN),r-=1);for(var y=r+1,s=new eu,a=f.MAX_PRINT_DIGITS-1,e=0;e<=a;e++){if(n&&e===y&&s.append("."),u=Math.trunc(i.hi),u<0)break;if(h=!1,o=0,u>9?(h=!0,o="9"):o="0"+u,s.append(o),i=i.subtract(f.valueOf(u)).multiply(f.TEN),h&&i.selfAdd(f.TEN),c=!0,l=f.magnitude(i.hi),l<0&&Math.abs(l)>=a-e&&(c=!1),!c)break}return t[0]=r,s.toString()},sqr:function(){return this.multiply(this)},doubleValue:function(){return this.hi+this.lo},subtract:function(){var n,t;return arguments[0]instanceof f?(n=arguments[0],this.add(n.negate())):"number"==typeof arguments[0]?(t=arguments[0],this.add(-t)):void 0},equals:function(){if(1===arguments.length){var n=arguments[0];return this.hi===n.hi&&this.lo===n.lo}},isZero:function(){return 0===this.hi&&0===this.lo},selfSubtract:function(){var n,t;return arguments[0]instanceof f?(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},getSpecialNumberString:function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},min:function(n){return this.le(n)?this:n},selfDivide:function(){var o,l;if(1===arguments.length){if(arguments[0]instanceof f)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,u=null,h=null,n=null,e=null,c=null,t=null;return n=this.hi/i,e=f.SPLIT*n,r=e-n,t=f.SPLIT*i,r=e-r,s=n-r,u=t-i,c=n*i,u=t-u,h=i-u,t=r*u-c+r*h+s*u+s*h,e=(this.hi-c-t+this.lo-n*a)/i,t=n+e,this.hi=t,this.lo=n-t+e,this}},dump:function(){return"DD<"+this.hi+", "+this.lo+">"},divide:function(){var c;if(arguments[0]instanceof f){var i=arguments[0],r=null,o=null,u=null,s=null,n=null,e=null,h=null,t=null;return n=this.hi/i.hi,e=f.SPLIT*n,r=e-n,t=f.SPLIT*i.hi,r=e-r,o=n-r,u=t-i.hi,h=n*i.hi,u=t-u,s=i.hi-u,t=r*u-h+r*s+o*u+o*s,e=(this.hi-h-t+this.lo-n*i.lo)/i.hi,t=n+e,new f(t,n-t+e)}if("number"==typeof arguments[0])return c=arguments[0],v.isNaN(c)?f.createNaN():f.copy(this).selfDivide(c,0)},ge:function(n){return this.hi>n.hi||this.hi===n.hi&&this.lo>=n.lo},pow:function(n){if(0===n)return f.valueOf(1);var t=new f(this),i=f.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},ceil:function(){if(this.isNaN())return f.NaN;var n=Math.ceil(this.hi),t=0;return n===this.hi&&(t=Math.ceil(this.lo)),new f(n,t)},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},rint:function(){return this.isNaN()?this:this.add(.5).floor()},setValue:function(){var n,t;return arguments[0]instanceof f?(n=arguments[0],this.init(n),this):"number"==typeof arguments[0]?(t=arguments[0],this.init(t),this):void 0},max:function(n){return this.ge(n)?this:n},sqrt:function(){if(this.isZero())return f.valueOf(0);if(this.isNegative())return f.NaN;var n=1/Math.sqrt(this.hi),i=this.hi*n,t=f.valueOf(i),r=this.subtract(t.sqr()),u=r.hi*.5*n;return t.add(u)},selfAdd:function(){var h,c,y;if(1===arguments.length){if(arguments[0]instanceof f)return h=arguments[0],this.selfAdd(h.hi,h.lo);if("number"==typeof arguments[0]){var l=arguments[0],i=null,e=null,t=null,r=null,n=null,u=null;return t=this.hi+l,n=t-this.hi,r=t-n,r=l-n+(this.hi-r),u=r+this.lo,i=t+u,e=u+(t-i),this.hi=i+e,this.lo=e+(i-this.hi),this}}else if(2===arguments.length){var a=arguments[0],v=arguments[1],i=null,e=null,o=null,s=null,t=null,r=null,n=null,u=null;return t=this.hi+a,o=this.lo+v,n=t-this.hi,u=o-this.lo,r=t-n,s=o-u,r=a-n+(this.hi-r),s=v-u+(this.lo-s),n=r+o,i=t+n,e=n+(t-i),n=s+e,c=i+n,y=n+(i-c),this.hi=c,this.lo=y,this}},selfMultiply:function(){var e,c,h,l;if(1===arguments.length){if(arguments[0]instanceof f)return e=arguments[0],this.selfMultiply(e.hi,e.lo);if("number"==typeof arguments[0])return c=arguments[0],this.selfMultiply(c,0)}else if(2===arguments.length){var u=arguments[0],a=arguments[1],n=null,o=null,i=null,s=null,t=null,r=null;return t=f.SPLIT*this.hi,n=t-this.hi,r=f.SPLIT*u,n=t-n,o=this.hi-n,i=r-u,t=this.hi*u,i=r-i,s=u-i,r=n*i-t+n*s+o*i+o*s+(this.hi*a+this.lo*u),h=t+r,n=t-h,l=r+n,this.hi=h,this.lo=l,this}},selfSqr:function(){return this.selfMultiply(this)},floor:function(){if(this.isNaN())return f.NaN;var n=Math.floor(this.hi),t=0;return n===this.hi&&(t=Math.floor(this.lo)),new f(n,t)},negate:function(){return this.isNaN()?this:new f(-this.hi,-this.lo)},clone:function(){try{return null}catch(n){if(n instanceof CloneNotSupportedException)return null;throw n;}},multiply:function(){var n,t;return arguments[0]instanceof f?(n=arguments[0],n.isNaN()?f.createNaN():f.copy(this).selfMultiply(n)):"number"==typeof arguments[0]?(t=arguments[0],v.isNaN(t)?f.createNaN():f.copy(this).selfMultiply(t,0)):void 0},isNaN:function(){return v.isNaN(this.hi)},intValue:function(){return Math.trunc(this.hi)},toString:function(){var n=f.magnitude(this.hi);return n>=-3&&n<=20?this.toStandardNotation():this.toSciNotation()},toStandardNotation:function(){var r=this.getSpecialNumberString(),e,o;if(null!==r)return r;var u=new Array(1).fill(null),n=this.extractSignificantDigits(!0,u),i=u[0]+1,t=n;return"."===n.charAt(0)?t="0"+n:i<0?t="0."+f.stringOfChar("0",-i)+n:-1===n.indexOf(".")&&(e=i-n.length,o=f.stringOfChar("0",e),t=n+o+".0"),this.isNegative()?"-"+t:t},reciprocal:function(){var t=null,e=null,i=null,o=null,n=null,r=null,s=null,u=null,h;return n=1/this.hi,r=f.SPLIT*n,t=r-n,u=f.SPLIT*this.hi,t=r-t,e=n-t,i=u-this.hi,s=n*this.hi,i=u-i,o=this.hi-i,u=t*i-s+t*o+e*i+e*o,r=(1-s-u-n*this.lo)/this.hi,h=n+r,new f(h,n-h+r)},toSciNotation:function(){var t,i,r;if(this.isZero())return f.SCI_NOT_ZERO;if(t=this.getSpecialNumberString(),null!==t)return t;var u=new Array(1).fill(null),n=this.extractSignificantDigits(!1,u),e=f.SCI_NOT_EXPONENT_CHAR+u[0];if("0"===n.charAt(0))throw new IllegalStateException("Found leading zero: "+n);return i="",n.length>1&&(i=n.substring(1)),r=n.charAt(0)+"."+i,this.isNegative()?"-"+r+e:r+e},abs:function(){return this.isNaN()?f.NaN:this.isNegative()?this.negate():new f(this)},isPositive:function(){return this.hi>0||0===this.hi&&this.lo>0},lt:function(n){return this.hi<n.hi||this.hi===n.hi&&this.lo<n.lo},add:function(){var n,t;return arguments[0]instanceof f?(n=arguments[0],f.copy(this).selfAdd(n)):"number"==typeof arguments[0]?(t=arguments[0],f.copy(this).selfAdd(t)):void 0},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 f&&(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)},gt:function(n){return this.hi>n.hi||this.hi===n.hi&&this.lo>n.lo},isNegative:function(){return this.hi<0||0===this.hi&&this.lo<0},trunc:function(){return this.isNaN()?f.NaN:this.isPositive()?this.floor():this.ceil()},signum:function(){return this.hi>0?1:this.hi<0?-1:this.lo>0?1:this.lo<0?-1:0},interfaces_:function(){return[ir,sr,ph]},getClass:function(){return f}});f.sqr=function(n){return f.valueOf(n).selfMultiply(n)};f.valueOf=function(){if("string"==typeof arguments[0]){var n=arguments[0];return f.parse(n)}if("number"==typeof arguments[0])return new f(arguments[0])};f.sqrt=function(n){return f.valueOf(n).sqrt()};f.parse=function(n){for(var c,s,i,p,a,u,e,o,t=0,h=n.length;kh.isWhitespace(n.charAt(t));)t++;c=!1;t<h&&(s=n.charAt(t),"-"!==s&&"+"!==s||(t++,"-"===s&&(c=!0)));for(var r=new f,l=0,v=0,y=0;!(t>=h);)if(i=n.charAt(t),t++,kh.isDigit(i))p=i-"0",r.selfMultiply(f.TEN),r.selfAdd(p),l++;else{if("."!==i){if("e"===i||"E"===i){a=n.substring(t);try{y=vu.parseInt(a)}catch(t){throw t instanceof NumberFormatException?new NumberFormatException("Invalid exponent "+a+" in string "+n):t;}break}throw new NumberFormatException("Unexpected character '"+i+"' at position "+t+" in string "+n);}v=l}return u=r,e=l-v-y,0===e?u=r:e>0?(o=f.TEN.pow(e),u=r.divide(o)):e<0&&(o=f.TEN.pow(-e),u=r.multiply(o)),c?u.negate():u};f.createNaN=function(){return new f(v.NaN,v.NaN)};f.copy=function(n){return new f(n)};f.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};f.stringOfChar=function(n,t){for(var i=new eu,r=0;r<t;r++)i.append(n);return i.toString()};f.PI=new f(3.1415926535897931,12246467991473532e-32);f.TWO_PI=new f(6.2831853071795862,24492935982947064e-32);f.PI_2=new f(1.5707963267948966,6123233995736766e-32);f.E=new f(2.7182818284590451,14456468917292502e-32);f.NaN=new f(v.NaN,v.NaN);f.EPS=123259516440783e-46;f.SPLIT=134217729;f.MAX_PRINT_DIGITS=32;f.TEN=f.valueOf(10);f.ONE=f.valueOf(1);f.SCI_NOT_EXPONENT_CHAR="E";f.SCI_NOT_ZERO="0.0E0";i(rr.prototype,{interfaces_:function(){return[]},getClass:function(){return rr}});rr.orientationIndex=function(n,t,i){var r=rr.orientationIndexFilter(n,t,i);if(r<=1)return r;var u=f.valueOf(t.x).selfAdd(-n.x),e=f.valueOf(t.y).selfAdd(-n.y),o=f.valueOf(i.x).selfAdd(-t.x),s=f.valueOf(i.y).selfAdd(-t.y);return u.selfMultiply(s).selfSubtract(e.selfMultiply(o)).signum()};rr.signOfDet2x2=function(n,t,i,r){return n.multiply(r).selfSubtract(t.multiply(i)).signum()};rr.intersection=function(n,t,i,u){var o=f.valueOf(u.y).selfSubtract(i.y).selfMultiply(f.valueOf(t.x).selfSubtract(n.x)),s=f.valueOf(u.x).selfSubtract(i.x).selfMultiply(f.valueOf(t.y).selfSubtract(n.y)),e=o.subtract(s),h=f.valueOf(u.x).selfSubtract(i.x).selfMultiply(f.valueOf(n.y).selfSubtract(i.y)),c=f.valueOf(u.y).selfSubtract(i.y).selfMultiply(f.valueOf(n.x).selfSubtract(i.x)),l=h.subtract(c),a=l.selfDivide(e).doubleValue(),v=f.valueOf(n.x).selfAdd(f.valueOf(t.x).selfSubtract(n.x).selfMultiply(a)).doubleValue(),y=f.valueOf(t.x).selfSubtract(n.x).selfMultiply(f.valueOf(n.y).selfSubtract(i.y)),p=f.valueOf(t.y).selfSubtract(n.y).selfMultiply(f.valueOf(n.x).selfSubtract(i.x)),w=y.subtract(p),b=w.selfDivide(e).doubleValue();return new r(v,f.valueOf(i.y).selfAdd(f.valueOf(u.y).selfSubtract(i.y).selfMultiply(b)).doubleValue())};rr.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 rr.signum(f);e=r+u}else{if(!(r<0)||u>=0)return rr.signum(f);e=-r-u}return o=rr.DP_SAFE_EPSILON*e,f>=o||-f>=o?rr.signum(f):2};rr.signum=function(n){return n>0?1:n<0?-1:0};rr.DP_SAFE_EPSILON=1e-15;i(lt.prototype,{setOrdinate:function(){},size:function(){},getOrdinate:function(){},getCoordinate:function(){1===arguments.length?arguments[0]:2===arguments.length&&(arguments[0],arguments[1])},getCoordinateCopy:function(){},getDimension:function(){},getX:function(){},clone:function(){},expandEnvelope:function(){},copy:function(){},getY:function(){},toCoordinateArray:function(){},interfaces_:function(){return[ph]},getClass:function(){return lt}});lt.X=0;lt.Y=1;lt.Z=2;lt.M=3;pt.arraycopy=function(n,t,i,r,u){for(var e=0,f=t;f<t+u;f++)i[r+e]=n[f],e++};pt.getProperty=function(n){return{"line.separator":"\n"}[n]};i(hr.prototype,{getY:function(){var n=this.y/this.w;if(v.isNaN(n)||v.isInfinite(n))throw new vf;return n},getX:function(){var n=this.x/this.w;if(v.isNaN(n)||v.isInfinite(n))throw new vf;return n},getCoordinate:function(){var n=new r;return n.x=this.getX(),n.y=this.getY(),n},interfaces_:function(){return[]},getClass:function(){return hr}});hr.intersection=function(n,t,i,u){var o=n.y-t.y,s=t.x-n.x,h=n.x*t.y-t.x*n.y,c=i.y-u.y,l=u.x-i.x,a=i.x*u.y-u.x*i.y,p=s*a-l*h,w=c*h-o*a,y=o*l-c*s,f=p/y,e=w/y;if(v.isNaN(f)||v.isInfinite(f)||v.isNaN(e)||v.isInfinite(e))throw new vf;return new r(f,e)};i(ua.prototype,{create:function(){1===arguments.length?arguments[0]instanceof Array?arguments[0]:l(arguments[0],lt)&&arguments[0]:2===arguments.length&&(arguments[0],arguments[1])},interfaces_:function(){return[]},getClass:function(){return ua}});i(yu.prototype,{filter:function(){},interfaces_:function(){return[]},getClass:function(){return yu}});i(h.prototype,{isGeometryCollection:function(){return this.getSortIndex()===h.SORTINDEX_GEOMETRYCOLLECTION},getFactory:function(){return this.factory},getGeometryN:function(){return this},getArea:function(){return 0},isRectangle:function(){return!1},equals:function(){var n,t,i;if(1===arguments.length){if(arguments[0]instanceof h)return n=arguments[0],null!==n&&this.equalsTopo(n);if(arguments[0]instanceof Object)return(t=arguments[0],!(t instanceof h))?!1:(i=t,this.equalsExact(i))}},equalsExact:function(n){return this===n||this.equalsExact(n,0)},geometryChanged:function(){this.apply(h.geometryChangedFilter)},geometryChangedAction:function(){this.envelope=null},equalsNorm:function(n){return null!==n&&this.norm().equalsExact(n.norm())},getLength:function(){return 0},getNumGeometries:function(){return 1},compareTo:function(){var t,n;if(1===arguments.length)return t=arguments[0],n=t,this.getSortIndex()!==n.getSortIndex()?this.getSortIndex()-n.getSortIndex():this.isEmpty()&&n.isEmpty()?0:this.isEmpty()?-1:n.isEmpty()?1:this.compareToSameClass(t);if(2===arguments.length){var i=arguments[0],r=arguments[1],n=i;return this.getSortIndex()!==n.getSortIndex()?this.getSortIndex()-n.getSortIndex():this.isEmpty()&&n.isEmpty()?0:this.isEmpty()?-1:n.isEmpty()?1:this.compareToSameClass(i,r)}},getUserData:function(){return this.userData},getSRID:function(){return this.SRID},getEnvelope:function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},checkNotGeometryCollection:function(n){if(n.getSortIndex()===h.SORTINDEX_GEOMETRYCOLLECTION)throw new ct("This method does not support GeometryCollection arguments");},equal:function(n,t,i){return 0===i?n.equals(t):n.distance(t)<=i},norm:function(){var n=this.copy();return n.normalize(),n},getPrecisionModel:function(){return this.factory.getPrecisionModel()},getEnvelopeInternal:function(){return null===this.envelope&&(this.envelope=this.computeEnvelopeInternal()),new p(this.envelope)},setSRID:function(n){this.SRID=n},setUserData:function(n){this.userData=n},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},hashCode:function(){return this.getEnvelopeInternal().hashCode()},isGeometryCollectionOrDerived:function(){return this.getSortIndex()===h.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===h.SORTINDEX_MULTIPOINT||this.getSortIndex()===h.SORTINDEX_MULTILINESTRING||this.getSortIndex()===h.SORTINDEX_MULTIPOLYGON},interfaces_:function(){return[ph,sr,ir]},getClass:function(){return h}});h.hasNonEmptyElements=function(n){for(var t=0;t<n.length;t++)if(!n[t].isEmpty())return!0;return!1};h.hasNullElements=function(n){for(var t=0;t<n.length;t++)if(null===n[t])return!0;return!1};h.serialVersionUID=0x799ea46522854c00;h.SORTINDEX_POINT=0;h.SORTINDEX_MULTIPOINT=1;h.SORTINDEX_LINESTRING=2;h.SORTINDEX_LINEARRING=3;h.SORTINDEX_MULTILINESTRING=4;h.SORTINDEX_POLYGON=5;h.SORTINDEX_MULTIPOLYGON=6;h.SORTINDEX_GEOMETRYCOLLECTION=7;h.geometryChangedFilter={interfaces_:function(){return[yu]},filter:function(n){n.geometryChangedAction()}};i(pe.prototype,{filter:function(){},interfaces_:function(){return[]},getClass:function(){return pe}});i(oi.prototype,{isInBoundary:function(){},interfaces_:function(){return[]},getClass:function(){return oi}});i(fa.prototype,{isInBoundary:function(n){return n%2==1},interfaces_:function(){return[oi]},getClass:function(){return fa}});i(ea.prototype,{isInBoundary:function(n){return n>0},interfaces_:function(){return[oi]},getClass:function(){return ea}});i(oa.prototype,{isInBoundary:function(n){return n>1},interfaces_:function(){return[oi]},getClass:function(){return oa}});i(sa.prototype,{isInBoundary:function(n){return 1===n},interfaces_:function(){return[oi]},getClass:function(){return sa}});oi.Mod2BoundaryNodeRule=fa;oi.EndPointBoundaryNodeRule=ea;oi.MultiValentEndPointBoundaryNodeRule=oa;oi.MonoValentEndPointBoundaryNodeRule=sa;oi.MOD2_BOUNDARY_RULE=new fa;oi.ENDPOINT_BOUNDARY_RULE=new ea;oi.MULTIVALENT_ENDPOINT_BOUNDARY_RULE=new oa;oi.MONOVALENT_ENDPOINT_BOUNDARY_RULE=new sa;oi.OGC_SFS_BOUNDARY_RULE=oi.MOD2_BOUNDARY_RULE;i(w.prototype,{interfaces_:function(){return[]},getClass:function(){return w}});w.isRing=function(n){return!(n.length<4||!n[0].equals2D(n[n.length-1]))};w.ptNotInList=function(n,t){for(var r,i=0;i<n.length;i++)if(r=n[i],w.indexOf(r,t)<0)return r;return null};w.scroll=function(n,t){var i=w.indexOf(t,n),r;if(i<0)return null;r=new Array(n.length).fill(null);pt.arraycopy(n,i,r,0,n.length-i);pt.arraycopy(n,0,r,n.length-i,i);pt.arraycopy(r,0,n,0,n.length)};w.equals=function(){var t,i,n;if(2===arguments.length){if(t=arguments[0],i=arguments[1],t===i)return!0;if(null===t||null===i||t.length!==i.length)return!1;for(n=0;n<t.length;n++)if(!t[n].equals(i[n]))return!1;return!0}if(3===arguments.length){var r=arguments[0],u=arguments[1],f=arguments[2];if(r===u)return!0;if(null===r||null===u||r.length!==u.length)return!1;for(n=0;n<r.length;n++)if(0!==f.compare(r[n],u[n]))return!1;return!0}};w.intersection=function(n,t){for(var r=new ii,i=0;i<n.length;i++)t.intersects(n[i])&&r.add(n[i],!0);return r.toCoordinateArray()};w.hasRepeatedPoints=function(n){for(var t=1;t<n.length;t++)if(n[t-1].equals(n[t]))return!0;return!1};w.removeRepeatedPoints=function(n){return w.hasRepeatedPoints(n)?new ii(n,!1).toCoordinateArray():n};w.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};w.removeNull=function(n){for(var r,u,i=0,t=0;t<n.length;t++)null!==n[t]&&i++;if(r=new Array(i).fill(null),0===i)return r;for(u=0,t=0;t<n.length;t++)null!==n[t]&&(r[u++]=n[t]);return r};w.copyDeep=function(){if(1===arguments.length){for(var t=arguments[0],i=new Array(t.length).fill(null),n=0;n<t.length;n++)i[n]=new r(t[n]);return i}if(5===arguments.length)for(var u=arguments[0],f=arguments[1],e=arguments[2],o=arguments[3],s=arguments[4],n=0;n<s;n++)e[o+n]=new r(u[f+n])};w.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};w.envelope=function(n){for(var i=new p,t=0;t<n.length;t++)i.expandToInclude(n[t]);return i};w.toCoordinateArray=function(n){return n.toArray(w.coordArrayType)};w.atLeastNCoordinatesOrNothing=function(n,t){return t.length>=n?t:[]};w.indexOf=function(n,t){for(var i=0;i<t.length;i++)if(n.equals(t[i]))return i;return-1};w.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};w.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};w.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};w.extract=function(n,t,i){var r,u,e,f;if(t=br.clamp(t,0,n.length),i=br.clamp(i,-1,n.length),r=i-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};i(np.prototype,{compare:function(n,t){var i=n,r=t;return w.compare(i,r)},interfaces_:function(){return[ve]},getClass:function(){return np}});i(tp.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=w.compare(i,r),w.isEqualReversed(i,r)?0:u)},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=w.increasingDirection(i),e=w.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},interfaces_:function(){return[ve]},getClass:function(){return tp}});w.ForwardComparator=np;w.BidirectionalComparator=tp;w.coordArrayType=new Array(0).fill(null);ao.prototype.get=function(){};ao.prototype.put=function(){};ao.prototype.size=function(){};ao.prototype.values=function(){};ao.prototype.entrySet=function(){};nb.prototype=new ao;ha.prototype=new yt;ha.prototype.contains=function(){};li.prototype=new ha;li.prototype.contains=function(n){for(var t=0,i=this.array_.length;t<i;t++)if(this.array_[t]===n)return!0;return!1};li.prototype.add=function(n){return!this.contains(n)&&(this.array_.push(n),!0)};li.prototype.addAll=function(n){for(var t=n.iterator();t.hasNext();)this.add(t.next());return!0};li.prototype.remove=function(){throw new javascript.util.OperationNotSupported;};li.prototype.size=function(){return this.array_.length};li.prototype.isEmpty=function(){return 0===this.array_.length};li.prototype.toArray=function(){for(var t=[],n=0,i=this.array_.length;n<i;n++)t.push(this.array_[n]);return t};li.prototype.iterator=function(){return new ta(this)};ta=function(n){this.hashSet_=n;this.position_=0};ta.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new vs;return this.hashSet_.array_[this.position_++]};ta.prototype.hasNext=function(){return this.position_<this.hashSet_.size()};ta.prototype.remove=function(){throw new bh;};hf=0;ui.prototype=new nb;ui.prototype.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};ui.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:hf,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:hf,getValue:function(){return this.value},getKey:function(){return this.key}},f<0?r.left=u:r.right=u,this.fixAfterInsertion(u),this.size_++,null};ui.prototype.fixAfterInsertion=function(n){var t;for(n.color=1;null!=n&&n!=this.root_&&1==n.parent.color;)at(n)==ip(at(at(n)))?(t=ib(at(at(n))),1==tb(t)?(yf(at(n),hf),yf(t,hf),yf(at(at(n)),1),n=at(at(n))):(n==ib(at(n))&&(n=at(n),this.rotateLeft(n)),yf(at(n),hf),yf(at(at(n)),1),this.rotateRight(at(at(n))))):(t=ip(at(at(n))),1==tb(t)?(yf(at(n),hf),yf(t,hf),yf(at(at(n)),1),n=at(at(n))):(n==ip(at(n))&&(n=at(n),this.rotateRight(n)),yf(at(n),hf),yf(at(at(n)),1),this.rotateLeft(at(at(n)))));this.root_.color=hf};ui.prototype.values=function(){var t=new u,n=this.getFirstEntry();if(null!==n)for(t.add(n.value);null!==(n=ui.successor(n));)t.add(n.value);return t};ui.prototype.entrySet=function(){var t=new li,n=this.getFirstEntry();if(null!==n)for(t.add(n);null!==(n=ui.successor(n));)t.add(n);return t};ui.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}};ui.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}};ui.prototype.getFirstEntry=function(){var n=this.root_;if(null!=n)for(;null!=n.left;)n=n.left;return n};ui.successor=function(n){var t,i;if(null===n)return null;if(null!==n.right){for(t=n.right;null!==t.left;)t=t.left;return t}for(t=n.parent,i=n;null!==t&&i===t.right;)i=t,t=t.parent;return t};ui.prototype.size=function(){return this.size_};i(ca.prototype,{interfaces_:function(){return[]},getClass:function(){return ca}});rb.prototype=new ha;di.prototype=new rb;di.prototype.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};di.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};di.prototype.addAll=function(n){for(var t=n.iterator();t.hasNext();)this.add(t.next());return!0};di.prototype.remove=function(){throw new bh;};di.prototype.size=function(){return this.array_.length};di.prototype.isEmpty=function(){return 0===this.array_.length};di.prototype.toArray=function(){for(var t=[],n=0,i=this.array_.length;n<i;n++)t.push(this.array_[n]);return t};di.prototype.iterator=function(){return new ia(this)};ia=function(n){this.treeSet_=n;this.position_=0};ia.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new vs;return this.treeSet_.array_[this.position_++]};ia.prototype.hasNext=function(){return this.position_<this.treeSet_.size()};ia.prototype.remove=function(){throw new bh;};pf.sort=function(){var t,i,f,r,n=arguments[0],u;if(1===arguments.length)return r=function(n,t){return n.compareTo(t)},void n.sort(r);if(2===arguments.length)f=arguments[1],r=function(n,t){return f.compare(n,t)},n.sort(r);else{if(3===arguments.length){for(i=n.slice(arguments[1],arguments[2]),i.sort(),u=n.slice(0,arguments[1]).concat(i,n.slice(arguments[2],n.length)),n.splice(0,n.length),t=0;t<u.length;t++)n.push(u[t]);return}if(4===arguments.length){for(i=n.slice(arguments[1],arguments[2]),f=arguments[3],r=function(n,t){return f.compare(n,t)},i.sort(r),u=n.slice(0,arguments[1]).concat(i,n.slice(arguments[2],n.length)),n.splice(0,n.length),t=0;t<u.length;t++)n.push(u[t]);return}}};pf.asList=function(n){for(var i=new u,t=0,r=n.length;t<r;t++)i.add(n[t]);return i};i(e.prototype,{interfaces_:function(){return[]},getClass:function(){return e}});e.toDimensionSymbol=function(n){switch(n){case e.FALSE:return e.SYM_FALSE;case e.TRUE:return e.SYM_TRUE;case e.DONTCARE:return e.SYM_DONTCARE;case e.P:return e.SYM_P;case e.L:return e.SYM_L;case e.A:return e.SYM_A}throw new ct("Unknown dimension value: "+n);};e.toDimensionValue=function(n){switch(kh.toUpperCase(n)){case e.SYM_FALSE:return e.FALSE;case e.SYM_TRUE:return e.TRUE;case e.SYM_DONTCARE:return e.DONTCARE;case e.SYM_P:return e.P;case e.SYM_L:return e.L;case e.SYM_A:return e.A}throw new ct("Unknown dimension symbol: "+n);};e.P=0;e.L=1;e.A=2;e.FALSE=-1;e.TRUE=-2;e.DONTCARE=-3;e.SYM_FALSE="F";e.SYM_TRUE="T";e.SYM_DONTCARE="*";e.SYM_P="0";e.SYM_L="1";e.SYM_A="2";i(wf.prototype,{filter:function(){},interfaces_:function(){return[]},getClass:function(){return wf}});i(vo.prototype,{filter:function(){},isDone:function(){},isGeometryChanged:function(){},interfaces_:function(){return[]},getClass:function(){return vo}});y(nt,h);i(nt.prototype,{computeEnvelopeInternal:function(){for(var t=new p,n=0;n<this.geometries.length;n++)t.expandToInclude(this.geometries[n].getEnvelopeInternal());return t},getGeometryN:function(n){return this.geometries[n]},getSortIndex:function(){return h.SORTINDEX_GEOMETRYCOLLECTION},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++)u++,r[u]=i[n];return r},getArea:function(){for(var t=0,n=0;n<this.geometries.length;n++)t+=this.geometries[n].getArea();return t},equalsExact:function(){var t,r,i,n;if(2===arguments.length){if((t=arguments[0],r=arguments[1],!this.isEquivalentClass(t))||(i=t,this.geometries.length!==i.geometries.length))return!1;for(n=0;n<this.geometries.length;n++)if(!this.geometries[n].equalsExact(i.geometries[n],r))return!1;return!0}return h.prototype.equalsExact.apply(this,arguments)},normalize:function(){for(var n=0;n<this.geometries.length;n++)this.geometries[n].normalize();pf.sort(this.geometries)},getCoordinate:function(){return this.isEmpty()?null:this.geometries[0].getCoordinate()},getBoundaryDimension:function(){for(var n=e.FALSE,t=0;t<this.geometries.length;t++)n=Math.max(n,this.geometries[t].getBoundaryDimension());return n},getDimension:function(){for(var n=e.FALSE,t=0;t<this.geometries.length;t++)n=Math.max(n,this.geometries[t].getDimension());return n},getLength:function(){for(var t=0,n=0;n<this.geometries.length;n++)t+=this.geometries[n].getLength();return t},getNumPoints:function(){for(var t=0,n=0;n<this.geometries.length;n++)t+=this.geometries[n].getNumPoints();return t},getNumGeometries:function(){return this.geometries.length},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)},compareToSameClass:function(){if(1===arguments.length){var f=arguments[0],e=new di(pf.asList(this.geometries)),o=new di(pf.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}},apply:function(){var u,t,i,r,n;if(l(arguments[0],pe))for(u=arguments[0],n=0;n<this.geometries.length;n++)this.geometries[n].apply(u);else if(l(arguments[0],vo)){if(t=arguments[0],0===this.geometries.length)return null;for(n=0;n<this.geometries.length&&(this.geometries[n].apply(t),!t.isDone());n++);t.isGeometryChanged()&&this.geometryChanged()}else if(l(arguments[0],wf))for(i=arguments[0],i.filter(this),n=0;n<this.geometries.length;n++)this.geometries[n].apply(i);else if(l(arguments[0],yu))for(r=arguments[0],r.filter(this),n=0;n<this.geometries.length;n++)this.geometries[n].apply(r)},getBoundary:function(){return this.checkNotGeometryCollection(this),c.shouldNeverReachHere(),null},clone:function(){var t=h.prototype.clone.call(this),n;for(t.geometries=new Array(this.geometries.length).fill(null),n=0;n<this.geometries.length;n++)t.geometries[n]=this.geometries[n].clone();return t},getGeometryType:function(){return"GeometryCollection"},copy:function(){for(var t=new Array(this.geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this.geometries[n].copy();return new nt(t,this.factory)},isEmpty:function(){for(var n=0;n<this.geometries.length;n++)if(!this.geometries[n].isEmpty())return!1;return!0},interfaces_:function(){return[]},getClass:function(){return nt}});nt.serialVersionUID=-0x4f07bcb1f857d800;y(cr,nt);i(cr.prototype,{getSortIndex:function(){return h.SORTINDEX_MULTILINESTRING},equalsExact:function(){if(2===arguments.length){var n=arguments[0],t=arguments[1];return!!this.isEquivalentClass(n)&&nt.prototype.equalsExact.call(this,n,t)}return nt.prototype.equalsExact.apply(this,arguments)},getBoundaryDimension:function(){return this.isClosed()?e.FALSE:0},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},getDimension:function(){return 1},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)},getBoundary:function(){return new ee(this).getBoundary()},getGeometryType:function(){return"MultiLineString"},copy:function(){for(var t=new Array(this.geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this.geometries[n].copy();return new cr(t,this.factory)},interfaces_:function(){return[ca]},getClass:function(){return cr}});cr.serialVersionUID=0x7155d2ab4afa8000;i(ee.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)},getBoundary:function(){return this.geom instanceof d?this.boundaryLineString(this.geom):this.geom instanceof cr?this.boundaryMultiLineString(this.geom):this.geom.getBoundary()},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()])},getEmptyMultiPoint:function(){return this.geomFact.createMultiPoint()},computeBoundaryCoordinates:function(n){var f=new u,i,t,r;for(this.endpointMap=new ui,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();){var e=r.next(),o=e.getValue(),s=o.count;this.bnRule.isInBoundary(s)&&f.add(e.getKey())}return w.toCoordinateArray(f)},addEndpoint:function(n){var t=this.endpointMap.get(n);null===t&&(t=new rp,this.endpointMap.put(n,t));t.count++},interfaces_:function(){return[]},getClass:function(){return ee}});ee.getBoundary=function(){var t,n;if(1===arguments.length)return t=arguments[0],n=new ee(t),n.getBoundary();if(2===arguments.length){var i=arguments[0],r=arguments[1],n=new ee(i,r);return n.getBoundary()}};i(rp.prototype,{interfaces_:function(){return[]},getClass:function(){return rp}});i(kr.prototype,{interfaces_:function(){return[]},getClass:function(){return kr}});kr.chars=function(n,t){for(var r=new Array(t).fill(null),i=0;i<t;i++)r[i]=n;return new String(r)};kr.getStackTrace=function(){if(1===arguments.length){var n=arguments[0],t=new sk,u=new fk(t);return n.printStackTrace(u),t.toString()}if(2===arguments.length){for(var f=arguments[0],e=arguments[1],i="",o=new ek(kr.getStackTrace(f)),s=new ck(o),r=0;r<e;r++)try{i+=s.readLine()+kr.NEWLINE}catch(n){if(!(n instanceof hk))throw n;c.shouldNeverReachHere()}return i}};kr.split=function(n,t){for(var s,o,r,h=t.length,f=new u,i=""+n,e=i.indexOf(t);e>=0;)s=i.substring(0,e),f.add(s),i=i.substring(e+h),e=i.indexOf(t);for(i.length>0&&f.add(i),o=new Array(f.size()).fill(null),r=0;r<o.length;r++)o[r]=f.get(r);return o};kr.toString=function(){if(1===arguments.length){var n=arguments[0];return kr.SIMPLE_ORDINATE_FORMAT.format(n)}};kr.spaces=function(n){return kr.chars(" ",n)};kr.NEWLINE=pt.getProperty("line.separator");kr.SIMPLE_ORDINATE_FORMAT=new ok("0.#");i(ri.prototype,{interfaces_:function(){return[]},getClass:function(){return ri}});ri.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))};ri.isRing=function(n){var t=n.size();return 0===t||!(t<=3)&&n.getOrdinate(0,lt.X)===n.getOrdinate(t-1,lt.X)&&n.getOrdinate(0,lt.Y)===n.getOrdinate(t-1,lt.Y)};ri.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)||v.isNaN(e)&&v.isNaN(o)))return!1;return!0};ri.extend=function(n,t,i){var f=n.create(i,t.getDimension()),r=t.size(),u;if(ri.copy(t,0,f,0,r),r>0)for(u=r;u<i;u++)ri.copy(t,r-1,f,u,1);return f};ri.reverse=function(n){for(var i=n.size()-1,r=Math.trunc(i/2),t=0;t<=r;t++)ri.swap(n,t,i-t)};ri.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)};ri.copy=function(n,t,i,r,u){for(var f=0;f<u;f++)ri.copyCoord(n,t+f,i,r+f)};ri.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 eu,n.append("("),t=0;t<u;t++)for(t>0&&n.append(" "),i=0;i<f;i++)i>0&&n.append(","),n.append(kr.toString(r.getOrdinate(t,i)));return n.append(")"),n.toString()}};ri.ensureValidRing=function(n,t){var i=t.size();return 0===i?t:i<=3?ri.createClosedRing(n,t,4):t.getOrdinate(0,lt.X)===t.getOrdinate(i-1,lt.X)&&t.getOrdinate(0,lt.Y)===t.getOrdinate(i-1,lt.Y)?t:ri.createClosedRing(n,t,i+1)};ri.createClosedRing=function(n,t,i){var u=n.create(i,t.getDimension()),f=t.size(),r;for(ri.copy(t,0,u,0,f),r=f;r<i;r++)ri.copy(t,0,u,r,1);return u};y(d,h);i(d.prototype,{computeEnvelopeInternal:function(){return this.isEmpty()?new p:this.points.expandEnvelope(new p)},isRing:function(){return this.isClosed()&&this.isSimple()},getSortIndex:function(){return h.SORTINDEX_LINESTRING},getCoordinates:function(){return this.points.toCoordinateArray()},equalsExact:function(){var t,r,i,n;if(2===arguments.length){if((t=arguments[0],r=arguments[1],!this.isEquivalentClass(t))||(i=t,this.points.size()!==i.points.size()))return!1;for(n=0;n<this.points.size();n++)if(!this.equal(this.points.getCoordinate(n),i.points.getCoordinate(n),r))return!1;return!0}return h.prototype.equalsExact.apply(this,arguments)},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&&ri.reverse(this.points),null},getCoordinate:function(){return this.isEmpty()?null:this.points.getCoordinate(0)},getBoundaryDimension:function(){return this.isClosed()?e.FALSE:0},isClosed:function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},getEndPoint:function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},getDimension:function(){return 1},getLength:function(){return s.computeLength(this.points)},getNumPoints:function(){return this.points.size()},reverse:function(){var n=this.points.copy();return ri.reverse(n),this.getFactory().createLineString(n)},compareToSameClass:function(){var r;if(1===arguments.length){for(var u=arguments[0],n=u,t=0,i=0;t<this.points.size()&&i<n.points.size();){if(r=this.points.getCoordinate(t).compareTo(n.points.getCoordinate(i)),0!==r)return r;t++;i++}return t<this.points.size()?1:i<n.points.size()?-1:0}if(2===arguments.length){var f=arguments[0],e=arguments[1],n=f;return e.compare(this.points,n.points)}},apply:function(){var i,t,n,r,u;if(l(arguments[0],pe))for(i=arguments[0],n=0;n<this.points.size();n++)i.filter(this.points.getCoordinate(n));else if(l(arguments[0],vo)){if(t=arguments[0],0===this.points.size())return null;for(n=0;n<this.points.size()&&(t.filter(this.points,n),!t.isDone());n++);t.isGeometryChanged()&&this.geometryChanged()}else l(arguments[0],wf)?(r=arguments[0],r.filter(this)):l(arguments[0],yu)&&(u=arguments[0],u.filter(this))},getBoundary:function(){return new ee(this).getBoundary()},isEquivalentClass:function(n){return n instanceof d},clone:function(){var n=h.prototype.clone.call(this);return n.points=this.points.clone(),n},getCoordinateN:function(n){return this.points.getCoordinate(n)},getGeometryType:function(){return"LineString"},copy:function(){return new d(this.points.copy(),this.factory)},getCoordinateSequence:function(){return this.points},isEmpty:function(){return 0===this.points.size()},init:function(n){if(null===n&&(n=this.getFactory().getCoordinateSequenceFactory().create([])),1===n.size())throw new ct("Invalid number of points in LineString (found "+n.size()+" - must be 0 or >= 2)");this.points=n},isCoordinate:function(n){for(var t=0;t<this.points.size();t++)if(this.points.getCoordinate(t).equals(n))return!0;return!1},getStartPoint:function(){return this.isEmpty()?null:this.getPointN(0)},getPointN:function(n){return this.getFactory().createPoint(this.points.getCoordinate(n))},interfaces_:function(){return[ca]},getClass:function(){return d}});d.serialVersionUID=0x2b2b51ba435c8e00;i(la.prototype,{interfaces_:function(){return[]},getClass:function(){return la}});y(bt,h);i(bt.prototype,{computeEnvelopeInternal:function(){if(this.isEmpty())return new p;var n=new p;return n.expandToInclude(this.coordinates.getX(0),this.coordinates.getY(0)),n},getSortIndex:function(){return h.SORTINDEX_POINT},getCoordinates:function(){return this.isEmpty()?[]:[this.getCoordinate()]},equalsExact:function(){if(2===arguments.length){var n=arguments[0],t=arguments[1];return!!this.isEquivalentClass(n)&&(!(!this.isEmpty()||!n.isEmpty())||this.isEmpty()===n.isEmpty()&&this.equal(n.getCoordinate(),this.getCoordinate(),t))}return h.prototype.equalsExact.apply(this,arguments)},normalize:function(){},getCoordinate:function(){return 0!==this.coordinates.size()?this.coordinates.getCoordinate(0):null},getBoundaryDimension:function(){return e.FALSE},getDimension:function(){return 0},getNumPoints:function(){return this.isEmpty()?0:1},reverse:function(){return this.copy()},getX:function(){if(null===this.getCoordinate())throw new IllegalStateException("getX called on empty Point");return this.getCoordinate().x},compareToSameClass:function(){var t,n;if(1===arguments.length)return t=arguments[0],n=t,this.getCoordinate().compareTo(n.getCoordinate());if(2===arguments.length){var i=arguments[0],r=arguments[1],n=i;return r.compare(this.coordinates,n.coordinates)}},apply:function(){var t,n,i,r;if(l(arguments[0],pe)){if(t=arguments[0],this.isEmpty())return null;t.filter(this.getCoordinate())}else if(l(arguments[0],vo)){if(n=arguments[0],this.isEmpty())return null;n.filter(this.coordinates,0);n.isGeometryChanged()&&this.geometryChanged()}else l(arguments[0],wf)?(i=arguments[0],i.filter(this)):l(arguments[0],yu)&&(r=arguments[0],r.filter(this))},getBoundary:function(){return this.getFactory().createGeometryCollection(null)},clone:function(){var n=h.prototype.clone.call(this);return n.coordinates=this.coordinates.clone(),n},getGeometryType:function(){return"Point"},copy:function(){return new bt(this.coordinates.copy(),this.factory)},getCoordinateSequence:function(){return this.coordinates},getY:function(){if(null===this.getCoordinate())throw new IllegalStateException("getY called on empty Point");return this.getCoordinate().y},isEmpty:function(){return 0===this.coordinates.size()},init:function(n){null===n&&(n=this.getFactory().getCoordinateSequenceFactory().create([]));c.isTrue(n.size()<=1);this.coordinates=n},isSimple:function(){return!0},interfaces_:function(){return[la]},getClass:function(){return bt}});bt.serialVersionUID=0x44077bad161cbc00;i(bf.prototype,{interfaces_:function(){return[]},getClass:function(){return bf}});y(st,h);i(st.prototype,{computeEnvelopeInternal:function(){return this.shell.getEnvelopeInternal()},getSortIndex:function(){return h.SORTINDEX_POLYGON},getCoordinates:function(){var t,f,i;if(this.isEmpty())return[];for(var r=new Array(this.getNumPoints()).fill(null),n=-1,e=this.shell.getCoordinates(),u=0;u<e.length;u++)n++,r[n]=e[u];for(t=0;t<this.holes.length;t++)for(f=this.holes[t].getCoordinates(),i=0;i<f.length;i++)n++,r[n]=f[i];return r},getArea:function(){var t=0,n;for(t+=Math.abs(s.signedArea(this.shell.getCoordinateSequence())),n=0;n<this.holes.length;n++)t-=Math.abs(s.signedArea(this.holes[n].getCoordinateSequence()));return t},isRectangle:function(){var t,i;if(0!==this.getNumInteriorRing()||null===this.shell||5!==this.shell.getNumPoints())return!1;for(var r=this.shell.getCoordinateSequence(),u=this.getEnvelopeInternal(),n=0;n<5;n++)if((t=r.getX(n),t!==u.getMinX()&&t!==u.getMaxX())||(i=r.getY(n),i!==u.getMinY()&&i!==u.getMaxY()))return!1;for(var f=r.getX(0),e=r.getY(0),n=1;n<=4;n++){if(t=r.getX(n),i=r.getY(n),t!==f==(i!==e))return!1;f=t;e=i}return!0},equalsExact:function(){var t,i,n;if(2===arguments.length){if(t=arguments[0],i=arguments[1],!this.isEquivalentClass(t))return!1;var r=t,u=this.shell,f=r.shell;if(!u.equalsExact(f,i)||this.holes.length!==r.holes.length)return!1;for(n=0;n<this.holes.length;n++)if(!this.holes[n].equalsExact(r.holes[n],i))return!1;return!0}return h.prototype.equalsExact.apply(this,arguments)},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);pf.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);pt.arraycopy(n.getCoordinates(),0,t,0,t.length);u=w.minCoordinate(n.getCoordinates());w.scroll(t,u);pt.arraycopy(t,0,n.getCoordinates(),0,t.length);n.getCoordinates()[t.length]=t[0];s.isCCW(n.getCoordinates())===r&&w.reverse(n.getCoordinates())}},getCoordinate:function(){return this.shell.getCoordinate()},getNumInteriorRing:function(){return this.holes.length},getBoundaryDimension:function(){return 1},getDimension:function(){return 2},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},getNumPoints:function(){for(var t=this.shell.getNumPoints(),n=0;n<this.holes.length;n++)t+=this.holes[n].getNumPoints();return t},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},convexHull:function(){return this.getExteriorRing().convexHull()},compareToSameClass:function(){if(1===arguments.length){var h=arguments[0],t=this.shell,i=h.shell;return t.compareToSameClass(i)}if(2===arguments.length){var c=arguments[0],u=arguments[1],r=c,t=this.shell,i=r.shell,f=t.compareToSameClass(i,u);if(0!==f)return f;for(var e=this.getNumInteriorRing(),o=r.getNumInteriorRing(),n=0;n<e&&n<o;){var l=this.getInteriorRingN(n),a=r.getInteriorRingN(n),s=l.compareToSameClass(a,u);if(0!==s)return s;n++}return n<e?1:n<o?-1:0}},apply:function(){var r,t,u,i,n;if(l(arguments[0],pe))for(r=arguments[0],this.shell.apply(r),n=0;n<this.holes.length;n++)this.holes[n].apply(r);else if(l(arguments[0],vo)){if(t=arguments[0],this.shell.apply(t),!t.isDone())for(n=0;n<this.holes.length&&(this.holes[n].apply(t),!t.isDone());n++);t.isGeometryChanged()&&this.geometryChanged()}else if(l(arguments[0],wf))u=arguments[0],u.filter(this);else if(l(arguments[0],yu))for(i=arguments[0],i.filter(this),this.shell.apply(i),n=0;n<this.holes.length;n++)this.holes[n].apply(i)},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)},clone:function(){var t=h.prototype.clone.call(this),n;for(t.shell=this.shell.clone(),t.holes=new Array(this.holes.length).fill(null),n=0;n<this.holes.length;n++)t.holes[n]=this.holes[n].clone();return t},getGeometryType:function(){return"Polygon"},copy:function(){for(var i=this.shell.copy(),t=new Array(this.holes.length).fill(null),n=0;n<t.length;n++)t[n]=this.holes[n].copy();return new st(i,t,this.factory)},getExteriorRing:function(){return this.shell},isEmpty:function(){return this.shell.isEmpty()},getInteriorRingN:function(n){return this.holes[n]},interfaces_:function(){return[bf]},getClass:function(){return st}});st.serialVersionUID=-0x307ffefd8dc97200;y(lr,nt);i(lr.prototype,{getSortIndex:function(){return h.SORTINDEX_MULTIPOINT},isValid:function(){return!0},equalsExact:function(){if(2===arguments.length){var n=arguments[0],t=arguments[1];return!!this.isEquivalentClass(n)&&nt.prototype.equalsExact.call(this,n,t)}return nt.prototype.equalsExact.apply(this,arguments)},getCoordinate:function(){if(1===arguments.length){var n=arguments[0];return this.geometries[n].getCoordinate()}return nt.prototype.getCoordinate.apply(this,arguments)},getBoundaryDimension:function(){return e.FALSE},getDimension:function(){return 0},getBoundary:function(){return this.getFactory().createGeometryCollection(null)},getGeometryType:function(){return"MultiPoint"},copy:function(){for(var t=new Array(this.geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this.geometries[n].copy();return new lr(t,this.factory)},interfaces_:function(){return[la]},getClass:function(){return lr}});lr.serialVersionUID=-0x6fb1ed4162e0fc00;y(gt,d);i(gt.prototype,{getSortIndex:function(){return h.SORTINDEX_LINEARRING},getBoundaryDimension:function(){return e.FALSE},isClosed:function(){return!!this.isEmpty()||d.prototype.isClosed.call(this)},reverse:function(){var n=this.points.copy();return ri.reverse(n),this.getFactory().createLinearRing(n)},validateConstruction:function(){if(!this.isEmpty()&&!d.prototype.isClosed.call(this))throw new ct("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<gt.MINIMUM_VALID_SIZE)throw new ct("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)");},getGeometryType:function(){return"LinearRing"},copy:function(){return new gt(this.points.copy(),this.factory)},interfaces_:function(){return[]},getClass:function(){return gt}});gt.MINIMUM_VALID_SIZE=4;gt.serialVersionUID=-0x3b229e262367a600;y(ai,nt);i(ai.prototype,{getSortIndex:function(){return h.SORTINDEX_MULTIPOLYGON},equalsExact:function(){if(2===arguments.length){var n=arguments[0],t=arguments[1];return!!this.isEquivalentClass(n)&&nt.prototype.equalsExact.call(this,n,t)}return nt.prototype.equalsExact.apply(this,arguments)},getBoundaryDimension:function(){return 1},getDimension:function(){return 2},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)},getBoundary:function(){var n,t,f;if(this.isEmpty())return this.getFactory().createMultiLineString();for(n=new u,t=0;t<this.geometries.length;t++)for(var e=this.geometries[t],r=e.getBoundary(),i=0;i<r.getNumGeometries();i++)n.add(r.getGeometryN(i));return f=new Array(n.size()).fill(null),this.getFactory().createMultiLineString(n.toArray(f))},getGeometryType:function(){return"MultiPolygon"},copy:function(){for(var t=new Array(this.geometries.length).fill(null),n=0;n<t.length;n++)t[n]=this.geometries[n].copy();return new ai(t,this.factory)},interfaces_:function(){return[bf]},getClass:function(){return ai}});ai.serialVersionUID=-0x7a5aa1369171980;i(dr.prototype,{setCopyUserData:function(n){this.isUserDataCopied=n},edit:function(n,t){if(null===n)return null;var i=this.editInternal(n,t);return this.isUserDataCopied&&i.setUserData(n.getUserData()),i},editInternal:function(n,t){return null===this.factory&&(this.factory=n.getFactory()),n instanceof nt?this.editGeometryCollection(n,t):n instanceof st?this.editPolygon(n,t):n instanceof bt?t.edit(n,this.factory):n instanceof d?t.edit(n,this.factory):(c.shouldNeverReachHere("Unsupported Geometry class: "+n.getClass().getName()),null)},editGeometryCollection:function(n,t){for(var f,i=t.edit(n,this.factory),r=new u,e=0;e<i.getNumGeometries();e++)f=this.edit(i.getGeometryN(e),t),null===f||f.isEmpty()||r.add(f);return i.getClass()===lr?this.factory.createMultiPoint(r.toArray([])):i.getClass()===cr?this.factory.createMultiLineString(r.toArray([])):i.getClass()===ai?this.factory.createMultiPolygon(r.toArray([])):this.factory.createGeometryCollection(r.toArray([]))},editPolygon:function(n,t){var i=t.edit(n,this.factory),r,o,f,e;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 u,f=0;f<i.getNumInteriorRing();f++)e=this.edit(i.getInteriorRingN(f),t),null===e||e.isEmpty()||o.add(e);return this.factory.createPolygon(r,o.toArray([]))},interfaces_:function(){return[]},getClass:function(){return dr}});dr.GeometryEditorOperation=aa;i(up.prototype,{edit:function(n){return n},interfaces_:function(){return[aa]},getClass:function(){return up}});i(fp.prototype,{edit:function(n,t){var i=this.editCoordinates(n.getCoordinates(),n);return null===i?n:n instanceof gt?t.createLinearRing(i):n instanceof d?t.createLineString(i):n instanceof bt?i.length>0?t.createPoint(i[0]):t.createPoint():n},interfaces_:function(){return[aa]},getClass:function(){return fp}});i(ep.prototype,{edit:function(n,t){return n instanceof gt?t.createLinearRing(this.edit(n.getCoordinateSequence(),n)):n instanceof d?t.createLineString(this.edit(n.getCoordinateSequence(),n)):n instanceof bt?t.createPoint(this.edit(n.getCoordinateSequence(),n)):n},interfaces_:function(){return[aa]},getClass:function(){return ep}});dr.NoOpGeometryOperation=up;dr.CoordinateOperation=fp;dr.CoordinateSequenceOperation=ep;i(gr.prototype,{setOrdinate:function(n,t,i){switch(t){case lt.X:this.coordinates[n].x=i;break;case lt.Y:this.coordinates[n].y=i;break;case lt.Z:this.coordinates[n].z=i;break;default:throw new ct("invalid ordinateIndex");}},size:function(){return this.coordinates.length},getOrdinate:function(n,t){switch(t){case lt.X:return this.coordinates[n].x;case lt.Y:return this.coordinates[n].y;case lt.Z:return this.coordinates[n].z}return v.NaN},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)},getCoordinateCopy:function(n){return new r(this.coordinates[n])},getDimension:function(){return this.dimension},getX:function(n){return this.coordinates[n].x},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 gr(t,this.dimension)},expandEnvelope:function(n){for(var t=0;t<this.coordinates.length;t++)n.expandToInclude(this.coordinates[t]);return n},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 gr(t,this.dimension)},toString:function(){var n,t;if(this.coordinates.length>0){for(n=new eu(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"()"},getY:function(n){return this.coordinates[n].y},toCoordinateArray:function(){return this.coordinates},interfaces_:function(){return[lt,ir]},getClass:function(){return gr}});gr.serialVersionUID=-0xcb44a778db18e00;i(oe.prototype,{readResolve:function(){return oe.instance()},create:function(){if(1===arguments.length){if(arguments[0]instanceof Array||l(arguments[0],lt))return new gr(arguments[0])}else if(2===arguments.length){var t=arguments[0],n=arguments[1];return n>3&&(n=3),n<2?new gr(t):new gr(t,n)}},interfaces_:function(){return[ua,ir]},getClass:function(){return oe}});oe.instance=function(){return oe.instanceObject};oe.serialVersionUID=-0x38e49fa6cf6f2e00;oe.instanceObject=new oe;var cf,fd=Object.defineProperty,ed=function(n,t){function i(n){return this&&this.constructor===i?(this._keys=[],this._values=[],this._itp=[],this.objectOnly=t,void(n&&ak.call(this,n))):new i(n)}return t||fd(n,"size",{get:td}),n.constructor=i,i.prototype=n,i}({"delete":vk,has:wk,get:yk,set:bk,keys:dk,values:gk,entries:nd,forEach:id,clear:kk}),od="undefined"!=typeof Map&&Map.prototype.values?Map:ed;kf.prototype=new ao;kf.prototype.get=function(n){return this.map_.get(n)||null};kf.prototype.put=function(n,t){return this.map_.set(n,t),t};kf.prototype.values=function(){for(var t=new u,i=this.map_.values(),n=i.next();!n.done;)t.add(n.value),n=i.next();return t};kf.prototype.entrySet=function(){var n=new li;return this.map_.entries().forEach(function(t){return n.add(t)}),n};kf.prototype.size=function(){return this.map_.size()};i(ft.prototype,{equals:function(n){if(!(n instanceof ft))return!1;var t=n;return this.modelType===t.modelType&&this.scale===t.scale},compareTo:function(n){var t=n,i=this.getMaximumSignificantDigits(),r=t.getMaximumSignificantDigits();return new vu(i).compareTo(new vu(r))},getScale:function(){return this.scale},isFloating:function(){return this.modelType===ft.FLOATING||this.modelType===ft.FLOATING_SINGLE},getType:function(){return this.modelType},toString:function(){var n="UNKNOWN";return this.modelType===ft.FLOATING?n="Floating":this.modelType===ft.FLOATING_SINGLE?n="Floating-Single":this.modelType===ft.FIXED&&(n="Fixed (Scale="+this.getScale()+")"),n},makePrecise:function(){var n,t;if("number"==typeof arguments[0])return(n=arguments[0],v.isNaN(n))?n:this.modelType===ft.FLOATING_SINGLE?n:this.modelType===ft.FIXED?Math.round(n*this.scale)/this.scale:n;if(arguments[0]instanceof r){if(t=arguments[0],this.modelType===ft.FLOATING)return null;t.x=this.makePrecise(t.x);t.y=this.makePrecise(t.y)}},getMaximumSignificantDigits:function(){var n=16;return this.modelType===ft.FLOATING?n=16:this.modelType===ft.FLOATING_SINGLE?n=6:this.modelType===ft.FIXED&&(n=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),n},setScale:function(n){this.scale=Math.abs(n)},interfaces_:function(){return[ir,sr]},getClass:function(){return ft}});ft.mostPrecise=function(n,t){return n.compareTo(t)>=0?n:t};i(nf.prototype,{readResolve:function(){return nf.nameToTypeMap.get(this.name)},toString:function(){return this.name},interfaces_:function(){return[ir]},getClass:function(){return nf}});nf.serialVersionUID=-552860263173159e4;nf.nameToTypeMap=new kf;ft.Type=nf;ft.serialVersionUID=0x6bee6404e9a25c00;ft.FIXED=new nf("FIXED");ft.FLOATING=new nf("FLOATING");ft.FLOATING_SINGLE=new nf("FLOATING SINGLE");ft.maximumPreciseValue=9007199254740992;i(g.prototype,{toGeometry:function(n){return n.isNull()?this.createPoint(null):n.getMinX()===n.getMaxX()&&n.getMinY()===n.getMaxY()?this.createPoint(new r(n.getMinX(),n.getMinY())):n.getMinX()===n.getMaxX()||n.getMinY()===n.getMaxY()?this.createLineString([new r(n.getMinX(),n.getMinY()),new r(n.getMaxX(),n.getMaxY())]):this.createPolygon(this.createLinearRing([new r(n.getMinX(),n.getMinY()),new r(n.getMinX(),n.getMaxY()),new r(n.getMaxX(),n.getMaxY()),new r(n.getMaxX(),n.getMinY()),new r(n.getMinX(),n.getMinY())]),null)},createLineString:function(){if(0===arguments.length)return this.createLineString(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Array){var n=arguments[0];return this.createLineString(null!==n?this.getCoordinateSequenceFactory().create(n):null)}if(l(arguments[0],lt))return new d(arguments[0],this)}},createMultiLineString:function(){return 0===arguments.length?new cr(null,this):1===arguments.length?new cr(arguments[0],this):void 0},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(g.toGeometryArray(n));if(t=n.iterator().next(),n.size()>1){if(t instanceof st)return this.createMultiPolygon(g.toPolygonArray(n));if(t instanceof d)return this.createMultiLineString(g.toLineStringArray(n));if(t instanceof bt)return this.createMultiPoint(g.toPointArray(n));c.shouldNeverReachHere("Unhandled class: "+t.getClass().getName())}return t},createMultiPointFromCoords:function(n){return this.createMultiPoint(null!==n?this.getCoordinateSequenceFactory().create(n):null)},createPoint:function(){if(0===arguments.length)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof r){var n=arguments[0];return this.createPoint(null!==n?this.getCoordinateSequenceFactory().create([n]):null)}if(l(arguments[0],lt))return new bt(arguments[0],this)}},getCoordinateSequenceFactory:function(){return this.coordinateSequenceFactory},createPolygon:function(){var n,t,i,r,u;if(0===arguments.length)return new st(null,null,this);if(1===arguments.length){if(l(arguments[0],lt))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 gt)return i=arguments[0],this.createPolygon(i,null)}else if(2===arguments.length)return r=arguments[0],u=arguments[1],new st(r,u,this)},getSRID:function(){return this.SRID},createGeometryCollection:function(){return 0===arguments.length?new nt(null,this):1===arguments.length?new nt(arguments[0],this):void 0},createGeometry:function(n){return new dr(this).edit(n,{edit:function(){if(2===arguments.length){var n=arguments[0];return arguments[1],this.coordinateSequenceFactory.create(n)}}})},getPrecisionModel:function(){return this.precisionModel},createLinearRing:function(){if(0===arguments.length)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Array){var n=arguments[0];return this.createLinearRing(null!==n?this.getCoordinateSequenceFactory().create(n):null)}if(l(arguments[0],lt))return new gt(arguments[0],this)}},createMultiPolygon:function(){return 0===arguments.length?new ai(null,this):1===arguments.length?new ai(arguments[0],this):void 0},createMultiPoint:function(){var i,n,r,t,u;if(0===arguments.length)return new lr(null,this);if(1===arguments.length){if(arguments[0]instanceof Array)return new lr(arguments[0],this);if(arguments[0]instanceof Array)return i=arguments[0],this.createMultiPoint(null!==i?this.getCoordinateSequenceFactory().create(i):null);if(l(arguments[0],lt)){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()),ri.copy(n,t,u,0,1),r[t]=this.createPoint(u);return this.createMultiPoint(r)}}},interfaces_:function(){return[ir]},getClass:function(){return g}});g.toMultiPolygonArray=function(n){var t=new Array(n.size()).fill(null);return n.toArray(t)};g.toGeometryArray=function(n){if(null===n)return null;var t=new Array(n.size()).fill(null);return n.toArray(t)};g.getDefaultCoordinateSequenceFactory=function(){return oe.instance()};g.toMultiLineStringArray=function(n){var t=new Array(n.size()).fill(null);return n.toArray(t)};g.toLineStringArray=function(n){var t=new Array(n.size()).fill(null);return n.toArray(t)};g.toMultiPointArray=function(n){var t=new Array(n.size()).fill(null);return n.toArray(t)};g.toLinearRingArray=function(n){var t=new Array(n.size()).fill(null);return n.toArray(t)};g.toPointArray=function(n){var t=new Array(n.size()).fill(null);return n.toArray(t)};g.toPolygonArray=function(n){var t=new Array(n.size()).fill(null);return n.toArray(t)};g.createPointFromInternalCoord=function(n,t){return t.getPrecisionModel().makePrecise(n),t.getFactory().createPoint(n)};g.serialVersionUID=-0x5ea75f2051eeb400;lu={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*$/};i(sp.prototype,{read:function(n){var i,r,u,t;if(n=n.replace(/[\n\r]/g," "),t=lu.typeStr.exec(n),-1!==n.search("EMPTY")&&(t=lu.emptyTypeStr.exec(n),t[2]=void 0),t&&(r=t[1].toLowerCase(),u=t[2],ls[r]&&(i=ls[r].apply(this,[u]))),void 0===i)throw new Error("Could not parse WKT "+n);return i},write:function(n){return this.extractGeometry(n)},extractGeometry:function(n){var t=n.getGeometryType().toLowerCase(),i;return lf[t]?(i=t.toUpperCase(),n.isEmpty()?i+" EMPTY":i+"("+lf[t].apply(this,[n])+")"):null}});lf={coordinate:function(n){return n.x+" "+n.y},point:function(n){return lf.coordinate.call(this,n.coordinates.coordinates[0])},multipoint:function(n){for(var i=[],t=0,r=n.geometries.length;t<r;++t)i.push("("+lf.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(lf.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(lf.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("("+lf.linestring.apply(this,[n.geometries[t]])+")");return i.join(",")},polygon:function(n){var i=[],t,r;for(i.push("("+lf.linestring.apply(this,[n.shell])+")"),t=0,r=n.holes.length;t<r;++t)i.push("("+lf.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("("+lf.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(",")}};ls={point:function(n){if(void 0===n)return this.geometryFactory.createPoint();var t=n.trim().split(lu.spaces);return this.geometryFactory.createPoint(new r(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(lu.trimParens,"$1"),u.push(ls.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=[],i=0,e=u.length;i<e;++i)t=u[i].trim().split(lu.spaces),f.push(new r(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=[],i=0,e=u.length;i<e;++i)t=u[i].trim().split(lu.spaces),f.push(new r(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(lu.parenComma),u=[],t=0,f=r.length;t<f;++t)i=r[t].replace(lu.trimParens,"$1"),u.push(ls.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(lu.parenComma),o=[],t=0,s=e.length;t<s;++t)r=e[t].replace(lu.trimParens,"$1"),u=ls.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(lu.doubleParenComma),u=[],t=0,f=r.length;t<f;++t)i=r[t].replace(lu.trimParens,"$1"),u.push(ls.polygon.apply(this,[i]));return this.geometryFactory.createMultiPolygon(u)},geometrycollection:function(n){if(void 0===n)return this.geometryFactory.createGeometryCollection();n=n.replace(/,\s*([A-Za-z])/g,"|$1");for(var i=n.trim().split("|"),r=[],t=0,u=i.length;t<u;++t)r.push(this.read(i[t]));return this.geometryFactory.createGeometryCollection(r)}};i(pi.prototype,{write:function(n){return this.parser.write(n)}});i(pi,{toLineString:function(n,t){if(2!==arguments.length)throw new Error("Not implemented");return"LINESTRING ( "+n.x+" "+n.y+", "+t.x+" "+t.y+" )"}});i(ht.prototype,{getIndexAlongSegment:function(n,t){return this.computeIntLineIndex(),this.intLineIndex[n][t]},getTopologySummary:function(){var n=new eu;return this.isEndPoint()&&n.append(" endpoint"),this._isProper&&n.append(" proper"),this.isCollinear()&&n.append(" collinear"),n.toString()},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)},getIntersectionNum:function(){return this.result},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],t=this.getEdgeDistance(n,0),i=this.getEdgeDistance(n,1);t>i?(this.intLineIndex[n][0]=0,this.intLineIndex[n][1]=1):(this.intLineIndex[n][0]=1,this.intLineIndex[n][1]=0)}},isProper:function(){return this.hasIntersection()&&this._isProper},setPrecisionModel:function(n){this.precisionModel=n},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}},getIntersection:function(n){return this.intPt[n]},isEndPoint:function(){return this.hasIntersection()&&!this._isProper},hasIntersection:function(){return this.result!==ht.NO_INTERSECTION},getEdgeDistance:function(n,t){return ht.computeEdgeDistance(this.intPt[t],this.inputLines[n][0],this.inputLines[n][1])},isCollinear:function(){return this.result===ht.COLLINEAR_INTERSECTION},toString:function(){return pi.toLineString(this.inputLines[0][0],this.inputLines[0][1])+" - "+pi.toLineString(this.inputLines[1][0],this.inputLines[1][1])+this.getTopologySummary()},getEndpoint:function(n,t){return this.inputLines[n][t]},isIntersection:function(n){for(var t=0;t<this.result;t++)if(this.intPt[t].equals2D(n))return!0;return!1},getIntersectionAlongSegment:function(n,t){return this.computeIntLineIndex(),this.intPt[this.intLineIndex[n][t]]},interfaces_:function(){return[]},getClass:function(){return ht}});ht.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))),c.isTrue(!(0===r&&!n.equals(t)),"Bad distance calculation"),r};ht.nonRobustComputeEdgeDistance=function(n,t){var i=n.x-t.x,r=n.y-t.y,u=Math.sqrt(i*i+r*r);return c.isTrue(!(0===u&&!n.equals(t)),"Invalid distance calculation"),u};ht.DONT_INTERSECT=0;ht.DO_INTERSECT=1;ht.COLLINEAR=2;ht.NO_INTERSECTION=0;ht.POINT_INTERSECTION=1;ht.COLLINEAR_INTERSECTION=2;y(si,ht);i(si.prototype,{isInSegmentEnvelopes:function(n){var t=new p(this.inputLines[0][0],this.inputLines[0][1]),i=new p(this.inputLines[1][0],this.inputLines[1][1]);return t.contains(n)&&i.contains(n)},computeIntersection:function(){if(3!==arguments.length)return ht.prototype.computeIntersection.apply(this,arguments);var n=arguments[0],t=arguments[1],i=arguments[2];return this._isProper=!1,p.intersects(t,i,n)&&0===s.orientationIndex(t,i,n)&&0===s.orientationIndex(i,t,n)?(this._isProper=!0,(n.equals(t)||n.equals(i))&&(this._isProper=!1),this.result=ht.POINT_INTERSECTION,null):void(this.result=ht.NO_INTERSECTION)},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},safeHCoordinateIntersection:function(n,t,i,r){var u=null;try{u=hr.intersection(n,t,i,r)}catch(f){if(!(f instanceof vf))throw f;u=si.nearestEndpoint(n,t,i,r)}return u},intersection:function(n,t,i,u){var f=this.intersectionWithNormalization(n,t,i,u);return this.isInSegmentEnvelopes(f)||(f=new r(si.nearestEndpoint(n,t,i,u))),null!==this.precisionModel&&this.precisionModel.makePrecise(f),f},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},checkDD:function(n,t,i,r,u){var f=rr.intersection(n,t,i,r),e=this.isInSegmentEnvelopes(f);pt.out.println("DD in env = "+e+"  --------------------- "+f);u.distance(f)>.0001&&pt.out.println("Distance = "+u.distance(f))},intersectionWithNormalization:function(n,t,i,u){var o=new r(n),s=new r(t),h=new r(i),c=new r(u),e=new r,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},computeCollinearIntersection:function(n,t,i,r){var u=p.intersects(n,t,i),f=p.intersects(n,t,r),e=p.intersects(i,r,n),o=p.intersects(i,r,t);return u&&f?(this.intPt[0]=i,this.intPt[1]=r,ht.COLLINEAR_INTERSECTION):e&&o?(this.intPt[0]=n,this.intPt[1]=t,ht.COLLINEAR_INTERSECTION):u&&e?(this.intPt[0]=i,this.intPt[1]=n,!i.equals(n)||f||o?ht.COLLINEAR_INTERSECTION:ht.POINT_INTERSECTION):u&&o?(this.intPt[0]=i,this.intPt[1]=t,!i.equals(t)||f||e?ht.COLLINEAR_INTERSECTION:ht.POINT_INTERSECTION):f&&e?(this.intPt[0]=r,this.intPt[1]=n,!r.equals(n)||u||o?ht.COLLINEAR_INTERSECTION:ht.POINT_INTERSECTION):f&&o?(this.intPt[0]=r,this.intPt[1]=t,!r.equals(t)||u||e?ht.COLLINEAR_INTERSECTION:ht.POINT_INTERSECTION):ht.NO_INTERSECTION},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,y=o<l?o:l,p=e>c?e:c,w=s<a?s:a,b=(v+y)/2,k=(p+w)/2;u.x=b;u.y=k;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},computeIntersect:function(n,t,i,u){var f,e,o,h;return(this._isProper=!1,!p.intersects(n,t,i,u))?ht.NO_INTERSECTION:(f=s.orientationIndex(n,t,i),e=s.orientationIndex(n,t,u),f>0&&e>0||f<0&&e<0)?ht.NO_INTERSECTION:(o=s.orientationIndex(i,u,n),h=s.orientationIndex(i,u,t),o>0&&h>0||o<0&&h<0?ht.NO_INTERSECTION:0===f&&0===e&&0===o&&0===h?this.computeCollinearIntersection(n,t,i,u):(0===f||0===e||0===o||0===h?(this._isProper=!1,n.equals2D(i)||n.equals2D(u)?this.intPt[0]=n:t.equals2D(i)||t.equals2D(u)?this.intPt[0]=t:0===f?this.intPt[0]=new r(i):0===e?this.intPt[0]=new r(u):0===o?this.intPt[0]=new r(n):0===h&&(this.intPt[0]=new r(t))):(this._isProper=!0,this.intPt[0]=this.intersection(n,t,i,u)),ht.POINT_INTERSECTION))},interfaces_:function(){return[]},getClass:function(){return si}});si.nearestEndpoint=function(n,t,i,r){var e=n,f=s.distancePointLine(n,i,r),u=s.distancePointLine(t,i,r);return u<f&&(f=u,e=t),u=s.distancePointLine(i,n,t),u<f&&(f=u,e=i),u=s.distancePointLine(r,n,t),u<f&&(f=u,e=r),e};i(yo.prototype,{interfaces_:function(){return[]},getClass:function(){return yo}});yo.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 yo.signOfDet2x2(r,u,f,e)};yo.signOfDet2x2=function(n,t,i,r){var u=null,f=null,e=null,o=0;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(0<t?0<r?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):0<r?-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),0<n){if(!(0<i)||!(n<=i))return u}else{if(0<i||!(n>=i))return-u;u=-u;n=-n;i=-i}for(;;){if(o+=1,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}};i(po.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=yo.signOfDet2x2(o,f,s,e);if(0===u)return this.isPointOnSegment=!0,null;e<f&&(u=-u);u>0&&this.crossingCount++}},isPointInPolygon:function(){return this.getLocation()!==t.EXTERIOR},getLocation:function(){return this.isPointOnSegment?t.BOUNDARY:this.crossingCount%2==1?t.INTERIOR:t.EXTERIOR},isOnSegment:function(){return this.isPointOnSegment},interfaces_:function(){return[]},getClass:function(){return po}});po.locatePointInRing=function(){var i,u;if(arguments[0]instanceof r&&l(arguments[1],lt)){for(var o=arguments[0],f=arguments[1],n=new po(o),i=new r,u=new r,t=1;t<f.size();t++)if(f.getCoordinate(t,i),f.getCoordinate(t-1,u),n.countSegment(i,u),n.isOnSegment())return n.getLocation();return n.getLocation()}if(arguments[0]instanceof r&&arguments[1]instanceof Array){for(var s=arguments[0],e=arguments[1],n=new po(s),t=1;t<e.length;t++)if(i=e[t],u=e[t-1],n.countSegment(i,u),n.isOnSegment())return n.getLocation();return n.getLocation()}};i(s.prototype,{interfaces_:function(){return[]},getClass:function(){return s}});s.orientationIndex=function(n,t,i){return rr.orientationIndex(n,t,i)};s.signedArea=function(){var t,h,c,o,s,e,u,n;if(arguments[0]instanceof Array){if(t=arguments[0],t.length<3)return 0;for(var u=0,e=t[0].x,n=1;n<t.length-1;n++)h=t[n].x-e,c=t[n+1].y,u+=h*(t[n-1].y-c);return u/2}if(l(arguments[0],lt)){if(o=arguments[0],s=o.size(),s<3)return 0;var a=new r,f=new r,i=new r;for(o.getCoordinate(0,f),o.getCoordinate(1,i),e=f.x,i.x-=e,u=0,n=1;n<s-1;n++)a.y=f.y,f.x=i.x,f.y=i.y,o.getCoordinate(n+1,i),i.x-=e,u+=f.x*(a.y-i.y);return u/2}};s.distanceLineLine=function(n,t,i,r){var u,f;if(n.equals(t))return s.distancePointLine(n,i,r);if(i.equals(r))return s.distancePointLine(r,n,t);if(u=!1,p.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),c=(n.y-i.y)*(t.x-n.x)-(n.x-i.x)*(t.y-n.y),e=c/f,o=h/f;(o<0||o>1||e<0||e>1)&&(u=!0)}else u=!0;return u?br.min(s.distancePointLine(n,i,r),s.distancePointLine(t,i,r),s.distancePointLine(i,n,t),s.distancePointLine(r,n,t)):0};s.isPointInRing=function(n,i){return s.locatePointInRing(n,i)!==t.EXTERIOR};s.computeLength=function(n){var f=n.size(),i,t;if(f<=1)return 0;i=0;t=new r;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;i+=Math.sqrt(c*c+l*l);e=s;o=h}return i};s.isCCW=function(n){var o=n.length-1,c,i,r,f,e,l;if(o<3)throw new ct("Ring has fewer than 4 points, so orientation cannot be determined");for(var t=n[0],u=0,h=1;h<=o;h++)c=n[h],c.y>t.y&&(t=c,u=h);i=u;do(i-=1)<0&&(i=o);while(n[i].equals2D(t)&&i!==u);r=u;do r=(r+1)%o;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=s.computeOrientation(f,t,e),0===l?f.x>e.x:l>0)};s.locatePointInRing=function(n,t){return po.locatePointInRing(n,t)};s.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)};s.computeOrientation=function(n,t,i){return s.orientationIndex(n,t,i)};s.distancePointLine=function(){var o,r,f,u,h,e,c,l;if(2===arguments.length){if(o=arguments[0],r=arguments[1],0===r.length)throw new ct("Line array must contain at least one vertex");for(f=o.distance(r[0]),u=0;u<r.length-1;u++)h=s.distancePointLine(o,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))}};s.isOnLine=function(n,t){for(var u,f,r=new si,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};s.CLOCKWISE=-1;s.RIGHT=s.CLOCKWISE;s.COUNTERCLOCKWISE=1;s.LEFT=s.COUNTERCLOCKWISE;s.COLLINEAR=0;s.STRAIGHT=s.COLLINEAR;i(b.prototype,{minX:function(){return Math.min(this.p0.x,this.p1.x)},orientationIndex:function(){var u;if(arguments[0]instanceof b){var i=arguments[0],n=s.orientationIndex(this.p0,this.p1,i.p0),t=s.orientationIndex(this.p0,this.p1,i.p1);return n>=0&&t>=0?Math.max(n,t):n<=0&&t<=0?Math.max(n,t):0}if(arguments[0]instanceof r)return u=arguments[0],s.orientationIndex(this.p0,this.p1,u)},toGeometry:function(n){return n.createLineString([this.p0,this.p1])},isVertical:function(){return this.p0.x===this.p1.x},equals:function(n){if(!(n instanceof b))return!1;var t=n;return this.p0.equals(t.p0)&&this.p1.equals(t.p1)},intersection:function(n){var t=new si;return t.computeIntersection(this.p0,this.p1,n.p0,n.p1),t.hasIntersection()?t.getIntersection(0):null},project:function(){var n,s,t,e,o;if(arguments[0]instanceof r)return(n=arguments[0],n.equals(this.p0)||n.equals(this.p1))?new r(n):(s=this.projectionFactor(n),t=new r,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 b){var i=arguments[0],u=this.projectionFactor(i.p0),f=this.projectionFactor(i.p1);return u>=1&&f>=1?null:u<=0&&f<=0?null:(e=this.project(i.p0),u<0&&(e=this.p0),u>1&&(e=this.p1),o=this.project(i.p1),f<0&&(o=this.p0),f>1&&(o=this.p1),new b(e,o))}},normalize:function(){this.p1.compareTo(this.p0)<0&&this.reverse()},angle:function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},getCoordinate:function(n){return 0===n?this.p0:this.p1},distancePerpendicular:function(n){return s.distancePointLinePerpendicular(n,this.p0,this.p1)},minY:function(){return Math.min(this.p0.y,this.p1.y)},midPoint:function(){return b.midPoint(this.p0,this.p1)},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?v.NaN:((n.x-this.p0.x)*t+(n.y-this.p0.y)*i)/r},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=v.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),r<i&&(i=r,t[0]=this.p1,t[1]=o),t},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},maxX:function(){return Math.max(this.p0.x,this.p1.x)},getLength:function(){return this.p0.distance(this.p1)},compareTo:function(n){var t=n,i=this.p0.compareTo(t.p0);return 0!==i?i:this.p1.compareTo(t.p1)},reverse:function(){var n=this.p0;this.p0=this.p1;this.p1=n},equalsTopo:function(n){return this.p0.equals(n.p0)&&this.p1.equals(n.p1)||this.p0.equals(n.p1)&&this.p1.equals(n.p0)},lineIntersection:function(n){try{return hr.intersection(this.p0,this.p1,n.p0,n.p1)}catch(n){if(!(n instanceof vf))throw n;}return null},maxY:function(){return Math.max(this.p0.y,this.p1.y)},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),i=this.p1.x-this.p0.x,u=this.p1.y-this.p0.y,f=Math.sqrt(i*i+u*u),e=0,o=0;if(0!==t){if(f<=0)throw new IllegalStateException("Cannot compute offset from zero-length line segment");e=t*i/f;o=t*u/f}return new r(s-o,h+e)},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)},segmentFraction:function(n){var t=this.projectionFactor(n);return t<0?t=0:(t>1||v.isNaN(t))&&(t=1),t},toString:function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},isHorizontal:function(){return this.p0.y===this.p1.y},distance:function(){var n,t;return arguments[0]instanceof b?(n=arguments[0],s.distanceLineLine(this.p0,this.p1,n.p0,n.p1)):arguments[0]instanceof r?(t=arguments[0],s.distancePointLine(t,this.p0,this.p1)):void 0},pointAlong:function(n){var t=new r;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},hashCode:function(){var t=java.lang.Double.doubleToLongBits(this.p0.x),i,n;return t^=31*java.lang.Double.doubleToLongBits(this.p0.y),i=Math.trunc(t)^Math.trunc(t>>32),n=java.lang.Double.doubleToLongBits(this.p1.x),n^=31*java.lang.Double.doubleToLongBits(this.p1.y),i^Math.trunc(n)^Math.trunc(n>>32)},interfaces_:function(){return[sr,ir]},getClass:function(){return b}});b.midPoint=function(n,t){return new r((n.x+t.x)/2,(n.y+t.y)/2)};b.serialVersionUID=0x2d2172135f411c00;i(ot.prototype,{isIntersects:function(){return!this.isDisjoint()},isCovers:function(){return(ot.isTrue(this.matrix[t.INTERIOR][t.INTERIOR])||ot.isTrue(this.matrix[t.INTERIOR][t.BOUNDARY])||ot.isTrue(this.matrix[t.BOUNDARY][t.INTERIOR])||ot.isTrue(this.matrix[t.BOUNDARY][t.BOUNDARY]))&&this.matrix[t.EXTERIOR][t.INTERIOR]===e.FALSE&&this.matrix[t.EXTERIOR][t.BOUNDARY]===e.FALSE},isCoveredBy:function(){return(ot.isTrue(this.matrix[t.INTERIOR][t.INTERIOR])||ot.isTrue(this.matrix[t.INTERIOR][t.BOUNDARY])||ot.isTrue(this.matrix[t.BOUNDARY][t.INTERIOR])||ot.isTrue(this.matrix[t.BOUNDARY][t.BOUNDARY]))&&this.matrix[t.INTERIOR][t.EXTERIOR]===e.FALSE&&this.matrix[t.BOUNDARY][t.EXTERIOR]===e.FALSE},set:function(){var t,n,i,r;if(1===arguments.length)for(t=arguments[0],n=0;n<t.length;n++)i=Math.trunc(n/3),r=n%3,this.matrix[i][r]=e.toDimensionValue(t.charAt(n));else if(3===arguments.length){var u=arguments[0],f=arguments[1],o=arguments[2];this.matrix[u][f]=o}},isContains:function(){return ot.isTrue(this.matrix[t.INTERIOR][t.INTERIOR])&&this.matrix[t.EXTERIOR][t.INTERIOR]===e.FALSE&&this.matrix[t.EXTERIOR][t.BOUNDARY]===e.FALSE},setAtLeast:function(){var t,n,i,r;if(1===arguments.length)for(t=arguments[0],n=0;n<t.length;n++)i=Math.trunc(n/3),r=n%3,this.setAtLeast(i,r,e.toDimensionValue(t.charAt(n)));else if(3===arguments.length){var u=arguments[0],f=arguments[1],o=arguments[2];this.matrix[u][f]<o&&(this.matrix[u][f]=o)}},setAtLeastIfValid:function(n,t,i){n>=0&&t>=0&&this.setAtLeast(n,t,i)},isWithin:function(){return ot.isTrue(this.matrix[t.INTERIOR][t.INTERIOR])&&this.matrix[t.INTERIOR][t.EXTERIOR]===e.FALSE&&this.matrix[t.BOUNDARY][t.EXTERIOR]===e.FALSE},isTouches:function(n,i){return n>i?this.isTouches(i,n):(n===e.A&&i===e.A||n===e.L&&i===e.L||n===e.L&&i===e.A||n===e.P&&i===e.A||n===e.P&&i===e.L)&&this.matrix[t.INTERIOR][t.INTERIOR]===e.FALSE&&(ot.isTrue(this.matrix[t.INTERIOR][t.BOUNDARY])||ot.isTrue(this.matrix[t.BOUNDARY][t.INTERIOR])||ot.isTrue(this.matrix[t.BOUNDARY][t.BOUNDARY]))},isOverlaps:function(n,i){return n===e.P&&i===e.P||n===e.A&&i===e.A?ot.isTrue(this.matrix[t.INTERIOR][t.INTERIOR])&&ot.isTrue(this.matrix[t.INTERIOR][t.EXTERIOR])&&ot.isTrue(this.matrix[t.EXTERIOR][t.INTERIOR]):n===e.L&&i===e.L&&1===this.matrix[t.INTERIOR][t.INTERIOR]&&ot.isTrue(this.matrix[t.INTERIOR][t.EXTERIOR])&&ot.isTrue(this.matrix[t.EXTERIOR][t.INTERIOR])},isEquals:function(n,i){return n===i&&ot.isTrue(this.matrix[t.INTERIOR][t.INTERIOR])&&this.matrix[t.INTERIOR][t.EXTERIOR]===e.FALSE&&this.matrix[t.BOUNDARY][t.EXTERIOR]===e.FALSE&&this.matrix[t.EXTERIOR][t.INTERIOR]===e.FALSE&&this.matrix[t.EXTERIOR][t.BOUNDARY]===e.FALSE},toString:function(){for(var t,i=new eu("123456789"),n=0;n<3;n++)for(t=0;t<3;t++)i.setCharAt(3*n+t,e.toDimensionSymbol(this.matrix[n][t]));return i.toString()},setAll:function(n){for(var i,t=0;t<3;t++)for(i=0;i<3;i++)this.matrix[t][i]=n},get:function(n,t){return this.matrix[n][t]},transpose:function(){var n=this.matrix[1][0];return this.matrix[1][0]=this.matrix[0][1],this.matrix[0][1]=n,n=this.matrix[2][0],this.matrix[2][0]=this.matrix[0][2],this.matrix[0][2]=n,n=this.matrix[2][1],this.matrix[2][1]=this.matrix[1][2],this.matrix[1][2]=n,this},matches:function(n){var t,i;if(9!==n.length)throw new ct("Should be length 9: "+n);for(t=0;t<3;t++)for(i=0;i<3;i++)if(!ot.matches(this.matrix[t][i],n.charAt(3*t+i)))return!1;return!0},add:function(n){for(var i,t=0;t<3;t++)for(i=0;i<3;i++)this.setAtLeast(t,i,n.get(t,i))},isDisjoint:function(){return this.matrix[t.INTERIOR][t.INTERIOR]===e.FALSE&&this.matrix[t.INTERIOR][t.BOUNDARY]===e.FALSE&&this.matrix[t.BOUNDARY][t.INTERIOR]===e.FALSE&&this.matrix[t.BOUNDARY][t.BOUNDARY]===e.FALSE},isCrosses:function(n,i){return n===e.P&&i===e.L||n===e.P&&i===e.A||n===e.L&&i===e.A?ot.isTrue(this.matrix[t.INTERIOR][t.INTERIOR])&&ot.isTrue(this.matrix[t.INTERIOR][t.EXTERIOR]):n===e.L&&i===e.P||n===e.A&&i===e.P||n===e.A&&i===e.L?ot.isTrue(this.matrix[t.INTERIOR][t.INTERIOR])&&ot.isTrue(this.matrix[t.EXTERIOR][t.INTERIOR]):n===e.L&&i===e.L&&0===this.matrix[t.INTERIOR][t.INTERIOR]},interfaces_:function(){return[ph]},getClass:function(){return ot}});ot.matches=function(){var n,t,i,r;return Number.isInteger(arguments[0])&&"string"==typeof arguments[1]?(n=arguments[0],t=arguments[1],t===e.SYM_DONTCARE||t===e.SYM_TRUE&&(n>=0||n===e.TRUE)||t===e.SYM_FALSE&&n===e.FALSE||t===e.SYM_P&&n===e.P||t===e.SYM_L&&n===e.L||t===e.SYM_A&&n===e.A):"string"==typeof arguments[0]&&"string"==typeof arguments[1]?(i=arguments[0],r=arguments[1],new ot(i).matches(r)):void 0};ot.isTrue=function(n){return n>=0||n===e.TRUE};hb=Object.freeze({Coordinate:r,CoordinateList:ii,Envelope:p,LineSegment:b,GeometryFactory:g,Geometry:h,Point:bt,LineString:d,LinearRing:gt,Polygon:st,GeometryCollection:nt,MultiPoint:lr,MultiLineString:cr,MultiPolygon:ai,Dimension:e,IntersectionMatrix:ot,PrecisionModel:ft});i(df.prototype,{addPoint:function(n){this.ptCount+=1;this.ptCentSum.x+=n.x;this.ptCentSum.y+=n.y},setBasePoint:function(n){null===this.areaBasePt&&(this.areaBasePt=n)},addLineSegments:function(n){for(var i,u,f,r=0,t=0;t<n.length-1;t++)i=n[t].distance(n[t+1]),0!==i&&(r+=i,u=(n[t].x+n[t+1].x)/2,this.lineCentSum.x+=i*u,f=(n[t].y+n[t+1].y)/2,this.lineCentSum.y+=i*f);this.totalLength+=r;0===r&&n.length>0&&this.addPoint(n[0])},addHole:function(n){for(var i=s.isCCW(n),t=0;t<n.length-1;t++)this.addTriangle(this.areaBasePt,n[t],n[t+1],i);this.addLineSegments(n)},getCentroid:function(){var n=new r;if(Math.abs(this.areasum2)>0)n.x=this.cg3.x/3/this.areasum2,n.y=this.cg3.y/3/this.areasum2;else if(this.totalLength>0)n.x=this.lineCentSum.x/this.totalLength,n.y=this.lineCentSum.y/this.totalLength;else{if(!(this.ptCount>0))return null;n.x=this.ptCentSum.x/this.ptCount;n.y=this.ptCentSum.y/this.ptCount}return n},addShell:function(n){n.length>0&&this.setBasePoint(n[0]);for(var i=!s.isCCW(n),t=0;t<n.length-1;t++)this.addTriangle(this.areaBasePt,n[t],n[t+1],i);this.addLineSegments(n)},addTriangle:function(n,t,i,r){var f=r?1:-1,u;df.centroid3(n,t,i,this.triangleCent3);u=df.area2(n,t,i);this.cg3.x+=f*u*this.triangleCent3.x;this.cg3.y+=f*u*this.triangleCent3.y;this.areasum2+=f*u},add:function(){var i,n,u,r,t;if(arguments[0]instanceof st)for(i=arguments[0],this.addShell(i.getExteriorRing().getCoordinates()),t=0;t<i.getNumInteriorRing();t++)this.addHole(i.getInteriorRingN(t).getCoordinates());else if(arguments[0]instanceof h){if(n=arguments[0],n.isEmpty())return null;if(n instanceof bt)this.addPoint(n.getCoordinate());else if(n instanceof d)this.addLineSegments(n.getCoordinates());else if(n instanceof st)u=n,this.add(u);else if(n instanceof nt)for(r=n,t=0;t<r.getNumGeometries();t++)this.add(r.getGeometryN(t))}},interfaces_:function(){return[]},getClass:function(){return df}});df.area2=function(n,t,i){return(t.x-n.x)*(i.y-n.y)-(i.x-n.x)*(t.y-n.y)};df.centroid3=function(n,t,i,r){return r.x=n.x+t.x+i.x,r.y=n.y+t.y+i.y,null};df.getCentroid=function(n){return new df(n).getCentroid()};va.prototype=new Error;va.prototype.name="EmptyStackException";gi.prototype=new ei;gi.prototype.add=function(n){return this.array_.push(n),!0};gi.prototype.get=function(n){if(n<0||n>=this.size())throw new IndexOutOfBoundsException;return this.array_[n]};gi.prototype.push=function(n){return this.array_.push(n),n};gi.prototype.pop=function(){if(0===this.array_.length)throw new va;return this.array_.pop()};gi.prototype.peek=function(){if(0===this.array_.length)throw new va;return this.array_[this.array_.length-1]};gi.prototype.empty=function(){return 0===this.array_.length};gi.prototype.isEmpty=function(){return this.empty()};gi.prototype.search=function(n){return this.array_.indexOf(n)};gi.prototype.size=function(){return this.array_.length};gi.prototype.toArray=function(){for(var t=[],n=0,i=this.array_.length;n<i;n++)t.push(this.array_[n]);return t};i(ys.prototype,{filter:function(n){this.treeSet.contains(n)||(this.list.add(n),this.treeSet.add(n))},getCoordinates:function(){var n=new Array(this.list.size()).fill(null);return this.list.toArray(n)},interfaces_:function(){return[pe]},getClass:function(){return ys}});ys.filterCoordinates=function(n){for(var i=new ys,t=0;t<n.length;t++)i.filter(n[t]);return i.getCoordinates()};i(gf.prototype,{preSort:function(n){for(var i=null,t=1;t<n.length;t++)(n[t].y<n[0].y||n[t].y===n[0].y&&n[t].x<n[0].x)&&(i=n[0],n[0]=n[t],n[t]=i);return pf.sort(n,1,n.length,new ps(n[0])),n},computeOctRing:function(n){var i=this.computeOctPts(n),t=new ii;return t.add(i,!1),t.size()<3?null:(t.closeRing(),t.toCoordinateArray())},lineOrPolygon:function(n){if(n=this.cleanRing(n),3===n.length)return this.geomFactory.createLineString([n[0],n[1]]);var t=this.geomFactory.createLinearRing(n);return this.geomFactory.createPolygon(t,null)},cleanRing:function(n){var t,e,o;c.equals(n[0],n[n.length-1]);for(var i=new u,f=null,r=0;r<=n.length-2;r++)t=n[r],e=n[r+1],t.equals(e)||null!==f&&this.isBetween(f,t,e)||(i.add(t),f=t);return i.add(n[n.length-1]),o=new Array(i.size()).fill(null),i.toArray(o)},isBetween:function(n,t,i){return 0!==s.computeOrientation(n,t,i)?!1:n.x!==i.x&&(n.x<=t.x&&t.x<=i.x||i.x<=t.x&&t.x<=n.x)?!0:n.y!==i.y&&(n.y<=t.y&&t.y<=i.y||i.y<=t.y&&t.y<=n.y)?!0:!1},reduce:function(n){var i=this.computeOctRing(n),r,t,u;if(null===i)return n;for(r=new di,t=0;t<i.length;t++)r.add(i[t]);for(t=0;t<n.length;t++)s.isPointInRing(n[t],i)||r.add(n[t]);return u=w.toCoordinateArray(r),u.length<3?this.padArray3(u):u},getConvexHull:function(){var n;if(0===this.inputPts.length)return this.geomFactory.createGeometryCollection(null);if(1===this.inputPts.length)return this.geomFactory.createPoint(this.inputPts[0]);if(2===this.inputPts.length)return this.geomFactory.createLineString(this.inputPts);n=this.inputPts;this.inputPts.length>50&&(n=this.reduce(this.inputPts));var t=this.preSort(n),i=this.grahamScan(t),r=this.toCoordinateArray(i);return this.lineOrPolygon(r)},padArray3:function(n){for(var i=new Array(3).fill(null),t=0;t<i.length;t++)i[t]=t<n.length?n[t]:n[0];return i},computeOctPts:function(n){for(var i,t=new Array(8).fill(null),r=0;r<t.length;r++)t[r]=n[0];for(i=1;i<n.length;i++)n[i].x<t[0].x&&(t[0]=n[i]),n[i].x-n[i].y<t[1].x-t[1].y&&(t[1]=n[i]),n[i].y>t[2].y&&(t[2]=n[i]),n[i].x+n[i].y>t[3].x+t[3].y&&(t[3]=n[i]),n[i].x>t[4].x&&(t[4]=n[i]),n[i].x-n[i].y>t[5].x-t[5].y&&(t[5]=n[i]),n[i].y<t[6].y&&(t[6]=n[i]),n[i].x+n[i].y<t[7].x+t[7].y&&(t[7]=n[i]);return t},toCoordinateArray:function(n){for(var r,i=new Array(n.size()).fill(null),t=0;t<n.size();t++)r=n.get(t),i[t]=r;return i},grahamScan:function(n){var i=null,t=new gi,r;for(i=t.push(n[0]),i=t.push(n[1]),i=t.push(n[2]),r=3;r<n.length;r++){for(i=t.pop();!t.empty()&&s.computeOrientation(t.peek(),i,n[r])>0;)i=t.pop();i=t.push(i);i=t.push(n[r])}return i=t.push(n[0]),t},interfaces_:function(){return[]},getClass:function(){return gf}});gf.extractCoordinates=function(n){var t=new ys;return n.apply(t),t.getCoordinates()};i(ps.prototype,{compare:function(n,t){var i=n,r=t;return ps.polarCompare(this.origin,i,r)},interfaces_:function(){return[ve]},getClass:function(){return ps}});ps.polarCompare=function(n,t,i){var f=t.x-n.x,e=t.y-n.y,o=i.x-n.x,h=i.y-n.y,c=s.computeOrientation(n,t,i),r,u;return c===s.COUNTERCLOCKWISE?1:c===s.CLOCKWISE?-1:(r=f*f+e*e,u=o*o+h*h,r<u?-1:r>u?1:0)};gf.RadialComparator=ps;i(ur.prototype,{transformPoint:function(n){return this.factory.createPoint(this.transformCoordinates(n.getCoordinateSequence(),n))},transformPolygon:function(n){var o=!0,t=this.transformLinearRing(n.getExteriorRing(),n),r,f,i,e;for(null!==t&&t instanceof gt&&!t.isEmpty()||(o=!1),r=new u,f=0;f<n.getNumInteriorRing();f++)i=this.transformLinearRing(n.getInteriorRingN(f),n),null===i||i.isEmpty()||(i instanceof gt||(o=!1),r.add(i));return o?this.factory.createPolygon(t,r.toArray([])):(e=new u,null!==t&&e.add(t),e.addAll(r),this.factory.buildGeometry(e))},createCoordinateSequence:function(n){return this.factory.getCoordinateSequenceFactory().create(n)},getInputGeometry:function(){return this.inputGeom},transformMultiLineString:function(n){for(var i,r=new u,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)},transformCoordinates:function(n){return this.copy(n)},transformLineString:function(n){return this.factory.createLineString(this.transformCoordinates(n.getCoordinateSequence(),n))},transformMultiPoint:function(n){for(var i,r=new u,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)},transformMultiPolygon:function(n){for(var i,r=new u,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)},copy:function(n){return n.copy()},transformGeometryCollection:function(n){for(var r,t=new u,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(g.toGeometryArray(t)):this.factory.buildGeometry(t)},transform:function(n){if(this.inputGeom=n,this.factory=n.getFactory(),n instanceof bt)return this.transformPoint(n,null);if(n instanceof lr)return this.transformMultiPoint(n,null);if(n instanceof gt)return this.transformLinearRing(n,null);if(n instanceof d)return this.transformLineString(n,null);if(n instanceof cr)return this.transformMultiLineString(n,null);if(n instanceof st)return this.transformPolygon(n,null);if(n instanceof ai)return this.transformMultiPolygon(n,null);if(n instanceof nt)return this.transformGeometryCollection(n,null);throw new ct("Unknown Geometry subtype: "+n.getClass().getName());},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))},interfaces_:function(){return[]},getClass:function(){return ur}});i(ws.prototype,{snapVertices:function(n,t){for(var e,u,f=this._isClosed?n.size()-1:n.size(),i=0;i<f;i++)e=n.get(i),u=this.findSnapForVertex(e,t),null!==u&&(n.set(i,new r(u)),0===i&&this._isClosed&&n.set(n.size()-1,new r(u)))},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},snapTo:function(n){var t=new ii(this.srcPts);return this.snapVertices(t,n),this.snapSegments(t,n),t.toCoordinateArray()},snapSegments:function(n,t){var u,i,f,e;if(0===t.length)return null;for(u=t.length,t[0].equals2D(t[t.length-1])&&(u=t.length-1),i=0;i<u;i++)f=t[i],e=this.findSegmentIndexToSnap(f,n),e>=0&&n.add(e+1,new r(f),!1)},findSegmentIndexToSnap:function(n,t){for(var r,u=v.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},setAllowSnappingToSourceVertices:function(n){this.allowSnappingToSourceVertices=n},interfaces_:function(){return[]},getClass:function(){return ws}});ws.isClosed=function(n){return!(n.length<=1)&&n[0].equals2D(n[n.length-1])};i(nr.prototype,{snapTo:function(n,t){return new dh(t,this.extractTargetCoordinates(n)).transform(this.srcGeom)},snapToSelf:function(n,t){var u=this.extractTargetCoordinates(this.srcGeom),f=new dh(n,u,!0),r=f.transform(this.srcGeom),i=r;return t&&l(i,bf)&&(i=r.buffer(0)),i},computeSnapTolerance:function(n){return this.computeMinimumSegmentLength(n)/10},extractTargetCoordinates:function(n){for(var i=new di,r=n.getCoordinates(),t=0;t<r.length;t++)i.add(r[t]);return i.toArray(new Array(0).fill(null))},computeMinimumSegmentLength:function(n){for(var r,i=v.MAX_VALUE,t=0;t<n.length-1;t++)r=n[t].distance(n[t+1]),r<i&&(i=r);return i},interfaces_:function(){return[]},getClass:function(){return nr}});nr.snap=function(n,t,i){var r=new Array(2).fill(null),f=new nr(n),u;return r[0]=f.snapTo(t,i),u=new nr(t),r[1]=u.snapTo(r[0],i),r};nr.computeOverlaySnapTolerance=function(){var t,u,f;if(1===arguments.length){var i=arguments[0],n=nr.computeSizeBasedSnapTolerance(i),r=i.getPrecisionModel();return r.getType()===ft.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(nr.computeOverlaySnapTolerance(u),nr.computeOverlaySnapTolerance(f))};nr.computeSizeBasedSnapTolerance=function(n){var t=n.getEnvelopeInternal();return Math.min(t.getHeight(),t.getWidth())*nr.SNAP_PRECISION_FACTOR};nr.snapToSelf=function(n,t,i){return new nr(n).snapToSelf(t,i)};nr.SNAP_PRECISION_FACTOR=1e-9;y(dh,ur);i(dh.prototype,{snapLine:function(n,t){var i=new ws(n,this.snapTolerance);return i.setAllowSnappingToSourceVertices(this.isSelfSnap),i.snapTo(t)},transformCoordinates:function(n){var t=n.toCoordinateArray(),i=this.snapLine(t,this.snapPts);return this.factory.getCoordinateSequenceFactory().create(i)},interfaces_:function(){return[]},getClass:function(){return dh}});i(nu.prototype,{getCommon:function(){return v.longBitsToDouble(this.commonBits)},add:function(n){var t=v.doubleToLongBits(n);return this.isFirst?(this.commonBits=t,this.commonSignExp=nu.signExpBits(this.commonBits),this.isFirst=!1,null):nu.signExpBits(t)!==this.commonSignExp?(this.commonBits=0,null):(this.commonMantissaBitsCount=nu.numCommonMostSigMantissaBits(this.commonBits,t),void(this.commonBits=nu.zeroLowerBits(this.commonBits,64-(12+this.commonMantissaBitsCount))))},toString:function(){if(1===arguments.length){var t=arguments[0],r=v.longBitsToDouble(t),u=Long.toBinaryString(t),i="0000000000000000000000000000000000000000000000000000000000000000"+u,n=i.substring(i.length-64);return n.substring(0,1)+"  "+n.substring(1,12)+"(exp) "+n.substring(12)+" [ "+r+" ]"}},interfaces_:function(){return[]},getClass:function(){return nu}});nu.getBit=function(n,t){return 0!=(n&1<<t)?1:0};nu.signExpBits=function(n){return n>>52};nu.zeroLowerBits=function(n,t){return n&~((1<<t)-1)};nu.numCommonMostSigMantissaBits=function(n,t){for(var r=0,i=52;i>=0;i--){if(nu.getBit(n,i)!==nu.getBit(t,i))return r;r++}return 52};i(gh.prototype,{addCommonBits:function(n){var t=new nc(this.commonCoord);n.apply(t);n.geometryChanged()},removeCommonBits:function(n){var t,i;return 0===this.commonCoord.x&&0===this.commonCoord.y?n:(t=new r(this.commonCoord),t.x=-t.x,t.y=-t.y,i=new nc(t),n.apply(i),n.geometryChanged(),n)},getCommonCoordinate:function(){return this.commonCoord},add:function(n){n.apply(this.ccFilter);this.commonCoord=this.ccFilter.getCommonCoordinate()},interfaces_:function(){return[]},getClass:function(){return gh}});i(ya.prototype,{filter:function(n){this.commonBitsX.add(n.x);this.commonBitsY.add(n.y)},getCommonCoordinate:function(){return new r(this.commonBitsX.getCommon(),this.commonBitsY.getCommon())},interfaces_:function(){return[pe]},getClass:function(){return ya}});i(nc.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)},isDone:function(){return!1},isGeometryChanged:function(){return!0},interfaces_:function(){return[vo]},getClass:function(){return nc}});gh.CommonCoordinateFilter=ya;gh.Translater=nc;i(wo.prototype,{next:function(){if(this.atStart)return this.atStart=!1,wo.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 vs;var n=this.parent.getGeometryN(this.index++);return n instanceof nt?(this.subcollectionIterator=new wo(n),this.subcollectionIterator.next()):n},remove:function(){throw new UnsupportedOperationException(this.getClass().getName());},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)},interfaces_:function(){return[wh]},getClass:function(){return wo}});wo.isAtomic=function(n){return!(n instanceof nt)};i(bo.prototype,{locateInternal:function(){var o,n,l,h,f,a,c,i,e,u,v;if(arguments[0]instanceof r&&arguments[1]instanceof st){if((o=arguments[0],n=arguments[1],n.isEmpty())||(l=n.getExteriorRing(),h=this.locateInPolygonRing(o,l),h===t.EXTERIOR))return t.EXTERIOR;if(h===t.BOUNDARY)return t.BOUNDARY;for(f=0;f<n.getNumInteriorRing();f++){if(a=n.getInteriorRingN(f),c=this.locateInPolygonRing(o,a),c===t.INTERIOR)return t.EXTERIOR;if(c===t.BOUNDARY)return t.BOUNDARY}return t.INTERIOR}return arguments[0]instanceof r&&arguments[1]instanceof d?(i=arguments[0],e=arguments[1],!e.getEnvelopeInternal().intersects(i))?t.EXTERIOR:(u=e.getCoordinates(),e.isClosed()||!i.equals(u[0])&&!i.equals(u[u.length-1])?s.isOnLine(i,u)?t.INTERIOR:t.EXTERIOR:t.BOUNDARY):arguments[0]instanceof r&&arguments[1]instanceof bt?(v=arguments[0],arguments[1].getCoordinate().equals2D(v)?t.INTERIOR:t.EXTERIOR):void 0},locateInPolygonRing:function(n,i){return i.getEnvelopeInternal().intersects(n)?s.locatePointInRing(n,i.getCoordinates()):t.EXTERIOR},intersects:function(n,i){return this.locate(n,i)!==t.EXTERIOR},updateLocationInfo:function(n){n===t.INTERIOR&&(this.isIn=!0);n===t.BOUNDARY&&this.numBoundaries++},computeLocation:function(n,t){var r,o,u,i,s,f,e;if(t instanceof bt&&this.updateLocationInfo(this.locateInternal(n,t)),t instanceof d)this.updateLocationInfo(this.locateInternal(n,t));else if(t instanceof st)this.updateLocationInfo(this.locateInternal(n,t));else if(t instanceof cr)for(r=t,i=0;i<r.getNumGeometries();i++)o=r.getGeometryN(i),this.updateLocationInfo(this.locateInternal(n,o));else if(t instanceof ai)for(u=t,i=0;i<u.getNumGeometries();i++)s=u.getGeometryN(i),this.updateLocationInfo(this.locateInternal(n,s));else if(t instanceof nt)for(f=new wo(t);f.hasNext();)e=f.next(),e!==t&&this.computeLocation(n,e)},locate:function(n,i){return i.isEmpty()?t.EXTERIOR:i instanceof d?this.locateInternal(n,i):i instanceof st?this.locateInternal(n,i):(this.isIn=!1,this.numBoundaries=0,this.computeLocation(n,i),this.boundaryRule.isInBoundary(this.numBoundaries)?t.BOUNDARY:this.numBoundaries>0||this.isIn?t.INTERIOR:t.EXTERIOR)},interfaces_:function(){return[]},getClass:function(){return bo}});i(bs.prototype,{interfaces_:function(){return[]},getClass:function(){return bs}});bs.octant=function(){var t,n,i,u;if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){if(t=arguments[0],n=arguments[1],0===t&&0===n)throw new ct("Cannot compute the octant for point ( "+t+", "+n+" )");return i=Math.abs(t),u=Math.abs(n),t>=0?n>=0?i>=u?0:1:i>=u?7:6:n>=0?i>=u?3:2:i>=u?4:5}if(arguments[0]instanceof r&&arguments[1]instanceof r){var f=arguments[0],e=arguments[1],o=e.x-f.x,s=e.y-f.y;if(0===o&&0===s)throw new ct("Cannot compute the octant for two identical points "+f);return bs.octant(o,s)}};i(tc.prototype,{getCoordinates:function(){},size:function(){},getCoordinate:function(){},isClosed:function(){},setData:function(){},getData:function(){},interfaces_:function(){return[]},getClass:function(){return tc}});i(hp.prototype,{getCoordinates:function(){return this.pts},size:function(){return this.pts.length},getCoordinate:function(n){return this.pts[n]},isClosed:function(){return this.pts[0].equals(this.pts[this.pts.length-1])},getSegmentOctant:function(n){return n===this.pts.length-1?-1:bs.octant(this.getCoordinate(n),this.getCoordinate(n+1))},setData:function(n){this.data=n},getData:function(){return this.data},toString:function(){return pi.toLineString(new gr(this.pts))},interfaces_:function(){return[tc]},getClass:function(){return hp}});i(pa.prototype,{getBounds:function(){},interfaces_:function(){return[]},getClass:function(){return pa}});i(ne.prototype,{getItem:function(){return this.item},getBounds:function(){return this.bounds},interfaces_:function(){return[pa,ir]},getClass:function(){return ne}});i(cp.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},size:function(){return this._size},reorder:function(n){for(var t=null,i=this.items.get(n);2*n<=this._size&&(t=2*n,t!==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)},clear:function(){this._size=0;this.items.clear()},isEmpty:function(){return 0===this._size},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)},interfaces_:function(){return[]},getClass:function(){return cp}});i(we.prototype,{visitItem:function(){},interfaces_:function(){return[]},getClass:function(){return we}});i(wa.prototype,{insert:function(){},remove:function(){},query:function(){1===arguments.length?arguments[0]:2===arguments.length&&(arguments[0],arguments[1])},interfaces_:function(){return[]},getClass:function(){return wa}});i(tr.prototype,{getLevel:function(){return this.level},size:function(){return this.childBoundables.size()},getChildBoundables:function(){return this.childBoundables},addChildBoundable:function(n){c.isTrue(null===this.bounds);this.childBoundables.add(n)},isEmpty:function(){return this.childBoundables.isEmpty()},getBounds:function(){return null===this.bounds&&(this.bounds=this.computeBounds()),this.bounds},interfaces_:function(){return[pa,ir]},getClass:function(){return tr}});tr.serialVersionUID=0x5a1e55ec41369800;gu={reverseOrder:function(){return{compare:function(n,t){return t.compareTo(n)}}},min:function(n){return gu.sort(n),n.get(0)},sort:function(n,t){var i=n.toArray();t?pf.sort(i,t):pf.sort(i);for(var u=n.iterator(),r=0,f=i.length;r<f;r++)u.next(),u.set(i[r])},singletonList:function(n){var t=new u;return t.add(n),t}};i(fr.prototype,{expandToQueue:function(n,t){var i=fr.isComposite(this.boundable1),r=fr.isComposite(this.boundable2);if(i&&r)return fr.area(this.boundable1)>fr.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 ct("neither boundable is composite");},isLeaves:function(){return!(fr.isComposite(this.boundable1)||fr.isComposite(this.boundable2))},compareTo:function(n){var t=n;return this._distance<t._distance?-1:this._distance>t._distance?1:0},expand:function(n,t,i,r){for(var o,f,e=n.getChildBoundables(),u=e.iterator();u.hasNext();)o=u.next(),f=new fr(o,t,this.itemDistance),f.getDistance()<r&&i.add(f)},getBoundable:function(n){return 0===n?this.boundable1:this.boundable2},getDistance:function(){return this._distance},distance:function(){return this.isLeaves()?this.itemDistance.distance(this.boundable1,this.boundable2):this.boundable1.getBounds().distance(this.boundable2.getBounds())},interfaces_:function(){return[sr]},getClass:function(){return fr}});fr.area=function(n){return n.getBounds().getArea()};fr.isComposite=function(n){return n instanceof tr};i(ni.prototype,{getNodeCapacity:function(){return this.nodeCapacity},lastNode:function(n){return n.get(n.size()-1)},size:function(){var n;if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.size(this.root));if(1===arguments.length){for(var r=arguments[0],t=0,i=r.getChildBoundables().iterator();i.hasNext();)n=i.next(),n instanceof tr?t+=this.size(n):n instanceof ne&&(t+=1);return t}},removeItem:function(n,t){for(var r,i=null,u=n.getChildBoundables().iterator();u.hasNext();)r=u.next(),r instanceof ne&&r.getItem()===t&&(i=r);return null!==i&&(n.getChildBoundables().remove(i),!0)},itemsTree:function(){var i,n,r;if(0===arguments.length)return this.build(),i=this.itemsTree(this.root),null===i?new u:i;if(1===arguments.length){for(var e=arguments[0],t=new u,f=e.getChildBoundables().iterator();f.hasNext();)n=f.next(),n instanceof tr?(r=this.itemsTree(n),null!==r&&t.add(r)):n instanceof ne?t.add(n.getItem()):c.shouldNeverReachHere();return t.size()<=0?null:t}},insert:function(n,t){c.isTrue(!this.built,"Cannot insert items into an STR packed R-tree after it has been built.");this.itemBoundables.add(new ne(n,t))},boundablesAtLevel:function(){var o,i,e,n;if(1===arguments.length)return o=arguments[0],i=new u,this.boundablesAtLevel(o,this.root,i),i;if(3===arguments.length){var t=arguments[0],r=arguments[1],f=arguments[2];if(c.isTrue(t>-2),r.getLevel()===t)return f.add(r),null;for(e=r.getChildBoundables().iterator();e.hasNext();)n=e.next(),n instanceof tr?this.boundablesAtLevel(t,n,f):(c.isTrue(n instanceof ne),-1===t&&f.add(n));return null}},query:function(){var f,r,e,o,n;if(1===arguments.length)return f=arguments[0],this.build(),r=new u,this.isEmpty()?r:(this.getIntersectsOp().intersects(this.root.getBounds(),f)&&this.query(f,this.root,r),r);if(2===arguments.length){if(e=arguments[0],o=arguments[1],this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this.root.getBounds(),e)&&this.query(e,this.root,o)}else if(3===arguments.length)if(l(arguments[2],we)&&arguments[0]instanceof Object&&arguments[1]instanceof tr)for(var s=arguments[0],y=arguments[1],h=arguments[2],i=y.getChildBoundables(),t=0;t<i.size();t++)n=i.get(t),this.getIntersectsOp().intersects(n.getBounds(),s)&&(n instanceof tr?this.query(s,n,h):n instanceof ne?h.visitItem(n.getItem()):c.shouldNeverReachHere());else if(l(arguments[2],ei)&&arguments[0]instanceof Object&&arguments[1]instanceof tr)for(var a=arguments[0],p=arguments[1],v=arguments[2],i=p.getChildBoundables(),t=0;t<i.size();t++)n=i.get(t),this.getIntersectsOp().intersects(n.getBounds(),a)&&(n instanceof tr?this.query(a,n,v):n instanceof ne?v.add(n.getItem()):c.shouldNeverReachHere())},build:function(){return this.built?null:(this.root=this.itemBoundables.isEmpty()?this.createNode(0):this.createHigherLevels(this.itemBoundables,-1),this.itemBoundables=null,void(this.built=!0))},getRoot:function(){return this.build(),this.root},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 tr&&(u=this.remove(o,t,s))){n=t;break}return null!==n&&n.getChildBoundables().isEmpty()&&r.getChildBoundables().remove(n),u}},createHigherLevels:function(n,t){c.isTrue(!n.isEmpty());var i=this.createParentBoundables(n,t+1);return 1===i.size()?i.get(0):this.createHigherLevels(i,t+1)},depth:function(){var t,i;if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.depth(this.root));if(1===arguments.length){for(var u=arguments[0],n=0,r=u.getChildBoundables().iterator();r.hasNext();)t=r.next(),t instanceof tr&&(i=this.depth(t),i>n&&(n=i));return n+1}},createParentBoundables:function(n,t){var i,r,f,e;for(c.isTrue(!n.isEmpty()),i=new u,i.add(this.createNode(t)),r=new u(n),gu.sort(r,this.getComparator()),f=r.iterator();f.hasNext();)e=f.next(),this.lastNode(i).getChildBoundables().size()===this.getNodeCapacity()&&i.add(this.createNode(t)),this.lastNode(i).addChildBoundable(e);return i},isEmpty:function(){return this.built?this.root.isEmpty():this.itemBoundables.isEmpty()},interfaces_:function(){return[ir]},getClass:function(){return ni}});ni.compareDoubles=function(n,t){return n>t?1:n<t?-1:0};ni.IntersectsOp=rd;ni.serialVersionUID=-0x35ef64c82d4c5400;ni.DEFAULT_NODE_CAPACITY=10;i(ba.prototype,{distance:function(){},interfaces_:function(){return[]},getClass:function(){return ba}});y(kt,ni);i(kt.prototype,{createParentBoundablesFromVerticalSlices:function(n,t){c.isTrue(n.length>0);for(var r=new u,i=0;i<n.length;i++)r.addAll(this.createParentBoundablesFromVerticalSlice(n[i],t));return r},createNode:function(n){return new ic(n)},size:function(){return 0===arguments.length?ni.prototype.size.call(this):ni.prototype.size.apply(this,arguments)},insert:function(){if(2!==arguments.length)return ni.prototype.insert.apply(this,arguments);var n=arguments[0],t=arguments[1];return n.isNull()?null:void ni.prototype.insert.call(this,n,t)},getIntersectsOp:function(){return kt.intersectsOp},verticalSlices:function(n,t){for(var f,o,s=Math.trunc(Math.ceil(n.size()/t)),r=new Array(t).fill(null),e=n.iterator(),i=0;i<t;i++)for(r[i]=new u,f=0;e.hasNext()&&f<s;)o=e.next(),r[i].add(o),f++;return r},query:function(){var n,t,i;if(1===arguments.length)return n=arguments[0],ni.prototype.query.call(this,n);if(2===arguments.length)t=arguments[0],i=arguments[1],ni.prototype.query.call(this,t,i);else if(3===arguments.length)if(l(arguments[2],we)&&arguments[0]instanceof Object&&arguments[1]instanceof tr){var r=arguments[0],u=arguments[1],f=arguments[2];ni.prototype.query.call(this,r,u,f)}else if(l(arguments[2],ei)&&arguments[0]instanceof Object&&arguments[1]instanceof tr){var e=arguments[0],o=arguments[1],s=arguments[2];ni.prototype.query.call(this,e,o,s)}},getComparator:function(){return kt.yComparator},createParentBoundablesFromVerticalSlice:function(n,t){return ni.prototype.createParentBoundables.call(this,n,t)},remove:function(){if(2===arguments.length){var n=arguments[0],t=arguments[1];return ni.prototype.remove.call(this,n,t)}return ni.prototype.remove.apply(this,arguments)},depth:function(){return 0===arguments.length?ni.prototype.depth.call(this):ni.prototype.depth.apply(this,arguments)},createParentBoundables:function(n,t){var r,i,f;return c.isTrue(!n.isEmpty()),r=Math.trunc(Math.ceil(n.size()/this.getNodeCapacity())),i=new u(n),gu.sort(i,kt.xComparator),f=this.verticalSlices(i,Math.trunc(Math.ceil(Math.sqrt(r)))),this.createParentBoundablesFromVerticalSlices(f,t)},nearestNeighbour:function(){var e,n,o,t,f;if(1===arguments.length){if(l(arguments[0],ba))return e=arguments[0],n=new fr(this.getRoot(),this.getRoot(),e),this.nearestNeighbour(n);if(arguments[0]instanceof fr)return o=arguments[0],this.nearestNeighbour(o,v.POSITIVE_INFINITY)}else if(2===arguments.length){if(arguments[0]instanceof kt&&l(arguments[1],ba)){var s=arguments[0],h=arguments[1],n=new fr(this.getRoot(),s.getRoot(),h);return this.nearestNeighbour(n)}if(arguments[0]instanceof fr&&"number"==typeof arguments[1]){var c=arguments[0],a=arguments[1],i=a,u=null,r=new cp;for(r.add(c);!r.isEmpty()&&i>0;){if(t=r.poll(),f=t.getDistance(),f>=i)break;t.isLeaves()?(i=f,u=t):t.expandToQueue(r,i)}return[u.getBoundable(0).getItem(),u.getBoundable(1).getItem()]}}else if(3===arguments.length){var y=arguments[0],p=arguments[1],w=arguments[2],b=new ne(y,p),n=new fr(this.getRoot(),b,w);return this.nearestNeighbour(n)[0]}},interfaces_:function(){return[wa,ir]},getClass:function(){return kt}});kt.centreX=function(n){return kt.avg(n.getMinX(),n.getMaxX())};kt.avg=function(n,t){return(n+t)/2};kt.centreY=function(n){return kt.avg(n.getMinY(),n.getMaxY())};y(ic,tr);i(ic.prototype,{computeBounds:function(){for(var i,n=null,t=this.getChildBoundables().iterator();t.hasNext();)i=t.next(),null===n?n=new p(i.getBounds()):n.expandToInclude(i.getBounds());return n},interfaces_:function(){return[]},getClass:function(){return ic}});kt.STRtreeNode=ic;kt.serialVersionUID=0x39920f7d5f261e0;kt.xComparator={interfaces_:function(){return[ve]},compare:function(n,t){return ni.compareDoubles(kt.centreX(n.getBounds()),kt.centreX(t.getBounds()))}};kt.yComparator={interfaces_:function(){return[ve]},compare:function(n,t){return ni.compareDoubles(kt.centreY(n.getBounds()),kt.centreY(t.getBounds()))}};kt.intersectsOp={interfaces_:function(){return[IntersectsOp]},intersects:function(n,t){return n.intersects(t)}};kt.DEFAULT_NODE_CAPACITY=10;i(er.prototype,{interfaces_:function(){return[]},getClass:function(){return er}});er.relativeSign=function(n,t){return n<t?-1:n>t?1:0};er.compare=function(n,t,i){if(t.equals2D(i))return 0;var r=er.relativeSign(t.x,i.x),u=er.relativeSign(t.y,i.y);switch(n){case 0:return er.compareValue(r,u);case 1:return er.compareValue(u,r);case 2:return er.compareValue(u,-r);case 3:return er.compareValue(-r,u);case 4:return er.compareValue(-r,-u);case 5:return er.compareValue(-u,-r);case 6:return er.compareValue(-u,r);case 7:return er.compareValue(r,-u)}return c.shouldNeverReachHere("invalid octant value"),0};er.compareValue=function(n,t){return n<0?-1:n>0?1:t<0?-1:t>0?1:0};i(lp.prototype,{getCoordinate:function(){return this.coord},print:function(n){n.print(this.coord);n.print(" seg # = "+this.segmentIndex)},compareTo:function(n){var t=n;return this.segmentIndex<t.segmentIndex?-1:this.segmentIndex>t.segmentIndex?1:this.coord.equals2D(t.coord)?0:er.compare(this.segmentOctant,this.coord,t.coord)},isEndPoint:function(n){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===n},isInterior:function(){return this._isInterior},interfaces_:function(){return[sr]},getClass:function(){return lp}});i(ap.prototype,{getSplitCoordinates:function(){var r=new ii,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()},addCollapsedNodes:function(){var n=new u,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)},print:function(n){n.println("Intersections:");for(var t=this.iterator();t.hasNext();)t.next().print(n)},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+1),this.edge.getCoordinate(t+2)),i.equals2D(r)&&n.add(new vu(t+1))},addEdgeCoordinates:function(n,t,i){var e=t.segmentIndex-n.segmentIndex+2,o=this.edge.getCoordinate(t.segmentIndex),f=t.isInterior()||!t.coord.equals2D(o),u;for(f||e--,i.add(new r(n.coord),!1),u=n.segmentIndex+1;u<=t.segmentIndex;u++)i.add(this.edge.getCoordinate(u));f&&i.add(new r(t.coord))},iterator:function(){return this.nodeMap.values().iterator()},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},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)},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 vu(r[0])),u=i},getEdge:function(){return this.edge},addEndpoints:function(){var n=this.edge.size()-1;this.add(this.edge.getCoordinate(0),0);this.add(this.edge.getCoordinate(n),n)},createSplitEdge:function(n,t){var e=t.segmentIndex-n.segmentIndex+2,s=this.edge.getCoordinate(t.segmentIndex),o=t.isInterior()||!t.coord.equals2D(s),i,u,f;for(o||e--,i=new Array(e).fill(null),u=0,i[u++]=new r(n.coord),f=n.segmentIndex+1;f<=t.segmentIndex;f++)i[u++]=this.edge.getCoordinate(f);return o&&(i[u]=new r(t.coord)),new tf(i,this.edge.getData())},add:function(n,t){var i=new lp(this.edge,n,t,this.edge.getSegmentOctant(t)),r=this.nodeMap.get(i);return null!==r?(c.isTrue(r.coord.equals2D(n),"Found equal nodes with different coordinates"),r):(this.nodeMap.put(i,i),i)},checkSplitEdgesCorrectness:function(n){var t=this.edge.getCoordinates(),f=n.get(0),i=f.getCoordinate(0);if(!i.equals2D(t[0]))throw new ci("bad split edge start point at "+i);var e=n.get(n.size()-1),r=e.getCoordinates(),u=r[r.length-1];if(!u.equals2D(t[t.length-1]))throw new ci("bad split edge end point at "+u);},interfaces_:function(){return[]},getClass:function(){return ap}});i(ub.prototype,{next:function(){return null===this.currNode?(this.currNode=this.nextNode,this.currSegIndex=this.currNode.segmentIndex,this.readNextNode(),this.currNode):null===this.nextNode?null:this.nextNode.segmentIndex===this.currNode.segmentIndex?(this.currNode=this.nextNode,this.currSegIndex=this.currNode.segmentIndex,this.readNextNode(),this.currNode):(this.nextNode.segmentIndex,this.currNode.segmentIndex,null)},remove:function(){throw new UnsupportedOperationException(this.getClass().getName());},hasNext:function(){return null!==this.nextNode},readNextNode:function(){this.nextNode=this.nodeIt.hasNext()?this.nodeIt.next():null},interfaces_:function(){return[wh]},getClass:function(){return ub}});i(vp.prototype,{addIntersection:function(){},interfaces_:function(){return[tc]},getClass:function(){return vp}});i(tf.prototype,{getCoordinates:function(){return this.pts},size:function(){return this.pts.length},getCoordinate:function(n){return this.pts[n]},isClosed:function(){return this.pts[0].equals(this.pts[this.pts.length-1])},getSegmentOctant:function(n){return n===this.pts.length-1?-1:this.safeOctant(this.getCoordinate(n),this.getCoordinate(n+1))},setData:function(n){this.data=n},safeOctant:function(n,t){return n.equals2D(t)?0:bs.octant(n,t)},getData:function(){return this.data},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 i=arguments[0],u=arguments[1],f=(arguments[2],arguments[3]),e=new r(i.getIntersection(f));this.addIntersection(e,u)}},toString:function(){return pi.toLineString(new gr(this.pts))},getNodeList:function(){return this.nodeList},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)},addIntersections:function(n,t,i){for(var r=0;r<n.getIntersectionNum();r++)this.addIntersection(n,t,i,r)},interfaces_:function(){return[vp]},getClass:function(){return tf}});tf.getNodedSubstrings=function(){var t,n,r;if(1===arguments.length)return t=arguments[0],n=new u,tf.getNodedSubstrings(t,n),n;if(2===arguments.length)for(var f=arguments[0],e=arguments[1],i=f.iterator();i.hasNext();)r=i.next(),r.getNodeList().addSplitEdges(e)};i(rc.prototype,{overlap:function(){if(2===arguments.length)arguments[0],arguments[1];else if(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)}},interfaces_:function(){return[]},getClass:function(){return rc}});i(yp.prototype,{getLineSegment:function(n,t){t.p0=this.pts[n];t.p1=this.pts[n+1]},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)},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},computeOverlaps:function(n,t){this.computeOverlapsInternal(this.start,this.end,n,n.start,n.end,t)},setId:function(n){this.id=n},select:function(n,t){this.computeSelect(n,this.start,this.end,t)},getEnvelope:function(){if(null===this.env){var n=this.pts[this.start],t=this.pts[this.end];this.env=new p(n,t)}return this.env},getEndIndex:function(){return this.end},getStartIndex:function(){return this.start},getContext:function(){return this.context},getId:function(){return this.id},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))},interfaces_:function(){return[]},getClass:function(){return yp}});i(it.prototype,{interfaces_:function(){return[]},getClass:function(){return it}});it.isNorthern=function(n){return n===it.NE||n===it.NW};it.isOpposite=function(n,t){return n!==t&&2==(n-t+4)%4};it.commonHalfPlane=function(n,t){if(n===t)return n;if(2==(n-t+4)%4)return-1;var i=n<t?n:t,r=n>t?n:t;return 0===i&&3===r?3:i};it.isInHalfPlane=function(n,t){return t===it.SE?n===it.SE||n===it.SW:n===t||n===t+1};it.quadrant=function(){var u,i,n,t;if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){if(u=arguments[0],i=arguments[1],0===u&&0===i)throw new ct("Cannot compute the quadrant for point ( "+u+", "+i+" )");return u>=0?i>=0?it.NE:it.SE:i>=0?it.NW:it.SW}if(arguments[0]instanceof r&&arguments[1]instanceof r){if(n=arguments[0],t=arguments[1],t.x===n.x&&t.y===n.y)throw new ct("Cannot compute the quadrant for two identical points "+n);return t.x>=n.x?t.y>=n.y?it.NE:it.SE:t.y>=n.y?it.NW:it.SW}};it.NE=0;it.NW=1;it.SW=2;it.SE=3;i(pu.prototype,{interfaces_:function(){return[]},getClass:function(){return pu}});pu.getChainStartIndices=function(n){var t=0,i=new u,r;i.add(new vu(t));do r=pu.findChainEnd(n,t),i.add(new vu(r)),t=r;while(t<n.length-1);return pu.toIntArray(i)};pu.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=it.quadrant(n[i],n[i+1]),r=t+1;r<n.length;){if(!n[r-1].equals2D(n[r])&&it.quadrant(n[r-1],n[r])!==u)break;r++}return r-1};pu.getChains=function(){var i,e;if(1===arguments.length)return i=arguments[0],pu.getChains(i,null);if(2===arguments.length){for(var r=arguments[0],o=arguments[1],f=new u,t=pu.getChainStartIndices(r),n=0;n<t.length-1;n++)e=new yp(r,t[n],t[n+1],o),f.add(e);return f}};pu.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};i(uc.prototype,{computeNodes:function(){},getNodedSubstrings:function(){},interfaces_:function(){return[]},getClass:function(){return uc}});i(ka.prototype,{setSegmentIntersector:function(n){this.segInt=n},interfaces_:function(){return[uc]},getClass:function(){return ka}});y(be,ka);i(be.prototype,{getMonotoneChains:function(){return this.monoChains},getNodedSubstrings:function(){return tf.getNodedSubstrings(this.nodedSegStrings)},getIndex:function(){return this.index},add:function(n){for(var t,r=pu.getChains(n.getCoordinates(),n),i=r.iterator();i.hasNext();)t=i.next(),t.setId(this.idCounter++),this.index.insert(t.getEnvelope(),t),this.monoChains.add(t)},computeNodes:function(n){this.nodedSegStrings=n;for(var t=n.iterator();t.hasNext();)this.add(t.next());this.intersectChains()},intersectChains:function(){for(var i,r=new fc(this.segInt),n=this.monoChains.iterator();n.hasNext();)for(var t=n.next(),f=this.index.query(t.getEnvelope()),u=f.iterator();u.hasNext();)if(i=u.next(),i.getId()>t.getId()&&(t.computeOverlaps(i,r),this.nOverlaps++),this.segInt.isDone())return null},interfaces_:function(){return[]},getClass:function(){return be}});y(fc,rc);i(fc.prototype,{overlap:function(){if(4!==arguments.length)return rc.prototype.overlap.apply(this,arguments);var n=arguments[0],t=arguments[1],i=arguments[2],r=arguments[3],u=n.getContext(),f=i.getContext();this.si.processIntersections(u,t,f,r)},interfaces_:function(){return[]},getClass:function(){return fc}});be.SegmentOverlapAction=fc;y(ar,ci);i(ar.prototype,{getCoordinate:function(){return this.pt},interfaces_:function(){return[]},getClass:function(){return ar}});ar.msgWithCoord=function(n,t){return null!==t?n+" [ "+t+" ]":n};i(ec.prototype,{processIntersections:function(){},isDone:function(){},interfaces_:function(){return[]},getClass:function(){return ec}});i(se.prototype,{getInteriorIntersection:function(){return this.interiorIntersection},setCheckEndSegmentsOnly:function(n){this.isCheckEndSegmentsOnly=n},getIntersectionSegments:function(){return this.intSegments},count:function(){return this.intersectionCount},getIntersections:function(){return this.intersections},setFindAllIntersections:function(n){this.findAllIntersections=n},setKeepIntersections:function(n){this.keepIntersections=n},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++)},isEndSegment:function(n,t){return 0===t||t>=n.size()-2},hasIntersection:function(){return null!==this.interiorIntersection},isDone:function(){return!this.findAllIntersections&&null!==this.interiorIntersection},interfaces_:function(){return[ec]},getClass:function(){return se}});se.createAllIntersectionsFinder=function(n){var t=new se(n);return t.setFindAllIntersections(!0),t};se.createAnyIntersectionFinder=function(n){return new se(n)};se.createIntersectionCounter=function(n){var t=new se(n);return t.setFindAllIntersections(!0),t.setKeepIntersections(!1),t};i(oc.prototype,{execute:function(){return null!==this.segInt?null:void this.checkInteriorIntersections()},getIntersections:function(){return this.segInt.getIntersections()},isValid:function(){return this.execute(),this._isValid},setFindAllIntersections:function(n){this.findAllIntersections=n},checkInteriorIntersections:function(){this._isValid=!0;this.segInt=new se(this.li);this.segInt.setFindAllIntersections(this.findAllIntersections);var n=new be;if(n.setSegmentIntersector(this.segInt),n.computeNodes(this.segStrings),this.segInt.hasIntersection())return this._isValid=!1,null},checkValid:function(){if(this.execute(),!this._isValid)throw new ar(this.getErrorMessage(),this.segInt.getInteriorIntersection());},getErrorMessage:function(){if(this._isValid)return"no intersections found";var n=this.segInt.getIntersectionSegments();return"found non-noded intersection between "+pi.toLineString(n[0],n[1])+" and "+pi.toLineString(n[2],n[3])},interfaces_:function(){return[]},getClass:function(){return oc}});oc.computeIntersections=function(n){var t=new oc(n);return t.setFindAllIntersections(!0),t.isValid(),t.getIntersections()};i(ko.prototype,{checkValid:function(){this.nv.checkValid()},interfaces_:function(){return[]},getClass:function(){return ko}});ko.toSegmentStrings=function(n){for(var r,t=new u,i=n.iterator();i.hasNext();)r=i.next(),t.add(new hp(r.getCoordinates(),r));return t};ko.checkValid=function(n){new ko(n).checkValid()};i(ks.prototype,{map:function(n){for(var r,i=new u,t=0;t<n.getNumGeometries();t++)r=this.mapOp.map(n.getGeometryN(t)),r.isEmpty()||i.add(r);return n.getFactory().createGeometryCollection(g.toGeometryArray(i))},interfaces_:function(){return[]},getClass:function(){return ks}});ks.map=function(n,t){return new ks(t).map(n)};i(o.prototype,{interfaces_:function(){return[]},getClass:function(){return o}});o.opposite=function(n){return n===o.LEFT?o.RIGHT:n===o.RIGHT?o.LEFT:n};o.ON=0;o.LEFT=1;o.RIGHT=2;i(vr.prototype,{setAllLocations:function(n){for(var t=0;t<this.location.length;t++)this.location[t]=n},isNull:function(){for(var n=0;n<this.location.length;n++)if(this.location[n]!==t.NONE)return!1;return!0},setAllLocationsIfNull:function(n){for(var i=0;i<this.location.length;i++)this.location[i]===t.NONE&&(this.location[i]=n)},isLine:function(){return 1===this.location.length},merge:function(n){var r,i;for(n.location.length>this.location.length&&(r=new Array(3).fill(null),r[o.ON]=this.location[o.ON],r[o.LEFT]=t.NONE,r[o.RIGHT]=t.NONE,this.location=r),i=0;i<this.location.length;i++)this.location[i]===t.NONE&&i<n.location.length&&(this.location[i]=n.location[i])},getLocations:function(){return this.location},flip:function(){if(this.location.length<=1)return null;var n=this.location[o.LEFT];this.location[o.LEFT]=this.location[o.RIGHT];this.location[o.RIGHT]=n},toString:function(){var n=new eu;return this.location.length>1&&n.append(t.toLocationSymbol(this.location[o.LEFT])),n.append(t.toLocationSymbol(this.location[o.ON])),this.location.length>1&&n.append(t.toLocationSymbol(this.location[o.RIGHT])),n.toString()},setLocations:function(n,t,i){this.location[o.ON]=n;this.location[o.LEFT]=t;this.location[o.RIGHT]=i},get:function(n){return n<this.location.length?this.location[n]:t.NONE},isArea:function(){return this.location.length>1},isAnyNull:function(){for(var n=0;n<this.location.length;n++)if(this.location[n]===t.NONE)return!0;return!1},setLocation:function(){var n,t,i;1===arguments.length?(n=arguments[0],this.setLocation(o.ON,n)):2===arguments.length&&(t=arguments[0],i=arguments[1],this.location[t]=i)},init:function(n){this.location=new Array(n).fill(null);this.setAllLocations(t.NONE)},isEqualOnSide:function(n,t){return this.location[t]===n.location[t]},allPositionsEqual:function(n){for(var t=0;t<this.location.length;t++)if(this.location[t]!==n)return!1;return!0},interfaces_:function(){return[]},getClass:function(){return vr}});i(ti.prototype,{getGeometryCount:function(){var n=0;return this.elt[0].isNull()||n++,this.elt[1].isNull()||n++,n},setAllLocations:function(n,t){this.elt[n].setAllLocations(t)},isNull:function(n){return this.elt[n].isNull()},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))},isLine:function(n){return this.elt[n].isLine()},merge:function(n){for(var t=0;t<2;t++)null===this.elt[t]&&null!==n.elt[t]?this.elt[t]=new vr(n.elt[t]):this.elt[t].merge(n.elt[t])},flip:function(){this.elt[0].flip();this.elt[1].flip()},getLocation:function(){var n,t,i;return 1===arguments.length?(n=arguments[0],this.elt[n].get(o.ON)):2===arguments.length?(t=arguments[0],i=arguments[1],this.elt[t].get(i)):void 0},toString:function(){var n=new eu;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()},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()}},isAnyNull:function(n){return this.elt[n].isAnyNull()},setLocation:function(){var n,t;if(2===arguments.length)n=arguments[0],t=arguments[1],this.elt[n].setLocation(o.ON,t);else if(3===arguments.length){var i=arguments[0],r=arguments[1],u=arguments[2];this.elt[i].setLocation(r,u)}},isEqualOnSide:function(n,t){return this.elt[0].isEqualOnSide(n.elt[0],t)&&this.elt[1].isEqualOnSide(n.elt[1],t)},allPositionsEqual:function(n,t){return this.elt[n].allPositionsEqual(t)},toLine:function(n){this.elt[n].isArea()&&(this.elt[n]=new vr(this.elt[n].location[0]))},interfaces_:function(){return[]},getClass:function(){return ti}});ti.toLineLabel=function(n){for(var r=new ti(t.NONE),i=0;i<2;i++)r.setLocation(i,n.getLocation(i));return r};i(ds.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=s.isCCW(this.ring.getCoordinates())},isIsolated:function(){return 1===this.label.getGeometryCount()},computePoints:function(n){var t,i,r;this.startDe=n;t=n;i=!0;do{if(null===t)throw new ar("Found null DirectedEdge");if(t.getEdgeRing()===this)throw new ar("Directed Edge visited twice during ring-building at "+t.getCoordinate());this.edges.add(t);r=t.getLabel();c.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)},getLinearRing:function(){return this.ring},getCoordinate:function(n){return this.pts.get(n)},computeMaxNodeDegree:function(){var n,i,t;this.maxNodeDegree=0;n=this.startDe;do i=n.getNode(),t=i.getEdges().getOutgoingDegree(this),t>this.maxNodeDegree&&(this.maxNodeDegree=t),n=this.getNext(n);while(n!==this.startDe);this.maxNodeDegree*=2},addPoints:function(n,t,i){var f=n.getCoordinates(),u,r;if(t)for(u=1,i&&(u=0),r=u;r<f.length;r++)this.pts.add(f[r]);else for(u=f.length-2,i&&(u=f.length-1),r=u;r>=0;r--)this.pts.add(f[r])},isHole:function(){return this._isHole},setInResult:function(){var n=this.startDe;do n.getEdge().setInResult(!0),n=n.getNext();while(n!==this.startDe)},containsPoint:function(n){var i=this.getLinearRing(),t;if(!i.getEnvelopeInternal().contains(n)||!s.isPointInRing(n,i.getCoordinates()))return!1;for(t=this.holes.iterator();t.hasNext();)if(t.next().containsPoint(n))return!1;return!0},addHole:function(n){this.holes.add(n)},isShell:function(){return null===this.shell},getLabel:function(){return this.label},getEdges:function(){return this.edges},getMaxNodeDegree:function(){return this.maxNodeDegree<0&&this.computeMaxNodeDegree(),this.maxNodeDegree},getShell:function(){return this.shell},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],i=arguments[1],r=u.getLocation(i,o.RIGHT);if(r===t.NONE)return null;if(this.label.getLocation(i)===t.NONE)return this.label.setLocation(i,r),null}},setShell:function(n){this.shell=n;null!==n&&n.addHole(this)},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)},interfaces_:function(){return[]},getClass:function(){return ds}});y(da,ds);i(da.prototype,{setEdgeRing:function(n,t){n.setMinEdgeRing(t)},getNext:function(n){return n.getNextMin()},interfaces_:function(){return[]},getClass:function(){return da}});y(sc,ds);i(sc.prototype,{buildMinimalRings:function(){var t=new u,n=this.startDe,i;do null===n.getMinEdgeRing()&&(i=new da(n,this.geometryFactory),t.add(i)),n=n.getNext();while(n!==this.startDe);return t},setEdgeRing:function(n,t){n.setEdgeRing(t)},linkDirectedEdgesForMinimalEdgeRings:function(){var n=this.startDe;do n.getNode().getEdges().linkMinimalDirectedEdges(this),n=n.getNext();while(n!==this.startDe)},getNext:function(n){return n.getNext()},interfaces_:function(){return[]},getClass:function(){return sc}});i(ke.prototype,{setVisited:function(n){this._isVisited=n},setInResult:function(n){this._isInResult=n},isCovered:function(){return this._isCovered},isCoveredSet:function(){return this._isCoveredSet},setLabel:function(n){this.label=n},getLabel:function(){return this.label},setCovered:function(n){this._isCovered=n;this._isCoveredSet=!0},updateIM:function(n){c.isTrue(this.label.getGeometryCount()>=2,"found partial label");this.computeIM(n)},isInResult:function(){return this._isInResult},isVisited:function(){return this._isVisited},interfaces_:function(){return[]},getClass:function(){return ke}});y(te,ke);i(te.prototype,{isIncidentEdgeInResult:function(){for(var n=this.getEdges().getEdges().iterator();n.hasNext();)if(n.next().getEdge().isInResult())return!0;return!1},isIsolated:function(){return 1===this.label.getGeometryCount()},getCoordinate:function(){return this.coord},print:function(n){n.println("node "+this.coord+" lbl: "+this.label)},computeIM:function(){},computeMergedLocation:function(n,i){var r=t.NONE,u;return(r=this.label.getLocation(i),n.isNull(i))||(u=n.getLocation(i),r!==t.BOUNDARY&&(r=u)),r},setLabel:function(){if(2!==arguments.length)return ke.prototype.setLabel.apply(this,arguments);var n=arguments[0],t=arguments[1];null===this.label?this.label=new ti(n,t):this.label.setLocation(n,t)},getEdges:function(){return this.edges},mergeLabel:function(){var i,r,n,u,f;if(arguments[0]instanceof te)i=arguments[0],this.mergeLabel(i.label);else if(arguments[0]instanceof ti)for(r=arguments[0],n=0;n<2;n++)u=this.computeMergedLocation(r,n),f=this.label.getLocation(n),f===t.NONE&&this.label.setLocation(n,u)},add:function(n){this.edges.insert(n);n.setNode(this)},setLabelBoundary:function(n){var r,i;if(null===this.label)return null;r=t.NONE;null!==this.label&&(r=this.label.getLocation(n));i=null;switch(r){case t.BOUNDARY:i=t.INTERIOR;break;case t.INTERIOR:i=t.BOUNDARY;break;default:i=t.BOUNDARY}this.label.setLocation(n,i)},interfaces_:function(){return[]},getClass:function(){return te}});i(gs.prototype,{find:function(n){return this.nodeMap.get(n)},addNode:function(){var i,t,n;return arguments[0]instanceof r?(i=arguments[0],n=this.nodeMap.get(i),null===n&&(n=this.nodeFact.createNode(i),this.nodeMap.put(i,n)),n):arguments[0]instanceof te?(t=arguments[0],n=this.nodeMap.get(t.getCoordinate()),null===n?(this.nodeMap.put(t.getCoordinate(),t),t):(n.mergeLabel(t),n)):void 0},print:function(n){for(var t=this.iterator();t.hasNext();)t.next().print(n)},iterator:function(){return this.nodeMap.values().iterator()},values:function(){return this.nodeMap.values()},getBoundaryNodes:function(n){for(var f,i=new u,r=this.iterator();r.hasNext();)f=r.next(),f.getLabel().getLocation(n)===t.BOUNDARY&&i.add(f);return i},add:function(n){var t=n.getCoordinate();this.addNode(t).add(n)},interfaces_:function(){return[]},getClass:function(){return gs}});i(rf.prototype,{compareDirection:function(n){return this.dx===n.dx&&this.dy===n.dy?0:this.quadrant>n.quadrant?1:this.quadrant<n.quadrant?-1:s.computeOrientation(n.p0,n.p1,this.p1)},getDy:function(){return this.dy},getCoordinate:function(){return this.p0},setNode:function(n){this.node=n},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)},compareTo:function(n){var t=n;return this.compareDirection(t)},getDirectedCoordinate:function(){return this.p1},getDx:function(){return this.dx},getLabel:function(){return this.label},getEdge:function(){return this.edge},getQuadrant:function(){return this.quadrant},getNode:function(){return this.node},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},computeLabel:function(){},init:function(n,t){this.p0=n;this.p1=t;this.dx=t.x-n.x;this.dy=t.y-n.y;this.quadrant=it.quadrant(this.dx,this.dy);c.isTrue(!(0===this.dx&&0===this.dy),"EdgeEnd with identical endpoints found")},interfaces_:function(){return[sr]},getClass:function(){return rf}});y(go,rf);i(go.prototype,{getNextMin:function(){return this.nextMin},getDepth:function(n){return this.depth[n]},setVisited:function(n){this._isVisited=n},computeDirectedLabel:function(){this.label=new ti(this.edge.getLabel());this._isForward||this.label.flip()},getNext:function(){return this.next},setDepth:function(n,t){if(-999!==this.depth[n]&&this.depth[n]!==t)throw new ar("assigned depths do not match",this.getCoordinate());this.depth[n]=t},isInteriorAreaEdge:function(){for(var i=!0,n=0;n<2;n++)this.label.isArea(n)&&this.label.getLocation(n,o.LEFT)===t.INTERIOR&&this.label.getLocation(n,o.RIGHT)===t.INTERIOR||(i=!1);return i},setNextMin:function(n){this.nextMin=n},print:function(n){rf.prototype.print.call(this,n);n.print(" "+this.depth[o.LEFT]+"/"+this.depth[o.RIGHT]);n.print(" ("+this.getDepthDelta()+")");this._isInResult&&n.print(" inResult")},setMinEdgeRing:function(n){this.minEdgeRing=n},isLineEdge:function(){var n=this.label.isLine(0)||this.label.isLine(1),i=!this.label.isArea(0)||this.label.allPositionsEqual(0,t.EXTERIOR),r=!this.label.isArea(1)||this.label.allPositionsEqual(1,t.EXTERIOR);return n&&i&&r},setEdgeRing:function(n){this.edgeRing=n},getMinEdgeRing:function(){return this.minEdgeRing},getDepthDelta:function(){var n=this.edge.getDepthDelta();return this._isForward||(n=-n),n},setInResult:function(n){this._isInResult=n},getSym:function(){return this.sym},isForward:function(){return this._isForward},getEdge:function(){return this.edge},printEdge:function(n){this.print(n);n.print(" ");this._isForward?this.edge.print(n):this.edge.printReverse(n)},setSym:function(n){this.sym=n},setVisitedEdge:function(n){this.setVisited(n);this.sym.setVisited(n)},setEdgeDepths:function(n,t){var i=this.getEdge().getDepthDelta(),r;this._isForward||(i=-i);r=1;n===o.LEFT&&(r=-1);var u=o.opposite(n),f=i*r,e=t+f;this.setDepth(n,t);this.setDepth(u,e)},getEdgeRing:function(){return this.edgeRing},isInResult:function(){return this._isInResult},setNext:function(n){this.next=n},isVisited:function(){return this._isVisited},interfaces_:function(){return[]},getClass:function(){return go}});go.depthFactor=function(n,i){return n===t.EXTERIOR&&i===t.INTERIOR?1:n===t.INTERIOR&&i===t.EXTERIOR?-1:0};i(ns.prototype,{createNode:function(n){return new te(n,null)},interfaces_:function(){return[]},getClass:function(){return ns}});i(uf.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)},find:function(n){return this.nodes.find(n)},addNode:function(){var n,t;return arguments[0]instanceof te?(n=arguments[0],this.nodes.addNode(n)):arguments[0]instanceof r?(t=arguments[0],this.nodes.addNode(t)):void 0},getNodeIterator:function(){return this.nodes.iterator()},linkResultDirectedEdges:function(){for(var n=this.nodes.iterator();n.hasNext();)n.next().getEdges().linkResultDirectedEdges()},debugPrintln:function(n){pt.out.println(n)},isBoundaryNode:function(n,i){var u=this.nodes.find(i),r;return null===u?!1:(r=u.getLabel(),null!==r&&r.getLocation(n)===t.BOUNDARY)},linkAllDirectedEdges:function(){for(var n=this.nodes.iterator();n.hasNext();)n.next().getEdges().linkAllDirectedEdges()},matchInSameDirection:function(n,t,i,r){return!!n.equals(i)&&s.computeOrientation(n,t,r)===s.COLLINEAR&&it.quadrant(n,t)===it.quadrant(i,r)},getEdgeEnds:function(){return this.edgeEndList},debugPrint:function(n){pt.out.print(n)},getEdgeIterator:function(){return this.edges.iterator()},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},insertEdge:function(n){this.edges.add(n)},findEdgeEnd:function(n){for(var i,t=this.getEdgeEnds().iterator();t.hasNext();)if(i=t.next(),i.getEdge()===n)return i;return null},addEdges:function(n){for(var t,i,r,u=n.iterator();u.hasNext();)t=u.next(),this.edges.add(t),i=new go(t,!0),r=new go(t,!1),i.setSym(r),r.setSym(i),this.add(i),this.add(r)},add:function(n){this.nodes.add(n);this.edgeEndList.add(n)},getNodes:function(){return this.nodes.values()},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},interfaces_:function(){return[]},getClass:function(){return uf}});uf.linkResultDirectedEdges=function(n){for(var t=n.iterator();t.hasNext();)t.next().getEdges().linkResultDirectedEdges()};i(ga.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)},computePolygons:function(n){for(var r,f,t=new u,i=n.iterator();i.hasNext();)r=i.next(),f=r.toPolygon(this.geometryFactory),t.add(f);return t},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 ar("unable to assign hole to a shell",i.getCoordinate(0));i.setShell(u)}},buildMinimalEdgeRings:function(n,t,i){for(var r,f,e,o=new u,s=n.iterator();s.hasNext();)r=s.next(),r.getMaxNodeDegree()>2?(r.linkDirectedEdgesForMinimalEdgeRings(),f=r.buildMinimalRings(),e=this.findShell(f),null!==e?(this.placePolygonHoles(e,f),t.add(e)):i.addAll(f)):o.add(r);return o},containsPoint:function(n){for(var t=this.shellList.iterator();t.hasNext();)if(t.next().containsPoint(n))return!0;return!1},buildMaximalEdgeRings:function(n){for(var t,f,i=new u,r=n.iterator();r.hasNext();)t=r.next(),t.isInResult()&&t.getLabel().isArea()&&null===t.getEdgeRing()&&(f=new sc(t,this.geometryFactory),i.add(f),f.setInResult());return i},placePolygonHoles:function(n,t){for(var r,i=t.iterator();i.hasNext();)r=i.next(),r.isHole()&&r.setShell(n)},getPolygons:function(){return this.computePolygons(this.shellList)},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 o=e.next(),h=o.getLinearRing(),c=h.getEnvelopeInternal();null!==i&&(f=i.getLinearRing().getEnvelopeInternal());r=!1;c.contains(l)&&s.isPointInRing(a,h.getCoordinates())&&(r=!0);r&&(null===i||f.contains(c))&&(i=o)}return i},findShell:function(n){for(var t,i=0,r=null,u=n.iterator();u.hasNext();)t=u.next(),t.isHole()||(r=t,i++);return c.isTrue(i<=1,"found two shells in MinimalEdgeRing list"),r},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];uf.linkResultDirectedEdges(r);var f=this.buildMaximalEdgeRings(i),t=new u,e=this.buildMinimalEdgeRings(f,this.shellList,t);this.sortShellsAndHoles(e,this.shellList,t);this.placeFreeHoles(this.shellList,t)}},interfaces_:function(){return[]},getClass:function(){return ga}});i(pp.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)},labelIsolatedLine:function(n,t){var i=this.ptLocator.locate(n.getCoordinate(),this.op.getArgGeometry(t));n.getLabel().setLocation(t,i)},build:function(n){return this.findCoveredLineEdges(),this.collectLines(n),this.buildLines(n),this.resultLineList},collectLineEdge:function(n,t,i){var u=n.getLabel(),r=n.getEdge();n.isLineEdge()&&(n.isVisited()||!a.isResultOfOp(u,t)||r.isCovered()||(i.add(r),n.setVisitedEdge(!0)))},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))},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))},buildLines:function(){for(var n,i,t=this.lineEdgesList.iterator();t.hasNext();)n=t.next(),i=(n.getLabel(),this.geometryFactory.createLineString(n.getCoordinates())),this.resultLineList.add(i),n.setInResult(!0)},collectBoundaryTouchEdge:function(n,t,i){var r=n.getLabel();return n.isLineEdge()?null:n.isVisited()?null:n.isInteriorAreaEdge()?null:n.getEdge().isInResult()?null:(c.isTrue(!(n.isInResult()||n.getSym().isInResult())||!n.getEdge().isInResult()),void(a.isResultOfOp(r,t)&&t===a.INTERSECTION&&(i.add(n.getEdge()),n.setVisitedEdge(!0))))},interfaces_:function(){return[]},getClass:function(){return pp}});i(wp.prototype,{filterCoveredNodeToPoint:function(n){var t=n.getCoordinate(),i;this.op.isCoveredByLA(t)||(i=this.geometryFactory.createPoint(t),this.resultPointList.add(i))},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!==a.INTERSECTION||(r=t.getLabel(),a.isResultOfOp(r,n)&&this.filterCoveredNodeToPoint(t))},build:function(n){return this.extractNonCoveredResultNodes(n),this.resultPointList},interfaces_:function(){return[]},getClass:function(){return wp}});i(nv.prototype,{locate:function(){},interfaces_:function(){return[]},getClass:function(){return nv}});i(tu.prototype,{locate:function(n){return tu.locate(n,this.geom)},interfaces_:function(){return[nv]},getClass:function(){return tu}});tu.isPointInRing=function(n,t){return!!t.getEnvelopeInternal().intersects(n)&&s.isPointInRing(n,t.getCoordinates())};tu.containsPointInPolygon=function(n,t){var r,i,u;if(t.isEmpty()||(r=t.getExteriorRing(),!tu.isPointInRing(n,r)))return!1;for(i=0;i<t.getNumInteriorRing();i++)if(u=t.getInteriorRingN(i),tu.isPointInRing(n,u))return!1;return!0};tu.containsPoint=function(n,t){var i,r;if(t instanceof st)return tu.containsPointInPolygon(n,t);if(t instanceof nt)for(i=new wo(t);i.hasNext();)if(r=i.next(),r!==t&&tu.containsPoint(n,r))return!0;return!1};tu.locate=function(n,i){return i.isEmpty()?t.EXTERIOR:tu.containsPoint(n,i)?t.INTERIOR:t.EXTERIOR};i(ts.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)},propagateSideLabels:function(n){for(var f,u,i,s,h,e=t.NONE,r=this.iterator();r.hasNext();)u=r.next(),i=u.getLabel(),i.isArea(n)&&i.getLocation(n,o.LEFT)!==t.NONE&&(e=i.getLocation(n,o.LEFT));if(e===t.NONE)return null;for(f=e,r=this.iterator();r.hasNext();)if(u=r.next(),i=u.getLabel(),i.getLocation(n,o.ON)===t.NONE&&i.setLocation(n,o.ON,f),i.isArea(n))if(s=i.getLocation(n,o.LEFT),h=i.getLocation(n,o.RIGHT),h!==t.NONE){if(h!==f)throw new ar("side location conflict",u.getCoordinate());s===t.NONE&&c.shouldNeverReachHere("found single null side (at "+u.getCoordinate()+")");f=s}else c.isTrue(i.getLocation(n,o.LEFT)===t.NONE,"found single null side"),i.setLocation(n,o.RIGHT,f),i.setLocation(n,o.LEFT,f)},getCoordinate:function(){var n=this.iterator();return n.hasNext()?n.next().getCoordinate():null},print:function(n){pt.out.println("EdgeEndStar:   "+this.getCoordinate());for(var t=this.iterator();t.hasNext();)t.next().print(n)},isAreaLabelsConsistent:function(n){return this.computeEdgeEndLabels(n.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},checkAreaLabelsConsistent:function(n){var r=this.getEdges(),u,f,l,i,e,s;if(r.size()<=0)return!0;var a=r.size()-1,v=r.get(a).getLabel(),h=v.getLocation(n,o.LEFT);for(c.isTrue(h!==t.NONE,"Found unlabelled area edge"),u=h,f=this.iterator();f.hasNext();){if((l=f.next(),i=l.getLabel(),c.isTrue(i.isArea(n),"Found non-area edge"),e=i.getLocation(n,o.LEFT),s=i.getLocation(n,o.RIGHT),e===s)||s!==u)return!1;u=e}return!0},findIndex:function(n){this.iterator();for(var t=0;t<this.edgeList.size();t++)if(this.edgeList.get(t)===n)return t;return-1},iterator:function(){return this.getEdges().iterator()},getEdges:function(){return null===this.edgeList&&(this.edgeList=new u(this.edgeMap.values())),this.edgeList},getLocation:function(n,i,r){return this.ptInAreaLocation[n]===t.NONE&&(this.ptInAreaLocation[n]=tu.locate(i,r[n].getGeometry())),this.ptInAreaLocation[n]},toString:function(){var n=new eu,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()},computeEdgeEndLabels:function(n){for(var t=this.iterator();t.hasNext();)t.next().computeLabel(n)},computeLabelling:function(n){var o,r,e,s;for(this.computeEdgeEndLabels(n[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1),o=[!1,!1],r=this.iterator();r.hasNext();)for(var f=r.next(),u=f.getLabel(),i=0;i<2;i++)u.isLine(i)&&u.getLocation(i)===t.BOUNDARY&&(o[i]=!0);for(r=this.iterator();r.hasNext();)for(var f=r.next(),u=f.getLabel(),i=0;i<2;i++)u.isAnyNull(i)&&(e=t.NONE,o[i]?e=t.EXTERIOR:(s=f.getCoordinate(),e=this.getLocation(i,s,n)),u.setAllLocationsIfNull(i,e))},getDegree:function(){return this.edgeMap.size()},insertEdgeEnd:function(n,t){this.edgeMap.put(n,t);this.edgeList=null},interfaces_:function(){return[]},getClass:function(){return ts}});y(tv,ts);i(tv.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 ar("no outgoing dirEdge found",this.getCoordinate());c.isTrue(t.isInResult(),"unable to link last incoming dirEdge");r.setNext(t)}},insert:function(n){var t=n;this.insertEdgeEnd(t,t)},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 it.isNorthern(u)&&it.isNorthern(f)?n:it.isNorthern(u)||it.isNorthern(f)?0!==n.getDy()?n:0!==t.getDy()?t:(c.shouldNeverReachHere("found two horizontal edges incident on node"),null):t},print:function(n){var t,i;for(pt.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()},getResultAreaEdges:function(){var t,n;if(null!==this.resultAreaEdgeList)return this.resultAreaEdgeList;for(this.resultAreaEdgeList=new u,t=this.iterator();t.hasNext();)n=t.next(),(n.isInResult()||n.getSym().isInResult())&&this.resultAreaEdgeList.add(n);return this.resultAreaEdgeList},updateLabelling:function(n){for(var r,i,t=this.iterator();t.hasNext();)r=t.next(),i=r.getLabel(),i.setAllLocationsIfNull(0,n.getLocation(0)),i.setAllLocationsIfNull(1,n.getLocation(1))},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)},computeDepths:function(){var t;if(1===arguments.length){var n=arguments[0],u=this.findIndex(n),f=(n.getLabel(),n.getDepth(o.LEFT)),e=n.getDepth(o.RIGHT),s=this.computeDepths(u+1,this.edgeList.size(),f);if(this.computeDepths(0,u,s)!==e)throw new ar("depth mismatch at "+n.getCoordinate());}else if(3===arguments.length){for(var h=arguments[0],c=arguments[1],l=arguments[2],i=l,r=h;r<c;r++)t=this.edgeList.get(r),t.getLabel(),t.setEdgeDepths(o.RIGHT,i),i=t.getDepth(o.LEFT);return i}},mergeSymLabels:function(){for(var t,n=this.iterator();n.hasNext();)t=n.next(),t.getLabel().merge(t.getSym().getLabel())},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&&(c.isTrue(null!==i,"found null for first outgoing dirEdge"),c.isTrue(i.getEdgeRing()===n,"unable to link last incoming dirEdge"),u.setNextMin(i))},getOutgoingDegree:function(){var n,t,i;if(0===arguments.length){for(n=0,t=this.iterator();t.hasNext();)i=t.next(),i.isInResult()&&n++;return n}if(1===arguments.length){for(var r=arguments[0],n=0,t=this.iterator();t.hasNext();)i=t.next(),i.getEdgeRing()===r&&n++;return n}},getLabel:function(){return this.label},findCoveredLineEdges:function(){for(var f,n,u,r=t.NONE,i=this.iterator();i.hasNext();)if(n=i.next(),u=n.getSym(),!n.isLineEdge()){if(n.isInResult()){r=t.INTERIOR;break}if(u.isInResult()){r=t.EXTERIOR;break}}if(r===t.NONE)return null;for(f=r,i=this.iterator();i.hasNext();)n=i.next(),u=n.getSym(),n.isLineEdge()?n.getEdge().setCovered(f===t.INTERIOR):(n.isInResult()&&(f=t.EXTERIOR),u.isInResult()&&(f=t.INTERIOR))},computeLabelling:function(n){var r,u;for(ts.prototype.computeLabelling.call(this,n),this.label=new ti(t.NONE),r=this.iterator();r.hasNext();)for(var f=r.next(),e=f.getEdge(),o=e.getLabel(),i=0;i<2;i++)u=o.getLocation(i),u!==t.INTERIOR&&u!==t.BOUNDARY||this.label.setLocation(i,t.INTERIOR)},interfaces_:function(){return[]},getClass:function(){return tv}});y(nh,ns);i(nh.prototype,{createNode:function(n){return new te(n,new tv)},interfaces_:function(){return[]},getClass:function(){return nh}});i(bp.prototype,{computeIntersections:function(n,t){this.mce.computeIntersectsForChain(this.chainIndex,n.mce,n.chainIndex,t)},interfaces_:function(){return[]},getClass:function(){return bp}});i(ie.prototype,{isDelete:function(){return this.eventType===ie.DELETE},setDeleteEventIndex:function(n){this.deleteEventIndex=n},getObject:function(){return this.obj},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},getInsertEvent:function(){return this.insertEvent},isInsert:function(){return this.eventType===ie.INSERT},isSameLabel:function(n){return null!==this.label&&this.label===n.label},getDeleteEventIndex:function(){return this.deleteEventIndex},interfaces_:function(){return[sr]},getClass:function(){return ie}});ie.INSERT=1;ie.DELETE=2;i(iv.prototype,{interfaces_:function(){return[]},getClass:function(){return iv}});i(de.prototype,{isTrivialIntersection:function(n,t,i,r){if(n===i&&1===this.li.getIntersectionNum()){if(de.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},getProperIntersectionPoint:function(){return this.properIntersectionPoint},setIsDoneIfProperInt:function(n){this.isDoneWhenProperInt=n},hasProperInteriorIntersection:function(){return this.hasProperInterior},isBoundaryPointInternal:function(n,t){for(var r,u,i=t.iterator();i.hasNext();)if(r=i.next(),u=r.getCoordinate(),n.isIntersection(u))return!0;return!1},hasProperIntersection:function(){return this.hasProper},hasIntersection:function(){return this._hasIntersection},isDone:function(){return this._isDone},isBoundaryPoint:function(n,t){return!(null===t||!this.isBoundaryPointInternal(n,t[0])&&!this.isBoundaryPointInternal(n,t[1]))},setBoundaryNodes:function(n,t){this.bdyNodes=new Array(2).fill(null);this.bdyNodes[0]=n;this.bdyNodes[1]=t},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))))},interfaces_:function(){return[]},getClass:function(){return de}});de.isAdjacentSegments=function(n,t){return 1===Math.abs(n-t)};y(rv,iv);i(rv.prototype,{prepareEvents:function(){var n,t;for(gu.sort(this.events),n=0;n<this.events.size();n++)t=this.events.get(n),t.isDelete()&&t.getInsertEvent().setDeleteEventIndex(n)},computeIntersections:function(){var i,n,t;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 de&&l(arguments[0],ei)&&l(arguments[1],ei)){var r=arguments[0],u=arguments[1],e=arguments[2];this.addEdges(r,r);this.addEdges(u,u);this.computeIntersections(e)}else if("boolean"==typeof arguments[2]&&l(arguments[0],ei)&&arguments[1]instanceof de){var f=arguments[0],o=arguments[1],s=arguments[2];s?this.addEdges(f,null):this.addEdges(f);this.computeIntersections(o)}},addEdge:function(n,t){for(var f,u,r=n.getMonotoneChainEdge(),e=r.getStartIndexes(),i=0;i<e.length-1;i++)f=new bp(r,i),u=new ie(t,r.getMinX(i),f),this.events.add(u),this.events.add(new ie(r.getMaxX(i),u))},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++))},addEdges:function(){var i,n,t;if(1===arguments.length)for(i=arguments[0],n=i.iterator();n.hasNext();)t=n.next(),this.addEdge(t,t);else if(2===arguments.length)for(var r=arguments[0],u=arguments[1],n=r.iterator();n.hasNext();)t=n.next(),this.addEdge(t,u)},interfaces_:function(){return[]},getClass:function(){return rv}});i(is.prototype,{getMin:function(){return this.min},intersects:function(n,t){return!(this.min>t||this.max<n)},getMax:function(){return this.max},toString:function(){return pi.toLineString(new r(this.min,0),new r(this.max,0))},interfaces_:function(){return[]},getClass:function(){return is}});i(kp.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},interfaces_:function(){return[ve]},getClass:function(){return kp}});is.NodeComparator=kp;y(uv,is);i(uv.prototype,{query:function(n,t,i){return this.intersects(n,t)?void i.visitItem(this.item):null},interfaces_:function(){return[]},getClass:function(){return uv}});y(fv,is);i(fv.prototype,{buildExtent:function(n,t){this.min=Math.min(n.min,t.min);this.max=Math.max(n.max,t.max)},query:function(n,t,i){return this.intersects(n,t)?(null!==this.node1&&this.node1.query(n,t,i),void(null!==this.node2&&this.node2.query(n,t,i))):null},interfaces_:function(){return[]},getClass:function(){return fv}});i(dp.prototype,{buildTree:function(){gu.sort(this.leaves,new IntervalRTreeNode.NodeComparator);for(var t=this.leaves,i=null,n=new u;;){if(this.buildLevel(t,n),1===n.size())return n.get(0);i=t;t=n;n=i}},insert:function(n,t,i){if(null!==this.root)throw new IllegalStateException("Index cannot be added to once it has been queried");this.leaves.add(new uv(n,t,i))},query:function(n,t,i){this.init();this.root.query(n,t,i)},buildRoot:function(){return null!==this.root?null:void(this.root=this.buildTree())},printNode:function(n){pt.out.println(pi.toLineString(new r(n.min,this.level),new r(n.max,this.level)))},init:function(){return null!==this.root?null:void this.buildRoot()},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 fv(n.get(i),n.get(i+1)),t.add(u))},interfaces_:function(){return[]},getClass:function(){return dp}});i(wi.prototype,{filter:function(n){if(this.isForcedToLineString&&n instanceof gt){var t=n.getFactory().createLineString(n.getCoordinateSequence());return this.lines.add(t),null}n instanceof d&&this.lines.add(n)},setForceToLineString:function(n){this.isForcedToLineString=n},interfaces_:function(){return[yu]},getClass:function(){return wi}});wi.getGeometry=function(){var n,t,i;return 1===arguments.length?(n=arguments[0],n.getFactory().buildGeometry(wi.getLines(n))):2===arguments.length?(t=arguments[0],i=arguments[1],t.getFactory().buildGeometry(wi.getLines(t,i))):void 0};wi.getLines=function(){var f,i,r,t;if(1===arguments.length)return f=arguments[0],wi.getLines(f,!1);if(2===arguments.length){if(l(arguments[0],yt)&&l(arguments[1],yt)){for(var a=arguments[0],e=arguments[1],n=a.iterator();n.hasNext();)t=n.next(),wi.getLines(t,e);return e}if(arguments[0]instanceof h&&"boolean"==typeof arguments[1]){var v=arguments[0],y=arguments[1],o=new u;return v.apply(new wi(o,y)),o}if(arguments[0]instanceof h&&l(arguments[1],yt))return i=arguments[0],r=arguments[1],i instanceof d?r.add(i):i.apply(new wi(r)),r}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&l(arguments[0],yt)&&l(arguments[1],yt)){for(var p=arguments[0],s=arguments[1],w=arguments[2],n=p.iterator();n.hasNext();)t=n.next(),wi.getLines(t,s,w);return s}if("boolean"==typeof arguments[2]&&arguments[0]instanceof h&&l(arguments[1],yt)){var b=arguments[0],c=arguments[1],k=arguments[2];return b.apply(new wi(c,k)),c}}};i(ev.prototype,{visitItem:function(n){this.items.add(n)},getItems:function(){return this.items},interfaces_:function(){return[we]},getClass:function(){return ev}});i(hc.prototype,{locate:function(n){var t=new po(n),i=new ov(t);return this.index.query(n.y,n.y,i),t.getLocation()},interfaces_:function(){return[nv]},getClass:function(){return hc}});i(ov.prototype,{visitItem:function(n){var t=n;this.counter.countSegment(t.getCoordinate(0),t.getCoordinate(1))},interfaces_:function(){return[we]},getClass:function(){return ov}});i(sv.prototype,{init:function(n){for(var r,u,i=wi.getLines(n),t=i.iterator();t.hasNext();)r=t.next(),u=r.getCoordinates(),this.addLine(u)},addLine:function(n){for(var t=1;t<n.length;t++){var i=new b(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)}},query:function(){if(2===arguments.length){var t=arguments[0],i=arguments[1],n=new ev;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)}},interfaces_:function(){return[]},getClass:function(){return sv}});hc.SegmentVisitor=ov;hc.IntervalIndexedGeometry=sv;i(gp.prototype,{getSegmentIndex:function(){return this.segmentIndex},getCoordinate:function(){return this.coord},print:function(n){n.print(this.coord);n.print(" seg # = "+this.segmentIndex);n.println(" dist = "+this.dist)},compareTo:function(n){var t=n;return this.compare(t.segmentIndex,t.dist)},isEndPoint:function(n){return 0===this.segmentIndex&&0===this.dist||this.segmentIndex===n},toString:function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},getDistance:function(){return this.dist},compare:function(n,t){return this.segmentIndex<n?-1:this.segmentIndex>n?1:this.dist<t?-1:this.dist>t?1:0},interfaces_:function(){return[sr]},getClass:function(){return gp}});i(nw.prototype,{print:function(n){n.println("Intersections:");for(var t=this.iterator();t.hasNext();)t.next().print(n)},iterator:function(){return this.nodeMap.values().iterator()},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},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)},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),i,u,f;for(o||e--,i=new Array(e).fill(null),u=0,i[u++]=new r(n.coord),f=n.segmentIndex+1;f<=t.segmentIndex;f++)i[u++]=this.edge.pts[f];return o&&(i[u]=t.coord),new ou(i,new ti(this.edge.label))},add:function(n,t,i){var r=new gp(n,t,i),u=this.nodeMap.get(r);return null!==u?u:(this.nodeMap.put(r,r),r)},isIntersection:function(n){for(var t=this.iterator();t.hasNext();)if(t.next().coord.equals(n))return!0;return!1},interfaces_:function(){return[]},getClass:function(){return nw}});i(cc.prototype,{getChainStartIndices:function(n){var t=0,i=new u,r;i.add(new vu(t));do r=this.findChainEnd(n,t),i.add(new vu(r)),t=r;while(t<n.length-1);return cc.toIntArray(i)},findChainEnd:function(n,t){for(var r=it.quadrant(n[t],n[t+1]),i=t+1;i<n.length;){if(it.quadrant(n[i-1],n[i])!==r)break;i++}return i-1},interfaces_:function(){return[]},getClass:function(){return cc}});cc.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};i(tw.prototype,{getCoordinates:function(){return this.pts},getMaxX:function(n){var t=this.pts[this.startIndex[n]].x,i=this.pts[this.startIndex[n+1]].x;return t>i?t:i},getMinX:function(n){var t=this.pts[this.startIndex[n]].x,i=this.pts[this.startIndex[n+1]].x;return t<i?t:i},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))}},getStartIndexes:function(){return this.startIndex},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)},interfaces_:function(){return[]},getClass:function(){return tw}});i(wu.prototype,{getDepth:function(n,t){return this.depth[n][t]},setDepth:function(n,t,i){this.depth[n][t]=i},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},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},getDelta:function(n){return this.depth[n][o.RIGHT]-this.depth[n][o.LEFT]},getLocation:function(n,i){return this.depth[n][i]<=0?t.EXTERIOR:t.INTERIOR},toString:function(){return"A: "+this.depth[0][1]+","+this.depth[0][2]+" B: "+this.depth[1][1]+","+this.depth[1][2]},add:function(){var u,n,i,r;if(1===arguments.length)for(u=arguments[0],n=0;n<2;n++)for(i=1;i<3;i++)r=u.getLocation(n,i),r!==t.EXTERIOR&&r!==t.INTERIOR||(this.isNull(n,i)?this.depth[n][i]=wu.depthAtLocation(r):this.depth[n][i]+=wu.depthAtLocation(r));else if(3===arguments.length){var f=arguments[0],e=arguments[1],o=arguments[2];o===t.INTERIOR&&this.depth[f][e]++}},interfaces_:function(){return[]},getClass:function(){return wu}});wu.depthAtLocation=function(n){return n===t.EXTERIOR?0:n===t.INTERIOR?1:wu.NULL_VALUE};wu.NULL_VALUE=-1;y(ou,ke);i(ou.prototype,{getDepth:function(){return this.depth},getCollapsedEdge:function(){var n=new Array(2).fill(null);return n[0]=this.pts[0],n[1]=this.pts[1],new ou(n,ti.toLineLabel(this.label))},isIsolated:function(){return this._isIsolated},getCoordinates:function(){return this.pts},setIsolated:function(n){this._isIsolated=n},setName:function(n){this.name=n},equals:function(n){var i;if(!(n instanceof ou)||(i=n,this.pts.length!==i.pts.length))return!1;for(var r=!0,u=!0,f=this.pts.length,t=0;t<this.pts.length;t++)if(this.pts[t].equals2D(i.pts[t])||(r=!1),this.pts[t].equals2D(i.pts[--f])||(u=!1),!r&&!u)return!1;return!0},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]}},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)},computeIM:function(n){ou.updateIM(this.label,n)},isCollapsed:function(){return!!this.label.isArea()&&3===this.pts.length&&!!this.pts[0].equals(this.pts[2])},isClosed:function(){return this.pts[0].equals(this.pts[this.pts.length-1])},getMaximumSegmentIndex:function(){return this.pts.length-1},getDepthDelta:function(){return this.depthDelta},getNumPoints:function(){return this.pts.length},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("")},getMonotoneChainEdge:function(){return null===this.mce&&(this.mce=new tw(this)),this.mce},getEnvelope:function(){if(null===this.env){this.env=new p;for(var n=0;n<this.pts.length;n++)this.env.expandToInclude(this.pts[n])}return this.env},addIntersection:function(n,t,i,u){var o=new r(n.getIntersection(u)),f=t,s=n.getEdgeDistance(i,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)},toString:function(){var n=new eu,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()},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},setDepthDelta:function(n){this.depthDelta=n},getEdgeIntersectionList:function(){return this.eiList},addIntersections:function(n,t,i){for(var r=0;r<n.getIntersectionNum();r++)this.addIntersection(n,t,i,r)},interfaces_:function(){return[]},getClass:function(){return ou}});ou.updateIM=function(){if(2!==arguments.length)return ke.prototype.updateIM.apply(this,arguments);var n=arguments[0],t=arguments[1];t.setAtLeastIfValid(n.getLocation(0,o.ON),n.getLocation(1,o.ON),1);n.isArea()&&(t.setAtLeastIfValid(n.getLocation(0,o.LEFT),n.getLocation(1,o.LEFT),2),t.setAtLeastIfValid(n.getLocation(0,o.RIGHT),n.getLocation(1,o.RIGHT),2))};y(or,uf);i(or.prototype,{insertBoundaryPoint:function(n,i){var e=this.nodes.addNode(i),r=e.getLabel(),u=1,f;t.NONE;r.getLocation(n,o.ON)===t.BOUNDARY&&u++;f=or.determineBoundary(this.boundaryNodeRule,u);r.setLocation(n,f)},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 de(r,!0,!1);n.setIsDoneIfProperInt(f);var e=this.createEdgeSetIntersector(),o=this.parentGeom instanceof gt||this.parentGeom instanceof st||this.parentGeom instanceof ai,s=u||!o;return e.computeIntersections(this.edges,n,s),this.addSelfIntersectionNodes(this.argIndex),n}},computeSplitEdges:function(n){for(var t=this.edges.iterator();t.hasNext();)t.next().eiList.addSplitEdges(n)},computeEdgeIntersections:function(n,t,i){var r=new de(t,i,!0);return r.setBoundaryNodes(this.getBoundaryNodes(),n.getBoundaryNodes()),this.createEdgeSetIntersector().computeIntersections(this.edges,n.edges,r),r},getGeometry:function(){return this.parentGeom},getBoundaryNodeRule:function(){return this.boundaryNodeRule},hasTooFewPoints:function(){return this._hasTooFewPoints},addPoint:function(){var n,i,u;arguments[0]instanceof bt?(n=arguments[0],i=n.getCoordinate(),this.insertPoint(this.argIndex,i,t.INTERIOR)):arguments[0]instanceof r&&(u=arguments[0],this.insertPoint(this.argIndex,u,t.INTERIOR))},addPolygon:function(n){var i,r;for(this.addPolygonRing(n.getExteriorRing(),t.EXTERIOR,t.INTERIOR),i=0;i<n.getNumInteriorRing();i++)r=n.getInteriorRingN(i),this.addPolygonRing(r,t.INTERIOR,t.EXTERIOR)},addEdge:function(n){this.insertEdge(n);var i=n.getCoordinates();this.insertPoint(this.argIndex,i[0],t.BOUNDARY);this.insertPoint(this.argIndex,i[i.length-1],t.BOUNDARY)},addLineString:function(n){var i=w.removeRepeatedPoints(n.getCoordinates()),r;if(i.length<2)return this._hasTooFewPoints=!0,this.invalidPoint=i[0],null;r=new ou(i,new ti(this.argIndex,t.INTERIOR));this.lineEdgeMap.put(n,r);this.insertEdge(r);c.isTrue(i.length>=2,"found LineString with single point");this.insertBoundaryPoint(this.argIndex,i[0]);this.insertBoundaryPoint(this.argIndex,i[i.length-1])},getInvalidPoint:function(){return this.invalidPoint},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},getBoundaryNodes:function(){return null===this.boundaryNodes&&(this.boundaryNodes=this.nodes.getBoundaryNodes(this.argIndex)),this.boundaryNodes},addSelfIntersectionNode:function(n,i,r){return this.isBoundaryNode(n,i)?null:void(r===t.BOUNDARY&&this.useBoundaryDeterminationRule?this.insertBoundaryPoint(n,i):this.insertPoint(n,i,r))},addPolygonRing:function(n,i,r){var u,f,e,o;if(n.isEmpty())return null;if(u=w.removeRepeatedPoints(n.getCoordinates()),u.length<4)return this._hasTooFewPoints=!0,this.invalidPoint=u[0],null;f=i;e=r;s.isCCW(u)&&(f=r,e=i);o=new ou(u,new ti(this.argIndex,t.BOUNDARY,f,e));this.lineEdgeMap.put(n,o);this.insertEdge(o);this.insertPoint(this.argIndex,u[0],t.BOUNDARY)},insertPoint:function(n,t,i){var r=this.nodes.addNode(t),u=r.getLabel();null===u?r.label=new ti(n,i):u.setLocation(n,i)},createEdgeSetIntersector:function(){return new rv},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)},add:function(){if(1!==arguments.length)return uf.prototype.add.apply(this,arguments);var n=arguments[0];if(n.isEmpty())return null;if(n instanceof ai&&(this.useBoundaryDeterminationRule=!1),n instanceof st)this.addPolygon(n);else if(n instanceof d)this.addLineString(n);else if(n instanceof bt)this.addPoint(n);else if(n instanceof lr)this.addCollection(n);else if(n instanceof cr)this.addCollection(n);else if(n instanceof ai)this.addCollection(n);else{if(!(n instanceof nt))throw new UnsupportedOperationException(n.getClass().getName());this.addCollection(n)}},addCollection:function(n){for(var i,t=0;t<n.getNumGeometries();t++)i=n.getGeometryN(t),this.add(i)},locate:function(n){return l(this.parentGeom,bf)&&this.parentGeom.getNumGeometries()>50?(null===this.areaPtLocator&&(this.areaPtLocator=new hc(this.parentGeom)),this.areaPtLocator.locate(n)):this.ptLocator.locate(n,this.parentGeom)},findEdge:function(){if(1===arguments.length){var n=arguments[0];return this.lineEdgeMap.get(n)}return uf.prototype.findEdge.apply(this,arguments)},interfaces_:function(){return[]},getClass:function(){return or}});or.determineBoundary=function(n,i){return n.isInBoundary(i)?t.BOUNDARY:t.INTERIOR};i(ge.prototype,{getArgGeometry:function(n){return this.arg[n].getGeometry()},setComputationPrecision:function(n){this.resultPrecisionModel=n;this.li.setPrecisionModel(this.resultPrecisionModel)},interfaces_:function(){return[]},getClass:function(){return ge}});i(no.prototype,{compareTo:function(n){var t=n;return no.compareOriented(this.pts,this._orientation,t.pts,t._orientation)},interfaces_:function(){return[sr]},getClass:function(){return no}});no.orientation=function(n){return 1===w.increasingDirection(n)};no.compareOriented=function(n,t,i,r){for(var s,u,f,h=t?1:-1,c=r?1:-1,l=t?n.length:-1,a=r?i.length:-1,e=t?0:n.length-1,o=r?0:i.length-1;;){if(s=n[e].compareTo(i[o]),0!==s)return s;if(e+=h,o+=c,u=e===l,f=o===a,u&&!f)return-1;if(!u&&f)return 1;if(u&&f)return 0}};i(hv.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(")  ")},addAll:function(n){for(var t=n.iterator();t.hasNext();)this.add(t.next())},findEdgeIndex:function(n){for(var t=0;t<this.edges.size();t++)if(this.edges.get(t).equals(n))return t;return-1},iterator:function(){return this.edges.iterator()},getEdges:function(){return this.edges},get:function(n){return this.edges.get(n)},findEqualEdge:function(n){var t=new no(n.getCoordinates());return this.ocaMap.get(t)},add:function(n){this.edges.add(n);var t=new no(n.getCoordinates());this.ocaMap.put(t,n)},interfaces_:function(){return[]},getClass:function(){return hv}});y(a,ge);i(a.prototype,{insertUniqueEdge:function(n){var i=this.edgeList.findEqualEdge(n),u,t,r;null!==i?(u=i.getLabel(),t=n.getLabel(),i.isPointwiseEqual(n)||(t=new ti(n.getLabel()),t.flip()),r=i.getDepth(),r.isNull()&&r.add(u),r.add(t),u.merge(t)):this.edgeList.add(n)},getGraph:function(){return this.graph},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))},isCoveredByLA:function(n){return!!this.isCovered(n,this.resultLineList)||!!this.isCovered(n,this.resultPolyList)},computeGeometry:function(n,t,i,r){var f=new u;return f.addAll(n),f.addAll(t),f.addAll(i),f.isEmpty()?a.createEmptyResult(r,this.arg[0].getGeometry(),this.arg[1].getGeometry(),this.geomFact):this.geomFact.buildGeometry(f)},mergeSymLabels:function(){for(var n=this.graph.getNodes().iterator();n.hasNext();)n.next().getEdges().mergeSymLabels()},isCovered:function(n,i){for(var u,r=i.iterator();r.hasNext();)if(u=r.next(),this.ptLocator.locate(n,u)!==t.EXTERIOR)return!0;return!1},replaceCollapsedEdges:function(){for(var i,t=new u,n=this.edgeList.iterator();n.hasNext();)i=n.next(),i.isCollapsed()&&(n.remove(),t.add(i.getCollapsedEdge()));this.edgeList.addAll(t)},updateNodeLabelling:function(){for(var t,i,n=this.graph.getNodes().iterator();n.hasNext();)t=n.next(),i=t.getEdges().getLabel(),t.getLabel().merge(i)},getResultGeometry:function(n){return this.computeOverlay(n),this.resultGeom},insertUniqueEdges:function(n){for(var i,t=n.iterator();t.hasNext();)i=t.next(),this.insertUniqueEdge(i)},computeOverlay:function(n){var t,i,r,f;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 u;this.arg[0].computeSplitEdges(t);this.arg[1].computeSplitEdges(t);this.insertUniqueEdges(t);this.computeLabelsFromDepths();this.replaceCollapsedEdges();ko.checkValid(this.edgeList.getEdges());this.graph.addEdges(this.edgeList.getEdges());this.computeLabelling();this.labelIncompleteNodes();this.findResultAreaEdges(n);this.cancelDuplicateResultEdges();i=new ga(this.geomFact);i.add(this.graph);this.resultPolyList=i.getPolygons();r=new pp(this,this.geomFact,this.ptLocator);this.resultLineList=r.build(n);f=new wp(this,this.geomFact,this.ptLocator);this.resultPointList=f.build(n);this.resultGeom=this.computeGeometry(this.resultPointList,this.resultLineList,this.resultPolyList,n)},labelIncompleteNode:function(n,t){var i=this.ptLocator.locate(n.getCoordinate(),this.arg[t].getGeometry());n.getLabel().setLocation(t,i)},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))},findResultAreaEdges:function(n){for(var t,i,r=this.graph.getEdgeEnds().iterator();r.hasNext();)t=r.next(),i=t.getLabel(),i.isArea()&&!t.isInteriorAreaEdge()&&a.isResultOfOp(i.getLocation(0,o.RIGHT),i.getLocation(1,o.RIGHT),n)&&t.setInResult(!0)},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):(c.isTrue(!t.isNull(n,o.LEFT),"depth of LEFT side has not been initialized"),i.setLocation(n,o.LEFT,t.getLocation(n,o.LEFT)),c.isTrue(!t.isNull(n,o.RIGHT),"depth of RIGHT side has not been initialized"),i.setLocation(n,o.RIGHT,t.getLocation(n,o.RIGHT))))}},computeLabelling:function(){for(var n=this.graph.getNodes().iterator();n.hasNext();)n.next().getEdges().computeLabelling(this.arg);this.mergeSymLabels();this.updateNodeLabelling()},labelIncompleteNodes:function(){for(var n,i,r=0,t=this.graph.getNodes().iterator();t.hasNext();)n=t.next(),i=n.getLabel(),n.isIsolated()&&(r++,i.isNull(0)?this.labelIncompleteNode(n,0):this.labelIncompleteNode(n,1)),n.getEdges().updateLabelling(i)},isCoveredByA:function(n){return!!this.isCovered(n,this.resultPolyList)},interfaces_:function(){return[]},getClass:function(){return a}});a.overlayOp=function(n,t,i){return new a(n,t).getResultGeometry(i)};a.intersection=function(n,t){if(n.isEmpty()||t.isEmpty())return a.createEmptyResult(a.INTERSECTION,n,t,n.getFactory());if(n.isGeometryCollection()){var i=t;return ks.map(n,{interfaces_:function(){return[MapOp]},map:function(n){return n.intersection(i)}})}return n.checkNotGeometryCollection(n),n.checkNotGeometryCollection(t),hi.overlayOp(n,t,a.INTERSECTION)};a.symDifference=function(n,t){if(n.isEmpty()||t.isEmpty()){if(n.isEmpty()&&t.isEmpty())return a.createEmptyResult(a.SYMDIFFERENCE,n,t,n.getFactory());if(n.isEmpty())return t.copy();if(t.isEmpty())return n.copy()}return n.checkNotGeometryCollection(n),n.checkNotGeometryCollection(t),hi.overlayOp(n,t,a.SYMDIFFERENCE)};a.resultDimension=function(n,t,i){var u=t.getDimension(),f=i.getDimension(),r=-1;switch(n){case a.INTERSECTION:r=Math.min(u,f);break;case a.UNION:r=Math.max(u,f);break;case a.DIFFERENCE:r=u;break;case a.SYMDIFFERENCE:r=Math.max(u,f)}return r};a.createEmptyResult=function(n,t,i,r){var u=null;switch(a.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};a.difference=function(n,t){return n.isEmpty()?a.createEmptyResult(a.DIFFERENCE,n,t,n.getFactory()):t.isEmpty()?n.copy():(n.checkNotGeometryCollection(n),n.checkNotGeometryCollection(t),hi.overlayOp(n,t,a.DIFFERENCE))};a.isResultOfOp=function(){if(2===arguments.length){var r=arguments[0],u=arguments[1],f=r.getLocation(0),e=r.getLocation(1);return a.isResultOfOp(f,e,u)}if(3===arguments.length){var n=arguments[0],i=arguments[1],o=arguments[2];switch(n===t.BOUNDARY&&(n=t.INTERIOR),i===t.BOUNDARY&&(i=t.INTERIOR),o){case a.INTERSECTION:return n===t.INTERIOR&&i===t.INTERIOR;case a.UNION:return n===t.INTERIOR||i===t.INTERIOR;case a.DIFFERENCE:return n===t.INTERIOR&&i!==t.INTERIOR;case a.SYMDIFFERENCE:return n===t.INTERIOR&&i!==t.INTERIOR||n!==t.INTERIOR&&i===t.INTERIOR}return!1}};a.INTERSECTION=1;a.UNION=2;a.DIFFERENCE=3;a.SYMDIFFERENCE=4;i(su.prototype,{selfSnap:function(n){return new nr(n).snapTo(n,this.snapTolerance)},removeCommonBits:function(n){this.cbr=new gh;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},prepareResult:function(n){return this.cbr.addCommonBits(n),n},getResultGeometry:function(n){var t=this.snap(this.geom),i=a.overlayOp(t[0],t[1],n);return this.prepareResult(i)},checkValid:function(n){n.isValid()||pt.out.println("Snapped geometry is invalid")},computeSnapTolerance:function(){this.snapTolerance=nr.computeOverlaySnapTolerance(this.geom[0],this.geom[1])},snap:function(n){var t=this.removeCommonBits(n);return nr.snap(t[0],t[1],this.snapTolerance)},interfaces_:function(){return[]},getClass:function(){return su}});su.overlayOp=function(n,t,i){return new su(n,t).getResultGeometry(i)};su.union=function(n,t){return su.overlayOp(n,t,a.UNION)};su.intersection=function(n,t){return su.overlayOp(n,t,a.INTERSECTION)};su.symDifference=function(n,t){return su.overlayOp(n,t,a.SYMDIFFERENCE)};su.difference=function(n,t){return su.overlayOp(n,t,a.DIFFERENCE)};i(hi.prototype,{getResultGeometry:function(n){var t=null,i=!1,r=null;try{t=a.overlayOp(this.geom[0],this.geom[1],n);i=!0}catch(n){if(!(n instanceof ci))throw n;r=n}if(!i)try{t=su.overlayOp(this.geom[0],this.geom[1],n)}catch(n){throw n instanceof ci?r:n;}return t},interfaces_:function(){return[]},getClass:function(){return hi}});hi.overlayOp=function(n,t,i){return new hi(n,t).getResultGeometry(i)};hi.union=function(n,t){return hi.overlayOp(n,t,a.UNION)};hi.intersection=function(n,t){return hi.overlayOp(n,t,a.INTERSECTION)};hi.symDifference=function(n,t){return hi.overlayOp(n,t,a.SYMDIFFERENCE)};hi.difference=function(n,t){return hi.overlayOp(n,t,a.DIFFERENCE)};i(bu.prototype,{addPolygon:function(n){var f,u;if(n.isEmpty())return null;var i=null,t=0,r=this.horizontalBisector(n);0===r.getLength()?(t=0,i=r.getCoordinate()):(f=hi.overlayOp(r,n,a.INTERSECTION),u=this.widestGeometry(f),t=u.getEnvelopeInternal().getWidth(),i=bu.centre(u.getEnvelopeInternal()));(null===this.interiorPoint||t>this.maxWidth)&&(this.interiorPoint=i,this.maxWidth=t)},getInteriorPoint:function(){return this.interiorPoint},widestGeometry:function(){var n,i,t,r;if(arguments[0]instanceof nt){if(n=arguments[0],n.isEmpty())return n;for(i=n.getGeometryN(0),t=1;t<n.getNumGeometries();t++)n.getGeometryN(t).getEnvelopeInternal().getWidth()>i.getEnvelopeInternal().getWidth()&&(i=n.getGeometryN(t));return i}if(arguments[0]instanceof h)return r=arguments[0],r instanceof nt?this.widestGeometry(r):r},horizontalBisector:function(n){var t=n.getEnvelopeInternal(),i=th.getBisectorY(n);return this.factory.createLineString([new r(t.getMinX(),i),new r(t.getMaxX(),i)])},add:function(n){if(n instanceof st)this.addPolygon(n);else if(n instanceof nt)for(var i=n,t=0;t<i.getNumGeometries();t++)this.add(i.getGeometryN(t))},interfaces_:function(){return[]},getClass:function(){return bu}});bu.centre=function(n){return new r(bu.avg(n.getMinX(),n.getMaxX()),bu.avg(n.getMinY(),n.getMaxY()))};bu.avg=function(n,t){return(n+t)/2};i(th.prototype,{updateInterval:function(n){n<=this.centreY?n>this.loY&&(this.loY=n):n>this.centreY&&n<this.hiY&&(this.hiY=n)},getBisectorY:function(){this.process(this.poly.getExteriorRing());for(var n=0;n<this.poly.getNumInteriorRing();n++)this.process(this.poly.getInteriorRingN(n));return bu.avg(this.hiY,this.loY)},process:function(n){for(var r,i=n.getCoordinateSequence(),t=0;t<i.size();t++)r=i.getY(t),this.updateInterval(r)},interfaces_:function(){return[]},getClass:function(){return th}});th.getBisectorY=function(n){return new th(n).getBisectorY()};bu.SafeBisectorFinder=th;i(cv.prototype,{addEndpoints:function(){var n,r,t,i;if(arguments[0]instanceof h){if(n=arguments[0],n instanceof d)this.addEndpoints(n.getCoordinates());else if(n instanceof nt)for(r=n,t=0;t<r.getNumGeometries();t++)this.addEndpoints(r.getGeometryN(t))}else arguments[0]instanceof Array&&(i=arguments[0],this.add(i[0]),this.add(i[i.length-1]))},getInteriorPoint:function(){return this.interiorPoint},addInterior:function(){var t,i,r,n;if(arguments[0]instanceof h){if(t=arguments[0],t instanceof d)this.addInterior(t.getCoordinates());else if(t instanceof nt)for(i=t,n=0;n<i.getNumGeometries();n++)this.addInterior(i.getGeometryN(n))}else if(arguments[0]instanceof Array)for(r=arguments[0],n=1;n<r.length-1;n++)this.add(r[n])},add:function(n){var t=n.distance(this.centroid);t<this.minDistance&&(this.interiorPoint=new r(n),this.minDistance=t)},interfaces_:function(){return[]},getClass:function(){return cv}});i(lv.prototype,{getInteriorPoint:function(){return this.interiorPoint},add:function(){var n,i,t,u,f;if(arguments[0]instanceof h){if(n=arguments[0],n instanceof bt)this.add(n.getCoordinate());else if(n instanceof nt)for(i=n,t=0;t<i.getNumGeometries();t++)this.add(i.getGeometryN(t))}else arguments[0]instanceof r&&(u=arguments[0],f=u.distance(this.centroid),f<this.minDistance&&(this.interiorPoint=new r(u),this.minDistance=f))},interfaces_:function(){return[]},getClass:function(){return lv}});i(to.prototype,{select:function(){if(1===arguments.length)arguments[0];else if(2===arguments.length){var n=arguments[0],t=arguments[1];n.getLineSegment(t,this.selectedSegment);this.select(this.selectedSegment)}},interfaces_:function(){return[]},getClass:function(){return to}});i(ff.prototype,{hasChildren:function(){for(var n=0;n<2;n++)if(null!==this.subnode[n])return!0;return!1},isPrunable:function(){return!(this.hasChildren()||this.hasItems())},addAllItems:function(n){n.addAll(this.items);for(var t=0;t<2;t++)null!==this.subnode[t]&&this.subnode[t].addAllItems(n);return n},size:function(){for(var t=0,n=0;n<2;n++)null!==this.subnode[n]&&(t+=this.subnode[n].size());return t+this.items.size()},addAllItemsFromOverlapping:function(n,t){return null===n||this.isSearchMatch(n)?(t.addAll(this.items),null!==this.subnode[0]&&this.subnode[0].addAllItemsFromOverlapping(n,t),void(null!==this.subnode[1]&&this.subnode[1].addAllItemsFromOverlapping(n,t))):null},hasItems:function(){return!this.items.isEmpty()},remove:function(n,t){if(!this.isSearchMatch(n))return!1;for(var r=!1,i=0;i<2;i++)if(null!==this.subnode[i]&&(r=this.subnode[i].remove(n,t))){this.subnode[i].isPrunable()&&(this.subnode[i]=null);break}return r||(r=this.items.remove(t))},getItems:function(){return this.items},depth:function(){for(var i,t=0,n=0;n<2;n++)null!==this.subnode[n]&&(i=this.subnode[n].depth(),i>t&&(t=i));return t+1},nodeSize:function(){for(var t=0,n=0;n<2;n++)null!==this.subnode[n]&&(t+=this.subnode[n].nodeSize());return t+1},add:function(n){this.items.add(n)},interfaces_:function(){return[]},getClass:function(){return ff}});ff.getSubnodeIndex=function(n,t){var i=-1;return n.min>=t&&(i=1),n.max<=t&&(i=0),i};i(re.prototype,{expandToInclude:function(n){n.max>this.max&&(this.max=n.max);n.min<this.min&&(this.min=n.min)},getWidth:function(){return this.max-this.min},overlaps:function(){var n,t,i;return 1===arguments.length?(n=arguments[0],this.overlaps(n.min,n.max)):2===arguments.length?(t=arguments[0],i=arguments[1],!(this.min>i||this.max<t)):void 0},getMin:function(){return this.min},toString:function(){return"["+this.min+", "+this.max+"]"},contains:function(){var n,t,i,r;if(1===arguments.length){if(arguments[0]instanceof re)return n=arguments[0],this.contains(n.min,n.max);if("number"==typeof arguments[0])return t=arguments[0],t>=this.min&&t<=this.max}else if(2===arguments.length)return i=arguments[0],r=arguments[1],i>=this.min&&r<=this.max},init:function(n,t){this.min=n;this.max=t;n>t&&(this.min=t,this.max=n)},getMax:function(){return this.max},interfaces_:function(){return[]},getClass:function(){return re}});rs.exponent=function(n){return ud(64,n)-1023};rs.powerOf2=function(n){return Math.pow(2,n)};i(lc.prototype,{getInterval:function(){return this.interval},getLevel:function(){return this.level},computeKey:function(n){for(this.level=lc.computeLevel(n),this.interval=new re,this.computeInterval(this.level,n);!this.interval.contains(n);)this.level+=1,this.computeInterval(this.level,n)},computeInterval:function(n,t){var i=rs.powerOf2(n);this.pt=Math.floor(t.getMin()/i)*i;this.interval.init(this.pt,this.pt+i)},getPoint:function(){return this.pt},interfaces_:function(){return[]},getClass:function(){return lc}});lc.computeLevel=function(n){var t=n.getWidth();return rs.exponent(t)+1};y(he,ff);i(he.prototype,{getInterval:function(){return this.interval},find:function(n){var t=ff.getSubnodeIndex(n,this.centre);return-1===t?this:null!==this.subnode[t]?this.subnode[t].find(n):this},insert:function(n){var t,i;c.isTrue(null===this.interval||this.interval.contains(n.interval));t=ff.getSubnodeIndex(n.interval,this.centre);n.level===this.level-1?this.subnode[t]=n:(i=this.createSubnode(t),i.insert(n),this.subnode[t]=i)},isSearchMatch:function(n){return n.overlaps(this.interval)},getSubnode:function(n){return null===this.subnode[n]&&(this.subnode[n]=this.createSubnode(n)),this.subnode[n]},getNode:function(n){var t=ff.getSubnodeIndex(n,this.centre);return-1!==t?this.getSubnode(t).getNode(n):this},createSubnode:function(n){var t=0,i=0;switch(n){case 0:t=this.interval.getMin();i=this.centre;break;case 1:t=this.centre;i=this.interval.getMax()}return new he(new re(t,i),this.level-1)},interfaces_:function(){return[]},getClass:function(){return he}});he.createNode=function(n){var t=new lc(n);return new he(t.getInterval(),t.getLevel())};he.createExpanded=function(n,t){var r=new re(t),i;return null!==n&&r.expandToInclude(n.interval),i=he.createNode(r),null!==n&&i.insert(n),i};i(io.prototype,{interfaces_:function(){return[]},getClass:function(){return io}});io.isZeroWidth=function(n,t){var i=t-n,r,u;return 0===i?!0:(r=Math.max(Math.abs(n),Math.abs(t)),u=i/r,rs.exponent(u)<=io.MIN_BINARY_EXPONENT)};io.MIN_BINARY_EXPONENT=-50;y(ih,ff);i(ih.prototype,{insert:function(n,t){var i=ff.getSubnodeIndex(n,ih.origin),r,u;if(-1===i)return this.add(t),null;r=this.subnode[i];null!==r&&r.getInterval().contains(n)||(u=he.createExpanded(r,n),this.subnode[i]=u);this.insertContained(this.subnode[i],n,t)},isSearchMatch:function(){return!0},insertContained:function(n,t,i){c.isTrue(n.getInterval().contains(t));var u=io.isZeroWidth(t.getMin(),t.getMax()),r=null;r=u?n.find(t):n.getNode(t);r.add(i)},interfaces_:function(){return[]},getClass:function(){return ih}});ih.origin=0;i(rh.prototype,{size:function(){return null!==this.root?this.root.size():0},insert:function(n,t){this.collectStats(n);var i=rh.ensureExtent(n,this.minExtent);this.root.insert(i,t)},query:function(){var n,i,t,r,f;if(1===arguments.length){if("number"==typeof arguments[0])return n=arguments[0],this.query(new re(n,n));if(arguments[0]instanceof re)return i=arguments[0],t=new u,this.query(i,t),t}else 2===arguments.length&&(r=arguments[0],f=arguments[1],this.root.addAllItemsFromOverlapping(r,f))},iterator:function(){var n=new u;return this.root.addAllItems(n),n.iterator()},remove:function(n,t){var i=rh.ensureExtent(n,this.minExtent);return this.root.remove(i,t)},collectStats:function(n){var t=n.getWidth();t<this.minExtent&&t>0&&(this.minExtent=t)},depth:function(){return null!==this.root?this.root.depth():0},nodeSize:function(){return null!==this.root?this.root.nodeSize():0},interfaces_:function(){return[]},getClass:function(){return rh}});rh.ensureExtent=function(n,t){var i=n.getMin(),r=n.getMax();return i!==r?n:(i===r&&(i-=t/2,r=i+t/2),new re(i,r))};i(iw.prototype,{isInside:function(){},interfaces_:function(){return[]},getClass:function(){return iw}});i(ac.prototype,{testLineSegment:function(n,t){var u=null,i=null,f=null,r=null,e=t.p0,o=t.p1;u=e.x-n.x;i=e.y-n.y;f=o.x-n.x;r=o.y-n.y;(i>0&&r<=0||r>0&&i<=0)&&0<yo.signOfDet2x2(u,i,f,r)/(r-i)&&this.crossings++},buildIndex:function(){var t,i;this.tree=new rh;for(var u=w.removeRepeatedPoints(this.ring.getCoordinates()),r=pu.getChains(u),n=0;n<r.size();n++)t=r.get(n),i=t.getEnvelope(),this.interval.min=i.getMinY(),this.interval.max=i.getMaxY(),this.tree.insert(this.interval,t)},testMonotoneChain:function(n,t,i){i.select(n,t)},isInside:function(n){var t,r;this.crossings=0;t=new p(v.NEGATIVE_INFINITY,v.POSITIVE_INFINITY,n.y,n.y);this.interval.min=n.y;this.interval.max=n.y;for(var u=this.tree.query(this.interval),f=new vc(this,n),i=u.iterator();i.hasNext();)r=i.next(),this.testMonotoneChain(t,f,r);return this.crossings%2==1},interfaces_:function(){return[iw]},getClass:function(){return ac}});y(vc,to);i(vc.prototype,{select:function(){if(1!==arguments.length)return to.prototype.select.apply(this,arguments);var n=arguments[0];this.mcp.testLineSegment(this.p,n)},interfaces_:function(){return[]},getClass:function(){return vc}});ac.MCSelecter=vc;i(k.prototype,{interfaces_:function(){return[]},getClass:function(){return k}});k.toDegrees=function(n){return 180*n/Math.PI};k.normalize=function(n){for(;n>Math.PI;)n-=k.PI_TIMES_2;for(;n<=-Math.PI;)n+=k.PI_TIMES_2;return n};k.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)}};k.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};k.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};k.interiorAngle=function(n,t,i){var r=k.angle(t,n),u=k.angle(t,i);return Math.abs(u-r)};k.normalizePositive=function(n){if(n<0){for(;n<0;)n+=k.PI_TIMES_2;n>=k.PI_TIMES_2&&(n=0)}else{for(;n>=k.PI_TIMES_2;)n-=k.PI_TIMES_2;n<0&&(n=0)}return n};k.angleBetween=function(n,t,i){var r=k.angle(t,n),u=k.angle(t,i);return k.diff(r,u)};k.diff=function(n,t){var i=null;return i=n<t?t-n:n-t,i>Math.PI&&(i=2*Math.PI-i),i};k.toRadians=function(n){return n*Math.PI/180};k.getTurn=function(n,t){var i=Math.sin(t-n);return i>0?k.COUNTERCLOCKWISE:i<0?k.CLOCKWISE:k.NONE};k.angleBetweenOriented=function(n,t,i){var u=k.angle(t,n),f=k.angle(t,i),r=f-u;return r<=-Math.PI?r+k.PI_TIMES_2:r>Math.PI?r-k.PI_TIMES_2:r};k.PI_TIMES_2=2*Math.PI;k.PI_OVER_2=Math.PI/2;k.PI_OVER_4=Math.PI/4;k.COUNTERCLOCKWISE=s.COUNTERCLOCKWISE;k.CLOCKWISE=s.CLOCKWISE;k.NONE=s.COLLINEAR;i(vt.prototype,{area:function(){return vt.area(this.p0,this.p1,this.p2)},signedArea:function(){return vt.signedArea(this.p0,this.p1,this.p2)},interpolateZ:function(n){if(null===n)throw new ct("Supplied point is null.");return vt.interpolateZ(n,this.p0,this.p1,this.p2)},longestSideLength:function(){return vt.longestSideLength(this.p0,this.p1,this.p2)},isAcute:function(){return vt.isAcute(this.p0,this.p1,this.p2)},circumcentre:function(){return vt.circumcentre(this.p0,this.p1,this.p2)},area3D:function(){return vt.area3D(this.p0,this.p1,this.p2)},centroid:function(){return vt.centroid(this.p0,this.p1,this.p2)},inCentre:function(){return vt.inCentre(this.p0,this.p1,this.p2)},interfaces_:function(){return[]},getClass:function(){return vt}});vt.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)};vt.signedArea=function(n,t,i){return((i.x-n.x)*(t.y-n.y)-(t.x-n.x)*(i.y-n.y))/2};vt.det=function(n,t,i,r){return n*r-t*i};vt.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)};vt.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};vt.isAcute=function(n,t,i){return!!k.isAcute(n,t,i)&&!!k.isAcute(t,i,n)&&!!k.isAcute(i,n,t)};vt.circumcentre=function(n,t,i){var s=i.x,h=i.y,u=n.x-s,f=n.y-h,e=t.x-s,o=t.y-h,c=2*vt.det(u,f,e,o);return new r(s-vt.det(f,u*u+f*f,o,e*e+o*o)/c,h+vt.det(u,u*u+f*f,e,e*e+o*o)/c)};vt.perpendicularBisector=function(n,t){var i=t.x-n.x,r=t.y-n.y;return new hr(new hr(n.x+i/2,n.y+r/2,1),new hr(n.x-r+i/2,n.y+i+r/2,1))};vt.angleBisector=function(n,t,i){var u=t.distance(n),e=t.distance(i),f=u/(u+e),o=i.x-n.x,s=i.y-n.y;return new r(n.x+f*o,n.y+f*s)};vt.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};vt.centroid=function(n,t,i){return new r((n.x+t.x+i.x)/3,(n.y+t.y+i.y)/3)};vt.inCentre=function(n,t,i){var u=t.distance(i),f=n.distance(i),e=n.distance(t),o=u+f+e;return new r((u*n.x+f*t.x+e*i.x)/o,(u*n.y+f*t.y+e*i.y)/o)};i(ce.prototype,{getRadius:function(){return this.compute(),this.radius},getDiameter:function(){switch(this.compute(),this.extremalPts.length){case 0:return this.input.getFactory().createLineString();case 1:return this.input.getFactory().createPoint(this.centre)}var n=this.extremalPts[0],t=this.extremalPts[1];return this.input.getFactory().createLineString([n,t])},getExtremalPoints:function(){return this.compute(),this.extremalPts},computeCirclePoints:function(){var n,f;if(this.input.isEmpty())return this.extremalPts=new Array(0).fill(null),null;if(1===this.input.getNumPoints())return n=this.input.getCoordinates(),this.extremalPts=[new r(n[0])],null;var o=this.input.convexHull(),i=o.getCoordinates(),n=i;if(i[0].equals2D(i[i.length-1])&&(n=new Array(i.length-1).fill(null),w.copyDeep(i,0,n,0,i.length-1)),n.length<=2)return this.extremalPts=w.copyDeep(n),null;for(var t=ce.lowestPoint(n),u=ce.pointWitMinAngleWithX(n,t),e=0;e<n.length;e++){if(f=ce.pointWithMinAngleWithSegment(n,t,u),k.isObtuse(t,f,u))return this.extremalPts=[new r(t),new r(u)],null;if(k.isObtuse(f,t,u))t=f;else{if(!k.isObtuse(f,u,t))return this.extremalPts=[new r(t),new r(u),new r(f)],null;u=f}}c.shouldNeverReachHere("Logic failure in Minimum Bounding Circle algorithm!")},compute:function(){return null!==this.extremalPts?null:(this.computeCirclePoints(),this.computeCentre(),void(null!==this.centre&&(this.radius=this.centre.distance(this.extremalPts[0]))))},getFarthestPoints:function(){switch(this.compute(),this.extremalPts.length){case 0:return this.input.getFactory().createLineString();case 1:return this.input.getFactory().createPoint(this.centre)}var n=this.extremalPts[0],t=this.extremalPts[this.extremalPts.length-1];return this.input.getFactory().createLineString([n,t])},getCircle:function(){if(this.compute(),null===this.centre)return this.input.getFactory().createPolygon();var n=this.input.getFactory().createPoint(this.centre);return 0===this.radius?n:n.buffer(this.radius)},getCentre:function(){return this.compute(),this.centre},computeCentre:function(){switch(this.extremalPts.length){case 0:this.centre=null;break;case 1:this.centre=this.extremalPts[0];break;case 2:this.centre=new r((this.extremalPts[0].x+this.extremalPts[1].x)/2,(this.extremalPts[0].y+this.extremalPts[1].y)/2);break;case 3:this.centre=vt.circumcentre(this.extremalPts[0],this.extremalPts[1],this.extremalPts[2])}},interfaces_:function(){return[]},getClass:function(){return ce}});ce.pointWitMinAngleWithX=function(n,t){for(var r,f,i,h,e,o=v.MAX_VALUE,s=null,u=0;u<n.length;u++)r=n[u],r!==t&&(f=r.x-t.x,i=r.y-t.y,i<0&&(i=-i),h=Math.sqrt(f*f+i*i),e=i/h,e<o&&(o=e,s=r));return s};ce.lowestPoint=function(n){for(var i=n[0],t=1;t<n.length;t++)n[t].y<i.y&&(i=n[t]);return i};ce.pointWithMinAngleWithSegment=function(n,t,i){for(var r,f,e=v.MAX_VALUE,o=null,u=0;u<n.length;u++)r=n[u],r!==t&&r!==i&&(f=k.angleBetween(t,r,i),f<e&&(e=f,o=r));return o};i(bi.prototype,{getWidthCoordinate:function(){return this.computeMinimumDiameter(),this.minWidthPt},getSupportingSegment:function(){return this.computeMinimumDiameter(),this.inputGeom.getFactory().createLineString([this.minBaseSeg.p0,this.minBaseSeg.p1])},getDiameter:function(){if(this.computeMinimumDiameter(),null===this.minWidthPt)return this.inputGeom.getFactory().createLineString(null);var n=this.minBaseSeg.project(this.minWidthPt);return this.inputGeom.getFactory().createLineString([n,this.minWidthPt])},computeWidthConvex:function(n){this.convexHullPts=n instanceof st?n.getExteriorRing().getCoordinates():n.getCoordinates();0===this.convexHullPts.length?(this.minWidth=0,this.minWidthPt=null,this.minBaseSeg=null):1===this.convexHullPts.length?(this.minWidth=0,this.minWidthPt=this.convexHullPts[0],this.minBaseSeg.p0=this.convexHullPts[0],this.minBaseSeg.p1=this.convexHullPts[0]):2===this.convexHullPts.length||3===this.convexHullPts.length?(this.minWidth=0,this.minWidthPt=this.convexHullPts[0],this.minBaseSeg.p0=this.convexHullPts[0],this.minBaseSeg.p1=this.convexHullPts[1]):this.computeConvexRingMinDiameter(this.convexHullPts)},computeConvexRingMinDiameter:function(n){this.minWidth=v.MAX_VALUE;for(var r=1,i=new b,t=0;t<n.length-1;t++)i.p0=n[t],i.p1=n[t+1],r=this.findMaxPerpDistance(n,i,r)},computeMinimumDiameter:function(){if(null!==this.minWidthPt)return null;if(this.isConvex)this.computeWidthConvex(this.inputGeom);else{var n=new gf(this.inputGeom).getConvexHull();this.computeWidthConvex(n)}},getLength:function(){return this.computeMinimumDiameter(),this.minWidth},findMaxPerpDistance:function(n,t,i){for(var r=t.distancePerpendicular(n[i]),f=r,u=i,e=u;f>=r;)r=f,u=e,e=bi.nextIndex(n,u),f=t.distancePerpendicular(n[e]);return r<this.minWidth&&(this.minPtIndex=u,this.minWidth=r,this.minWidthPt=n[this.minPtIndex],this.minBaseSeg=new b(t)),u},getMinimumRectangle:function(){var i,r;if(this.computeMinimumDiameter(),0===this.minWidth)return this.minBaseSeg.p0.equals2D(this.minBaseSeg.p1)?this.inputGeom.getFactory().createPoint(this.minBaseSeg.p0):this.minBaseSeg.toGeometry(this.inputGeom.getFactory());for(var n=this.minBaseSeg.p1.x-this.minBaseSeg.p0.x,t=this.minBaseSeg.p1.y-this.minBaseSeg.p0.y,f=v.MAX_VALUE,e=-v.MAX_VALUE,o=v.MAX_VALUE,s=-v.MAX_VALUE,u=0;u<this.convexHullPts.length;u++)i=bi.computeC(n,t,this.convexHullPts[u]),i>e&&(e=i),i<f&&(f=i),r=bi.computeC(-t,n,this.convexHullPts[u]),r>s&&(s=r),r<o&&(o=r);var h=bi.computeSegmentForLine(-n,-t,s),c=bi.computeSegmentForLine(-n,-t,o),l=bi.computeSegmentForLine(-t,n,e),a=bi.computeSegmentForLine(-t,n,f),y=l.lineIntersection(h),p=a.lineIntersection(h),w=a.lineIntersection(c),b=l.lineIntersection(c),k=this.inputGeom.getFactory().createLinearRing([y,p,w,b,y]);return this.inputGeom.getFactory().createPolygon(k,null)},interfaces_:function(){return[]},getClass:function(){return bi}});bi.nextIndex=function(n,t){return t++,t>=n.length&&(t=0),t};bi.computeC=function(n,t,i){return n*i.y-t*i.x};bi.getMinimumDiameter=function(n){return new bi(n).getDiameter()};bi.getMinimumRectangle=function(n){return new bi(n).getMinimumRectangle()};bi.computeSegmentForLine=function(n,t,i){var u=null,f=null;return Math.abs(t)>Math.abs(n)?(u=new r(0,i/t),f=new r(1,i/t-n/t)):(u=new r(i/n,0),f=new r(i/n-t/n,1)),new b(u,f)};cb=Object.freeze({Centroid:df,CGAlgorithms:s,ConvexHull:gf,InteriorPointArea:bu,InteriorPointLine:cv,InteriorPointPoint:lv,RobustLineIntersector:si,MCPointInRing:ac,MinimumBoundingCircle:ce,MinimumDiameter:bi});i(ro.prototype,{getResultGeometry:function(){return new yc(this.distanceTolerance).transform(this.inputGeom)},setDistanceTolerance:function(n){if(n<=0)throw new ct("Tolerance must be positive");this.distanceTolerance=n},interfaces_:function(){return[]},getClass:function(){return ro}});ro.densifyPoints=function(n,t,i){for(var e,o,c,s,l,h,r=new b,u=new ii,f=0;f<n.length-1;f++)if(r.p0=n[f],r.p1=n[f+1],u.add(r.p0,!1),e=r.getLength(),o=Math.trunc(e/t)+1,o>1)for(c=e/o,s=1;s<o;s++)l=s*c/e,h=r.pointAlong(l),i.makePrecise(h),u.add(h,!1);return u.add(n[n.length-1],!1),u.toCoordinateArray()};ro.densify=function(n,t){var i=new ro(n);return i.setDistanceTolerance(t),i.getResultGeometry()};y(yc,ur);i(yc.prototype,{transformMultiPolygon:function(n,t){var i=ur.prototype.transformMultiPolygon.call(this,n,t);return this.createValidArea(i)},transformPolygon:function(n,t){var i=ur.prototype.transformPolygon.call(this,n,t);return t instanceof ai?i:this.createValidArea(i)},transformCoordinates:function(n,t){var r=n.toCoordinateArray(),i=ro.densifyPoints(r,this.distanceTolerance,t.getPrecisionModel());return t instanceof d&&1===i.length&&(i=new Array(0).fill(null)),this.factory.getCoordinateSequenceFactory().create(i)},createValidArea:function(n){return n.buffer(0)},interfaces_:function(){return[]},getClass:function(){return yc}});ro.DensifyTransformer=yc;lb=Object.freeze({Densifier:ro});i(ue.prototype,{find:function(n){var t=this;do{if(null===t)return null;if(t.dest().equals2D(n))return t;t=t.oNext()}while(t!==this);return null},dest:function(){return this._sym._orig},oNext:function(){return this._sym._next},insert:function(n){var r,t,i;if(this.oNext()===this)return this.insertAfter(n),null;r=this.compareTo(n);t=this;do{if(i=t.oNext(),i.compareTo(n)!==r||i===this)return t.insertAfter(n),null;t=i}while(t!==this);c.shouldNeverReachHere()},insertAfter:function(n){c.equals(this._orig,n.orig());var t=this.oNext();this._sym.setNext(n);n.sym().setNext(t)},degree:function(){var t=0,n=this;do t++,n=n.oNext();while(n!==this);return t},equals:function(){if(2===arguments.length){var n=arguments[0],t=arguments[1];return this._orig.equals2D(n)&&this._sym._orig.equals(t)}},deltaY:function(){return this._sym._orig.y-this._orig.y},sym:function(){return this._sym},prev:function(){return this._sym.next()._sym},compareAngularDirection:function(n){var r=this.deltaX(),u=this.deltaY(),f=n.deltaX(),e=n.deltaY(),t,i;return r===f&&u===e?0:(t=it.quadrant(r,u),i=it.quadrant(f,e),t>i?1:t<i?-1:s.computeOrientation(n._orig,n.dest(),this.dest()))},prevNode:function(){for(var n=this;2===n.degree();)if((n=n.prev())===this)return null;return n},compareTo:function(n){var t=n;return this.compareAngularDirection(t)},next:function(){return this._next},setSym:function(n){this._sym=n},orig:function(){return this._orig},toString:function(){return"HE("+this._orig.x+" "+this._orig.y+", "+this._sym._orig.x+" "+this._sym._orig.y+")"},setNext:function(n){this._next=n},init:function(n){this.setSym(n);n.setSym(this);this.setNext(n);n.setNext(this)},deltaX:function(){return this._sym._orig.x-this._orig.x},interfaces_:function(){return[]},getClass:function(){return ue}});ue.init=function(n,t){if(null!==n._sym||null!==t._sym||null!==n._next||null!==t._next)throw new IllegalStateException("Edges are already initialized");return n.init(t),n};ue.create=function(n,t){var i=new ue(n),r=new ue(t);return i.init(r),i};y(yr,ue);i(yr.prototype,{mark:function(){this._isMarked=!0},setMark:function(n){this._isMarked=n},isMarked:function(){return this._isMarked},interfaces_:function(){return[]},getClass:function(){return yr}});yr.setMarkBoth=function(n,t){n.setMark(t);n.sym().setMark(t)};yr.isMarked=function(n){return n.isMarked()};yr.setMark=function(n,t){n.setMark(t)};yr.markBoth=function(n){n.mark();n.sym().mark()};yr.mark=function(n){n.mark()};i(uh.prototype,{insert:function(n,t,i){var r=this.create(n,t),u;return null!==i?i.insert(r):this.vertexMap.put(n,r),u=this.vertexMap.get(t),null!==u?u.insert(r.sym()):this.vertexMap.put(t,r.sym()),r},create:function(n,t){var i=this.createEdge(n),r=this.createEdge(t);return ue.init(i,r),i},createEdge:function(n){return new ue(n)},addEdge:function(n,t){if(!uh.isValidEdge(n,t))return null;var i=this.vertexMap.get(n),r=null;return null!==i&&(r=i.find(t)),null!==r?r:this.insert(n,t,i)},getVertexEdges:function(){return this.vertexMap.values()},findEdge:function(n,t){var i=this.vertexMap.get(n);return null===i?null:i.find(t)},interfaces_:function(){return[]},getClass:function(){return uh}});uh.isValidEdge=function(n,t){return 0!==t.compareTo(n)};y(av,yr);i(av.prototype,{setStart:function(){this._isStart=!0},isStart:function(){return this._isStart},interfaces_:function(){return[]},getClass:function(){return av}});y(vv,uh);i(vv.prototype,{createEdge:function(n){return new av(n)},interfaces_:function(){return[]},getClass:function(){return vv}});i(pc.prototype,{addLine:function(n){this.lines.add(this.factory.createLineString(n.toCoordinateArray()))},updateRingStartEdge:function(n){return n.isStart()||(n=n.sym(),n.isStart())?null===this.ringStartEdge?(this.ringStartEdge=n,null):void(n.orig().compareTo(this.ringStartEdge.orig())<0&&(this.ringStartEdge=n)):null},getResult:function(){return null===this.result&&this.computeResult(),this.result},process:function(n){var t=n.prevNode();null===t&&(t=n);this.stackEdges(t);this.buildLines()},buildRing:function(n){var i=new ii,t=n,r;for(i.add(t.orig().copy(),!1);2===t.sym().degree();){if(r=t.next(),r===n)break;i.add(r.orig().copy(),!1);t=r}i.add(t.dest().copy(),!1);this.addLine(i)},buildLine:function(n){var i=new ii,t=n,r;for(this.ringStartEdge=null,yr.markBoth(t),i.add(t.orig().copy(),!1);2===t.sym().degree();){if(this.updateRingStartEdge(t),r=t.next(),r===n)return this.buildRing(this.ringStartEdge),null;i.add(r.orig().copy(),!1);t=r;yr.markBoth(t)}i.add(t.dest().copy(),!1);this.stackEdges(t.sym());this.addLine(i)},stackEdges:function(n){var t=n;do yr.isMarked(t)||this.nodeEdgeStack.add(t),t=t.oNext();while(t!==n)},computeResult:function(){for(var t,i=this.graph.getVertexEdges(),n=i.iterator();n.hasNext();)t=n.next(),yr.isMarked(t)||this.process(t);this.result=this.factory.buildGeometry(this.lines)},buildLines:function(){for(;!this.nodeEdgeStack.empty();){var n=this.nodeEdgeStack.pop();yr.isMarked(n)||this.buildLine(n)}},add:function(){var u,n,f,t,r;if(arguments[0]instanceof h)arguments[0].apply({interfaces_:function(){return[yu]},filter:function(n){n instanceof d&&this.add(n)}});else if(l(arguments[0],yt))for(u=arguments[0],n=u.iterator();n.hasNext();)f=n.next(),this.add(f);else if(arguments[0]instanceof d){t=arguments[0];null===this.factory&&(this.factory=t.getFactory());for(var i=t.getCoordinateSequence(),e=!1,n=1;n<i.size();n++)r=this.graph.addEdge(i.getCoordinate(n-1),i.getCoordinate(n)),null!==r&&(e||(r.setStart(),e=!0))}},interfaces_:function(){return[]},getClass:function(){return pc}});pc.dissolve=function(n){var t=new pc;return t.add(n),t.getResult()};ab=Object.freeze({LineDissolver:pc});vb=Object.freeze({GeometryGraph:or});i(ef.prototype,{hasChildren:function(){for(var n=0;n<4;n++)if(null!==this.subnode[n])return!0;return!1},isPrunable:function(){return!(this.hasChildren()||this.hasItems())},addAllItems:function(n){n.addAll(this.items);for(var t=0;t<4;t++)null!==this.subnode[t]&&this.subnode[t].addAllItems(n);return n},getNodeCount:function(){for(var t=0,n=0;n<4;n++)null!==this.subnode[n]&&(t+=this.subnode[n].size());return t+1},size:function(){for(var t=0,n=0;n<4;n++)null!==this.subnode[n]&&(t+=this.subnode[n].size());return t+this.items.size()},addAllItemsFromOverlapping:function(n,t){if(!this.isSearchMatch(n))return null;t.addAll(this.items);for(var i=0;i<4;i++)null!==this.subnode[i]&&this.subnode[i].addAllItemsFromOverlapping(n,t)},visitItems:function(n,t){for(var i=this.items.iterator();i.hasNext();)t.visitItem(i.next())},hasItems:function(){return!this.items.isEmpty()},remove:function(n,t){if(!this.isSearchMatch(n))return!1;for(var r=!1,i=0;i<4;i++)if(null!==this.subnode[i]&&(r=this.subnode[i].remove(n,t))){this.subnode[i].isPrunable()&&(this.subnode[i]=null);break}return r||(r=this.items.remove(t))},visit:function(n,t){if(!this.isSearchMatch(n))return null;this.visitItems(n,t);for(var i=0;i<4;i++)null!==this.subnode[i]&&this.subnode[i].visit(n,t)},getItems:function(){return this.items},depth:function(){for(var i,t=0,n=0;n<4;n++)null!==this.subnode[n]&&(i=this.subnode[n].depth(),i>t&&(t=i));return t+1},isEmpty:function(){var t=!0,n;for(this.items.isEmpty()||(t=!1),n=0;n<4;n++)null!==this.subnode[n]&&(this.subnode[n].isEmpty()||(t=!1));return t},add:function(n){this.items.add(n)},interfaces_:function(){return[ir]},getClass:function(){return ef}});ef.getSubnodeIndex=function(n,t,i){var r=-1;return n.getMinX()>=t&&(n.getMinY()>=i&&(r=3),n.getMaxY()<=i&&(r=1)),n.getMaxX()<=t&&(n.getMinY()>=i&&(r=2),n.getMaxY()<=i&&(r=0)),r};i(wc.prototype,{getLevel:function(){return this.level},computeKey:function(){var t;if(1===arguments.length)for(t=arguments[0],this.level=wc.computeQuadLevel(t),this.env=new p,this.computeKey(this.level,t);!this.env.contains(t);)this.level+=1,this.computeKey(this.level,t);else if(2===arguments.length){var r=arguments[0],i=arguments[1],n=rs.powerOf2(r);this.pt.x=Math.floor(i.getMinX()/n)*n;this.pt.y=Math.floor(i.getMinY()/n)*n;this.env.init(this.pt.x,this.pt.x+n,this.pt.y,this.pt.y+n)}},getEnvelope:function(){return this.env},getCentre:function(){return new r((this.env.getMinX()+this.env.getMaxX())/2,(this.env.getMinY()+this.env.getMaxY())/2)},getPoint:function(){return this.pt},interfaces_:function(){return[]},getClass:function(){return wc}});wc.computeQuadLevel=function(n){var t=n.getWidth(),i=n.getHeight(),r=t>i?t:i;return rs.exponent(r)+1};y(le,ef);i(le.prototype,{find:function(n){var t=ef.getSubnodeIndex(n,this.centrex,this.centrey);return-1===t?this:null!==this.subnode[t]?this.subnode[t].find(n):this},isSearchMatch:function(n){return this.env.intersects(n)},getSubnode:function(n){return null===this.subnode[n]&&(this.subnode[n]=this.createSubnode(n)),this.subnode[n]},getEnvelope:function(){return this.env},getNode:function(n){var t=ef.getSubnodeIndex(n,this.centrex,this.centrey);return-1!==t?this.getSubnode(t).getNode(n):this},createSubnode:function(n){var t=0,i=0,r=0,u=0;switch(n){case 0:t=this.env.getMinX();i=this.centrex;r=this.env.getMinY();u=this.centrey;break;case 1:t=this.centrex;i=this.env.getMaxX();r=this.env.getMinY();u=this.centrey;break;case 2:t=this.env.getMinX();i=this.centrex;r=this.centrey;u=this.env.getMaxY();break;case 3:t=this.centrex;i=this.env.getMaxX();r=this.centrey;u=this.env.getMaxY()}return new le(new p(t,i,r,u),this.level-1)},insertNode:function(n){var t,i;c.isTrue(null===this.env||this.env.contains(n.env));t=ef.getSubnodeIndex(n.env,this.centrex,this.centrey);n.level===this.level-1?this.subnode[t]=n:(i=this.createSubnode(t),i.insertNode(n),this.subnode[t]=i)},interfaces_:function(){return[]},getClass:function(){return le}});le.createNode=function(n){var t=new wc(n);return new le(t.getEnvelope(),t.getLevel())};le.createExpanded=function(n,t){var r=new p(t),i;return null!==n&&r.expandToInclude(n.env),i=le.createNode(r),null!==n&&i.insertNode(n),i};y(us,ef);i(us.prototype,{insert:function(n,t){var i=ef.getSubnodeIndex(n,us.origin.x,us.origin.y),r,u;if(-1===i)return this.add(t),null;r=this.subnode[i];null!==r&&r.getEnvelope().contains(n)||(u=le.createExpanded(r,n),this.subnode[i]=u);this.insertContained(this.subnode[i],n,t)},isSearchMatch:function(){return!0},insertContained:function(n,t,i){c.isTrue(n.getEnvelope().contains(t));var u=io.isZeroWidth(t.getMinX(),t.getMaxX()),f=io.isZeroWidth(t.getMinY(),t.getMaxY()),r=null;r=u||f?n.find(t):n.getNode(t);r.add(i)},interfaces_:function(){return[]},getClass:function(){return us}});us.origin=new r(0,0);i(uo.prototype,{size:function(){return null!==this.root?this.root.size():0},insert:function(n,t){this.collectStats(n);var i=uo.ensureExtent(n,this.minExtent);this.root.insert(i,t)},query:function(){var t,n,i,r;if(1===arguments.length)return t=arguments[0],n=new ev,this.query(t,n),n.getItems();2===arguments.length&&(i=arguments[0],r=arguments[1],this.root.visit(i,r))},queryAll:function(){var n=new u;return this.root.addAllItems(n),n},remove:function(n,t){var i=uo.ensureExtent(n,this.minExtent);return this.root.remove(i,t)},collectStats:function(n){var i=n.getWidth(),t;i<this.minExtent&&i>0&&(this.minExtent=i);t=n.getHeight();t<this.minExtent&&t>0&&(this.minExtent=t)},depth:function(){return null!==this.root?this.root.depth():0},isEmpty:function(){return null===this.root},interfaces_:function(){return[wa,ir]},getClass:function(){return uo}});uo.ensureExtent=function(n,t){var i=n.getMinX(),u=n.getMaxX(),r=n.getMinY(),f=n.getMaxY();return i!==u&&r!==f?n:(i===u&&(i-=t/2,u=i+t/2),r===f&&(r-=t/2,f=r+t/2),new p(i,u,r,f))};uo.serialVersionUID=-0x678b60c967a25400;var sd=Object.freeze({Quadtree:uo}),hd=Object.freeze({STRtree:kt}),cd=Object.freeze({quadtree:sd,strtree:hd}),ld=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"];i(rw.prototype,{read:function(n){var i=void 0,t;if(i="string"==typeof n?JSON.parse(n):n,t=i.type,!au[t])throw new Error("Unknown GeoJSON type: "+i.type);return-1!==ld.indexOf(t)?au[t].apply(this,[i.coordinates]):"GeometryCollection"===t?au[t].apply(this,[i.geometries]):au[t].apply(this,[i])},write:function(n){var t=n.getGeometryType();if(!af[t])throw new Error("Geometry is not supported");return af[t].apply(this,[n])}});au={Feature:function(n){var t={},i,r;for(i in n)t[i]=n[i];if(n.geometry){if(r=n.geometry.type,!au[r])throw new Error("Unknown GeoJSON type: "+n.type);t.geometry=this.read(n.geometry)}return n.bbox&&(t.bbox=au.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,i=[],t=0;t<n.length;++t)u=n[t],i.push(new r(u[0],u[1]));return i},bbox:function(n){return this.geometryFactory.createLinearRing([new r(n[0],n[1]),new r(n[2],n[1]),new r(n[2],n[3]),new r(n[0],n[3]),new r(n[0],n[1])])},Point:function(n){var t=new r(n[0],n[1]);return this.geometryFactory.createPoint(t)},MultiPoint:function(n){for(var i=[],t=0;t<n.length;++t)i.push(au.Point.apply(this,[n[t]]));return this.geometryFactory.createMultiPoint(i)},LineString:function(n){var t=au.coordinates.apply(this,[n]);return this.geometryFactory.createLineString(t)},MultiLineString:function(n){for(var i=[],t=0;t<n.length;++t)i.push(au.LineString.apply(this,[n[t]]));return this.geometryFactory.createMultiLineString(i)},Polygon:function(n){for(var r=au.coordinates.apply(this,[n[0]]),u=this.geometryFactory.createLinearRing(r),i=[],t=1;t<n.length;++t){var f=n[t],e=au.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(au.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)}};af={coordinate:function(n){return[n.x,n.y]},Point:function(n){return{type:"Point",coordinates:af.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=af.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(af.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=af.LineString.apply(this,[r]),i.push(u.coordinates);return{type:"MultiLineString",coordinates:i}},Polygon:function(n){var i=[],f=af.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=af.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=af.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(af[u].apply(this,[r]));return{type:"GeometryCollection",geometries:i}}};i(fb.prototype,{read:function(n){var t=this.parser.read(n);return this.precisionModel.getType()===ft.FIXED&&this.reducePrecision(t),t},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])}});i(eb.prototype,{write:function(n){return this.parser.write(n)}});i(ob.prototype,{read:function(n){var t=this.parser.read(n);return this.precisionModel.getType()===ft.FIXED&&this.reducePrecision(t),t},reducePrecision:function(n){var t,r,i,u;if(n.coordinate)this.precisionModel.makePrecise(n.coordinate);else if(n.points)for(t=0,r=n.points.coordinates.length;t<r;t++)this.precisionModel.makePrecise(n.points.coordinates[t]);else if(n.geometries)for(i=0,u=n.geometries.length;i<u;i++)this.reducePrecision(n.geometries[i])}});i(sb.prototype,{read:function(n){var t=this.ol;return n instanceof t.geom.Point?this.convertFromPoint(n):n instanceof t.geom.LineString?this.convertFromLineString(n):n instanceof t.geom.LinearRing?this.convertFromLinearRing(n):n instanceof t.geom.Polygon?this.convertFromPolygon(n):n instanceof t.geom.MultiPoint?this.convertFromMultiPoint(n):n instanceof t.geom.MultiLineString?this.convertFromMultiLineString(n):n instanceof t.geom.MultiPolygon?this.convertFromMultiPolygon(n):n instanceof t.geom.GeometryCollection?this.convertFromCollection(n):void 0},convertFromPoint:function(n){var t=n.getCoordinates();return this.geometryFactory.createPoint(new r(t[0],t[1]))},convertFromLineString:function(n){return this.geometryFactory.createLineString(n.getCoordinates().map(function(n){return new r(n[0],n[1])}))},convertFromLinearRing:function(n){return this.geometryFactory.createLinearRing(n.getCoordinates().map(function(n){return new r(n[0],n[1])}))},convertFromPolygon:function(n){for(var i,r=n.getLinearRings(),u=null,f=[],t=0;t<r.length;t++)i=this.convertFromLinearRing(r[t]),0===t?u=i:f.push(i);return this.geometryFactory.createPolygon(u,f)},convertFromMultiPoint:function(n){var t=n.getPoints().map(function(n){return this.convertFromPoint(n)},this);return this.geometryFactory.createMultiPoint(t)},convertFromMultiLineString:function(n){var t=n.getLineStrings().map(function(n){return this.convertFromLineString(n)},this);return this.geometryFactory.createMultiLineString(t)},convertFromMultiPolygon:function(n){var t=n.getPolygons().map(function(n){return this.convertFromPolygon(n)},this);return this.geometryFactory.createMultiPolygon(t)},convertFromCollection:function(n){var t=n.getGeometries().map(function(n){return this.read(n)},this);return this.geometryFactory.createGeometryCollection(t)},write:function(n){return"Point"===n.getGeometryType()?this.convertToPoint(n.getCoordinate()):"LineString"===n.getGeometryType()?this.convertToLineString(n):"LinearRing"===n.getGeometryType()?this.convertToLinearRing(n):"Polygon"===n.getGeometryType()?this.convertToPolygon(n):"MultiPoint"===n.getGeometryType()?this.convertToMultiPoint(n):"MultiLineString"===n.getGeometryType()?this.convertToMultiLineString(n):"MultiPolygon"===n.getGeometryType()?this.convertToMultiPolygon(n):"GeometryCollection"===n.getGeometryType()?this.convertToCollection(n):void 0},convertToPoint:function(n){return new this.ol.geom.Point([n.x,n.y])},convertToLineString:function(n){var t=n.points.coordinates.map(bc);return new this.ol.geom.LineString(t)},convertToLinearRing:function(n){var t=n.points.coordinates.map(bc);return new this.ol.geom.LinearRing(t)},convertToPolygon:function(n){for(var i=[n.shell.points.coordinates.map(bc)],t=0;t<n.holes.length;t++)i.push(n.holes[t].points.coordinates.map(bc));return new this.ol.geom.Polygon(i)},convertToMultiPoint:function(n){return new this.ol.geom.MultiPoint(n.getCoordinates().map(bc))},convertToMultiLineString:function(n){for(var i=[],t=0;t<n.geometries.length;t++)i.push(this.convertToLineString(n.geometries[t]).getCoordinates());return new this.ol.geom.MultiLineString(i)},convertToMultiPolygon:function(n){for(var i=[],t=0;t<n.geometries.length;t++)i.push(this.convertToPolygon(n.geometries[t]).getCoordinates());return new this.ol.geom.MultiPolygon(i)},convertToCollection:function(n){for(var r,i=[],t=0;t<n.geometries.length;t++)r=n.geometries[t],i.push(this.write(r));return new this.ol.geom.GeometryCollection(i)}});yb=Object.freeze({GeoJSONReader:fb,GeoJSONWriter:eb,OL3Parser:sb,WKTReader:ob,WKTWriter:pi});i(kc.prototype,{rescale:function(){var i,u,n,t;if(l(arguments[0],yt))for(i=arguments[0],t=i.iterator();t.hasNext();)u=t.next(),this.rescale(u.getCoordinates());else if(arguments[0]instanceof Array){for(n=arguments[0],2===n.length&&(new r(n[0]),new r(n[1])),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])&&pt.out.println(n)}},scale:function(){var i;if(l(arguments[0],yt)){for(var o=arguments[0],f=new u,n=o.iterator();n.hasNext();)i=n.next(),f.add(new tf(this.scale(i.getCoordinates()),i.getData()));return f}if(arguments[0]instanceof Array){for(var t=arguments[0],e=new Array(t.length).fill(null),n=0;n<t.length;n++)e[n]=new r(Math.round((t[n].x-this.offsetX)*this.scaleFactor),Math.round((t[n].y-this.offsetY)*this.scaleFactor),t[n].z);return w.removeRepeatedPoints(e)}},isIntegerPrecision:function(){return 1===this.scaleFactor},getNodedSubstrings:function(){var n=this.noder.getNodedSubstrings();return this.isScaled&&this.rescale(n),n},computeNodes:function(n){var t=n;this.isScaled&&(t=this.scale(n));this.noder.computeNodes(t)},interfaces_:function(){return[uc]},getClass:function(){return kc}});pb=Object.freeze({MCIndexNoder:be,ScaledNoder:kc,SegmentString:tc});i(dc.prototype,{isSimpleMultiPoint:function(n){var r,t,u,i;if(n.isEmpty())return!0;for(r=new di,t=0;t<n.getNumGeometries();t++){if(u=n.getGeometryN(t),i=u.getCoordinate(),r.contains(i))return this.nonSimpleLocation=i,!1;r.add(i)}return!0},isSimplePolygonal:function(n){for(var r,i=wi.getLines(n),t=i.iterator();t.hasNext();)if(r=t.next(),!this.isSimpleLinearGeometry(r))return!1;return!0},hasClosedEndpointIntersection:function(n){for(var e,u,r=new ui,t=n.getEdgeIterator();t.hasNext();){var i=t.next(),f=(i.getMaximumSegmentIndex(),i.isClosed()),o=i.getCoordinate(0);this.addEndpoint(r,o,f);e=i.getCoordinate(i.getNumPoints()-1);this.addEndpoint(r,e,f)}for(t=r.values().iterator();t.hasNext();)if(u=t.next(),u.isClosed&&2!==u.degree)return this.nonSimpleLocation=u.getCoordinate(),!0;return!1},getNonSimpleLocation:function(){return this.nonSimpleLocation},isSimpleLinearGeometry:function(n){if(n.isEmpty())return!0;var t=new or(0,n),r=new si,i=t.computeSelfNodes(r,!0);return!(i.hasIntersection()&&(i.hasProperIntersection()?(this.nonSimpleLocation=i.getProperIntersectionPoint(),1):this.hasNonEndpointIntersection(t)||this.isClosedEndpointsInInterior&&this.hasClosedEndpointIntersection(t)))},hasNonEndpointIntersection:function(n){for(var i,t=n.getEdgeIterator();t.hasNext();)for(var r=t.next(),f=r.getMaximumSegmentIndex(),u=r.getEdgeIntersectionList().iterator();u.hasNext();)if(i=u.next(),!i.isEndPoint(f))return this.nonSimpleLocation=i.getCoordinate(),!0;return!1},addEndpoint:function(n,t,i){var r=n.get(t);null===r&&(r=new yv(t),n.put(t,r));r.addEndpoint(i)},computeSimple:function(n){return this.nonSimpleLocation=null,!!n.isEmpty()||(n instanceof d?this.isSimpleLinearGeometry(n):n instanceof cr?this.isSimpleLinearGeometry(n):n instanceof lr?this.isSimpleMultiPoint(n):l(n,bf)?this.isSimplePolygonal(n):!(n instanceof nt)||this.isSimpleGeometryCollection(n))},isSimple:function(){return this.nonSimpleLocation=null,this.computeSimple(this.inputGeom)},isSimpleGeometryCollection:function(n){for(var i,t=0;t<n.getNumGeometries();t++)if(i=n.getGeometryN(t),!this.computeSimple(i))return!1;return!0},interfaces_:function(){return[]},getClass:function(){return dc}});i(yv.prototype,{addEndpoint:function(n){this.degree++;this.isClosed|=n},getCoordinate:function(){return this.pt},interfaces_:function(){return[]},getClass:function(){return yv}});dc.EndpointInfo=yv;i(rt.prototype,{getEndCapStyle:function(){return this.endCapStyle},isSingleSided:function(){return this._isSingleSided},setQuadrantSegments:function(n){this.quadrantSegments=n;0===this.quadrantSegments&&(this.joinStyle=rt.JOIN_BEVEL);this.quadrantSegments<0&&(this.joinStyle=rt.JOIN_MITRE,this.mitreLimit=Math.abs(this.quadrantSegments));n<=0&&(this.quadrantSegments=1);this.joinStyle!==rt.JOIN_ROUND&&(this.quadrantSegments=rt.DEFAULT_QUADRANT_SEGMENTS)},getJoinStyle:function(){return this.joinStyle},setJoinStyle:function(n){this.joinStyle=n},setSimplifyFactor:function(n){this.simplifyFactor=n<0?0:n},getSimplifyFactor:function(){return this.simplifyFactor},getQuadrantSegments:function(){return this.quadrantSegments},setEndCapStyle:function(n){this.endCapStyle=n},getMitreLimit:function(){return this.mitreLimit},setMitreLimit:function(n){this.mitreLimit=n},setSingleSided:function(n){this._isSingleSided=n},interfaces_:function(){return[]},getClass:function(){return rt}});rt.bufferDistanceError=function(n){var t=Math.PI/2/n;return 1-Math.cos(t/2)};rt.CAP_ROUND=1;rt.CAP_FLAT=2;rt.CAP_SQUARE=3;rt.JOIN_ROUND=1;rt.JOIN_MITRE=2;rt.JOIN_BEVEL=3;rt.DEFAULT_QUADRANT_SEGMENTS=8;rt.DEFAULT_MITRE_LIMIT=5;rt.DEFAULT_SIMPLIFY_FACTOR=.01;i(uw.prototype,{getCoordinate:function(){return this.minCoord},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},findRightmostEdgeAtVertex:function(){var n=this.minDe.getEdge().getCoordinates();c.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=s.computeOrientation(this.minCoord,i,t),r=!1;t.y<this.minCoord.y&&i.y<this.minCoord.y&&u===s.COUNTERCLOCKWISE?r=!0:t.y>this.minCoord.y&&i.y>this.minCoord.y&&u===s.CLOCKWISE&&(r=!0);r&&(this.minIndex=this.minIndex-1)},getRightmostSideOfSegment:function(n,t){var u=n.getEdge(),i=u.getCoordinates(),r;return t<0||t+1>=i.length?-1:i[t].y===i[t+1].y?-1:(r=o.LEFT,i[t].y<i[t+1].y&&(r=o.RIGHT),r)},getEdge:function(){return this.orientedDe},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])},findRightmostEdgeAtNode:function(){var n=this.minDe.getNode(),t=n.getEdges();this.minDe=t.getRightmostEdge();this.minDe.isForward()||(this.minDe=this.minDe.getSym(),this.minIndex=this.minDe.getEdge().getCoordinates().length-1)},findEdge:function(n){for(var i,t=n.iterator();t.hasNext();)i=t.next(),i.isForward()&&this.checkForRightmostCoordinate(i);c.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)===o.LEFT&&(this.orientedDe=this.minDe.getSym())},interfaces_:function(){return[]},getClass:function(){return uw}});pv.prototype.addLast=function(n){this.array_.push(n)};pv.prototype.removeFirst=function(){return this.array_.shift()};pv.prototype.isEmpty=function(){return 0===this.array_.length};i(fw.prototype,{clearVisitedEdges:function(){for(var n=this.dirEdgeList.iterator();n.hasNext();)n.next().setVisited(!1)},getRightmostCoordinate:function(){return this.rightMostCoord},computeNodeDepth:function(n){for(var t,r=null,i=n.getEdges().iterator();i.hasNext();)if(t=i.next(),t.isVisited()||t.getSym().isVisited()){r=t;break}if(null===r)throw new ar("unable to find edge to compute depths at "+n.getCoordinate());for(n.getEdges().computeDepths(r),i=n.getEdges().iterator();i.hasNext();)t=i.next(),t.setVisited(!0),this.copySymDepths(t)},computeDepth:function(n){this.clearVisitedEdges();var t=this.finder.getEdge();t.getNode();t.getLabel();t.setEdgeDepths(o.RIGHT,n);this.copySymDepths(t);this.computeDepths(t)},create:function(n){this.addReachable(n);this.finder.findEdge(this.dirEdgeList);this.rightMostCoord=this.finder.getCoordinate()},findResultEdges:function(){for(var n,t=this.dirEdgeList.iterator();t.hasNext();)n=t.next(),n.getDepth(o.RIGHT)>=1&&n.getDepth(o.LEFT)<=0&&!n.isInteriorAreaEdge()&&n.setInResult(!0)},computeDepths:function(n){var t=new li,i=new pv,o=n.getNode(),r,f,s,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();)s=f.next(),e=s.getSym(),e.isVisited()||(u=e.getNode(),t.contains(u)||(i.addLast(u),t.add(u)))},compareTo:function(n){var t=n;return this.rightMostCoord.x<t.rightMostCoord.x?-1:this.rightMostCoord.x>t.rightMostCoord.x?1:0},getEnvelope:function(){var n,t;if(null===this.env){for(n=new p,t=this.dirEdgeList.iterator();t.hasNext();)for(var u=t.next(),r=u.getEdge().getCoordinates(),i=0;i<r.length-1;i++)n.expandToInclude(r[i]);this.env=n}return this.env},addReachable:function(n){var t=new gi,i;for(t.add(n);!t.empty();)i=t.pop(),this.add(i,t)},copySymDepths:function(n){var t=n.getSym();t.setDepth(o.LEFT,n.getDepth(o.RIGHT));t.setDepth(o.RIGHT,n.getDepth(o.LEFT))},add:function(n,t){var i,r,f,u;for(n.setVisited(!0),this.nodes.add(n),i=n.getEdges().iterator();i.hasNext();)r=i.next(),this.dirEdgeList.add(r),f=r.getSym(),u=f.getNode(),u.isVisited()||t.push(u)},getNodes:function(){return this.nodes},getDirectedEdges:function(){return this.dirEdgeList},interfaces_:function(){return[sr]},getClass:function(){return fw}});i(vi.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)},deleteShallowConcavities:function(){for(var r,t=1,n=(this.inputLine.length,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]=vi.DELETE,r=!0,u=!0),t=r?i:n,n=this.findNextNonDeletedIndex(t),i=this.findNextNonDeletedIndex(n);return u},isShallowConcavity:function(n,t,i,r){return s.computeOrientation(n,t,i)===this.angleOrientation&&s.distancePointLine(t,n,i)<r},isShallowSampled:function(n,t,i,r,u){var e=Math.trunc((r-i)/vi.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},isConcave:function(n,t,i){return s.computeOrientation(n,t,i)===this.angleOrientation},simplify:function(n){this.distanceTol=Math.abs(n);n<0&&(this.angleOrientation=s.CLOCKWISE);this.isDeleted=new Array(this.inputLine.length).fill(null);var t=!1;do t=this.deleteShallowConcavities();while(t);return this.collapseLine()},findNextNonDeletedIndex:function(n){for(var t=n+1;t<this.inputLine.length&&this.isDeleted[t]===vi.DELETE;)t++;return t},isShallow:function(n,t,i,r){return s.distancePointLine(t,n,i)<r},collapseLine:function(){for(var t=new ii,n=0;n<this.inputLine.length;n++)this.isDeleted[n]!==vi.DELETE&&t.add(this.inputLine[n]);return t.toCoordinateArray()},interfaces_:function(){return[]},getClass:function(){return vi}});vi.simplify=function(n,t){return new vi(n).simplify(t)};vi.INIT=0;vi.DELETE=1;vi.KEEP=1;vi.NUM_PTS_TO_CHECK=10;i(gc.prototype,{getCoordinates:function(){return this.ptList.toArray(gc.COORDINATE_ARRAY_TYPE)},setPrecisionModel:function(n){this.precisionModel=n},addPt:function(n){var t=new r(n);return this.precisionModel.makePrecise(t),this.isRedundant(t)?null:void this.ptList.add(t)},reverse:function(){},addPts:function(n,t){var i;if(t)for(i=0;i<n.length;i++)this.addPt(n[i]);else for(i=n.length-1;i>=0;i--)this.addPt(n[i])},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},toString:function(){return(new g).createLineString(this.getCoordinates()).toString()},closeRing:function(){if(this.ptList.size()<1)return null;var n=new r(this.ptList.get(0)),t=this.ptList.get(this.ptList.size()-1);return this.ptList.size()>=2&&this.ptList.get(this.ptList.size()-2),n.equals(t)?null:void this.ptList.add(n)},setMinimumVertexDistance:function(n){this.minimimVertexDistance=n},interfaces_:function(){return[]},getClass:function(){return gc}});gc.COORDINATE_ARRAY_TYPE=new Array(0).fill(null);i(of.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=s.computeOrientation(this.s0,this.s1,this.s2),r=i===s.CLOCKWISE&&this.side===o.LEFT||i===s.COUNTERCLOCKWISE&&this.side===o.RIGHT;0===i?this.addCollinear(t):r?this.addOutsideTurn(i,t):this.addInsideTurn(i,t)},addLineEndCap:function(n,t){var h=new b(n,t),f=new b,u,i,c,l;this.computeOffsetSegment(h,o.LEFT,this.distance,f);u=new b;this.computeOffsetSegment(h,o.RIGHT,this.distance,u);var a=t.x-n.x,v=t.y-n.y,e=Math.atan2(v,a);switch(this.bufParams.getEndCapStyle()){case rt.CAP_ROUND:this.segList.addPt(f.p1);this.addFilletArc(t,e+Math.PI/2,e-Math.PI/2,s.CLOCKWISE,this.distance);this.segList.addPt(u.p1);break;case rt.CAP_FLAT:this.segList.addPt(f.p1);this.segList.addPt(u.p1);break;case rt.CAP_SQUARE:i=new r;i.x=Math.abs(this.distance)*Math.cos(e);i.y=Math.abs(this.distance)*Math.sin(e);c=new r(f.p1.x+i.x,f.p1.y+i.y);l=new r(u.p1.x+i.x,u.p1.y+i.y);this.segList.addPt(c);this.segList.addPt(l)}},getCoordinates:function(){return this.segList.getCoordinates()},addMitreJoin:function(n,t,i,u){var e=!0,f=null;try{f=hr.intersection(t.p0,t.p1,i.p0,i.p1);(u<=0?1:f.distance(n)/Math.abs(u))>this.bufParams.getMitreLimit()&&(e=!1)}catch(n){if(!(n instanceof vf))throw n;f=new r(0,0);e=!1}e?this.segList.addPt(f):this.addLimitedMitreJoin(t,i,u,this.bufParams.getMitreLimit())},addFilletCorner:function(n,t,i,r,u){var o=t.x-n.x,h=t.y-n.y,f=Math.atan2(h,o),c=i.x-n.x,l=i.y-n.y,e=Math.atan2(l,c);r===s.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)},addOutsideTurn:function(n,t){return this.offset0.p1.distance(this.offset1.p0)<this.distance*of.OFFSET_SEGMENT_SEPARATION_FACTOR?(this.segList.addPt(this.offset0.p1),null):void(this.bufParams.getJoinStyle()===rt.JOIN_MITRE?this.addMitreJoin(this.s1,this.offset0,this.offset1,this.distance):this.bufParams.getJoinStyle()===rt.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)))},createSquare:function(n){this.segList.addPt(new r(n.x+this.distance,n.y+this.distance));this.segList.addPt(new r(n.x+this.distance,n.y-this.distance));this.segList.addPt(new r(n.x-this.distance,n.y-this.distance));this.segList.addPt(new r(n.x-this.distance,n.y+this.distance));this.segList.closeRing()},addSegments:function(n,t){this.segList.addPts(n,t)},addFirstSegment:function(){this.segList.addPt(this.offset1.p0)},addLastSegment:function(){this.segList.addPt(this.offset1.p1)},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)},addLimitedMitreJoin:function(n,t,i,u){var f=this.seg0.p1,y=k.angle(f,this.seg0.p0),p=(k.angle(f,this.seg1.p1),k.angleBetweenOriented(this.seg0.p0,f,this.seg1.p1)),s=p/2,w=k.normalize(y+s),h=k.normalize(w+Math.PI),e=u*i,d=e*Math.abs(Math.sin(s)),c=i-d,g=f.x+e*Math.cos(h),nt=f.y+e*Math.sin(h),tt=new r(g,nt),l=new b(f,tt),a=l.pointAlongOffset(1,c),v=l.pointAlongOffset(1,-c);this.side===o.LEFT?(this.segList.addPt(a),this.segList.addPt(v)):(this.segList.addPt(v),this.segList.addPt(a))},computeOffsetSegment:function(n,t,i,r){var e=t===o.LEFT?1:-1,u=n.p1.x-n.p0.x,f=n.p1.y-n.p0.y,s=Math.sqrt(u*u+f*f),h=e*i*u/s,c=e*i*f/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},addFilletArc:function(n,t,i,u,f){var y=u===s.CLOCKWISE?-1:1,h=Math.abs(t-i),v=Math.trunc(h/this.filletAngleQuantum+.5),c,l,e,o,a;if(v<1)return null;for(c=null,l=null,c=0,l=h/v,e=c,o=new r;e<h;)a=t+y*e,o.x=n.x+f*Math.cos(a),o.y=n.y+f*Math.sin(a),this.segList.addPt(o),e+=l},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*of.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)?this.segList.addPt(this.offset0.p1):((this.segList.addPt(this.offset0.p1),this.closingSegLengthFactor>0)?(n=new r((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 r((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))},createCircle:function(n){var t=new r(n.x+this.distance,n.y);this.segList.addPt(t);this.addFilletArc(n,0,2*Math.PI,-1,this.distance);this.segList.closeRing()},addBevelJoin:function(n,t){this.segList.addPt(n.p1);this.segList.addPt(t.p0)},init:function(n){this.distance=n;this.maxCurveSegmentError=n*(1-Math.cos(this.filletAngleQuantum/2));this.segList=new gc;this.segList.setPrecisionModel(this.precisionModel);this.segList.setMinimumVertexDistance(n*of.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},addCollinear:function(n){this.li.computeIntersection(this.s0,this.s1,this.s1,this.s2);this.li.getIntersectionNum()>=2&&(this.bufParams.getJoinStyle()===rt.JOIN_BEVEL||this.bufParams.getJoinStyle()===rt.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,s.CLOCKWISE,this.distance))},closeRing:function(){this.segList.closeRing()},hasNarrowConcaveAngle:function(){return this._hasNarrowConcaveAngle},interfaces_:function(){return[]},getClass:function(){return of}});of.OFFSET_SEGMENT_SEPARATION_FACTOR=.001;of.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR=.001;of.CURVE_VERTEX_SNAP_DISTANCE_FACTOR=1e-6;of.MAX_CLOSING_SEG_LEN_FACTOR=80;i(nl.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&&w.reverse(r),r},computeSingleSidedBufferCurve:function(n,t,i){var s=this.simplifyTolerance(this.distance),u,e,f,h,r;if(t)for(i.addSegments(n,!0),u=vi.simplify(n,-s),e=u.length-1,i.initSideSegments(u[e],u[e-1],o.LEFT),i.addFirstSegment(),r=e-2;r>=0;r--)i.addNextSegment(u[r],!0);else for(i.addSegments(n,!1),f=vi.simplify(n,s),h=f.length-1,i.initSideSegments(f[0],f[1],o.LEFT),i.addFirstSegment(),r=2;r<=h;r++)i.addNextSegment(f[r],!0);i.addLastSegment();i.closeRing()},computeRingBufferCurve:function(n,t,i){var f=this.simplifyTolerance(this.distance),r,e,u,s;for(t===o.RIGHT&&(f=-f),r=vi.simplify(n,f),e=r.length-1,i.initSideSegments(r[e-1],r[0],t),u=1;u<=e;u++)s=1!==u,i.addNextSegment(r[u],s);i.closeRing()},computeLineBufferCurve:function(n,t){var s=this.simplifyTolerance(this.distance),u=vi.simplify(n,s),e=u.length-1,r,f,i;for(t.initSideSegments(u[0],u[1],o.LEFT),i=2;i<=e;i++)t.addNextSegment(u[i],!0);for(t.addLastSegment(),t.addLineEndCap(u[e-1],u[e]),r=vi.simplify(n,-s),f=r.length-1,t.initSideSegments(r[f],r[f-1],o.LEFT),i=f-2;i>=0;i--)t.addNextSegment(r[i],!0);t.addLastSegment();t.addLineEndCap(r[1],r[0]);t.closeRing()},computePointCurve:function(n,t){switch(this.bufParams.getEndCapStyle()){case rt.CAP_ROUND:t.createCircle(n);break;case rt.CAP_SQUARE:t.createSquare(n)}},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())},getBufferParameters:function(){return this.bufParams},simplifyTolerance:function(n){return n*this.bufParams.getSimplifyFactor()},getRingCurve:function(n,t,i){if(this.distance=i,n.length<=2)return this.getLineCurve(n,i);if(0===i)return nl.copyCoordinates(n);var r=this.getSegGen(i);return this.computeRingBufferCurve(n,t,r),r.getCoordinates()},computeOffsetCurve:function(n,t,i){var s=this.simplifyTolerance(this.distance),u,e,f,h,r;if(t)for(u=vi.simplify(n,-s),e=u.length-1,i.initSideSegments(u[e],u[e-1],o.LEFT),i.addFirstSegment(),r=e-2;r>=0;r--)i.addNextSegment(u[r],!0);else for(f=vi.simplify(n,s),h=f.length-1,i.initSideSegments(f[0],f[1],o.LEFT),i.addFirstSegment(),r=2;r<=h;r++)i.addNextSegment(f[r],!0);i.addLastSegment()},getSegGen:function(n){return new of(this.precisionModel,this.bufParams,n)},interfaces_:function(){return[]},getClass:function(){return nl}});nl.copyCoordinates=function(n){for(var i=new Array(n.length).fill(null),t=0;t<i.length;t++)i[t]=new r(n[t]);return i};i(wv.prototype,{findStabbedSegments:function(){var e,h,p,a,w,v;if(1===arguments.length){for(var f=arguments[0],y=new u,n=this.subgraphs.iterator();n.hasNext();)e=n.next(),h=e.getEnvelope(),f.y<h.getMinY()||f.y>h.getMaxY()||this.findStabbedSegments(f,e.getDirectedEdges(),y);return y}if(3===arguments.length)if(l(arguments[2],ei)&&arguments[0]instanceof r&&arguments[1]instanceof go)for(var t=arguments[0],c=arguments[1],b=arguments[2],i=c.getEdge().getCoordinates(),n=0;n<i.length-1;n++)this.seg.p0=i[n],this.seg.p1=i[n+1],this.seg.p0.y>this.seg.p1.y&&this.seg.reverse(),p=Math.max(this.seg.p0.x,this.seg.p1.x),p<t.x||this.seg.isHorizontal()||t.y<this.seg.p0.y||t.y>this.seg.p1.y||s.computeOrientation(this.seg.p0,this.seg.p1,t)===s.RIGHT||(a=c.getDepth(o.LEFT),this.seg.p0.equals(i[n])||(a=c.getDepth(o.RIGHT)),w=new bv(this.seg,a),b.add(w));else if(l(arguments[2],ei)&&arguments[0]instanceof r&&l(arguments[1],ei))for(var k=arguments[0],d=arguments[1],g=arguments[2],n=d.iterator();n.hasNext();)v=n.next(),v.isForward()&&this.findStabbedSegments(k,v,g)},getDepth:function(n){var t=this.findStabbedSegments(n);return 0===t.size()?0:gu.min(t).leftDepth},interfaces_:function(){return[]},getClass:function(){return wv}});i(bv.prototype,{compareTo:function(n){var i=n,t;return this.upwardSeg.minX()>=i.upwardSeg.maxX()?1:this.upwardSeg.maxX()<=i.upwardSeg.minX()?-1:(t=this.upwardSeg.orientationIndex(i.upwardSeg),0!==t?t:(t=-1*i.upwardSeg.orientationIndex(this.upwardSeg),0!==t?t:this.upwardSeg.compareTo(i.upwardSeg)))},compareX:function(n,t){var i=n.p0.compareTo(t.p0);return 0!==i?i:n.p1.compareTo(t.p1)},toString:function(){return this.upwardSeg.toString()},interfaces_:function(){return[sr]},getClass:function(){return bv}});wv.DepthSegment=bv;i(ew.prototype,{addPoint:function(n){if(this.distance<=0)return null;var i=n.getCoordinates(),r=this.curveBuilder.getLineCurve(i,this.distance);this.addCurve(r,t.EXTERIOR,t.INTERIOR)},addPolygon:function(n){var r=this.distance,u=o.LEFT,f,e,i,s,h;if((this.distance<0&&(r=-this.distance,u=o.RIGHT),f=n.getExteriorRing(),e=w.removeRepeatedPoints(f.getCoordinates()),this.distance<0&&this.isErodedCompletely(f,this.distance))||this.distance<=0&&e.length<3)return null;for(this.addPolygonRing(e,r,u,t.EXTERIOR,t.INTERIOR),i=0;i<n.getNumInteriorRing();i++)s=n.getInteriorRingN(i),h=w.removeRepeatedPoints(s.getCoordinates()),this.distance>0&&this.isErodedCompletely(s,-this.distance)||this.addPolygonRing(h,r,o.opposite(u),t.INTERIOR,t.EXTERIOR)},isTriangleErodedCompletely:function(n,t){var i=new vt(n[0],n[1],n[2]),r=i.inCentre();return s.distancePointLine(r,i.p0,i.p1)<Math.abs(t)},addLineString:function(n){if(this.distance<=0&&!this.curveBuilder.getBufferParameters().isSingleSided())return null;var i=w.removeRepeatedPoints(n.getCoordinates()),r=this.curveBuilder.getLineCurve(i,this.distance);this.addCurve(r,t.EXTERIOR,t.INTERIOR)},addCurve:function(n,i,r){if(null===n||n.length<2)return null;var u=new tf(n,new ti(0,t.BOUNDARY,i,r));this.curveList.add(u)},getCurves:function(){return this.add(this.inputGeom),this.curveList},addPolygonRing:function(n,t,i,r,u){var f,e,h;if(0===t&&n.length<gt.MINIMUM_VALID_SIZE)return null;f=r;e=u;n.length>=gt.MINIMUM_VALID_SIZE&&s.isCCW(n)&&(f=u,e=r,i=o.opposite(i));h=this.curveBuilder.getRingCurve(n,i,t);this.addCurve(h,f,e)},add:function(n){if(n.isEmpty())return null;if(n instanceof st)this.addPolygon(n);else if(n instanceof d)this.addLineString(n);else if(n instanceof bt)this.addPoint(n);else if(n instanceof lr)this.addCollection(n);else if(n instanceof cr)this.addCollection(n);else if(n instanceof ai)this.addCollection(n);else{if(!(n instanceof nt))throw new UnsupportedOperationException(n.getClass().getName());this.addCollection(n)}},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)},addCollection:function(n){for(var i,t=0;t<n.getNumGeometries();t++)i=n.getGeometryN(t),this.add(i)},interfaces_:function(){return[]},getClass:function(){return ew}});i(tl.prototype,{isTrivialIntersection:function(n,t,i,r){if(n===i&&1===this.li.getIntersectionNum()){if(tl.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},getProperIntersectionPoint:function(){return this.properIntersectionPoint},hasProperInteriorIntersection:function(){return this.hasProperInterior},getLineIntersector:function(){return this.li},hasProperIntersection:function(){return this.hasProper},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)))},hasIntersection:function(){return this._hasIntersection},isDone:function(){return!1},hasInteriorIntersection:function(){return this.hasInterior},interfaces_:function(){return[ec]},getClass:function(){return tl}});tl.isAdjacentSegments=function(n,t){return 1===Math.abs(n-t)};i(fo.prototype,{setWorkingPrecisionModel:function(n){this.workingPrecisionModel=n},insertUniqueEdge:function(n){var t=this.edgeList.findEqualEdge(n),r,i;if(null!==t){r=t.getLabel();i=n.getLabel();t.isPointwiseEqual(n)||(i=new ti(n.getLabel()),i.flip());r.merge(i);var u=fo.depthDelta(i),f=t.getDepthDelta(),e=f+u;t.setDepthDelta(e)}else this.edgeList.add(n),n.setDepthDelta(fo.depthDelta(n.getLabel()))},buildSubgraphs:function(n,t){for(var r=new u,f=n.iterator();f.hasNext();){var i=f.next(),e=i.getRightmostCoordinate(),o=new wv(r),s=o.getDepth(e);i.computeDepth(s);i.findResultEdges();r.add(i);t.add(i.getDirectedEdges(),i.getNodes())}},createSubgraphs:function(n){for(var r,f,t=new u,i=n.getNodes().iterator();i.hasNext();)r=i.next(),r.isVisited()||(f=new fw,f.create(r),t.add(f));return gu.sort(t,gu.reverseOrder()),t},createEmptyResultGeometry:function(){return this.geomFact.createPolygon()},getNoder:function(n){if(null!==this.workingNoder)return this.workingNoder;var t=new be,i=new si;return i.setPrecisionModel(n),t.setSegmentIntersector(new tl(i)),t},buffer:function(n,t){var i=this.workingPrecisionModel,e,r,u;null===i&&(i=n.getPrecisionModel());this.geomFact=n.getFactory();var o=new nl(i,this.bufParams),s=new ew(n,t,o),f=s.getCurves();return f.size()<=0?this.createEmptyResultGeometry():(this.computeNodedEdges(f,i),this.graph=new uf(new nh),this.graph.addEdges(this.edgeList.getEdges()),e=this.createSubgraphs(this.graph),r=new ga(this.geomFact),this.buildSubgraphs(e,r),u=r.getPolygons(),u.size()<=0?this.createEmptyResultGeometry():this.geomFact.buildGeometry(u))},computeNodedEdges:function(n,t){var f=this.getNoder(t),e,u,i,r,o,s;for(f.computeNodes(n),e=f.getNodedSubstrings(),u=e.iterator();u.hasNext();)i=u.next(),r=i.getCoordinates(),2===r.length&&r[0].equals2D(r[1])||(o=i.getData(),s=new ou(i.getCoordinates(),new ti(o)),this.insertUniqueEdge(s))},setNoder:function(n){this.workingNoder=n},interfaces_:function(){return[]},getClass:function(){return fo}});fo.depthDelta=function(n){var i=n.getLocation(0,o.LEFT),r=n.getLocation(0,o.RIGHT);return i===t.INTERIOR&&r===t.EXTERIOR?1:i===t.EXTERIOR&&r===t.INTERIOR?-1:0};fo.convertSegStrings=function(n){for(var r,f,t=new g,i=new u;n.hasNext();)r=n.next(),f=t.createLineString(r.getCoordinates()),i.add(f);return t.buildGeometry(i)};i(il.prototype,{checkEndPtVertexIntersections:function(){var t,i,n;if(0===arguments.length)for(t=this.segStrings.iterator();t.hasNext();)i=t.next(),n=i.getCoordinates(),this.checkEndPtVertexIntersections(n[0],this.segStrings),this.checkEndPtVertexIntersections(n[n.length-1],this.segStrings);else if(2===arguments.length)for(var u=arguments[0],f=arguments[1],t=f.iterator();t.hasNext();)for(var i=t.next(),n=i.getCoordinates(),r=1;r<n.length-1;r++)if(n[r].equals(u))throw new ci("found endpt/interior pt intersection at index "+r+" :pt "+u);},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 ci("found non-noded intersection at "+s+"-"+h+" and "+c+"-"+l);}},checkValid:function(){this.checkEndPtVertexIntersections();this.checkInteriorIntersections();this.checkCollapses()},checkCollapses:function(){var n,i;if(0===arguments.length)for(n=this.segStrings.iterator();n.hasNext();)i=n.next(),this.checkCollapses(i);else if(1===arguments.length)for(var r=arguments[0],t=r.getCoordinates(),n=0;n<t.length-2;n++)this.checkCollapse(t[n],t[n+1],t[n+2])},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},checkCollapse:function(n,t,i){if(n.equals(i))throw new ci("found non-noded collapse at "+il.fact.createLineString([n,t,i]));},interfaces_:function(){return[]},getClass:function(){return il}});il.fact=new g;i(fh.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),c.isTrue(!(r&&i),"Found bad envelope test"),i)},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 r(this.maxx,this.maxy);this.corner[1]=new r(this.minx,this.maxy);this.corner[2]=new r(this.minx,this.miny);this.corner[3]=new r(this.maxx,this.miny)},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))},scale:function(n){return Math.round(n*this.scaleFactor)},getCoordinate:function(){return this.originalPt},copyScaled:function(n,t){t.x=this.scale(n.x);t.y=this.scale(n.y)},getSafeEnvelope:function(){if(null===this.safeEnv){var n=fh.SAFE_ENV_EXPANSION_FACTOR/this.scaleFactor;this.safeEnv=new p(this.originalPt.x-n,this.originalPt.x+n,this.originalPt.y-n,this.originalPt.y+n)}return this.safeEnv},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()))))},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)))))},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)},interfaces_:function(){return[]},getClass:function(){return fh}});fh.SAFE_ENV_EXPANSION_FACTOR=.75;i(kv.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 rl(t,u,f);return this.index.query(i,{interfaces_:function(){return[we]},visitItem:function(n){n.select(i,r)}}),r.isNodeAdded()}},interfaces_:function(){return[]},getClass:function(){return kv}});y(rl,to);i(rl.prototype,{isNodeAdded:function(){return this._isNodeAdded},select:function(){if(2!==arguments.length)return to.prototype.select.apply(this,arguments);var i=arguments[0],n=arguments[1],t=i.getContext();return null!==this.parentEdge&&t===this.parentEdge&&n===this.hotPixelVertexIndex?null:void(this._isNodeAdded=this.hotPixel.addSnappedNode(t,n))},interfaces_:function(){return[]},getClass:function(){return rl}});kv.HotPixelSnapAction=rl;i(ow.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)}},isDone:function(){return!1},getInteriorIntersections:function(){return this.interiorIntersections},interfaces_:function(){return[ec]},getClass:function(){return ow}});i(sw.prototype,{checkCorrectness:function(n){var t=tf.getNodedSubstrings(n),i=new il(t);try{i.checkValid()}catch(n){if(!(n instanceof ra))throw n;n.printStackTrace()}},getNodedSubstrings:function(){return tf.getNodedSubstrings(this.nodedSegStrings)},snapRound:function(n,t){var i=this.findInteriorIntersections(n,t);this.computeIntersectionSnaps(i);this.computeVertexSnaps(n)},findInteriorIntersections:function(n,t){var i=new ow(t);return this.noder.setSegmentIntersector(i),this.noder.computeNodes(n),i.getInteriorIntersections()},computeVertexSnaps:function(){var u,t,f,e,o;if(l(arguments[0],yt))for(u=arguments[0],t=u.iterator();t.hasNext();)f=t.next(),this.computeVertexSnaps(f);else if(arguments[0]instanceof tf)for(var i=arguments[0],r=i.getCoordinates(),n=0;n<r.length;n++)e=new fh(r[n],this.scaleFactor,this.li),o=this.pointSnapper.snap(e,i,n),o&&i.addIntersection(r[n],n)},computeNodes:function(n){this.nodedSegStrings=n;this.noder=new be;this.pointSnapper=new kv(this.noder.getIndex());this.snapRound(n,this.li)},computeIntersectionSnaps:function(n){for(var i,r,t=n.iterator();t.hasNext();)i=t.next(),r=new fh(i,this.scaleFactor,this.li),this.pointSnapper.snap(r)},interfaces_:function(){return[uc]},getClass:function(){return sw}});i(yi.prototype,{bufferFixedPrecision:function(n){var i=new kc(new sw(new ft(1)),n.getScale()),t=new fo(this.bufParams);t.setWorkingPrecisionModel(n);t.setNoder(i);this.resultGeometry=t.buffer(this.argGeom,this.distance)},bufferReducedPrecision:function(){var n;if(0===arguments.length){for(n=yi.MAX_PRECISION_DIGITS;n>=0;n--){try{this.bufferReducedPrecision(n)}catch(n){if(!(n instanceof ar))throw n;this.saveException=n}if(null!==this.resultGeometry)return null}throw this.saveException;}if(1===arguments.length){var t=arguments[0],i=yi.precisionScaleFactor(this.argGeom,this.distance,t),r=new ft(i);this.bufferFixedPrecision(r)}},computeGeometry:function(){if(this.bufferOriginalPrecision(),null!==this.resultGeometry)return null;var n=this.argGeom.getFactory().getPrecisionModel();n.getType()===ft.FIXED?this.bufferFixedPrecision(n):this.bufferReducedPrecision()},setQuadrantSegments:function(n){this.bufParams.setQuadrantSegments(n)},bufferOriginalPrecision:function(){try{var n=new fo(this.bufParams);this.resultGeometry=n.buffer(this.argGeom,this.distance)}catch(n){if(!(n instanceof ci))throw n;this.saveException=n}},getResultGeometry:function(n){return this.distance=n,this.computeGeometry(),this.resultGeometry},setEndCapStyle:function(n){this.bufParams.setEndCapStyle(n)},interfaces_:function(){return[]},getClass:function(){return yi}});yi.bufferOp=function(){var t;if(2===arguments.length){var i=arguments[0],r=arguments[1],u=new yi(i),t=u.getResultGeometry(r);return t}if(3===arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof h&&"number"==typeof arguments[1]){var f=arguments[0],e=arguments[1],o=arguments[2],n=new yi(f);return n.setQuadrantSegments(o),n.getResultGeometry(e)}if(arguments[2]instanceof rt&&arguments[0]instanceof h&&"number"==typeof arguments[1]){var s=arguments[0],c=arguments[1],l=arguments[2],n=new yi(s,l),t=n.getResultGeometry(c);return t}}else if(4===arguments.length){var a=arguments[0],v=arguments[1],y=arguments[2],p=arguments[3],n=new yi(a);return n.setQuadrantSegments(y),n.setEndCapStyle(p),n.getResultGeometry(v)}};yi.precisionScaleFactor=function(n,t,i){var r=n.getEnvelopeInternal(),u=br.max(Math.abs(r.getMaxX()),Math.abs(r.getMaxY()),Math.abs(r.getMinX()),Math.abs(r.getMinY())),f=t>0?t:0,e=u+2*f,o=Math.trunc(Math.log(e)/Math.log(10)+1),s=i-o;return Math.pow(10,s)};yi.CAP_ROUND=rt.CAP_ROUND;yi.CAP_BUTT=rt.CAP_FLAT;yi.CAP_FLAT=rt.CAP_FLAT;yi.CAP_SQUARE=rt.CAP_SQUARE;yi.MAX_PRECISION_DIGITS=12;wb=Object.freeze({BufferOp:yi,BufferParameters:rt});i(fs.prototype,{filter:function(n){n instanceof st&&this.comps.add(n)},interfaces_:function(){return[wf]},getClass:function(){return fs}});fs.getPolygons=function(){var i,n,t;return 1===arguments.length?(i=arguments[0],fs.getPolygons(i,new u)):2===arguments.length?(n=arguments[0],t=arguments[1],n instanceof st?t.add(n):n instanceof nt&&n.apply(new fs(t)),t):void 0};i(pr.prototype,{isInsideArea:function(){return this.segIndex===pr.INSIDE_AREA},getCoordinate:function(){return this.pt},getGeometryComponent:function(){return this.component},getSegmentIndex:function(){return this.segIndex},interfaces_:function(){return[]},getClass:function(){return pr}});pr.INSIDE_AREA=-1;i(es.prototype,{filter:function(n){n instanceof bt&&this.pts.add(n)},interfaces_:function(){return[wf]},getClass:function(){return es}});es.getPoints=function(){var t,n,i;return 1===arguments.length?(t=arguments[0],t instanceof bt?gu.singletonList(t):es.getPoints(t,new u)):2===arguments.length?(n=arguments[0],i=arguments[1],n instanceof bt?i.add(n):n instanceof nt&&n.apply(new es(i)),i):void 0};i(ul.prototype,{filter:function(n){(n instanceof bt||n instanceof d||n instanceof st)&&this.locations.add(new pr(n,0,n.getCoordinate()))},interfaces_:function(){return[wf]},getClass:function(){return ul}});ul.getLocations=function(n){var t=new u;return n.apply(new ul(t)),t};i(ku.prototype,{computeContainmentDistance:function(){var i,s,a,n;if(0===arguments.length){if(i=new Array(2).fill(null),this.computeContainmentDistance(0,i),this.minDistance<=this.terminateDistance)return null;this.computeContainmentDistance(1,i)}else if(2===arguments.length){var r=arguments[0],u=arguments[1],e=1-r,o=fs.getPolygons(this.geom[r]);if(o.size()>0&&(s=ul.getLocations(this.geom[e]),this.computeContainmentDistance(s,o,u),this.minDistance<=this.terminateDistance))return this.minDistanceLocation[e]=u[0],this.minDistanceLocation[r]=u[1],null}else if(3===arguments.length)if(arguments[2]instanceof Array&&l(arguments[0],ei)&&l(arguments[1],ei)){for(var h=arguments[0],c=arguments[1],b=arguments[2],f=0;f<h.size();f++)for(a=h.get(f),n=0;n<c.size();n++)if(this.computeContainmentDistance(a,c.get(n),b),this.minDistance<=this.terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof pr&&arguments[1]instanceof st){var v=arguments[0],y=arguments[1],p=arguments[2],w=v.getCoordinate();if(t.EXTERIOR!==this.ptLocator.locate(w,y))return this.minDistance=0,p[0]=v,p[1]=new pr(y,w),null}},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},computeFacetDistance:function(){var n=new Array(2).fill(null),t=wi.getLines(this.geom[0]),i=wi.getLines(this.geom[1]),r=es.getPoints(this.geom[0]),u=es.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))))},nearestLocations:function(){return this.computeMinDistance(),this.minDistanceLocation},updateMinDistance:function(n,t){return null===n[0]?null:void(t?(this.minDistanceLocation[0]=n[1],this.minDistanceLocation[1]=n[0]):(this.minDistanceLocation[0]=n[0],this.minDistanceLocation[1]=n[1]))},nearestPoints:function(){return this.computeMinDistance(),[this.minDistanceLocation[0].getCoordinate(),this.minDistanceLocation[1].getCoordinate()]},computeMinDistance:function(){var a,v,i,r;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 d&&arguments[1]instanceof bt){var f=arguments[0],e=arguments[1],l=arguments[2];if(f.getEnvelopeInternal().distance(e.getEnvelopeInternal())>this.minDistance)return null;for(var t=f.getCoordinates(),o=e.getCoordinate(),n=0;n<t.length-1;n++)if(r=s.distancePointLine(o,t[n],t[n+1]),r<this.minDistance&&(this.minDistance=r,a=new b(t[n],t[n+1]),v=a.closestPoint(o),l[0]=new pr(f,n,v),l[1]=new pr(e,0,o)),this.minDistance<=this.terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof d&&arguments[1]instanceof d){var h=arguments[0],c=arguments[1],y=arguments[2];if(h.getEnvelopeInternal().distance(c.getEnvelopeInternal())>this.minDistance)return null;for(var t=h.getCoordinates(),u=c.getCoordinates(),n=0;n<t.length-1;n++)for(i=0;i<u.length-1;i++){if(r=s.distanceLineLine(t[n],t[n+1],u[i],u[i+1]),r<this.minDistance){this.minDistance=r;var w=new b(t[n],t[n+1]),k=new b(u[i],u[i+1]),p=w.closestPoints(k);y[0]=new pr(h,n,p[0]);y[1]=new pr(c,i,p[1])}if(this.minDistance<=this.terminateDistance)return null}}},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 pr(u,0,u.getCoordinate()),i[1]=new pr(e,0,e.getCoordinate())),this.minDistance<=this.terminateDistance)return null},distance:function(){if(null===this.geom[0]||null===this.geom[1])throw new ct("null geometries are not supported");return this.geom[0].isEmpty()||this.geom[1].isEmpty()?0:(this.computeMinDistance(),this.minDistance)},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},interfaces_:function(){return[]},getClass:function(){return ku}});ku.distance=function(n,t){return new ku(n,t).distance()};ku.isWithinDistance=function(n,t,i){return new ku(n,t,i).distance()<=i};ku.nearestPoints=function(n,t){return new ku(n,t).nearestPoints()};bb=Object.freeze({DistanceOp:ku});i(hw.prototype,{getCoordinates:function(){var n;if(null===this.coordinates){for(var t=0,i=0,r=new ii,u=this.directedEdges.iterator();u.hasNext();)n=u.next(),n.getEdgeDirection()?t++:i++,r.add(n.getEdge().getLine().getCoordinates(),!1,n.getEdgeDirection());this.coordinates=r.toCoordinateArray();i>t&&w.reverse(this.coordinates)}return this.coordinates},toLineString:function(){return this.factory.createLineString(this.getCoordinates())},add:function(n){this.directedEdges.add(n)},interfaces_:function(){return[]},getClass:function(){return hw}});i(hu.prototype,{setVisited:function(n){this._isVisited=n},isMarked:function(){return this._isMarked},setData:function(n){this.data=n},getData:function(){return this.data},setMarked:function(n){this._isMarked=n},getContext:function(){return this.data},isVisited:function(){return this._isVisited},setContext:function(n){this.data=n},interfaces_:function(){return[]},getClass:function(){return hu}});hu.getComponentWithVisitedState=function(n,t){for(;n.hasNext();){var i=n.next();if(i.isVisited()===t)return i}return null};hu.setVisited=function(n,t){for(;n.hasNext();)n.next().setVisited(t)};hu.setMarked=function(n,t){for(;n.hasNext();)n.next().setMarked(t)};y(iu,hu);i(iu.prototype,{isRemoved:function(){return null===this.parentEdge},compareDirection:function(n){return this.quadrant>n.quadrant?1:this.quadrant<n.quadrant?-1:s.computeOrientation(n.p0,n.p1,this.p1)},getCoordinate:function(){return this.from.getCoordinate()},print:function(n){var t=this.getClass().getName(),i=t.lastIndexOf("."),r=t.substring(i+1);n.print("  "+r+": "+this.p0+" - "+this.p1+" "+this.quadrant+":"+this.angle)},getDirectionPt:function(){return this.p1},getAngle:function(){return this.angle},compareTo:function(n){var t=n;return this.compareDirection(t)},getFromNode:function(){return this.from},getSym:function(){return this.sym},setEdge:function(n){this.parentEdge=n},remove:function(){this.sym=null;this.parentEdge=null},getEdge:function(){return this.parentEdge},getQuadrant:function(){return this.quadrant},setSym:function(n){this.sym=n},getToNode:function(){return this.to},getEdgeDirection:function(){return this.edgeDirection},interfaces_:function(){return[sr]},getClass:function(){return iu}});iu.toEdges=function(n){for(var t=new u,i=n.iterator();i.hasNext();)t.add(i.next().parentEdge);return t};y(fl,iu);i(fl.prototype,{getNext:function(){return 2!==this.getToNode().getDegree()?null:this.getToNode().getOutEdges().getEdges().get(0)===this.getSym()?this.getToNode().getOutEdges().getEdges().get(1):(c.isTrue(this.getToNode().getOutEdges().getEdges().get(1)===this.getSym()),this.getToNode().getOutEdges().getEdges().get(0))},interfaces_:function(){return[]},getClass:function(){return fl}});y(sf,hu);i(sf.prototype,{isRemoved:function(){return null===this.dirEdge},setDirectedEdges:function(n,t){this.dirEdge=[n,t];n.setEdge(this);t.setEdge(this);n.setSym(t);t.setSym(n);n.getFromNode().addOutEdge(n);t.getFromNode().addOutEdge(t)},getDirEdge:function(){var t,n;return Number.isInteger(arguments[0])?(t=arguments[0],this.dirEdge[t]):arguments[0]instanceof fe?(n=arguments[0],this.dirEdge[0].getFromNode()===n?this.dirEdge[0]:this.dirEdge[1].getFromNode()===n?this.dirEdge[1]:null):void 0},remove:function(){this.dirEdge=null},getOppositeNode:function(n){return this.dirEdge[0].getFromNode()===n?this.dirEdge[0].getToNode():this.dirEdge[1].getFromNode()===n?this.dirEdge[1].getToNode():null},interfaces_:function(){return[]},getClass:function(){return sf}});i(cw.prototype,{getNextEdge:function(n){var t=this.getIndex(n);return this.outEdges.get(this.getIndex(t+1))},getCoordinate:function(){var n=this.iterator();return n.hasNext()?n.next().getCoordinate():null},iterator:function(){return this.sortEdges(),this.outEdges.iterator()},sortEdges:function(){this.sorted||(gu.sort(this.outEdges),this.sorted=!0)},remove:function(n){this.outEdges.remove(n)},getEdges:function(){return this.sortEdges(),this.outEdges},getNextCWEdge:function(n){var t=this.getIndex(n);return this.outEdges.get(this.getIndex(t-1))},getIndex:function(){var r,u,n,t,f,i;if(arguments[0]instanceof sf){for(r=arguments[0],this.sortEdges(),n=0;n<this.outEdges.size();n++)if(t=this.outEdges.get(n),t.getEdge()===r)return n;return-1}if(arguments[0]instanceof iu){for(u=arguments[0],this.sortEdges(),n=0;n<this.outEdges.size();n++)if(t=this.outEdges.get(n),t===u)return n;return-1}if(Number.isInteger(arguments[0]))return f=arguments[0],i=f%this.outEdges.size(),i<0&&(i+=this.outEdges.size()),i},add:function(n){this.outEdges.add(n);this.sorted=!1},getDegree:function(){return this.outEdges.size()},interfaces_:function(){return[]},getClass:function(){return cw}});y(fe,hu);i(fe.prototype,{isRemoved:function(){return null===this.pt},addOutEdge:function(n){this.deStar.add(n)},getCoordinate:function(){return this.pt},getOutEdges:function(){return this.deStar},remove:function(){if(0===arguments.length)this.pt=null;else if(1===arguments.length){var n=arguments[0];this.deStar.remove(n)}},getIndex:function(n){return this.deStar.getIndex(n)},getDegree:function(){return this.deStar.getDegree()},interfaces_:function(){return[]},getClass:function(){return fe}});fe.getEdgesBetween=function(n,t){var r=iu.toEdges(n.getOutEdges().getEdges()),i=new li(r),u=iu.toEdges(t.getOutEdges().getEdges());return i.retainAll(u),i};y(dv,sf);i(dv.prototype,{getLine:function(){return this.line},interfaces_:function(){return[]},getClass:function(){return dv}});i(lw.prototype,{find:function(n){return this.nodeMap.get(n)},iterator:function(){return this.nodeMap.values().iterator()},remove:function(n){return this.nodeMap.remove(n)},values:function(){return this.nodeMap.values()},add:function(n){return this.nodeMap.put(n.getCoordinate(),n),n},interfaces_:function(){return[]},getClass:function(){return lw}});i(eh.prototype,{findNodesOfDegree:function(n){for(var r,t=new u,i=this.nodeIterator();i.hasNext();)r=i.next(),r.getDegree()===n&&t.add(r);return t},dirEdgeIterator:function(){return this.dirEdges.iterator()},edgeIterator:function(){return this.edges.iterator()},remove:function(){var i,t,r,n,f;if(arguments[0]instanceof sf)i=arguments[0],this.remove(i.getDirEdge(0)),this.remove(i.getDirEdge(1)),this.edges.remove(i),i.remove();else if(arguments[0]instanceof iu)t=arguments[0],n=t.getSym(),null!==n&&n.setSym(null),t.getFromNode().remove(t),t.remove(),this.dirEdges.remove(t);else if(arguments[0]instanceof fe){for(var u=arguments[0],o=u.getOutEdges().getEdges(),e=o.iterator();e.hasNext();)r=e.next(),n=r.getSym(),null!==n&&this.remove(n),this.dirEdges.remove(r),f=r.getEdge(),null!==f&&this.edges.remove(f);this.nodeMap.remove(u.getCoordinate());u.remove()}},findNode:function(n){return this.nodeMap.find(n)},getEdges:function(){return this.edges},nodeIterator:function(){return this.nodeMap.iterator()},contains:function(){var n,t;return arguments[0]instanceof sf?(n=arguments[0],this.edges.contains(n)):arguments[0]instanceof iu?(t=arguments[0],this.dirEdges.contains(t)):void 0},add:function(){var t,n,i;arguments[0]instanceof fe?(t=arguments[0],this.nodeMap.add(t)):arguments[0]instanceof sf?(n=arguments[0],this.edges.add(n),this.add(n.getDirEdge(0)),this.add(n.getDirEdge(1))):arguments[0]instanceof iu&&(i=arguments[0],this.dirEdges.add(i))},getNodes:function(){return this.nodeMap.values()},interfaces_:function(){return[]},getClass:function(){return eh}});y(gv,eh);i(gv.prototype,{addEdge:function(n){var t;if(n.isEmpty()||(t=w.removeRepeatedPoints(n.getCoordinates()),t.length<=1))return null;var f=t[0],e=t[t.length-1],i=this.getNode(f),r=this.getNode(e),o=new fl(i,r,t[1],!0),s=new fl(r,i,t[t.length-2],!1),u=new dv(n);u.setDirectedEdges(o,s);this.add(u)},getNode:function(n){var t=this.findNode(n);return null===t&&(t=new fe(n),this.add(t)),t},interfaces_:function(){return[]},getClass:function(){return gv}});i(aw.prototype,{buildEdgeStringsForUnprocessedNodes:function(){for(var n,t=this.graph.getNodes().iterator();t.hasNext();)n=t.next(),n.isMarked()||(c.isTrue(2===n.getDegree()),this.buildEdgeStringsStartingAt(n),n.setMarked(!0))},buildEdgeStringsForNonDegree2Nodes:function(){for(var n,t=this.graph.getNodes().iterator();t.hasNext();)n=t.next(),2!==n.getDegree()&&(this.buildEdgeStringsStartingAt(n),n.setMarked(!0))},buildEdgeStringsForObviousStartNodes:function(){this.buildEdgeStringsForNonDegree2Nodes()},getMergedLineStrings:function(){return this.merge(),this.mergedLineStrings},buildEdgeStringsStartingAt:function(n){for(var i,t=n.getOutEdges().iterator();t.hasNext();)i=t.next(),i.getEdge().isMarked()||this.edgeStrings.add(this.buildEdgeStringStartingWith(i))},merge:function(){var n,t;if(null!==this.mergedLineStrings)return null;for(hu.setMarked(this.graph.nodeIterator(),!1),hu.setMarked(this.graph.edgeIterator(),!1),this.edgeStrings=new u,this.buildEdgeStringsForObviousStartNodes(),this.buildEdgeStringsForIsolatedLoops(),this.mergedLineStrings=new u,n=this.edgeStrings.iterator();n.hasNext();)t=n.next(),this.mergedLineStrings.add(t.toLineString())},buildEdgeStringStartingWith:function(n){var i=new hw(this.factory),t=n;do i.add(t),t.getEdge().setMarked(!0),t=t.getNext();while(null!==t&&t!==n);return i},add:function(){var i,n,r,t;if(arguments[0]instanceof h)arguments[0].apply({interfaces_:function(){return[yu]},filter:function(n){n instanceof d&&this.add(n)}});else if(l(arguments[0],yt))for(i=arguments[0],this.mergedLineStrings=null,n=i.iterator();n.hasNext();)r=n.next(),this.add(r);else arguments[0]instanceof d&&(t=arguments[0],null===this.factory&&(this.factory=t.getFactory()),this.graph.addEdge(t))},buildEdgeStringsForIsolatedLoops:function(){this.buildEdgeStringsForUnprocessedNodes()},interfaces_:function(){return[]},getClass:function(){return aw}});kb=Object.freeze({LineMerger:aw});db=Object.freeze({OverlayOp:a});y(el,iu);i(el.prototype,{getNext:function(){return this.next},isInRing:function(){return null!==this.edgeRing},setRing:function(n){this.edgeRing=n},setLabel:function(n){this.label=n},getLabel:function(){return this.label},setNext:function(n){this.next=n},getRing:function(){return this.edgeRing},interfaces_:function(){return[]},getClass:function(){return el}});y(ny,sf);i(ny.prototype,{getLine:function(){return this.line},interfaces_:function(){return[]},getClass:function(){return ny}});i(sl.prototype,{visitInteriorRing:function(n,i){var f=n.getCoordinates(),e=f[0],s=sl.findDifferentPoint(f,e),h=i.findEdgeInSameDirection(e,s),r=i.findEdgeEnd(h),u=null;r.getLabel().getLocation(0,o.RIGHT)===t.INTERIOR?u=r:r.getSym().getLabel().getLocation(0,o.RIGHT)===t.INTERIOR&&(u=r.getSym());c.isTrue(null!==u,"unable to find dirEdge with Interior on RHS");this.visitLinkedDirectedEdges(u)},visitShellInteriors:function(n,t){var u,r,i;if(n instanceof st&&(i=n,this.visitInteriorRing(i.getExteriorRing(),t)),n instanceof ai)for(u=n,r=0;r<u.getNumGeometries();r++)i=u.getGeometryN(r),this.visitInteriorRing(i.getExteriorRing(),t)},getCoordinate:function(){return this.disconnectedRingcoord},setInteriorEdgesInResult:function(n){for(var r,i=n.getEdgeEnds().iterator();i.hasNext();)r=i.next(),r.getLabel().getLocation(0,o.RIGHT)===t.INTERIOR&&r.setInResult(!0)},visitLinkedDirectedEdges:function(n){var i=n,t=n;do c.isTrue(null!==t,"found null Directed Edge"),t.setVisited(!0),t=t.getNext();while(t!==i)},buildEdgeRings:function(n){for(var t,f,e,i=new u,r=n.iterator();r.hasNext();)t=r.next(),t.isInResult()&&null===t.getEdgeRing()&&(f=new sc(t,this.geometryFactory),f.linkDirectedEdgesForMinimalEdgeRings(),e=f.buildMinimalRings(),i.addAll(e));return i},hasUnvisitedShellEdge:function(n){for(var e,u,i,f,r=0;r<n.size();r++)if(e=n.get(r),!e.isHole()&&(u=e.getEdges(),i=u.get(0),i.getLabel().getLocation(0,o.RIGHT)===t.INTERIOR))for(f=0;f<u.size();f++)if(i=u.get(f),!i.isVisited())return this.disconnectedRingcoord=i.getCoordinate(),!0;return!1},isInteriorsConnected:function(){var t=new u,n,i;return this.geomGraph.computeSplitEdges(t),n=new uf(new nh),n.addEdges(t),this.setInteriorEdgesInResult(n),n.linkResultDirectedEdges(),i=this.buildEdgeRings(n.getEdgeEnds()),this.visitShellInteriors(this.geomGraph.getGeometry(),n),!this.hasUnvisitedShellEdge(i)},interfaces_:function(){return[]},getClass:function(){return sl}});sl.findDifferentPoint=function(n,t){for(var i=0;i<n.length;i++)if(!n[i].equals(t))return n[i];return null};i(ty.prototype,{createEdgeEndForNext:function(n,t,i,r){var f=i.segmentIndex+1,u,e;if(f>=n.getNumPoints()&&null===r)return null;u=n.getCoordinate(f);null!==r&&r.segmentIndex===i.segmentIndex&&(u=r.coord);e=new rf(n,i.coord,u,new ti(n.getLabel()));t.add(e)},createEdgeEndForPrev:function(n,t,i,r){var u=i.segmentIndex,f,e,o;if(0===i.dist){if(0===u)return null;u--}f=n.getCoordinate(u);null!==r&&r.segmentIndex>=u&&(f=r.coord);e=new ti(n.getLabel());e.flip();o=new rf(n,i.coord,f,e);t.add(o)},computeEdgeEnds:function(){var o,t;if(1===arguments.length){for(var l=arguments[0],f=new u,e=l;e.hasNext();)o=e.next(),this.computeEdgeEnds(o,f);return f}if(2===arguments.length){var r=arguments[0],s=arguments[1],h=r.getEdgeIntersectionList();h.addEndpoints();var i=h.iterator(),c=null,n=null;if(!i.hasNext())return null;t=i.next();do c=n,n=t,t=null,i.hasNext()&&(t=i.next()),null!==n&&(this.createEdgeEndForPrev(r,s,n,c),this.createEdgeEndForNext(r,s,n,t));while(null!==n)}},interfaces_:function(){return[]},getClass:function(){return ty}});y(hl,rf);i(hl.prototype,{insert:function(n){this.edgeEnds.add(n)},print:function(n){n.println("EdgeEndBundle--> Label: "+this.label);for(var t=this.iterator();t.hasNext();)t.next().print(n),n.println()},iterator:function(){return this.edgeEnds.iterator()},getEdgeEnds:function(){return this.edgeEnds},computeLabelOn:function(n,i){for(var o,r,u=0,f=!1,e=this.iterator();e.hasNext();)o=e.next(),r=o.getLabel().getLocation(n),r===t.BOUNDARY&&u++,r===t.INTERIOR&&(f=!0);r=t.NONE;f&&(r=t.INTERIOR);u>0&&(r=or.determineBoundary(i,u));this.label.setLocation(n,r)},computeLabelSide:function(n,i){for(var u,f,r=this.iterator();r.hasNext();)if(u=r.next(),u.getLabel().isArea()){if(f=u.getLabel().getLocation(n,i),f===t.INTERIOR)return this.label.setLocation(n,i,t.INTERIOR),null;f===t.EXTERIOR&&this.label.setLocation(n,i,t.EXTERIOR)}},getLabel:function(){return this.label},computeLabelSides:function(n){this.computeLabelSide(n,o.LEFT);this.computeLabelSide(n,o.RIGHT)},updateIM:function(n){ou.updateIM(this.label,n)},computeLabel:function(n){for(var i,r=!1,u=this.iterator();u.hasNext();)u.next().getLabel().isArea()&&(r=!0);for(this.label=r?new ti(t.NONE,t.NONE,t.NONE):new ti(t.NONE),i=0;i<2;i++)this.computeLabelOn(i,n),r&&this.computeLabelSides(i)},interfaces_:function(){return[]},getClass:function(){return hl}});y(iy,ts);i(iy.prototype,{updateIM:function(n){for(var t=this.iterator();t.hasNext();)t.next().updateIM(n)},insert:function(n){var t=this.edgeMap.get(n);null===t?(t=new hl(n),this.insertEdgeEnd(n,t)):t.insert(n)},interfaces_:function(){return[]},getClass:function(){return iy}});y(ry,te);i(ry.prototype,{updateIMFromEdges:function(n){this.edges.updateIM(n)},computeIM:function(n){n.setAtLeastIfValid(this.label.getLocation(0),this.label.getLocation(1),0)},interfaces_:function(){return[]},getClass:function(){return ry}});y(cl,ns);i(cl.prototype,{createNode:function(n){return new ry(n,new iy)},interfaces_:function(){return[]},getClass:function(){return cl}});i(vw.prototype,{insertEdgeEnds:function(n){for(var i,t=n.iterator();t.hasNext();)i=t.next(),this.nodes.add(i)},getNodeIterator:function(){return this.nodes.iterator()},copyNodesAndLabels:function(n,t){for(var r,i=n.getNodeIterator();i.hasNext();)r=i.next(),this.nodes.addNode(r.getCoordinate()).setLabel(t,r.getLabel().getLocation(t))},build:function(n){this.computeIntersectionNodes(n,0);this.copyNodesAndLabels(n,0);var t=new ty,i=t.computeEdgeEnds(n.getEdgeIterator());this.insertEdgeEnds(i)},computeIntersectionNodes:function(n,i){for(var o,r,u=n.getEdgeIterator();u.hasNext();)for(var f=u.next(),s=f.getLabel().getLocation(i),e=f.getEdgeIntersectionList().iterator();e.hasNext();)o=e.next(),r=this.nodes.addNode(o.coord),s===t.BOUNDARY?r.setLabelBoundary(i):r.getLabel().isNull(i)&&r.setLabel(i,t.INTERIOR)},interfaces_:function(){return[]},getClass:function(){return vw}});i(uy.prototype,{isNodeEdgeAreaLabelsConsistent:function(){for(var t,n=this.nodeGraph.getNodeIterator();n.hasNext();)if(t=n.next(),!t.getEdges().isAreaLabelsConsistent(this.geomGraph))return this.invalidPoint=t.getCoordinate().copy(),!1;return!0},getInvalidPoint:function(){return this.invalidPoint},hasDuplicateRings:function(){for(var r,t,i,n=this.nodeGraph.getNodeIterator();n.hasNext();)for(r=n.next(),t=r.getEdges().iterator();t.hasNext();)if(i=t.next(),i.getEdgeEnds().size()>1)return this.invalidPoint=i.getEdge().getCoordinate(0),!0;return!1},isNodeConsistentArea:function(){var n=this.geomGraph.computeSelfNodes(this.li,!0,!0);return n.hasProperIntersection()?(this.invalidPoint=n.getProperIntersectionPoint(),!1):(this.nodeGraph.build(this.geomGraph),this.isNodeEdgeAreaLabelsConsistent())},interfaces_:function(){return[]},getClass:function(){return uy}});i(yw.prototype,{buildIndex:function(){var n,t,i;for(this.index=new kt,n=0;n<this.rings.size();n++)t=this.rings.get(n),i=t.getEnvelopeInternal(),this.index.insert(i,t)},getNestedPoint:function(){return this.nestedPt},isNonNested:function(){var t,n,e,r,o;for(this.buildIndex(),t=0;t<this.rings.size();t++)for(var i=this.rings.get(t),h=i.getCoordinates(),f=this.index.query(i.getEnvelopeInternal()),u=0;u<f.size();u++)if(n=f.get(u),e=n.getCoordinates(),i!==n&&i.getEnvelopeInternal().intersects(n.getEnvelopeInternal())&&(r=ru.findPtNotNode(h,n,this.graph),null!==r&&(o=s.isPointInRing(r,e),o)))return this.nestedPt=r,!1;return!0},add:function(n){this.rings.add(n);this.totalEnv.expandToInclude(n.getEnvelopeInternal())},interfaces_:function(){return[]},getClass:function(){return yw}});i(tt.prototype,{getErrorType:function(){return this.errorType},getMessage:function(){return tt.errMsg[this.errorType]},getCoordinate:function(){return this.pt},toString:function(){var n="";return null!==this.pt&&(n=" at or near point "+this.pt),this.getMessage()+n},interfaces_:function(){return[]},getClass:function(){return tt}});tt.ERROR=0;tt.REPEATED_POINT=1;tt.HOLE_OUTSIDE_SHELL=2;tt.NESTED_HOLES=3;tt.DISCONNECTED_INTERIOR=4;tt.SELF_INTERSECTION=5;tt.RING_SELF_INTERSECTION=6;tt.NESTED_SHELLS=7;tt.DUPLICATE_RINGS=8;tt.TOO_FEW_POINTS=9;tt.INVALID_COORDINATE=10;tt.RING_NOT_CLOSED=11;tt.errMsg=["Topology Validation Error","Repeated Point","Hole lies outside shell","Holes are nested","Interior is disconnected","Self-intersection","Ring Self-intersection","Nested shells","Duplicate Rings","Too few distinct points in geometry component","Invalid Coordinate","Ring is not closed"];i(ru.prototype,{checkInvalidCoordinates:function(){var t,i,n;if(arguments[0]instanceof Array){for(t=arguments[0],n=0;n<t.length;n++)if(!ru.isValid(t[n]))return this.validErr=new tt(tt.INVALID_COORDINATE,t[n]),null}else if(arguments[0]instanceof st){if(i=arguments[0],this.checkInvalidCoordinates(i.getExteriorRing().getCoordinates()),null!==this.validErr)return null;for(n=0;n<i.getNumInteriorRing();n++)if(this.checkInvalidCoordinates(i.getInteriorRingN(n).getCoordinates()),null!==this.validErr)return null}},checkHolesNotNested:function(n,t){for(var u,i=new yw(t),r=0;r<n.getNumInteriorRing();r++)u=n.getInteriorRingN(r),i.add(u);i.isNonNested()||(this.validErr=new tt(tt.NESTED_HOLES,i.getNestedPoint()))},checkConsistentArea:function(n){var t=new uy(n);return t.isNodeConsistentArea()?void(t.hasDuplicateRings()&&(this.validErr=new tt(tt.DUPLICATE_RINGS,t.getInvalidPoint()))):(this.validErr=new tt(tt.SELF_INTERSECTION,t.getInvalidPoint()),null)},isValid:function(){return this.checkValid(this.parentGeometry),null===this.validErr},checkShellInsideHole:function(n,t,i){var f=n.getCoordinates(),e=t.getCoordinates(),u=ru.findPtNotNode(f,t,i),r;return null!==u&&!s.isPointInRing(u,e)?u:(r=ru.findPtNotNode(e,n,i),null!==r)?s.isPointInRing(r,f)?r:null:(c.shouldNeverReachHere("points in shell and hole appear to be equal"),null)},checkNoSelfIntersectingRings:function(n){for(var i,t=n.getEdgeIterator();t.hasNext();)if(i=t.next(),this.checkNoSelfIntersectingRing(i.getEdgeIntersectionList()),null!==this.validErr)return null},checkConnectedInteriors:function(n){var t=new sl(n);t.isInteriorsConnected()||(this.validErr=new tt(tt.DISCONNECTED_INTERIOR,t.getCoordinate()))},checkNoSelfIntersectingRing:function(n){for(var t,i=new di,r=!0,u=n.iterator();u.hasNext();)if(t=u.next(),r)r=!1;else{if(i.contains(t.coord))return this.validErr=new tt(tt.RING_SELF_INTERSECTION,t.coord),null;i.add(t.coord)}},checkHolesInShell:function(n,t){for(var f,i,u=n.getExteriorRing(),e=new ac(u),r=0;r<n.getNumInteriorRing();r++){if(f=n.getInteriorRingN(r),i=ru.findPtNotNode(f.getCoordinates(),u,t),null===i)return null;if(!e.isInside(i))return this.validErr=new tt(tt.HOLE_OUTSIDE_SHELL,i),null}},checkTooFewPoints:function(n){if(n.hasTooFewPoints())return this.validErr=new tt(tt.TOO_FEW_POINTS,n.getInvalidPoint()),null},getValidationError:function(){return this.checkValid(this.parentGeometry),this.validErr},checkValid:function(){var c,l,e,a,o,f,r,n,u,s,t,v,i;if(arguments[0]instanceof bt)c=arguments[0],this.checkInvalidCoordinates(c.getCoordinates());else if(arguments[0]instanceof lr)l=arguments[0],this.checkInvalidCoordinates(l.getCoordinates());else if(arguments[0]instanceof gt){if((e=arguments[0],this.checkInvalidCoordinates(e.getCoordinates()),null!==this.validErr)||(this.checkClosedRing(e),null!==this.validErr)||(n=new or(0,e),this.checkTooFewPoints(n),null!==this.validErr))return null;a=new si;n.computeSelfNodes(a,!0,!0);this.checkNoSelfIntersectingRings(n)}else if(arguments[0]instanceof d){if(o=arguments[0],this.checkInvalidCoordinates(o.getCoordinates()),null!==this.validErr)return null;n=new or(0,o);this.checkTooFewPoints(n)}else if(arguments[0]instanceof st){if((f=arguments[0],this.checkInvalidCoordinates(f),null!==this.validErr)||(this.checkClosedRings(f),null!==this.validErr)||(n=new or(0,f),this.checkTooFewPoints(n),null!==this.validErr)||(this.checkConsistentArea(n),null!==this.validErr)||!this.isSelfTouchingRingFormingHoleValid&&(this.checkNoSelfIntersectingRings(n),null!==this.validErr)||(this.checkHolesInShell(f,n),null!==this.validErr)||(this.checkHolesNotNested(f,n),null!==this.validErr))return null;this.checkConnectedInteriors(n)}else if(arguments[0]instanceof ai){for(r=arguments[0],t=0;t<r.getNumGeometries();t++)if((u=r.getGeometryN(t),this.checkInvalidCoordinates(u),null!==this.validErr)||(this.checkClosedRings(u),null!==this.validErr))return null;if((n=new or(0,r),this.checkTooFewPoints(n),null!==this.validErr)||(this.checkConsistentArea(n),null!==this.validErr)||!this.isSelfTouchingRingFormingHoleValid&&(this.checkNoSelfIntersectingRings(n),null!==this.validErr))return null;for(t=0;t<r.getNumGeometries();t++)if(u=r.getGeometryN(t),this.checkHolesInShell(u,n),null!==this.validErr)return null;for(t=0;t<r.getNumGeometries();t++)if(u=r.getGeometryN(t),this.checkHolesNotNested(u,n),null!==this.validErr)return null;if(this.checkShellsNotNested(r,n),null!==this.validErr)return null;this.checkConnectedInteriors(n)}else if(arguments[0]instanceof nt){for(s=arguments[0],t=0;t<s.getNumGeometries();t++)if(v=s.getGeometryN(t),this.checkValid(v),null!==this.validErr)return null}else if(arguments[0]instanceof h){if(i=arguments[0],this.validErr=null,i.isEmpty())return null;if(i instanceof bt)this.checkValid(i);else if(i instanceof lr)this.checkValid(i);else if(i instanceof gt)this.checkValid(i);else if(i instanceof d)this.checkValid(i);else if(i instanceof st)this.checkValid(i);else if(i instanceof ai)this.checkValid(i);else{if(!(i instanceof nt))throw new UnsupportedOperationException(i.getClass().getName());this.checkValid(i)}}},setSelfTouchingRingFormingHoleValid:function(n){this.isSelfTouchingRingFormingHoleValid=n},checkShellNotNested:function(n,t,i){var h=n.getCoordinates(),e=t.getExteriorRing(),c=e.getCoordinates(),u=ru.findPtNotNode(h,e,i),f,r,o;if(null===u||!s.isPointInRing(u,c))return null;if(t.getNumInteriorRing()<=0)return this.validErr=new tt(tt.NESTED_SHELLS,u),null;for(f=null,r=0;r<t.getNumInteriorRing();r++)if(o=t.getInteriorRingN(r),null===(f=this.checkShellInsideHole(n,o,i)))return null;this.validErr=new tt(tt.NESTED_SHELLS,f)},checkClosedRings:function(n){if(this.checkClosedRing(n.getExteriorRing()),null!==this.validErr)return null;for(var t=0;t<n.getNumInteriorRing();t++)if(this.checkClosedRing(n.getInteriorRingN(t)),null!==this.validErr)return null},checkClosedRing:function(n){if(!n.isClosed()){var t=null;n.getNumPoints()>=1&&(t=n.getCoordinateN(0));this.validErr=new tt(tt.RING_NOT_CLOSED,t)}},checkShellsNotNested:function(n,t){for(var u,i=0;i<n.getNumGeometries();i++)for(var f=n.getGeometryN(i),e=f.getExteriorRing(),r=0;r<n.getNumGeometries();r++)if(i!==r&&(u=n.getGeometryN(r),this.checkShellNotNested(e,u,t),null!==this.validErr))return null},interfaces_:function(){return[]},getClass:function(){return ru}});ru.findPtNotNode=function(n,t,i){for(var u,f=i.findEdge(t),e=f.getEdgeIntersectionList(),r=0;r<n.length;r++)if(u=n[r],!e.isIntersection(u))return u;return null};ru.isValid=function(){if(arguments[0]instanceof h)return new ru(arguments[0]).isValid();if(arguments[0]instanceof r){var n=arguments[0];return!(v.isNaN(n.x)||v.isInfinite(n.x)||v.isNaN(n.y)||v.isInfinite(n.y))}};i(du.prototype,{isIncluded:function(){return this._isIncluded},getCoordinates:function(){var n,t,i,r;if(null===this.ringPts){for(n=new ii,t=this.deList.iterator();t.hasNext();)i=t.next(),r=i.getEdge(),du.addEdge(r.getLine().getCoordinates(),i.getEdgeDirection(),n);this.ringPts=n.toCoordinateArray()}return this.ringPts},isIncludedSet:function(){return this._isIncludedSet},isValid:function(){return this.getCoordinates(),!(this.ringPts.length<=3)&&(this.getRing(),ru.isValid(this.ring))},build:function(n){var t=n;do this.add(t),t.setRing(this),t=t.getNext(),c.isTrue(null!==t,"found null DE in ring"),c.isTrue(t===n||!t.isInRing(),"found DE already in ring");while(t!==n)},isOuterHole:function(){return!!this._isHole&&!this.hasShell()},getPolygon:function(){var t=null,n;if(null!==this.holes)for(t=new Array(this.holes.size()).fill(null),n=0;n<this.holes.size();n++)t[n]=this.holes.get(n);return this.factory.createPolygon(this.ring,t)},isHole:function(){return this._isHole},isProcessed:function(){return this._isProcessed},addHole:function(){var t,n,i;arguments[0]instanceof gt?(t=arguments[0],null===this.holes&&(this.holes=new u),this.holes.add(t)):arguments[0]instanceof du&&(n=arguments[0],n.setShell(this),i=n.getRing(),null===this.holes&&(this.holes=new u),this.holes.add(i))},setIncluded:function(n){this._isIncluded=n;this._isIncludedSet=!0},getOuterHole:function(){var n,i,t;if(this.isHole())return null;for(n=0;n<this.deList.size();n++)if(i=this.deList.get(n),t=i.getSym().getRing(),t.isOuterHole())return t;return null},computeHole:function(){var n=this.getRing();this._isHole=s.isCCW(n.getCoordinates())},hasShell:function(){return null!==this.shell},isOuterShell:function(){return null!==this.getOuterHole()},getLineString:function(){return this.getCoordinates(),this.factory.createLineString(this.ringPts)},toString:function(){return pi.toLineString(new gr(this.getCoordinates()))},getShell:function(){return this.isHole()?this.shell:this},add:function(n){this.deList.add(n)},getRing:function(){if(null!==this.ring)return this.ring;this.getCoordinates();this.ringPts.length<3&&pt.out.println(this.ringPts);try{this.ring=this.factory.createLinearRing(this.ringPts)}catch(n){if(!(n instanceof ra))throw n;pt.out.println(this.ringPts)}return this.ring},updateIncluded:function(){var n,i,t;if(this.isHole())return null;for(n=0;n<this.deList.size();n++)if(i=this.deList.get(n),t=i.getSym().getRing().getShell(),null!==t&&t.isIncludedSet())return this.setIncluded(!t.isIncluded()),null},setShell:function(n){this.shell=n},setProcessed:function(n){this._isProcessed=n},interfaces_:function(){return[]},getClass:function(){return du}});du.findDirEdgesInRing=function(n){var t=n,i=new u;do i.add(t),t=t.getNext(),c.isTrue(null!==t,"found null DE in ring"),c.isTrue(t===n||!t.isInRing(),"found DE already in ring");while(t!==n);return i};du.addEdge=function(n,t,i){var r;if(t)for(r=0;r<n.length;r++)i.add(n[r],!1);else for(r=n.length-1;r>=0;r--)i.add(n[r],!1)};du.findEdgeRingContaining=function(n,t){for(var e,r=n.getRing(),o=r.getEnvelopeInternal(),h=r.getCoordinateN(0),i=null,c=null,l=t.iterator();l.hasNext();){var a=l.next(),u=a.getRing(),f=u.getEnvelopeInternal();!f.equals(o)&&f.contains(o)&&(h=w.ptNotInList(r.getCoordinates(),u.getCoordinates()),e=!1,s.isPointInRing(h,u.getCoordinates())&&(e=!0),e&&(null===i||c.contains(f))&&(i=a,c=i.getRing().getEnvelopeInternal()))}return i};i(pw.prototype,{compare:function(n,t){var i=n,r=t;return i.getRing().getEnvelope().compareTo(r.getRing().getEnvelope())},interfaces_:function(){return[ve]},getClass:function(){return pw}});du.EnvelopeComparator=pw;y(fi,eh);i(fi.prototype,{findEdgeRing:function(n){var t=new du(this.factory);return t.build(n),t},computeDepthParity:function(){if(0===arguments.length)for(;;)return null;else 1===arguments.length&&arguments[0]},computeNextCWEdges:function(){for(var t,n=this.nodeIterator();n.hasNext();)t=n.next(),fi.computeNextCWEdges(t)},addEdge:function(n){var t;if(n.isEmpty()||(t=w.removeRepeatedPoints(n.getCoordinates()),t.length<2))return null;var f=t[0],e=t[t.length-1],i=this.getNode(f),r=this.getNode(e),o=new el(i,r,t[1],!0),s=new el(r,i,t[t.length-2],!1),u=new ny(n);u.setDirectedEdges(o,s);this.add(u)},deleteCutEdges:function(){var t,i,n,r,f;for(this.computeNextCWEdges(),fi.findLabeledEdgeRings(this.dirEdges),t=new u,i=this.dirEdges.iterator();i.hasNext();)n=i.next(),n.isMarked()||(r=n.getSym(),n.getLabel()===r.getLabel()&&(n.setMarked(!0),r.setMarked(!0),f=n.getEdge(),t.add(f.getLine())));return t},getEdgeRings:function(){var r,t,i,n,f;for(this.computeNextCWEdges(),fi.label(this.dirEdges,-1),r=fi.findLabeledEdgeRings(this.dirEdges),this.convertMaximalToMinimalEdgeRings(r),t=new u,i=this.dirEdges.iterator();i.hasNext();)n=i.next(),n.isMarked()||n.isInRing()||(f=this.findEdgeRing(n),t.add(f));return t},getNode:function(n){var t=this.findNode(n);return null===t&&(t=new fe(n),this.add(t)),t},convertMaximalToMinimalEdgeRings:function(n){for(var i,e,t=n.iterator();t.hasNext();){var r=t.next(),u=r.getLabel(),f=fi.findIntersectionNodes(r,u);if(null!==f)for(i=f.iterator();i.hasNext();)e=i.next(),fi.computeNextCCWEdges(e,u)}},deleteDangles:function(){for(var r,o,t,u,s,f,h=this.findNodesOfDegree(1),e=new li,i=new gi,n=h.iterator();n.hasNext();)i.push(n.next());for(;!i.isEmpty();)for(r=i.pop(),fi.deleteAllEdges(r),o=r.getOutEdges().getEdges(),n=o.iterator();n.hasNext();)t=n.next(),t.setMarked(!0),u=t.getSym(),null!==u&&u.setMarked(!0),s=t.getEdge(),e.add(s.getLine()),f=t.getToNode(),1===fi.getDegreeNonDeleted(f)&&i.push(f);return e},interfaces_:function(){return[]},getClass:function(){return fi}});fi.findLabeledEdgeRings=function(n){for(var t,e,i=new u,r=1,f=n.iterator();f.hasNext();)t=f.next(),t.isMarked()||t.getLabel()>=0||(i.add(t),e=du.findDirEdgesInRing(t),fi.label(e,r),r++);return i};fi.getDegreeNonDeleted=function(n){for(var r=n.getOutEdges().getEdges(),t=0,i=r.iterator();i.hasNext();)i.next().isMarked()||t++;return t};fi.deleteAllEdges=function(n){for(var i,r,u=n.getOutEdges().getEdges(),t=u.iterator();t.hasNext();)i=t.next(),i.setMarked(!0),r=i.getSym(),null!==r&&r.setMarked(!0)};fi.label=function(n,t){for(var i=n.iterator();i.hasNext();)i.next().setLabel(t)};fi.computeNextCWEdges=function(n){for(var i,r,e=n.getOutEdges(),u=null,t=null,f=e.getEdges().iterator();f.hasNext();)i=f.next(),i.isMarked()||((null===u&&(u=i),null!==t)&&(r=t.getSym(),r.setNext(i)),t=i);null!==t&&(r=t.getSym(),r.setNext(u))};fi.computeNextCCWEdges=function(n,t){for(var u,l=n.getOutEdges(),f=null,i=null,s=l.getEdges(),e=s.size()-1;e>=0;e--){var o=s.get(e),h=o.getSym(),r=null;o.getLabel()===t&&(r=o);u=null;h.getLabel()===t&&(u=h);null===r&&null===u||(null!==u&&(i=u),null!==r&&(null!==i&&(i.setNext(r),i=null),null===f&&(f=r)))}null!==i&&(c.isTrue(null!==f),i.setNext(f))};fi.getDegree=function(n,t){for(var u=n.getOutEdges().getEdges(),i=0,r=u.iterator();r.hasNext();)r.next().getLabel()===t&&i++;return i};fi.findIntersectionNodes=function(n,t){var i=n,r=null,f;do f=i.getFromNode(),fi.getDegree(f,t)>1&&(null===r&&(r=new u),r.add(f)),i=i.getNext(),c.isTrue(null!==i,"found null DE in ring"),c.isTrue(i===n||!i.isInRing(),"found DE already in ring");while(i!==n);return r};i(wr.prototype,{getGeometry:function(){return null===this.geomFactory&&(this.geomFactory=new g),this.polygonize(),this.extractOnlyPolygonal?this.geomFactory.buildGeometry(this.polyList):this.geomFactory.createGeometryCollection(g.toGeometryArray(this.polyList))},getInvalidRingLines:function(){return this.polygonize(),this.invalidRingLines},findValidRings:function(n,t,i){for(var r,u=n.iterator();u.hasNext();)r=u.next(),r.isValid()?t.add(r):i.add(r.getLineString())},polygonize:function(){var t,n,i;if(null!==this.polyList||(this.polyList=new u,null===this.graph))return null;this.dangles=this.graph.deleteDangles();this.cutEdges=this.graph.deleteCutEdges();t=this.graph.getEdgeRings();n=new u;this.invalidRingLines=new u;this.isCheckingRingsValid?this.findValidRings(t,n,this.invalidRingLines):n=t;this.findShellsAndHoles(n);wr.assignHolesToShells(this.holeList,this.shellList);gu.sort(this.shellList,new du.EnvelopeComparator);i=!0;this.extractOnlyPolygonal&&(wr.findDisjointShells(this.shellList),i=!1);this.polyList=wr.extractPolygons(this.shellList,i)},getDangles:function(){return this.polygonize(),this.dangles},getCutEdges:function(){return this.polygonize(),this.cutEdges},getPolygons:function(){return this.polygonize(),this.polyList},add:function(){var i,n,r,t,u;if(l(arguments[0],yt))for(i=arguments[0],n=i.iterator();n.hasNext();)r=n.next(),this.add(r);else arguments[0]instanceof d?(t=arguments[0],this.geomFactory=t.getFactory(),null===this.graph&&(this.graph=new fi(this.geomFactory)),this.graph.addEdge(t)):arguments[0]instanceof h&&(u=arguments[0],u.apply(this.lineStringAdder))},setCheckRingsValid:function(n){this.isCheckingRingsValid=n},findShellsAndHoles:function(n){var i,t;for(this.holeList=new u,this.shellList=new u,i=n.iterator();i.hasNext();)t=i.next(),t.computeHole(),t.isHole()?this.holeList.add(t):this.shellList.add(t)},interfaces_:function(){return[]},getClass:function(){return wr}});wr.findOuterShells=function(n){for(var r,t,i=n.iterator();i.hasNext();)r=i.next(),t=r.getOuterHole(),null===t||t.isProcessed()||(r.setIncluded(!0),t.setProcessed(!0))};wr.extractPolygons=function(n,t){for(var f,i=new u,r=n.iterator();r.hasNext();)f=r.next(),(t||f.isIncluded())&&i.add(f.getPolygon());return i};wr.assignHolesToShells=function(n,t){for(var r,i=n.iterator();i.hasNext();)r=i.next(),wr.assignHoleToShell(r,t)};wr.assignHoleToShell=function(n,t){var i=du.findEdgeRingContaining(n,t);null!==i&&i.addHole(n)};wr.findDisjointShells=function(n){var t,r,i;wr.findOuterShells(n);t=null;do for(t=!1,r=n.iterator();r.hasNext();)i=r.next(),i.isIncludedSet()||(i.updateIncluded(),i.isIncludedSet()||(t=!0));while(t)};i(fy.prototype,{filter:function(n){n instanceof d&&this.p.add(n)},interfaces_:function(){return[yu]},getClass:function(){return fy}});wr.LineStringAdder=fy;gb=Object.freeze({Polygonizer:wr});i(ey.prototype,{insertEdgeEnds:function(n){for(var i,t=n.iterator();t.hasNext();)i=t.next(),this.nodes.add(i)},computeProperIntersectionIM:function(n,t){var i=this.arg[0].getGeometry().getDimension(),r=this.arg[1].getGeometry().getDimension(),u=n.hasProperIntersection(),f=n.hasProperInteriorIntersection();2===i&&2===r?u&&t.setAtLeast("212101212"):2===i&&1===r?(u&&t.setAtLeast("FFF0FFFF2"),f&&t.setAtLeast("1FFFFF1FF")):1===i&&2===r?(u&&t.setAtLeast("F0FFFFFF2"),f&&t.setAtLeast("1F1FFFFFF")):1===i&&1===r&&f&&t.setAtLeast("0FFFFFFFF")},labelIsolatedEdges:function(n,t){for(var i,r=this.arg[n].getEdgeIterator();r.hasNext();)i=r.next(),i.isIsolated()&&(this.labelIsolatedEdge(i,t,this.arg[t].getGeometry()),this.isolatedEdges.add(i))},labelIsolatedEdge:function(n,i,r){if(r.getDimension()>0){var u=this.ptLocator.locate(n.getCoordinate(),r);n.getLabel().setAllLocations(i,u)}else n.getLabel().setAllLocations(i,t.EXTERIOR)},computeIM:function(){var n=new ot,r,i,u,f;return(n.set(t.EXTERIOR,t.EXTERIOR,2),!this.arg[0].getGeometry().getEnvelopeInternal().intersects(this.arg[1].getGeometry().getEnvelopeInternal()))?(this.computeDisjointIM(n),n):(this.arg[0].computeSelfNodes(this.li,!1),this.arg[1].computeSelfNodes(this.li,!1),r=this.arg[0].computeEdgeIntersections(this.arg[1],this.li,!1),this.computeIntersectionNodes(0),this.computeIntersectionNodes(1),this.copyNodesAndLabels(0),this.copyNodesAndLabels(1),this.labelIsolatedNodes(),this.computeProperIntersectionIM(r,n),i=new ty,u=i.computeEdgeEnds(this.arg[0].getEdgeIterator()),this.insertEdgeEnds(u),f=i.computeEdgeEnds(this.arg[1].getEdgeIterator()),this.insertEdgeEnds(f),this.labelNodeEdges(),this.labelIsolatedEdges(0,1),this.labelIsolatedEdges(1,0),this.updateIM(n),n)},labelNodeEdges:function(){for(var n=this.nodes.iterator();n.hasNext();)n.next().getEdges().computeLabelling(this.arg)},copyNodesAndLabels:function(n){for(var i,t=this.arg[n].getNodeIterator();t.hasNext();)i=t.next(),this.nodes.addNode(i.getCoordinate()).setLabel(n,i.getLabel().getLocation(n))},labelIntersectionNodes:function(n){for(var e,i,r=this.arg[n].getEdgeIterator();r.hasNext();)for(var u=r.next(),o=u.getLabel().getLocation(n),f=u.getEdgeIntersectionList().iterator();f.hasNext();)e=f.next(),i=this.nodes.find(e.coord),i.getLabel().isNull(n)&&(o===t.BOUNDARY?i.setLabelBoundary(n):i.setLabel(n,t.INTERIOR))},labelIsolatedNode:function(n,t){var i=this.ptLocator.locate(n.getCoordinate(),this.arg[t].getGeometry());n.getLabel().setAllLocations(t,i)},computeIntersectionNodes:function(n){for(var e,i,r=this.arg[n].getEdgeIterator();r.hasNext();)for(var u=r.next(),o=u.getLabel().getLocation(n),f=u.getEdgeIntersectionList().iterator();f.hasNext();)e=f.next(),i=this.nodes.addNode(e.coord),o===t.BOUNDARY?i.setLabelBoundary(n):i.getLabel().isNull(n)&&i.setLabel(n,t.INTERIOR)},labelIsolatedNodes:function(){for(var n,i,t=this.nodes.iterator();t.hasNext();)n=t.next(),i=n.getLabel(),c.isTrue(i.getGeometryCount()>0,"node with empty label found"),n.isIsolated()&&(i.isNull(0)?this.labelIsolatedNode(n,0):this.labelIsolatedNode(n,1))},updateIM:function(n){for(var i,r,t=this.isolatedEdges.iterator();t.hasNext();)t.next().updateIM(n);for(i=this.nodes.iterator();i.hasNext();)r=i.next(),r.updateIM(n),r.updateIMFromEdges(n)},computeDisjointIM:function(n){var r=this.arg[0].getGeometry(),i;r.isEmpty()||(n.set(t.INTERIOR,t.EXTERIOR,r.getDimension()),n.set(t.BOUNDARY,t.EXTERIOR,r.getBoundaryDimension()));i=this.arg[1].getGeometry();i.isEmpty()||(n.set(t.EXTERIOR,t.INTERIOR,i.getDimension()),n.set(t.EXTERIOR,t.BOUNDARY,i.getBoundaryDimension()))},interfaces_:function(){return[]},getClass:function(){return ey}});i(ll.prototype,{isContainedInBoundary:function(n){var t,i;if(n instanceof st)return!1;if(n instanceof bt)return this.isPointContainedInBoundary(n);if(n instanceof d)return this.isLineStringContainedInBoundary(n);for(t=0;t<n.getNumGeometries();t++)if(i=n.getGeometryN(t),!this.isContainedInBoundary(i))return!1;return!0},isLineSegmentContainedInBoundary:function(n,t){if(n.equals(t))return this.isPointContainedInBoundary(n);if(n.x===t.x){if(n.x===this.rectEnv.getMinX()||n.x===this.rectEnv.getMaxX())return!0}else if(n.y===t.y&&(n.y===this.rectEnv.getMinY()||n.y===this.rectEnv.getMaxY()))return!0;return!1},isLineStringContainedInBoundary:function(n){for(var i=n.getCoordinateSequence(),u=new r,f=new r,t=0;t<i.size()-1;t++)if(i.getCoordinate(t,u),i.getCoordinate(t+1,f),!this.isLineSegmentContainedInBoundary(u,f))return!1;return!0},isPointContainedInBoundary:function(){var t,n;return arguments[0]instanceof bt?(t=arguments[0],this.isPointContainedInBoundary(t.getCoordinate())):arguments[0]instanceof r?(n=arguments[0],n.x===this.rectEnv.getMinX()||n.x===this.rectEnv.getMaxX()||n.y===this.rectEnv.getMinY()||n.y===this.rectEnv.getMaxY()):void 0},contains:function(n){return!!this.rectEnv.contains(n.getEnvelopeInternal())&&!this.isContainedInBoundary(n)},interfaces_:function(){return[]},getClass:function(){return ll}});ll.contains=function(n,t){return new ll(n).contains(t)};i(ww.prototype,{intersects:function(n,t){var u=new p(n,t),r,i;return this.rectEnv.intersects(u)?this.rectEnv.intersects(n)?!0:this.rectEnv.intersects(t)?!0:(n.compareTo(t)>0&&(r=n,n=t,t=r),i=!1,t.y>n.y&&(i=!0),i?this.li.computeIntersection(n,t,this.diagDown0,this.diagDown1):this.li.computeIntersection(n,t,this.diagUp0,this.diagUp1),!!this.li.hasIntersection()):!1},interfaces_:function(){return[]},getClass:function(){return ww}});i(eo.prototype,{applyTo:function(n){for(var i,t=0;t<n.getNumGeometries()&&!this._isDone;t++)if(i=n.getGeometryN(t),i instanceof nt)this.applyTo(i);else if(this.visit(i),this.isDone())return this._isDone=!0,null},interfaces_:function(){return[]},getClass:function(){return eo}});i(oh.prototype,{intersects:function(n){var t,i,r;return this.rectEnv.intersects(n.getEnvelopeInternal())?(t=new oy(this.rectEnv),t.applyTo(n),t.intersects())?!0:(i=new sy(this.rectangle),i.applyTo(n),i.containsPoint())?!0:(r=new hy(this.rectangle),r.applyTo(n),!!r.intersects()):!1},interfaces_:function(){return[]},getClass:function(){return oh}});oh.intersects=function(n,t){return new oh(n).intersects(t)};y(oy,eo);i(oy.prototype,{isDone:function(){return!0===this._intersects},visit:function(n){var t=n.getEnvelopeInternal();return this.rectEnv.intersects(t)?this.rectEnv.contains(t)?(this._intersects=!0,null):t.getMinX()>=this.rectEnv.getMinX()&&t.getMaxX()<=this.rectEnv.getMaxX()?(this._intersects=!0,null):t.getMinY()>=this.rectEnv.getMinY()&&t.getMaxY()<=this.rectEnv.getMaxY()?(this._intersects=!0,null):void 0:null},intersects:function(){return this._intersects},interfaces_:function(){return[]},getClass:function(){return oy}});y(sy,eo);i(sy.prototype,{isDone:function(){return!0===this._containsPoint},visit:function(n){var u,t,i;if(!(n instanceof st)||(u=n.getEnvelopeInternal(),!this.rectEnv.intersects(u)))return null;for(t=new r,i=0;i<4;i++)if(this.rectSeq.getCoordinate(i,t),u.contains(t)&&tu.containsPointInPolygon(t,n))return this._containsPoint=!0,null},containsPoint:function(){return this._containsPoint},interfaces_:function(){return[]},getClass:function(){return sy}});y(hy,eo);i(hy.prototype,{intersects:function(){return this.hasIntersection},isDone:function(){return!0===this.hasIntersection},visit:function(n){var i=n.getEnvelopeInternal(),t;if(!this.rectEnv.intersects(i))return null;t=wi.getLines(n);this.checkIntersectionWithLineStrings(t)},checkIntersectionWithLineStrings:function(n){for(var i,t=n.iterator();t.hasNext();)if(i=t.next(),this.checkIntersectionWithSegments(i),this.hasIntersection)return null},checkIntersectionWithSegments:function(n){for(var i=n.getCoordinateSequence(),t=1;t<i.size();t++)if(i.getCoordinate(t-1,this.p0),i.getCoordinate(t,this.p1),this.rectIntersector.intersects(this.p0,this.p1))return this.hasIntersection=!0,null},interfaces_:function(){return[]},getClass:function(){return hy}});y(ut,ge);i(ut.prototype,{getIntersectionMatrix:function(){return this._relate.computeIM()},interfaces_:function(){return[]},getClass:function(){return ut}});ut.covers=function(n,t){return!!n.getEnvelopeInternal().covers(t.getEnvelopeInternal())&&(!!n.isRectangle()||ut.relate(n,t).isCovers())};ut.intersects=function(n,t){return!!n.getEnvelopeInternal().intersects(t.getEnvelopeInternal())&&(n.isRectangle()?oh.intersects(n,t):t.isRectangle()?oh.intersects(t,n):ut.relate(n,t).isIntersects())};ut.touches=function(n,t){return!!n.getEnvelopeInternal().intersects(t.getEnvelopeInternal())&&ut.relate(n,t).isTouches(n.getDimension(),t.getDimension())};ut.within=function(n,t){return t.contains(n)};ut.coveredBy=function(n,t){return ut.covers(t,n)};ut.relate=function(){if(2===arguments.length){var i=arguments[0],r=arguments[1],n=new ut(i,r),t=n.getIntersectionMatrix();return t}if(3===arguments.length){if("string"==typeof arguments[2]&&arguments[0]instanceof h&&arguments[1]instanceof h){var u=arguments[0],f=arguments[1],e=arguments[2];return ut.relateWithCheck(u,f).matches(e)}if(l(arguments[2],oi)&&arguments[0]instanceof h&&arguments[1]instanceof h){var o=arguments[0],s=arguments[1],c=arguments[2],n=new ut(o,s,c),t=n.getIntersectionMatrix();return t}}};ut.overlaps=function(n,t){return!!n.getEnvelopeInternal().intersects(t.getEnvelopeInternal())&&ut.relate(n,t).isOverlaps(n.getDimension(),t.getDimension())};ut.disjoint=function(n,t){return!n.intersects(t)};ut.relateWithCheck=function(n,t){return n.checkNotGeometryCollection(n),n.checkNotGeometryCollection(t),ut.relate(n,t)};ut.crosses=function(n,t){return!!n.getEnvelopeInternal().intersects(t.getEnvelopeInternal())&&ut.relate(n,t).isCrosses(n.getDimension(),t.getDimension())};ut.contains=function(n,t){return!!n.getEnvelopeInternal().contains(t.getEnvelopeInternal())&&(n.isRectangle()?ll.contains(n,t):ut.relate(n,t).isContains())};nk=Object.freeze({RelateOp:ut});i(uu.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)},combine:function(){for(var i,n=new u,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)},interfaces_:function(){return[]},getClass:function(){return uu}});uu.combine=function(){var t,n;if(1===arguments.length)return t=arguments[0],n=new uu(t),n.combine();if(2===arguments.length){var i=arguments[0],r=arguments[1],n=new uu(uu.createList(i,r));return n.combine()}if(3===arguments.length){var u=arguments[0],f=arguments[1],e=arguments[2],n=new uu(uu.createList(u,f,e));return n.combine()}};uu.extractFactory=function(n){return n.isEmpty()?null:n.iterator().next().getFactory()};uu.createList=function(){if(2===arguments.length){var t=arguments[0],i=arguments[1],n=new u;return n.add(t),n.add(i),n}if(3===arguments.length){var r=arguments[0],f=arguments[1],e=arguments[2],n=new u;return n.add(r),n.add(f),n.add(e),n}};i(al.prototype,{union:function(){for(var e,u,f,n,o=new bo,i=new di,r=0;r<this.pointGeom.getNumGeometries();r++)e=this.pointGeom.getGeometryN(r),u=e.getCoordinate(),o.locate(u,this.otherGeom)===t.EXTERIOR&&i.add(u);return 0===i.size()?this.otherGeom:(f=null,n=w.toCoordinateArray(i),f=1===n.length?this.geomFact.createPoint(n[0]):this.geomFact.createMultiPointFromCoords(n),uu.combine(f,this.otherGeom))},interfaces_:function(){return[]},getClass:function(){return al}});al.union=function(n,t){return new al(n,t).union()};i(oo.prototype,{filter:function(n){-1!==this.sortIndex&&n.getSortIndex()!==this.sortIndex||this.comps.add(n)},interfaces_:function(){return[wf]},getClass:function(){return oo}});oo.extract=function(){var i,r;if(2===arguments.length)return i=arguments[0],r=arguments[1],oo.extract(i,r,new u);if(3===arguments.length){var n=arguments[0],f=arguments[1],t=arguments[2];return n.getSortIndex()===f?t.add(n):n instanceof nt&&n.apply(new oo(f,t)),t}};i(cu.prototype,{reduceToGeometries:function(n){for(var t,i,r=new u,f=n.iterator();f.hasNext();)t=f.next(),i=null,l(t,ei)?i=this.unionTree(t):t instanceof h&&(i=t),r.add(i);return r},extractByEnvelope:function(n,t,i){for(var f,e=new u,r=0;r<t.getNumGeometries();r++)f=t.getGeometryN(r),f.getEnvelopeInternal().intersects(n)?e.add(f):i.add(f);return this.geomFactory.buildGeometry(e)},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)):uu.combine(n,t)},union:function(){var n,t,i,r;if(null===this.inputPolys)throw new IllegalStateException("union() method cannot be called twice");if(this.inputPolys.isEmpty())return null;for(this.geomFactory=this.inputPolys.iterator().next().getFactory(),n=new kt(cu.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)},binaryUnion:function(){var u,r;if(1===arguments.length)return u=arguments[0],this.binaryUnion(u,0,u.size());if(3===arguments.length){var t=arguments[0],n=arguments[1],i=arguments[2];if(i-n<=1)return r=cu.getGeometry(t,n),this.unionSafe(r,null);if(i-n==2)return this.unionSafe(cu.getGeometry(t,n),cu.getGeometry(t,n+1));var f=Math.trunc((i+n)/2),r=this.binaryUnion(t,n,f),e=this.binaryUnion(t,f,i);return this.unionSafe(r,e)}},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},unionSafe:function(n,t){return null===n&&null===t?null:null===n?t.copy():null===t?n.copy():this.unionOptimized(n,t)},unionActual:function(n,t){return cu.restrictToPolygons(n.union(t))},unionTree:function(n){var t=this.reduceToGeometries(n);return this.binaryUnion(t)},unionUsingEnvelopeIntersection:function(n,t,i){var r=new u,f=this.extractByEnvelope(i,n,r),e=this.extractByEnvelope(i,t,r),o=this.unionActual(f,e);return r.add(o),uu.combine(r)},bufferUnion:function(){if(1===arguments.length){var r=arguments[0],n=r.get(0).getFactory(),t=n.buildGeometry(r),i=t.buffer(0);return i}if(2===arguments.length){var u=arguments[0],f=arguments[1],n=u.getFactory(),t=n.createGeometryCollection([u,f]),i=t.buffer(0);return i}},interfaces_:function(){return[]},getClass:function(){return cu}});cu.restrictToPolygons=function(n){if(l(n,bf))return n;var t=fs.getPolygons(n);return 1===t.size()?t.get(0):n.getFactory().createMultiPolygon(g.toPolygonArray(t))};cu.getGeometry=function(n,t){return t>=n.size()?null:n.get(t)};cu.union=function(n){return new cu(n).union()};cu.STRTREE_NODE_CAPACITY=4;i(so.prototype,{unionNoOpt:function(n){var t=this.geomFact.createPoint();return hi.overlayOp(n,t,a.UNION)},unionWithNull:function(n,t){return null===n&&null===t?null:null===t?n:null===n?t:n.union(t)},extract:function(){var i,t,r,n;if(l(arguments[0],yt))for(i=arguments[0],t=i.iterator();t.hasNext();)r=t.next(),this.extract(r);else arguments[0]instanceof h&&(n=arguments[0],null===this.geomFact&&(this.geomFact=n.getFactory()),oo.extract(n,h.SORTINDEX_POLYGON,this.polygons),oo.extract(n,h.SORTINDEX_LINESTRING,this.lines),oo.extract(n,h.SORTINDEX_POINT,this.points))},union:function(){var n,f,r,e,u,t,i;return null===this.geomFact?null:(n=null,this.points.size()>0&&(f=this.geomFact.buildGeometry(this.points),n=this.unionNoOpt(f)),r=null,this.lines.size()>0&&(e=this.geomFact.buildGeometry(this.lines),r=this.unionNoOpt(e)),u=null,this.polygons.size()>0&&(u=cu.union(this.polygons)),t=this.unionWithNull(r,u),i=null,i=null===n?t:null===t?n:al.union(n,t),null===i?this.geomFact.createGeometryCollection():i)},interfaces_:function(){return[]},getClass:function(){return so}});so.union=function(){var t,i,n;if(1===arguments.length){if(l(arguments[0],yt))return t=arguments[0],n=new so(t),n.union();if(arguments[0]instanceof h)return i=arguments[0],n=new so(i),n.union()}else if(2===arguments.length){var r=arguments[0],u=arguments[1],n=new so(r,u);return n.union()}};var ad=Object.freeze({UnaryUnionOp:so}),vd=Object.freeze({IsValidOp:ru,ConsistentAreaTester:uy}),yd=Object.freeze({BoundaryOp:ee,IsSimpleOp:dc,buffer:wb,distance:bb,linemerge:kb,overlay:db,polygonize:gb,relate:nk,union:ad,valid:vd});y(cy,dr.CoordinateOperation);i(cy.prototype,{editCoordinates:function(n,t){var u,i,f,o;if(0===n.length)return null;for(u=new Array(n.length).fill(null),i=0;i<n.length;i++)f=new r(n[i]),this.targetPM.makePrecise(f),u[i]=f;var h=new ii(u,!1),s=h.toCoordinateArray(),e=0;return t instanceof d&&(e=2),t instanceof gt&&(e=4),o=u,this.removeCollapsed&&(o=null),s.length<e?o:s},interfaces_:function(){return[]},getClass:function(){return cy}});i(os.prototype,{fixPolygonalTopology:function(n){var r=n,t,i;return this.changePrecisionModel||(r=this.changePM(n,this.targetPM)),t=r.buffer(0),i=t,this.changePrecisionModel||(i=this.changePM(t,n.getPrecisionModel())),i},reducePointwise:function(n){var i=null,t;return i=this.changePrecisionModel?new dr(this.createFactory(n.getFactory(),this.targetPM)):new dr,t=this.removeCollapsed,n.getDimension()>=2&&(t=!0),i.edit(n,new cy(this.targetPM,t))},changePM:function(n,t){return this.createEditor(n.getFactory(),t).edit(n,new dr.NoOpGeometryOperation)},setRemoveCollapsedComponents:function(n){this.removeCollapsed=n},createFactory:function(n,t){return new g(t,n.getSRID(),n.getCoordinateSequenceFactory())},setChangePrecisionModel:function(n){this.changePrecisionModel=n},reduce:function(n){var t=this.reducePointwise(n);return this.isPointwise?t:l(t,bf)?t.isValid()?t:this.fixPolygonalTopology(t):t},setPointwise:function(n){this.isPointwise=n},createEditor:function(n,t){return n.getPrecisionModel()===t?new dr:new dr(this.createFactory(n,t))},interfaces_:function(){return[]},getClass:function(){return os}});os.reduce=function(n,t){return new os(t).reduce(n)};os.reducePointwise=function(n,t){var i=new os(t);return i.setPointwise(!0),i.reduce(n)};tk=Object.freeze({GeometryPrecisionReducer:os});i(vl.prototype,{simplifySection:function(n,t){var f,i;if(n+1===t)return null;this.seg.p0=this.pts[n];this.seg.p1=this.pts[t];for(var r=-1,u=n,i=n+1;i<t;i++)f=this.seg.distance(this.pts[i]),f>r&&(r=f,u=i);if(r<=this.distanceTolerance)for(i=n+1;i<t;i++)this.usePt[i]=!1;else this.simplifySection(n,u),this.simplifySection(u,t)},setDistanceTolerance:function(n){this.distanceTolerance=n},simplify:function(){var t,n;for(this.usePt=new Array(this.pts.length).fill(null),n=0;n<this.pts.length;n++)this.usePt[n]=!0;for(this.simplifySection(0,this.pts.length-1),t=new ii,n=0;n<this.pts.length;n++)this.usePt[n]&&t.add(new r(this.pts[n]));return t.toCoordinateArray()},interfaces_:function(){return[]},getClass:function(){return vl}});vl.simplify=function(n,t){var i=new vl(n);return i.setDistanceTolerance(t),i.simplify()};i(sh.prototype,{setEnsureValid:function(n){this.isEnsureValidTopology=n},getResultGeometry:function(){return this.inputGeom.isEmpty()?this.inputGeom.copy():new yl(this.isEnsureValidTopology,this.distanceTolerance).transform(this.inputGeom)},setDistanceTolerance:function(n){if(n<0)throw new ct("Tolerance must be non-negative");this.distanceTolerance=n},interfaces_:function(){return[]},getClass:function(){return sh}});sh.simplify=function(n,t){var i=new sh(n);return i.setDistanceTolerance(t),i.getResultGeometry()};y(yl,ur);i(yl.prototype,{transformPolygon:function(n,t){if(n.isEmpty())return null;var i=ur.prototype.transformPolygon.call(this,n,t);return t instanceof ai?i:this.createValidArea(i)},createValidArea:function(n){return this.isEnsureValidTopology?n.buffer(0):n},transformCoordinates:function(n){var t=n.toCoordinateArray(),i=null;return i=0===t.length?new Array(0).fill(null):vl.simplify(t,this.distanceTolerance),this.factory.getCoordinateSequenceFactory().create(i)},transformMultiPolygon:function(n,t){var i=ur.prototype.transformMultiPolygon.call(this,n,t);return this.createValidArea(i)},transformLinearRing:function(n,t){var r=t instanceof st,i=ur.prototype.transformLinearRing.call(this,n,t);return!r||i instanceof gt?i:null},interfaces_:function(){return[]},getClass:function(){return yl}});sh.DPTransformer=yl;y(pl,b);i(pl.prototype,{getIndex:function(){return this.index},getParent:function(){return this.parent},interfaces_:function(){return[]},getClass:function(){return pl}});i(ae.prototype,{addToResult:function(n){this.resultSegs.add(n)},asLineString:function(){return this.parentLine.getFactory().createLineString(ae.extractCoordinates(this.resultSegs))},getResultSize:function(){var n=this.resultSegs.size();return 0===n?0:n+1},getParent:function(){return this.parentLine},getSegment:function(n){return this.segs[n]},getParentCoordinates:function(){return this.parentLine.getCoordinates()},getMinimumSize:function(){return this.minimumSize},asLinearRing:function(){return this.parentLine.getFactory().createLinearRing(ae.extractCoordinates(this.resultSegs))},getSegments:function(){return this.segs},init:function(){var t=this.parentLine.getCoordinates(),n,i;for(this.segs=new Array(t.length-1).fill(null),n=0;n<t.length-1;n++)i=new pl(t[n],t[n+1],this.parentLine,n),this.segs[n]=i},getResultCoordinates:function(){return ae.extractCoordinates(this.resultSegs)},interfaces_:function(){return[]},getClass:function(){return ae}});ae.extractCoordinates=function(n){for(var t=new Array(n.size()+1).fill(null),r=null,i=0;i<n.size();i++)r=n.get(i),t[i]=r.p0;return t[t.length-1]=r.p1,t};i(hh.prototype,{remove:function(n){this.index.remove(new p(n.p0,n.p1),n)},add:function(){var r,n;if(arguments[0]instanceof ae)for(var u=arguments[0],i=u.getSegments(),t=0;t<i.length;t++)r=i[t],this.add(r);else arguments[0]instanceof b&&(n=arguments[0],this.index.insert(new p(n.p0,n.p1),n))},query:function(n){var i=new p(n.p0,n.p1),t=new bw(n);return this.index.query(i,t),t.getItems()},interfaces_:function(){return[]},getClass:function(){return hh}});i(bw.prototype,{visitItem:function(n){var t=n;p.intersects(t.p0,t.p1,this.querySeg.p0,this.querySeg.p1)&&this.items.add(n)},getItems:function(){return this.items},interfaces_:function(){return[we]},getClass:function(){return bw}});i(wl.prototype,{flatten:function(n,t){var r=this.linePts[n],u=this.linePts[t],i=new b(r,u);return this.remove(this.line,n,t),this.outputIndex.add(i),i},hasBadIntersection:function(n,t,i){return!!this.hasBadOutputIntersection(i)||!!this.hasBadInputIntersection(n,t,i)},setDistanceTolerance:function(n){this.distanceTolerance=n},simplifySection:function(n,t,i){var f,u,o,s,e,r;if(i+=1,f=new Array(2).fill(null),n+1===t)return r=this.line.getSegment(n),this.line.addToResult(r),null;if(u=!0,this.line.getResultSize()<this.line.getMinimumSize()&&i+1<this.line.getMinimumSize()&&(u=!1),o=new Array(1).fill(null),s=this.findFurthestPoint(this.linePts,n,t,o),o[0]>this.distanceTolerance&&(u=!1),e=new b,e.p0=this.linePts[n],e.p1=this.linePts[t],f[0]=n,f[1]=t,this.hasBadIntersection(this.line,f,e)&&(u=!1),u)return r=this.flatten(n,t),this.line.addToResult(r),null;this.simplifySection(n,s,i);this.simplifySection(s,t,i)},hasBadOutputIntersection:function(n){for(var r,i=this.outputIndex.query(n),t=i.iterator();t.hasNext();)if(r=t.next(),this.hasInteriorIntersection(r,n))return!0;return!1},findFurthestPoint:function(n,t,i,r){var f=new b,h,o;f.p0=n[t];f.p1=n[i];for(var e=-1,s=t,u=t+1;u<i;u++)h=n[u],o=f.distance(h),o>e&&(e=o,s=u);return r[0]=e,s},simplify:function(n){this.line=n;this.linePts=n.getParentCoordinates();this.simplifySection(0,this.linePts.length-1,0)},remove:function(n,t,i){for(var u,r=t;r<i;r++)u=n.getSegment(r),this.inputIndex.remove(u)},hasInteriorIntersection:function(n,t){return this.li.computeIntersection(n.p0,n.p1,t.p0,t.p1),this.li.isInteriorIntersection()},hasBadInputIntersection:function(n,t,i){for(var u,f=this.inputIndex.query(i),r=f.iterator();r.hasNext();)if(u=r.next(),this.hasInteriorIntersection(u,i)){if(wl.isInLineSection(n,t,u))continue;return!0}return!1},interfaces_:function(){return[]},getClass:function(){return wl}});wl.isInLineSection=function(n,t,i){if(i.getParent()!==n.getParent())return!1;var r=i.getIndex();return r>=t[0]&&r<t[1]};i(kw.prototype,{setDistanceTolerance:function(n){this.distanceTolerance=n},simplify:function(n){for(var i,t=n.iterator();t.hasNext();)this.inputIndex.add(t.next());for(t=n.iterator();t.hasNext();)i=new wl(this.inputIndex,this.outputIndex),i.setDistanceTolerance(this.distanceTolerance),i.simplify(t.next())},interfaces_:function(){return[]},getClass:function(){return kw}});i(ss.prototype,{getResultGeometry:function(){return this.inputGeom.isEmpty()?this.inputGeom.copy():(this.linestringMap=new kf,this.inputGeom.apply(new ly(this)),this.lineSimplifier.simplify(this.linestringMap.values()),new bl(this.linestringMap).transform(this.inputGeom))},setDistanceTolerance:function(n){if(n<0)throw new ct("Tolerance must be non-negative");this.lineSimplifier.setDistanceTolerance(n)},interfaces_:function(){return[]},getClass:function(){return ss}});ss.simplify=function(n,t){var i=new ss(n);return i.setDistanceTolerance(t),i.getResultGeometry()};y(bl,ur);i(bl.prototype,{transformCoordinates:function(n,t){if(0===n.size())return null;if(t instanceof d){var i=this.linestringMap.get(t);return this.createCoordinateSequence(i.getResultCoordinates())}return ur.prototype.transformCoordinates.call(this,n,t)},interfaces_:function(){return[]},getClass:function(){return bl}});i(ly.prototype,{filter:function(n){var t,i,r;if(n instanceof d){if(t=n,t.isEmpty())return null;i=t.isClosed()?4:2;r=new ae(t,i);this.tps.linestringMap.put(t,r)}},interfaces_:function(){return[yu]},getClass:function(){return ly}});ss.LineStringTransformer=bl;ss.LineStringMapBuilderFilter=ly;ik=Object.freeze({DouglasPeuckerSimplifier:sh,TopologyPreservingSimplifier:ss});i(ch.prototype,{splitAt:function(){var n,t;if(1===arguments.length){if(n=arguments[0],t=this.minimumLen/this.segLen,n.distance(this.seg.p0)<this.minimumLen)return this.splitPt=this.seg.pointAlong(t),null;if(n.distance(this.seg.p1)<this.minimumLen)return this.splitPt=ch.pointAlongReverse(this.seg,t),null;this.splitPt=n}else if(2===arguments.length){var r=arguments[0],u=arguments[1],f=this.getConstrainedLength(r),i=f/this.segLen;this.splitPt=u.equals2D(this.seg.p0)?this.seg.pointAlong(i):ch.pointAlongReverse(this.seg,i)}},setMinimumLength:function(n){this.minimumLen=n},getConstrainedLength:function(n){return n<this.minimumLen?this.minimumLen:n},getSplitPoint:function(){return this.splitPt},interfaces_:function(){return[]},getClass:function(){return ch}});ch.pointAlongReverse=function(n,t){var i=new r;return i.x=n.p1.x-t*(n.p1.x-n.p0.x),i.y=n.p1.y-t*(n.p1.y-n.p0.y),i};i(dw.prototype,{findSplitPoint:function(){},interfaces_:function(){return[]},getClass:function(){return dw}});i(kl.prototype,{findSplitPoint:function(n,t){var u=n.getLineSegment(),o=u.getLength(),f=o/2,i=new ch(u),e=kl.projectedSplitPoint(n,t),s=2*e.distance(t)*.8,r=s;return r>f&&(r=f),i.setMinimumLength(r),i.splitAt(e),i.getSplitPoint()},interfaces_:function(){return[dw]},getClass:function(){return kl}});kl.projectedSplitPoint=function(n,t){return n.getLineSegment().project(t)};i(wt.prototype,{interfaces_:function(){return[]},getClass:function(){return wt}});wt.triArea=function(n,t,i){return(t.x-n.x)*(i.y-n.y)-(t.y-n.y)*(i.x-n.x)};wt.isInCircleDDNormalized=function(n,t,i,r){var u=f.valueOf(n.x).selfSubtract(r.x),e=f.valueOf(n.y).selfSubtract(r.y),o=f.valueOf(t.x).selfSubtract(r.x),s=f.valueOf(t.y).selfSubtract(r.y),h=f.valueOf(i.x).selfSubtract(r.x),c=f.valueOf(i.y).selfSubtract(r.y),l=u.multiply(s).selfSubtract(o.multiply(e)),a=o.multiply(c).selfSubtract(h.multiply(s)),v=h.multiply(e).selfSubtract(u.multiply(c)),y=u.multiply(u).selfAdd(e.multiply(e)),p=o.multiply(o).selfAdd(s.multiply(s)),w=h.multiply(h).selfAdd(c.multiply(c));return y.selfMultiply(a).selfAdd(p.selfMultiply(v)).selfAdd(w.selfMultiply(l)).doubleValue()>0};wt.checkRobustInCircle=function(n,t,i,r){var f=wt.isInCircleNonRobust(n,t,i,r),e=wt.isInCircleDDSlow(n,t,i,r),o=wt.isInCircleCC(n,t,i,r),u=vt.circumcentre(n,t,i);pt.out.println("p radius diff a = "+Math.abs(r.distance(u)-n.distance(u))/n.distance(u));f===e&&f===o||(pt.out.println("inCircle robustness failure (double result = "+f+", DD result = "+e+", CC result = "+o+")"),pt.out.println(pi.toLineString(new gr([n,t,i,r]))),pt.out.println("Circumcentre = "+pi.toPoint(u)+" radius = "+n.distance(u)),pt.out.println("p radius diff a = "+Math.abs(r.distance(u)/n.distance(u)-1)),pt.out.println("p radius diff b = "+Math.abs(r.distance(u)/t.distance(u)-1)),pt.out.println("p radius diff c = "+Math.abs(r.distance(u)/i.distance(u)-1)),pt.out.println())};wt.isInCircleDDFast=function(n,t,i,r){var u=f.sqr(n.x).selfAdd(f.sqr(n.y)).selfMultiply(wt.triAreaDDFast(t,i,r)),e=f.sqr(t.x).selfAdd(f.sqr(t.y)).selfMultiply(wt.triAreaDDFast(n,i,r)),o=f.sqr(i.x).selfAdd(f.sqr(i.y)).selfMultiply(wt.triAreaDDFast(n,t,r)),s=f.sqr(r.x).selfAdd(f.sqr(r.y)).selfMultiply(wt.triAreaDDFast(n,t,i));return u.selfSubtract(e).selfAdd(o).selfSubtract(s).doubleValue()>0};wt.isInCircleCC=function(n,t,i,r){var u=vt.circumcentre(n,t,i),f=n.distance(u);return r.distance(u)-f<=0};wt.isInCircleNormalized=function(n,t,i,r){var u=n.x-r.x,f=n.y-r.y,e=t.x-r.x,o=t.y-r.y,s=i.x-r.x,h=i.y-r.y;return(u*u+f*f)*(e*h-s*o)+(e*e+o*o)*(s*f-u*h)+(s*s+h*h)*(u*o-e*f)>0};wt.isInCircleDDSlow=function(n,t,i,r){var u=f.valueOf(r.x),e=f.valueOf(r.y),o=f.valueOf(n.x),s=f.valueOf(n.y),h=f.valueOf(t.x),c=f.valueOf(t.y),l=f.valueOf(i.x),a=f.valueOf(i.y),v=o.multiply(o).add(s.multiply(s)).multiply(wt.triAreaDDSlow(h,c,l,a,u,e)),y=h.multiply(h).add(c.multiply(c)).multiply(wt.triAreaDDSlow(o,s,l,a,u,e)),p=l.multiply(l).add(a.multiply(a)).multiply(wt.triAreaDDSlow(o,s,h,c,u,e)),w=u.multiply(u).add(e.multiply(e)).multiply(wt.triAreaDDSlow(o,s,h,c,l,a));return v.subtract(y).add(p).subtract(w).doubleValue()>0};wt.isInCircleNonRobust=function(n,t,i,r){return(n.x*n.x+n.y*n.y)*wt.triArea(t,i,r)-(t.x*t.x+t.y*t.y)*wt.triArea(n,i,r)+(i.x*i.x+i.y*i.y)*wt.triArea(n,t,r)-(r.x*r.x+r.y*r.y)*wt.triArea(n,t,i)>0};wt.isInCircleRobust=function(n,t,i,r){return wt.isInCircleNormalized(n,t,i,r)};wt.triAreaDDSlow=function(n,t,i,r,u,f){return i.subtract(n).multiply(f.subtract(t)).subtract(r.subtract(t).multiply(u.subtract(n)))};wt.triAreaDDFast=function(n,t,i){var r=f.valueOf(t.x).selfSubtract(n.x).selfMultiply(f.valueOf(i.y).selfSubtract(n.y)),u=f.valueOf(t.y).selfSubtract(n.y).selfMultiply(f.valueOf(i.x).selfSubtract(n.x));return r.selfSubtract(u)};i(et.prototype,{circleCenter:function(n,t){var r=new et(this.getX(),this.getY()),i=this.bisector(r,n),e=this.bisector(n,t),u=new hr(i,e),f=null;try{f=new et(u.getX(),u.getY())}catch(i){if(!(i instanceof vf))throw i;pt.err.println("a: "+r+"  b: "+n+"  c: "+t);pt.err.println(i)}return f},dot:function(n){return this.p.x*n.getX()+this.p.y*n.getY()},magn:function(){return Math.sqrt(this.p.x*this.p.x+this.p.y*this.p.y)},getZ:function(){return this.p.z},bisector:function(n,t){var i=t.getX()-n.getX(),r=t.getY()-n.getY();return new hr(new hr(n.getX()+i/2,n.getY()+r/2,1),new hr(n.getX()-r+i/2,n.getY()+i+r/2,1))},equals:function(){var n,t,i;return 1===arguments.length?(n=arguments[0],this.p.x===n.getX()&&this.p.y===n.getY()):2===arguments.length?(t=arguments[0],i=arguments[1],this.p.distance(t.getCoordinate())<i):void 0},getCoordinate:function(){return this.p},isInCircle:function(n,t,i){return wt.isInCircleRobust(n.p,t.p,i.p,this.p)},interpolateZValue:function(n,t,i){var r=n.getX(),u=n.getY(),f=t.getX()-r,e=i.getX()-r,o=t.getY()-u,s=i.getY()-u,h=f*s-e*o,c=this.getX()-r,l=this.getY()-u,a=(s*c-e*l)/h,v=(-o*c+f*l)/h;return n.getZ()+a*(t.getZ()-n.getZ())+v*(i.getZ()-n.getZ())},midPoint:function(n){return new et((this.p.x+n.getX())/2,(this.p.y+n.getY())/2,(this.p.z+n.getZ())/2)},rightOf:function(n){return this.isCCW(n.dest(),n.orig())},isCCW:function(n,t){return(n.p.x-this.p.x)*(t.p.y-this.p.y)-(n.p.y-this.p.y)*(t.p.x-this.p.x)>0},getX:function(){return this.p.x},crossProduct:function(n){return this.p.x*n.getY()-this.p.y*n.getX()},setZ:function(n){this.p.z=n},times:function(n){return new et(n*this.p.x,n*this.p.y)},cross:function(){return new et(this.p.y,-this.p.x)},leftOf:function(n){return this.isCCW(n.orig(),n.dest())},toString:function(){return"POINT ("+this.p.x+" "+this.p.y+")"},sub:function(n){return new et(this.p.x-n.getX(),this.p.y-n.getY())},getY:function(){return this.p.y},classify:function(n,t){var u=this,i=t.sub(n),r=u.sub(n),f=i.crossProduct(r);return f>0?et.LEFT:f<0?et.RIGHT:i.getX()*r.getX()<0||i.getY()*r.getY()<0?et.BEHIND:i.magn()<r.magn()?et.BEYOND:n.equals(u)?et.ORIGIN:t.equals(u)?et.DESTINATION:et.BETWEEN},sum:function(n){return new et(this.p.x+n.getX(),this.p.y+n.getY())},distance:function(n,t){return Math.sqrt(Math.pow(t.getX()-n.getX(),2)+Math.pow(t.getY()-n.getY(),2))},circumRadiusRatio:function(n,t){var u=this.circleCenter(n,t),f=this.distance(u,n),i=this.distance(this,n),r=this.distance(n,t);return r<i&&(i=r),r=this.distance(t,this),r<i&&(i=r),f/i},interfaces_:function(){return[]},getClass:function(){return et}});et.interpolateZ=function(){if(3===arguments.length){var p=arguments[0],t=arguments[1],e=arguments[2],w=t.distance(e),b=p.distance(t),k=e.z-t.z;return t.z+k*(b/w)}if(4===arguments.length){var o=arguments[0],n=arguments[1],i=arguments[2],r=arguments[3],u=n.x,f=n.y,s=i.x-u,h=r.x-u,c=i.y-f,l=r.y-f,a=s*l-h*c,v=o.x-u,y=o.y-f,d=(l*v-h*y)/a,g=(-c*v+s*y)/a;return n.z+d*(i.z-n.z)+g*(r.z-n.z)}};et.LEFT=0;et.RIGHT=1;et.BEYOND=2;et.BEHIND=3;et.BETWEEN=4;et.ORIGIN=5;et.DESTINATION=6;y(ho,et);i(ho.prototype,{getConstraint:function(){return this.constraint},setOnConstraint:function(n){this._isOnConstraint=n},merge:function(n){n._isOnConstraint&&(this._isOnConstraint=!0,this.constraint=n.constraint)},isOnConstraint:function(){return this._isOnConstraint},setConstraint:function(n){this._isOnConstraint=!0;this.constraint=n},interfaces_:function(){return[]},getClass:function(){return ho}});i(dt.prototype,{equalsNonOriented:function(n){return!!this.equalsOriented(n)||!!this.equalsOriented(n.sym())},toLineSegment:function(){return new b(this.vertex.getCoordinate(),this.dest().getCoordinate())},dest:function(){return this.sym().orig()},oNext:function(){return this.next},equalsOriented:function(n){return!(!this.orig().getCoordinate().equals2D(n.orig().getCoordinate())||!this.dest().getCoordinate().equals2D(n.dest().getCoordinate()))},dNext:function(){return this.sym().oNext().sym()},lPrev:function(){return this.next.sym()},rPrev:function(){return this.sym().oNext()},rot:function(){return this._rot},oPrev:function(){return this._rot.next._rot},sym:function(){return this._rot._rot},setOrig:function(n){this.vertex=n},lNext:function(){return this.invRot().oNext().rot()},getLength:function(){return this.orig().getCoordinate().distance(this.dest().getCoordinate())},invRot:function(){return this._rot.sym()},setDest:function(n){this.sym().setOrig(n)},setData:function(n){this.data=n},getData:function(){return this.data},"delete":function(){this._rot=null},orig:function(){return this.vertex},rNext:function(){return this._rot.next.invRot()},toString:function(){var n=this.vertex.getCoordinate(),t=this.dest().getCoordinate();return pi.toLineString(n,t)},isLive:function(){return null!==this._rot},getPrimary:function(){return this.orig().getCoordinate().compareTo(this.dest().getCoordinate())<=0?this:this.sym()},dPrev:function(){return this.invRot().oNext().invRot()},setNext:function(n){this.next=n},interfaces_:function(){return[]},getClass:function(){return dt}});dt.makeEdge=function(n,t){var i=new dt,r=new dt,u=new dt,f=new dt,e;return i._rot=r,r._rot=u,u._rot=f,f._rot=i,i.setNext(i),r.setNext(f),u.setNext(u),f.setNext(r),e=i,e.setOrig(n),e.setDest(t),e};dt.swap=function(n){var t=n.oPrev(),i=n.sym().oPrev();dt.splice(n,t);dt.splice(n.sym(),i);dt.splice(n,t.lNext());dt.splice(n.sym(),i.lNext());n.setOrig(t.dest());n.setDest(i.dest())};dt.splice=function(n,t){var i=n.oNext().rot(),r=t.oNext().rot(),u=t.oNext(),f=n.oNext(),e=r.oNext(),o=i.oNext();n.setNext(u);t.setNext(f);i.setNext(e);r.setNext(o)};dt.connect=function(n,t){var i=dt.makeEdge(n.dest(),t.orig());return dt.splice(i,n.lNext()),dt.splice(i.sym(),t),i};i(dl.prototype,{insertSite:function(n){var t=this.subdiv.locate(n),i,r,u;if(this.subdiv.isVertexOfEdge(t,n))return t;this.subdiv.isOnEdge(t,n.getCoordinate())&&(t=t.oPrev(),this.subdiv.delete(t.oNext()));i=this.subdiv.makeEdge(t.orig(),n);dt.splice(i,t);r=i;do i=this.subdiv.connect(t,i.sym()),t=i.oPrev();while(t.lNext()!==r);for(;;)if(u=t.oPrev(),u.dest().rightOf(t)&&n.isInCircle(t.orig(),u.dest(),t.dest()))dt.swap(t),t=t.oPrev();else{if(t.oNext()===r)return i;t=t.oNext().lPrev()}},insertSites:function(n){for(var i,t=n.iterator();t.hasNext();)i=t.next(),this.insertSite(i)},interfaces_:function(){return[]},getClass:function(){return dl}});i(gw.prototype,{locate:function(){},interfaces_:function(){return[]},getClass:function(){return gw}});i(ay.prototype,{init:function(){this.lastEdge=this.findEdge()},locate:function(n){this.lastEdge.isLive()||this.init();var t=this.subdiv.locateFromEdge(n,this.lastEdge);return this.lastEdge=t,t},findEdge:function(){return this.subdiv.getEdges().iterator().next()},interfaces_:function(){return[gw]},getClass:function(){return ay}});y(lh,ci);i(lh.prototype,{getSegment:function(){return this.seg},interfaces_:function(){return[]},getClass:function(){return lh}});lh.msgWithSpatial=function(n,t){return null!==t?n+" [ "+t+" ]":n};i(ah.prototype,{visit:function(){},interfaces_:function(){return[]},getClass:function(){return ah}});i(fu.prototype,{getTriangleVertices:function(n){var t=new py;return this.visitTriangles(t,n),t.getTriangleVertices()},isFrameVertex:function(n){return!!n.equals(this.frameVertex[0])||!!n.equals(this.frameVertex[1])||!!n.equals(this.frameVertex[2])},isVertexOfEdge:function(n,t){return!(!t.equals(n.orig(),this.tolerance)&&!t.equals(n.dest(),this.tolerance))},connect:function(n,t){var i=dt.connect(n,t);return this.quadEdges.add(i),i},getVoronoiCellPolygon:function(n,t){var r=new u,f=n,e,i;do e=n.rot().orig().getCoordinate(),r.add(e),n=n.oPrev();while(n!==f);i=new ii;i.addAll(r,!1);i.closeRing();i.size()<4&&(pt.out.println(i),i.add(i.get(i.size()-1),!0));var s=i.toCoordinateArray(),o=t.createPolygon(t.createLinearRing(s),null),h=f.orig();return o.setUserData(h.getCoordinate()),o},setLocator:function(n){this.locator=n},initSubdiv:function(){var n=this.makeEdge(this.frameVertex[0],this.frameVertex[1]),i=this.makeEdge(this.frameVertex[1],this.frameVertex[2]),t;return dt.splice(n.sym(),i),t=this.makeEdge(this.frameVertex[2],this.frameVertex[0]),dt.splice(i.sym(),t),dt.splice(t.sym(),n),n},isFrameBorderEdge:function(n){var u=new Array(3).fill(null),t,i,r;return(fu.getTriangleEdges(n,u),t=new Array(3).fill(null),fu.getTriangleEdges(n.sym(),t),i=n.lNext().dest(),this.isFrameVertex(i))?!0:(r=n.sym().lNext().dest(),!!this.isFrameVertex(r))},makeEdge:function(n,t){var i=dt.makeEdge(n,t);return this.quadEdges.add(i),i},visitTriangles:function(n,t){var i,r,u,f;for(this.visitedKey++,i=new gi,i.push(this.startingEdge),r=new li;!i.empty();)u=i.pop(),r.contains(u)||(f=this.fetchTriangleToVisit(u,i,t,r),null!==f&&n.visit(f))},isFrameEdge:function(n){return!(!this.isFrameVertex(n.orig())&&!this.isFrameVertex(n.dest()))},isOnEdge:function(n,t){return this.seg.setCoordinates(n.orig().getCoordinate(),n.dest().getCoordinate()),this.seg.distance(t)<this.edgeCoincidenceTolerance},getEnvelope:function(){return new p(this.frameEnv)},createFrame:function(n){var i=n.getWidth(),r=n.getHeight(),t=0;t=i>r?10*i:10*r;this.frameVertex[0]=new et((n.getMaxX()+n.getMinX())/2,n.getMaxY()+t);this.frameVertex[1]=new et(n.getMinX()-t,n.getMinY()-t);this.frameVertex[2]=new et(n.getMaxX()+t,n.getMinY()-t);this.frameEnv=new p(this.frameVertex[0].getCoordinate(),this.frameVertex[1].getCoordinate());this.frameEnv.expandToInclude(this.frameVertex[2].getCoordinate())},getTriangleCoordinates:function(n){var t=new wy;return this.visitTriangles(t,n),t.getTriangles()},getVertices:function(n){for(var r,u,f,t=new li,i=this.quadEdges.iterator();i.hasNext();)r=i.next(),u=r.orig(),!n&&this.isFrameVertex(u)||t.add(u),f=r.dest(),!n&&this.isFrameVertex(f)||t.add(f);return t},fetchTriangleToVisit:function(n,t,i,r){var u=n,e=0,o=!1,f;do this.triEdges[e]=u,this.isFrameEdge(u)&&(o=!0),f=u.sym(),r.contains(f)||t.push(f),r.add(u),e++,u=u.lNext();while(u!==n);return o&&!i?null:this.triEdges},getEdges:function(){var n;if(0===arguments.length)return this.quadEdges;if(1===arguments.length){for(var t=arguments[0],i=this.getPrimaryEdges(!1),r=new Array(i.size()).fill(null),f=0,u=i.iterator();u.hasNext();)n=u.next(),r[f++]=t.createLineString([n.orig().getCoordinate(),n.dest().getCoordinate()]);return t.createMultiLineString(r)}},getVertexUniqueEdges:function(n){for(var i,r,o,f,e=new u,t=new li,s=this.quadEdges.iterator();s.hasNext();)i=s.next(),r=i.orig(),t.contains(r)||(t.add(r),!n&&this.isFrameVertex(r)||e.add(i)),o=i.sym(),f=o.orig(),t.contains(f)||(t.add(f),!n&&this.isFrameVertex(f)||e.add(o));return e},getTriangleEdges:function(n){var t=new yy;return this.visitTriangles(t,n),t.getTriangleEdges()},getPrimaryEdges:function(n){var f,i,r,t,e;for(this.visitedKey++,f=new u,i=new gi,i.push(this.startingEdge),r=new li;!i.empty();)t=i.pop(),r.contains(t)||(e=t.getPrimary(),!n&&this.isFrameEdge(e)||f.add(e),i.push(t.oNext()),i.push(t.sym().oNext()),r.add(t),r.add(t.sym()));return f},"delete":function(n){dt.splice(n,n.oPrev());dt.splice(n.sym(),n.sym().oPrev());var t=n.sym(),i=n.rot(),r=n.rot().sym();this.quadEdges.remove(n);this.quadEdges.remove(t);this.quadEdges.remove(i);this.quadEdges.remove(r);n.delete();t.delete();i.delete();r.delete()},locateFromEdge:function(n,t){for(var r=0,u=this.quadEdges.size(),i=t;;){if(++r>u)throw new lh(i.toLineSegment());if(n.equals(i.orig())||n.equals(i.dest()))break;if(n.rightOf(i))i=i.sym();else if(n.rightOf(i.oNext())){if(n.rightOf(i.dPrev()))break;i=i.dPrev()}else i=i.oNext()}return i},getTolerance:function(){return this.tolerance},getVoronoiCellPolygons:function(n){var r;this.visitTriangles(new vy,!0);for(var t=new u,f=this.getVertexUniqueEdges(!1),i=f.iterator();i.hasNext();)r=i.next(),t.add(this.getVoronoiCellPolygon(r,n));return t},getVoronoiDiagram:function(n){var t=this.getVoronoiCellPolygons(n);return n.createGeometryCollection(g.toGeometryArray(t))},getTriangles:function(n){for(var u,t=this.getTriangleCoordinates(!1),i=new Array(t.size()).fill(null),f=0,r=t.iterator();r.hasNext();)u=r.next(),i[f++]=n.createPolygon(n.createLinearRing(u),null);return n.createGeometryCollection(i)},insertSite:function(n){var t=this.locate(n),i,r;if(n.equals(t.orig(),this.tolerance)||n.equals(t.dest(),this.tolerance))return t;i=this.makeEdge(t.orig(),n);dt.splice(i,t);r=i;do i=this.connect(t,i.sym()),t=i.oPrev();while(t.lNext()!==r);return r},locate:function(){var u,f,i,n;if(1===arguments.length){if(arguments[0]instanceof et)return u=arguments[0],this.locator.locate(u);if(arguments[0]instanceof r)return f=arguments[0],this.locator.locate(new et(f))}else if(2===arguments.length){var e=arguments[0],o=arguments[1],t=this.locator.locate(new et(e));if(null===t)return null;i=t;t.dest().getCoordinate().equals2D(e)&&(i=t.sym());n=i;do{if(n.dest().getCoordinate().equals2D(o))return n;n=n.oNext()}while(n!==i);return null}},interfaces_:function(){return[]},getClass:function(){return fu}});fu.getTriangleEdges=function(n,t){if(t[0]=n,t[1]=t[0].lNext(),t[2]=t[1].lNext(),t[2].lNext()!==t[0])throw new ct("Edges do not form a triangle");};i(vy.prototype,{visit:function(n){for(var i=n[0].orig().getCoordinate(),r=n[1].orig().getCoordinate(),u=n[2].orig().getCoordinate(),f=vt.circumcentre(i,r,u),e=new et(f),t=0;t<3;t++)n[t].rot().setOrig(e)},interfaces_:function(){return[ah]},getClass:function(){return vy}});i(yy.prototype,{getTriangleEdges:function(){return this.triList},visit:function(n){this.triList.add(n.clone())},interfaces_:function(){return[ah]},getClass:function(){return yy}});i(py.prototype,{visit:function(n){this.triList.add([n[0].orig(),n[1].orig(),n[2].orig()])},getTriangleVertices:function(){return this.triList},interfaces_:function(){return[ah]},getClass:function(){return py}});i(wy.prototype,{checkTriangleSize:function(n){n.length>=2?pi.toLineString(n[0],n[1]):n.length>=1&&pi.toPoint(n[0])},visit:function(n){var t,r,i;for(this.coordList.clear(),t=0;t<3;t++)r=n[t].orig(),this.coordList.add(r.getCoordinate());if(this.coordList.size()>0){if(this.coordList.closeRing(),i=this.coordList.toCoordinateArray(),4!==i.length)return null;this.triCoords.add(i)}},getTriangles:function(){return this.triCoords},interfaces_:function(){return[ah]},getClass:function(){return wy}});fu.TriangleCircumcentreVisitor=vy;fu.TriangleEdgesListVisitor=yy;fu.TriangleVertexListVisitor=py;fu.TriangleCoordinatesVisitor=wy;fu.EDGE_COINCIDENCE_TOL_FACTOR=1e3;i(hs.prototype,{getLineSegment:function(){return this.ls},getEndZ:function(){return this.ls.getCoordinate(1).z},getStartZ:function(){return this.ls.getCoordinate(0).z},intersection:function(n){return this.ls.intersection(n.getLineSegment())},getStart:function(){return this.ls.getCoordinate(0)},getEnd:function(){return this.ls.getCoordinate(1)},getEndY:function(){return this.ls.getCoordinate(1).y},getStartX:function(){return this.ls.getCoordinate(0).x},equalsTopo:function(n){return this.ls.equalsTopo(n.getLineSegment())},getStartY:function(){return this.ls.getCoordinate(0).y},setData:function(n){this.data=n},getData:function(){return this.data},getEndX:function(){return this.ls.getCoordinate(1).x},toString:function(){return this.ls.toString()},interfaces_:function(){return[]},getClass:function(){return hs}});i(gl.prototype,{visit:function(){},interfaces_:function(){return[]},getClass:function(){return gl}});i(by.prototype,{isRepeated:function(){return this.count>1},getRight:function(){return this.right},getCoordinate:function(){return this.p},setLeft:function(n){this.left=n},getX:function(){return this.p.x},getData:function(){return this.data},getCount:function(){return this.count},getLeft:function(){return this.left},getY:function(){return this.p.y},increment:function(){this.count=this.count+1},setRight:function(n){this.right=n},interfaces_:function(){return[]},getClass:function(){return by}});i(cs.prototype,{insert:function(){var r,n,i,t;return 1===arguments.length?(r=arguments[0],this.insert(r,null)):2===arguments.length?(n=arguments[0],i=arguments[1],null===this.root)?(this.root=new by(n,i),this.root):this.tolerance>0&&(t=this.findBestMatchNode(n),null!==t)?(t.increment(),t):this.insertExact(n,i):void 0},query:function(){var t=arguments,i=this,r,n,f,e;if(1===arguments.length)return r=arguments[0],n=new u,this.query(r,n),n;2===arguments.length&&(arguments[0]instanceof p&&l(arguments[1],ei)?!function(){var n=t[0],r=t[1];i.queryNode(i.root,n,!0,{interfaces_:function(){return[gl]},visit:function(n){r.add(n)}})}():arguments[0]instanceof p&&l(arguments[1],gl)&&(f=arguments[0],e=arguments[1],this.queryNode(this.root,f,!0,e)))},queryNode:function(n,t,i,r){var o,s;if(null===n)return null;var f=null,e=null,u=null;i?(f=t.getMinX(),e=t.getMaxX(),u=n.getX()):(f=t.getMinY(),e=t.getMaxY(),u=n.getY());o=f<u;s=u<=e;o&&this.queryNode(n.getLeft(),t,!i,r);t.contains(n.getCoordinate())&&r.visit(n);s&&this.queryNode(n.getRight(),t,!i,r)},findBestMatchNode:function(n){var t=new ky(n,this.tolerance);return this.query(t.queryEnvelope(),t),t.getNode()},isEmpty:function(){return null===this.root},insertExact:function(n,t){for(var r,i=this.root,u=this.root,f=!0,e=!0;null!==i;){if(null!==i&&n.distance(i.getCoordinate())<=this.tolerance)return i.increment(),i;e=f?n.x<i.getX():n.y<i.getY();u=i;i=e?i.getLeft():i.getRight();f=!f}return this.numberOfNodes=this.numberOfNodes+1,r=new by(n,t),e?u.setLeft(r):u.setRight(r),r},interfaces_:function(){return[]},getClass:function(){return cs}});cs.toCoordinates=function(){var n;if(1===arguments.length)return n=arguments[0],cs.toCoordinates(n,!1);if(2===arguments.length){for(var f=arguments[0],e=arguments[1],t=new ii,i=f.iterator();i.hasNext();)for(var r=i.next(),o=e?r.getCount():1,u=0;u<o;u++)t.add(r.getCoordinate(),!0);return t.toCoordinateArray()}};i(ky.prototype,{visit:function(n){var t=this.p.distance(n.getCoordinate()),i;if(!(t<=this.tolerance))return null;i=!1;(null===this.matchNode||t<this.matchDist||null!==this.matchNode&&t===this.matchDist&&n.getCoordinate().compareTo(this.matchNode.getCoordinate())<1)&&(i=!0);i&&(this.matchNode=n,this.matchDist=t)},queryEnvelope:function(){var n=new p(this.p);return n.expandBy(this.tolerance),n},getNode:function(){return this.matchNode},interfaces_:function(){return[gl]},getClass:function(){return ky}});cs.BestMatchVisitor=ky;i(co.prototype,{getInitialVertices:function(){return this.initialVertices},getKDT:function(){return this.kdt},enforceConstraints:function(){this.addConstraintVertices();var n=0,t=0;do t=this.enforceGabriel(this.segments),n++;while(t>0&&n<co.MAX_SPLIT_ITER)},insertSites:function(n){for(var i,t=n.iterator();t.hasNext();)i=t.next(),this.insertSite(i)},getVertexFactory:function(){return this.vertexFactory},getPointArray:function(){for(var i,n,t=new Array(this.initialVertices.size()+this.segVertices.size()).fill(null),r=0,u=this.initialVertices.iterator();u.hasNext();)n=u.next(),t[r++]=n.getCoordinate();for(i=this.segVertices.iterator();i.hasNext();)n=i.next(),t[r++]=n.getCoordinate();return t},setConstraints:function(n,t){this.segments=n;this.segVertices=t},computeConvexHull:function(){var n=new g,t=this.getPointArray(),i=new gf(t,n);this.convexHull=i.getConvexHull()},addConstraintVertices:function(){this.computeConvexHull();this.insertSites(this.segVertices)},findNonGabrielPoint:function(n){var i=n.getStart(),u=n.getEnd(),f=new r((i.x+u.x)/2,(i.y+u.y)/2),h=i.distance(f),c=new p(f),y,t,o,s;c.expandBy(h);for(var w=this.kdt.query(c),e=null,l=v.MAX_VALUE,a=w.iterator();a.hasNext();)y=a.next(),t=y.getCoordinate(),t.equals2D(i)||t.equals2D(u)||(o=f.distance(t),o<h&&(s=o,(null===e||s<l)&&(e=t,l=s)));return e},getConstraintSegments:function(){return this.segments},setSplitPointFinder:function(n){this.splitFinder=n},getConvexHull:function(){return this.convexHull},getTolerance:function(){return this.tolerance},enforceGabriel:function(n){for(var t,f,r=new u,e=0,o=new u,s=n.iterator();s.hasNext();)if(t=s.next(),f=this.findNonGabrielPoint(t),null!==f){this.splitPt=this.splitFinder.findSplitPoint(t,f);var i=this.createVertex(this.splitPt,t),h=(this.insertSite(i),new hs(t.getStartX(),t.getStartY(),t.getStartZ(),i.getX(),i.getY(),i.getZ(),t.getData())),c=new hs(i.getX(),i.getY(),i.getZ(),t.getEndX(),t.getEndY(),t.getEndZ(),t.getData());r.add(h);r.add(c);o.add(t);e+=1}return n.removeAll(o),n.addAll(r),e},createVertex:function(){var t,n;if(1===arguments.length)return t=arguments[0],n=null,null!==this.vertexFactory?this.vertexFactory.createVertex(t,null):new ho(t);if(2===arguments.length){var i=arguments[0],r=arguments[1],n=null;return n=null!==this.vertexFactory?this.vertexFactory.createVertex(i,r):new ho(i),n.setOnConstraint(!0),n}},getSubdivision:function(){return this.subdiv},computeBoundingBox:function(){var t=co.computeVertexEnvelope(this.initialVertices),i=co.computeVertexEnvelope(this.segVertices),n=new p(t);n.expandToInclude(i);var r=.2*n.getWidth(),u=.2*n.getHeight(),f=Math.max(r,u);this.computeAreaEnv=new p(n);this.computeAreaEnv.expandBy(f)},setVertexFactory:function(n){this.vertexFactory=n},formInitialDelaunay:function(){this.computeBoundingBox();this.subdiv=new fu(this.computeAreaEnv,this.tolerance);this.subdiv.setLocator(new ay(this.subdiv));this.incDel=new dl(this.subdiv);this.insertSites(this.initialVertices)},insertSite:function(){var n,t,i,u;if(arguments[0]instanceof ho)return(n=arguments[0],t=this.kdt.insert(n.getCoordinate(),n),t.isRepeated())?(i=t.getData(),i.merge(n),i):(this.incDel.insertSite(n),n);arguments[0]instanceof r&&(u=arguments[0],this.insertSite(this.createVertex(u)))},interfaces_:function(){return[]},getClass:function(){return co}});co.computeVertexEnvelope=function(n){for(var r,t=new p,i=n.iterator();i.hasNext();)r=i.next(),t.expandToInclude(r.getCoordinate());return t};co.MAX_SPLIT_ITER=99;i(ki.prototype,{create:function(){if(null!==this.subdiv)return null;var n=ki.envelope(this.siteCoords),t=ki.toVertices(this.siteCoords);this.subdiv=new fu(n,this.tolerance);new dl(this.subdiv).insertSites(t)},setTolerance:function(n){this.tolerance=n},setSites:function(){var n,t;arguments[0]instanceof h?(n=arguments[0],this.siteCoords=ki.extractUniqueCoordinates(n)):l(arguments[0],yt)&&(t=arguments[0],this.siteCoords=ki.unique(w.toCoordinateArray(t)))},getEdges:function(n){return this.create(),this.subdiv.getEdges(n)},getSubdivision:function(){return this.create(),this.subdiv},getTriangles:function(n){return this.create(),this.subdiv.getTriangles(n)},interfaces_:function(){return[]},getClass:function(){return ki}});ki.extractUniqueCoordinates=function(n){if(null===n)return new ii;var t=n.getCoordinates();return ki.unique(t)};ki.envelope=function(n){for(var r,t=new p,i=n.iterator();i.hasNext();)r=i.next(),t.expandToInclude(r);return t};ki.unique=function(n){var t=w.copyDeep(n);return pf.sort(t),new ii(t,!1)};ki.toVertices=function(n){for(var r,t=new u,i=n.iterator();i.hasNext();)r=i.next(),t.add(new et(r));return t};i(vh.prototype,{createSiteVertices:function(n){for(var r,t=new u,i=n.iterator();i.hasNext();)r=i.next(),this.constraintVertexMap.containsKey(r)||t.add(new ho(r));return t},create:function(){var i,t,r,n;if(null!==this.subdiv)return null;i=ki.envelope(this.siteCoords);t=new u;null!==this.constraintLines&&(i.expandToInclude(this.constraintLines.getEnvelopeInternal()),this.createVertices(this.constraintLines),t=vh.createConstraintSegments(this.constraintLines));r=this.createSiteVertices(this.siteCoords);n=new co(r,this.tolerance);n.setConstraints(t,new u(this.constraintVertexMap.values()));n.formInitialDelaunay();n.enforceConstraints();this.subdiv=n.getSubdivision()},setTolerance:function(n){this.tolerance=n},setConstraints:function(n){this.constraintLines=n},setSites:function(n){this.siteCoords=ki.extractUniqueCoordinates(n)},getEdges:function(n){return this.create(),this.subdiv.getEdges(n)},getSubdivision:function(){return this.create(),this.subdiv},getTriangles:function(n){return this.create(),this.subdiv.getTriangles(n)},createVertices:function(n){for(var r,i=n.getCoordinates(),t=0;t<i.length;t++)r=new ho(i[t]),this.constraintVertexMap.put(i[t],r)},interfaces_:function(){return[]},getClass:function(){return vh}});vh.createConstraintSegments=function(){var r;if(1===arguments.length){for(var f=arguments[0],e=wi.getLines(f),i=new u,n=e.iterator();n.hasNext();)r=n.next(),vh.createConstraintSegments(r,i);return i}if(2===arguments.length)for(var o=arguments[0],s=arguments[1],t=o.getCoordinates(),n=1;n<t.length;n++)s.add(new hs(t[n-1],t[n]))};i(na.prototype,{create:function(){var n,t,i;if(null!==this.subdiv)return null;n=ki.envelope(this.siteCoords);this.diagramEnv=n;t=Math.max(this.diagramEnv.getWidth(),this.diagramEnv.getHeight());this.diagramEnv.expandBy(t);null!==this.clipEnv&&this.diagramEnv.expandToInclude(this.clipEnv);i=ki.toVertices(this.siteCoords);this.subdiv=new fu(n,this.tolerance);new dl(this.subdiv).insertSites(i)},getDiagram:function(n){this.create();var t=this.subdiv.getVoronoiDiagram(n);return na.clipGeometryCollection(t,this.diagramEnv)},setTolerance:function(n){this.tolerance=n},setSites:function(){var n,t;arguments[0]instanceof h?(n=arguments[0],this.siteCoords=ki.extractUniqueCoordinates(n)):l(arguments[0],yt)&&(t=arguments[0],this.siteCoords=ki.unique(w.toCoordinateArray(t)))},setClipEnvelope:function(n){this.clipEnv=n},getSubdivision:function(){return this.create(),this.subdiv},interfaces_:function(){return[]},getClass:function(){return na}});na.clipGeometryCollection=function(n,t){for(var r,i,o=n.getFactory().toGeometry(t),e=new u,f=0;f<n.getNumGeometries();f++)r=n.getGeometryN(f),i=null,t.contains(r.getEnvelopeInternal())?i=r:t.intersects(r.getEnvelopeInternal())&&(i=o.intersection(r),i.setUserData(r.getUserData())),null===i||i.isEmpty()||e.add(i);return n.getFactory().createGeometryCollection(g.toGeometryArray(e))};rk=Object.freeze({Vertex:et});uk=Object.freeze({ConformingDelaunayTriangulationBuilder:vh,DelaunayTriangulationBuilder:ki,VoronoiDiagramBuilder:na,quadedge:rk});i(dy.prototype,{interfaces_:function(){return[]},getClass:function(){return dy}});dy.union=function(n,t){if(n.isEmpty()||t.isEmpty()){if(n.isEmpty()&&t.isEmpty())return a.createEmptyResult(a.UNION,n,t,n.getFactory());if(n.isEmpty())return t.copy();if(t.isEmpty())return n.copy()}return n.checkNotGeometryCollection(n),n.checkNotGeometryCollection(t),hi.overlayOp(n,t,a.UNION)};i(h.prototype,{equalsTopo:function(n){return!!this.getEnvelopeInternal().equals(n.getEnvelopeInternal())&&ut.relate(this,n).isEquals(this.getDimension(),n.getDimension())},union:function(){if(0===arguments.length)return so.union(this);if(1===arguments.length){var n=arguments[0];return dy.union(this,n)}},isValid:function(){return ru.isValid(this)},intersection:function(n){if(this.isEmpty()||n.isEmpty())return a.createEmptyResult(a.INTERSECTION,this,n,this.factory);if(this.isGeometryCollection()){var t=n;return ks.map(this,{interfaces_:function(){return[MapOp]},map:function(n){return n.intersection(t)}})}return this.checkNotGeometryCollection(this),this.checkNotGeometryCollection(n),hi.overlayOp(this,n,a.INTERSECTION)},covers:function(n){return ut.covers(this,n)},coveredBy:function(n){return ut.coveredBy(this,n)},touches:function(n){return ut.touches(this,n)},intersects:function(n){return ut.intersects(this,n)},within:function(n){return ut.within(this,n)},overlaps:function(n){return ut.overlaps(this,n)},disjoint:function(n){return ut.disjoint(this,n)},crosses:function(n){return ut.crosses(this,n)},buffer:function(){var n,t,i;if(1===arguments.length)return n=arguments[0],yi.bufferOp(this,n);if(2===arguments.length)return t=arguments[0],i=arguments[1],yi.bufferOp(this,t,i);if(3===arguments.length){var r=arguments[0],u=arguments[1],f=arguments[2];return yi.bufferOp(this,r,u,f)}},convexHull:function(){return new gf(this).getConvexHull()},relate:function(){for(var t=arguments.length,i=Array(t),n=0;n<t;n++)i[n]=arguments[n];return ut.relate.apply(ut,[this].concat(i))},getCentroid:function(){if(this.isEmpty())return this.factory.createPoint();var n=df.getCentroid(this);return this.createPointFromInternalCoord(n,this)},getInteriorPoint:function(){var t,i,n;return this.isEmpty()?this.factory.createPoint():(t=null,i=this.getDimension(),0===i?(n=new lv(this),t=n.getInteriorPoint()):1===i?(n=new cv(this),t=n.getInteriorPoint()):(n=new bu(this),t=n.getInteriorPoint()),this.createPointFromInternalCoord(t,this))},symDifference:function(n){if(this.isEmpty()||n.isEmpty()){if(this.isEmpty()&&n.isEmpty())return a.createEmptyResult(a.SYMDIFFERENCE,this,n,this.factory);if(this.isEmpty())return n.copy();if(n.isEmpty())return this.copy()}return this.checkNotGeometryCollection(this),this.checkNotGeometryCollection(n),hi.overlayOp(this,n,a.SYMDIFFERENCE)},createPointFromInternalCoord:function(n,t){return t.getPrecisionModel().makePrecise(n),t.getFactory().createPoint(n)},toText:function(){return(new pi).write(this)},toString:function(){this.toText()},contains:function(n){return ut.contains(this,n)},difference:function(n){return this.isEmpty()?a.createEmptyResult(a.DIFFERENCE,this,n,this.factory):n.isEmpty()?this.copy():(this.checkNotGeometryCollection(this),this.checkNotGeometryCollection(n),hi.overlayOp(this,n,a.DIFFERENCE))},isSimple:function(){return new dc(this).isSimple()},isWithinDistance:function(n,t){return!(this.getEnvelopeInternal().distance(n.getEnvelopeInternal())>t)&&ku.isWithinDistance(this,n,t)},distance:function(n){return ku.distance(this,n)},isEquivalentClass:function(n){return this.getClass()===n.getClass()}});n.version="1.3.0 (6e65adb)";n.algorithm=cb;n.densify=lb;n.dissolve=ab;n.geom=hb;n.geomgraph=vb;n.index=cd;n.io=yb;n.noding=pb;n.operation=yd;n.precision=tk;n.simplify=ik;n.triangulate=uk;Object.defineProperty(n,"__esModule",{value:!0})})},{}],177:[function(n,t){function i(n,t){var c,ft,g,nt;switch(n.geometry?n.geometry.type:n.type){case"Point":return r(o(n),t);case"Polygon":c=[];s(n,function(n){c.push(n)});for(var v,y,p,w,b,k,l,tt=u(n,t),a=tt.geometry.coordinates,it=0,rt=0,d=0,ut=c.map(function(n){return[n[0]-a[0],n[1]-a[1]]}),h=0;h<c.length-1;h++)v=ut[h],p=v[0],b=v[1],y=ut[h+1],w=y[0],k=y[1],l=p*k-w*b,d+=l,it+=(p+w)*l,rt+=(b+k)*l;return 0===d?tt:(ft=.5*d,g=1/(6*ft),r([a[0]+g*it,a[1]+g*rt],t));default:return nt=f(e(n)),nt?i(nt,t):u(n,t)}}var r=n("@turf/helpers").point,f=n("@turf/convex"),e=n("@turf/explode"),u=n("@turf/centroid"),o=n("@turf/invariant").getCoord,s=n("@turf/meta").coordEach;t.exports=i},{"@turf/centroid":178,"@turf/convex":181,"@turf/explode":200,"@turf/helpers":203,"@turf/invariant":204,"@turf/meta":205}],178:[function(n,t){var i=n("@turf/meta").coordEach,r=n("@turf/helpers").point;t.exports=function(n,t){var f=0,e=0,u=0;return i(n,function(n){f+=n[0];e+=n[1];u++},!0),r([f/u,e/u],t)}},{"@turf/helpers":179,"@turf/meta":180}],179:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],180:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],181:[function(n,t){var i=n("@turf/meta").coordEach,r=n("convex-hull"),u=n("@turf/helpers").polygon;t.exports=function(n){var f=[],t,e,o;if(i(n,function(n){f.push([n[0],n[1]])}),t=r(f),t.length>=3){for(e=[],o=0;o<t.length;o++)e.push(f[t[o][0]]);return e.push(f[t[t.length-1][1]]),u([e])}}},{"@turf/helpers":182,"@turf/meta":183,"convex-hull":186}],182:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],183:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],184:[function(n,t){"use strict";function i(n,t){for(var r,o,f,e=new Array(t+1),i=0;i<n.length;++i)e[i]=n[i];for(i=0;i<=n.length;++i){for(r=n.length;r<=t;++r){for(o=new Array(t),f=0;f<t;++f)o[f]=Math.pow(r+1-i,f);e[r]=o}if(u.apply(void 0,e))return!0}return!1}function r(n){var u=n.length;if(0===u)return[];if(1===u)return[0];for(var e=n[0].length,f=[n[0]],t=[0],r=1;r<u;++r)if(f.push(n[r]),i(f,e)){if(t.push(r),t.length===e+1)return t}else f.pop();return t}t.exports=r;var u=n("robust-orientation")},{"robust-orientation":192}],185:[function(n,t,i){"use strict";"use restrict";function u(n){var t=32;return n&=-n,n&&t--,65535&n&&(t-=16),16711935&n&&(t-=8),252645135&n&&(t-=4),858993459&n&&(t-=2),1431655765&n&&(t-=1),t}i.INT_BITS=32;i.INT_MAX=2147483647;i.INT_MIN=-2147483648;i.sign=function(n){return(n>0)-(n<0)};i.abs=function(n){var t=n>>31;return(n^t)-t};i.min=function(n,t){return t^(n^t)&-(n<t)};i.max=function(n,t){return n^(n^t)&-(n<t)};i.isPow2=function(n){return!(n&n-1||!n)};i.log2=function(n){var i,t;return i=(n>65535)<<4,n>>>=i,t=(n>255)<<3,n>>>=t,i|=t,t=(n>15)<<2,n>>>=t,i|=t,t=(n>3)<<1,n>>>=t,(i|=t)|n>>1};i.log10=function(n){return n>=1e9?9:n>=1e8?8:n>=1e7?7:n>=1e6?6:n>=1e5?5:n>=1e4?4:n>=1e3?3:n>=100?2:n>=10?1:0};i.popCount=function(n){return n-=n>>>1&1431655765,16843009*((n=(858993459&n)+(n>>>2&858993459))+(n>>>4)&252645135)>>>24};i.countTrailingZeros=u;i.nextPow2=function(n){return n+=0===n,--n,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,(n|=n>>>16)+1};i.prevPow2=function(n){return n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,(n|=n>>>16)-(n>>>1)};i.parity=function(n){return n^=n>>>16,n^=n>>>8,n^=n>>>4,27030>>>(n&=15)&1};var r=new Array(256);!function(n){for(var t=0;t<256;++t){var i=t,r=t,u=7;for(i>>>=1;i;i>>>=1)r<<=1,r|=1&i,--u;n[t]=r<<u&255}}(r);i.reverse=function(n){return r[255&n]<<24|r[n>>>8&255]<<16|r[n>>>16&255]<<8|r[n>>>24&255]};i.interleave2=function(n,t){return n&=65535,n=16711935&(n|n<<8),n=252645135&(n|n<<4),n=858993459&(n|n<<2),n=1431655765&(n|n<<1),t&=65535,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),n|t<<1};i.deinterleave2=function(n,t){return n=n>>>t&1431655765,n=858993459&(n|n>>>1),n=252645135&(n|n>>>2),n=16711935&(n|n>>>4),(n=65535&(n|n>>>16))<<16>>16};i.interleave3=function(n,t,i){return n&=1023,n=4278190335&(n|n<<16),n=251719695&(n|n<<8),n=3272356035&(n|n<<4),n=1227133513&(n|n<<2),t&=1023,t=4278190335&(t|t<<16),t=251719695&(t|t<<8),t=3272356035&(t|t<<4),t=1227133513&(t|t<<2),n|=t<<1,i&=1023,i=4278190335&(i|i<<16),i=251719695&(i|i<<8),i=3272356035&(i|i<<4),i=1227133513&(i|i<<2),n|i<<2};i.deinterleave3=function(n,t){return n=n>>>t&1227133513,n=3272356035&(n|n>>>2),n=251719695&(n|n>>>4),n=4278190335&(n|n>>>8),(n=1023&(n|n>>>16))<<22>>22};i.nextCombination=function(n){var t=n|n-1;return t+1|(~t&-~t)-1>>>u(n)+1}},{}],186:[function(n,t){"use strict";function i(n){var i=n.length,t;return 0===i?[]:1===i?[[0]]:(t=n[0].length,0===t?[]:1===t?r(n):2===t?u(n):f(n,t))}var r=n("./lib/ch1d"),u=n("./lib/ch2d"),f=n("./lib/chnd");t.exports=i},{"./lib/ch1d":187,"./lib/ch2d":188,"./lib/chnd":189}],187:[function(n,t){"use strict";function i(n){for(var t=0,i=0,r=1;r<n.length;++r)n[r][0]<n[t][0]&&(t=r),n[r][0]>n[i][0]&&(i=r);return t<i?[[t],[i]]:t>i?[[i],[t]]:[[t]]}t.exports=i},{}],188:[function(n,t){"use strict";function i(n){var u=r(n),t=u.length,f;if(t<=2)return[];for(var e=new Array(t),o=u[t-1],i=0;i<t;++i)f=u[i],e[i]=[o,f],o=f;return e}t.exports=i;var r=n("monotone-convex-hull-2d")},{"monotone-convex-hull-2d":191}],189:[function(n,t){"use strict";function r(n,t){for(var f,u=n.length,r=new Array(u),i=0;i<t.length;++i)r[i]=n[t[i]];for(f=t.length,i=0;i<u;++i)t.indexOf(i)<0&&(r[f++]=n[i]);return r}function u(n,t){for(var u,r,i,f,s=n.length,e=t.length,o=0;o<s;++o)for(u=n[o],r=0;r<u.length;++r)if(i=u[r],i<e)u[r]=t[i];else{for(i-=e,f=0;f<e;++f)i>=t[f]&&(i+=1);u[r]=i}return n}function f(n,t){var f,o,s;try{return i(n,!0)}catch(h){return(f=e(n),f.length<=t)?[]:(o=r(n,f),s=i(o,!0),u(s,f))}}t.exports=f;var i=n("incremental-convex-hull"),e=n("affine-hull")},{"affine-hull":184,"incremental-convex-hull":190}],190:[function(n,t){"use strict";function r(n,t,i){this.vertices=n;this.adjacent=t;this.boundary=i;this.lastVisited=-1}function s(n,t,i){this.vertices=n;this.cell=t;this.index=i}function h(n,t){return o(n.vertices,t.vertices)}function c(n){for(var f,r,t=["function orient(){var tuple=this.tuple;return test("],i=0;i<=n;++i)i>0&&t.push(","),t.push("tuple[",i,"]");return t.push(")}return orient"),f=new Function("test",t.join("")),r=u[n+1],r||(r=u),f(r)}function e(n,t,i){var r,u;for(this.dimension=n,this.vertices=t,this.simplices=i,this.interior=i.filter(function(n){return!n.boundary}),this.tuple=new Array(n+1),r=0;r<=n;++r)this.tuple[r]=this.vertices[r];u=f[n];u||(u=f[n]=c(n));this.orient=u}function l(n,t){var a=n.length,f,v,y,h,s,o,d,b,i,k,l;if(0===a)throw new Error("Must have at least d+1 points");if(f=n[0].length,a<=f)throw new Error("Must input at least d+1 points");if(v=n.slice(0,f+1),y=u.apply(void 0,v),0===y)throw new Error("Input not in general position");for(h=new Array(f+1),i=0;i<=f;++i)h[i]=i;y<0&&(h[0]=1,h[1]=0);for(var p=new r(h,new Array(f+1),!1),c=p.adjacent,w=new Array(f+2),i=0;i<=f;++i){for(s=h.slice(),o=0;o<=f;++o)o===i&&(s[o]=-1);d=s[0];s[0]=s[1];s[1]=d;b=new r(s,new Array(f+1),!0);c[i]=b;w[i]=b}for(w[f+1]=p,i=0;i<=f;++i)for(var s=c[i].vertices,g=c[i].adjacent,o=0;o<=f;++o)if(k=s[o],k<0)g[o]=p;else for(l=0;l<=f;++l)c[l].vertices.indexOf(k)<0&&(g[o]=c[l]);for(var nt=new e(f,v,w),tt=!!t,i=f+1;i<a;++i)nt.insert(n[i],tt);return nt.boundary()}var u,o,f,i;t.exports=l;u=n("robust-orientation");o=n("simplicial-complex").compareCells;r.prototype.flip=function(){var t=this.vertices[0],n;this.vertices[0]=this.vertices[1];this.vertices[1]=t;n=this.adjacent[0];this.adjacent[0]=this.adjacent[1];this.adjacent[1]=n};f=[];i=e.prototype;i.handleBoundaryDegeneracy=function(n,t){var h=this.dimension,f=this.vertices.length-1,a=this.tuple,v=this.vertices,e=[n],c,u,i,l,r,o,s;for(n.lastVisited=-f;e.length>0;)for(n=e.pop(),c=(n.vertices,n.adjacent),u=0;u<=h;++u)if(i=c[u],i.boundary&&!(i.lastVisited<=-f)){for(l=i.vertices,r=0;r<=h;++r)o=l[r],a[r]=o<0?t:v[o];if(s=this.orient(),s>0)return i;i.lastVisited=-f;0===s&&e.push(i)}return null};i.walk=function(n,t){var f=this.vertices.length-1,o=this.dimension,c=this.vertices,e=this.tuple,l=t?this.interior.length*Math.random()|0:this.interior.length-1,r=this.interior[l],i,u,s,h;n:for(;!r.boundary;){for(var a=r.vertices,v=r.adjacent,i=0;i<=o;++i)e[i]=c[a[i]];for(r.lastVisited=f,i=0;i<=o;++i)if(u=v[i],!(u.lastVisited>=f)){if(s=e[i],e[i]=n,h=this.orient(),e[i]=s,h<0){r=u;continue n}u.lastVisited=u.boundary?-f:f}return}return r};i.addPeaks=function(n,t){var e=this.vertices.length-1,c=this.dimension,ct=this.vertices,ut=this.tuple,ft=this.interior,lt=this.simplices,b=[t],o,f,a,g,ot,tt,i,it,rt,u;for(t.lastVisited=e,t.vertices[t.vertices.indexOf(-1)]=e,t.boundary=!1,ft.push(t),o=[];b.length>0;){var t=b.pop(),et=t.vertices,k=t.adjacent,d=et.indexOf(e);if(!(d<0))for(u=0;u<=c;++u)if(u!==d&&(f=k[u],f.boundary&&!(f.lastVisited>=e))){if(a=f.vertices,f.lastVisited!==-e){for(g=0,i=0;i<=c;++i)a[i]<0?(g=i,ut[i]=n):ut[i]=ct[a[i]];if(ot=this.orient(),ot>0){a[g]=e;f.boundary=!1;ft.push(f);b.push(f);f.lastVisited=e;continue}f.lastVisited=-e}var st=f.adjacent,v=et.slice(),nt=k.slice(),l=new r(v,nt,!0);if(lt.push(l),tt=st.indexOf(t),!(tt<0))for(st[tt]=l,nt[d]=f,v[u]=-1,nt[u]=t,k[u]=l,l.flip(),i=0;i<=c;++i)if(it=v[i],!(it<0||it===e)){for(var ht=new Array(c-1),at=0,y=0;y<=c;++y)rt=v[y],rt<0||y===i||(ht[at++]=rt);o.push(new s(ht,l,i))}}}for(o.sort(h),u=0;u+1<o.length;u+=2){var p=o[u],w=o[u+1],vt=p.index,yt=w.index;vt<0||yt<0||(p.cell.adjacent[p.index]=w.cell,w.cell.adjacent[w.index]=p.cell)}};i.insert=function(n,t){var e=this.vertices,i,u,f;if(e.push(n),i=this.walk(n,t),i){for(var s=this.dimension,o=this.tuple,r=0;r<=s;++r)u=i.vertices[r],o[r]=u<0?n:e[u];f=this.orient(o);f<0||(0!==f||(i=this.handleBoundaryDegeneracy(i,n)))&&this.addPeaks(n,i)}};i.boundary=function(){for(var u,h,i=this.dimension,f=[],e=this.simplices,c=e.length,r=0;r<c;++r)if(u=e[r],u.boundary){for(var n=new Array(i),o=u.vertices,l=0,s=0,t=0;t<=i;++t)o[t]>=0?n[l++]=o[t]:s=1&t;s===(1&i)&&(h=n[0],n[0]=n[1],n[1]=h);f.push(n)}return f}},{"robust-orientation":192,"simplicial-complex":196}],191:[function(n,t){"use strict";function r(n){var o=n.length,s,u,t,h;if(o<3){for(s=new Array(o),t=0;t<o;++t)s[t]=t;return 2===o&&n[0][0]===n[1][0]&&n[0][1]===n[1][1]?[0]:s}for(u=new Array(o),t=0;t<o;++t)u[t]=t;u.sort(function(t,i){var r=n[t][0]-n[i][0];return r||n[t][1]-n[i][1]});for(var f=[u[0],u[1]],e=[u[0],u[1]],t=2;t<o;++t){for(var c=u[t],l=n[c],r=f.length;r>1&&i(n[f[r-2]],n[f[r-1]],l)<=0;)r-=1,f.pop();for(f.push(c),r=e.length;r>1&&i(n[e[r-2]],n[e[r-1]],l)>=0;)r-=1,e.pop();e.push(c)}for(var s=new Array(e.length+f.length-2),a=0,t=0,v=f.length;t<v;++t)s[a++]=f[t];for(h=e.length-2;h>0;--h)s[a++]=e[h];return s}t.exports=r;var i=n("robust-orientation")[3]},{"robust-orientation":192}],192:[function(n,t){"use strict";function e(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 s(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}function h(n){return 1&n?"-":""}function r(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(",r(n.slice(0,t)),",",r(n.slice(t)),")"].join("")}function o(n){if(2===n.length)return[["sum(prod(",n[0][0],",",n[1][1],"),prod(-",n[0][1],",",n[1][0],"))"].join("")];for(var i=[],t=0;t<n.length;++t)i.push(["scale(",r(o(e(n,t))),",",h(t),n[0][t],")"].join(""));return i}function u(n){for(var i=[],u=[],f=s(n),h=[],t=0;t<n;++t)0==(1&t)?i.push.apply(i,o(e(f,t))):u.push.apply(u,o(e(f,t))),h.push("m"+t);var p=r(i),w=r(u),c="orientation"+n+"Exact",b=["function ",c,"(",h.join(),"){var p=",p,",n=",w,",d=sub(p,n);return d[d.length-1];};return ",c].join("");return new Function("sum","prod","scale","sub",b)(a,l,v,y)}function c(n){var t=i[n.length];return t||(t=i[n.length]=u(n.length)),t.apply(void 0,n)}var l=n("two-product"),a=n("robust-sum"),v=n("robust-scale"),y=n("robust-subtract"),f=5,p=u(3),w=u(4),i=[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:p(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],h=t[1]-r[1],c=i[1]-r[1],l=n[2]-r[2],a=t[2]-r[2],v=i[2]-r[2],y=e*c,p=o*h,b=o*s,k=f*c,d=f*h,g=e*s,u=l*(y-p)+a*(b-k)+v*(d-g),tt=(Math.abs(y)+Math.abs(p))*Math.abs(l)+(Math.abs(b)+Math.abs(k))*Math.abs(a)+(Math.abs(d)+Math.abs(g))*Math.abs(v),nt=77715611723761027e-32*tt;return u>nt||-u>nt?u:w(n,t,i,r)}];!function(){for(var r,s,n;i.length<=f;)i.push(u(i.length));for(var e=[],o=["slow"],n=0;n<=f;++n)e.push("a"+n),o.push("o"+n);for(r=["function getOrientation(",e.join(),"){switch(arguments.length){case 0:case 1:return 0;"],n=2;n<=f;++n)r.push("case ",n,":return o",n,"(",e.slice(0,n).join(),");");for(r.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(r.join("")),s=Function.apply(void 0,o),t.exports=s.apply(void 0,[c].concat(i)),n=0;n<=f;++n)t.exports[n]=i[n]}()},{"robust-scale":193,"robust-subtract":194,"robust-sum":195,"two-product":197}],193:[function(n,t){"use strict";function r(n,t){var h=n.length,o,s,l;if(1===h)return o=i(n[0],t),o[0]?o:[o[1]];var f=new Array(2*h),r=[.1,.1],c=[.1,.1],e=0;for(i(n[0],t,r),r[0]&&(f[e++]=r[0]),s=1;s<h;++s){i(n[s],t,c);l=r[1];u(l,c[0],r);r[0]&&(f[e++]=r[0]);var a=c[1],v=r[1],y=a+v,w=y-a,p=v-w;r[1]=y;p&&(f[e++]=p)}return r[1]&&(f[e++]=r[1]),0===e&&(f[e++]=0),f.length=e,f}var i=n("two-product"),u=n("two-sum");t.exports=r},{"two-product":197,"two-sum":198}],194:[function(n,t){"use strict";function i(n,t){var i=n+t,r=i-n,f=i-r,e=t-r,o=n-f,u=o+e;return u?[u,i]:[i]}function r(n,t){var v=0|n.length,y=0|t.length;if(1===v&&1===y)return i(n[0],-t[0]);var r,e,ft=v+y,w=new Array(ft),b=0,o=0,s=0,k=Math.abs,h=n[o],nt=k(h),c=-t[s],tt=k(c);nt<tt?(e=h,(o+=1)<v&&(h=n[o],nt=k(h))):(e=c,(s+=1)<y&&(c=-t[s],tt=k(c)));o<v&&nt<tt||s>=y?(r=h,(o+=1)<v&&(h=n[o],nt=k(h))):(r=c,(s+=1)<y&&(c=-t[s],tt=k(c)));for(var l,p,it,rt,ut,u=r+e,g=u-r,a=e-g,d=a,f=u;o<v&&s<y;)nt<tt?(r=h,(o+=1)<v&&(h=n[o],nt=k(h))):(r=c,(s+=1)<y&&(c=-t[s],tt=k(c))),e=d,u=r+e,g=u-r,a=e-g,a&&(w[b++]=a),l=f+u,p=l-f,it=l-p,rt=u-p,ut=f-it,d=ut+rt,f=l;for(;o<v;)r=h,e=d,u=r+e,g=u-r,a=e-g,a&&(w[b++]=a),l=f+u,p=l-f,it=l-p,rt=u-p,ut=f-it,d=ut+rt,f=l,(o+=1)<v&&(h=n[o]);for(;s<y;)r=c,e=d,u=r+e,g=u-r,a=e-g,a&&(w[b++]=a),l=f+u,p=l-f,it=l-p,rt=u-p,ut=f-it,d=ut+rt,f=l,(s+=1)<y&&(c=-t[s]);return d&&(w[b++]=d),f&&(w[b++]=f),b||(w[b++]=0),w.length=b,w}t.exports=r},{}],195:[function(n,t){"use strict";function i(n,t){var i=n+t,r=i-n,f=i-r,e=t-r,o=n-f,u=o+e;return u?[u,i]:[i]}function r(n,t){var v=0|n.length,y=0|t.length;if(1===v&&1===y)return i(n[0],t[0]);var r,e,ft=v+y,w=new Array(ft),b=0,o=0,s=0,k=Math.abs,h=n[o],nt=k(h),c=t[s],tt=k(c);nt<tt?(e=h,(o+=1)<v&&(h=n[o],nt=k(h))):(e=c,(s+=1)<y&&(c=t[s],tt=k(c)));o<v&&nt<tt||s>=y?(r=h,(o+=1)<v&&(h=n[o],nt=k(h))):(r=c,(s+=1)<y&&(c=t[s],tt=k(c)));for(var l,p,it,rt,ut,u=r+e,g=u-r,a=e-g,d=a,f=u;o<v&&s<y;)nt<tt?(r=h,(o+=1)<v&&(h=n[o],nt=k(h))):(r=c,(s+=1)<y&&(c=t[s],tt=k(c))),e=d,u=r+e,g=u-r,a=e-g,a&&(w[b++]=a),l=f+u,p=l-f,it=l-p,rt=u-p,ut=f-it,d=ut+rt,f=l;for(;o<v;)r=h,e=d,u=r+e,g=u-r,a=e-g,a&&(w[b++]=a),l=f+u,p=l-f,it=l-p,rt=u-p,ut=f-it,d=ut+rt,f=l,(o+=1)<v&&(h=n[o]);for(;s<y;)r=c,e=d,u=r+e,g=u-r,a=e-g,a&&(w[b++]=a),l=f+u,p=l-f,it=l-p,rt=u-p,ut=f-it,d=ut+rt,f=l,(s+=1)<y&&(c=t[s]);return d&&(w[b++]=d),f&&(w[b++]=f),b||(w[b++]=0),w.length=b,w}t.exports=r},{}],196:[function(n,t,i){"use strict";"use restrict";function l(n){for(var t=0,r=Math.max,i=0,u=n.length;i<u;++i)t=r(t,n[i].length);return t-1}function a(n){for(var t=-1,f=Math.max,i=0,e=n.length;i<e;++i)for(var u=n[i],r=0,o=u.length;r<o;++r)t=f(t,u[r]);return t+1}function v(n){for(var i=new Array(n.length),t=0,r=n.length;t<r;++t)i[t]=n[t].slice(0);return i}function r(n,t){var c=n.length,f=n.length-t.length,i=Math.min,r,e,o,s,h,u;if(f)return f;switch(c){case 0:return 0;case 1:return n[0]-t[0];case 2:return r=n[0]+n[1]-t[0]-t[1],r||i(n[0],n[1])-i(t[0],t[1]);case 3:if(e=n[0]+n[1],o=t[0]+t[1],r=e+n[2]-(o+t[2]))return r;var l=i(n[0],n[1]),a=i(t[0],t[1]),r=i(l,n[2])-i(a,t[2]);return r||i(l+n[2],e)-i(a+t[2],o);default:for(s=n.slice(0),s.sort(),h=t.slice(0),h.sort(),u=0;u<c;++u)if(f=s[u]-h[u])return f;return 0}}function y(n,t){return r(n[0],t[0])}function u(n,t){var i;if(t){for(var f=n.length,u=new Array(f),i=0;i<f;++i)u[i]=[n[i],t[i]];for(u.sort(y),i=0;i<f;++i)n[i]=u[i][0],t[i]=u[i][1];return n}return n.sort(r),n}function e(n){var u;if(0===n.length)return[];for(var i=1,f=n.length,t=1;t<f;++t)if(u=n[t],r(u,n[t-1])){if(t===i){i++;continue}n[i++]=u}return n.length=i,n}function f(n,t){for(var i,u,f=0,e=n.length-1,o=-1;f<=e;)i=f+e>>1,u=r(n[i],t),u<=0?(0===u&&(o=i),f=i+1):u>0&&(e=i-1);return o}function s(n,t){for(var v,u,e,o=new Array(n.length),i=0,y=o.length;i<y;++i)o[i]=[];for(var s=[],i=0,p=t.length;i<p;++i)for(var l=t[i],a=l.length,c=1,w=1<<a;c<w;++c){for(s.length=h.popCount(c),v=0,u=0;u<a;++u)c&1<<u&&(s[v++]=l[u]);if(e=f(n,s),!(e<0))for(;;)if(o[e++].push(i),e>=n.length||0!==r(n[e],s))break}return o}function p(n,t){var r,i,f;if(!t)return s(e(o(n,0)),n,0);for(r=new Array(t),i=0;i<t;++i)r[i]=[];for(i=0,f=n.length;i<f;++i)for(var h=n[i],u=0,c=h.length;u<c;++u)r[h[u]].push(i);return r}function w(n){for(var f,t,e=[],i=0,h=n.length;i<h;++i)for(var o=n[i],s=0|o.length,r=1,c=1<<s;r<c;++r){for(f=[],t=0;t<s;++t)r>>>t&1&&f.push(o[t]);e.push(f)}return u(e)}function o(n,t){var r,i;if(t<0)return[];for(var o=[],c=(1<<t+1)-1,e=0;e<n.length;++e)for(r=n[e],i=c;i<1<<r.length;i=h.nextCombination(i)){for(var s=new Array(t+1),l=0,f=0;f<r.length;++f)i&1<<f&&(s[l++]=r[f]);o.push(s)}return u(o)}function b(n){for(var e=[],i=0,h=n.length;i<h;++i)for(var r=n[i],f=0,o=r.length;f<o;++f){for(var s=new Array(r.length-1),t=0,c=0;t<o;++t)t!==f&&(s[c++]=r[t]);e.push(s)}return u(e)}function k(n,t){for(var r,u,o,h,e=new c(t),i=0;i<n.length;++i)for(r=n[i],u=0;u<r.length;++u)for(o=u+1;o<r.length;++o)e.link(r[u],r[o]);for(var s=[],f=e.ranks,i=0;i<f.length;++i)f[i]=-1;for(i=0;i<n.length;++i)h=e.find(n[i][0]),f[h]<0?(f[h]=s.length,s.push([n[i].slice(0)])):s[f[h]].push(n[i].slice(0));return s}function d(n){for(var i,r,p,l,v,h=e(u(o(n,0))),y=new c(h.length),t=0;t<n.length;++t)for(i=n[t],r=0;r<i.length;++r)for(p=f(h,[i[r]]),l=r+1;l<i.length;++l)y.link(p,f(h,[i[l]]));for(var a=[],s=y.ranks,t=0;t<s.length;++t)s[t]=-1;for(t=0;t<n.length;++t)v=y.find(f(h,[n[t][0]])),s[v]<0?(s[v]=a.length,a.push([n[t].slice(0)])):a[s[v]].push(n[t].slice(0));return a}function g(n,t){return t?k(n,t):d(n)}var h=n("bit-twiddle"),c=n("union-find");i.dimension=l;i.countVertices=a;i.cloneCells=v;i.compareCells=r;i.normalize=u;i.unique=e;i.findCell=f;i.incidence=s;i.dual=p;i.explode=w;i.skeleton=o;i.boundary=b;i.connectedComponents=g},{"bit-twiddle":185,"union-find":199}],197:[function(n,t){"use strict";function r(n,t,r){var u=n*t,o=i*n,a=o-n,f=o-a,s=n-f,h=i*t,v=h-t,e=h-v,c=t-e,y=u-f*e,p=y-s*e,w=p-f*c,l=s*c-w;return r?(r[0]=l,r[1]=u,r):[l,u]}t.exports=r;var i=+(Math.pow(2,27)+1)},{}],198:[function(n,t){"use strict";function i(n,t,i){var r=n+t,u=r-n,o=r-u,f=t-u,e=n-o;return i?(i[0]=e+f,i[1]=r,i):[e+f,r]}t.exports=i},{}],199:[function(n,t){"use strict";"use restrict";function r(n){this.roots=new Array(n);this.ranks=new Array(n);for(var t=0;t<n;++t)this.roots[t]=t,this.ranks[t]=0}t.exports=r;var i=r.prototype;Object.defineProperty(i,"length",{get:function(){return this.roots.length}});i.makeSet=function(){var n=this.roots.length;return this.roots.push(n),this.ranks.push(0),n};i.find=function(n){for(var r,i=n,t=this.roots;t[n]!==n;)n=t[n];for(;t[i]!==n;)r=t[i],t[i]=n,i=r;return n};i.link=function(n,t){var i=this.find(n),r=this.find(t);if(i!==r){var u=this.ranks,f=this.roots,e=u[i],o=u[r];e<o?f[i]=r:o<e?f[r]=i:(f[r]=i,++u[i])}}},{}],200:[function(n,t){var i=n("@turf/meta"),r=n("@turf/helpers"),u=r.point,f=i.coordEach,e=i.featureEach,o=r.featureCollection;t.exports=function(n){var t=[];return"FeatureCollection"===n.type?e(n,function(n){f(n,function(i){t.push(u(i,n.properties))})}):f(n,function(i){t.push(u(i,n.properties))}),o(t)}},{"@turf/helpers":201,"@turf/meta":202}],201:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],202:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],203:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],204:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],205:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],206:[function(n,t,i){arguments[4][168][0].apply(i,arguments)},{"@turf/bbox":207,"@turf/helpers":209,dup:168}],207:[function(n,t,i){arguments[4][22][0].apply(i,arguments)},{"@turf/meta":208,dup:22}],208:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],209:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],210:[function(n,t,i){arguments[4][178][0].apply(i,arguments)},{"@turf/helpers":211,"@turf/meta":212,dup:178}],211:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],212:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],213:[function(n,t){var i=n("@turf/destination"),r=n("@turf/helpers").polygon;t.exports=function(n,t,u,f,e){if(!n)throw new Error("center is required");if(!t)throw new Error("radius is required");u=u||64;e=e||n.properties||{};for(var o=[],s=0;s<u;s++)o.push(i(n,t,360*s/u,f).geometry.coordinates);return o.push(o[0]),r([o],e)}},{"@turf/destination":214,"@turf/helpers":217}],214:[function(n,t,i){arguments[4][5][0].apply(i,arguments)},{"@turf/helpers":215,"@turf/invariant":216,dup:5}],215:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],216:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],217:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],218:[function(n,t,i){arguments[4][83][0].apply(i,arguments)},{"@turf/helpers":219,"@turf/invariant":220,dup:83}],219:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],220:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],221:[function(n,t){function r(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=u(n.properties),t.geometry=i(n.geometry),t}function u(n){var t={};return n?(Object.keys(n).forEach(function(i){var r=n[i];"object"==typeof r?(r.length&&(t[i]=r.map(function(n){return n})),t[i]=u(r)):t[i]=r}),t):t}function e(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 r(n)}),t}function i(n){var t={type:n.type};return n.bbox&&(t.bbox=n.bbox),"GeometryCollection"===n.type?(t.geometries=n.geometries.map(function(n){return i(n)}),t):(t.coordinates=f(n.coordinates),t)}function f(n){return"object"!=typeof n[0]?n.slice():n.map(function(n){return f(n)})}t.exports=function(n){if(!n)throw new Error("geojson is required");switch(n.type){case"Feature":return r(n);case"FeatureCollection":return e(n);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return i(n);default:throw new Error("unknown GeoJSON type");}}},{}],222:[function(n,t){var i=n("@turf/meta"),r=n("@turf/clone"),u=n("@turf/helpers"),f=n("@turf/invariant"),e=n("density-clustering"),o=n("@turf/distance"),s=i.coordAll,h=f.collectionOf,c=u.convertDistance;t.exports=function(n,t,i,u){if(h(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===u||null===u||Math.sign(u)>0))throw new Error("Invalid minPoints");n=r(n,!0);u=u||3;var f=new e.DBSCAN,a=f.run(s(n),c(t,i),u,o),l=-1;return a.forEach(function(t){l++;t.forEach(function(t){var i=n.features[t];i.properties||(i.properties={});i.properties.cluster=l;i.properties.dbscan="core"})}),f.noise.forEach(function(t){var i=n.features[t];i.properties||(i.properties={});i.properties.dbscan=i.properties.cluster?"edge":"noise"}),n}},{"@turf/clone":223,"@turf/distance":224,"@turf/helpers":227,"@turf/invariant":228,"@turf/meta":229,"density-clustering":234}],223:[function(n,t,i){arguments[4][221][0].apply(i,arguments)},{dup:221}],224:[function(n,t,i){arguments[4][8][0].apply(i,arguments)},{"@turf/helpers":225,"@turf/invariant":226,dup:8}],225:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],226:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],227:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],228:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],229:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],230:[function(n,t){function i(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)}i.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};i.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)};i.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)};i.prototype._addToCluster=function(n,t){this.clusters[t].push(n);this._assigned[n]=1};i.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};i.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};i.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)};void 0!==t&&t.exports&&(t.exports=i)},{}],231:[function(n,t){function i(n,t,i){this.k=3;this.dataset=[];this.assignments=[];this.centroids=[];this.init(n,t,i)}i.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)};i.prototype.run=function(n,t){var c,e,o,r,u,f,i;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()};i.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};i.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};i.prototype.getClusters=function(){for(var n,t=new Array(this.k),i=0;i<this.assignments.length;i++)n=this.assignments[i],void 0===t[n]&&(t[n]=[]),t[n].push(i);return t};i.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};i.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)};void 0!==t&&t.exports&&(t.exports=i)},{}],232:[function(n,t){function i(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(void 0!==t&&t.exports)var r=n("./PriorityQueue.js");i.prototype.run=function(n,t,i,u){var f,o,s,e,h;for(this._init(n,t,i,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 r(null,null,"asc"),h=this._regionQuery(f),void 0!==this._distanceToCore(f)&&(this._updateQueue(f,h,e),this._expandCluster(s,e)));return this.clusters};i.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};i.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)};i.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))}})};i.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)))};i.prototype._distanceToCore=function(n){for(var i=this.epsilon,t=0;t<i;t++)if(this._regionQuery(n,t).length>=this.minPts)return t};i.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};i.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)};void 0!==t&&t.exports&&(t.exports=i)},{"./PriorityQueue.js":233}],233:[function(n,t){function i(n,t,i){this._queue=[];this._priorities=[];this._sorting="desc";this._init(n,t,i)}i.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)};i.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}};i.prototype.forEach=function(n){this._queue.forEach(n)};i.prototype.getElements=function(){return this._queue};i.prototype.getElementPriority=function(n){return this._priorities[n]};i.prototype.getPriorities=function(){return this._priorities};i.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};i.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)};i.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))};void 0!==t&&t.exports&&(t.exports=i)},{}],234:[function(n,t){void 0!==t&&t.exports&&(t.exports={DBSCAN:n("./DBSCAN.js"),KMEANS:n("./KMEANS.js"),OPTICS:n("./OPTICS.js"),PriorityQueue:n("./PriorityQueue.js")})},{"./DBSCAN.js":230,"./KMEANS.js":231,"./OPTICS.js":232,"./PriorityQueue.js":233}],235:[function(n,t){var i=n("@turf/meta"),r=n("@turf/clone"),u=n("skmeans"),f=n("@turf/invariant"),e=i.coordAll,o=i.featureEach,s=f.collectionOf;t.exports=function(n,t,i){var f;s(n,"Point","Input must contain Points");f=n.features.length;t=t||Math.round(Math.sqrt(f/2));t>f&&(t=f);!1!==i&&void 0!==i||(n=r(n,!0));var h=e(n),a=h.slice(0,t),c=u(h,t,a),l={};return c.centroids.forEach(function(n,t){l[t]=n}),o(n,function(n,t){var i=c.idxs[t];n.properties.cluster=i;n.properties.centroid=l[i]}),n}},{"@turf/clone":236,"@turf/invariant":237,"@turf/meta":238,skmeans:241}],236:[function(n,t,i){arguments[4][221][0].apply(i,arguments)},{dup:221}],237:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],238:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],239:[function(n,t){"use strict";t.exports={eudist: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},mandist:function(n,t,i){for(var f=n.length,u=0,r=0;r<f;r++)u+=Math.abs((n[r]||0)-(t[r]||0));return i?Math.sqrt(u):u},dist:function(n,t,i){var r=Math.abs(n-t);return i?r:r*r}}},{}],240:[function(n,t){"use strict";var i=n("./distance.js"),r=i.eudist,u=i.dist;t.exports={kmrand: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},kmpp:function(n,t){var d=n[0].length?r:u,e=[],o=n.length,g=n[0].length>0,y=n[Math.floor(Math.random()*o)],nt=g?y.join("_"):""+y,c,l,w,a,f,s,k,v;for(e.push(y),{}[nt]=!0;e.length<t;){for(var p=[],tt=e.length,b=0,i=[],h=0;h<o;h++){for(c=1/0,l=0;l<tt;l++)w=d(n[h],e[l]),w<=c&&(c=w);p[h]=c}for(a=0;a<o;a++)b+=p[a];for(f=0;f<o;f++)i[f]={i:f,v:n[f],pr:p[f]/b,cs:0};for(i.sort(function(n,t){return n.pr-t.pr}),i[0].cs=i[0].pr,s=1;s<o;s++)i[s].cs=i[s-1].cs+i[s].pr;for(k=Math.random(),v=0;v<o-1&&i[v++].cs<k;);e.push(i[v-1].v)}return e}}},{"./distance.js":239}],241:[function(n,t){"use strict";function r(n,t,i){i=i||[];for(var r=0;r<n;r++)i[r]=t;return i}function e(n,t,i,u){var e=[],tt=[],it=[],rt=[],c=!1,vt=u||f,ut=n.length,w=n[0].length,ct=w>0,ft=[],lt,et,a,ot,k,l,d,g,p,nt;if(i)e="kmrand"==i?s(n,t):"kmpp"==i?h(n,t):i;else for(lt={};e.length<t;)et=Math.floor(Math.random()*ut),lt[et]||(lt[et]=!0,e.push(n[et]));do{for(r(t,0,ft),a=0;a<ut;a++){for(var yt=1/0,at=0,b=0;b<t;b++)rt=ct?o(n[a],e[b]):Math.abs(n[a]-e[b]),rt<=yt&&(yt=rt,at=b);it[a]=at;ft[at]++}for(var v=[],tt=[],y=0;y<t;y++)v[y]=ct?r(w,0,v[y]):0,tt[y]=e[y];if(ct){for(ot=0;ot<t;ot++)e[ot]=[];for(k=0;k<ut;k++)for(var wt=it[k],bt=v[wt],kt=n[k],st=0;st<w;st++)bt[st]+=kt[st];for(c=!0,l=0;l<t;l++){for(var pt=e[l],dt=v[l],gt=tt[l],ni=ft[l],ht=0;ht<w;ht++)pt[ht]=dt[ht]/ni||0;if(c)for(d=0;d<w;d++)if(gt[d]!=pt[d]){c=!1;break}}}else{for(g=0;g<ut;g++)v[it[g]]+=n[g];for(p=0;p<t;p++)e[p]=v[p]/ft[p]||0;for(c=!0,nt=0;nt<t;nt++)if(tt[nt]!=e[nt]){c=!1;break}}c=c||--vt<=0}while(!c);return{it:f-vt,k:t,idxs:it,centroids:e}}var i=n("./distance.js"),u=n("./kinit.js"),o=i.eudist,s=(i.mandist,i.dist,u.kmrand),h=u.kmpp,f=1e4;t.exports=e},{"./distance.js":239,"./kinit.js":240}],242:[function(n,t){function s(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 r=[];return e(n,function(n){i(n.properties,t)&&r.push(n)}),o(r)}function r(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 e=u(n,t),s=Object.keys(e),r=0;r<s.length;r++){for(var h=s[r],c=e[h],l=[],f=0;f<c.length;f++)l.push(n.features[c[f]]);i(o(l),h,r)}}function h(n,t,i,u){var f=u;return r(n,t,function(n,t,r){f=0===r&&void 0===u?n:i(f,n,t,r)}),f}function u(n,t){var i={};return e(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 i(n,t){var u,r;if(void 0===n)return!1;if(u=typeof t,"number"===u||"string"===u)return n.hasOwnProperty(t);if(Array.isArray(t)){for(r=0;r<t.length;r++)if(!i(n,t[r]))return!1;return!0}return f(n,t)}function f(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 c(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}var e=n("@turf/meta").featureEach,o=n("@turf/helpers").featureCollection;t.exports={getCluster:s,clusterEach:r,clusterReduce:h,createBins:u,applyFilter:i,propertiesContainsFilter:f,filterProperties:c}},{"@turf/helpers":243,"@turf/meta":244}],243:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],244:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],245:[function(n,t){var i=n("@turf/bbox"),r=n("@turf/inside"),u=n("rbush");t.exports=function(n,t,f,e){var o=u(6),s=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[f]}});return o.load(s),n.features.forEach(function(n){n.properties||(n.properties={});var t=i(n),f=o.search({minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]}),u=[];f.forEach(function(t){r({type:"Point",coordinates:[t.minX,t.minY]},n)&&u.push(t.property)});n.properties[e]=u}),n}},{"@turf/bbox":246,"@turf/inside":248,rbush:251}],246:[function(n,t,i){arguments[4][22][0].apply(i,arguments)},{"@turf/meta":247,dup:22}],247:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],248:[function(n,t,i){arguments[4][36][0].apply(i,arguments)},{"@turf/invariant":249,dup:36}],249:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],250:[function(n,t,i){arguments[4][56][0].apply(i,arguments)},{dup:56}],251:[function(n,t,i){arguments[4][57][0].apply(i,arguments)},{dup:57,quickselect:250}],252:[function(n,t){var i=n("@turf/meta");t.exports=function(n){function r(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:[]}},u=Object.keys(t).reduce(function(n,t){return n[t.replace("Multi","")]=t,n},{});return i.featureEach(n,function(n){n.geometry&&(t[n.geometry.type]?r(n,n.geometry.type,!0):u[n.geometry.type]&&r(n,u[n.geometry.type],!1))}),{type:"FeatureCollection",features:Object.keys(t).filter(function(n){return t[n].coordinates.length}).sort().map(function(n){return{type:"Feature",properties:{collectedProperties:t[n].properties},geometry:{type:n,coordinates:t[n].coordinates}}})}}},{"@turf/meta":253}],253:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],254:[function(n,t){function u(n){var t=[],i={};return o(n,function(n){if(n.geometry){var r=n.geometry.coordinates.join("-");i.hasOwnProperty(r)||(t.push(n),i[r]=!0)}}),h(t)}var f=n("@turf/tin"),r=n("@turf/helpers"),i=n("@turf/distance"),e=n("geojson-dissolve"),o=n("@turf/meta").featureEach,s=r.feature,h=r.featureCollection;t.exports=function(n,t,r){var c,h,o;if(!n)throw new Error("points is required");if(void 0===t||null===t)throw new Error("maxEdge is required");if("number"!=typeof t)throw new Error("invalid maxEdge");if(c=u(n),h=f(c),h.features=h.features.filter(function(n){var u=n.geometry.coordinates[0][0],f=n.geometry.coordinates[0][1],e=n.geometry.coordinates[0][2],o=i(u,f,r),s=i(f,e,r),h=i(u,e,r);return o<=t&&s<=t&&h<=t}),h.features.length<1)throw new Error("too few polygons found to compute concave hull");return o=e(h.features),1===o.coordinates.length&&(o.coordinates=o.coordinates[0],o.type="Polygon"),s(o)}},{"@turf/distance":255,"@turf/helpers":258,"@turf/meta":259,"@turf/tin":260,"geojson-dissolve":262}],255:[function(n,t,i){arguments[4][8][0].apply(i,arguments)},{"@turf/helpers":256,"@turf/invariant":257,dup:8}],256:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],257:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],258:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],259:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],260:[function(n,t){function i(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 u(n,t){return t.x-n.x}function f(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 e(n){if(n.length<3)return[];n.sort(u);for(var y,h,p,d,g,nt,r=n.length-1,tt=n[r].x,it=n[0].x,l=n[r].y,w=l;r--;)n[r].y<l&&(l=n[r].y),n[r].y>w&&(w=n[r].y);var t,o=it-tt,a=w-l,v=o>a?o:a,b=.5*(it+tt),k=.5*(w+l),e=[new i({x:b-20*v,y:k-v,__sentinel:!0},{x:b,y:k+20*v,__sentinel:!0},{x:b+20*v,y:k-v,__sentinel:!0})],s=[],c=[];for(r=n.length;r--;){for(c.length=0,t=e.length;t--;)o=n[r].x-e[t].x,o>0&&o*o>e[t].r?(s.push(e[t]),e.splice(t,1)):(a=n[r].y-e[t].y,o*o+a*a>e[t].r||(c.push(e[t].a,e[t].b,e[t].b,e[t].c,e[t].c,e[t].a),e.splice(t,1)));for(f(c),t=c.length;t;)h=c[--t],y=c[--t],p=n[r],d=h.x-y.x,g=h.y-y.y,nt=2*(d*(p.y-h.y)-g*(p.x-h.x)),Math.abs(nt)>1e-12&&e.push(new i(y,h,p))}for(Array.prototype.push.apply(s,e),r=s.length;r--;)(s[r].a.__sentinel||s[r].b.__sentinel||s[r].c.__sentinel)&&s.splice(r,1);return s}var r=n("@turf/helpers"),o=r.polygon,s=r.featureCollection;t.exports=function(n,t){if("FeatureCollection"!==n.type)throw new Error("points must be a FeatureCollection");var i=!1;return s(e(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},o([[t,r,u,t]],f)}))}},{"@turf/helpers":261}],261:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],262:[function(n,t){function i(n){return n.length?Array.isArray(n[0])?n[0]:Array.prototype.slice.call(n):[]}function r(n){var i={geoms:{type:"GeometryCollection",geometries:JSON.parse(JSON.stringify(n))}},t=e(i);return o(t,t.objects.geoms.geometries)}function u(n){for(var t=null,i=0;i<n.length;i++)if(t){if(t!==n[i].type)return null}else t=n[i].type;return t}function f(){var f=i(arguments),n=f.reduce(function(n,t){var i=c(t),r;for(Array.isArray(i)||(i=[i]),r=0;r<i.length;r++)h(i[r],function(t){n.push(t)});return n},[]),t=u(n);if(!t)throw new Error("List does not contain only homoegenous GeoJSON");switch(t){case"LineString":return s(n);case"Polygon":return r(n);default:return n}}var e=n("topojson-server").topology,o=n("topojson-client").merge,s=n("geojson-linestring-dissolve"),h=n("@turf/meta").geomEach,c=n("geojson-flatten");t.exports=f},{"@turf/meta":259,"geojson-flatten":263,"geojson-linestring-dissolve":264,"topojson-client":265,"topojson-server":266}],263:[function(n,t){function i(n){switch(n&&n.type||null){case"FeatureCollection":return n.features=n.features.reduce(function(n,t){return n.concat(i(t))},[]),n;case"Feature":return n.geometry?i(n.geometry).map(function(t){return{type:"Feature",properties:JSON.parse(JSON.stringify(n.properties)),geometry:t}}):n;case"MultiPoint":return n.coordinates.map(function(n){return{type:"Point",coordinates:n}});case"MultiPolygon":return n.coordinates.map(function(n){return{type:"Polygon",coordinates:n}});case"MultiLineString":return n.coordinates.map(function(n){return{type:"LineString",coordinates:n}});case"GeometryCollection":return n.geometries.map(i).reduce(function(n,t){return n.concat(t)},[]);case"Point":case"Polygon":case"LineString":return[n]}}t.exports=i},{}],264:[function(n,t){function i(n){return n[0].toString()+","+n[1].toString()}function r(n,t){var r,u=i(n.coordinates[0]),f=i(n.coordinates[n.coordinates.length-1]),e=i(t.coordinates[0]),o=i(t.coordinates[t.coordinates.length-1]);if(u===o)r=t.coordinates.concat(n.coordinates.slice(1));else if(e===f)r=n.coordinates.concat(t.coordinates.slice(1));else if(u===e)r=n.coordinates.slice(1).reverse().concat(t.coordinates);else{if(f!==o)return null;r=n.coordinates.concat(t.coordinates.reverse().slice(1))}return{type:"LineString",coordinates:r}}function u(n){for(var u,t=n.slice(),i=[];t.length>0;)u=t.shift(),t=t.reduce(function(n,t){var i=r(u,t);return i?u=i:n.push(t),n},[]),i.push(u);return 1===i.length?i[0]:{type:"MultiLineString",coordinates:i.map(function(n){return n.coordinates})}}t.exports=u},{}],265:[function(t,i,r){!function(t,u){"object"==typeof r&&void 0!==i?u(r):"function"==typeof n&&n.amd?n(["exports"],u):u(t.topojson=t.topojson||{})}(this,function(n){"use strict";function r(n,i){var r=i.id,u=i.bbox,f=null==i.properties?{}:i.properties,e=t(n,i);return null==r&&null==u?{type:"Feature",properties:f,geometry:e}:null==u?{type:"Feature",id:r,properties:f,geometry:e}:{type:"Feature",id:r,bbox:u,properties:f,geometry:e}}function t(n,t){function s(n,t){t.length&&t.pop();for(var r=c[n<0?~n:n],i=0,u=r.length;i<u;++i)t.push(o(r[i],i));n<0&&v(t,u)}function u(n){return o(n)}function r(n){for(var t=[],i=0,r=n.length;i<r;++i)s(n[i],t);return t.length<2&&t.push(t[0]),t}function h(n){for(var t=r(n);t.length<4;)t.push(t[0]);return t}function f(n){return n.map(h)}function e(n){var t,i=n.type;switch(i){case"GeometryCollection":return{type:i,geometries:n.geometries.map(e)};case"Point":t=u(n.coordinates);break;case"MultiPoint":t=n.coordinates.map(u);break;case"LineString":t=r(n.arcs);break;case"MultiLineString":t=n.arcs.map(r);break;case"Polygon":t=f(n.arcs);break;case"MultiPolygon":t=n.arcs.map(f);break;default:return null}return{type:i,coordinates:t}}var o=i(n.transform),c=n.arcs;return e(t)}function u(n,t,i){var u,r,f;if(arguments.length>1)u=l(n,t,i);else for(r=0,u=new Array(f=n.arcs.length);r<f;++r)u[r]=r;return{type:"MultiLineString",arcs:s(n,u)}}function l(n,t,i){function h(n){var t=n<0?~n:n;(u[t]||(u[t]=[])).push({i:n,g:s})}function f(n){n.forEach(h)}function e(n){n.forEach(f)}function c(n){n.forEach(e)}function o(n){switch(s=n,n.type){case"GeometryCollection":n.geometries.forEach(o);break;case"LineString":f(n.arcs);break;case"MultiLineString":case"Polygon":e(n.arcs);break;case"MultiPolygon":c(n.arcs)}}var s,r=[],u=[];return o(t),u.forEach(null==i?function(n){r.push(n[0].i)}:function(n){i(n[0].g,n[n.length-1].g)&&r.push(n[0].i)}),r}function a(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)}function f(n,i){function f(n){switch(n.type){case"GeometryCollection":n.geometries.forEach(f);break;case"Polygon":e(n.arcs);break;case"MultiPolygon":n.arcs.forEach(e)}}function e(n){n.forEach(function(t){t.forEach(function(t){(r[t=t<0?~t:t]||(r[t]=[])).push(n)})});u.push(n)}function o(i){return a(t(n,{type:"Polygon",arcs:[i]}).coordinates[0])}var r={},u=[],h=[];return i.forEach(f),u.forEach(function(n){if(!n._){var t=[],i=[n];for(n._=1,h.push(t);n=i.pop();)t.push(n),n.forEach(function(n){n.forEach(function(n){r[n<0?~n:n].forEach(function(n){n._||(n._=1,i.push(n))})})})}}),u.forEach(function(n){delete n._}),{type:"MultiPolygon",arcs:h.map(function(t){var e,i=[],h,c,u,f;if(t.forEach(function(n){n.forEach(function(n){n.forEach(function(n){r[n<0?~n:n].length<2&&i.push(n)})})}),i=s(n,i),(e=i.length)>1)for(u=1,f=o(i[0]);u<e;++u)(h=o(i[u]))>f&&(c=i[0],i[0]=i[u],i[u]=c,f=h);return i})}}var e=function(n){return n},i=function(n){if(null==n)return e;var t,i,r=n.scale[0],u=n.scale[1],f=n.translate[0],o=n.translate[1];return function(n,e){e||(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+o;s<c;)h[s]=n[s],++s;return h}},o=function(n){function e(n){n=h(n);n[0]<t&&(t=n[0]);n[0]>u&&(u=n[0]);n[1]<r&&(r=n[1]);n[1]>f&&(f=n[1])}function o(n){switch(n.type){case"GeometryCollection":n.geometries.forEach(o);break;case"Point":e(n.coordinates);break;case"MultiPoint":n.coordinates.forEach(e)}}var s,h=i(n.transform),t=1/0,r=t,u=-t,f=-t;n.arcs.forEach(function(n){for(var i,e=-1,o=n.length;++e<o;)i=h(n[e],e),i[0]<t&&(t=i[0]),i[0]>u&&(u=i[0]),i[1]<r&&(r=i[1]),i[1]>f&&(f=i[1])});for(s in n.objects)o(n.objects[s]);return[t,r,u,f]},v=function(n,t){for(var u,i=n.length,r=i-t;r<--i;)u=n[r],n[r++]=n[i],n[i]=u},y=function(n,t){return"GeometryCollection"===t.type?{type:"FeatureCollection",features:t.geometries.map(function(t){return r(n,t)})}:r(n,t)},s=function(n,t){function s(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]}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(n){var t,u,c=s(n),f=c[0],e=c[1],o,h;(t=r[f])?(delete r[t.end],t.push(n),t.end=e,u=i[e])?(delete i[u.start],o=u===t?t:t.concat(u),i[o.start=t.start]=r[o.end=u.end]=o):i[t.start]=r[t.end]=t:(t=i[e])?(delete i[t.start],t.unshift(n),t.start=f,u=r[f])?(delete r[u.end],h=u===t?t:u.concat(t),i[h.start=u.start]=r[h.end=t.end]=h):i[t.start]=r[t.end]=t:(t=[n],i[t.start=f]=r[t.end=e]=t)}),f(r,i),f(i,r),t.forEach(function(n){e[n<0?~n:n]||u.push([n])}),u},p=function(n){return t(n,u.apply(this,arguments))},w=function(n){return t(n,f.apply(this,arguments))},h=function(n,t){for(var u,i=0,r=n.length;i<r;)u=i+r>>>1,n[u]<t?i=u+1:r=u;return i},b=function(n){function a(n,t){n.forEach(function(n){n<0&&(n=~n);var i=f[n];i?i.push(t):f[n]=[t]})}function s(n,t){n.forEach(function(n){a(n,t)})}function v(n,t){"GeometryCollection"===n.type?n.geometries.forEach(function(n){v(n,t)}):n.type in y&&y[n.type](n.arcs,t)}var f={},c=n.map(function(){return[]}),y={LineString:a,MultiLineString:s,Polygon:s,MultiPolygon:function(n,t){n.forEach(function(n){s(n,t)})}},t,o,i,r,u;n.forEach(v);for(t in f)for(var l=f[t],p=l.length,e=0;e<p;++e)for(o=e+1;o<p;++o)r=l[e],u=l[o],(i=c[r])[t=h(i,u)]!==u&&i.splice(t,0,u),(i=c[u])[t=h(i,r)]!==r&&i.splice(t,0,r);return c},c=function(n){if(null==n)return e;var t,i,r=n.scale[0],u=n.scale[1],f=n.translate[0],o=n.translate[1];return function(n,e){e||(t=i=0);var s=2,c=n.length,h=new Array(c),l=Math.round((n[0]-f)/r),a=Math.round((n[1]-o)/u);for(h[0]=l-t,t=l,h[1]=a-i,i=a;s<c;)h[s]=n[s],++s;return h}},k=function(n,t){function h(n){return s(n)}function l(n){var t;switch(n.type){case"GeometryCollection":t={type:"GeometryCollection",geometries:n.geometries.map(l)};break;case"Point":t={type:"Point",coordinates:h(n.coordinates)};break;case"MultiPoint":t={type:"MultiPoint",coordinates:n.coordinates.map(h)};break;default:return n}return null!=n.id&&(t.id=n.id),null!=n.bbox&&(t.bbox=n.bbox),null!=n.properties&&(t.properties=n.properties),t}function w(n){var r,u=0,i=1,f=n.length,t=new Array(f);for(t[0]=s(n[0],0);++u<f;)((r=s(n[u],u))[0]||r[1])&&(t[i++]=r);return 1===i&&(t[i++]=[0,0]),t.length=i,t}if(n.transform)throw new Error("already quantized");if(t&&t.scale)i=n.bbox;else{if(!((r=Math.floor(t))>=2))throw new Error("n must be ≥2");i=n.bbox||o(n);var r,u=i[0],f=i[1],a=i[2],v=i[3];t={scale:[a-u?(a-u)/(r-1):1,v-f?(v-f)/(r-1):1],translate:[u,f]}}var i,e,s=c(t),y=n.objects,p={};for(e in y)p[e]=l(y[e]);return{type:"Topology",bbox:i,transform:t,objects:p,arcs:n.arcs.map(w)}};n.bbox=o;n.feature=y;n.mesh=p;n.meshArcs=u;n.merge=w;n.mergeArcs=f;n.neighbors=b;n.quantize=k;n.transform=i;n.untransform=c;Object.defineProperty(n,"__esModule",{value:!0})})},{}],266:[function(t,i,r){!function(t,u){"object"==typeof r&&void 0!==i?u(r):"function"==typeof n&&n.amd?n(["exports"],u):u(t.topojson=t.topojson||{})}(this,function(n){"use strict";function c(n,t,i,u){r(n,t,i);r(n,t,t+u);r(n,t+u,i)}function r(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 l(n){return null==n?{type:null}:("FeatureCollection"===n.type?a:"Feature"===n.type?o:u)(n)}function a(n){var t={type:"GeometryCollection",geometries:n.features.map(o)};return null!=n.bbox&&(t.bbox=n.bbox),t}function o(n){var i,t=u(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 u(n){if(null==n)return{type:null};var t="GeometryCollection"===n.type?{type:"GeometryCollection",geometries:n.geometries.map(u)}:"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 v(n){var r,t=n[0],i=n[1];return i<t&&(r=t,t=i,i=r),t+31*i}function y(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}var p=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 c(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(c)}},h;for(h in n)o(n[h]);if(u>=i&&f>=r)return[i,r,u,f]},w=function(n,t,i,r,u){function s(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}function h(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}function c(){for(var t,i=[],n=0,r=f.length;n<r;++n)t=f[n],t!=u&&i.push(t);return i}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:s,has:h,values:c}},f=function(n,t,i,r,u,f){function c(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}function l(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}function a(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}function v(){for(var t,i=[],n=0,r=e.length;n<r;++n)t=e[n],t!=u&&i.push(t);return i}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:c,maybeSet:l,get:a,keys:v}},t=function(n,t){return n[0]===t[0]&&n[1]===t[1]},s=new ArrayBuffer(16),h=new Float64Array(s),i=new Uint32Array(s),e=function(n){h[0]=n[0];h[1]=n[1];var t=i[0]^i[1];return 2147483647&(t=t<<5^t>>7^i[2]^i[3])},b=function(n){function d(n,t,i,r){var u,f;c[i]!==n&&(c[i]=n,u=a[i],u>=0?(f=v[i],u===t&&f===r||u===r&&f===t||(++p,y[i]=1)):(a[i]=t,v[i]=r))}function et(n){return e(r[n])}function ot(n,i){return t(r[n],r[i])}for(var l,o,s,r=n.coordinates,nt=n.lines,tt=n.rings,h=function(){for(var i=f(1.4*r.length,et,ot,Int32Array,-1,Int32Array),t=new Int32Array(r.length),n=0,u=r.length;n<u;++n)t[n]=i.maybeSet(n,n);return t}(),c=new Int32Array(r.length),a=new Int32Array(r.length),v=new Int32Array(r.length),y=new Int8Array(r.length),p=0,ft,g,i=0,u=r.length;i<u;++i)c[i]=a[i]=v[i]=-1;for(i=0,u=nt.length;i<u;++i){var it=nt[i],b=it[0],st=it[1];for(o=h[b],s=h[++b],++p,y[o]=1;++b<=st;)d(i,l=o,o=s,s=h[b]);++p;y[s]=1}for(i=0,u=r.length;i<u;++i)c[i]=-1;for(i=0,u=tt.length;i<u;++i){var rt=tt[i],k=rt[0]+1,ut=rt[1];for(l=h[ut-1],o=h[k-1],s=h[k],d(i,l,o,s);++k<=ut;)d(i,l=o,o=s,s=h[k])}for(c=a=v=null,g=w(1.4*p,e,t),i=0,u=r.length;i<u;++i)y[ft=h[i]]&&g.add(r[ft]);return g},k=function(n){for(var o,a=b(n),i=n.coordinates,v=n.lines,y=n.rings,t=0,s=v.length;t<s;++t)for(var r=v[t],h=r[0],w=r[1];++h<w;)a.has(i[h])&&(o={0:h,1:r[1]},r[1]=h,r=r.next=o);for(t=0,s=y.length;t<s;++t)for(var u=y[t],e=u[0],f=e,l=u[1],p=a.has(i[e]);++f<l;)a.has(i[f])&&(p?(o={0:f,1:u[1]},u[1]=f,u=u.next=o):(c(i,e,l,l-f),i[l]=i[e],p=!0,f=e));return n},d=function(n){function p(n){var h,c,i,f,u,e,t,o;if(i=s.get(h=r[n[0]]))for(t=0,o=i.length;t<o;++t)if(f=i[t],k(f,n))return n[0]=f[0],void(n[1]=f[1]);if(u=s.get(c=r[n[1]]))for(t=0,o=u.length;t<o;++t)if(e=u[t],d(e,n))return n[1]=e[0],void(n[0]=e[1]);i?i.push(n):s.set(h,[n]);u?u.push(n):s.set(c,[n]);y.push(n)}function k(n,i){var u=n[0],f=i[0],e=n[1];if(u-e!=f-i[1])return!1;for(;u<=e;++u,++f)if(!t(r[u],r[f]))return!1;return!0}function d(n,i){var u=n[0],o=i[0],e=n[1],f=i[1];if(u-e!=o-f)return!1;for(;u<=e;++u,--f)if(!t(r[u],r[f]))return!1;return!0}function w(n,i){var e=n[0],o=i[0],s=n[1],h=i[1],u=s-e;if(u!==h-o)return!1;for(var l=c(n),a=c(i),f=0;f<u;++f)if(!t(r[e+(f+l)%u],r[o+(f+a)%u]))return!1;return!0}function b(n,i){var e=n[0],s=i[0],h=n[1],o=i[1],u=h-e;if(u!==o-s)return!1;for(var l=c(n),a=u-c(i),f=0;f<u;++f)if(!t(r[e+(f+l)%u],r[o-(f+a)%u]))return!1;return!0}function c(n){for(var i,f=n[0],o=n[1],t=f,e=t,u=r[t];++t<o;)i=r[t],(i[0]<u[0]||i[0]===u[0]&&i[1]<u[1])&&(e=t,u=i);return e-f}var h,u,i,o,r=n.coordinates,l=n.lines,a=n.rings,v=l.length+a.length,s,y;for(delete n.lines,delete n.rings,i=0,o=l.length;i<o;++i)for(h=l[i];h=h.next;)++v;for(i=0,o=a.length;i<o;++i)for(u=a[i];u=u.next;)++v;for(s=f(2*v*1.4,e,t),y=n.arcs=[],i=0,o=l.length;i<o;++i){h=l[i];do p(h);while(h=h.next)}for(i=0,o=a.length;i<o;++i)if(u=a[i],u.next){do p(u);while(u=u.next)}else!function(n){var e,i,t,u,f;if(i=s.get(e=r[n[0]]))for(u=0,f=i.length;u<f;++u){if(t=i[u],w(t,n))return n[0]=t[0],void(n[1]=t[1]);if(b(t,n))return n[0]=t[1],void(n[1]=t[0])}if(i=s.get(e=r[n[0]+c(n)]))for(u=0,f=i.length;u<f;++u){if(t=i[u],w(t,n))return n[0]=t[0],void(n[1]=t[1]);if(b(t,n))return n[0]=t[1],void(n[1]=t[0])}i?i.push(n):s.set(e,[n]);y.push(n)}(u);return n},g=function(n){for(var e=-1,h=n.length;++e<h;){for(var r,u,t=n[e],c=0,f=1,l=t.length,i=t[0],o=i[0],s=i[1];++c<l;)i=t[c],r=i[0],u=i[1],r===o&&u===s||(t[f++]=[r-o,u-s],o=r,s=u);1===f&&(t[f++]=[0,0]);t.length=f}return n},nt=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 c(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(c)}},h;for(h in n)r(n[h]);return{type:"Topology",coordinates:i,lines:e,rings:o,objects:n}},tt=function(n){var t,i={};for(t in n)i[t]=l(n[t]);return i},it=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 w(n){return s(n,4)}function c(n){return n.map(w)}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)}},p;for(p in n)l(n[p]);return{scale:[1/f,1/e],translate:[r,u]}},rt=function(n,t){function o(n){n&&e.hasOwnProperty(n.type)&&e[n.type](n)}function r(n){var i=[],t;do t=c.get(n),i.push(n[0]<n[1]?t:~t);while(n=n.next);return i}function a(n){return n.map(r)}var u=p(n=tt(n)),s=t>0&&u&&it(n,u,t),i=d(k(nt(n))),h=i.coordinates,c=f(1.4*i.arcs.length,v,y),e,l;n=i.objects;i.bbox=u;i.arcs=i.arcs.map(function(n,t){return c.set(n,t),h.slice(n[0],n[1]+1)});delete i.coordinates;h=null;e={GeometryCollection:function(n){n.geometries.forEach(o)},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(a)}};for(l in n)o(n[l]);return s&&(i.transform=s,i.arcs=g(i.arcs)),i};n.topology=rt;Object.defineProperty(n,"__esModule",{value:!0})})},{}],267:[function(n,t,i){arguments[4][181][0].apply(i,arguments)},{"@turf/helpers":268,"@turf/meta":269,"convex-hull":272,dup:181}],268:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],269:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],270:[function(n,t,i){arguments[4][184][0].apply(i,arguments)},{dup:184,"robust-orientation":278}],271:[function(n,t,i){arguments[4][185][0].apply(i,arguments)},{dup:185}],272:[function(n,t,i){arguments[4][186][0].apply(i,arguments)},{"./lib/ch1d":273,"./lib/ch2d":274,"./lib/chnd":275,dup:186}],273:[function(n,t,i){arguments[4][187][0].apply(i,arguments)},{dup:187}],274:[function(n,t,i){arguments[4][188][0].apply(i,arguments)},{dup:188,"monotone-convex-hull-2d":277}],275:[function(n,t,i){arguments[4][189][0].apply(i,arguments)},{"affine-hull":270,dup:189,"incremental-convex-hull":276}],276:[function(n,t,i){arguments[4][190][0].apply(i,arguments)},{dup:190,"robust-orientation":278,"simplicial-complex":282}],277:[function(n,t,i){arguments[4][191][0].apply(i,arguments)},{dup:191,"robust-orientation":278}],278:[function(n,t,i){arguments[4][192][0].apply(i,arguments)},{dup:192,"robust-scale":279,"robust-subtract":280,"robust-sum":281,"two-product":283}],279:[function(n,t,i){arguments[4][193][0].apply(i,arguments)},{dup:193,"two-product":283,"two-sum":284}],280:[function(n,t,i){arguments[4][194][0].apply(i,arguments)},{dup:194}],281:[function(n,t,i){arguments[4][195][0].apply(i,arguments)},{dup:195}],282:[function(n,t,i){arguments[4][196][0].apply(i,arguments)},{"bit-twiddle":271,dup:196,"union-find":285}],283:[function(n,t,i){arguments[4][197][0].apply(i,arguments)},{dup:197}],284:[function(n,t,i){arguments[4][198][0].apply(i,arguments)},{dup:198}],285:[function(n,t,i){arguments[4][199][0].apply(i,arguments)},{dup:199}],286:[function(n,t,i){arguments[4][5][0].apply(i,arguments)},{"@turf/helpers":287,"@turf/invariant":288,dup:5}],287:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],288:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],289:[function(n,t){function i(n){switch(n.type){case"Polygon":return u(n)>1?n:void 0;case"MultiPolygon":var t=[];if(o(n,function(n){u(n)>1&&t.push(n.geometry.coordinates)}),t.length)return{type:"MultiPolygon",coordinates:t}}}var r=n("jsts"),u=n("@turf/area"),f=n("@turf/helpers").feature,e=n("@turf/invariant").getGeom,o=n("@turf/meta").flattenEach;t.exports=function(n,t){var u=e(n),o=e(t),s=n.properties||{},l,a;if(u=i(u),o=i(o),u){if(!o)return f(u,s);var h=new r.io.GeoJSONReader,v=h.read(u),y=h.read(o),c=v.difference(y);if(!c.isEmpty())return l=new r.io.GeoJSONWriter,a=l.write(c),f(a,s)}}},{"@turf/area":290,"@turf/helpers":294,"@turf/invariant":295,"@turf/meta":296,jsts:297}],290:[function(n,t,i){arguments[4][12][0].apply(i,arguments)},{"@mapbox/geojson-area":291,"@turf/meta":292,dup:12}],291:[function(n,t,i){arguments[4][13][0].apply(i,arguments)},{dup:13,wgs84:293}],292:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],293:[function(n,t,i){arguments[4][15][0].apply(i,arguments)},{dup:15}],294:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],295:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],296:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],297:[function(n,t,i){arguments[4][176][0].apply(i,arguments)},{dup:176}],298:[function(n,t){function r(n){if(null===n||void 0===n)throw new Error("No polygon was passed");n.geometry.type="LineString";var t=[].concat.apply([],n.geometry.coordinates);return n.geometry.coordinates=t,n}var u=n("@turf/union"),f=n("@turf/boolean-overlap"),i=n("@turf/bbox"),e=n("rbush"),o=n("geojson-utils"),s=n("get-closest");t.exports=function(n,t){for(var y,ut,h,c,it,w,nt,b,l=[],rt=[],v=new e,k=0;k<n.features.length;k++)y=i(n.features[k]),ut={minX:y[0],minY:y[1],maxX:y[2],maxY:y[3],origIndexPosition:k},rt.push(ut);for(v.load(rt),h=0;h<n.features.length;h++){for(var a=n.features[h],d=i(a),tt={minX:d[0],minY:d[1],maxX:d[2],maxY:d[3]},g=v.search(tt),ft=!1,p=0;p<g.length;p++)if(a=n.features[h],c=g[p].origIndexPosition,l.length>0&&0!==c&&(c>l[l.length-1]?c-=l.length:(it=s.greaterNumber(c,l),0!==it&&(c-=it))),c!==h&&(w=n.features[c],void 0===typeof t||w.properties[t]===a.properties[t])){if(nt=f(a,w),!nt){var et=JSON.stringify(a),ot=JSON.stringify(w),st=r(JSON.parse(et)),ht=r(JSON.parse(ot));nt=o.lineStringsIntersect(st.geometry,ht.geometry)}nt&&(n.features[h]=u(a,w),l.push(g[p].origIndexPosition),l.sort(function(n,t){return n-t}),v.remove(g[p]),n.features.splice(c,1),tt.origIndexPosition=h,v.remove(tt,function(n,t){return n.origIndexPosition===t.origIndexPosition}),ft=!0)}ft&&(b=i(a),v.insert({minX:b[0],minY:b[1],maxX:b[2],maxY:b[3],origIndexPosition:h}),h--)}return n}},{"@turf/bbox":299,"@turf/boolean-overlap":301,"@turf/union":367,"geojson-utils":369,"get-closest":370,rbush:372}],299:[function(n,t,i){arguments[4][22][0].apply(i,arguments)},{"@turf/meta":300,dup:22}],300:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],301:[function(n,t,i){arguments[4][91][0].apply(i,arguments)},{"@turf/invariant":302,"@turf/line-intersect":303,"@turf/line-overlap":317,"@turf/meta":362,dup:91,"geojson-equality":366}],302:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],303:[function(n,t,i){arguments[4][44][0].apply(i,arguments)},{"@turf/helpers":307,"@turf/invariant":308,"@turf/line-segment":309,"@turf/meta":313,dup:44,"geojson-rbush":314}],304:[function(n,t,i){arguments[4][20][0].apply(i,arguments)},{"@turf/helpers":305,dup:20}],305:[function(n,t,i){arguments[4][46][0].apply(i,arguments)},{dup:46}],306:[function(n,t,i){arguments[4][47][0].apply(i,arguments)},{"@turf/meta":313,dup:47}],307:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],308:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],309:[function(n,t,i){arguments[4][50][0].apply(i,arguments)},{"@turf/helpers":310,"@turf/invariant":311,"@turf/meta":312,dup:50}],310:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],311:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],312:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],313:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],314:[function(n,t,i){arguments[4][55][0].apply(i,arguments)},{"@turf/bbox":306,"@turf/bbox-polygon":304,"@turf/helpers":307,"@turf/meta":313,dup:55,rbush:316}],315:[function(n,t,i){arguments[4][56][0].apply(i,arguments)},{dup:56}],316:[function(n,t,i){arguments[4][57][0].apply(i,arguments)},{dup:57,quickselect:315}],317:[function(n,t,i){arguments[4][107][0].apply(i,arguments)},{"@turf/boolean-point-on-line":321,"@turf/helpers":323,"@turf/invariant":324,"@turf/line-segment":325,"@turf/meta":329,"@turf/point-on-line":330,"deep-equal":356,dup:107,"geojson-rbush":359}],318:[function(n,t,i){arguments[4][20][0].apply(i,arguments)},{"@turf/helpers":319,dup:20}],319:[function(n,t,i){arguments[4][46][0].apply(i,arguments)},{dup:46}],320:[function(n,t,i){arguments[4][47][0].apply(i,arguments)},{"@turf/meta":329,dup:47}],321:[function(n,t,i){arguments[4][34][0].apply(i,arguments)},{"@turf/invariant":322,dup:34}],322:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],323:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],324:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],325:[function(n,t,i){arguments[4][50][0].apply(i,arguments)},{"@turf/helpers":326,"@turf/invariant":327,"@turf/meta":328,dup:50}],326:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],327:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],328:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],329:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],330:[function(n,t,i){arguments[4][120][0].apply(i,arguments)},{"@turf/bearing":331,"@turf/destination":333,"@turf/distance":336,"@turf/helpers":339,"@turf/invariant":340,"@turf/line-intersect":341,"@turf/meta":355,dup:120}],331:[function(n,t,i){arguments[4][3][0].apply(i,arguments)},{"@turf/invariant":332,dup:3}],332:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],333:[function(n,t,i){arguments[4][5][0].apply(i,arguments)},{"@turf/helpers":334,"@turf/invariant":335,dup:5}],334:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],335:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],336:[function(n,t,i){arguments[4][8][0].apply(i,arguments)},{"@turf/helpers":337,"@turf/invariant":338,dup:8}],337:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],338:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],339:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],340:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],341:[function(n,t,i){arguments[4][44][0].apply(i,arguments)},{"@turf/helpers":345,"@turf/invariant":346,"@turf/line-segment":347,"@turf/meta":351,dup:44,"geojson-rbush":352}],342:[function(n,t,i){arguments[4][20][0].apply(i,arguments)},{"@turf/helpers":343,dup:20}],343:[function(n,t,i){arguments[4][46][0].apply(i,arguments)},{dup:46}],344:[function(n,t,i){arguments[4][47][0].apply(i,arguments)},{"@turf/meta":351,dup:47}],345:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],346:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],347:[function(n,t,i){arguments[4][50][0].apply(i,arguments)},{"@turf/helpers":348,"@turf/invariant":349,"@turf/meta":350,dup:50}],348:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],349:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],350:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],351:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],352:[function(n,t,i){arguments[4][55][0].apply(i,arguments)},{"@turf/bbox":344,"@turf/bbox-polygon":342,"@turf/helpers":345,"@turf/meta":351,dup:55,rbush:354}],353:[function(n,t,i){arguments[4][56][0].apply(i,arguments)},{dup:56}],354:[function(n,t,i){arguments[4][57][0].apply(i,arguments)},{dup:57,quickselect:353}],355:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],356:[function(n,t,i){arguments[4][87][0].apply(i,arguments)},{"./lib/is_arguments.js":357,"./lib/keys.js":358,dup:87}],357:[function(n,t,i){arguments[4][88][0].apply(i,arguments)},{dup:88}],358:[function(n,t,i){arguments[4][89][0].apply(i,arguments)},{dup:89}],359:[function(n,t,i){arguments[4][55][0].apply(i,arguments)},{"@turf/bbox":320,"@turf/bbox-polygon":318,"@turf/helpers":323,"@turf/meta":329,dup:55,rbush:361}],360:[function(n,t,i){arguments[4][56][0].apply(i,arguments)},{dup:56}],361:[function(n,t,i){arguments[4][57][0].apply(i,arguments)},{dup:57,quickselect:360}],362:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],363:[function(n,t,i){arguments[4][87][0].apply(i,arguments)},{"./lib/is_arguments.js":364,"./lib/keys.js":365,dup:87}],364:[function(n,t,i){arguments[4][88][0].apply(i,arguments)},{dup:88}],365:[function(n,t,i){arguments[4][89][0].apply(i,arguments)},{dup:89}],366:[function(n,t,i){arguments[4][90][0].apply(i,arguments)},{"deep-equal":363,dup:90}],367:[function(n,t){var i=n("jsts");t.exports=function(){for(var r=new i.io.GeoJSONReader,n=r.read(JSON.stringify(arguments[0].geometry)),t=1;t<arguments.length;t++)n=n.union(r.read(JSON.stringify(arguments[t].geometry)));return n=(new i.io.GeoJSONWriter).write(n),{type:"Feature",geometry:n,properties:arguments[0].properties}}},{jsts:368}],368:[function(n,t,i){arguments[4][176][0].apply(i,arguments)},{dup:176}],369:[function(n,t){!function(){function i(n){for(var t=[],i=[],r=0;r<n[0].length;r++)t.push(n[0][r][1]),i.push(n[0][r][0]);return t=t.sort(function(n,t){return n-t}),i=i.sort(function(n,t){return n-t}),[[t[0],i[0]],[t[t.length-1],i[i.length-1]]]}function r(n,t,i){for(var f,r=[[0,0]],u=0;u<i.length;u++){for(f=0;f<i[u].length;f++)r.push(i[u][f]);r.push(i[u][0]);r.push([0,0])}for(var e=!1,u=0,f=r.length-1;u<r.length;f=u++)r[u][0]>t!=r[f][0]>t&&n<(r[f][1]-r[u][1])*(t-r[u][0])/(r[f][0]-r[u][0])+r[u][1]&&(e=!e);return e}var n=this.gju={};void 0!==t&&t.exports&&(t.exports=n);n.lineStringsIntersect=function(n,t){for(var f,s,l,o=[],u=0;u<=n.coordinates.length-2;++u)for(f=0;f<=t.coordinates.length-2;++f){var i={x:n.coordinates[u][1],y:n.coordinates[u][0]},e={x:n.coordinates[u+1][1],y:n.coordinates[u+1][0]},r={x:t.coordinates[f][1],y:t.coordinates[f][0]},h={x:t.coordinates[f+1][1],y:t.coordinates[f+1][0]},a=(h.x-r.x)*(i.y-r.y)-(h.y-r.y)*(i.x-r.x),v=(e.x-i.x)*(i.y-r.y)-(e.y-i.y)*(i.x-r.x),c=(h.y-r.y)*(e.x-i.x)-(h.x-r.x)*(e.y-i.y);0!=c&&(s=a/c,l=v/c,0<=s&&s<=1&&0<=l&&l<=1&&o.push({type:"Point",coordinates:[i.x+s*(e.x-i.x),i.y+s*(e.y-i.y)]}))}return 0==o.length&&(o=!1),o};n.pointInBoundingBox=function(n,t){return!(n.coordinates[1]<t[0][0]||n.coordinates[1]>t[1][0]||n.coordinates[0]<t[0][1]||n.coordinates[0]>t[1][1])};n.pointInPolygon=function(t,u){for(var o,e="Polygon"==u.type?[u.coordinates]:u.coordinates,s=!1,f=0;f<e.length;f++)n.pointInBoundingBox(t,i(e[f]))&&(s=!0);if(!s)return!1;for(o=!1,f=0;f<e.length;f++)r(t.coordinates[1],t.coordinates[0],e[f])&&(o=!0);return o};n.pointInMultiPolygon=function(t,u){for(var e,f,c="MultiPolygon"==u.type?[u.coordinates]:u.coordinates,o=!1,s=!1,h=0;h<c.length;h++){for(e=c[h],f=0;f<e.length;f++)o||n.pointInBoundingBox(t,i(e[f]))&&(o=!0);if(!o)return!1;for(f=0;f<e.length;f++)s||r(t.coordinates[1],t.coordinates[0],e[f])&&(s=!0)}return s};n.numberToRadius=function(n){return n*Math.PI/180};n.numberToDegree=function(n){return 180*n/Math.PI};n.drawCircle=function(t,i,r){for(var e=[i.coordinates[1],i.coordinates[0]],o=t/6371e3,f=[n.numberToRadius(e[0]),n.numberToRadius(e[1])],r=r||15,s=[[e[0],e[1]]],u=0;u<r;u++){var h=2*Math.PI*u/r,c=Math.asin(Math.sin(f[0])*Math.cos(o)+Math.cos(f[0])*Math.sin(o)*Math.cos(h)),l=f[1]+Math.atan2(Math.sin(h)*Math.sin(o)*Math.cos(f[0]),Math.cos(o)-Math.sin(f[0])*Math.sin(c));s[u]=[];s[u][1]=n.numberToDegree(c);s[u][0]=n.numberToDegree(l)}return{type:"Polygon",coordinates:[s]}};n.rectangleCentroid=function(n){var t=n.coordinates[0],i=t[0][0],r=t[0][1];return{type:"Point",coordinates:[i+(t[2][0]-i)/2,r+(t[2][1]-r)/2]}};n.pointDistance=function(t,i){var e=t.coordinates[0],r=t.coordinates[1],o=i.coordinates[0],u=i.coordinates[1],s=n.numberToRadius(u-r),h=n.numberToRadius(o-e),f=Math.pow(Math.sin(s/2),2)+Math.cos(n.numberToRadius(r))*Math.cos(n.numberToRadius(u))*Math.pow(Math.sin(h/2),2);return 12742e3*Math.atan2(Math.sqrt(f),Math.sqrt(1-f))};n.geometryWithinRadius=function(t,i,r){var u,f,e;if("Point"==t.type)return n.pointDistance(t,i)<=r;if("LineString"==t.type||"Polygon"==t.type){f={};u="Polygon"==t.type?t.coordinates[0]:t.coordinates;for(e in u)if(f.coordinates=u[e],n.pointDistance(f,i)>r)return!1}return!0};n.area=function(n){for(var i,r,f=0,t=n.coordinates[0],e=t.length-1,u=0;u<t.length;e=u++)i={x:t[u][1],y:t[u][0]},r={x:t[e][1],y:t[e][0]},f+=i.x*r.y,f-=i.y*r.x;return f/2};n.centroid=function(t){for(var r,u,i,s=0,h=0,f=t.coordinates[0],o=f.length-1,e=0;e<f.length;o=e++)r={x:f[e][1],y:f[e][0]},u={x:f[o][1],y:f[o][0]},i=r.x*u.y-u.x*r.y,s+=(r.x+u.x)*i,h+=(r.y+u.y)*i;return i=6*n.area(t),{type:"Point",coordinates:[h/i,s/i]}};n.simplify=function(n,t){var rt,i;t=t||20;n=n.map(function(n){return{lng:n.coordinates[0],lat:n.coordinates[1]}});var nt,u,s,r,f,i,a,ut,v,y,e,c,p,o,l,w,h,tt,b,it=Math.PI/180*.5,k=[],d=[],g=[];if(n.length<3)return n;for(nt=n.length,y=360*t/(12756274*Math.PI),y*=y,s=0,d[0]=0,g[0]=nt-1,u=1;u>0;)if(r=d[u-1],f=g[u-1],u--,f-r>1){for(e=n[f].lng()-n[r].lng(),c=n[f].lat()-n[r].lat(),Math.abs(e)>180&&(e=360-Math.abs(e)),e*=Math.cos(it*(n[f].lat()+n[r].lat())),p=e*e+c*c,i=r+1,a=r,v=-1;i<f;i++)o=n[i].lng()-n[r].lng(),l=n[i].lat()-n[r].lat(),Math.abs(o)>180&&(o=360-Math.abs(o)),o*=Math.cos(it*(n[i].lat()+n[r].lat())),w=o*o+l*l,h=n[i].lng()-n[f].lng(),tt=n[i].lat()-n[f].lat(),Math.abs(h)>180&&(h=360-Math.abs(h)),h*=Math.cos(it*(n[i].lat()+n[f].lat())),b=h*h+tt*tt,(ut=w>=p+b?b:b>=p+w?w:(o*c-l*e)*(o*c-l*e)/p)>v&&(a=i,v=ut);v<y?(k[s]=r,s++):(u++,d[u-1]=a,g[u-1]=f,u++,d[u-1]=r,g[u-1]=a)}else k[s]=r,s++;for(k[s]=nt-1,s++,rt=[],i=0;i<s;i++)rt.push(n[k[i]]);return rt.map(function(n){return{type:"Point",coordinates:[n.lng,n.lat]}})};n.destinationPoint=function(t,i,r){r/=6371;i=n.numberToRadius(i);var o=n.numberToRadius(t.coordinates[0]),u=n.numberToRadius(t.coordinates[1]),e=Math.asin(Math.sin(u)*Math.cos(r)+Math.cos(u)*Math.sin(r)*Math.cos(i)),f=o+Math.atan2(Math.sin(i)*Math.sin(r)*Math.cos(u),Math.cos(r)-Math.sin(u)*Math.sin(e));return f=(f+3*Math.PI)%(2*Math.PI)-Math.PI,{type:"Point",coordinates:[n.numberToDegree(f),n.numberToDegree(e)]}}}()},{}],370:[function(n,t){"use strict";function i(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}t.exports={number:function(n,t){return i(n,t,function(n,t){return Math.abs(n-t)})},greaterNumber:function(n,t){return i(n,t,function(n,t){return n-t})},lowerNumber:function(n,t){return i(n,t,function(n,t){return t-n})},custom:function(n,t,r){return i(n,t,r)}}},{}],371:[function(n,t,i){arguments[4][56][0].apply(i,arguments)},{dup:56}],372:[function(n,t,i){arguments[4][57][0].apply(i,arguments)},{dup:57,quickselect:371}],373:[function(n,t,i){arguments[4][8][0].apply(i,arguments)},{"@turf/helpers":374,"@turf/invariant":375,dup:8}],374:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],375:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],376:[function(n,t){var i=n("@turf/bbox"),r=n("@turf/bbox-polygon");t.exports=function(n){return r(i(n))}},{"@turf/bbox":379,"@turf/bbox-polygon":377}],377:[function(n,t,i){arguments[4][20][0].apply(i,arguments)},{"@turf/helpers":378,dup:20}],378:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],379:[function(n,t,i){arguments[4][22][0].apply(i,arguments)},{"@turf/meta":380,dup:22}],380:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],381:[function(n,t,i){arguments[4][200][0].apply(i,arguments)},{"@turf/helpers":382,"@turf/meta":383,dup:200}],382:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],383:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],384:[function(n,t){var i=n("@turf/meta").flattenEach,r=n("@turf/helpers").featureCollection;t.exports=function(n){if(!n)throw new Error("geojson is required");var t=[];return i(n,function(n){t.push(n)}),r(t)}},{"@turf/helpers":385,"@turf/meta":386}],385:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],386:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],387:[function(n,t){var i=n("@turf/meta").coordEach;t.exports=function(n,t){if(!n)throw new Error("geojson is required");return!1!==t&&void 0!==t||(n=JSON.parse(JSON.stringify(n))),i(n,function(n){var t=n[0],i=n[1];n[0]=i;n[1]=t}),n}},{"@turf/meta":388}],388:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],389:[function(n,t){"use strict";var e=Math.PI/180,o=180/Math.PI,i=function(n,t){this.lon=n;this.lat=t;this.x=e*n;this.y=e*t},f,r,u;i.prototype.view=function(){return String(this.lon).slice(0,4)+","+String(this.lat).slice(0,4)};i.prototype.antipode=function(){var n=-1*this.lat,t=this.lon<0?180+this.lon:-1*(180-this.lon);return new i(t,n)};f=function(){this.coords=[];this.length=0};f.prototype.move_to=function(n){this.length++;this.coords.push(n)};r=function(n){this.properties=n||{};this.geometries=[]};r.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}};r.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};u=function(n,t,r){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 i(n.x,n.y);this.end=new i(t.x,t.y);this.properties=r||{};var u=this.start.x-this.end.x,f=this.start.y-this.end.y,e=Math.pow(Math.sin(f/2),2)+Math.cos(this.start.y)*Math.cos(this.end.y)*Math.pow(Math.sin(u/2),2);if(this.g=2*Math.asin(Math.sqrt(e)),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);};u.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=o*Math.atan2(f,Math.sqrt(Math.pow(r,2)+Math.pow(u,2)));return[o*Math.atan2(u,r),e]};u.prototype.Arc=function(n,t){var i=[],ct,v,lt,at,c,e,u,tt,pt,wt,ut,ft,et,a,ot,w,st,ht,b;if(!n||n<=2)i.push([this.start.lon,this.start.lat]),i.push([this.end.lon,this.end.lat]);else for(ct=1/(n-1),v=0;v<n;++v)lt=ct*v,at=this.interpolate(lt),i.push(at);for(var vt=!1,k=0,y=t&&t.offset?t.offset:10,h=180-y,l=-180+y,yt=360-y,p=1;p<i.length;++p){var d=i[p-1][0],g=i[p][0],nt=Math.abs(g-d);nt>yt&&(g>h&&d<l||d>h&&g<l)?vt=!0:nt>k&&(k=nt)}if(c=[],vt&&k<y)for(e=[],c.push(e),u=0;u<i.length;++u)if(tt=parseFloat(i[u][0]),u>0&&Math.abs(tt-i[u-1][0])>yt){var o=parseFloat(i[u-1][0]),it=parseFloat(i[u-1][1]),s=parseFloat(i[u][0]),rt=parseFloat(i[u][1]);if(o>-180&&o<l&&180===s&&u+1<i.length&&i[u-1][0]>-180&&i[u-1][0]<l){e.push([-180,i[u][1]]);u++;e.push([i[u][0],i[u][1]]);continue}if(o>h&&o<180&&-180===s&&u+1<i.length&&i[u-1][0]>h&&i[u-1][0]<180){e.push([180,i[u][1]]);u++;e.push([i[u][0],i[u][1]]);continue}o<l&&s>h&&(pt=o,o=s,s=pt,wt=it,it=rt,rt=wt);(o>h&&s<l&&(s+=360),o<=180&&s>=180&&o<s)?(ut=(180-o)/(s-o),ft=ut*rt+(1-ut)*it,e.push([i[u-1][0]>h?180:-180,ft]),e=[],e.push([i[u-1][0]>h?-180:180,ft]),c.push(e)):(e=[],c.push(e));e.push([tt,i[u][1]])}else e.push([i[u][0],i[u][1]]);else for(et=[],c.push(et),a=0;a<i.length;++a)et.push([i[a][0],i[a][1]]);for(ot=new r(this.properties),w=0;w<c.length;++w)for(st=new f,ot.geometries.push(st),ht=c[w],b=0;b<ht.length;++b)st.move_to(ht[b]);return ot};t.exports={Coord:i,Arc:r,GreatCircle:u}},{}],390:[function(n,t){var r=n("./arc"),i=n("@turf/invariant").getCoord;t.exports=function(n,t,u,f,e){return n=i(n),t=i(t),u=u||{},f=f||100,e=e||10,new r.GreatCircle({x:n[0],y:n[1]},{x:t[0],y:t[1]},u).Arc(f,{offset:e}).json()}},{"./arc":389,"@turf/invariant":391}],391:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],392:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],393:[function(n,t){function c(n,t,i){for(var o,s,f=[],e=0;e<6;e++)o=n[0]+t*r[e],s=n[1]+i*u[e],f.push([o,s]);return f.push(f[0].slice()),h([f])}function l(n,t,i){for(var e,o=[],f=0;f<6;f++)e=[],e.push(n),e.push([n[0]+t*r[f],n[1]+i*u[f]]),e.push([n[0]+t*r[(f+1)%6],n[1]+i*u[(f+1)%6]]),e.push(n),o.push(h([e]));return o}for(var o,s=n("@turf/distance"),f=n("@turf/helpers"),i=f.point,h=f.polygon,a=f.featureCollection,r=[],u=[],e=0;e<6;e++)o=Math.PI/3*e,r.push(Math.cos(o)),u.push(Math.sin(o));t.exports=function(n,t,r,u){var o=n[0],h=n[1],p=n[2],w=n[3],ft=(h+w)/2,et=(o+p)/2,vt=t/s(i([o,ft]),i([p,ft]),r),g=vt*(p-o),yt=t/s(i([et,h]),i([et,w]),r),nt=yt*(w-h),b=g/2,ot=2*b,f=Math.sqrt(3)/2*nt,st=p-o,tt=w-h,ht=.75*ot,pt=f,ct=st/(ot-b/2),k=Math.ceil(ct),v,y,e,rt,ut,d;Math.round(ct)===k&&k++;var wt=(k*ht-b/2-st)/2-b/2,it=Math.ceil(tt/f),lt=(tt-it*f)/2,at=it*f-tt>f/2;for(at&&(lt-=f/4),v=a([]),y=0;y<k;y++)for(e=0;e<=it;e++)rt=y%2==1,0===e&&rt||0===e&&at||(ut=y*ht+o-wt,d=e*pt+h+lt,rt&&(d-=f/2),u?v.features.push.apply(v.features,l([ut,d],g/2,nt/2)):v.features.push(c([ut,d],g/2,nt/2)));return v}},{"@turf/distance":394,"@turf/helpers":397}],394:[function(n,t,i){arguments[4][8][0].apply(i,arguments)},{"@turf/helpers":395,"@turf/invariant":396,dup:8}],395:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],396:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],397:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],398:[function(n,t){var i=n("@turf/bbox"),r=n("@turf/distance"),u=n("@turf/centroid"),f=n("@turf/square-grid");t.exports=function(n,t,e,o,s){var v,y;if(!t)throw new Error("valueField is required");if(void 0===e||null===e)throw new Error("weight is required");if(void 0===o||null===o)throw new Error("cellWidth is required");if(0===n.features.filter(function(n){return n.properties&&n.properties.hasOwnProperty(t)}).length)throw new Error("Specified Data Field is Missing");for(var c=f(i(n),o,s),w=c.features.length,l=0;l<w;l++){for(var a=0,p=0,h=0;h<n.features.length;h++)v=r(u(c.features[l]),n.features[h],s),0===v&&(a=n.features[h].properties[t]),y=1/Math.pow(v,e),p+=y,a+=y*n.features[h].properties[t];c.features[l].properties[t]=a/p}return c}},{"@turf/bbox":399,"@turf/centroid":401,"@turf/distance":404,"@turf/square-grid":407}],399:[function(n,t,i){arguments[4][22][0].apply(i,arguments)},{"@turf/meta":400,dup:22}],400:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],401:[function(n,t,i){arguments[4][178][0].apply(i,arguments)},{"@turf/helpers":402,"@turf/meta":403,dup:178}],402:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],403:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],404:[function(n,t,i){arguments[4][8][0].apply(i,arguments)},{"@turf/helpers":405,"@turf/invariant":406,dup:8}],405:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],406:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],407:[function(n,t){var u=n("@turf/distance"),f=n("@turf/bbox"),r=n("@turf/helpers"),i=r.point,e=r.polygon,o=r.featureCollection;t.exports=function(n,t,r,s){var d=[],rt,v,h,b,c,k,ut;if(!n)throw new Error("bbox is required");if(Array.isArray(n)||(n=f(n)),4!==n.length)throw new Error("bbox must contain 4 numbers");var l=n[0],a=n[1],g=n[2],nt=n[3],p=u(i([l,a]),i([g,a]),r),w=u(i([l,a]),i([l,nt]),r),tt=Math.ceil(p/t),it=Math.ceil(w/t),ft=t/p,y=ft*(g-l);for(!0===s&&(y*=p/t/tt),rt=t/w,v=rt*(nt-a),!0===s&&(v*=w/t/it),h=l,b=0;b<tt;b++){for(c=a,k=0;k<it;k++)ut=e([[[h,c],[h,c+v],[h+y,c+v],[h+y,c],[h,c]]]),d.push(ut),c+=v;h+=y}return o(d)}},{"@turf/bbox":408,"@turf/distance":410,"@turf/helpers":413}],408:[function(n,t,i){arguments[4][22][0].apply(i,arguments)},{"@turf/meta":409,dup:22}],409:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],410:[function(n,t,i){arguments[4][8][0].apply(i,arguments)},{"@turf/helpers":411,"@turf/invariant":412,dup:8}],411:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],412:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],413:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],414:[function(n,t,i){arguments[4][36][0].apply(i,arguments)},{"@turf/invariant":415,dup:36}],415:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],416:[function(n,t){var r=n("@turf/meta"),u=n("@turf/bbox"),f=n("@turf/hex-grid"),e=n("@turf/point-grid"),o=n("@turf/distance"),s=n("@turf/centroid"),h=n("@turf/invariant"),c=n("@turf/square-grid"),l=n("@turf/triangle-grid"),i=r.featureEach,a=h.collectionOf;t.exports=function(n,t,r,h,v,y){if(!n)throw new Error("points is required");if(a(n,"Point","input must contain Points"),!t)throw new Error("cellSize is required");if(void 0!==y&&"number"!=typeof y)throw new Error("weight must be a number");h=h||"elevation";r=r||"square";y=y||1;var p,w=u(n);switch(r){case"point":case"points":p=e(w,t,v,!0);break;case"square":case"squares":p=c(w,t,v);break;case"hex":case"hexes":p=f(w,t,v);break;case"triangle":case"triangles":p=l(w,t,v);break;default:throw new Error("invalid gridType");}return i(p,function(t){var u=0,f=0;i(n,function(n){var i,l="point"===r?t:s(t),c=o(l,n,v),e;if(void 0!==h&&(i=n.properties[h]),void 0===i&&(i=n.geometry.coordinates[2]),void 0===i)throw new Error("zValue is missing");0===c&&(u=i);e=1/Math.pow(c,y);f+=e;u+=e*i});t.properties[h]=u/f}),p}},{"@turf/bbox":417,"@turf/centroid":419,"@turf/distance":422,"@turf/hex-grid":425,"@turf/invariant":430,"@turf/meta":431,"@turf/point-grid":432,"@turf/square-grid":442,"@turf/triangle-grid":449}],417:[function(n,t,i){arguments[4][22][0].apply(i,arguments)},{"@turf/meta":418,dup:22}],418:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],419:[function(n,t,i){arguments[4][178][0].apply(i,arguments)},{"@turf/helpers":420,"@turf/meta":421,dup:178}],420:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],421:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],422:[function(n,t,i){arguments[4][8][0].apply(i,arguments)},{"@turf/helpers":423,"@turf/invariant":424,dup:8}],423:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],424:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],425:[function(n,t,i){arguments[4][393][0].apply(i,arguments)},{"@turf/distance":426,"@turf/helpers":429,dup:393}],426:[function(n,t,i){arguments[4][8][0].apply(i,arguments)},{"@turf/helpers":427,"@turf/invariant":428,dup:8}],427:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],428:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],429:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],430:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],431:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],432:[function(n,t){var r=n("@turf/distance"),e=n("@turf/bbox"),u=n("@turf/helpers"),o=n("@turf/inside"),s=n("@turf/invariant"),f=s.getGeomType,i=u.point,h=u.featureCollection;t.exports=function(n,t,u,s,c){var d=[],p=n,rt,v,y,k;if(!n)throw new Error("bbox is required");if(Array.isArray(n)||(n=e(n)),4!==n.length)throw new Error("bbox must contain 4 numbers");var l=n[0],a=n[1],w=n[2],b=n[3],ut=t/r(i([l,a]),i([w,a]),u),g=ut*(w-l),ft=t/r(i([l,a]),i([l,b]),u),nt=ft*(b-a);if(!1!==s)var tt=w-l,it=b-a,et=Math.floor(tt/g),ot=Math.floor(it/nt),st=(tt-et*g)/2,ht=(it-ot*nt)/2;for(rt=!Array.isArray(p)&&("Polygon"===f(p)||"MultiPolygon"===f(p)),v=l,!1!==s&&(v+=st);v<=w;){for(y=a,!1!==s&&(y+=ht);y<=b;)k=i([v,y]),!0===c&&rt?o(k,p)&&d.push(k):d.push(k),y+=nt;v+=g}return h(d)}},{"@turf/bbox":433,"@turf/distance":435,"@turf/helpers":438,"@turf/inside":439,"@turf/invariant":441}],433:[function(n,t,i){arguments[4][22][0].apply(i,arguments)},{"@turf/meta":434,dup:22}],434:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],435:[function(n,t,i){arguments[4][8][0].apply(i,arguments)},{"@turf/helpers":436,"@turf/invariant":437,dup:8}],436:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],437:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],438:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],439:[function(n,t,i){arguments[4][36][0].apply(i,arguments)},{"@turf/invariant":440,dup:36}],440:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],441:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],442:[function(n,t,i){arguments[4][407][0].apply(i,arguments)},{"@turf/bbox":443,"@turf/distance":445,"@turf/helpers":448,dup:407}],443:[function(n,t,i){arguments[4][22][0].apply(i,arguments)},{"@turf/meta":444,dup:22}],444:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],445:[function(n,t,i){arguments[4][8][0].apply(i,arguments)},{"@turf/helpers":446,"@turf/invariant":447,dup:8}],446:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],447:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],448:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],449:[function(n,t){var r=n("@turf/distance"),u=n("@turf/helpers"),i=u.polygon,f=u.featureCollection;t.exports=function(n,t,u){for(var c,e,l=f([]),v=t/r([n[0],n[1]],[n[2],n[1]],u),h=v*(n[2]-n[0]),y=t/r([n[0],n[1]],[n[0],n[3]],u),s=y*(n[3]-n[1]),a=0,o=n[0];o<=n[2];){for(c=0,e=n[1];e<=n[3];)a%2==0&&c%2==0?l.features.push(i([[[o,e],[o,e+s],[o+h,e],[o,e]]]),i([[[o,e+s],[o+h,e+s],[o+h,e],[o,e+s]]])):a%2==0&&c%2==1?l.features.push(i([[[o,e],[o+h,e+s],[o+h,e],[o,e]]]),i([[[o,e],[o,e+s],[o+h,e+s],[o,e]]])):c%2==0&&a%2==1?l.features.push(i([[[o,e],[o,e+s],[o+h,e+s],[o,e]]]),i([[[o,e],[o+h,e+s],[o+h,e],[o,e]]])):c%2==1&&a%2==1&&l.features.push(i([[[o,e],[o,e+s],[o+h,e],[o,e]]]),i([[[o,e+s],[o+h,e+s],[o+h,e],[o,e+s]]])),e+=s,c++;a++;o+=h}return l}},{"@turf/distance":450,"@turf/helpers":453}],450:[function(n,t,i){arguments[4][8][0].apply(i,arguments)},{"@turf/helpers":451,"@turf/invariant":452,dup:8}],451:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],452:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],453:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],454:[function(n,t){var i=n("jsts"),r=n("@turf/truncate");t.exports=function(n,t){var e="Feature"===n.type?n.geometry:n,o="Feature"===t.type?t.geometry:t,u=new i.io.GeoJSONReader,s=u.read(r(e)),h=u.read(r(o)),f=s.intersection(h);return f.isEmpty()?{type:"Feature",properties:{},geometry:null}:{type:"Feature",properties:{},geometry:(new i.io.GeoJSONWriter).write(f)}}},{"@turf/truncate":455,jsts:457}],455:[function(n,t){function i(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;return n}var r=n("@turf/meta").coordEach;t.exports=function(n,t,u,f){if(t=void 0===t||null===t||isNaN(t)?6:t,u=void 0===u||null===u||isNaN(u)?3:u,!n)throw new Error("<geojson> is required");if("number"!=typeof t)throw new Error("<precision> must be a number");if("number"!=typeof u)throw new Error("<coordinates> must be a number");!1!==f&&void 0!==f||(n=JSON.parse(JSON.stringify(n)));var e=Math.pow(10,t);return r(n,function(n){i(n,e,u)}),n}},{"@turf/meta":456}],456:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],457:[function(n,t,i){arguments[4][176][0].apply(i,arguments)},{dup:176}],458:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],459:[function(n,t){function u(n,t,i){for(var u=[],r=1;r<t.length;r++){var f=+t[r-1],h=+t[r],c=w.isoBands(n,f,h-f),l=e(c),a=o(l),s={};s.groupedRings=a;s[i]=f+"-"+h;u.push(s)}return u}function f(n,t,i){var r=c(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,l=u/s,a=f/h,v=function(n){n[0]=n[0]*l+e;n[1]=n[1]*a+o};return n.forEach(function(n){n.groupedRings.forEach(function(n){n.forEach(function(n){n.forEach(v)})})}),n}function e(n){var t=[],i=[],u;return n.forEach(function(n){var u=l(r([n]));i.push(u);t.push({ring:n,area:u})}),i.sort(function(n,t){return t-n}),u=[],i.forEach(function(n){for(var i=0;i<t.length;i++)if(t[i].area===n){u.push(t[i].ring);t.splice(i,1);break}}),u}function o(n){for(var i,f,o,u,c,t=n.map(function(n){return{lrCoordinates:n,grouped:!1}}),e=[];!h(t);)for(i=0;i<t.length;i++)if(!t[i].grouped){for(f=[],f.push(t[i].lrCoordinates),t[i].grouped=!0,o=r([t[i].lrCoordinates]),u=i+1;u<t.length;u++)t[u].grouped||(c=r([t[u].lrCoordinates]),s(c,o)&&(f.push(t[u].lrCoordinates),t[u].grouped=!0));e.push(f)}return e}function s(n,t){for(var r=v(n),i=0;i<r.features.length;i++)if(!a(r.features[i],t))return!1;return!0}function h(n){for(var t=0;t<n.length;t++)if(!1===n[t].grouped)return!1;return!0}var c=n("@turf/bbox"),l=n("@turf/area"),a=n("@turf/inside"),i=n("@turf/helpers"),v=n("@turf/explode"),y=n("@turf/invariant"),p=n("grid-to-matrix"),w=n("marchingsquares"),r=i.polygon,b=i.multiPolygon,k=y.collectionOf,d=i.featureCollection;t.exports=function(n,t,i,r){var s=function(n){return!!n&&n.constructor===Object},c;if(k(n,"Point","Input must contain Points"),!t||!Array.isArray(t))throw new Error("breaks is required");if(r=r||{},r.commonProperties&&!s(r.commonProperties))throw new Error("commonProperties is not an Object");if(r.isobandProperties&&!Array.isArray(r.isobandProperties))throw new Error("isobandProperties is not an Array");if(i&&"string"!=typeof i)throw new Error("zProperty is not a string");i=i||"elevation";var l=r.commonProperties||{},e=r.isobandProperties||[],h=p(n,i,!0),o=u(h,t,i);return o=f(o,h,n),c=o.map(function(n,t){if(e[t]&&!s(e[t]))throw new Error("Each mappedProperty is required to be an Object");var r=Object.assign({},l,e[t]);return r[i]=n[i],b(n.groupedRings,r)}),d(c)}},{"@turf/area":461,"@turf/bbox":462,"@turf/explode":463,"@turf/helpers":464,"@turf/inside":465,"@turf/invariant":466,"grid-to-matrix":468,marchingsquares:473}],460:[function(n,t,i){arguments[4][13][0].apply(i,arguments)},{dup:13,wgs84:474}],461:[function(n,t){var i=n("@mapbox/geojson-area").geometry,r=n("@turf/meta").geomReduce;t.exports=function(n){return r(n,function(n,t){return n+i(t)},0)}},{"@mapbox/geojson-area":460,"@turf/meta":467}],462:[function(n,t,i){arguments[4][47][0].apply(i,arguments)},{"@turf/meta":467,dup:47}],463:[function(n,t){var u=n("@turf/helpers").featureCollection,f=n("@turf/meta").featureEach,i=n("@turf/meta").coordEach,r=n("@turf/helpers").point;t.exports=function(n){var t=[];return"FeatureCollection"===n.type?f(n,function(n){i(n,function(i){t.push(r(i,n.properties))})}):i(n,function(i){t.push(r(i,n.properties))}),u(t)}},{"@turf/helpers":464,"@turf/meta":467}],464:[function(n,t){function i(n,t){if(!n)throw new Error("No geometry passed");return{type:"Feature",properties:t||{},geometry:n}}t.exports.feature=i;t.exports.point=function(n,t){if(!n)throw new Error("No coordinates passed");if(void 0===n.length)throw new Error("Coordinates must be an array");if(n.length<2)throw new Error("Coordinates must be at least 2 numbers long");if("number"!=typeof n[0]||"number"!=typeof n[1])throw new Error("Coordinates must numbers");return i({type:"Point",coordinates:n},t)};t.exports.polygon=function(n,t){var f,r,u;if(!n)throw new Error("No coordinates passed");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(r[r.length-1][u]!==r[0][u])throw new Error("First and last Position are not equivalent.");}return i({type:"Polygon",coordinates:n},t)};t.exports.lineString=function(n,t){if(!n)throw new Error("No coordinates passed");return i({type:"LineString",coordinates:n},t)};t.exports.featureCollection=function(n){if(!n)throw new Error("No features passed");return{type:"FeatureCollection",features:n}};t.exports.multiLineString=function(n,t){if(!n)throw new Error("No coordinates passed");return i({type:"MultiLineString",coordinates:n},t)};t.exports.multiPoint=function(n,t){if(!n)throw new Error("No coordinates passed");return i({type:"MultiPoint",coordinates:n},t)};t.exports.multiPolygon=function(n,t){if(!n)throw new Error("No coordinates passed");return i({type:"MultiPolygon",coordinates:n},t)};t.exports.geometryCollection=function(n,t){if(!n)throw new Error("No geometries passed");return i({type:"GeometryCollection",geometries:n},t)};var r={miles:3960,nauticalmiles:3441.145,degrees:57.2957795,radians:1,inches:250905600,yards:6969600,meters:6373e3,metres:6373e3,kilometers:6373,kilometres:6373,feet:20908792.65};t.exports.radiansToDistance=function(n,t){var i=r[t||"kilometers"];if(void 0===i)throw new Error("Invalid unit");return n*i};t.exports.distanceToRadians=function(n,t){var i=r[t||"kilometers"];if(void 0===i)throw new Error("Invalid unit");return n/i};t.exports.distanceToDegrees=function(n,t){var i=r[t||"kilometers"];if(void 0===i)throw new Error("Invalid unit");return n/i*57.2958}},{}],465:[function(n,t){function i(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}var r=n("@turf/invariant");t.exports=function(n,t){var h=r.getCoord(n),u=t.geometry.coordinates,f,e,o,s;for("Polygon"===t.geometry.type&&(u=[u]),f=0,e=!1;f<u.length&&!e;f++)if(i(h,u[f][0])){for(o=!1,s=1;s<u[f].length&&!o;)i(h,u[f][s],!0)&&(o=!0),s++;o||(e=!0)}return e}},{"@turf/invariant":466}],466:[function(n,t){function u(n){if(!n)throw new Error("No obj passed");var t=i(n);if(t.length>1&&"number"==typeof t[0]&&"number"==typeof t[1])return t;throw new Error("Coordinate is not a valid Point");}function i(n){if(!n)throw new Error("No obj passed");var t;if(n.length?t=n:n.coordinates?t=n.coordinates:n.geometry&&n.geometry.coordinates&&(t=n.geometry.coordinates),t)return r(t),t;throw new Error("No valid coordinates");}function r(n){if(n.length>1&&"number"==typeof n[0]&&"number"==typeof n[1])return!0;if(n[0].length)return r(n[0]);throw new Error("coordinates must only contain numbers");}function f(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 e(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 o(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);}}t.exports.geojsonType=f;t.exports.collectionOf=o;t.exports.featureOf=e;t.exports.getCoord=u;t.exports.getCoords=i},{}],467:[function(n,t){function i(n,t,r){for(var u,o,l,a,f,p,e,h,v,y=0,s=0,w="FeatureCollection"===n.type,b="Feature"===n.type,k=w?n.features.length:1,c=0;c<k;c++)for(h=w?n.features[c].geometry:b?n.geometry:n,v="GeometryCollection"===h.type,p=v?h.geometries.length:1,l=0;l<p;l++)if(f=v?h.geometries[l]:h,e=f.coordinates,y=!r||"Polygon"!==f.type&&"MultiPolygon"!==f.type?0:1,"Point"===f.type)t(e,s),s++;else if("LineString"===f.type||"MultiPoint"===f.type)for(u=0;u<e.length;u++)t(e[u],s),s++;else if("Polygon"===f.type||"MultiLineString"===f.type)for(u=0;u<e.length;u++)for(o=0;o<e[u].length-y;o++)t(e[u][o],s),s++;else if("MultiPolygon"===f.type)for(u=0;u<e.length;u++)for(o=0;o<e[u].length;o++)for(a=0;a<e[u][o].length-y;a++)t(e[u][o][a],s),s++;else{if("GeometryCollection"!==f.type)throw new Error("Unknown Geometry Type");for(u=0;u<f.geometries.length;u++)i(f.geometries[u],t,r)}}function e(n,t,r,u){var f=r;return i(n,function(n,i){f=0===i&&void 0===r?n:t(f,n,i)},u),f}function r(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 o(n,t,i){var u=i;return r(n,function(n,r){u=0===r&&void 0===i?n:t(u,n,r)}),u}function u(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 s(n,t,i){var r=i;return u(n,function(n,u){r=0===u&&void 0===i?n:t(r,n,u)}),r}function h(n){var t=[];return i(n,function(n){t.push(n)}),t}function f(n,t){for(var f,e,i,h,r,s,o=0,c="FeatureCollection"===n.type,l="Feature"===n.type,a=c?n.features.length:1,u=0;u<a;u++)for(r=c?n.features[u].geometry:l?n.geometry:n,s="GeometryCollection"===r.type,h=s?r.geometries.length:1,e=0;e<h;e++)if(i=s?r.geometries[e]:r,"Point"===i.type||"LineString"===i.type||"MultiPoint"===i.type||"Polygon"===i.type||"MultiLineString"===i.type||"MultiPolygon"===i.type)t(i,o),o++;else{if("GeometryCollection"!==i.type)throw new Error("Unknown Geometry Type");for(f=0;f<i.geometries.length;f++)t(i.geometries[f],o),o++}}function c(n,t,i){var r=i;return f(n,function(n,u){r=0===u&&void 0===i?n:t(r,n,u)}),r}t.exports.coordEach=i;t.exports.coordReduce=e;t.exports.propEach=r;t.exports.propReduce=o;t.exports.featureEach=u;t.exports.featureReduce=s;t.exports.coordAll=h;t.exports.geomEach=f;t.exports.geomReduce=c},{}],468:[function(n,t){function u(n,t){var r={};return f(n,function(n){var t=i(n)[1];r[t]||(r[t]=[]);r[t].push(n)}),Object.keys(r).map(function(n){return r[n].sort(function(n,t){return i(n)[0]-i(t)[0]})}).sort(function(n,r){return t?i(n[0])[1]-i(r[0])[1]:i(r[0])[1]-i(n[0])[1]})}var r=n("@turf/invariant"),i=r.getCoords,f=n("@turf/meta").featureEach;t.exports=function(n,t,i){var s;r.collectionOf(n,"Point","input must contain Points");t=t||"elevation";for(var h=u(n,i),c=[],f=0;f<h.length;f++){for(var l=h[f],e=[],o=0;o<l.length;o++)s=l[o],s.properties[t]?e.push(s.properties[t]):e.push(0);c.push(e)}return c}},{"@turf/invariant":469,"@turf/meta":470}],469:[function(n,t){function f(n){if(!n)throw new Error("obj is required");var t=r(n);if(t.length>1&&"number"==typeof t[0]&&"number"==typeof t[1])return t;throw new Error("Coordinate is not a valid Point");}function r(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 i(t),t;throw new Error("No valid coordinates");}function i(n){if(n.length>1&&"number"==typeof n[0]&&"number"==typeof n[1])return!0;if(Array.isArray(n[0])&&n[0].length)return i(n[0]);throw new Error("coordinates must only contain numbers");}function e(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 o(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 s(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 u(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 h(n){if(!n)throw new Error("geojson is required");var t=u(n);if(t)return t.type}t.exports={geojsonType:e,collectionOf:s,featureOf:o,getCoord:f,getCoords:r,containsNumber:i,getGeom:u,getGeomType:h}},{}],470:[function(n,t){function i(n,t,r){var o,y;if(null!==n)for(var a,u,e,v,l,b,f,c,p,w=0,h=0,k=n.type,d="FeatureCollection"===k,g="Feature"===k,nt=d?n.features.length:1,s=0;s<nt;s++)for(o=0,c=d?n.features[s].geometry:g?n.geometry:n,p=!!c&&"GeometryCollection"===c.type,b=p?c.geometries.length:1,a=0;a<b;a++)if(null!==(l=p?c.geometries[a]:c)){f=l.coordinates;y=l.type;switch(w=!r||"Polygon"!==y&&"MultiPolygon"!==y?0:1,y){case null:break;case"Point":t(f,h,s,o);h++;o++;break;case"LineString":case"MultiPoint":for(u=0;u<f.length;u++)t(f[u],h,s,o),h++,o++;break;case"Polygon":case"MultiLineString":for(u=0;u<f.length;u++)for(e=0;e<f[u].length-w;e++)t(f[u][e],h,s,o),h++,o++;break;case"MultiPolygon":for(u=0;u<f.length;u++)for(e=0;e<f[u].length;e++)for(v=0;v<f[u][e].length-w;v++)t(f[u][e][v],h,s,o),h++,o++;break;case"GeometryCollection":for(u=0;u<l.geometries.length;u++)i(l.geometries[u],t,r);break;default:throw new Error("Unknown Geometry Type");}}}function f(n,t,r,u){var f=r;return i(n,function(n,i,u,e){f=0===i&&void 0===r?n:t(f,n,i,u,e)},u),f}function e(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 c(n,t,i){var r=i;return e(n,function(n,u){r=0===u&&void 0===i?n:t(r,n,u)}),r}function o(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 l(n,t,i){var r=i;return o(n,function(n,u){r=0===u&&void 0===i?n:t(r,n,u)}),r}function a(n){var t=[];return i(n,function(n){t.push(n)}),t}function r(n,t){for(var e,o,f,l,i,h,s,r=0,c="FeatureCollection"===n.type,a="Feature"===n.type,v=c?n.features.length:1,u=0;u<v;u++)for(i=c?n.features[u].geometry:a?n.geometry:n,s=c?n.features[u].properties:a?n.properties:{},h=!!i&&"GeometryCollection"===i.type,l=h?i.geometries.length:1,o=0;o<l;o++)if(null!==(f=h?i.geometries[o]:i))switch(f.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":t(f,r,s);r++;break;case"GeometryCollection":for(e=0;e<f.geometries.length;e++)t(f.geometries[e],r,s),r++;break;default:throw new Error("Unknown Geometry Type");}else t(null,r,s),r++}function v(n,t,i){var u=i;return r(n,function(n,r,f){u=0===r&&void 0===i?n:t(u,n,r,f)}),u}function u(n,t){r(n,function(n,i,r){var f=null===n?null:n.type,u;switch(f){case null:case"Point":case"LineString":case"Polygon":return void t(h(n,r),i,0)}switch(f){case"MultiPoint":u="Point";break;case"MultiLineString":u="LineString";break;case"MultiPolygon":u="Polygon"}n.coordinates.forEach(function(n,f){t(h({type:u,coordinates:n},r),i,f)})})}function y(n,t,i){var r=i;return u(n,function(n,u,f){r=0===u&&0===f&&void 0===i?n:t(r,n,u,f)}),r}function s(n,t){u(n,function(n,i){var u=0,r;n.geometry&&(r=n.geometry.type,"Point"!==r&&"MultiPoint"!==r&&f(n,function(r,f){var e=w([r,f],n.properties);return t(e,i,u),u++,f}))})}function p(n,t,i){var r=i;return s(n,function(n,u,f){r=0===u&&void 0===i?n:t(r,n,u,f)}),r}function h(n,t){if(void 0===n)throw new Error("No geometry passed");return{type:"Feature",properties:t||{},geometry:n}}function w(n,t){if(!n)throw new Error("No coordinates passed");if(n.length<2)throw new Error("Coordinates must be an array of two or more positions");return{type:"Feature",properties:t||{},geometry:{type:"LineString",coordinates:n}}}t.exports={coordEach:i,coordReduce:f,propEach:e,propReduce:c,featureEach:o,featureReduce:l,coordAll:a,geomEach:r,geomReduce:v,flattenEach:u,flattenReduce:y,segmentEach:s,segmentReduce:p}},{}],471:[function(t,i){!function(t,r){"function"==typeof n&&n.amd?n([],function(){return{isoBands:r()}}):"object"==typeof i&&i.exports?i.exports={isoBands:r()}:t.MarchingSquaresJS={isoBands:r(),isoContours:t.MarchingSquaresJS?t.MarchingSquaresJS.isoContours:null}}(this,function(){function oi(n,t,i,r){var s,f,e,u,o,h;for(r=r||{},s=Object.keys(ei),f=0;f<s.length;f++)e=s[f],u=r[e],u=void 0!==u&&null!==u?u:ei[e],bt[e]=u;return bt.verbose&&console.log("MarchingSquaresJS-isoBands: computing isobands for ["+t+":"+(t+i)+"]"),h=si(n,t,i),bt.polygons?(bt.verbose&&console.log("MarchingSquaresJS-isoBands: returning single polygons for each grid cell"),o=yi(h)):(bt.verbose&&console.log("MarchingSquaresJS-isoBands: returning polygon paths for entire data grid"),o=hi(h)),"function"==typeof bt.successCallback&&bt.successCallback(o),o}function n(n,t,i){return(n-t)/(i-t)}function kt(n){return n.constructor.toString().indexOf("Array")>-1}function si(t,s,h){for(var et,st,ut,ht,b,k,it,d,g,rt,nt,tt,w,ct=t.length-1,at=t[0].length-1,ot={rows:ct,cols:at,cells:[]},l=s+Math.abs(h),ft=0;ft<ct;++ft)for(ot.cells[ft]=[],et=0;et<at;++et){var c=0,a=t[ft+1][et],v=t[ft+1][et+1],y=t[ft][et+1],p=t[ft][et];isNaN(a)||isNaN(v)||isNaN(y)||isNaN(p)||(c|=a<s?0:a>l?128:64,c|=v<s?0:v>l?32:16,c|=y<s?0:y>l?8:4,c|=p<s?0:p>l?2:1,st=+c,ut=0,(17===c||18===c||33===c||34===c||38===c||68===c||72===c||98===c||102===c||132===c||136===c||137===c||152===c||153===c)&&(ht=(a+v+y+p)/4,ut=ht>l?2:ht<s?0:1,34===c?1===ut?c=35:0===ut&&(c=136):136===c?1===ut?(c=35,ut=4):0===ut&&(c=34):17===c?1===ut?(c=155,ut=4):0===ut&&(c=153):68===c?1===ut?(c=103,ut=4):0===ut&&(c=102):153===c?1===ut&&(c=155):102===c?1===ut&&(c=103):152===c?ut<2&&(c=156,ut=1):137===c?ut<2&&(c=139,ut=1):98===c?ut<2&&(c=99,ut=1):38===c?ut<2&&(c=39,ut=1):18===c?ut>0?(c=156,ut=4):c=152:33===c?ut>0?(c=139,ut=4):c=137:72===c?ut>0?(c=99,ut=4):c=98:132===c&&(ut>0?(c=39,ut=4):c=38)),0!=c&&170!=c&&(b=k=it=d=g=rt=nt=tt=.5,w=[],1===c?(it=1-n(s,y,p),tt=1-n(s,a,p),w.push(u[c])):169===c?(it=n(l,p,y),tt=n(l,p,a),w.push(u[c])):4===c?(rt=1-n(s,v,y),d=n(s,p,y),w.push(i[c])):166===c?(rt=n(l,y,v),d=1-n(l,y,p),w.push(i[c])):16===c?(g=n(s,y,v),k=n(s,a,v),w.push(r[c])):154===c?(g=1-n(l,v,y),k=1-n(l,v,a),w.push(r[c])):64===c?(nt=n(s,p,a),b=1-n(s,v,a),w.push(e[c])):106===c?(nt=1-n(l,a,p),b=n(l,a,v),w.push(e[c])):168===c?(d=n(l,p,y),it=n(s,p,y),tt=n(s,p,a),nt=n(l,p,a),w.push(f[c]),w.push(u[c])):2===c?(d=1-n(s,y,p),it=1-n(l,y,p),tt=1-n(l,a,p),nt=1-n(s,a,p),w.push(f[c]),w.push(u[c])):162===c?(g=n(l,y,v),rt=n(s,y,v),d=1-n(s,y,p),it=1-n(l,y,p),w.push(f[c]),w.push(u[c])):8===c?(g=1-n(s,v,y),rt=1-n(l,v,y),d=n(l,p,y),it=n(s,p,y),w.push(r[c]),w.push(i[c])):138===c?(g=1-n(s,v,y),rt=1-n(l,v,y),b=1-n(l,v,a),k=1-n(s,v,a),w.push(r[c]),w.push(i[c])):32===c?(g=n(l,y,v),rt=n(s,y,v),b=n(s,a,v),k=n(l,a,v),w.push(r[c]),w.push(i[c])):42===c?(tt=1-n(l,a,p),nt=1-n(s,a,p),b=n(s,a,v),k=n(l,a,v),w.push(o[c]),w.push(e[c])):128===c&&(tt=n(s,p,a),nt=n(l,p,a),b=1-n(l,v,a),k=1-n(s,v,a),w.push(o[c]),w.push(e[c])),5===c?(rt=1-n(s,v,y),tt=1-n(s,a,p),w.push(i[c])):165===c?(rt=n(l,y,v),tt=n(l,p,a),w.push(i[c])):20===c?(d=n(s,p,y),k=n(s,a,v),w.push(f[c])):150===c?(d=1-n(l,y,p),k=1-n(l,v,a),w.push(f[c])):80===c?(g=n(s,y,v),nt=n(s,p,a),w.push(r[c])):90===c?(g=1-n(l,v,y),nt=1-n(l,a,p),w.push(r[c])):65===c?(it=1-n(s,y,p),b=1-n(s,v,a),w.push(u[c])):105===c?(it=n(l,p,y),b=n(l,a,v),w.push(u[c])):160===c?(g=n(l,y,v),rt=n(s,y,v),tt=n(s,p,a),nt=n(l,p,a),w.push(r[c]),w.push(i[c])):10===c?(g=1-n(s,v,y),rt=1-n(l,v,y),tt=1-n(l,a,p),nt=1-n(s,a,p),w.push(r[c]),w.push(i[c])):130===c?(d=1-n(s,y,p),it=1-n(l,y,p),b=1-n(l,v,a),k=1-n(s,v,a),w.push(f[c]),w.push(u[c])):40===c?(d=n(l,p,y),it=n(s,p,y),b=n(s,a,v),k=n(l,a,v),w.push(f[c]),w.push(u[c])):101===c?(rt=n(l,y,v),b=n(l,a,v),w.push(i[c])):69===c?(rt=1-n(s,v,y),b=1-n(s,v,a),w.push(i[c])):149===c?(tt=n(l,p,a),k=1-n(l,v,a),w.push(o[c])):21===c?(tt=1-n(s,a,p),k=n(s,a,v),w.push(o[c])):86===c?(d=1-n(l,y,p),nt=1-n(l,a,p),w.push(f[c])):84===c?(d=n(s,p,y),nt=n(s,p,a),w.push(f[c])):89===c?(g=1-n(l,v,y),it=n(l,p,y),w.push(u[c])):81===c?(g=n(s,y,v),it=1-n(s,y,p),w.push(u[c])):96===c?(g=n(l,y,v),rt=n(s,y,v),nt=n(s,p,a),b=n(l,a,v),w.push(r[c]),w.push(i[c])):74===c?(g=1-n(s,v,y),rt=1-n(l,v,y),nt=1-n(l,a,p),b=1-n(s,v,a),w.push(r[c]),w.push(i[c])):24===c?(g=1-n(l,v,y),d=n(l,p,y),it=n(s,p,y),k=n(s,a,v),w.push(r[c]),w.push(u[c])):146===c?(g=n(s,y,v),d=1-n(s,y,p),it=1-n(l,y,p),k=1-n(l,v,a),w.push(r[c]),w.push(u[c])):6===c?(rt=1-n(s,v,y),d=1-n(l,y,p),tt=1-n(l,a,p),nt=1-n(s,a,p),w.push(i[c]),w.push(f[c])):164===c?(rt=n(l,y,v),d=n(s,p,y),tt=n(s,p,a),nt=n(l,p,a),w.push(i[c]),w.push(f[c])):129===c?(it=1-n(s,y,p),tt=n(l,p,a),b=1-n(l,v,a),k=1-n(s,v,a),w.push(u[c]),w.push(o[c])):41===c?(it=n(l,p,y),tt=1-n(s,a,p),b=n(s,a,v),k=n(l,a,v),w.push(u[c]),w.push(o[c])):66===c?(d=1-n(s,y,p),it=1-n(l,y,p),nt=1-n(l,a,p),b=1-n(s,v,a),w.push(f[c]),w.push(u[c])):104===c?(d=n(l,p,y),it=n(s,p,y),nt=n(s,p,a),b=n(l,a,v),w.push(u[c]),w.push(lt[c])):144===c?(g=n(s,y,v),tt=n(s,p,a),nt=n(l,p,a),k=1-n(l,v,a),w.push(r[c]),w.push(e[c])):26===c?(g=1-n(l,v,y),tt=1-n(l,a,p),nt=1-n(s,a,p),k=n(s,a,v),w.push(r[c]),w.push(e[c])):36===c?(rt=n(l,y,v),d=n(s,p,y),b=n(s,a,v),k=n(l,a,v),w.push(i[c]),w.push(f[c])):134===c?(rt=1-n(s,v,y),d=1-n(l,y,p),b=1-n(l,v,a),k=1-n(s,v,a),w.push(i[c]),w.push(f[c])):9===c?(g=1-n(s,v,y),rt=1-n(l,v,y),it=n(l,p,y),tt=1-n(s,a,p),w.push(r[c]),w.push(i[c])):161===c?(g=n(l,y,v),rt=n(s,y,v),it=1-n(s,y,p),tt=n(l,p,a),w.push(r[c]),w.push(i[c])):37===c?(rt=n(l,y,v),tt=1-n(s,a,p),b=n(s,a,v),k=n(l,a,v),w.push(i[c]),w.push(o[c])):133===c?(rt=1-n(s,v,y),tt=n(l,p,a),b=1-n(l,v,a),k=1-n(s,v,a),w.push(i[c]),w.push(o[c])):148===c?(d=n(s,p,y),tt=n(s,p,a),nt=n(l,p,a),k=1-n(l,v,a),w.push(f[c]),w.push(e[c])):22===c?(d=1-n(l,y,p),tt=1-n(l,a,p),nt=1-n(s,a,p),k=n(s,a,v),w.push(f[c]),w.push(e[c])):82===c?(g=n(s,y,v),d=1-n(s,y,p),it=1-n(l,y,p),nt=1-n(l,a,p),w.push(r[c]),w.push(u[c])):88===c?(g=1-n(l,v,y),d=n(l,p,y),it=n(s,p,y),nt=n(s,p,a),w.push(r[c]),w.push(u[c])):73===c?(g=1-n(s,v,y),rt=1-n(l,v,y),it=n(l,p,y),b=1-n(s,v,a),w.push(r[c]),w.push(i[c])):97===c?(g=n(l,y,v),rt=n(s,y,v),it=1-n(s,y,p),b=n(l,a,v),w.push(r[c]),w.push(i[c])):145===c?(g=n(s,y,v),it=1-n(s,y,p),tt=n(l,p,a),k=1-n(l,v,a),w.push(r[c]),w.push(o[c])):25===c?(g=1-n(l,v,y),it=n(l,p,y),tt=1-n(s,a,p),k=n(s,a,v),w.push(r[c]),w.push(o[c])):70===c?(rt=1-n(s,v,y),d=1-n(l,y,p),nt=1-n(l,a,p),b=1-n(s,v,a),w.push(i[c]),w.push(f[c])):100===c?(rt=n(l,y,v),d=n(s,p,y),nt=n(s,p,a),b=n(l,a,v),w.push(i[c]),w.push(f[c])):34===c?(0===ut?(g=1-n(s,v,y),rt=1-n(l,v,y),d=n(l,p,y),it=n(s,p,y),tt=n(s,p,a),nt=n(l,p,a),b=1-n(l,v,a),k=1-n(s,v,a)):(g=n(l,y,v),rt=n(s,y,v),d=1-n(s,y,p),it=1-n(l,y,p),tt=1-n(l,a,p),nt=1-n(s,a,p),b=n(s,a,v),k=n(l,a,v)),w.push(r[c]),w.push(i[c]),w.push(o[c]),w.push(e[c])):35===c?(4===ut?(g=1-n(s,v,y),rt=1-n(l,v,y),d=n(l,p,y),it=n(s,p,y),tt=n(s,p,a),nt=n(l,p,a),b=1-n(l,v,a),k=1-n(s,v,a)):(g=n(l,y,v),rt=n(s,y,v),d=1-n(s,y,p),it=1-n(l,y,p),tt=1-n(l,a,p),nt=1-n(s,a,p),b=n(s,a,v),k=n(l,a,v)),w.push(r[c]),w.push(i[c]),w.push(u[c]),w.push(e[c])):136===c?(0===ut?(g=n(l,y,v),rt=n(s,y,v),d=1-n(s,y,p),it=1-n(l,y,p),tt=1-n(l,a,p),nt=1-n(s,a,p),b=n(s,a,v),k=n(l,a,v)):(g=1-n(s,v,y),rt=1-n(l,v,y),d=n(l,p,y),it=n(s,p,y),tt=n(s,p,a),nt=n(l,p,a),b=1-n(l,v,a),k=1-n(s,v,a)),w.push(r[c]),w.push(i[c]),w.push(o[c]),w.push(e[c])):153===c?(0===ut?(g=n(s,y,v),it=1-n(s,y,p),tt=1-n(s,a,p),k=n(s,a,v)):(g=1-n(l,v,y),it=n(l,p,y),tt=n(l,p,a),k=1-n(l,v,a)),w.push(r[c]),w.push(u[c])):102===c?(0===ut?(rt=1-n(s,v,y),d=n(s,p,y),nt=n(s,p,a),b=1-n(s,v,a)):(rt=n(l,y,v),d=1-n(l,y,p),nt=1-n(l,a,p),b=n(l,a,v)),w.push(i[c]),w.push(e[c])):155===c?(4===ut?(g=n(s,y,v),it=1-n(s,y,p),tt=1-n(s,a,p),k=n(s,a,v)):(g=1-n(l,v,y),it=n(l,p,y),tt=n(l,p,a),k=1-n(l,v,a)),w.push(r[c]),w.push(o[c])):103===c?(4===ut?(rt=1-n(s,v,y),d=n(s,p,y),nt=n(s,p,a),b=1-n(s,v,a)):(rt=n(l,y,v),d=1-n(l,y,p),nt=1-n(l,a,p),b=n(l,a,v)),w.push(i[c]),w.push(f[c])):152===c?(0===ut?(g=n(s,y,v),d=1-n(s,y,p),it=1-n(l,y,p),tt=1-n(l,a,p),nt=1-n(s,a,p),k=n(s,a,v)):(g=1-n(l,v,y),d=n(l,p,y),it=n(s,p,y),tt=n(s,p,a),nt=n(l,p,a),k=1-n(l,v,a)),w.push(r[c]),w.push(f[c]),w.push(u[c])):156===c?(4===ut?(g=n(s,y,v),d=1-n(s,y,p),it=1-n(l,y,p),tt=1-n(l,a,p),nt=1-n(s,a,p),k=n(s,a,v)):(g=1-n(l,v,y),d=n(l,p,y),it=n(s,p,y),tt=n(s,p,a),nt=n(l,p,a),k=1-n(l,v,a)),w.push(r[c]),w.push(u[c]),w.push(e[c])):137===c?(0===ut?(g=n(l,y,v),rt=n(s,y,v),it=1-n(s,y,p),tt=1-n(s,a,p),b=n(s,a,v),k=n(l,a,v)):(g=1-n(s,v,y),rt=1-n(l,v,y),it=n(l,p,y),tt=n(l,p,a),b=1-n(l,v,a),k=1-n(s,v,a)),w.push(r[c]),w.push(i[c]),w.push(u[c])):139===c?(4===ut?(g=n(l,y,v),rt=n(s,y,v),it=1-n(s,y,p),tt=1-n(s,a,p),b=n(s,a,v),k=n(l,a,v)):(g=1-n(s,v,y),rt=1-n(l,v,y),it=n(l,p,y),tt=n(l,p,a),b=1-n(l,v,a),k=1-n(s,v,a)),w.push(r[c]),w.push(i[c]),w.push(o[c])):98===c?(0===ut?(g=1-n(s,v,y),rt=1-n(l,v,y),d=n(l,p,y),it=n(s,p,y),nt=n(s,p,a),b=1-n(s,v,a)):(g=n(l,y,v),rt=n(s,y,v),d=1-n(s,y,p),it=1-n(l,y,p),nt=1-n(l,a,p),b=n(l,a,v)),w.push(r[c]),w.push(i[c]),w.push(e[c])):99===c?(4===ut?(g=1-n(s,v,y),rt=1-n(l,v,y),d=n(l,p,y),it=n(s,p,y),nt=n(s,p,a),b=1-n(s,v,a)):(g=n(l,y,v),rt=n(s,y,v),d=1-n(s,y,p),it=1-n(l,y,p),nt=1-n(l,a,p),b=n(l,a,v)),w.push(r[c]),w.push(i[c]),w.push(u[c])):38===c?(0===ut?(rt=1-n(s,v,y),d=n(s,p,y),tt=n(s,p,a),nt=n(l,p,a),b=1-n(l,v,a),k=1-n(s,v,a)):(rt=n(l,y,v),d=1-n(l,y,p),tt=1-n(l,a,p),nt=1-n(s,a,p),b=n(s,a,v),k=n(l,a,v)),w.push(i[c]),w.push(o[c]),w.push(e[c])):39===c?(4===ut?(rt=1-n(s,v,y),d=n(s,p,y),tt=n(s,p,a),nt=n(l,p,a),b=1-n(l,v,a),k=1-n(s,v,a)):(rt=n(l,y,v),d=1-n(l,y,p),tt=1-n(l,a,p),nt=1-n(s,a,p),b=n(s,a,v),k=n(l,a,v)),w.push(i[c]),w.push(f[c]),w.push(e[c])):85===c&&(g=1,rt=0,d=1,it=0,tt=0,nt=1,b=0,k=1),(b<0||b>1||k<0||k>1||g<0||g>1||d<0||d>1||tt<0||tt>1||nt<0||nt>1)&&console.log("MarchingSquaresJS-isoBands: "+c+" "+st+" "+a+","+v+","+y+","+p+" "+ut+" "+b+" "+k+" "+g+" "+rt+" "+d+" "+it+" "+tt+" "+nt),ot.cells[ft][et]={cval:c,cval_real:st,flipped:ut,topleft:b,topright:k,righttop:g,rightbottom:rt,bottomright:d,bottomleft:it,leftbottom:tt,lefttop:nt,edges:w}))}return ot}function hi(n){for(var u,o,h=[],c=n.rows,l=n.cols,s=[],e=0;e<c;e++)for(u=0;u<l;u++)if(void 0!==n.cells[e][u]&&n.cells[e][u].edges.length>0){var a=n.cells[e][u],f=ai(a),r=null,t=u,i=e;null!==f&&s.push([f.p[0]+t,f.p[1]+i]);do{if(null===(r=vi(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>=c||t<0||t>=l||void 0===n.cells[i][t]){if(t-=r.x,i-=r.y,o=ci(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);h.push(s);s=[];n.cells[e][u].edges.length>0&&u--}return h}function ci(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&yt)s.push([o,e]),r=-1,u=0,f=0;else{if(!(c&vt)){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&yt)){if(c&vt){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&wt)){if(c&pt){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&pt)){if(c&yt){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&pt)){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&vt)){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&vt)){if(c&wt){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&yt)){s.push([o+h.bottomright,e]);r=0;u=1;f=1;l=!0;break}s.push([o,e])}else{if(!(c&pt)){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&wt)){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&vt)){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&pt)){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}}function li(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()}function ai(n){if(n.edges.length>0){var i=n.edges[n.edges.length-1],t=n.cval_real;switch(i){case 0:return t&wt?{p:[1,n.righttop],x:-1,y:0,o:1}:{p:[n.topleft,1],x:0,y:-1,o:0};case 1:return t&vt?{p:[n.topleft,1],x:0,y:-1,o:0}:{p:[1,n.rightbottom],x:-1,y:0,o:0};case 2:return t&vt?{p:[n.bottomright,0],x:0,y:1,o:1}:{p:[n.topleft,1],x:0,y:-1,o:0};case 3:return t&yt?{p:[n.topleft,1],x:0,y:-1,o:0}:{p:[n.bottomleft,0],x:0,y:1,o:0};case 4:return t&wt?{p:[1,n.righttop],x:-1,y:0,o:1}:{p:[n.topright,1],x:0,y:-1,o:1};case 5:return t&vt?{p:[n.topright,1],x:0,y:-1,o:1}:{p:[1,n.rightbottom],x:-1,y:0,o:0};case 6:return t&vt?{p:[n.bottomright,0],x:0,y:1,o:1}:{p:[n.topright,1],x:0,y:-1,o:1};case 7:return t&yt?{p:[n.topright,1],x:0,y:-1,o:1}:{p:[n.bottomleft,0],x:0,y:1,o:0};case 8:return t&vt?{p:[n.bottomright,0],x:0,y:1,o:1}:{p:[1,n.righttop],x:-1,y:0,o:1};case 9:return t&yt?{p:[1,n.righttop],x:-1,y:0,o:1}:{p:[n.bottomleft,0],x:0,y:1,o:0};case 10:return t&yt?{p:[0,n.leftbottom],x:1,y:0,o:0}:{p:[1,n.righttop],x:-1,y:0,o:1};case 11:return t&pt?{p:[1,n.righttop],x:-1,y:0,o:1}:{p:[0,n.lefttop],x:1,y:0,o:1};case 12:return t&vt?{p:[n.bottomright,0],x:0,y:1,o:1}:{p:[1,n.rightbottom],x:-1,y:0,o:0};case 13:return t&yt?{p:[1,n.rightbottom],x:-1,y:0,o:0}:{p:[n.bottomleft,0],x:0,y:1,o:0};case 14:return t&yt?{p:[0,n.leftbottom],x:1,y:0,o:0}:{p:[1,n.rightbottom],x:-1,y:0,o:0};case 15:return t&pt?{p:[1,n.rightbottom],x:-1,y:0,o:0}:{p:[0,n.lefttop],x:1,y:0,o:1};case 16:return t&vt?{p:[n.bottomright,0],x:0,y:1,o:1}:{p:[0,n.leftbottom],x:1,y:0,o:0};case 17:return t&pt?{p:[n.bottomright,0],x:0,y:1,o:1}:{p:[0,n.lefttop],x:1,y:0,o:1};case 18:return t&yt?{p:[0,n.leftbottom],x:1,y:0,o:0}:{p:[n.bottomleft,0],x:0,y:1,o:0};case 19:return t&pt?{p:[n.bottomleft,0],x:0,y:1,o:0}:{p:[0,n.lefttop],x:1,y:0,o:1};case 20:return t&pt?{p:[n.topleft,1],x:0,y:-1,o:0}:{p:[0,n.leftbottom],x:1,y:0,o:0};case 21:return t&wt?{p:[0,n.leftbottom],x:1,y:0,o:0}:{p:[n.topright,1],x:0,y:-1,o:1};case 22:return t&pt?{p:[n.topleft,1],x:0,y:-1,o:0}:{p:[0,n.lefttop],x:1,y:0,o:1};case 23:return t&wt?{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}function vi(n,t,bt,kt){var ii,ri,gt,ni,ti,dt=n.cval;switch(t){case-1:switch(kt){case 0:ii=i[dt];gt=b[dt];ni=k[dt];ti=d[dt];break;default:ii=r[dt];gt=y[dt];ni=p[dt];ti=w[dt]}break;case 1:switch(kt){case 0:ii=o[dt];gt=st[dt];ni=ht[dt];ti=ct[dt];break;default:ii=e[dt];gt=ft[dt];ni=et[dt];ti=ot[dt]}break;default:switch(bt){case-1:switch(kt){case 0:ii=lt[dt];gt=s[dt];ni=h[dt];ti=c[dt];break;default:ii=at[dt];gt=l[dt];ni=a[dt];ti=v[dt]}break;case 1:switch(kt){case 0:ii=u[dt];gt=g[dt];ni=nt[dt];ti=tt[dt];break;default:ii=f[dt];gt=it[dt];ni=rt[dt];ti=ut[dt]}}}if(ri=n.edges.indexOf(ii),void 0===n.edges[ri])return null;switch(li(n,ri),dt=n.cval_real,ii){case 0:dt&wt?(t=n.topleft,bt=1):(t=1,bt=n.righttop);break;case 1:dt&vt?(t=1,bt=n.rightbottom):(t=n.topleft,bt=1);break;case 2:dt&vt?(t=n.topleft,bt=1):(t=n.bottomright,bt=0);break;case 3:dt&yt?(t=n.bottomleft,bt=0):(t=n.topleft,bt=1);break;case 4:dt&wt?(t=n.topright,bt=1):(t=1,bt=n.righttop);break;case 5:dt&vt?(t=1,bt=n.rightbottom):(t=n.topright,bt=1);break;case 6:dt&vt?(t=n.topright,bt=1):(t=n.bottomright,bt=0);break;case 7:dt&yt?(t=n.bottomleft,bt=0):(t=n.topright,bt=1);break;case 8:dt&vt?(t=1,bt=n.righttop):(t=n.bottomright,bt=0);break;case 9:dt&yt?(t=n.bottomleft,bt=0):(t=1,bt=n.righttop);break;case 10:dt&yt?(t=1,bt=n.righttop):(t=0,bt=n.leftbottom);break;case 11:dt&pt?(t=0,bt=n.lefttop):(t=1,bt=n.righttop);break;case 12:dt&vt?(t=1,bt=n.rightbottom):(t=n.bottomright,bt=0);break;case 13:dt&yt?(t=n.bottomleft,bt=0):(t=1,bt=n.rightbottom);break;case 14:dt&yt?(t=1,bt=n.rightbottom):(t=0,bt=n.leftbottom);break;case 15:dt&pt?(t=0,bt=n.lefttop):(t=1,bt=n.rightbottom);break;case 16:dt&vt?(t=0,bt=n.leftbottom):(t=n.bottomright,bt=0);break;case 17:dt&pt?(t=0,bt=n.lefttop):(t=n.bottomright,bt=0);break;case 18:dt&yt?(t=n.bottomleft,bt=0):(t=0,bt=n.leftbottom);break;case 19:dt&pt?(t=0,bt=n.lefttop):(t=n.bottomleft,bt=0);break;case 20:dt&pt?(t=0,bt=n.leftbottom):(t=n.topleft,bt=1);break;case 21:dt&wt?(t=n.topright,bt=1):(t=0,bt=n.leftbottom);break;case 22:dt&pt?(t=0,bt=n.lefttop):(t=n.topleft,bt=1);break;case 23:dt&wt?(t=n.topright,bt=1):(t=0,bt=n.lefttop);break;default:return console.log("MarchingSquaresJS-isoBands: edge index out of range!"),console.log(n),null}return void 0!==t&&void 0!==bt&&void 0!==gt&&void 0!==ni&&void 0!==ti||(console.log("MarchingSquaresJS-isoBands: undefined value!"),console.log(n),console.log(t+" "+bt+" "+gt+" "+ni+" "+ti)),{p:[t,bt],x:gt,y:ni,o:ti}}function yi(n){var i=[],r=0;return n.cells.forEach(function(n,u){n.forEach(function(n,f){if(void 0!==n){var e=t[n.cval](n);"object"==typeof e&&kt(e)?"object"==typeof e[0]&&kt(e[0])?"object"==typeof e[0][0]&&kt(e[0][0])?e.forEach(function(n){n.forEach(function(n){n[0]+=f;n[1]+=u});i[r++]=n}):(e.forEach(function(n){n[0]+=f;n[1]+=u}),i[r++]=e):console.log("MarchingSquaresJS-isoBands: bandcell polygon with malformed coordinates"):console.log("MarchingSquaresJS-isoBands: bandcell polygon with null coordinates")}})}),i}var ei={successCallback:null,verbose:!1,polygons:!1},bt={},pt=64,wt=16,vt=4,yt=1,s=[],h=[],c=[],l=[],a=[],v=[],y=[],p=[],w=[],b=[],k=[],d=[],g=[],nt=[],tt=[],it=[],rt=[],ut=[],ft=[],et=[],ot=[],st=[],ht=[],ct=[],t;y[85]=b[85]=-1;p[85]=k[85]=0;w[85]=d[85]=1;ft[85]=st[85]=1;et[85]=ht[85]=0;ot[85]=ct[85]=1;s[85]=l[85]=0;h[85]=a[85]=-1;c[85]=tt[85]=0;it[85]=g[85]=0;rt[85]=nt[85]=1;v[85]=ut[85]=1;st[1]=st[169]=0;ht[1]=ht[169]=-1;ct[1]=ct[169]=0;g[1]=g[169]=-1;nt[1]=nt[169]=0;tt[1]=tt[169]=0;b[4]=b[166]=0;k[4]=k[166]=-1;d[4]=d[166]=1;it[4]=it[166]=1;rt[4]=rt[166]=0;ut[4]=ut[166]=0;y[16]=y[154]=0;p[16]=p[154]=1;w[16]=w[154]=1;l[16]=l[154]=1;a[16]=a[154]=0;v[16]=v[154]=1;ft[64]=ft[106]=0;et[64]=et[106]=1;ot[64]=ot[106]=0;s[64]=s[106]=-1;h[64]=h[106]=0;c[64]=c[106]=1;ft[2]=ft[168]=0;et[2]=et[168]=-1;ot[2]=ot[168]=1;st[2]=st[168]=0;ht[2]=ht[168]=-1;ct[2]=ct[168]=0;g[2]=g[168]=-1;nt[2]=nt[168]=0;tt[2]=tt[168]=0;it[2]=it[168]=-1;rt[2]=rt[168]=0;ut[2]=ut[168]=1;y[8]=y[162]=0;p[8]=p[162]=-1;w[8]=w[162]=0;b[8]=b[162]=0;k[8]=k[162]=-1;d[8]=d[162]=1;g[8]=g[162]=1;nt[8]=nt[162]=0;tt[8]=tt[162]=1;it[8]=it[162]=1;rt[8]=rt[162]=0;ut[8]=ut[162]=0;y[32]=y[138]=0;p[32]=p[138]=1;w[32]=w[138]=1;b[32]=b[138]=0;k[32]=k[138]=1;d[32]=d[138]=0;s[32]=s[138]=1;h[32]=h[138]=0;c[32]=c[138]=0;l[32]=l[138]=1;a[32]=a[138]=0;v[32]=v[138]=1;st[128]=st[42]=0;ht[128]=ht[42]=1;ct[128]=ct[42]=1;ft[128]=ft[42]=0;et[128]=et[42]=1;ot[128]=ot[42]=0;s[128]=s[42]=-1;h[128]=h[42]=0;c[128]=c[42]=1;l[128]=l[42]=-1;a[128]=a[42]=0;v[128]=v[42]=0;b[5]=b[165]=-1;k[5]=k[165]=0;d[5]=d[165]=0;st[5]=st[165]=1;ht[5]=ht[165]=0;ct[5]=ct[165]=0;it[20]=it[150]=0;rt[20]=rt[150]=1;ut[20]=ut[150]=1;l[20]=l[150]=0;a[20]=a[150]=-1;v[20]=v[150]=1;y[80]=y[90]=-1;p[80]=p[90]=0;w[80]=w[90]=1;ft[80]=ft[90]=1;et[80]=et[90]=0;ot[80]=ot[90]=1;g[65]=g[105]=0;nt[65]=nt[105]=1;tt[65]=tt[105]=0;s[65]=s[105]=0;h[65]=h[105]=-1;c[65]=c[105]=0;y[160]=y[10]=-1;p[160]=p[10]=0;w[160]=w[10]=1;b[160]=b[10]=-1;k[160]=k[10]=0;d[160]=d[10]=0;st[160]=st[10]=1;ht[160]=ht[10]=0;ct[160]=ct[10]=0;ft[160]=ft[10]=1;et[160]=et[10]=0;ot[160]=ot[10]=1;it[130]=it[40]=0;rt[130]=rt[40]=1;ut[130]=ut[40]=1;g[130]=g[40]=0;nt[130]=nt[40]=1;tt[130]=tt[40]=0;s[130]=s[40]=0;h[130]=h[40]=-1;c[130]=c[40]=0;l[130]=l[40]=0;a[130]=a[40]=-1;v[130]=v[40]=1;b[37]=b[133]=0;k[37]=k[133]=1;d[37]=d[133]=1;st[37]=st[133]=0;ht[37]=ht[133]=1;ct[37]=ct[133]=0;s[37]=s[133]=-1;h[37]=h[133]=0;c[37]=c[133]=0;l[37]=l[133]=1;a[37]=a[133]=0;v[37]=v[133]=0;it[148]=it[22]=-1;rt[148]=rt[22]=0;ut[148]=ut[22]=0;st[148]=st[22]=0;ht[148]=ht[22]=-1;ct[148]=ct[22]=1;ft[148]=ft[22]=0;et[148]=et[22]=1;ot[148]=ot[22]=1;l[148]=l[22]=-1;a[148]=a[22]=0;v[148]=v[22]=1;y[82]=y[88]=0;p[82]=p[88]=-1;w[82]=w[88]=1;it[82]=it[88]=1;rt[82]=rt[88]=0;ut[82]=ut[88]=1;g[82]=g[88]=-1;nt[82]=nt[88]=0;tt[82]=tt[88]=1;ft[82]=ft[88]=0;et[82]=et[88]=-1;ot[82]=ot[88]=0;y[73]=y[97]=0;p[73]=p[97]=1;w[73]=w[97]=0;b[73]=b[97]=0;k[73]=k[97]=-1;d[73]=d[97]=0;g[73]=g[97]=1;nt[73]=nt[97]=0;tt[73]=tt[97]=0;s[73]=s[97]=1;h[73]=h[97]=0;c[73]=c[97]=1;y[145]=y[25]=0;p[145]=p[25]=-1;w[145]=w[25]=0;g[145]=g[25]=1;nt[145]=nt[25]=0;tt[145]=tt[25]=1;st[145]=st[25]=0;ht[145]=ht[25]=1;ct[145]=ct[25]=1;l[145]=l[25]=-1;a[145]=a[25]=0;v[145]=v[25]=0;b[70]=b[100]=0;k[70]=k[100]=1;d[70]=d[100]=0;it[70]=it[100]=-1;rt[70]=rt[100]=0;ut[70]=ut[100]=1;ft[70]=ft[100]=0;et[70]=et[100]=-1;ot[70]=ot[100]=1;s[70]=s[100]=1;h[70]=h[100]=0;c[70]=c[100]=0;b[101]=b[69]=0;k[101]=k[69]=1;d[101]=d[69]=0;s[101]=s[69]=1;h[101]=h[69]=0;c[101]=c[69]=0;st[149]=st[21]=0;ht[149]=ht[21]=1;ct[149]=ct[21]=1;l[149]=l[21]=-1;a[149]=a[21]=0;v[149]=v[21]=0;it[86]=it[84]=-1;rt[86]=rt[84]=0;ut[86]=ut[84]=1;ft[86]=ft[84]=0;et[86]=et[84]=-1;ot[86]=ot[84]=1;y[89]=y[81]=0;p[89]=p[81]=-1;w[89]=w[81]=0;g[89]=g[81]=1;nt[89]=nt[81]=0;tt[89]=tt[81]=1;y[96]=y[74]=0;p[96]=p[74]=1;w[96]=w[74]=0;b[96]=b[74]=-1;k[96]=k[74]=0;d[96]=d[74]=1;ft[96]=ft[74]=1;et[96]=et[74]=0;ot[96]=ot[74]=0;s[96]=s[74]=1;h[96]=h[74]=0;c[96]=c[74]=1;y[24]=y[146]=0;p[24]=p[146]=-1;w[24]=w[146]=1;it[24]=it[146]=1;rt[24]=rt[146]=0;ut[24]=ut[146]=1;g[24]=g[146]=0;nt[24]=nt[146]=1;tt[24]=tt[146]=1;l[24]=l[146]=0;a[24]=a[146]=-1;v[24]=v[146]=0;b[6]=b[164]=-1;k[6]=k[164]=0;d[6]=d[164]=1;it[6]=it[164]=-1;rt[6]=rt[164]=0;ut[6]=ut[164]=0;st[6]=st[164]=0;ht[6]=ht[164]=-1;ct[6]=ct[164]=1;ft[6]=ft[164]=1;et[6]=et[164]=0;ot[6]=ot[164]=0;g[129]=g[41]=0;nt[129]=nt[41]=1;tt[129]=tt[41]=1;st[129]=st[41]=0;ht[129]=ht[41]=1;ct[129]=ct[41]=0;s[129]=s[41]=-1;h[129]=h[41]=0;c[129]=c[41]=0;l[129]=l[41]=0;a[129]=a[41]=-1;v[129]=v[41]=0;it[66]=it[104]=0;rt[66]=rt[104]=1;ut[66]=ut[104]=0;g[66]=g[104]=-1;nt[66]=nt[104]=0;tt[66]=tt[104]=1;ft[66]=ft[104]=0;et[66]=et[104]=-1;ot[66]=ot[104]=0;s[66]=s[104]=0;h[66]=h[104]=-1;c[66]=c[104]=1;y[144]=y[26]=-1;p[144]=p[26]=0;w[144]=w[26]=0;st[144]=st[26]=1;ht[144]=ht[26]=0;ct[144]=ct[26]=1;ft[144]=ft[26]=0;et[144]=et[26]=1;ot[144]=ot[26]=1;l[144]=l[26]=-1;a[144]=a[26]=0;v[144]=v[26]=1;b[36]=b[134]=0;k[36]=k[134]=1;d[36]=d[134]=1;it[36]=it[134]=0;rt[36]=rt[134]=1;ut[36]=ut[134]=0;s[36]=s[134]=0;h[36]=h[134]=-1;c[36]=c[134]=1;l[36]=l[134]=1;a[36]=a[134]=0;v[36]=v[134]=0;y[9]=y[161]=-1;p[9]=p[161]=0;w[9]=w[161]=0;b[9]=b[161]=0;k[9]=k[161]=-1;d[9]=d[161]=0;g[9]=g[161]=1;nt[9]=nt[161]=0;tt[9]=tt[161]=0;st[9]=st[161]=1;ht[9]=ht[161]=0;ct[9]=ct[161]=1;y[136]=0;p[136]=1;w[136]=1;b[136]=0;k[136]=1;d[136]=0;it[136]=-1;rt[136]=0;ut[136]=1;g[136]=-1;nt[136]=0;tt[136]=0;st[136]=0;ht[136]=-1;ct[136]=0;ft[136]=0;et[136]=-1;ot[136]=1;s[136]=1;h[136]=0;c[136]=0;l[136]=1;a[136]=0;v[136]=1;y[34]=0;p[34]=-1;w[34]=0;b[34]=0;k[34]=-1;d[34]=1;it[34]=1;rt[34]=0;ut[34]=0;g[34]=1;nt[34]=0;tt[34]=1;st[34]=0;ht[34]=1;ct[34]=1;ft[34]=0;et[34]=1;ot[34]=0;s[34]=-1;h[34]=0;c[34]=1;l[34]=-1;a[34]=0;v[34]=0;y[35]=0;p[35]=1;w[35]=1;b[35]=0;k[35]=-1;d[35]=1;it[35]=1;rt[35]=0;ut[35]=0;g[35]=-1;nt[35]=0;tt[35]=0;st[35]=0;ht[35]=-1;ct[35]=0;ft[35]=0;et[35]=1;ot[35]=0;s[35]=-1;h[35]=0;c[35]=1;l[35]=1;a[35]=0;v[35]=1;y[153]=0;p[153]=1;w[153]=1;g[153]=-1;nt[153]=0;tt[153]=0;st[153]=0;ht[153]=-1;ct[153]=0;l[153]=1;a[153]=0;v[153]=1;b[102]=0;k[102]=-1;d[102]=1;it[102]=1;rt[102]=0;ut[102]=0;ft[102]=0;et[102]=1;ot[102]=0;s[102]=-1;h[102]=0;c[102]=1;y[155]=0;p[155]=-1;w[155]=0;g[155]=1;nt[155]=0;tt[155]=1;st[155]=0;ht[155]=1;ct[155]=1;l[155]=-1;a[155]=0;v[155]=0;b[103]=0;k[103]=1;d[103]=0;it[103]=-1;rt[103]=0;ut[103]=1;ft[103]=0;et[103]=-1;ot[103]=1;s[103]=1;h[103]=0;c[103]=0;y[152]=0;p[152]=1;w[152]=1;it[152]=-1;rt[152]=0;ut[152]=1;g[152]=-1;nt[152]=0;tt[152]=0;st[152]=0;ht[152]=-1;ct[152]=0;ft[152]=0;et[152]=-1;ot[152]=1;l[152]=1;a[152]=0;v[152]=1;y[156]=0;p[156]=-1;w[156]=1;it[156]=1;rt[156]=0;ut[156]=1;g[156]=-1;nt[156]=0;tt[156]=0;st[156]=0;ht[156]=-1;ct[156]=0;ft[156]=0;et[156]=1;ot[156]=1;l[156]=-1;a[156]=0;v[156]=1;y[137]=0;p[137]=1;w[137]=1;b[137]=0;k[137]=1;d[137]=0;g[137]=-1;nt[137]=0;tt[137]=0;st[137]=0;ht[137]=-1;ct[137]=0;s[137]=1;h[137]=0;c[137]=0;l[137]=1;a[137]=0;v[137]=1;y[139]=0;p[139]=1;w[139]=1;b[139]=0;k[139]=-1;d[139]=0;g[139]=1;nt[139]=0;tt[139]=0;st[139]=0;ht[139]=1;ct[139]=0;s[139]=-1;h[139]=0;c[139]=0;l[139]=1;a[139]=0;v[139]=1;y[98]=0;p[98]=-1;w[98]=0;b[98]=0;k[98]=-1;d[98]=1;it[98]=1;rt[98]=0;ut[98]=0;g[98]=1;nt[98]=0;tt[98]=1;ft[98]=0;et[98]=1;ot[98]=0;s[98]=-1;h[98]=0;c[98]=1;y[99]=0;p[99]=1;w[99]=0;b[99]=0;k[99]=-1;d[99]=1;it[99]=1;rt[99]=0;ut[99]=0;g[99]=-1;nt[99]=0;tt[99]=1;ft[99]=0;et[99]=-1;ot[99]=0;s[99]=1;h[99]=0;c[99]=1;b[38]=0;k[38]=-1;d[38]=1;it[38]=1;rt[38]=0;ut[38]=0;st[38]=0;ht[38]=1;ct[38]=1;ft[38]=0;et[38]=1;ot[38]=0;s[38]=-1;h[38]=0;c[38]=1;l[38]=-1;a[38]=0;v[38]=0;b[39]=0;k[39]=1;d[39]=1;it[39]=-1;rt[39]=0;ut[39]=0;st[39]=0;ht[39]=-1;ct[39]=1;ft[39]=0;et[39]=1;ot[39]=0;s[39]=-1;h[39]=0;c[39]=1;l[39]=1;a[39]=0;v[39]=0;var dt=function(n){return[[n.bottomleft,0],[0,0],[0,n.leftbottom]]},gt=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0]]},ni=function(n){return[[n.topright,1],[1,1],[1,n.righttop]]},ti=function(n){return[[0,n.lefttop],[0,1],[n.topleft,1]]},ii=function(n){return[[n.bottomright,0],[n.bottomleft,0],[0,n.leftbottom],[0,n.lefttop]]},ri=function(n){return[[n.bottomright,0],[n.bottomleft,0],[1,n.righttop],[1,n.rightbottom]]},ui=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.topleft,1],[n.topright,1]]},fi=function(n){return[[0,n.leftbottom],[0,n.lefttop],[n.topleft,1],[n.topright,1]]},pi=function(n){return[[0,0],[0,n.leftbottom],[1,n.rightbottom],[1,0]]},wi=function(n){return[[1,0],[n.bottomright,0],[n.topright,1],[1,1]]},bi=function(n){return[[1,1],[1,n.righttop],[0,n.lefttop],[0,1]]},ki=function(n){return[[n.bottomleft,0],[0,0],[0,1],[n.topleft,1]]},di=function(n){return[[1,n.righttop],[1,n.rightbottom],[0,n.leftbottom],[0,n.lefttop]]},gi=function(n){return[[n.topleft,1],[n.topright,1],[n.bottomright,0],[n.bottomleft,0]]},nr=function(){return[[0,0],[0,1],[1,1],[1,0]]},tr=function(n){return[[1,n.rightbottom],[1,0],[0,0],[0,1],[n.topleft,1]]},ir=function(n){return[[n.topright,1],[1,1],[1,0],[0,0],[0,n.leftbottom]]},rr=function(n){return[[1,0],[n.bottomright,0],[0,n.lefttop],[0,1],[1,1]]},ur=function(n){return[[1,1],[1,n.righttop],[n.bottomleft,0],[0,0],[0,1]]},fr=function(n){return[[1,n.righttop],[1,n.rightbottom],[0,n.lefttop],[0,1],[n.topleft,1]]},er=function(n){return[[1,1],[1,n.righttop],[n.bottomright,0],[n.bottomleft,0],[n.topright,1]]},or=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[0,n.leftbottom],[0,n.lefttop]]},sr=function(n){return[[n.topright,1],[n.bottomleft,0],[0,0],[0,n.leftbottom],[n.topleft,1]]},hr=function(n){return[[n.bottomright,0],[n.bottomleft,0],[0,n.lefttop],[0,1],[n.topleft,1]]},cr=function(n){return[[1,1],[1,n.righttop],[0,n.leftbottom],[0,n.lefttop],[n.topright,1]]},lr=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[n.topleft,1],[n.topright,1]]},ar=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomleft,0],[0,0],[0,n.leftbottom]]},vr=function(n){return[[1,n.rightbottom],[1,0],[0,0],[0,n.leftbottom],[n.topleft,1],[n.topright,1]]},yr=function(n){return[[1,1],[1,0],[n.bottomright,0],[0,n.leftbottom],[0,n.lefttop],[n.topright,1]]},pr=function(n){return[[1,1],[1,n.righttop],[n.bottomright,0],[n.bottomleft,0],[0,n.lefttop],[0,1]]},wr=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomleft,0],[0,0],[0,1],[n.topleft,1]]},br=function(n){return[[1,1],[1,n.righttop],[n.bottomleft,0],[0,0],[0,n.leftbottom],[n.topright,1]]},kr=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[0,n.lefttop],[0,1],[n.topleft,1]]},dr=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]]},gr=function(n){return[[1,1],[1,n.righttop],[n.bottomleft,0],[0,0],[0,n.leftbottom],[n.topright,1]]},nu=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[0,n.lefttop],[0,1],[n.topleft,1]]},tu=function(n){return[[1,1],[1,n.righttop],[n.bottomright,0],[n.bottomleft,0],[0,n.leftbottom],[0,n.lefttop],[n.topright,1]]},iu=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomleft,0],[0,0],[0,n.leftbottom],[n.topleft,1],[n.topright,1]]},ru=function(n){return[[1,n.righttop],[1,n.rightbottom],[n.bottomright,0],[n.bottomleft,0],[0,n.lefttop],[0,1],[n.topleft,1]]},uu=function(n){return[[1,n.rightbottom],[1,0],[n.bottomright,0],[0,n.leftbottom],[0,n.lefttop],[n.topleft,1],[n.topright,1]]},r=[],i=[],f=[],u=[],o=[],e=[],lt=[],at=[];return u[1]=o[1]=18,u[169]=o[169]=18,f[4]=i[4]=12,f[166]=i[166]=12,r[16]=at[16]=4,r[154]=at[154]=4,e[64]=lt[64]=22,e[106]=lt[106]=22,f[2]=e[2]=17,u[2]=o[2]=18,f[168]=e[168]=17,u[168]=o[168]=18,r[8]=u[8]=9,i[8]=f[8]=12,r[162]=u[162]=9,i[162]=f[162]=12,r[32]=at[32]=4,i[32]=lt[32]=1,r[138]=at[138]=4,i[138]=lt[138]=1,o[128]=at[128]=21,e[128]=lt[128]=22,o[42]=at[42]=21,e[42]=lt[42]=22,i[5]=o[5]=14,i[165]=o[165]=14,f[20]=at[20]=6,f[150]=at[150]=6,r[80]=e[80]=11,r[90]=e[90]=11,u[65]=lt[65]=3,u[105]=lt[105]=3,r[160]=e[160]=11,i[160]=o[160]=14,r[10]=e[10]=11,i[10]=o[10]=14,f[130]=at[130]=6,u[130]=lt[130]=3,f[40]=at[40]=6,u[40]=lt[40]=3,i[101]=lt[101]=1,i[69]=lt[69]=1,o[149]=at[149]=21,o[21]=at[21]=21,f[86]=e[86]=17,f[84]=e[84]=17,r[89]=u[89]=9,r[81]=u[81]=9,r[96]=lt[96]=0,i[96]=e[96]=15,r[74]=lt[74]=0,i[74]=e[74]=15,r[24]=f[24]=8,u[24]=at[24]=7,r[146]=f[146]=8,u[146]=at[146]=7,i[6]=e[6]=15,f[6]=o[6]=16,i[164]=e[164]=15,f[164]=o[164]=16,u[129]=at[129]=7,o[129]=lt[129]=20,u[41]=at[41]=7,o[41]=lt[41]=20,f[66]=lt[66]=2,u[66]=e[66]=19,f[104]=lt[104]=2,u[104]=e[104]=19,r[144]=o[144]=10,e[144]=at[144]=23,r[26]=o[26]=10,e[26]=at[26]=23,i[36]=at[36]=5,f[36]=lt[36]=2,i[134]=at[134]=5,f[134]=lt[134]=2,r[9]=o[9]=10,i[9]=u[9]=13,r[161]=o[161]=10,i[161]=u[161]=13,i[37]=at[37]=5,o[37]=lt[37]=20,i[133]=at[133]=5,o[133]=lt[133]=20,f[148]=o[148]=16,e[148]=at[148]=23,f[22]=o[22]=16,e[22]=at[22]=23,r[82]=f[82]=8,u[82]=e[82]=19,r[88]=f[88]=8,u[88]=e[88]=19,r[73]=lt[73]=0,i[73]=u[73]=13,r[97]=lt[97]=0,i[97]=u[97]=13,r[145]=u[145]=9,o[145]=at[145]=21,r[25]=u[25]=9,o[25]=at[25]=21,i[70]=lt[70]=1,f[70]=e[70]=17,i[100]=lt[100]=1,f[100]=e[100]=17,r[34]=u[34]=9,i[34]=f[34]=12,o[34]=at[34]=21,e[34]=lt[34]=22,r[136]=at[136]=4,i[136]=lt[136]=1,f[136]=e[136]=17,u[136]=o[136]=18,r[35]=at[35]=4,i[35]=f[35]=12,u[35]=o[35]=18,e[35]=lt[35]=22,r[153]=at[153]=4,u[153]=o[153]=18,i[102]=f[102]=12,e[102]=lt[102]=22,r[155]=u[155]=9,o[155]=at[155]=23,i[103]=lt[103]=1,f[103]=e[103]=17,r[152]=at[152]=4,f[152]=e[152]=17,u[152]=o[152]=18,r[156]=f[156]=8,u[156]=o[156]=18,e[156]=at[156]=23,r[137]=at[137]=4,i[137]=lt[137]=1,u[137]=o[137]=18,r[139]=at[139]=4,i[139]=u[139]=13,o[139]=lt[139]=20,r[98]=u[98]=9,i[98]=f[98]=12,e[98]=lt[98]=22,r[99]=lt[99]=0,i[99]=f[99]=12,u[99]=e[99]=19,i[38]=f[38]=12,o[38]=at[38]=21,e[38]=lt[38]=22,i[39]=at[39]=5,f[39]=o[39]=16,e[39]=lt[39]=22,t=[],t[1]=t[169]=dt,t[4]=t[166]=gt,t[16]=t[154]=ni,t[64]=t[106]=ti,t[168]=t[2]=ii,t[162]=t[8]=ri,t[138]=t[32]=ui,t[42]=t[128]=fi,t[5]=t[165]=pi,t[20]=t[150]=wi,t[80]=t[90]=bi,t[65]=t[105]=ki,t[160]=t[10]=di,t[130]=t[40]=gi,t[85]=nr,t[101]=t[69]=tr,t[149]=t[21]=ir,t[86]=t[84]=rr,t[89]=t[81]=ur,t[96]=t[74]=fr,t[24]=t[146]=er,t[6]=t[164]=or,t[129]=t[41]=sr,t[66]=t[104]=hr,t[144]=t[26]=cr,t[36]=t[134]=lr,t[9]=t[161]=ar,t[37]=t[133]=vr,t[148]=t[22]=yr,t[82]=t[88]=pr,t[73]=t[97]=wr,t[145]=t[25]=br,t[70]=t[100]=kr,t[34]=function(n){return[fi(n),ri(n)]},t[35]=dr,t[136]=function(n){return[ui(n),ii(n)]},t[153]=function(n){return[ni(n),dt(n)]},t[102]=function(n){return[gt(n),ti(n)]},t[155]=gr,t[103]=nu,t[152]=function(n){return[ni(n),ii(n)]},t[156]=tu,t[137]=function(n){return[ui(n),dt(n)]},t[139]=iu,t[98]=function(n){return[ri(n),ti(n)]},t[99]=ru,t[38]=function(n){return[gt(n),fi(n)]},t[39]=uu,oi})},{}],472:[function(t,i){!function(t,r){"function"==typeof n&&n.amd?n([],function(){return{isoContours:r()}}):"object"==typeof i&&i.exports?i.exports={isoContours:r()}:t.MarchingSquaresJS={isoContours:r(),isoBands:t.MarchingSquaresJS?t.MarchingSquaresJS.isoBands:null}}(this,function(){function e(n,i,r){var c,e,s,u,l;for(r=r||{},c=Object.keys(f),e=0;e<c.length;e++)s=c[e],u=r[s],u=void 0!==u&&null!==u?u:f[s],t[s]=u;return t.verbose&&console.log("MarchingSquaresJS-isoContours: computing isocontour for "+i),l=h(o(n,i)),"function"==typeof t.successCallback&&t.successCallback(l),l}function n(n,t,i){return(n-t)/(i-t)}function o(t,i){for(var v,y,w,s,h,c,l,b=t.length-1,k=t[0].length-1,p={rows:b,cols:k,cells:[]},a=0;a<b;++a)for(p.cells[a]=[],v=0;v<k;++v){var r=0,u=t[a+1][v],f=t[a+1][v+1],e=t[a][v+1],o=t[a][v];isNaN(u)||isNaN(f)||isNaN(e)||isNaN(o)||(r|=u>=i?8:0,r|=f>=i?4:0,r|=e>=i?2:0,r|=o>=i?1:0,y=!1,(5===r||10===r)&&(w=(u+f+e+o)/4,5===r&&w<i?(r=10,y=!0):10===r&&w<i&&(r=5,y=!0)),0!=r&&15!=r&&(s=h=c=l=.5,1===r?(c=1-n(i,u,o),h=1-n(i,e,o)):2===r?(h=n(i,o,e),l=1-n(i,f,e)):3===r?(c=1-n(i,u,o),l=1-n(i,f,e)):4===r?(s=n(i,u,f),l=n(i,e,f)):5===r?(s=n(i,u,f),l=n(i,e,f),h=1-n(i,e,o),c=1-n(i,u,o)):6===r?(h=n(i,o,e),s=n(i,u,f)):7===r?(c=1-n(i,u,o),s=n(i,u,f)):8===r?(c=n(i,o,u),s=1-n(i,f,u)):9===r?(h=1-n(i,e,o),s=1-n(i,f,u)):10===r?(s=1-n(i,f,u),l=1-n(i,f,e),h=n(i,o,e),c=n(i,o,u)):11===r?(s=1-n(i,f,u),l=1-n(i,f,e)):12===r?(c=n(i,o,u),l=n(i,e,f)):13===r?(h=1-n(i,e,o),l=n(i,e,f)):14===r?(c=n(i,o,u),h=n(i,o,e)):console.log("MarchingSquaresJS-isoContours: Illegal cval detected: "+r),p.cells[a][v]={cval:r,flipped:y,top:s,right:l,bottom:h,left:c}))}return p}function s(n){return 5===n.cval||10===n.cval}function r(n){return 0===n.cval||15===n.cval}function u(n){r(n)||5===n.cval||10===n.cval||(n.cval=15)}function i(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 h(n){var t=[],i=0;return n.rows,n.cols,n.cells.forEach(function(u,f){u.forEach(function(u,e){var o,a,l;if(void 0!==u&&!s(u)&&!r(u)){if(o=c(n.cells,f,e),a=!1,"mergeable"===o.info)for(var v=o.path[o.path.length-1][0],y=o.path[o.path.length-1][1],h=i-1;h>=0;h--)if(Math.abs(t[h][0][0]-v)<=1e-7&&Math.abs(t[h][0][1]-y)<=1e-7){for(l=o.path.length-2;l>=0;--l)t[h].unshift(o.path[l]);a=!0;break}a||(t[i++]=o.path)}})}),t}function c(n,t,r){var s,h,k=n.length,a=[],p=[0,0,1,1,0,0,0,0,-1,0,1,1,-1,0,-1,0],w=[0,-1,0,0,1,1,1,1,0,-1,0,0,0,-1,0,0],b=["none","bottom","right","right","top","top","top","top","left","bottom","right","right","left","bottom","left","none"],o=(n[t][r],n[t][r]),f=o.cval,e=["none","left","bottom","left","right","none","bottom","left","top","top","none","top","right","right","bottom","none"][f],c=i(o,e);a.push([r+c[0],t+c[1]]);e=b[f];c=i(o,e);a.push([r+c[0],t+c[1]]);u(o);for(var v=r+p[f],l=t+w[f],y=f;v>=0&&l>=0&&l<k&&(v!=r||l!=t)&&void 0!==(o=n[l][v]);){if(0===(f=o.cval)||15===f)return{path:a,info:"mergeable"};e=b[f];s=p[f];h=w[f];5!==f&&10!==f||(5===f?o.flipped?-1===w[y]?(e="left",s=-1,h=0):(e="right",s=1,h=0):-1===p[y]&&(e="bottom",s=0,h=-1):10===f&&(o.flipped?-1===p[y]?(e="top",s=0,h=1):(e="bottom",s=0,h=-1):1===w[y]&&(e="left",s=-1,h=0)));c=i(o,e);a.push([v+c[0],l+c[1]]);u(o);v+=s;l+=h;y=f}return{path:a,info:"closed"}}var f={successCallback:null,verbose:!1},t={};return e})},{}],473:[function(t,i){!function(r,u){"function"==typeof n&&n.amd?n(["./marchingsquares-isobands","./marchingsquares-isocontours"],u):"object"==typeof i&&i.exports?i.exports=u(t("./marchingsquares-isobands"),t("./marchingsquares-isocontours")):r.MarchingSquaresJS=u(r.MarchingSquaresJS?r.MarchingSquaresJS.isoBands:null,r.MarchingSquaresJS?r.MarchingSquaresJS.isoContours:null)}(this,function(n,t){return{isoBands:"function"==typeof n?n:"object"==typeof n&&"function"==typeof n.isoBands?n.isoBands:null,isoContours:"function"==typeof t?t:"object"==typeof t&&"function"==typeof t.isoContours?t.isoContours:null}})},{"./marchingsquares-isobands":471,"./marchingsquares-isocontours":472}],474:[function(n,t,i){arguments[4][15][0].apply(i,arguments)},{dup:15}],475:[function(n,t){function r(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=l(c.isoContours(n,o),s),e.push(h);return e}function u(n,t,i){var r=e(i),u=r[2]-r[0],f=r[3]-r[1],o=r[0],s=r[1],h=t[0].length-1,c=t.length-1,l=u/h,v=f/c,y=function(n){n[0]=n[0]*l+o;n[1]=n[1]*v+s};return n.forEach(function(n){a(n,y)}),n}function f(n){return!!n&&n.constructor===Object}var e=n("@turf/bbox"),o=n("@turf/meta"),i=n("@turf/helpers"),s=n("@turf/invariant"),h=n("grid-to-matrix"),c=n("marchingsquares"),l=i.multiLineString,a=o.coordEach,v=s.collectionOf,y=i.featureCollection;t.exports=function(n,t,i,e,o){if(i=i||"elevation",e=e||{},o=o||[],v(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(!f(e))throw new Error("propertiesToAllIsolines must be an Object");if(!Array.isArray(o))throw new Error("propertiesPerIsoline must be an Array");if("string"!=typeof i)throw new Error("zProperty must be a string");var s=h(n,i,!0),c=r(s,t,i,e,o),l=u(c,s,n);return y(l)}},{"@turf/bbox":476,"@turf/helpers":478,"@turf/invariant":479,"@turf/meta":480,"grid-to-matrix":481,marchingsquares:484}],476:[function(n,t,i){arguments[4][22][0].apply(i,arguments)},{"@turf/meta":477,dup:22}],477:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],478:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],479:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],480:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],481:[function(n,t,i){arguments[4][468][0].apply(i,arguments)},{"@turf/invariant":479,"@turf/meta":480,dup:468}],482:[function(n,t,i){arguments[4][471][0].apply(i,arguments)},{dup:471}],483:[function(n,t,i){arguments[4][472][0].apply(i,arguments)},{dup:472}],484:[function(n,t,i){arguments[4][473][0].apply(i,arguments)},{"./marchingsquares-isobands":482,"./marchingsquares-isocontours":483,dup:473}],485:[function(n,t){function i(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])}var r=n("@turf/helpers").point;t.exports=function(n){var u,t,f={type:"FeatureCollection",features:[]};if(t="Feature"===n.type?n.geometry:n,"LineString"===t.type)u=[t.coordinates];else if("MultiLineString"===t.type)u=t.coordinates;else if("MultiPolygon"===t.type)u=[].concat.apply([],t.coordinates);else{if("Polygon"!==t.type)throw new Error("Input must be a LineString, MultiLineString, Polygon, or MultiPolygon Feature or Geometry");u=t.coordinates}return u.forEach(function(n){u.forEach(function(t){for(var e,o,u=0;u<n.length-1;u++)for(e=u;e<t.length-1;e++){if(n===t){if(1===Math.abs(u-e))continue;if(0===u&&e===n.length-2&&n[u][0]===n[n.length-1][0]&&n[u][1]===n[n.length-1][1])continue}o=i(n[u][0],n[u][1],n[u+1][0],n[u+1][1],t[e][0],t[e][1],t[e+1][0],t[e+1][1]);o&&f.features.push(r([o[0],o[1]]))}})}),f}},{"@turf/helpers":486}],486:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],487:[function(n,t){function i(n){var t=n%360;return t<0&&(t+=360),t}var r=n("@turf/destination"),f=n("@turf/circle"),u=n("@turf/helpers").lineString;t.exports=function(n,t,e,o,s,h){if(!n)throw new Error("center is required");if(void 0===e||null===e)throw new Error("bearing1 is required");if(void 0===o||null===o)throw new Error("bearing2 is required");if(!t)throw new Error("radius is required");s=s||64;var a=i(e),c=i(o),p=n.properties;if(a===c)return u(f(n,t,s,h).geometry.coordinates[0],p);for(var w=a,v=a<c?c:c+360,l=w,y=[],b=0;l<v;)y.push(r(n,t,l,h).geometry.coordinates),b++,l=w+360*b/s;return l>v&&y.push(r(n,t,v,h).geometry.coordinates),u(y,p)}},{"@turf/circle":488,"@turf/destination":493,"@turf/helpers":496}],488:[function(n,t,i){arguments[4][213][0].apply(i,arguments)},{"@turf/destination":489,"@turf/helpers":492,dup:213}],489:[function(n,t,i){arguments[4][5][0].apply(i,arguments)},{"@turf/helpers":490,"@turf/invariant":491,dup:5}],490:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],491:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],492:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],493:[function(n,t,i){arguments[4][5][0].apply(i,arguments)},{"@turf/helpers":494,"@turf/invariant":495,dup:5}],494:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],495:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],496:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],497:[function(n,t){function i(n,t,i,f){var o=u(n,i),s,e;if(o<=t)return f(n);for(s=Math.floor(o/t)+1,e=0;e<s;e++)f(r(n,t*e,t*(e+1),i),e)}var r=n("@turf/line-slice-along"),u=n("@turf/line-distance"),f=n("@turf/helpers").featureCollection,e=n("@turf/meta").flattenEach;t.exports=function(n,t,r,u){if(!n)throw new Error("geojson is required");if(t<=0)throw new Error("segmentLength must be greater than 0");var o=[];return e(n,function(n){u&&(n.geometry.coordinates=n.geometry.coordinates.reverse());i(n,t,r,function(n){o.push(n)})}),f(o)}},{"@turf/helpers":498,"@turf/line-distance":499,"@turf/line-slice-along":504,"@turf/meta":514}],498:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],499:[function(n,t){var i=n("@turf/distance"),r=n("@turf/meta").segmentReduce;t.exports=function(n,t){if(!n)throw new Error("geojson is required");return r(n,function(n,r){var u=r.geometry.coordinates;return n+i(u[0],u[1],t)},0)}},{"@turf/distance":500,"@turf/meta":503}],500:[function(n,t,i){arguments[4][8][0].apply(i,arguments)},{"@turf/helpers":501,"@turf/invariant":502,dup:8}],501:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],502:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],503:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],504:[function(n,t){var r=n("@turf/bearing"),f=n("@turf/distance"),u=n("@turf/destination"),i=n("@turf/helpers").lineString;t.exports=function(n,t,e,o){var s,c=[],a,v,y,l,h;if("Feature"===n.type)s=n.geometry.coordinates;else{if("LineString"!==n.type)throw new Error("input must be a LineString Feature or Geometry");s=n.coordinates}for(l=0,h=0;h<s.length&&!(t>=l&&h===s.length-1);h++){if(l>t&&0===c.length){if(!(a=t-l))return c.push(s[h]),i(c);v=r(s[h],s[h-1])-180;y=u(s[h],a,v,o);c.push(y.geometry.coordinates)}if(l>=e)return(a=e-l)?(v=r(s[h],s[h-1])-180,y=u(s[h],a,v,o),c.push(y.geometry.coordinates),i(c)):(c.push(s[h]),i(c));if(l>=t&&c.push(s[h]),h===s.length-1)return i(c);l+=f(s[h],s[h+1],o)}return i(s[s.length-1])}},{"@turf/bearing":505,"@turf/destination":507,"@turf/distance":510,"@turf/helpers":513}],505:[function(n,t,i){arguments[4][3][0].apply(i,arguments)},{"@turf/invariant":506,dup:3}],506:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],507:[function(n,t,i){arguments[4][5][0].apply(i,arguments)},{"@turf/helpers":508,"@turf/invariant":509,dup:5}],508:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],509:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],510:[function(n,t,i){arguments[4][8][0].apply(i,arguments)},{"@turf/helpers":511,"@turf/invariant":512,dup:8}],511:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],512:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],513:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],514:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],515:[function(n,t,i){arguments[4][499][0].apply(i,arguments)},{"@turf/distance":516,"@turf/meta":519,dup:499}],516:[function(n,t,i){arguments[4][8][0].apply(i,arguments)},{"@turf/helpers":517,"@turf/invariant":518,dup:8}],517:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],518:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],519:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],520:[function(n,t,i){arguments[4][44][0].apply(i,arguments)},{"@turf/helpers":524,"@turf/invariant":525,"@turf/line-segment":526,"@turf/meta":530,dup:44,"geojson-rbush":531}],521:[function(n,t,i){arguments[4][20][0].apply(i,arguments)},{"@turf/helpers":522,dup:20}],522:[function(n,t,i){arguments[4][46][0].apply(i,arguments)},{dup:46}],523:[function(n,t,i){arguments[4][47][0].apply(i,arguments)},{"@turf/meta":530,dup:47}],524:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],525:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],526:[function(n,t,i){arguments[4][50][0].apply(i,arguments)},{"@turf/helpers":527,"@turf/invariant":528,"@turf/meta":529,dup:50}],527:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],528:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],529:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],530:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],531:[function(n,t,i){arguments[4][55][0].apply(i,arguments)},{"@turf/bbox":523,"@turf/bbox-polygon":521,"@turf/helpers":524,"@turf/meta":530,dup:55,rbush:533}],532:[function(n,t,i){arguments[4][56][0].apply(i,arguments)},{dup:56}],533:[function(n,t,i){arguments[4][57][0].apply(i,arguments)},{dup:57,quickselect:532}],534:[function(n,t){function r(n,t,i){var s=[],c=l(t,i),f=e(n),r=[];return f.forEach(function(n,t){var i,e,h;t!==f.length-1&&(i=u(n,f[t+1],c),(s.push(i),t>0)&&(e=s[t-1],h=o(i,e),!1!==h&&(e[1]=h,i[0]=h),r.push(e[0]),t===f.length-2&&(r.push(i[0]),r.push(i[1]))),2===f.length&&(r.push(i[0]),r.push(i[1])))}),h(r,n.properties)}function u(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;return[[u,n[1]+i*(n[0]-t[0])/r],[f,t[1]+i*(n[0]-t[0])/r]]}var f=n("@turf/meta"),i=n("@turf/helpers"),e=n("@turf/invariant").getCoords,o=n("./intersection"),s=f.flattenEach,h=i.lineString,c=i.multiLineString,l=i.distanceToDegrees;t.exports=function(n,t,i){var u,e,f;if(!n)throw new Error("geojson is required");if(void 0===t||null===t||isNaN(t))throw new Error("distance is required");u="Feature"===n.type?n.geometry.type:n.type;e=n.properties;switch(u){case"LineString":return r(n,t,i);case"MultiLineString":return f=[],s(n,function(n){f.push(r(n,t,i).geometry.coordinates)}),c(f,e);default:throw new Error("geometry "+u+" is not supported");}}},{"./intersection":535,"@turf/helpers":536,"@turf/invariant":537,"@turf/meta":538}],535:[function(n,t){function i(n){var t=n[0],i=n[1];return[i[0]-t[0],i[1]-t[1]]}function r(n,t){return n[0]*t[1]-t[0]*n[1]}function u(n,t){return[n[0]+t[0],n[1]+t[1]]}function f(n,t){return[n[0]-t[0],n[1]-t[1]]}function e(n,t){return[n*t[0],n*t[1]]}function o(n,t){var o=n[0],s=i(n),c=t[0],h=i(t),l=r(s,h);return u(o,e(r(f(c,o),h)/l,s))}function s(n,t){return 0===r(i(n),i(t))}function h(n,t){return!s(n,t)&&o(n,t)}t.exports=h},{}],536:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],537:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],538:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],539:[function(n,t,i){arguments[4][107][0].apply(i,arguments)},{"@turf/boolean-point-on-line":543,"@turf/helpers":545,"@turf/invariant":546,"@turf/line-segment":547,"@turf/meta":551,"@turf/point-on-line":552,"deep-equal":578,dup:107,"geojson-rbush":581}],540:[function(n,t,i){arguments[4][20][0].apply(i,arguments)},{"@turf/helpers":541,dup:20}],541:[function(n,t,i){arguments[4][46][0].apply(i,arguments)},{dup:46}],542:[function(n,t,i){arguments[4][47][0].apply(i,arguments)},{"@turf/meta":551,dup:47}],543:[function(n,t,i){arguments[4][34][0].apply(i,arguments)},{"@turf/invariant":544,dup:34}],544:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],545:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],546:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],547:[function(n,t,i){arguments[4][50][0].apply(i,arguments)},{"@turf/helpers":548,"@turf/invariant":549,"@turf/meta":550,dup:50}],548:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],549:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],550:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],551:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],552:[function(n,t,i){arguments[4][120][0].apply(i,arguments)},{"@turf/bearing":553,"@turf/destination":555,"@turf/distance":558,"@turf/helpers":561,"@turf/invariant":562,"@turf/line-intersect":563,"@turf/meta":577,dup:120}],553:[function(n,t,i){arguments[4][3][0].apply(i,arguments)},{"@turf/invariant":554,dup:3}],554:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],555:[function(n,t,i){arguments[4][5][0].apply(i,arguments)},{"@turf/helpers":556,"@turf/invariant":557,dup:5}],556:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],557:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],558:[function(n,t,i){arguments[4][8][0].apply(i,arguments)},{"@turf/helpers":559,"@turf/invariant":560,dup:8}],559:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],560:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],561:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],562:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],563:[function(n,t,i){arguments[4][44][0].apply(i,arguments)},{"@turf/helpers":567,"@turf/invariant":568,"@turf/line-segment":569,"@turf/meta":573,dup:44,"geojson-rbush":574}],564:[function(n,t,i){arguments[4][20][0].apply(i,arguments)},{"@turf/helpers":565,dup:20}],565:[function(n,t,i){arguments[4][46][0].apply(i,arguments)},{dup:46}],566:[function(n,t,i){arguments[4][47][0].apply(i,arguments)},{"@turf/meta":573,dup:47}],567:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],568:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],569:[function(n,t,i){arguments[4][50][0].apply(i,arguments)},{"@turf/helpers":570,"@turf/invariant":571,"@turf/meta":572,dup:50}],570:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],571:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],572:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],573:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],574:[function(n,t,i){arguments[4][55][0].apply(i,arguments)},{"@turf/bbox":566,"@turf/bbox-polygon":564,"@turf/helpers":567,"@turf/meta":573,dup:55,rbush:576}],575:[function(n,t,i){arguments[4][56][0].apply(i,arguments)},{dup:56}],576:[function(n,t,i){arguments[4][57][0].apply(i,arguments)},{dup:57,quickselect:575}],577:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],578:[function(n,t,i){arguments[4][87][0].apply(i,arguments)},{"./lib/is_arguments.js":579,"./lib/keys.js":580,dup:87}],579:[function(n,t,i){arguments[4][88][0].apply(i,arguments)},{dup:88}],580:[function(n,t,i){arguments[4][89][0].apply(i,arguments)},{dup:89}],581:[function(n,t,i){arguments[4][55][0].apply(i,arguments)},{"@turf/bbox":542,"@turf/bbox-polygon":540,"@turf/helpers":545,"@turf/meta":551,dup:55,rbush:583}],582:[function(n,t,i){arguments[4][56][0].apply(i,arguments)},{dup:56}],583:[function(n,t,i){arguments[4][57][0].apply(i,arguments)},{dup:57,quickselect:582}],584:[function(n,t,i){arguments[4][50][0].apply(i,arguments)},{"@turf/helpers":585,"@turf/invariant":586,"@turf/meta":587,dup:50}],585:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],586:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],587:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],588:[function(n,t,i){arguments[4][504][0].apply(i,arguments)},{"@turf/bearing":589,"@turf/destination":591,"@turf/distance":594,"@turf/helpers":597,dup:504}],589:[function(n,t,i){arguments[4][3][0].apply(i,arguments)},{"@turf/invariant":590,dup:3}],590:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],591:[function(n,t,i){arguments[4][5][0].apply(i,arguments)},{"@turf/helpers":592,"@turf/invariant":593,dup:5}],592:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],593:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],594:[function(n,t,i){arguments[4][8][0].apply(i,arguments)},{"@turf/helpers":595,"@turf/invariant":596,dup:8}],595:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],596:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],597:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],598:[function(n,t){var r=n("@turf/helpers").lineString,i=n("@turf/point-on-line");t.exports=function(n,t,u){var c,f,e,o,s,h;if("Feature"===u.type)c=u.geometry.coordinates;else{if("LineString"!==u.type)throw new Error("input must be a LineString Feature or Geometry");c=u.coordinates}for(e=i(u,n),o=i(u,t),f=e.properties.index<=o.properties.index?[e,o]:[o,e],s=[f[0].geometry.coordinates],h=f[0].properties.index+1;h<f[1].properties.index+1;h++)s.push(c[h]);return s.push(f[1].geometry.coordinates),r(s,u.properties)}},{"@turf/helpers":599,"@turf/point-on-line":600}],599:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],600:[function(n,t,i){arguments[4][120][0].apply(i,arguments)},{"@turf/bearing":601,"@turf/destination":603,"@turf/distance":606,"@turf/helpers":609,"@turf/invariant":610,"@turf/line-intersect":611,"@turf/meta":625,dup:120}],601:[function(n,t,i){arguments[4][3][0].apply(i,arguments)},{"@turf/invariant":602,dup:3}],602:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],603:[function(n,t,i){arguments[4][5][0].apply(i,arguments)},{"@turf/helpers":604,"@turf/invariant":605,dup:5}],604:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],605:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],606:[function(n,t,i){arguments[4][8][0].apply(i,arguments)},{"@turf/helpers":607,"@turf/invariant":608,dup:8}],607:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],608:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],609:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],610:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],611:[function(n,t,i){arguments[4][44][0].apply(i,arguments)},{"@turf/helpers":615,"@turf/invariant":616,"@turf/line-segment":617,"@turf/meta":621,dup:44,"geojson-rbush":622}],612:[function(n,t,i){arguments[4][20][0].apply(i,arguments)},{"@turf/helpers":613,dup:20}],613:[function(n,t,i){arguments[4][46][0].apply(i,arguments)},{dup:46}],614:[function(n,t,i){arguments[4][47][0].apply(i,arguments)},{"@turf/meta":621,dup:47}],615:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],616:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],617:[function(n,t,i){arguments[4][50][0].apply(i,arguments)},{"@turf/helpers":618,"@turf/invariant":619,"@turf/meta":620,dup:50}],618:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],619:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],620:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],621:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],622:[function(n,t,i){arguments[4][55][0].apply(i,arguments)},{"@turf/bbox":614,"@turf/bbox-polygon":612,"@turf/helpers":615,"@turf/meta":621,dup:55,rbush:624}],623:[function(n,t,i){arguments[4][56][0].apply(i,arguments)},{dup:56}],624:[function(n,t,i){arguments[4][57][0].apply(i,arguments)},{dup:57,quickselect:623}],625:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],626:[function(n,t){function o(n,t){var i=[],f=c();return e(t,function(t){if(i.forEach(function(n,t){n.id=t}),i.length){var h=f.search(t),o=s(t,h);i=i.filter(function(n){return n.id!==o.id});f.remove(o);e(u(o,t),function(n){i.push(n);f.insert(n)})}else i=u(n,t).features,f.load(r(i))}),r(i)}function u(n,t){var u=[],l=i(n)[0],y=i(n)[n.geometry.coordinates.length-1],e,o,h;if(f(l,i(t))||f(y,i(t)))return r([n]);if(e=c(),o=b(n),e.load(o),h=e.search(t),!h.features.length)return r([n]);var p=s(t,h),w=[l],a=g(o,function(n,r,e){var s=i(r)[1],o=i(t);return e===p.id?(n.push(o),u.push(v(n)),f(o,s)?[o]:[o,s]):(n.push(s),n)},w);return a.length>1&&u.push(v(a)),r(u)}function s(n,t){if(!t.features)throw new Error("<lines> must contain features");if(1===t.features.length)return t.features[0];var i,r=1/0;return e(t,function(t){var f=k(t,n),u=f.properties.dist;u<r&&(i=t,r=u)}),i}function f(n,t){return n[0]===t[0]&&n[1]===t[1]}var h=n("@turf/meta"),c=n("geojson-rbush"),l=n("@turf/helpers"),p=n("@turf/flatten"),w=n("@turf/truncate"),a=n("@turf/invariant"),b=n("@turf/line-segment"),k=n("@turf/point-on-line"),d=n("@turf/line-intersect"),i=a.getCoords,v=l.lineString,y=a.getGeomType,e=h.featureEach,g=h.featureReduce,r=l.featureCollection;t.exports=function(n,t){var f,i,r;if(!n)throw new Error("line is required");if(!t)throw new Error("splitter is required");if(f=y(n),i=y(t),"LineString"!==f)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=w(t,7);switch(i){case"Point":return u(n,r);case"MultiPoint":return o(n,p(r));case"LineString":case"MultiLineString":case"Polygon":case"MultiPolygon":return o(n,d(n,r))}}},{"@turf/flatten":630,"@turf/helpers":633,"@turf/invariant":634,"@turf/line-intersect":635,"@turf/line-segment":649,"@turf/meta":653,"@turf/point-on-line":654,"@turf/truncate":680,"geojson-rbush":682}],627:[function(n,t,i){arguments[4][20][0].apply(i,arguments)},{"@turf/helpers":628,dup:20}],628:[function(n,t,i){arguments[4][46][0].apply(i,arguments)},{dup:46}],629:[function(n,t,i){arguments[4][47][0].apply(i,arguments)},{"@turf/meta":653,dup:47}],630:[function(n,t,i){arguments[4][384][0].apply(i,arguments)},{"@turf/helpers":631,"@turf/meta":632,dup:384}],631:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],632:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],633:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],634:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],635:[function(n,t,i){arguments[4][44][0].apply(i,arguments)},{"@turf/helpers":639,"@turf/invariant":640,"@turf/line-segment":641,"@turf/meta":645,dup:44,"geojson-rbush":646}],636:[function(n,t,i){arguments[4][20][0].apply(i,arguments)},{"@turf/helpers":637,dup:20}],637:[function(n,t,i){arguments[4][46][0].apply(i,arguments)},{dup:46}],638:[function(n,t,i){arguments[4][47][0].apply(i,arguments)},{"@turf/meta":645,dup:47}],639:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],640:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],641:[function(n,t,i){arguments[4][50][0].apply(i,arguments)},{"@turf/helpers":642,"@turf/invariant":643,"@turf/meta":644,dup:50}],642:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],643:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],644:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],645:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],646:[function(n,t,i){arguments[4][55][0].apply(i,arguments)},{"@turf/bbox":638,"@turf/bbox-polygon":636,"@turf/helpers":639,"@turf/meta":645,dup:55,rbush:648}],647:[function(n,t,i){arguments[4][56][0].apply(i,arguments)},{dup:56}],648:[function(n,t,i){arguments[4][57][0].apply(i,arguments)},{dup:57,quickselect:647}],649:[function(n,t,i){arguments[4][50][0].apply(i,arguments)},{"@turf/helpers":650,"@turf/invariant":651,"@turf/meta":652,dup:50}],650:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],651:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],652:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],653:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],654:[function(n,t,i){arguments[4][120][0].apply(i,arguments)},{"@turf/bearing":655,"@turf/destination":657,"@turf/distance":660,"@turf/helpers":663,"@turf/invariant":664,"@turf/line-intersect":665,"@turf/meta":679,dup:120}],655:[function(n,t,i){arguments[4][3][0].apply(i,arguments)},{"@turf/invariant":656,dup:3}],656:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],657:[function(n,t,i){arguments[4][5][0].apply(i,arguments)},{"@turf/helpers":658,"@turf/invariant":659,dup:5}],658:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],659:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],660:[function(n,t,i){arguments[4][8][0].apply(i,arguments)},{"@turf/helpers":661,"@turf/invariant":662,dup:8}],661:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],662:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],663:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],664:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],665:[function(n,t,i){arguments[4][44][0].apply(i,arguments)},{"@turf/helpers":669,"@turf/invariant":670,"@turf/line-segment":671,"@turf/meta":675,dup:44,"geojson-rbush":676}],666:[function(n,t,i){arguments[4][20][0].apply(i,arguments)},{"@turf/helpers":667,dup:20}],667:[function(n,t,i){arguments[4][46][0].apply(i,arguments)},{dup:46}],668:[function(n,t,i){arguments[4][47][0].apply(i,arguments)},{"@turf/meta":675,dup:47}],669:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],670:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],671:[function(n,t,i){arguments[4][50][0].apply(i,arguments)},{"@turf/helpers":672,"@turf/invariant":673,"@turf/meta":674,dup:50}],672:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],673:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],674:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],675:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],676:[function(n,t,i){arguments[4][55][0].apply(i,arguments)},{"@turf/bbox":668,"@turf/bbox-polygon":666,"@turf/helpers":669,"@turf/meta":675,dup:55,rbush:678}],677:[function(n,t,i){arguments[4][56][0].apply(i,arguments)},{dup:56}],678:[function(n,t,i){arguments[4][57][0].apply(i,arguments)},{dup:57,quickselect:677}],679:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],680:[function(n,t,i){arguments[4][455][0].apply(i,arguments)},{"@turf/meta":681,dup:455}],681:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],682:[function(n,t,i){arguments[4][55][0].apply(i,arguments)},{"@turf/bbox":629,"@turf/bbox-polygon":627,"@turf/helpers":633,"@turf/meta":653,dup:55,rbush:684}],683:[function(n,t,i){arguments[4][56][0].apply(i,arguments)},{dup:56}],684:[function(n,t,i){arguments[4][57][0].apply(i,arguments)},{dup:57,quickselect:683}],685:[function(n,t){function r(n,t,i,r){var c,v,a,y;if(t=t||n.properties||{},c=e(n),v=u(n),!c.length)throw new Error("line must contain coordinates");switch(v){case"LineString":return i&&(c=f(c)),o([c],t);case"MultiLineString":return a=[],y=0,c.forEach(function(n){if(i&&(n=f(n)),r){var t=s(h(l(n)));t>y?(a.unshift(n),y=t):a.push(n)}else a.push(n)}),o(a,t);default:throw new Error("geometry type "+v+" is not supported");}}function u(n){return n.geometry?n.geometry.type:n.type}function f(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 s(n){var t=n[0],i=n[1],r=n[2],u=n[3];return Math.abs(t-r)*Math.abs(i-u)}var h=n("@turf/bbox"),e=n("@turf/invariant").getCoords,i=n("@turf/helpers"),o=i.polygon,c=i.multiPolygon,l=i.lineString;t.exports=function(n,t,i,f){if(!n)throw new Error("lines is required");switch(i=void 0===i||i,f=void 0===f||f,u(n)){case"FeatureCollection":case"GeometryCollection":var o=[];return(n.features?n.features:n.geometries).forEach(function(n){o.push(e(r(n,{},i,f)))}),c(o,t)}return r(n,t,i,f)}},{"@turf/bbox":686,"@turf/helpers":688,"@turf/invariant":689}],686:[function(n,t,i){arguments[4][22][0].apply(i,arguments)},{"@turf/meta":687,dup:22}],687:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],688:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],689:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],690:[function(n,t){function o(n,t,u){var f=[];return f.push(n.geometry.coordinates[0]),r(t,function(n){f.push(n.geometry.coordinates[0])}),r(u,function(n){f.push(n.geometry.coordinates[0])}),i.polygon(f)}function s(n){var t=[],u=[];return r(n,function(n){var r=n.geometry.coordinates,f=r[0],e=r.slice(1);t.push(i.polygon([f]));e.forEach(function(n){u.push(i.polygon([n]))})}),[i.featureCollection(t),i.featureCollection(u)]}function h(n){var t=n&&n.geometry.coordinates||[[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]];return i.polygon(t)}function u(n){if(n.features.length<=1)return n;var t=c(n),o=[],u={};return r(n,function(n,i){var r,s,h;if(u[i])return!0;for(t.remove({index:i},f),u[i]=!0;;)if(r=e(n),s=t.search({minX:r[0],minY:r[1],maxX:r[2],maxY:r[3]}),s.length>0&&(h=s.map(function(n){return u[n.index]=!0,t.remove({index:n.index},f),n.geojson}),h.push(n),n=a.apply(this,h)),0===s.length)break;o.push(n)}),i.featureCollection(o)}function f(n,t){return n.index===t.index}function c(n){var t=l(),i=[];return r(n,function(n,t){var r=e(n);i.push({minX:r[0],minY:r[1],maxX:r[2],maxY:r[3],geojson:n,index:t})}),t.load(i),t}var l=n("rbush"),a=n("@turf/union"),i=n("@turf/helpers"),e=n("@turf/bbox"),r=n("@turf/meta").flattenEach;t.exports=function(n,t){var e=h(t),f=s(n),i=f[0],r=f[1];return i=u(i),r=u(r),o(e,i,r)}},{"@turf/bbox":691,"@turf/helpers":693,"@turf/meta":694,"@turf/union":695,rbush:698}],691:[function(n,t,i){arguments[4][22][0].apply(i,arguments)},{"@turf/meta":692,dup:22}],692:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],693:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],694:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],695:[function(n,t,i){arguments[4][367][0].apply(i,arguments)},{dup:367,jsts:696}],696:[function(n,t,i){arguments[4][176][0].apply(i,arguments)},{dup:176}],697:[function(n,t,i){arguments[4][56][0].apply(i,arguments)},{dup:56}],698:[function(n,t,i){arguments[4][57][0].apply(i,arguments)},{dup:57,quickselect:697}],699:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],700:[function(n,t){var i=n("@turf/bearing"),r=n("@turf/destination"),u=n("@turf/distance");t.exports=function(n,t){var f=u(n,t,"miles"),e=i(n,t);return r(n,f/2,e,"miles")}},{"@turf/bearing":701,"@turf/destination":703,"@turf/distance":706}],701:[function(n,t,i){arguments[4][3][0].apply(i,arguments)},{"@turf/invariant":702,dup:3}],702:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],703:[function(n,t,i){arguments[4][5][0].apply(i,arguments)},{"@turf/helpers":704,"@turf/invariant":705,dup:5}],704:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],705:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],706:[function(n,t,i){arguments[4][8][0].apply(i,arguments)},{"@turf/helpers":707,"@turf/invariant":708,dup:8}],707:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],708:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],709:[function(n,t){var i=n("@turf/distance");t.exports=function(n,t){for(var e,f,u=1/0,r=0;r<t.features.length;r++)f=i(n,t.features[r],"miles"),f<u&&(e=t.features[r],u=f);return e}},{"@turf/distance":710}],710:[function(n,t,i){arguments[4][8][0].apply(i,arguments)},{"@turf/helpers":711,"@turf/invariant":712,dup:8}],711:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],712:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],713:[function(n,t){var i=n("@turf/invariant"),r=i.getCoord,u=i.getGeom;t.exports=function(n,t){var y=r(n),nt=u(t),tt=nt.coordinates,e=tt[0];if(e.length<4)throw new Error("OuterRing of a Polygon must have 4 or more Positions.");var v=t.properties||{},p=v.a,w=v.b,b=v.c,i=y[0],f=y[1],o=e[0][0],s=e[0][1],k=void 0!==p?p:e[0][2],h=e[1][0],c=e[1][1],d=void 0!==w?w:e[1][2],l=e[2][0],a=e[2][1],g=void 0!==b?b:e[2][2];return(g*(i-o)*(f-c)+k*(i-h)*(f-a)+d*(i-l)*(f-s)-d*(i-o)*(f-a)-g*(i-h)*(f-s)-k*(i-l)*(f-c))/((i-o)*(f-c)+(i-h)*(f-a)+(i-l)*(f-s)-(i-o)*(f-a)-(i-h)*(f-s)-(i-l)*(f-c))}},{"@turf/invariant":714}],714:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],715:[function(n,t,i){arguments[4][432][0].apply(i,arguments)},{"@turf/bbox":716,"@turf/distance":718,"@turf/helpers":721,"@turf/inside":722,"@turf/invariant":724,dup:432}],716:[function(n,t,i){arguments[4][22][0].apply(i,arguments)},{"@turf/meta":717,dup:22}],717:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],718:[function(n,t,i){arguments[4][8][0].apply(i,arguments)},{"@turf/helpers":719,"@turf/invariant":720,dup:8}],719:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],720:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],721:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],722:[function(n,t,i){arguments[4][36][0].apply(i,arguments)},{"@turf/invariant":723,dup:36}],723:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],724:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],725:[function(n,t,i){arguments[4][120][0].apply(i,arguments)},{"@turf/bearing":726,"@turf/destination":728,"@turf/distance":731,"@turf/helpers":734,"@turf/invariant":735,"@turf/line-intersect":736,"@turf/meta":750,dup:120}],726:[function(n,t,i){arguments[4][3][0].apply(i,arguments)},{"@turf/invariant":727,dup:3}],727:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],728:[function(n,t,i){arguments[4][5][0].apply(i,arguments)},{"@turf/helpers":729,"@turf/invariant":730,dup:5}],729:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],730:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],731:[function(n,t,i){arguments[4][8][0].apply(i,arguments)},{"@turf/helpers":732,"@turf/invariant":733,dup:8}],732:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],733:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],734:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],735:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],736:[function(n,t,i){arguments[4][44][0].apply(i,arguments)},{"@turf/helpers":740,"@turf/invariant":741,"@turf/line-segment":742,"@turf/meta":746,dup:44,"geojson-rbush":747}],737:[function(n,t,i){arguments[4][20][0].apply(i,arguments)},{"@turf/helpers":738,dup:20}],738:[function(n,t,i){arguments[4][46][0].apply(i,arguments)},{dup:46}],739:[function(n,t,i){arguments[4][47][0].apply(i,arguments)},{"@turf/meta":746,dup:47}],740:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],741:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],742:[function(n,t,i){arguments[4][50][0].apply(i,arguments)},{"@turf/helpers":743,"@turf/invariant":744,"@turf/meta":745,dup:50}],743:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],744:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],745:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],746:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],747:[function(n,t,i){arguments[4][55][0].apply(i,arguments)},{"@turf/bbox":739,"@turf/bbox-polygon":737,"@turf/helpers":740,"@turf/meta":746,dup:55,rbush:749}],748:[function(n,t,i){arguments[4][56][0].apply(i,arguments)},{dup:56}],749:[function(n,t,i){arguments[4][57][0].apply(i,arguments)},{dup:57,quickselect:748}],750:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],751:[function(n,t){function u(n){var p,w,b,k,d,g,u,t,a,tt,nt,v,ut,y,ft,it,rt;"FeatureCollection"!==n.type&&("Feature"!==n.type&&(n={type:"Feature",geometry:n,properties:{}}),n=r([n]));for(var c=f(n),l=!1,h=0;!l&&h<n.features.length;){if(t=n.features[h].geometry,a=!1,"Point"===t.type)c.geometry.coordinates[0]===t.coordinates[0]&&c.geometry.coordinates[1]===t.coordinates[1]&&(l=!0);else if("MultiPoint"===t.type)for(tt=!1,u=0;!tt&&u<t.coordinates.length;)c.geometry.coordinates[0]===t.coordinates[u][0]&&c.geometry.coordinates[1]===t.coordinates[u][1]&&(l=!0,tt=!0),u++;else if("LineString"===t.type)for(u=0;!a&&u<t.coordinates.length-1;)p=c.geometry.coordinates[0],w=c.geometry.coordinates[1],b=t.coordinates[u][0],k=t.coordinates[u][1],d=t.coordinates[u+1][0],g=t.coordinates[u+1][1],i(p,w,b,k,d,g)&&(a=!0,l=!0),u++;else if("MultiLineString"===t.type)for(nt=0;nt<t.coordinates.length;){for(a=!1,u=0,v=t.coordinates[nt];!a&&u<v.length-1;)p=c.geometry.coordinates[0],w=c.geometry.coordinates[1],b=v[u][0],k=v[u][1],d=v[u+1][0],g=v[u+1][1],i(p,w,b,k,d,g)&&(a=!0,l=!0),u++;nt++}else("Polygon"===t.type||"MultiPolygon"===t.type)&&(ut={type:"Feature",geometry:t,properties:{}},o(c,ut)&&(l=!0));h++}if(l)return c;for(y=r([]),h=0;h<n.features.length;h++)y.features=y.features.concat(s(n.features[h]).features);for(it=1/0,h=0;h<y.features.length;h++)rt=e(c,y.features[h],"miles"),rt<it&&(it=rt,ft=y.features[h]);return ft}function i(n,t,i,r,u,f){if(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)))return!0}var r=n("@turf/helpers").featureCollection,f=n("@turf/center"),e=n("@turf/distance"),o=n("@turf/inside"),s=n("@turf/explode");t.exports=u},{"@turf/center":752,"@turf/distance":756,"@turf/explode":759,"@turf/helpers":762,"@turf/inside":763}],752:[function(n,t,i){arguments[4][168][0].apply(i,arguments)},{"@turf/bbox":753,"@turf/helpers":755,dup:168}],753:[function(n,t,i){arguments[4][22][0].apply(i,arguments)},{"@turf/meta":754,dup:22}],754:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],755:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],756:[function(n,t,i){arguments[4][8][0].apply(i,arguments)},{"@turf/helpers":757,"@turf/invariant":758,dup:8}],757:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],758:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],759:[function(n,t,i){arguments[4][200][0].apply(i,arguments)},{"@turf/helpers":760,"@turf/meta":761,dup:200}],760:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],761:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],762:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],763:[function(n,t,i){arguments[4][36][0].apply(i,arguments)},{"@turf/invariant":764,dup:36}],764:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],765:[function(n,t){function l(n,t,i,r,h){var l=!0!==h?s(t,n,r):o(t,n,r),p=e(!0!==h?u(t,n):f(t,n)),v=e(!0!==h?u(t,i):f(t,i)),y=Math.abs(p-v);if(y>90)return l;var w=(v+180)%360,b=e(!0!==h?u(i,n):f(i,n)),c=Math.abs(b-w);return c>180&&(c=Math.abs(c-360)),c>90?!0!==h?s(n,i,r):o(n,i,r):!0!==h?l*Math.sin(nt(y)):a(t,i,n,r)}function a(n,t,r,u){var f=0;(Math.abs(n[0])>=180||Math.abs(t[0])>=180||Math.abs(r[0])>=180)&&(f=n[0]>0||t[0]>0||r[0]>0?-180:180);var o=c(r),s=i([n[0]+f,n[1]]),h=i([t[0]+f,t[1]]),l=i([r[0]+f,r[1]]),e=y(v(s,h,l));return 0!==f&&(e[0]-=f),b(o,e,u)}function v(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,a=r*r+u*u,o=((c-f)*r+(l-e)*u)/a;return[f+o*r,e+o*u]}function o(n,t,r){var u=0;Math.abs(n[0])>=180&&(u=n[0]>0?-180:180);Math.abs(t[0])>=180&&(u=t[0]>0?-180:180);var f=i([n[0]+u,n[1]]),e=i([t[0]+u,t[1]]),o=function(n){return n*n},s=o(f[0]-e[0])+o(f[1]-e[1]),h=Math.sqrt(s);return g(h,"meters",r)}function i(n){var r=Math.PI/180,u=6378137,i=20037508.342789244,t=[u*n[0]*r,u*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 y(n){var t=180/Math.PI,i=6378137;return[n[0]*t/i,(.5*Math.PI-2*Math.atan(Math.exp(-n[1]/i)))*t]}var p=n("@turf/meta"),u=n("@turf/bearing"),r=n("@turf/helpers"),s=n("@turf/distance"),w=n("@turf/invariant"),f=n("@turf/rhumb-bearing"),b=n("@turf/rhumb-distance"),k=r.lineString,h=w.featureOf,c=r.point,d=p.segmentEach,e=r.bearingToAngle,g=r.convertDistance,nt=r.degrees2radians;t.exports=function(n,t,i,r){if(!n)throw new Error("point is required");if(Array.isArray(n)?n=c(n):h(n,"Point","point"),!t)throw new Error("line is required");Array.isArray(t)?t=k(t):h(t,"LineString","line");var u=1/0,f=n.geometry.coordinates;return d(t,function(n){var e=n.geometry.coordinates[0],o=n.geometry.coordinates[1],t=l(f,e,o,i,r);u>t&&(u=t)}),u}},{"@turf/bearing":766,"@turf/distance":768,"@turf/helpers":771,"@turf/invariant":772,"@turf/meta":773,"@turf/rhumb-bearing":774,"@turf/rhumb-distance":786}],766:[function(n,t,i){arguments[4][3][0].apply(i,arguments)},{"@turf/invariant":767,dup:3}],767:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],768:[function(n,t,i){arguments[4][8][0].apply(i,arguments)},{"@turf/helpers":769,"@turf/invariant":770,dup:8}],769:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],770:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],771:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],772:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],773:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],774:[function(n,t){var i=n("@turf/invariant").getCoord,r=n("geodesy").LatLonSpherical;t.exports=function(n,t,u){if(!n)throw new Error("start point is required");if(!t)throw new Error("end point is required");var f,e=i(n),o=i(t),s=new r(e[1],e[0]),h=new r(o[1],o[0]);return f=u?h.rhumbBearingTo(s):s.rhumbBearingTo(h),f>180?-(360-f):f}},{"@turf/invariant":775,geodesy:782}],775:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],776:[function(n,t){"use strict";var i={};i.parseDMS=function(n){var t,i;if("number"==typeof n&&isFinite(n))return Number(n);if(t=String(n).trim().replace(/^-/,"").replace(/[NSEW]$/i,"").split(/[^0-9.,]+/),""==t[t.length-1]&&t.splice(t.length-1),""==t)return NaN;switch(t.length){case 3:i=t[0]/1+t[1]/60+t[2]/3600;break;case 2:i=t[0]/1+t[1]/60;break;case 1:i=t[0];break;default:return NaN}return/^-|[WS]$/i.test(n.trim())&&(i=-i),Number(i)};i.separator="";i.toDMS=function(n,t,r){if(isNaN(n))return null;if(void 0===t&&(t="dms"),void 0===r)switch(t){case"d":case"deg":r=4;break;case"dm":case"deg+min":r=2;break;case"dms":case"deg+min+sec":r=0;break;default:t="dms";r=0}n=Math.abs(n);var o,u,f,e;switch(t){default:case"d":case"deg":u=n.toFixed(r);u<100&&(u="0"+u);u<10&&(u="0"+u);o=u+"°";break;case"dm":case"deg+min":u=Math.floor(n);f=(60*n%60).toFixed(r);60==f&&(f=0,u++);u=("000"+u).slice(-3);f<10&&(f="0"+f);o=u+"°"+i.separator+f+"′";break;case"dms":case"deg+min+sec":u=Math.floor(n);f=Math.floor(60*n)%60;e=(3600*n%60).toFixed(r);60==e&&(e=0..toFixed(r),f++);60==f&&(f=0,u++);u=("000"+u).slice(-3);f=("00"+f).slice(-2);e<10&&(e="0"+e);o=u+"°"+i.separator+f+"′"+i.separator+e+"″"}return o};i.toLat=function(n,t,r){var u=i.toDMS(n,t,r);return null===u?"–":u.slice(1)+i.separator+(n<0?"S":"N")};i.toLon=function(n,t,r){var u=i.toDMS(n,t,r);return null===u?"–":u+i.separator+(n<0?"W":"E")};i.toBrng=function(n,t,r){n=(Number(n)+360)%360;var u=i.toDMS(n,t,r);return null===u?"–":u.replace("360","0")};i.compassPoint=function(n,t){void 0===t&&(t=3);n=(n%360+360)%360;var i=4*Math.pow(2,t-1);return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(n*i/360)%i*16/i]};void 0!==t&&t.exports&&(t.exports=i)},{}],777:[function(n,t){"use strict";function i(n,t,r){if(!(this instanceof i))return new i(n,t,r);void 0===r&&(r=i.datum.WGS84);this.lat=Number(n);this.lon=Number(t);this.datum=r}var r,u;void 0!==t&&t.exports&&(r=n("./vector3d.js"));void 0!==t&&t.exports&&(u=n("./dms.js"));i.ellipsoid={WGS84:{a:6378137,b:6356752.314245,f:1/298.257223563},Airy1830:{a:6377563.396,b:6356256.909,f:1/299.3249646},AiryModified:{a:6377340.189,b:6356034.448,f:1/299.3249646},Bessel1841:{a:6377397.155,b:6356078.962818,f:1/299.1528128},Clarke1866:{a:6378206.4,b:6356583.8,f:1/294.978698214},Clarke1880IGN:{a:6378249.2,b:6356515,f:1/293.466021294},GRS80:{a:6378137,b:6356752.31414,f:1/298.257222101},Intl1924:{a:6378388,b:6356911.946,f:1/297},WGS72:{a:6378135,b:6356750.5,f:1/298.26}};i.datum={ED50:{ellipsoid:i.ellipsoid.Intl1924,transform:[89.5,93.8,123.1,-1.2,0,0,.156]},Irl1975:{ellipsoid:i.ellipsoid.AiryModified,transform:[-482.53,130.596,-564.557,-8.15,-1.042,-.214,-.631]},NAD27:{ellipsoid:i.ellipsoid.Clarke1866,transform:[8,-160,-176,0,0,0,0]},NAD83:{ellipsoid:i.ellipsoid.GRS80,transform:[1.004,-1.91,-.515,-.0015,.0267,.00034,.011]},NTF:{ellipsoid:i.ellipsoid.Clarke1880IGN,transform:[168,60,-320,0,0,0,0]},OSGB36:{ellipsoid:i.ellipsoid.Airy1830,transform:[-446.448,125.157,-542.06,20.4894,-.1502,-.247,-.8421]},Potsdam:{ellipsoid:i.ellipsoid.Bessel1841,transform:[-582,-105,-414,-8.3,1.04,.35,-3.08]},TokyoJapan:{ellipsoid:i.ellipsoid.Bessel1841,transform:[148,-507,-685,0,0,0,0]},WGS72:{ellipsoid:i.ellipsoid.WGS72,transform:[0,0,-4.5,-.22,0,0,.554]},WGS84:{ellipsoid:i.ellipsoid.WGS84,transform:[0,0,0,0,0,0,0]}};i.prototype.convertDatum=function(n){var u=this,t=null,r;if(u.datum==i.datum.WGS84&&(t=n.transform),n==i.datum.WGS84)for(t=[],r=0;r<7;r++)t[r]=-u.datum.transform[r];return null==t&&(u=this.convertDatum(i.datum.WGS84),t=n.transform),u.toCartesian().applyTransform(t).toLatLonE(n)};i.prototype.toCartesian=function(){var u=this.lat.toRadians(),f=this.lon.toRadians(),s=this.datum.ellipsoid.a,n=this.datum.ellipsoid.f,t=Math.sin(u),e=Math.cos(u),h=Math.sin(f),c=Math.cos(f),o=2*n-n*n,i=s/Math.sqrt(1-o*t*t);return new r((i+0)*e*c,(i+0)*e*h,(i*(1-o)+0)*t)};r.prototype.toLatLonE=function(n){var s=this.x,h=this.y,t=this.z,v=n.ellipsoid.a,c=n.ellipsoid.b,l=n.ellipsoid.f,r=2*l-l*l,y=r/(1-r),u=Math.sqrt(s*s+h*h),w=Math.sqrt(u*u+t*t),f=c*t/(v*u)*(1+y*c/w),e=f/Math.sqrt(1+f*f),o=e/f,a=isNaN(o)?0:Math.atan2(t+y*c*e*e*e,u-r*v*o*o*o),b=Math.atan2(h,s),p=Math.sin(a);return Math.cos(a),Math.sqrt(1-r*p*p),new i(a.toDegrees(),b.toDegrees(),n)};r.prototype.applyTransform=function(n){var t=this.x,i=this.y,u=this.z,h=n[0],c=n[1],l=n[2],f=n[3]/1e6+1,e=(n[4]/3600).toRadians(),o=(n[5]/3600).toRadians(),s=(n[6]/3600).toRadians();return new r(h+t*f-i*s+u*o,c+t*s+i*f-u*e,l-t*o+i*e+u*f)};i.prototype.toString=function(n,t){return u.toLat(this.lat,n,t)+", "+u.toLon(this.lon,n,t)};void 0===Number.prototype.toRadians&&(Number.prototype.toRadians=function(){return this*Math.PI/180});void 0===Number.prototype.toDegrees&&(Number.prototype.toDegrees=function(){return 180*this/Math.PI});void 0!==t&&t.exports&&(t.exports=i,t.exports.Vector3d=r)},{"./dms.js":776,"./vector3d.js":785}],778:[function(n,t){"use strict";function i(n,t){if(!(this instanceof i))return new i(n,t);this.lat=Number(n);this.lon=Number(t)}if(void 0!==t&&t.exports)var r=n("./dms");i.prototype.distanceTo=function(n,t){if(!(n instanceof i))throw new TypeError("point is not LatLon object");t=void 0===t?6371e3:Number(t);var s=t,r=this.lat.toRadians(),h=this.lon.toRadians(),u=n.lat.toRadians(),c=n.lon.toRadians(),f=u-r,e=c-h,o=Math.sin(f/2)*Math.sin(f/2)+Math.cos(r)*Math.cos(u)*Math.sin(e/2)*Math.sin(e/2);return s*2*Math.atan2(Math.sqrt(o),Math.sqrt(1-o))};i.prototype.bearingTo=function(n){if(!(n instanceof i))throw new TypeError("point is not LatLon object");var r=this.lat.toRadians(),t=n.lat.toRadians(),u=(n.lon-this.lon).toRadians(),f=Math.sin(u)*Math.cos(t),e=Math.cos(r)*Math.sin(t)-Math.sin(r)*Math.cos(t)*Math.cos(u);return(Math.atan2(f,e).toDegrees()+360)%360};i.prototype.finalBearingTo=function(n){if(!(n instanceof i))throw new TypeError("point is not LatLon object");return(n.bearingTo(this)+180)%360};i.prototype.midpointTo=function(n){if(!(n instanceof i))throw new TypeError("point is not LatLon object");var t=this.lat.toRadians(),o=this.lon.toRadians(),r=n.lat.toRadians(),e=(n.lon-this.lon).toRadians(),u=Math.cos(r)*Math.cos(e),f=Math.cos(r)*Math.sin(e),s=Math.sqrt((Math.cos(t)+u)*(Math.cos(t)+u)+f*f),h=Math.sin(t)+Math.sin(r),c=Math.atan2(h,s),l=o+Math.atan2(f,Math.cos(t)+u);return new i(c.toDegrees(),(l.toDegrees()+540)%360-180)};i.prototype.intermediatePointTo=function(n,t){if(!(n instanceof i))throw new TypeError("point is not LatLon object");var r=this.lat.toRadians(),e=this.lon.toRadians(),u=n.lat.toRadians(),o=n.lon.toRadians(),b=Math.sin(r),a=Math.cos(r),k=Math.sin(e),d=Math.cos(e),g=Math.sin(u),v=Math.cos(u),nt=Math.sin(o),tt=Math.cos(o),y=u-r,p=o-e,w=Math.sin(y/2)*Math.sin(y/2)+Math.cos(r)*Math.cos(u)*Math.sin(p/2)*Math.sin(p/2),f=2*Math.atan2(Math.sqrt(w),Math.sqrt(1-w)),s=Math.sin((1-t)*f)/Math.sin(f),h=Math.sin(t*f)/Math.sin(f),c=s*a*d+h*v*tt,l=s*a*k+h*v*nt,it=s*b+h*g,rt=Math.atan2(it,Math.sqrt(c*c+l*l)),ut=Math.atan2(l,c);return new i(rt.toDegrees(),(ut.toDegrees()+540)%360-180)};i.prototype.destinationPoint=function(n,t,r){r=void 0===r?6371e3:Number(r);var u=Number(n)/r,f=Number(t).toRadians(),e=this.lat.toRadians(),a=this.lon.toRadians(),o=Math.sin(e),s=Math.cos(e),h=Math.sin(u),c=Math.cos(u),v=Math.sin(f),y=Math.cos(f),l=o*c+s*h*y,p=Math.asin(l),w=v*h*s,b=c-o*l,k=a+Math.atan2(w,b);return new i(p.toDegrees(),(k.toDegrees()+540)%360-180)};i.intersection=function(n,t,r,u){var c;if(!(n instanceof i))throw new TypeError("p1 is not LatLon object");if(!(r instanceof i))throw new TypeError("p2 is not LatLon object");var f=n.lat.toRadians(),l=n.lon.toRadians(),h=r.lat.toRadians(),v=r.lon.toRadians(),y=Number(t).toRadians(),d=Number(u).toRadians(),p=h-f,w=v-l,e=2*Math.asin(Math.sqrt(Math.sin(p/2)*Math.sin(p/2)+Math.cos(f)*Math.cos(h)*Math.sin(w/2)*Math.sin(w/2)));if(0==e)return null;c=Math.acos((Math.sin(h)-Math.sin(f)*Math.cos(e))/(Math.sin(e)*Math.cos(f)));isNaN(c)&&(c=0);var b=Math.acos((Math.sin(f)-Math.sin(h)*Math.cos(e))/(Math.sin(e)*Math.cos(h))),g=Math.sin(v-l)>0?c:2*Math.PI-c,nt=Math.sin(v-l)>0?2*Math.PI-b:b,o=y-g,s=nt-d;if(0==Math.sin(o)&&0==Math.sin(s)||Math.sin(o)*Math.sin(s)<0)return null;var tt=Math.acos(-Math.cos(o)*Math.cos(s)+Math.sin(o)*Math.sin(s)*Math.cos(e)),a=Math.atan2(Math.sin(e)*Math.sin(o)*Math.sin(s),Math.cos(s)+Math.cos(o)*Math.cos(tt)),k=Math.asin(Math.sin(f)*Math.cos(a)+Math.cos(f)*Math.sin(a)*Math.cos(y)),it=Math.atan2(Math.sin(y)*Math.sin(a)*Math.cos(f),Math.cos(a)-Math.sin(f)*Math.sin(k)),rt=l+it;return new i(k.toDegrees(),(rt.toDegrees()+540)%360-180)};i.prototype.crossTrackDistanceTo=function(n,t,r){if(!(n instanceof i))throw new TypeError("pathStart is not LatLon object");if(!(t instanceof i))throw new TypeError("pathEnd is not LatLon object");var u=void 0===r?6371e3:Number(r),f=n.distanceTo(this,u)/u,e=n.bearingTo(this).toRadians(),o=n.bearingTo(t).toRadians();return Math.asin(Math.sin(f)*Math.sin(e-o))*u};i.prototype.alongTrackDistanceTo=function(n,t,r){if(!(n instanceof i))throw new TypeError("pathStart is not LatLon object");if(!(t instanceof i))throw new TypeError("pathEnd is not LatLon object");var u=void 0===r?6371e3:Number(r),f=n.distanceTo(this,u)/u,e=n.bearingTo(this).toRadians(),o=n.bearingTo(t).toRadians(),s=Math.asin(Math.sin(f)*Math.sin(e-o));return Math.acos(Math.cos(f)/Math.abs(Math.cos(s)))*Math.sign(Math.cos(o-e))*u};i.prototype.maxLatitude=function(n){var t=Number(n).toRadians(),i=this.lat.toRadians();return Math.acos(Math.abs(Math.sin(t)*Math.cos(i))).toDegrees()};i.crossingParallels=function(n,t,i){var f=Number(i).toRadians(),e=n.lat.toRadians(),s=n.lon.toRadians(),o=t.lat.toRadians(),v=t.lon.toRadians(),h=v-s,r=Math.sin(e)*Math.cos(o)*Math.cos(f)*Math.sin(h),u=Math.sin(e)*Math.cos(o)*Math.cos(f)*Math.cos(h)-Math.cos(e)*Math.sin(o)*Math.cos(f),c=Math.cos(e)*Math.cos(o)*Math.sin(f)*Math.sin(h);if(c*c>r*r+u*u)return null;var l=Math.atan2(-u,r),a=Math.acos(c/Math.sqrt(r*r+u*u)),y=s+l-a,p=s+l+a;return{lon1:(y.toDegrees()+540)%360-180,lon2:(p.toDegrees()+540)%360-180}};i.prototype.rhumbDistanceTo=function(n,t){var e,o;if(!(n instanceof i))throw new TypeError("point is not LatLon object");t=void 0===t?6371e3:Number(t);var h=t,u=this.lat.toRadians(),s=n.lat.toRadians(),f=s-u,r=Math.abs(n.lon-this.lon).toRadians();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};i.prototype.rhumbBearingTo=function(n){var r;if(!(n instanceof i))throw new TypeError("point is not LatLon object");var u=this.lat.toRadians(),f=n.lat.toRadians(),t=(n.lon-this.lon).toRadians();return t>Math.PI&&(t-=2*Math.PI),t<-Math.PI&&(t+=2*Math.PI),r=Math.log(Math.tan(f/2+Math.PI/4)/Math.tan(u/2+Math.PI/4)),(Math.atan2(t,r).toDegrees()+360)%360};i.prototype.rhumbDestinationPoint=function(n,t,r){r=void 0===r?6371e3:Number(r);var e=Number(n)/r,f=this.lat.toRadians(),c=this.lon.toRadians(),o=Number(t).toRadians(),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,v=c+a;return new i(u.toDegrees(),(v.toDegrees()+540)%360-180)};i.prototype.rhumbMidpointTo=function(n){if(!(n instanceof i))throw new TypeError("point is not LatLon object");var f=this.lat.toRadians(),t=this.lon.toRadians(),e=n.lat.toRadians(),r=n.lon.toRadians();Math.abs(r-t)>Math.PI&&(t+=2*Math.PI);var o=(f+e)/2,s=Math.tan(Math.PI/4+f/2),h=Math.tan(Math.PI/4+e/2),c=Math.tan(Math.PI/4+o/2),u=((r-t)*Math.log(c)+t*Math.log(h)-r*Math.log(s))/Math.log(h/s);return isFinite(u)||(u=(t+r)/2),i(o.toDegrees(),(u.toDegrees()+540)%360-180)};i.areaOf=function(n,t){var u=void 0===t?6371e3:Number(t),f=n[0].equals(n[n.length-1]),s;f||n.push(n[0]);for(var h=n.length-1,r=0,i=0;i<h;i++){var e=n[i].lat.toRadians(),o=n[i+1].lat.toRadians(),c=(n[i+1].lon-n[i].lon).toRadians();r+=2*Math.atan2(Math.tan(c/2)*(Math.tan(e/2)+Math.tan(o/2)),1+Math.tan(e/2)*Math.tan(o/2))}return function(n){for(var f,i,r=0,u=n[0].bearingTo(n[1]),t=0;t<n.length-1;t++)i=n[t].bearingTo(n[t+1]),f=n[t].finalBearingTo(n[t+1]),r+=(i-u+540)%360-180,r+=(f-i+540)%360-180,u=f;return i=n[0].bearingTo(n[1]),r+=(i-u+540)%360-180,Math.abs(r)<90}(n)&&(r=Math.abs(r)-2*Math.PI),s=Math.abs(r*u*u),f||n.pop(),s};i.prototype.equals=function(n){if(!(n instanceof i))throw new TypeError("point is not LatLon object");return this.lat==n.lat&&this.lon==n.lon};i.prototype.toString=function(n,t){return r.toLat(this.lat,n,t)+", "+r.toLon(this.lon,n,t)};void 0===Number.prototype.toRadians&&(Number.prototype.toRadians=function(){return this*Math.PI/180});void 0===Number.prototype.toDegrees&&(Number.prototype.toDegrees=function(){return 180*this/Math.PI});void 0!==t&&t.exports&&(t.exports=i)},{"./dms":776}],779:[function(n,t){"use strict";function i(n,t){if(!(this instanceof i))return new i(n,t);this.lat=Number(n);this.lon=Number(t)}var r,u;void 0!==t&&t.exports&&(r=n("./vector3d.js"));void 0!==t&&t.exports&&(u=n("./dms.js"));i.prototype.toVector=function(){var n=this.lat.toRadians(),t=this.lon.toRadians(),i=Math.cos(n)*Math.cos(t),u=Math.cos(n)*Math.sin(t),f=Math.sin(n);return new r(i,u,f)};r.prototype.toLatLonS=function(){var n=Math.atan2(this.z,Math.sqrt(this.x*this.x+this.y*this.y)),t=Math.atan2(this.y,this.x);return new i(n.toDegrees(),t.toDegrees())};i.prototype.greatCircle=function(n){var u=this.lat.toRadians(),i=this.lon.toRadians(),t=Number(n).toRadians(),f=Math.sin(i)*Math.cos(t)-Math.sin(u)*Math.cos(i)*Math.sin(t),e=-Math.cos(i)*Math.cos(t)-Math.sin(u)*Math.sin(i)*Math.sin(t),o=Math.cos(u)*Math.sin(t);return new r(f,e,o)};r.prototype.greatCircle=function(n){var i=Number(n).toRadians(),f=new r(0,0,1),t=f.cross(this),u=this.cross(t),e=t.times(Math.cos(i)/t.length());return u.times(Math.sin(i)/u.length()).minus(e)};i.prototype.distanceTo=function(n,t){if(!(n instanceof i))throw new TypeError("point is not LatLon object");t=void 0===t?6371e3:Number(t);var r=this.toVector(),u=n.toVector();return r.angleTo(u)*t};i.prototype.bearingTo=function(n){if(!(n instanceof i))throw new TypeError("point is not LatLon object");var t=this.toVector(),u=n.toVector(),f=new r(0,0,1),e=t.cross(u),o=t.cross(f);return(e.angleTo(o,t).toDegrees()+360)%360};i.prototype.midpointTo=function(n){if(!(n instanceof i))throw new TypeError("point is not LatLon object");var t=this.toVector(),r=n.toVector();return t.plus(r).unit().toLatLonS()};i.prototype.intermediatePointTo=function(n,t){if(!(n instanceof i))throw new TypeError("point is not LatLon object");var u=this.toVector(),f=n.toVector(),s=u.cross(f).length(),h=u.dot(f),c=Math.atan2(s,h),o=c*Number(t),l=Math.sin(o),a=Math.cos(o),v=u.cross(f).unit().cross(u),e=u.times(a).plus(v.times(l));return new r(e.x,e.y,e.z).toLatLonS()};i.prototype.intermediatePointOnChordTo=function(n,t){if(!(n instanceof i))throw new TypeError("point is not LatLon object");var f=this.toVector(),e=n.toVector(),u=f.plus(e.minus(f).times(Number(t)));return new r(u.x,u.y,u.z).toLatLonS()};i.prototype.destinationPoint=function(n,t,i){i=void 0===i?6371e3:Number(i);var u=this.toVector(),f=Number(n)/i,e=Number(t).toRadians(),s=new r(0,0,1),o=s.cross(u).unit(),h=u.cross(o),c=o.times(Math.sin(e)),l=h.times(Math.cos(e)),a=l.plus(c),v=u.times(Math.cos(f)),y=a.times(Math.sin(f));return v.plus(y).toLatLonS()};i.intersection=function(n,t,r,u){var o,s,y,p,h,c;if(!(n instanceof i))throw new TypeError("path1start is not LatLon object");if(!(r instanceof i))throw new TypeError("path2start is not LatLon object");if(!(t instanceof i)&&isNaN(t))throw new TypeError("path1brngEnd is not LatLon object or bearing");if(!(u instanceof i)&&isNaN(u))throw new TypeError("path2brngEnd is not LatLon object or bearing");h=n.toVector();c=r.toVector();t instanceof i?(o=h.cross(t.toVector()),y="endpoint"):(o=n.greatCircle(Number(t)),y="bearing");u instanceof i?(s=c.cross(u.toVector()),p="endpoint"):(s=r.greatCircle(Number(u)),p="bearing");var f=o.cross(s),l=s.cross(o),e=null,a=null,v=null;switch(y+"+"+p){case"bearing+bearing":switch(a=Math.sign(o.cross(h).dot(f)),v=Math.sign(s.cross(c).dot(f)),a+v){case 2:e=f;break;case-2:e=l;break;case 0:e=h.plus(c).dot(f)>0?l:f}break;case"bearing+endpoint":a=Math.sign(o.cross(h).dot(f));e=a>0?f:l;break;case"endpoint+bearing":v=Math.sign(s.cross(c).dot(f));e=v>0?f:l;break;case"endpoint+endpoint":e=h.plus(c).plus(t.toVector()).plus(u.toVector()).dot(f)>0?f:l}return e.toLatLonS()};i.prototype.crossTrackDistanceTo=function(n,t,r){if(!(n instanceof i))throw new TypeError("pathStart is not LatLon object");var u=void 0===r?6371e3:Number(r),f=this.toVector();return((t instanceof i?n.toVector().cross(t.toVector()):n.greatCircle(Number(t))).angleTo(f)-Math.PI/2)*u};i.prototype.alongTrackDistanceTo=function(n,t,r){if(!(n instanceof i))throw new TypeError("pathStart is not LatLon object");var f=void 0===r?6371e3:Number(r),e=this.toVector(),u=t instanceof i?n.toVector().cross(t.toVector()):n.greatCircle(Number(t)),o=u.cross(e).cross(u);return n.toVector().angleTo(o,u)*f};i.prototype.nearestPointOnSegment=function(n,t){var i=null;if(this.isBetween(n,t)){var u=this.toVector(),f=n.toVector(),e=t.toVector(),r=f.cross(e),o=u.cross(r);i=r.cross(o).toLatLonS()}else i=this.distanceTo(n)<this.distanceTo(t)?n:t;return i};i.prototype.isBetween=function(n,t){var i=this.toVector(),r=n.toVector(),u=t.toVector(),f=i.minus(r),e=u.minus(r),o=i.minus(u),s=r.minus(u),h=f.dot(e),c=o.dot(s),l=h>=0&&c>=0,a=i.dot(r)>=0&&i.dot(u)>=0;return l&&a};i.prototype.enclosedBy=function(n){var u=n[0].equals(n[n.length-1]),r,t,o;u||n.push(n[0]);for(var f=n.length-1,e=this.toVector(),i=[],t=0;t<f;t++)i[t]=e.minus(n[t].toVector());for(i.push(i[0]),r=0,t=0;t<f;t++)r+=i[t].angleTo(i[t+1],e);return o=Math.abs(r)>Math.PI,u||n.pop(),o};i.areaOf=function(n,t){var f=void 0==t?6371e3:Number(t),e=n[0].equals(n[n.length-1]),o,s;e||n.push(n[0]);for(var u=n.length-1,r=[],i=0;i<u;i++)o=n[i].toVector(),s=n[i+1].toVector(),r[i]=o.cross(s);r.push(r[0]);for(var c=n[0].toVector(),h=0,i=0;i<u;i++)h+=r[i].angleTo(r[i+1],c);var l=u*Math.PI-Math.abs(h),a=l-(u-2)*Math.PI,v=a*f*f;return e||n.pop(),v};i.meanOf=function(n){for(var t=new r(0,0,0),i=0;i<n.length;i++)t=t.plus(n[i].toVector());return t.unit().toLatLonS()};i.prototype.equals=function(n){if(!(n instanceof i))throw new TypeError("point is not LatLon object");return this.lat==n.lat&&this.lon==n.lon};i.prototype.toString=function(n,t){return u.toLat(this.lat,n,t)+", "+u.toLon(this.lon,n,t)};void 0===Number.prototype.toRadians&&(Number.prototype.toRadians=function(){return this*Math.PI/180});void 0===Number.prototype.toDegrees&&(Number.prototype.toDegrees=function(){return 180*this/Math.PI});void 0===Math.sign&&(Math.sign=function(n){return n=+n,0===n||isNaN(n)?n:n>0?1:-1});void 0!==t&&t.exports&&(t.exports=i,t.exports.Vector3d=r)},{"./dms.js":776,"./vector3d.js":785}],780:[function(n,t){"use strict";if(void 0!==t&&t.exports)var i=n("./latlon-ellipsoidal.js");i.prototype.distanceTo=function(n){if(!(n instanceof i))throw new TypeError("point is not LatLon object");try{return Number(this.inverse(n).distance.toFixed(3))}catch(n){return NaN}};i.prototype.initialBearingTo=function(n){if(!(n instanceof i))throw new TypeError("point is not LatLon object");try{return Number(this.inverse(n).initialBearing.toFixed(9))}catch(n){return NaN}};i.prototype.finalBearingTo=function(n){if(!(n instanceof i))throw new TypeError("point is not LatLon object");try{return Number(this.inverse(n).finalBearing.toFixed(9))}catch(n){return NaN}};i.prototype.destinationPoint=function(n,t){return this.direct(Number(n),Number(t)).point};i.prototype.finalBearingOn=function(n,t){return Number(this.direct(Number(n),Number(t)).finalBearing.toFixed(9))};i.prototype.direct=function(n,t){var r,u,o,nt,tt,ot=this.lat.toRadians(),st=this.lon.toRadians(),it=t.toRadians(),rt=n,ut=this.datum.ellipsoid.a,s=this.datum.ellipsoid.b,c=this.datum.ellipsoid.f,ft=Math.sin(it),a=Math.cos(it),v=(1-c)*Math.tan(ot),l=1/Math.sqrt(1+v*v),y=v*l,ht=Math.atan2(v,a),h=l*ft,p=1-h*h,f=p*(ut*ut-s*s)/(s*s),et=1+f/16384*(4096+f*(f*(320-175*f)-768)),w=f/1024*(256+f*(f*(74-47*f)-128)),e=rt/(s*et),b=0;do r=Math.cos(2*ht+e),u=Math.sin(e),o=Math.cos(e),nt=w*u*(r+w/4*(o*(2*r*r-1)-w/6*r*(4*u*u-3)*(4*r*r-3))),tt=e,e=rt/(s*et)+nt;while(Math.abs(e-tt)>1e-12&&++b<100);if(b>=100)throw new Error("Formula failed to converge");var k=y*u-l*o*a,ct=Math.atan2(y*o+l*u*a,(1-c)*Math.sqrt(h*h+k*k)),lt=Math.atan2(u*ft,l*o-y*u*a),d=c/16*p*(4+c*(4-3*p)),at=lt-(1-d)*c*h*(e+d*u*(r+d*o*(2*r*r-1))),vt=(st+at+3*Math.PI)%(2*Math.PI)-Math.PI,g=Math.atan2(h,-k);return g=(g+2*Math.PI)%(2*Math.PI),{point:new i(ct.toDegrees(),vt.toDegrees(),this.datum),finalBearing:g.toDegrees(),iterations:b}};i.prototype.inverse=function(n){var p=this,ft=n;-180==p.lon&&(p.lon=180);var e,o,et,w,b,ot,ct=p.lat.toRadians(),lt=p.lon.toRadians(),at=ft.lat.toRadians(),vt=ft.lon.toRadians(),st=this.datum.ellipsoid.a,a=this.datum.ellipsoid.b,v=this.datum.ellipsoid.f,ht=vt-lt,k=(1-v)*Math.tan(ct),r=1/Math.sqrt(1+k*k),s=k*r,d=(1-v)*Math.tan(at),t=1/Math.sqrt(1+d*d),h=d*t,f=0,y=0,g=0,c=0,i=0,l=ht,nt=0;do{if(e=Math.sin(l),o=Math.cos(l),0==(et=t*e*t*e+(r*h-s*t*o)*(r*h-s*t*o)))break;if(f=Math.sqrt(et),y=s*h+r*t*o,g=Math.atan2(f,y),w=r*t*e/f,c=1-w*w,i=0!=c?y-2*s*h/c:0,b=v/16*c*(4+v*(4-3*c)),ot=l,l=ht+(1-b)*v*w*(g+b*f*(i+b*y*(2*i*i-1))),Math.abs(l)>Math.PI)throw new Error("λ > π");}while(Math.abs(l-ot)>1e-12&&++nt<1e3);if(nt>=1e3)throw new Error("Formula failed to converge");var u=c*(st*st-a*a)/(a*a),yt=1+u/16384*(4096+u*(u*(320-175*u)-768)),tt=u/1024*(256+u*(u*(74-47*u)-128)),pt=tt*f*(i+tt/4*(y*(2*i*i-1)-tt/6*i*(4*f*f-3)*(4*i*i-3))),it=a*yt*(g-pt),rt=Math.atan2(t*e,r*h-s*t*o),ut=Math.atan2(r*e,-s*t+r*h*o);return rt=(rt+2*Math.PI)%(2*Math.PI),ut=(ut+2*Math.PI)%(2*Math.PI),{distance:it,initialBearing:0==it?NaN:rt.toDegrees(),finalBearing:0==it?NaN:ut.toDegrees(),iterations:nt}};void 0===Number.prototype.toRadians&&(Number.prototype.toRadians=function(){return this*Math.PI/180});void 0===Number.prototype.toDegrees&&(Number.prototype.toDegrees=function(){return 180*this/Math.PI});void 0!==t&&t.exports&&(t.exports=i)},{"./latlon-ellipsoidal.js":777}],781:[function(n,t){"use strict";function i(n,t,r,f,e,o,s){if(!(this instanceof i))return new i(n,t,r,f,e,o,s);if(void 0===s&&(s=u.datum.WGS84),!(1<=n&&n<=60))throw new Error("Invalid MGRS grid reference (zone ‘"+n+"’)");if(1!=t.length)throw new Error("Invalid MGRS grid reference (band ‘"+t+"’)");if(-1==i.latBands.indexOf(t))throw new Error("Invalid MGRS grid reference (band ‘"+t+"’)");if(1!=r.length)throw new Error("Invalid MGRS grid reference (e100k ‘"+r+"’)");if(1!=f.length)throw new Error("Invalid MGRS grid reference (n100k ‘"+f+"’)");this.zone=Number(n);this.band=t;this.e100k=r;this.n100k=f;this.easting=Number(e);this.northing=Number(o);this.datum=s}var r,u;void 0!==t&&t.exports&&(r=n("./utm.js"));void 0!==t&&t.exports&&(u=n("./latlon-ellipsoidal.js"));i.latBands="CDEFGHJKLMNPQRSTUVWXX";i.e100kLetters=["ABCDEFGH","JKLMNPQR","STUVWXYZ"];i.n100kLetters=["ABCDEFGHJKLMNPQRSTUV","FGHJKLMNPQRSTUVABCDE"];r.prototype.toMgrs=function(){if(isNaN(this.zone+this.easting+this.northing))throw new Error("Invalid UTM coordinate ‘"+this.toString()+"’");var n=this.zone,u=this.toLatLonE(),f=i.latBands.charAt(Math.floor(u.lat/8+10)),e=Math.floor(this.easting/1e5),o=i.e100kLetters[(n-1)%3].charAt(e-1),s=Math.floor(this.northing/1e5)%20,h=i.n100kLetters[(n-1)%2].charAt(s),t=this.easting%1e5,r=this.northing%1e5;return t=Number(t.toFixed(6)),r=Number(r.toFixed(6)),new i(n,f,o,h,t,r)};i.prototype.toUtm=function(){for(var n=this.zone,f=this.band,s=this.e100k,h=this.n100k,c=this.easting,e=this.northing,l=f>="N"?"N":"S",a=i.e100kLetters[(n-1)%3].indexOf(s)+1,v=1e5*a,y=i.n100kLetters[(n-1)%2].indexOf(h),o=1e5*y,p=8*(i.latBands.indexOf(f)-10),w=1e5*Math.floor(new u(p,0).toUtm().northing/1e5),t=0;t+o+e<w;)t+=2e6;return new r(n,l,v+c,t+o+e,this.datum)};i.parse=function(n){var t;if((n=n.trim(),n.match(/\s/))||(t=n.slice(5),t=t.slice(0,t.length/2)+" "+t.slice(-t.length/2),n=n.slice(0,3)+" "+n.slice(3,5)+" "+t),null==(n=n.match(/\S+/g))||4!=n.length)throw new Error("Invalid MGRS grid reference ‘"+n+"’");var f=n[0],o=f.slice(0,2),s=f.slice(2,3),e=n[1],h=e.slice(0,1),c=e.slice(1,2),r=n[2],u=n[3];return r=r.length>=5?r:(r+"00000").slice(0,5),u=u.length>=5?u:(u+"00000").slice(0,5),new i(o,s,h,c,r,u)};i.prototype.toString=function(n){if(n=void 0===n?10:Number(n),-1==[2,4,6,8,10].indexOf(n))throw new Error("Invalid precision ‘"+n+"’");var t=("00"+this.zone).slice(-2),i=this.band,r=this.e100k,u=this.n100k,f=Math.floor(this.easting/Math.pow(10,5-n/2)),e=Math.floor(this.northing/Math.pow(10,5-n/2));return t+i+" "+r+u+" "+("00000"+f).slice(-n/2)+" "+("00000"+e).slice(-n/2)};void 0!==t&&t.exports&&(t.exports=i)},{"./latlon-ellipsoidal.js":777,"./utm.js":784}],782:[function(n,t,i){"use strict";var r,u;i.LatLonSpherical=n("./latlon-spherical.js");i.LatLonEllipsoidal=n("./latlon-ellipsoidal.js");r=n("./latlon-vincenty.js");for(u in r)i.LatLonEllipsoidal[u]=r[u];i.LatLonVectors=n("./latlon-vectors.js");i.Vector3d=n("./vector3d.js");i.Utm=n("./utm.js");i.Mgrs=n("./mgrs.js");i.OsGridRef=n("./osgridref.js");i.Dms=n("./dms.js")},{"./dms.js":776,"./latlon-ellipsoidal.js":777,"./latlon-spherical.js":778,"./latlon-vectors.js":779,"./latlon-vincenty.js":780,"./mgrs.js":781,"./osgridref.js":783,"./utm.js":784,"./vector3d.js":785}],783:[function(n,t){"use strict";function i(n,t){if(!(this instanceof i))return new i(n,t);this.easting=Number(n);this.northing=Number(t)}if(void 0!==t&&t.exports)var r=n("./latlon-ellipsoidal.js");i.latLonToOsGrid=function(n){if(!(n instanceof r))throw new TypeError("point is not LatLon object");n.datum!=r.datum.OSGB36&&(n=n.convertDatum(r.datum.OSGB36));var t=n.lat.toRadians(),ot=n.lon.toRadians(),l=6377563.396,a=6356256.909,y=.9996012717,e=49..toRadians(),st=(-2).toRadians(),p=1-a*a/(l*l),u=(l-a)/(l+a),g=u*u,v=u*u*u,o=Math.cos(t),s=Math.sin(t),f=l*y/Math.sqrt(1-p*s*s),nt=l*y*(1-p)/Math.pow(1-p*s*s,1.5),w=f/nt-1,ht=(1+u+5/4*g+5/4*v)*(t-e),ct=(3*u+3*u*u+21/8*v)*Math.sin(t-e)*Math.cos(t+e),lt=(15/8*g+15/8*v)*Math.sin(2*(t-e))*Math.cos(2*(t+e)),at=35/24*v*Math.sin(3*(t-e))*Math.cos(3*(t+e)),vt=a*y*(ht-ct+lt-at),b=o*o*o,tt=b*o*o,h=Math.tan(t)*Math.tan(t),it=h*h,yt=vt+-1e5,pt=f/2*s*o,wt=f/24*s*b*(5-h+9*w),bt=f/720*s*tt*(61-58*h+it),kt=f*o,dt=f/6*b*(f/nt-h),gt=f/120*tt*(5-18*h+it+14*w-58*h*w),c=ot-st,rt=c*c,ut=rt*c,ft=ut*c,et=ft*c,ni=et*c,k=yt+pt*rt+wt*ft+bt*ni,d=4e5+kt*c+dt*ut+gt*et;return k=Number(k.toFixed(3)),d=Number(d.toFixed(3)),new i(d,k)};i.osGridToLatLon=function(n,t){var ct,g;if(!(n instanceof i))throw new TypeError("gridref is not OsGridRef object");void 0===t&&(t=r.datum.WGS84);var lt=n.easting,ut=n.northing,h=6377563.396,l=6356256.909,y=.9996012717,s=49..toRadians(),at=(-2).toRadians(),nt=1-l*l/(h*h),e=(h-l)/(h+l),ft=e*e,p=e*e*e,u=s,tt=0;do u=(ut- -1e5-tt)/(h*y)+u,tt=l*y*((1+e+5/4*ft+5/4*p)*(u-s)-(3*e+3*e*e+21/8*p)*Math.sin(u-s)*Math.cos(u+s)+(15/8*ft+15/8*p)*Math.sin(2*(u-s))*Math.cos(2*(u+s))-35/24*p*Math.sin(3*(u-s))*Math.cos(3*(u+s)));while(ut- -1e5-tt>=1e-5);var vt=Math.cos(u),w=Math.sin(u),f=h*y/Math.sqrt(1-nt*w*w),a=h*y*(1-nt)/Math.pow(1-nt*w*w,1.5),et=f/a-1,v=Math.tan(u),o=v*v,b=o*o,yt=b*o,k=1/vt,it=f*f*f,rt=it*f*f,pt=rt*f*f,wt=v/(2*a*f),bt=v/(24*a*it)*(5+3*o+et-9*o*et),kt=v/(720*a*rt)*(61+90*o+45*b),dt=k/f,gt=k/(6*it)*(f/a+2*o),ni=k/(120*rt)*(5+28*o+24*b),ti=k/(5040*pt)*(61+662*o+1320*b+720*yt),d=lt-4e5,c=d*d,ot=c*d,st=c*c,ht=ot*c,ii=st*c,ri=ht*c;return u=u-wt*c+bt*st-kt*ii,ct=at+dt*d-gt*ot+ni*ht-ti*ri,g=new r(u.toDegrees(),ct.toDegrees(),r.datum.OSGB36),t!=r.datum.OSGB36&&(g=g.convertDatum(t)),g};i.parse=function(n){var r,u,f;if(n=String(n).trim(),r=n.match(/^(\d+),\s*(\d+)$/),r)return new i(r[1],r[2]);if(!(r=n.match(/^[A-Z]{2}\s*[0-9]+\s*[0-9]+$/i)))throw new Error("Invalid grid reference");u=n.toUpperCase().charCodeAt(0)-"A".charCodeAt(0);f=n.toUpperCase().charCodeAt(1)-"A".charCodeAt(0);u>7&&u--;f>7&&f--;var e=(u-2)%5*5+f%5,o=19-5*Math.floor(u/5)-Math.floor(f/5),t=n.slice(2).trim().split(/\s+/);if(1==t.length&&(t=[t[0].slice(0,t[0].length/2),t[0].slice(t[0].length/2)]),e<0||e>6||o<0||o>12)throw new Error("Invalid grid reference");if(2!=t.length)throw new Error("Invalid grid reference");if(t[0].length!=t[1].length)throw new Error("Invalid grid reference");return t[0]=(t[0]+"00000").slice(0,5),t[1]=(t[1]+"00000").slice(0,5),new i(e+t[0],o+t[1])};i.prototype.toString=function(n){var t,i,u,r,e,o,l;if(n=void 0===n?10:Number(n),isNaN(n)||n%2!=0||n>16)throw new RangeError("Invalid precision ‘"+n+"’");if(t=this.easting,i=this.northing,isNaN(t)||isNaN(i))throw new Error("Invalid grid reference");if(0==n){var s=Math.floor(t),h=t-s,f=Math.floor(i),c=i-f;return("000000"+s).slice(-6)+(h>0?h.toFixed(3).slice(1):"")+","+((f<1e6?("000000"+f).slice(-6):f)+(c>0?c.toFixed(3).slice(1):""))}return(u=Math.floor(t/1e5),r=Math.floor(i/1e5),u<0||u>6||r<0||r>12)?"":(e=19-r-(19-r)%5+Math.floor((u+10)/5),o=5*(19-r)%25+u%5,e>7&&e++,o>7&&o++,l=String.fromCharCode(e+"A".charCodeAt(0),o+"A".charCodeAt(0)),t=Math.floor(t%1e5/Math.pow(10,5-n/2)),i=Math.floor(i%1e5/Math.pow(10,5-n/2)),t=("00000000"+t).slice(-n/2),i=("00000000"+i).slice(-n/2),l+" "+t+" "+i)};void 0!==t&&t.exports&&(t.exports=i)},{"./latlon-ellipsoidal.js":777}],784:[function(n,t){"use strict";function i(n,t,u,f,e,o,s){if(!(this instanceof i))return new i(n,t,u,f,e,o,s);if(void 0===e&&(e=r.datum.WGS84),void 0===o&&(o=null),void 0===s&&(s=null),!(1<=n&&n<=60))throw new Error("Invalid UTM zone "+n);if(!t.match(/[NS]/i))throw new Error("Invalid UTM hemisphere "+t);this.zone=Number(n);this.hemisphere=t.toUpperCase();this.easting=Number(u);this.northing=Number(f);this.datum=e;this.convergence=null===o?null:Number(o);this.scale=null===s?null:Number(s)}if(void 0!==t&&t.exports)var r=n("./latlon-ellipsoidal.js");r.prototype.toUtm=function(){var ft,p,n,ct,lt;if(isNaN(this.lat)||isNaN(this.lon))throw new Error("Invalid point");if(!(-80<=this.lat&&this.lat<=84))throw new Error("Outside UTM limits");var t=Math.floor((this.lon+180)/6)+1,r=(6*(t-1)-177).toRadians(),o="CDEFGHJKLMNPQRSTUVWXX".charAt(Math.floor(this.lat/8+10));31==t&&"V"==o&&this.lon>=3&&(t++,r+=6..toRadians());32==t&&"X"==o&&this.lon<9&&(t--,r-=6..toRadians());32==t&&"X"==o&&this.lon>=9&&(t++,r+=6..toRadians());34==t&&"X"==o&&this.lon<21&&(t--,r-=6..toRadians());34==t&&"X"==o&&this.lon>=21&&(t++,r+=6..toRadians());36==t&&"X"==o&&this.lon<33&&(t--,r-=6..toRadians());36==t&&"X"==o&&this.lon>=33&&(t++,r+=6..toRadians());for(var et=this.lat.toRadians(),it=this.lon.toRadians()-r,ot=this.datum.ellipsoid.a,w=this.datum.ellipsoid.f,b=Math.sqrt(w*(2-w)),u=w/(2-w),k=u*u,d=u*k,h=u*d,c=u*h,s=u*c,l=Math.cos(it),at=Math.sin(it),vt=Math.tan(it),f=Math.tan(et),rt=Math.sinh(b*Math.atanh(b*f/Math.sqrt(1+f*f))),e=f*Math.sqrt(1+rt*rt)-rt*Math.sqrt(1+f*f),a=Math.atan2(e,l),v=Math.asinh(at/Math.sqrt(e*e+l*l)),ut=ot/(1+u)*(1+.25*k+1/64*h+1/256*s),g=[null,.5*u-2/3*k+5/16*d+41/180*h-127/288*c+7891/37800*s,13/48*k-.6*d+557/1440*h+281/630*c-1983433/1935360*s,61/240*d-103/140*h+15061/26880*c+167603/181440*s,49561/161280*h-179/168*c+6601661/7257600*s,34729/80640*c-3418889/1995840*s,.66506753108966654*s],st=a,n=1;n<=6;n++)st+=g[n]*Math.sin(2*n*a)*Math.cosh(2*n*v);for(ft=v,n=1;n<=6;n++)ft+=g[n]*Math.cos(2*n*a)*Math.sinh(2*n*v);for(var nt=.9996*ut*ft,y=.9996*ut*st,tt=1,n=1;n<=6;n++)tt+=2*n*g[n]*Math.cos(2*n*a)*Math.cosh(2*n*v);for(p=0,n=1;n<=6;n++)p+=2*n*g[n]*Math.sin(2*n*a)*Math.sinh(2*n*v);var yt=Math.atan(e/Math.sqrt(1+e*e)*vt),pt=Math.atan2(p,tt),wt=yt+pt,ht=Math.sin(et),bt=Math.sqrt(1-b*b*ht*ht)*Math.sqrt(1+f*f)/Math.sqrt(e*e+l*l),kt=ut/ot*Math.sqrt(tt*tt+p*p),dt=.9996*bt*kt;return nt+=5e5,y<0&&(y+=1e7),nt=Number(nt.toFixed(6)),y=Number(y.toFixed(6)),ct=Number(wt.toDegrees().toFixed(9)),lt=Number(dt.toFixed(12)),new i(t,this.lat>=0?"N":"S",nt,y,this.datum,ct,lt)};i.prototype.toLatLonE=function(){var ot=this.zone,vt=this.hemisphere,nt=this.easting,s=this.northing,tt,h,d,y,n;if(isNaN(ot)||isNaN(nt)||isNaN(s))throw new Error("Invalid coordinate");tt=this.datum.ellipsoid.a;h=this.datum.ellipsoid.f;nt-=5e5;s="S"==vt?s-1e7:s;for(var i=Math.sqrt(h*(2-h)),u=h/(2-h),p=u*u,w=u*p,e=u*w,o=u*e,f=u*o,it=tt/(1+u)*(1+.25*p+1/64*e+1/256*f),c=nt/(.9996*it),l=s/(.9996*it),b=[null,.5*u-2/3*p+37/96*w-1/360*e-81/512*o+96199/604800*f,1/48*p+1/15*w-437/1440*e+46/105*o-1118711/3870720*f,17/480*w-37/840*e-209/4480*o+5569/90720*f,4397/161280*e-11/504*o-830251/7257600*f,4583/161280*o-108847/3991680*f,.032330830940856981*f],k=l,n=1;n<=6;n++)k-=b[n]*Math.sin(2*n*l)*Math.cosh(2*n*c);for(d=c,n=1;n<=6;n++)d-=b[n]*Math.cos(2*n*l)*Math.sinh(2*n*c);var a=Math.sinh(d),yt=Math.sin(k),v=Math.cos(k),st=yt/Math.sqrt(a*a+v*v),t=st;do{var rt=Math.sinh(i*Math.atanh(i*t/Math.sqrt(1+t*t))),ut=t*Math.sqrt(1+rt*rt)-rt*Math.sqrt(1+t*t),ht=(st-ut)/Math.sqrt(1+ut*ut)*(1+(1-i*i)*t*t)/((1-i*i)*Math.sqrt(1+t*t));t+=ht}while(Math.abs(ht)>1e-12);for(var ft=t,ct=Math.atan(ft),lt=Math.atan2(a,v),g=1,n=1;n<=6;n++)g-=2*n*b[n]*Math.cos(2*n*l)*Math.cosh(2*n*c);for(y=0,n=1;n<=6;n++)y+=2*n*b[n]*Math.sin(2*n*l)*Math.sinh(2*n*c);var pt=Math.atan(Math.tan(k)*Math.tanh(d)),wt=Math.atan2(y,g),bt=pt+wt,at=Math.sin(ct),kt=Math.sqrt(1-i*i*at*at)*Math.sqrt(1+ft*ft)*Math.sqrt(a*a+v*v),dt=it/tt/Math.sqrt(g*g+y*y),gt=.9996*kt*dt;lt+=(6*(ot-1)-177).toRadians();var ni=Number(ct.toDegrees().toFixed(11)),ti=Number(lt.toDegrees().toFixed(11)),ii=Number(bt.toDegrees().toFixed(9)),ri=Number(gt.toFixed(12)),et=new r(ni,ti,this.datum);return et.convergence=ii,et.scale=ri,et};i.parse=function(n,t){if(void 0===t&&(t=r.datum.WGS84),null==(n=n.trim().match(/\S+/g))||4!=n.length)throw new Error("Invalid UTM coordinate ‘"+n+"’");return new i(n[0],n[1],n[2],n[3],t)};i.prototype.toString=function(n){n=Number(n||0);var t=this.zone<10?"0"+this.zone:this.zone,i=this.hemisphere,r=this.easting,u=this.northing;return isNaN(t)||!i.match(/[NS]/)||isNaN(r)||isNaN(u)?"":t+" "+i+" "+r.toFixed(n)+" "+u.toFixed(n)};void 0===Math.sinh&&(Math.sinh=function(n){return(Math.exp(n)-Math.exp(-n))/2});void 0===Math.cosh&&(Math.cosh=function(n){return(Math.exp(n)+Math.exp(-n))/2});void 0===Math.tanh&&(Math.tanh=function(n){return(Math.exp(n)-Math.exp(-n))/(Math.exp(n)+Math.exp(-n))});void 0===Math.asinh&&(Math.asinh=function(n){return Math.log(n+Math.sqrt(1+n*n))});void 0===Math.atanh&&(Math.atanh=function(n){return Math.log((1+n)/(1-n))/2});void 0!==t&&t.exports&&(t.exports=i)},{"./latlon-ellipsoidal.js":777}],785:[function(n,t){"use strict";function i(n,t,r){if(!(this instanceof i))return new i(n,t,r);this.x=Number(n);this.y=Number(t);this.z=Number(r)}i.prototype.plus=function(n){if(!(n instanceof i))throw new TypeError("v is not Vector3d object");return new i(this.x+n.x,this.y+n.y,this.z+n.z)};i.prototype.minus=function(n){if(!(n instanceof i))throw new TypeError("v is not Vector3d object");return new i(this.x-n.x,this.y-n.y,this.z-n.z)};i.prototype.times=function(n){return n=Number(n),new i(this.x*n,this.y*n,this.z*n)};i.prototype.dividedBy=function(n){return n=Number(n),new i(this.x/n,this.y/n,this.z/n)};i.prototype.dot=function(n){if(!(n instanceof i))throw new TypeError("v is not Vector3d object");return this.x*n.x+this.y*n.y+this.z*n.z};i.prototype.cross=function(n){if(!(n instanceof i))throw new TypeError("v is not Vector3d object");return new i(this.y*n.z-this.z*n.y,this.z*n.x-this.x*n.z,this.x*n.y-this.y*n.x)};i.prototype.negate=function(){return new i(-this.x,-this.y,-this.z)};i.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)};i.prototype.unit=function(){var n=this.length();return 1==n?this:0==n?this:new i(this.x/n,this.y/n,this.z/n)};i.prototype.angleTo=function(n,t){if(!(n instanceof i))throw new TypeError("v is not Vector3d object");if(!(t instanceof i||void 0==t))throw new TypeError("n is not Vector3d object");var r=void 0==t?1:Math.sign(this.cross(n).dot(t)),u=this.cross(n).length()*r,f=this.dot(n);return Math.atan2(u,f)};i.prototype.rotateAround=function(n,t){var e;if(!(n instanceof i))throw new TypeError("axis is not Vector3d object");for(var h=this.unit(),c=[h.x,h.y,h.z],r=n.unit(),f=Math.sin(t),u=Math.cos(t),l=[[r.x*r.x*(1-u)+u,r.x*r.y*(1-u)-r.z*f,r.x*r.z*(1-u)+r.y*f],[r.y*r.x*(1-u)+r.z*f,r.y*r.y*(1-u)+u,r.y*r.z*(1-u)-r.x*f],[r.z*r.x*(1-u)-r.y*f,r.z*r.y*(1-u)+r.x*f,r.z*r.z*(1-u)+u]],o=[0,0,0],s=0;s<3;s++)for(e=0;e<3;e++)o[s]+=l[s][e]*c[e];return new i(o[0],o[1],o[2])};i.prototype.toString=function(n){var t=void 0===n?3:Number(n);return"["+this.x.toFixed(t)+","+this.y.toFixed(t)+","+this.z.toFixed(t)+"]"};void 0===Math.sign&&(Math.sign=function(n){return n=+n,0===n||isNaN(n)?n:n>0?1:-1});void 0!==t&&t.exports&&(t.exports=i)},{}],786:[function(n,t){var i=n("@turf/helpers"),r=n("@turf/invariant").getCoord,u=n("geodesy").LatLonSpherical,f=i.radiansToDistance,e=i.distanceToRadians;t.exports=function(n,t,i){var l;if(!n)throw new Error("from point is required");if(!t)throw new Error("to point is required");i=i||"kilometers";var h=r(n),c=r(t),s=new u(h[1],h[0]),o=new u(c[1],c[0]);return o[0]+=o[0]-s[0]>180?-360:s[0]-o[0]>180?360:0,l=s.rhumbDistanceTo(o),f(e(l,"meters"),i)}},{"@turf/helpers":787,"@turf/invariant":788,geodesy:795}],787:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],788:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],789:[function(n,t,i){arguments[4][776][0].apply(i,arguments)},{dup:776}],790:[function(n,t,i){arguments[4][777][0].apply(i,arguments)},{"./dms.js":789,"./vector3d.js":798,dup:777}],791:[function(n,t,i){arguments[4][778][0].apply(i,arguments)},{"./dms":789,dup:778}],792:[function(n,t,i){arguments[4][779][0].apply(i,arguments)},{"./dms.js":789,"./vector3d.js":798,dup:779}],793:[function(n,t,i){arguments[4][780][0].apply(i,arguments)},{"./latlon-ellipsoidal.js":790,dup:780}],794:[function(n,t,i){arguments[4][781][0].apply(i,arguments)},{"./latlon-ellipsoidal.js":790,"./utm.js":797,dup:781}],795:[function(n,t,i){arguments[4][782][0].apply(i,arguments)},{"./dms.js":789,"./latlon-ellipsoidal.js":790,"./latlon-spherical.js":791,"./latlon-vectors.js":792,"./latlon-vincenty.js":793,"./mgrs.js":794,"./osgridref.js":796,"./utm.js":797,"./vector3d.js":798,dup:782}],796:[function(n,t,i){arguments[4][783][0].apply(i,arguments)},{"./latlon-ellipsoidal.js":790,dup:783}],797:[function(n,t,i){arguments[4][784][0].apply(i,arguments)},{"./latlon-ellipsoidal.js":790,dup:784}],798:[function(n,t,i){arguments[4][785][0].apply(i,arguments)},{dup:785}],799:[function(n,t){function u(n,t,r,u,f,s){for(var c,l,h=0;h<n.length;h++)c=n[h],l=n[h+1],h===n.length-1&&(l=n[0]),u=i(c,l,t),r<=0&&u>0&&(o(t,c,f)||(f=c)),r>0&&u<=0&&(e(t,c,s)||(s=c)),r=u;return[f,s]}function e(n,t,r){return i(n,t,r)>=0}function o(n,t,r){return i(n,t,r)<=0}function i(n,t,i){return(t[0]-n[0])*(i[1]-n[1])-(i[0]-n[0])*(t[1]-n[1])}function s(n){return n.geometry?n.geometry.type:n.type}var f=n("@turf/invariant").getCoords,r=n("@turf/helpers"),h=r.featureCollection;t.exports=function(n,t){var l,e,o,a=f(n),c=f(t),v;switch(s(t)){case"Polygon":e=0;o=0;l=i(c[0][0],c[0][1],a);v=u(c[0],a,l,void 0,e,o);e=v[0];o=v[1];break;case"MultiPolygon":e=0;o=0;l=i(c[0][0][0],c[0][0][1],a);c.forEach(function(n){var t=u(n[0],a,l,void 0,e,o);e=t[0];o=t[1]})}return h([r.point(e),r.point(o)])}},{"@turf/helpers":800,"@turf/invariant":801}],800:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],801:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],802:[function(n,t,i){arguments[4][58][0].apply(i,arguments)},{"@turf/helpers":803,"@turf/invariant":804,dup:58}],803:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],804:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],805:[function(n,t){var i=n("polygonize");t.exports=function(n){return i(n)}},{polygonize:817}],806:[function(n,t,i){arguments[4][20][0].apply(i,arguments)},{"@turf/helpers":809,dup:20}],807:[function(n,t,i){arguments[4][22][0].apply(i,arguments)},{"@turf/meta":812,dup:22}],808:[function(n,t,i){arguments[4][376][0].apply(i,arguments)},{"@turf/bbox":807,"@turf/bbox-polygon":806,dup:376}],809:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],810:[function(n,t,i){arguments[4][36][0].apply(i,arguments)},{"@turf/invariant":811,dup:36}],811:[function(n,t,i){arguments[4][469][0].apply(i,arguments)},{dup:469}],812:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],813:[function(n,t){"use strict";function r(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}var i=function(){function n(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}return function(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),t}}(),u=n("@turf/helpers"),f=u.lineString,e=n("./util"),o=e.orientationIndex,s=function(){function n(t,i){r(this,n);this.from=t;this.to=i;this.next=void 0;this.label=void 0;this.symetric=void 0;this.ring=void 0;this.from.addOuterEdge(this);this.to.addInnerEdge(this)}return i(n,[{key:"getSymetric",value:function(){return this.symetric||(this.symetric=new n(this.to,this.from),this.symetric.symetric=this),this.symetric}}]),i(n,[{key:"deleteEdge",value:function(){this.from.removeOuterEdge(this);this.to.removeInnerEdge(this)}},{key:"isEqual",value:function(n){return this.from.id===n.from.id&&this.to.id===n.to.id}},{key:"toString",value:function(){return"Edge { "+this.from.id+" -> "+this.to.id+" }"}},{key:"toLineString",value:function(){return f([this.from.coordinates,this.to.coordinates])}},{key:"compareTo",value:function(n){return o(n.from.coordinates,n.to.coordinates,this.to.coordinates)}}]),n}();t.exports=s},{"./util":818,"@turf/helpers":809}],814:[function(n,t){"use strict";function f(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}var e=function(){function n(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}return function(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),t}}(),i=n("./util"),o=i.orientationIndex,s=i.envelopeIsEqual,u=i.envelopeContains,h=i.coordinatesEqual,r=n("@turf/helpers"),c=r.multiPoint,l=r.polygon,a=r.point,v=n("@turf/envelope"),y=n("@turf/inside"),p=function(){function n(){f(this,n);this.edges=[];this.polygon=void 0;this.envelope=void 0}return e(n,[{key:"push",value:function(n){this[this.edges.length]=n;this.edges.push(n);this.polygon=this.envelope=void 0}},{key:"get",value:function(n){return this.edges[n]}},{key:"forEach",value:function(n){this.edges.forEach(n)}},{key:"map",value:function(n){return this.edges.map(n)}},{key:"some",value:function(n){return this.edges.some(n)}},{key:"isValid",value:function(){return!0}},{key:"isHole",value: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=o(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}},{key:"toMultiPoint",value:function(){return c(this.edges.map(function(n){return n.from.coordinates}))}},{key:"toPolygon",value: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=l([n])}},{key:"getEnvelope",value:function(){return this.envelope?this.envelope:this.envelope=v(this.toPolygon())}},{key:"inside",value:function(n){return y(n,this.toPolygon())}},{key:"length",get:function(){return this.edges.length}}],[{key:"findEdgeRingContaining",value:function(n,t){var r=n.getEnvelope(),f=void 0,i=void 0;return t.forEach(function(t){var e=t.getEnvelope(),o;(i&&(f=i.getEnvelope()),!s(e,r)&&u(e,r))&&(o=n.map(function(n){return n.from.coordinates}).find(function(n){return!t.some(function(t){return h(n,t.from.coordinates)})}),o&&t.inside(a(o))&&(i&&!u(f,e)||(i=t)))}),i}}]),n}();t.exports=p},{"./util":818,"@turf/envelope":808,"@turf/helpers":809,"@turf/inside":810}],815:[function(n,t){"use strict";function f(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}function e(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");}var i=function(){function n(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}return function(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),t}}(),r=n("./Node"),o=n("./Edge"),s=n("./EdgeRing"),u=n("@turf/meta"),h=u.flattenEach,c=u.coordReduce,l=n("@turf/invariant"),a=l.featureOf,v=function(){function n(){f(this,n);this.edges=[];this.nodes={}}return i(n,[{key:"getNode",value:function(n){var i=r.buildId(n),t=this.nodes[i];return t||(t=this.nodes[i]=new r(n)),t}},{key:"addEdge",value:function(n,t){var i=new o(n,t),r=i.getSymetric();this.edges.push(i);this.edges.push(r)}}],[{key:"fromGeoJson",value:function(t){e(t);var i=new n;return h(t,function(n){a(n,"LineString","Graph::fromGeoJson");c(n,function(n,t){if(n){var r=i.getNode(n),u=i.getNode(t);i.addEdge(r,u)}return t})}),i}}]),i(n,[{key:"deleteDangles",value:function(){var n=this;Object.keys(this.nodes).map(function(t){return n.nodes[t]}).forEach(function(t){return n._removeIfDangle(t)})}},{key:"_removeIfDangle",value: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)}))}},{key:"deleteCutEdges",value: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))})}},{key:"_computeNextCWEdges",value: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})}},{key:"_computeNextCCWEdges",value:function(n,t){for(var s=n.getOuterEdges(),f=void 0,i=void 0,e=s.length-1;e>=0;--e){var o=s[e],h=o.symetric,r=void 0,u=void 0;o.label===t&&(r=o);h.label===t&&(u=h);r&&u&&(u&&(i=u),r&&(i&&(i.next=r,i=void 0),f||(f=r)))}i&&(i.next=f)}},{key:"_findLabeledEdgeRings",value: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}},{key:"getEdgeRings",value: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}},{key:"_findIntersectionNodes",value:function(n){var i=[],t=n;do!function(){var r=0;t.from.getOuterEdges().forEach(function(t){t.label===n.label&&++r});r>1&&i.push(t.from);t=t.next}();while(!n.isEqual(t));return i}},{key:"_findEdgeRing",value:function(n){var t=n,i=new s;do i.push(t),t.ring=i,t=t.next;while(!n.isEqual(t));return i}},{key:"removeNode",value: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]}},{key:"removeEdge",value:function(n){this.edges=this.edges.filter(function(t){return!t.isEqual(n)});n.deleteEdge()}}]),n}();t.exports=v},{"./Edge":813,"./EdgeRing":814,"./Node":816,"@turf/invariant":811,"@turf/meta":812}],816:[function(n,t){"use strict";function r(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}var i=function(){function n(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}return function(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),t}}(),u=n("./util"),f=u.orientationIndex,e=function(){function n(t){r(this,n);this.id=n.buildId(t);this.coordinates=t;this.innerEdges=[];this.outerEdges=[];this.outerEdgesSorted=!1}return i(n,null,[{key:"buildId",value:function(n){return n.join(",")}}]),i(n,[{key:"removeInnerEdge",value:function(n){this.innerEdges=this.innerEdges.filter(function(t){return t.from.id!==n.from.id})}},{key:"removeOuterEdge",value:function(n){this.outerEdges=this.outerEdges.filter(function(t){return t.to.id!==n.to.id})}},{key:"addOuterEdge",value:function(n){this.outerEdges.push(n);this.outerEdgesSorted=!1}},{key:"sortOuterEdges",value:function(){var n=this;this.outerEdgesSorted||(this.outerEdges.sort(function(t,i){var r=t.to,u=i.to,e;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]:(e=f(n.coordinates,r.coordinates,u.coordinates),e<0?1:e>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)}},{key:"getOuterEdges",value:function(){return this.sortOuterEdges(),this.outerEdges}},{key:"getOuterEdge",value:function(n){return this.sortOuterEdges(),this.outerEdges[n]}},{key:"addInnerEdge",value:function(n){this.innerEdges.push(n)}}]),n}();t.exports=e},{"./util":818}],817:[function(n,t){"use strict";var i=n("./Graph"),r=n("./EdgeRing"),u=n("@turf/helpers"),f=u.featureCollection;t.exports=function(n){var u=i.fromGeoJson(n),e,t;return u.deleteDangles(),u.deleteCutEdges(),e=[],t=[],u.getEdgeRings().filter(function(n){return n.isValid()}).forEach(function(n){n.isHole()?e.push(n):t.push(n)}),e.forEach(function(n){r.findEdgeRingContaining(n,t)&&t.push(n)}),f(t.map(function(n){return n.toPolygon()}))}},{"./EdgeRing":814,"./Graph":815,"@turf/helpers":809}],818:[function(n,t){"use strict";function i(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 r(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)}function u(n,t){return t.geometry.coordinates[0].every(function(t){return e(s(t),n)})}function f(n,t){return n[0]===t[0]&&n[1]===t[1]}var e=n("@turf/inside"),o=n("@turf/helpers"),s=o.point;t.exports={orientationIndex:i,envelopeIsEqual:r,envelopeContains:u,coordinatesEqual:f}},{"@turf/helpers":809,"@turf/inside":810}],819:[function(n,t){var i=n("geojson-random");t.exports=function(n,t,r){switch(r=r||{},t=t||1,n){case"point":case"points":case void 0:return i.point(t,r.bbox);case"polygon":case"polygons":return i.polygon(t,r.num_vertices,r.max_radial_length,r.bbox);default:throw new Error("Unknown type given: valid options are points and polygons");}}},{"geojson-random":820}],820:[function(n,t){function r(n){return n?l(n):[f(),e()]}function c(n){return function(t){return[t[0]+n[0],t[1]+n[1]]}}function u(){return Math.random()-.5}function f(){return 360*u()}function e(){return 180*u()}function o(n){return{type:"Point",coordinates:n||[f(),e()]}}function l(n){return[Math.random()*(n[2]-n[0])+n[0],Math.random()*(n[3]-n[1])+n[1]]}function a(n){return{type:"Polygon",coordinates:n}}function s(n){return{type:"Feature",geometry:n,properties:{}}}function h(n){return{type:"FeatureCollection",features:n}}t.exports=function(){throw new Error("call .point() or .polygon() instead");};t.exports.position=r;t.exports.point=function(n,t){var u=[];for(i=0;i<n;i++)u.push(s(t?o(r(t)):o()));return h(u)};t.exports.polygon=function(n,t,u,f){function v(n,t,i){i[t]=t>0?n+i[t-1]:n}function y(n){n=2*n*Math.PI/o[o.length-1];var t=Math.random();e.push([t*u*Math.sin(n),t*u*Math.cos(n)])}var l,e,o;for("number"!=typeof t&&(t=10),"number"!=typeof u&&(u=10),l=[],i=0;i<n;i++)e=[],o=Array.apply(null,new Array(t+1)).map(Math.random),o.forEach(v),o.forEach(y),e[e.length-1]=e[0],e=e.map(c(r(f))),l.push(s(a([e])));return h(l)}},{}],821:[function(n,t){function i(n,t){switch("Feature"===n.type?n.geometry.type:n.type){case"GeometryCollection":return s(n,function(n){i(n,t)}),n;case"LineString":return f(r(n),t),n;case"Polygon":return e(r(n),t),n;case"MultiLineString":return r(n).forEach(function(n){f(n,t)}),n;case"MultiPolygon":return r(n).forEach(function(n){e(n,t)}),n;case"Point":case"MultiPoint":return n}}function f(n,t){u(n)===t&&n.reverse()}function e(n,t){u(n[0])!==t&&n[0].reverse();for(var i=1;i<n.length;i++)u(n[i])===t&&n[i].reverse()}var o=n("@turf/meta"),r=n("@turf/invariant").getCoords,u=n("@turf/boolean-clockwise"),c=n("@turf/helpers").featureCollection,s=o.geomEach,h=o.featureEach;t.exports=function(n,t,r){if(t=void 0!==t&&t,r=void 0!==r&&r,!n)throw new Error("<geojson> is required");if("boolean"!=typeof t)throw new Error("<reverse> must be a boolean");if("boolean"!=typeof r)throw new Error("<mutate> must be a boolean");!1!==r&&void 0!==r||(n=JSON.parse(JSON.stringify(n)));var u=[];switch(n.type){case"GeometryCollection":return s(n,function(n){i(n,t)}),n;case"FeatureCollection":return h(n,function(n){h(i(n,t),function(n){u.push(n)})}),c(u)}return i(n,t)}},{"@turf/boolean-clockwise":822,"@turf/helpers":824,"@turf/invariant":825,"@turf/meta":826}],822:[function(n,t,i){arguments[4][29][0].apply(i,arguments)},{"@turf/invariant":823,dup:29}],823:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],824:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],825:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],826:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],827:[function(n,t,i){arguments[4][774][0].apply(i,arguments)},{"@turf/invariant":828,dup:774,geodesy:835}],828:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],829:[function(n,t,i){arguments[4][776][0].apply(i,arguments)},{dup:776}],830:[function(n,t,i){arguments[4][777][0].apply(i,arguments)},{"./dms.js":829,"./vector3d.js":838,dup:777}],831:[function(n,t,i){arguments[4][778][0].apply(i,arguments)},{"./dms":829,dup:778}],832:[function(n,t,i){arguments[4][779][0].apply(i,arguments)},{"./dms.js":829,"./vector3d.js":838,dup:779}],833:[function(n,t,i){arguments[4][780][0].apply(i,arguments)},{"./latlon-ellipsoidal.js":830,dup:780}],834:[function(n,t,i){arguments[4][781][0].apply(i,arguments)},{"./latlon-ellipsoidal.js":830,"./utm.js":837,dup:781}],835:[function(n,t,i){arguments[4][782][0].apply(i,arguments)},{"./dms.js":829,"./latlon-ellipsoidal.js":830,"./latlon-spherical.js":831,"./latlon-vectors.js":832,"./latlon-vincenty.js":833,"./mgrs.js":834,"./osgridref.js":836,"./utm.js":837,"./vector3d.js":838,dup:782}],836:[function(n,t,i){arguments[4][783][0].apply(i,arguments)},{"./latlon-ellipsoidal.js":830,dup:783}],837:[function(n,t,i){arguments[4][784][0].apply(i,arguments)},{"./latlon-ellipsoidal.js":830,dup:784}],838:[function(n,t,i){arguments[4][785][0].apply(i,arguments)},{dup:785}],839:[function(n,t){var i=n("@turf/helpers"),r=n("@turf/invariant").getCoord,u=n("geodesy").LatLonSpherical,f=i.point,e=i.radiansToDistance,o=i.distanceToRadians;t.exports=function(n,t,i,s){if(!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");s=s||"kilometers";var l=e(o(t,s),"meters"),c=r(n),a=new u(c[1],c[0]),h=a.rhumbDestinationPoint(l,i);return h.lon+=h.lon-c[0]>180?-360:c[0]-h.lon>180?360:0,f([h.lon,h.lat])}},{"@turf/helpers":840,"@turf/invariant":841,geodesy:848}],840:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],841:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],842:[function(n,t,i){arguments[4][776][0].apply(i,arguments)},{dup:776}],843:[function(n,t,i){arguments[4][777][0].apply(i,arguments)},{"./dms.js":842,"./vector3d.js":851,dup:777}],844:[function(n,t,i){arguments[4][778][0].apply(i,arguments)},{"./dms":842,dup:778}],845:[function(n,t,i){arguments[4][779][0].apply(i,arguments)},{"./dms.js":842,"./vector3d.js":851,dup:779}],846:[function(n,t,i){arguments[4][780][0].apply(i,arguments)},{"./latlon-ellipsoidal.js":843,dup:780}],847:[function(n,t,i){arguments[4][781][0].apply(i,arguments)},{"./latlon-ellipsoidal.js":843,"./utm.js":850,dup:781}],848:[function(n,t,i){arguments[4][782][0].apply(i,arguments)},{"./dms.js":842,"./latlon-ellipsoidal.js":843,"./latlon-spherical.js":844,"./latlon-vectors.js":845,"./latlon-vincenty.js":846,"./mgrs.js":847,"./osgridref.js":849,"./utm.js":850,"./vector3d.js":851,dup:782}],849:[function(n,t,i){arguments[4][783][0].apply(i,arguments)},{"./latlon-ellipsoidal.js":843,dup:783}],850:[function(n,t,i){arguments[4][784][0].apply(i,arguments)},{"./latlon-ellipsoidal.js":843,dup:784}],851:[function(n,t,i){arguments[4][785][0].apply(i,arguments)},{dup:785}],852:[function(n,t,i){arguments[4][786][0].apply(i,arguments)},{"@turf/helpers":853,"@turf/invariant":854,dup:786,geodesy:861}],853:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],854:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],855:[function(n,t,i){arguments[4][776][0].apply(i,arguments)},{dup:776}],856:[function(n,t,i){arguments[4][777][0].apply(i,arguments)},{"./dms.js":855,"./vector3d.js":864,dup:777}],857:[function(n,t,i){arguments[4][778][0].apply(i,arguments)},{"./dms":855,dup:778}],858:[function(n,t,i){arguments[4][779][0].apply(i,arguments)},{"./dms.js":855,"./vector3d.js":864,dup:779}],859:[function(n,t,i){arguments[4][780][0].apply(i,arguments)},{"./latlon-ellipsoidal.js":856,dup:780}],860:[function(n,t,i){arguments[4][781][0].apply(i,arguments)},{"./latlon-ellipsoidal.js":856,"./utm.js":863,dup:781}],861:[function(n,t,i){arguments[4][782][0].apply(i,arguments)},{"./dms.js":855,"./latlon-ellipsoidal.js":856,"./latlon-spherical.js":857,"./latlon-vectors.js":858,"./latlon-vincenty.js":859,"./mgrs.js":860,"./osgridref.js":862,"./utm.js":863,"./vector3d.js":864,dup:782}],862:[function(n,t,i){arguments[4][783][0].apply(i,arguments)},{"./latlon-ellipsoidal.js":856,dup:783}],863:[function(n,t,i){arguments[4][784][0].apply(i,arguments)},{"./latlon-ellipsoidal.js":856,dup:784}],864:[function(n,t,i){arguments[4][785][0].apply(i,arguments)},{dup:785}],865:[function(n,t){function i(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)}var r=n("@turf/helpers").featureCollection;t.exports=function(n,t){return r(i(n.features,t))}},{"@turf/helpers":866}],866:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],867:[function(n,t){function i(n){var t=n%360;return t<0&&(t+=360),t}var r=n("@turf/circle"),u=n("@turf/meta").coordEach,f=n("@turf/helpers"),e=n("@turf/invariant").getCoords,o=f.polygon,s=n("@turf/line-arc");t.exports=function(n,t,f,h,c,l){if(!n)throw new Error("center is required");if(void 0===f||null===f)throw new Error("bearing1 is required");if(void 0===h||null===h)throw new Error("bearing2 is required");if(!t)throw new Error("radius is required");if(c=c||64,i(f)===i(h))return r(n,t,c,l);var v=e(n),y=s(n,t,f,h,c,l),a=[[v]];return u(y,function(n){a[0].push(n)}),a[0].push(v),o(a)}},{"@turf/circle":868,"@turf/helpers":873,"@turf/invariant":874,"@turf/line-arc":875,"@turf/meta":885}],868:[function(n,t,i){arguments[4][213][0].apply(i,arguments)},{"@turf/destination":869,"@turf/helpers":872,dup:213}],869:[function(n,t,i){arguments[4][5][0].apply(i,arguments)},{"@turf/helpers":870,"@turf/invariant":871,dup:5}],870:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],871:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],872:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],873:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],874:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],875:[function(n,t,i){arguments[4][487][0].apply(i,arguments)},{"@turf/circle":876,"@turf/destination":881,"@turf/helpers":884,dup:487}],876:[function(n,t,i){arguments[4][213][0].apply(i,arguments)},{"@turf/destination":877,"@turf/helpers":880,dup:213}],877:[function(n,t,i){arguments[4][5][0].apply(i,arguments)},{"@turf/helpers":878,"@turf/invariant":879,dup:5}],878:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],879:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],880:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],881:[function(n,t,i){arguments[4][5][0].apply(i,arguments)},{"@turf/helpers":882,"@turf/invariant":883,dup:5}],882:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],883:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],884:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],885:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],886:[function(n,t){function f(n,t,i){var e=n.type,f;if("Point"===e||"MultiPoint"===e)return n;o(n,!0);f=n.coordinates;switch(e){case"LineString":n.coordinates=r(f,t,i);break;case"MultiLineString":n.coordinates=f.map(function(n){return r(n,t,i)});break;case"Polygon":n.coordinates=u(f,t,i);break;case"MultiPolygon":n.coordinates=f.map(function(n){return u(n,t,i)})}return n}function r(n,t,r){return i(n.map(function(n){return{x:n[0],y:n[1],z:n[2]}}),t,r).map(function(n){return n.z?[n.x,n.y,n.z]:[n.x,n.y]})}function u(n,t,r){return n.map(function(n){var f=n.map(function(n){return{x:n[0],y:n[1]}}),u;if(f.length<4)throw new Error("invalid polygon");for(u=i(f,t,r).map(function(n){return[n.x,n.y]});!e(u);)t-=.01*t,u=i(f,t,r).map(function(n){return[n.x,n.y]});return u[u.length-1][0]===u[0][0]&&u[u.length-1][1]===u[0][1]||u.push(u[0]),u})}function e(n){return!(n.length<3)&&!(3===n.length&&n[2][0]===n[0][0]&&n[2][1]===n[0][1])}var i=n("simplify-js"),o=n("@turf/clean-coords"),s=n("@turf/meta").geomEach,h=n("@turf/clone");t.exports=function(n,t,i,r){if(!n)throw new Error("geojson is required");if(t&&t<0)throw new Error("invalid tolerance");return!0!==r&&(n=h(n)),s(n,function(n){f(n,t,i)}),n}},{"@turf/clean-coords":887,"@turf/clone":890,"@turf/meta":891,"simplify-js":892}],887:[function(n,t,i){arguments[4][83][0].apply(i,arguments)},{"@turf/helpers":888,"@turf/invariant":889,dup:83}],888:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],889:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],890:[function(n,t,i){arguments[4][221][0].apply(i,arguments)},{dup:221}],891:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],892:[function(t,i){!function(){"use strict";function r(n,t){var i=n.x-t.x,r=n.y-t.y;return i*i+r*r}function u(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 f(n,t){for(var i,u=n[0],f=[u],e=1,o=n.length;e<o;e++)i=n[e],r(i,u)>t&&(f.push(i),u=i);return u!==i&&f.push(i),f}function e(n,t){var i,e,l,o,h=n.length,v="undefined"!=typeof Uint8Array?Uint8Array:Array,s=new v(h),f=0,r=h-1,c=[],a=[];for(s[f]=s[r]=1;r;){for(e=0,i=f+1;i<r;i++)(l=u(n[i],n[f],n[r]))>e&&(o=i,e=l);e>t&&(s[o]=1,c.push(f,o,o,r));r=c.pop();f=c.pop()}for(i=0;i<h;i++)s[i]&&a.push(n[i]);return a}function t(n,t,i){var r=void 0!==t?t*t:1;return n=i?n:f(n,r),n=e(n,r)}"function"==typeof n&&n.amd?n(function(){return t}):void 0!==i?i.exports=t:"undefined"!=typeof self?self.simplify=t:window.simplify=t}()},{}],893:[function(n,t,i){arguments[4][407][0].apply(i,arguments)},{"@turf/bbox":894,"@turf/distance":896,"@turf/helpers":899,dup:407}],894:[function(n,t,i){arguments[4][22][0].apply(i,arguments)},{"@turf/meta":895,dup:22}],895:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],896:[function(n,t,i){arguments[4][8][0].apply(i,arguments)},{"@turf/helpers":897,"@turf/invariant":898,dup:8}],897:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],898:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],899:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],900:[function(n,t){var i=n("@turf/distance");t.exports=function(n){var t=n[0],r=n[1],u=n[2],f=n[3],e,o;return i(n.slice(0,2),[u,r])>=i(n.slice(0,2),[t,f])?(e=(r+f)/2,[t,e-(u-t)/2,u,e+(u-t)/2]):(o=(t+u)/2,[o-(f-r)/2,r,o+(f-r)/2,f])}},{"@turf/distance":901}],901:[function(n,t,i){arguments[4][8][0].apply(i,arguments)},{"@turf/helpers":902,"@turf/invariant":903,dup:8}],902:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],903:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],904:[function(n,t){var i=n("@turf/inside");t.exports=function(n,t,r,u){return n=JSON.parse(JSON.stringify(n)),t=JSON.parse(JSON.stringify(t)),n.features.forEach(function(n){n.properties||(n.properties={});t.features.forEach(function(t){void 0===n.properties[u]&&i(n,t)&&(n.properties[u]=t.properties[r])})}),n}},{"@turf/inside":905}],905:[function(n,t,i){arguments[4][36][0].apply(i,arguments)},{"@turf/invariant":906,dup:36}],906:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],907:[function(n,t){function i(n){var i=r(n),s=f(i.vertices,i.holes,2),h=[],e=[],t,o;for(s.forEach(function(n,t){var r=s[t];e.push([i.vertices[2*r],i.vertices[2*r+1]])}),t=0;t<e.length;t+=3)o=e.slice(t,t+3),o.push(e[t]),h.push(u([o]));return h}function r(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}var u=n("@turf/helpers").polygon,f=n("earcut");t.exports=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=i(n.geometry.coordinates):n.geometry.coordinates.forEach(function(n){t.features=t.features.concat(i(n))}),t}},{"@turf/helpers":908,earcut:909}],908:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],909:[function(n,t){"use strict";function h(n,t,i){var r,u,c,l,e,o,w,s;i=i||2;var y=t&&t.length,p=y?t[0]*i:n.length,h=v(n,0,p,i,!0),a=[];if(!h)return a;if(y&&(h=nt(n,t,h,i)),n.length>80*i){for(r=c=n[0],u=l=n[1],s=i;s<p;s+=i)e=n[s],o=n[s+1],e<r&&(r=e),o<u&&(u=o),e>c&&(c=e),o>l&&(l=o);w=Math.max(c-r,l-u)}return f(h,a,i,r,u,w),a}function v(n,t,i,u,f){var e,s;if(f===a(n,t,i,u)>0)for(e=t;e<i;e+=u)s=w(e,n[e],n[e+1],s);else for(e=i-u;e>=t;e-=u)s=w(e,n[e],n[e+1],s);return s&&r(s,s.next)&&(o(s),s=s.next),s}function u(n,t){if(!n)return n;t||(t=n);var f,u=n;do if(f=!1,u.steiner||!r(u,u.next)&&0!==i(u.prev,u,u.next))u=u.next;else{if(o(u),(u=t=u.prev)===u.next)return null;f=!0}while(f||u!==t);return t}function f(n,t,i,r,e,s,h){if(n){!h&&s&&ut(n,r,e,s);for(var l,c,a=n;n.prev!==n.next;)if(l=n.prev,c=n.next,s?k(n,r,e,s):b(n))t.push(l.i/i),t.push(n.i/i),t.push(c.i/i),o(n),n=c.next,a=c.next;else if((n=c)===a){h?1===h?(n=d(n,t,i),f(n,t,i,r,e,s,2)):2===h&&g(n,t,i,r,e,s):f(u(n),t,i,r,e,s,1);break}}}function b(n){var r=n.prev,u=n,f=n.next,t;if(i(r,u,f)>=0)return!1;for(t=n.next.next;t!==n.prev;){if(s(r.x,r.y,u.x,u.y,f.x,f.y,t.x,t.y)&&i(t.prev,t,t.next)>=0)return!1;t=t.next}return!0}function k(n,t,r,u){var o=n.prev,h=n,e=n.next;if(i(o,h,e)>=0)return!1;for(var l=o.x<h.x?o.x<e.x?o.x:e.x:h.x<e.x?h.x:e.x,a=o.y<h.y?o.y<e.y?o.y:e.y:h.y<e.y?h.y:e.y,v=o.x>h.x?o.x>e.x?o.x:e.x:h.x>e.x?h.x:e.x,y=o.y>h.y?o.y>e.y?o.y:e.y:h.y>e.y?h.y:e.y,p=c(l,a,t,r,u),w=c(v,y,t,r,u),f=n.nextZ;f&&f.z<=w;){if(f!==n.prev&&f!==n.next&&s(o.x,o.y,h.x,h.y,e.x,e.y,f.x,f.y)&&i(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(f=n.prevZ;f&&f.z>=p;){if(f!==n.prev&&f!==n.next&&s(o.x,o.y,h.x,h.y,e.x,e.y,f.x,f.y)&&i(f.prev,f,f.next)>=0)return!1;f=f.prevZ}return!0}function d(n,t,i){var u=n,s,f;do s=u.prev,f=u.next.next,!r(s,f)&&y(s,u,u.next,f)&&e(s,f)&&e(f,s)&&(t.push(s.i/i),t.push(u.i/i),t.push(f.i/i),o(u),o(u.next),u=n=f),u=u.next;while(u!==n);return u}function g(n,t,i,r,e,o){var s=n,h,c;do{for(h=s.next.next;h!==s.prev;){if(s.i!==h.i&&ot(s,h))return c=p(s,h),s=u(s,s.next),c=u(c,c.next),f(s,t,i,r,e,o),void f(c,t,i,r,e,o);h=h.next}s=s.next}while(s!==n)}function nt(n,t,i,r){for(var h,c,e,o=[],f=0,s=t.length;f<s;f++)h=t[f]*r,c=f<s-1?t[f+1]*r:n.length,e=v(n,h,c,r,!1),e===e.next&&(e.steiner=!0),o.push(et(e));for(o.sort(tt),f=0;f<o.length;f++)it(o[f],i),i=u(i,i.next);return i}function tt(n,t){return n.x-t.x}function it(n,t){if(t=rt(n,t)){var i=p(t,n);u(i,i.next)}}function rt(n,t){var r,i=t,f=n.x,u=n.y,o=-1/0,h;do{if(u<=i.y&&u>=i.next.y&&(h=i.x+(u-i.y)*(i.next.x-i.x)/(i.next.y-i.y),h<=f&&h>o)){if(o=h,h===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===o)return r.prev;var c,y=r,v=r.x,l=r.y,a=1/0;for(i=r.next;i!==y;)f>=i.x&&i.x>=v&&s(u<l?f:o,u,v,l,u<l?o:f,u,i.x,i.y)&&((c=Math.abs(u-i.y)/(f-i.x))<a||c===a&&i.x>r.x)&&e(i,n)&&(r=i,a=c),i=i.next;return r}function ut(n,t,i,r){var u=n;do null===u.z&&(u.z=c(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;ft(u)}function ft(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?(r=t,t=t.nextZ,e--):0!==e&&t?i.z<=t.z?(r=i,i=i.nextZ,f--):(r=t,t=t.nextZ,e--):(r=i,i=i.nextZ,f--),u?u.nextZ=r:n=r,r.prevZ=u,u=r;i=t}u.nextZ=null;h*=2}while(s>1);return n}function c(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 et(n){var t=n,i=n;do t.x<i.x&&(i=t),t=t.next;while(t!==n);return i}function s(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 ot(n,t){return n.next.i!==t.i&&n.prev.i!==t.i&&!st(n,t)&&e(n,t)&&e(t,n)&&ht(n,t)}function i(n,t,i){return(t.y-n.y)*(i.x-t.x)-(t.x-n.x)*(i.y-t.y)}function r(n,t){return n.x===t.x&&n.y===t.y}function y(n,t,u,f){return!!(r(n,t)&&r(u,f)||r(n,f)&&r(u,t))||i(n,t,u)>0!=i(n,t,f)>0&&i(u,f,n)>0!=i(u,f,t)>0}function st(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&&y(i,i.next,n,t))return!0;i=i.next}while(i!==n);return!1}function e(n,t){return i(n.prev,n,n.next)<0?i(n,t,n.next)>=0&&i(n,n.prev,t)>=0:i(n,t,n.prev)<0||i(n,n.next,t)<0}function ht(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&&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}function p(n,t){var r=new l(n.i,n.x,n.y),i=new l(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 w(n,t,i,r){var u=new l(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 o(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 l(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 a(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}t.exports=h;h.deviation=function(n,t,i,r){var h=t&&t.length,p=h?t[0]*i:n.length,f=Math.abs(a(n,0,p,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(a(n,c,l,i));for(e=0,u=0;u<r.length;u+=3){var o=r[u]*i,v=r[u+1]*i,y=r[u+2]*i;e+=Math.abs((n[o]-n[y])*(n[v+1]-n[o+1])-(n[o]-n[v])*(n[y+1]-n[o+1]))}return 0===f&&0===e?0:Math.abs((e-f)/f)};h.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}},{}],910:[function(n,t,i){arguments[4][260][0].apply(i,arguments)},{"@turf/helpers":911,dup:260}],911:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],912:[function(n,t){var i=n("@turf/meta"),r=n("@turf/centroid"),u=n("@turf/invariant"),f=n("@turf/rhumb-bearing"),e=n("@turf/rhumb-distance"),o=n("@turf/rhumb-destination"),s=i.coordEach,h=u.getCoords;t.exports=function(n,t,i,u){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:(i||(i=r(n)),!1!==u&&void 0!==u||(n=JSON.parse(JSON.stringify(n))),s(n,function(n){var u=f(i,n),s=u+t,c=e(i,n),r=h(o(i,c,s));n[0]=r[0];n[1]=r[1]}),n)}},{"@turf/centroid":913,"@turf/invariant":916,"@turf/meta":917,"@turf/rhumb-bearing":918,"@turf/rhumb-destination":930,"@turf/rhumb-distance":943}],913:[function(n,t,i){arguments[4][178][0].apply(i,arguments)},{"@turf/helpers":914,"@turf/meta":915,dup:178}],914:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],915:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],916:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],917:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],918:[function(n,t,i){arguments[4][774][0].apply(i,arguments)},{"@turf/invariant":919,dup:774,geodesy:926}],919:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],920:[function(n,t,i){arguments[4][776][0].apply(i,arguments)},{dup:776}],921:[function(n,t,i){arguments[4][777][0].apply(i,arguments)},{"./dms.js":920,"./vector3d.js":929,dup:777}],922:[function(n,t,i){arguments[4][778][0].apply(i,arguments)},{"./dms":920,dup:778}],923:[function(n,t,i){arguments[4][779][0].apply(i,arguments)},{"./dms.js":920,"./vector3d.js":929,dup:779}],924:[function(n,t,i){arguments[4][780][0].apply(i,arguments)},{"./latlon-ellipsoidal.js":921,dup:780}],925:[function(n,t,i){arguments[4][781][0].apply(i,arguments)},{"./latlon-ellipsoidal.js":921,"./utm.js":928,dup:781}],926:[function(n,t,i){arguments[4][782][0].apply(i,arguments)},{"./dms.js":920,"./latlon-ellipsoidal.js":921,"./latlon-spherical.js":922,"./latlon-vectors.js":923,"./latlon-vincenty.js":924,"./mgrs.js":925,"./osgridref.js":927,"./utm.js":928,"./vector3d.js":929,dup:782}],927:[function(n,t,i){arguments[4][783][0].apply(i,arguments)},{"./latlon-ellipsoidal.js":921,dup:783}],928:[function(n,t,i){arguments[4][784][0].apply(i,arguments)},{"./latlon-ellipsoidal.js":921,dup:784}],929:[function(n,t,i){arguments[4][785][0].apply(i,arguments)},{dup:785}],930:[function(n,t,i){arguments[4][839][0].apply(i,arguments)},{"@turf/helpers":931,"@turf/invariant":932,dup:839,geodesy:939}],931:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],932:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],933:[function(n,t,i){arguments[4][776][0].apply(i,arguments)},{dup:776}],934:[function(n,t,i){arguments[4][777][0].apply(i,arguments)},{"./dms.js":933,"./vector3d.js":942,dup:777}],935:[function(n,t,i){arguments[4][778][0].apply(i,arguments)},{"./dms":933,dup:778}],936:[function(n,t,i){arguments[4][779][0].apply(i,arguments)},{"./dms.js":933,"./vector3d.js":942,dup:779}],937:[function(n,t,i){arguments[4][780][0].apply(i,arguments)},{"./latlon-ellipsoidal.js":934,dup:780}],938:[function(n,t,i){arguments[4][781][0].apply(i,arguments)},{"./latlon-ellipsoidal.js":934,"./utm.js":941,dup:781}],939:[function(n,t,i){arguments[4][782][0].apply(i,arguments)},{"./dms.js":933,"./latlon-ellipsoidal.js":934,"./latlon-spherical.js":935,"./latlon-vectors.js":936,"./latlon-vincenty.js":937,"./mgrs.js":938,"./osgridref.js":940,"./utm.js":941,"./vector3d.js":942,dup:782}],940:[function(n,t,i){arguments[4][783][0].apply(i,arguments)},{"./latlon-ellipsoidal.js":934,dup:783}],941:[function(n,t,i){arguments[4][784][0].apply(i,arguments)},{"./latlon-ellipsoidal.js":934,dup:784}],942:[function(n,t,i){arguments[4][785][0].apply(i,arguments)},{dup:785}],943:[function(n,t,i){arguments[4][786][0].apply(i,arguments)},{"@turf/helpers":944,"@turf/invariant":945,dup:786,geodesy:952}],944:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],945:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],946:[function(n,t,i){arguments[4][776][0].apply(i,arguments)},{dup:776}],947:[function(n,t,i){arguments[4][777][0].apply(i,arguments)},{"./dms.js":946,"./vector3d.js":955,dup:777}],948:[function(n,t,i){arguments[4][778][0].apply(i,arguments)},{"./dms":946,dup:778}],949:[function(n,t,i){arguments[4][779][0].apply(i,arguments)},{"./dms.js":946,"./vector3d.js":955,dup:779}],950:[function(n,t,i){arguments[4][780][0].apply(i,arguments)},{"./latlon-ellipsoidal.js":947,dup:780}],951:[function(n,t,i){arguments[4][781][0].apply(i,arguments)},{"./latlon-ellipsoidal.js":947,"./utm.js":954,dup:781}],952:[function(n,t,i){arguments[4][782][0].apply(i,arguments)},{"./dms.js":946,"./latlon-ellipsoidal.js":947,"./latlon-spherical.js":948,"./latlon-vectors.js":949,"./latlon-vincenty.js":950,"./mgrs.js":951,"./osgridref.js":953,"./utm.js":954,"./vector3d.js":955,dup:782}],953:[function(n,t,i){arguments[4][783][0].apply(i,arguments)},{"./latlon-ellipsoidal.js":947,dup:783}],954:[function(n,t,i){arguments[4][784][0].apply(i,arguments)},{"./latlon-ellipsoidal.js":947,dup:784}],955:[function(n,t,i){arguments[4][785][0].apply(i,arguments)},{dup:785}],956:[function(n,t){function u(n,t,i){var r="Point"===d(n);return i=e(n,i),1===t||r?n:(p(n,function(n){var u=v(i,n),f=a(i,n),e=u*t,r=k(y(i,e,f));n[0]=r[0];n[1]=r[1];3===n.length&&(n[2]*=t)}),n)}function e(n,t){if(void 0!==t&&null!==t||(t="centroid"),Array.isArray(t)||"object"==typeof t)return b(t);var r=n.bbox?n.bbox:l(n),u=r[0],f=r[1],e=r[2],o=r[3];switch(t){case"sw":case"southwest":case"westsouth":case"bottomleft":return i([u,f]);case"se":case"southeast":case"eastsouth":case"bottomright":return i([e,f]);case"nw":case"northwest":case"westnorth":case"topleft":return i([u,o]);case"ne":case"northeast":case"eastnorth":case"topright":return i([e,o]);case"center":return s(n);case void 0:case null:case"centroid":return c(n);default:throw new Error("invalid origin");}}var f=n("@turf/meta"),o=n("@turf/clone"),s=n("@turf/center"),h=n("@turf/helpers"),c=n("@turf/centroid"),l=n("@turf/bbox"),r=n("@turf/invariant"),a=n("@turf/rhumb-bearing"),v=n("@turf/rhumb-distance"),y=n("@turf/rhumb-destination"),i=h.point,p=f.coordEach,w=f.featureEach,b=r.getCoord,k=r.getCoords,d=r.getGeomType;t.exports=function(n,t,i,r){if(!n)throw new Error("geojson required");if("number"!=typeof t||0===t)throw new Error("invalid factor");var f=Array.isArray(i)||"object"==typeof i;return!0!==r&&(n=o(n)),"FeatureCollection"!==n.type||f?u(n,t,i):(w(n,function(r,f){n.features[f]=u(r,t,i)}),n)}},{"@turf/bbox":957,"@turf/center":959,"@turf/centroid":963,"@turf/clone":966,"@turf/helpers":967,"@turf/invariant":968,"@turf/meta":969,"@turf/rhumb-bearing":970,"@turf/rhumb-destination":982,"@turf/rhumb-distance":995}],957:[function(n,t,i){arguments[4][22][0].apply(i,arguments)},{"@turf/meta":958,dup:22}],958:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],959:[function(n,t,i){arguments[4][168][0].apply(i,arguments)},{"@turf/bbox":960,"@turf/helpers":962,dup:168}],960:[function(n,t,i){arguments[4][22][0].apply(i,arguments)},{"@turf/meta":961,dup:22}],961:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],962:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],963:[function(n,t,i){arguments[4][178][0].apply(i,arguments)},{"@turf/helpers":964,"@turf/meta":965,dup:178}],964:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],965:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],966:[function(n,t,i){arguments[4][221][0].apply(i,arguments)},{dup:221}],967:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],968:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],969:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],970:[function(n,t,i){arguments[4][774][0].apply(i,arguments)},{"@turf/invariant":971,dup:774,geodesy:978}],971:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],972:[function(n,t,i){arguments[4][776][0].apply(i,arguments)},{dup:776}],973:[function(n,t,i){arguments[4][777][0].apply(i,arguments)},{"./dms.js":972,"./vector3d.js":981,dup:777}],974:[function(n,t,i){arguments[4][778][0].apply(i,arguments)},{"./dms":972,dup:778}],975:[function(n,t,i){arguments[4][779][0].apply(i,arguments)},{"./dms.js":972,"./vector3d.js":981,dup:779}],976:[function(n,t,i){arguments[4][780][0].apply(i,arguments)},{"./latlon-ellipsoidal.js":973,dup:780}],977:[function(n,t,i){arguments[4][781][0].apply(i,arguments)},{"./latlon-ellipsoidal.js":973,"./utm.js":980,dup:781}],978:[function(n,t,i){arguments[4][782][0].apply(i,arguments)},{"./dms.js":972,"./latlon-ellipsoidal.js":973,"./latlon-spherical.js":974,"./latlon-vectors.js":975,"./latlon-vincenty.js":976,"./mgrs.js":977,"./osgridref.js":979,"./utm.js":980,"./vector3d.js":981,dup:782}],979:[function(n,t,i){arguments[4][783][0].apply(i,arguments)},{"./latlon-ellipsoidal.js":973,dup:783}],980:[function(n,t,i){arguments[4][784][0].apply(i,arguments)},{"./latlon-ellipsoidal.js":973,dup:784}],981:[function(n,t,i){arguments[4][785][0].apply(i,arguments)},{dup:785}],982:[function(n,t,i){arguments[4][839][0].apply(i,arguments)},{"@turf/helpers":983,"@turf/invariant":984,dup:839,geodesy:991}],983:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],984:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],985:[function(n,t,i){arguments[4][776][0].apply(i,arguments)},{dup:776}],986:[function(n,t,i){arguments[4][777][0].apply(i,arguments)},{"./dms.js":985,"./vector3d.js":994,dup:777}],987:[function(n,t,i){arguments[4][778][0].apply(i,arguments)},{"./dms":985,dup:778}],988:[function(n,t,i){arguments[4][779][0].apply(i,arguments)},{"./dms.js":985,"./vector3d.js":994,dup:779}],989:[function(n,t,i){arguments[4][780][0].apply(i,arguments)},{"./latlon-ellipsoidal.js":986,dup:780}],990:[function(n,t,i){arguments[4][781][0].apply(i,arguments)},{"./latlon-ellipsoidal.js":986,"./utm.js":993,dup:781}],991:[function(n,t,i){arguments[4][782][0].apply(i,arguments)},{"./dms.js":985,"./latlon-ellipsoidal.js":986,"./latlon-spherical.js":987,"./latlon-vectors.js":988,"./latlon-vincenty.js":989,"./mgrs.js":990,"./osgridref.js":992,"./utm.js":993,"./vector3d.js":994,dup:782}],992:[function(n,t,i){arguments[4][783][0].apply(i,arguments)},{"./latlon-ellipsoidal.js":986,dup:783}],993:[function(n,t,i){arguments[4][784][0].apply(i,arguments)},{"./latlon-ellipsoidal.js":986,dup:784}],994:[function(n,t,i){arguments[4][785][0].apply(i,arguments)},{dup:785}],995:[function(n,t,i){arguments[4][786][0].apply(i,arguments)},{"@turf/helpers":996,"@turf/invariant":997,dup:786,geodesy:1004}],996:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],997:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],998:[function(n,t,i){arguments[4][776][0].apply(i,arguments)},{dup:776}],999:[function(n,t,i){arguments[4][777][0].apply(i,arguments)},{"./dms.js":998,"./vector3d.js":1007,dup:777}],1e3:[function(n,t,i){arguments[4][778][0].apply(i,arguments)},{"./dms":998,dup:778}],1001:[function(n,t,i){arguments[4][779][0].apply(i,arguments)},{"./dms.js":998,"./vector3d.js":1007,dup:779}],1002:[function(n,t,i){arguments[4][780][0].apply(i,arguments)},{"./latlon-ellipsoidal.js":999,dup:780}],1003:[function(n,t,i){arguments[4][781][0].apply(i,arguments)},{"./latlon-ellipsoidal.js":999,"./utm.js":1006,dup:781}],1004:[function(n,t,i){arguments[4][782][0].apply(i,arguments)},{"./dms.js":998,"./latlon-ellipsoidal.js":999,"./latlon-spherical.js":1e3,"./latlon-vectors.js":1001,"./latlon-vincenty.js":1002,"./mgrs.js":1003,"./osgridref.js":1005,"./utm.js":1006,"./vector3d.js":1007,dup:782}],1005:[function(n,t,i){arguments[4][783][0].apply(i,arguments)},{"./latlon-ellipsoidal.js":999,dup:783}],1006:[function(n,t,i){arguments[4][784][0].apply(i,arguments)},{"./latlon-ellipsoidal.js":999,dup:784}],1007:[function(n,t,i){arguments[4][785][0].apply(i,arguments)},{dup:785}],1008:[function(n,t){var i=n("@turf/meta"),r=n("@turf/invariant"),u=n("@turf/rhumb-destination"),f=i.coordEach,e=r.getCoords;t.exports=function(n,t,i,r,o,s){if(!n)throw new Error("geojson is required");if(void 0===t||null===t||isNaN(t))throw new Error("distance is required");if(o&&"number"!=typeof o&&isNaN(o))throw new Error("zTranslation is not a number");if(o=void 0!==o?o:0,0===t&&0===o)return n;if(void 0===i||null===i||isNaN(i))throw new Error("direction is required");return t<0&&(t=-t,i=-i),!1!==s&&void 0!==s||(n=JSON.parse(JSON.stringify(n))),f(n,function(n){var f=e(u(n,t,i,r));n[0]=f[0];n[1]=f[1];o&&3===n.length&&(n[2]+=o)}),n}},{"@turf/invariant":1009,"@turf/meta":1010,"@turf/rhumb-destination":1011}],1009:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],1010:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],1011:[function(n,t,i){arguments[4][839][0].apply(i,arguments)},{"@turf/helpers":1012,"@turf/invariant":1013,dup:839,geodesy:1020}],1012:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],1013:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],1014:[function(n,t,i){arguments[4][776][0].apply(i,arguments)},{dup:776}],1015:[function(n,t,i){arguments[4][777][0].apply(i,arguments)},{"./dms.js":1014,"./vector3d.js":1023,dup:777}],1016:[function(n,t,i){arguments[4][778][0].apply(i,arguments)},{"./dms":1014,dup:778}],1017:[function(n,t,i){arguments[4][779][0].apply(i,arguments)},{"./dms.js":1014,"./vector3d.js":1023,dup:779}],1018:[function(n,t,i){arguments[4][780][0].apply(i,arguments)},{"./latlon-ellipsoidal.js":1015,dup:780}],1019:[function(n,t,i){arguments[4][781][0].apply(i,arguments)},{"./latlon-ellipsoidal.js":1015,"./utm.js":1022,dup:781}],1020:[function(n,t,i){arguments[4][782][0].apply(i,arguments)},{"./dms.js":1014,"./latlon-ellipsoidal.js":1015,"./latlon-spherical.js":1016,"./latlon-vectors.js":1017,"./latlon-vincenty.js":1018,"./mgrs.js":1019,"./osgridref.js":1021,"./utm.js":1022,"./vector3d.js":1023,dup:782}],1021:[function(n,t,i){arguments[4][783][0].apply(i,arguments)},{"./latlon-ellipsoidal.js":1015,dup:783}],1022:[function(n,t,i){arguments[4][784][0].apply(i,arguments)},{"./latlon-ellipsoidal.js":1015,dup:784}],1023:[function(n,t,i){arguments[4][785][0].apply(i,arguments)},{dup:785}],1024:[function(n,t,i){arguments[4][449][0].apply(i,arguments)},{"@turf/distance":1025,"@turf/helpers":1028,dup:449}],1025:[function(n,t,i){arguments[4][8][0].apply(i,arguments)},{"@turf/helpers":1026,"@turf/invariant":1027,dup:8}],1026:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],1027:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],1028:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],1029:[function(n,t,i){arguments[4][455][0].apply(i,arguments)},{"@turf/meta":1030,dup:455}],1030:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],1031:[function(n,t,i){arguments[4][367][0].apply(i,arguments)},{dup:367,jsts:1032}],1032:[function(n,t,i){arguments[4][176][0].apply(i,arguments)},{dup:176}],1033:[function(n,t){var i=n("@turf/meta"),r=n("@turf/helpers"),u=n("simplepolygon"),f=i.flattenEach,e=i.featureEach,o=r.polygon,s=r.featureCollection;t.exports=function(n){var t=[];return f(n,function(n){"Polygon"===n.geometry.type&&e(u(n),function(i){t.push(o(i.geometry.coordinates,n.properties))})}),s(t)}},{"@turf/helpers":1036,"@turf/meta":1039,simplepolygon:1046}],1034:[function(n,t,i){arguments[4][13][0].apply(i,arguments)},{dup:13,wgs84:1047}],1035:[function(n,t,i){arguments[4][461][0].apply(i,arguments)},{"@mapbox/geojson-area":1034,"@turf/meta":1039,dup:461}],1036:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],1037:[function(n,t,i){arguments[4][36][0].apply(i,arguments)},{"@turf/invariant":1038,dup:36}],1038:[function(n,t,i){arguments[4][469][0].apply(i,arguments)},{dup:469}],1039:[function(n,t,i){arguments[4][14][0].apply(i,arguments)},{dup:14}],1040:[function(n,t,i){(function(r){function f(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function e(n){var t=this.useColors,r,u,f;(n[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+n[0]+(t?"%c ":" ")+"+"+i.humanize(this.diff),t)&&(r="color: "+this.color,n.splice(1,0,r,"color: inherit"),u=0,f=0,n[0].replace(/%[a-zA-Z%]/g,function(n){"%%"!==n&&(u++,"%c"===n&&(f=u))}),n.splice(f,0,r))}function o(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function s(n){try{null==n?i.storage.removeItem("debug"):i.storage.debug=n}catch(n){}}function u(){var n;try{n=i.storage.debug}catch(n){}return!n&&void 0!==r&&"env"in r&&(n=r.env.DEBUG),n}i=t.exports=n("./debug");i.log=o;i.formatArgs=e;i.save=s;i.load=u;i.useColors=f;i.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(n){}}();i.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"];i.formatters.j=function(n){try{return JSON.stringify(n)}catch(n){return"[UnexpectedJSONParseError]: "+n.message}};i.enable(u())}).call(this,n("_process"))},{"./debug":1041,_process:1052}],1041:[function(n,t,i){function f(n){var r,t=0;for(r in n)t=(t<<5)-t+n.charCodeAt(r),t|=0;return i.colors[Math.abs(t)%i.colors.length]}function r(n){function t(){var n,f,e;if(t.enabled){var r=t,o=+new Date,s=o-(u||o);for(r.diff=s,r.prev=u,r.curr=o,u=o,n=new Array(arguments.length),f=0;f<n.length;f++)n[f]=arguments[f];n[0]=i.coerce(n[0]);"string"!=typeof n[0]&&n.unshift("%O");e=0;n[0]=n[0].replace(/%([a-zA-Z%])/g,function(t,u){var f,o;return"%%"===t?t:(e++,f=i.formatters[u],"function"==typeof f&&(o=n[e],t=f.call(r,o),n.splice(e,1),e--),t)});i.formatArgs.call(r,n);(t.log||i.log||console.log.bind(console)).apply(r,n)}}return t.namespace=n,t.enabled=i.enabled(n),t.useColors=i.useColors(),t.color=f(n),"function"==typeof i.init&&i.init(t),t}function e(n){i.save(n);i.names=[];i.skips=[];for(var r=("string"==typeof n?n:"").split(/[\s,]+/),u=r.length,t=0;t<u;t++)r[t]&&(n=r[t].replace(/\*/g,".*?"),"-"===n[0]?i.skips.push(new RegExp("^"+n.substr(1)+"$")):i.names.push(new RegExp("^"+n+"$")))}function o(){i.enable("")}function s(n){for(var t=0,r=i.skips.length;t<r;t++)if(i.skips[t].test(n))return!1;for(t=0,r=i.names.length;t<r;t++)if(i.names[t].test(n))return!0;return!1}function h(n){return n instanceof Error?n.stack||n.message:n}i=t.exports=r.debug=r.default=r;i.coerce=h;i.disable=o;i.enable=e;i.enabled=s;i.humanize=n("ms");i.names=[];i.skips=[];i.formatters={};var u},{ms:1043}],1042:[function(n,t){function r(n,t,r,u){if(i(n,r)||i(n,u)||i(t,r)||i(u,r))return null;var f=n[0],e=n[1],o=t[0],s=t[1],h=r[0],c=r[1],l=u[0],a=u[1],v=(f-o)*(c-a)-(e-s)*(h-l);return 0==v?null:[((f*s-e*o)*(h-l)-(f-o)*(h*a-c*l))/v,((f*s-e*o)*(c-a)-(e-s)*(h*a-c*l))/v]}function i(n,t){if(!n||!t||n.length!=t.length)return!1;for(var r=0,u=n.length;r<u;r++)if(n[r]instanceof Array&&t[r]instanceof Array){if(!i(n[r],t[r]))return!1}else if(n[r]!=t[r])return!1;return!0}var u=n("rbush");t.exports=function(n,t,i){function v(n,i,u,f){var h=e[n][i],l=e[n][i+1],c=e[u][f],a=e[u][f+1],o=r(h,l,c,a),v,y,w,b;null!=o&&(v=l[0]!=h[0]?(o[0]-h[0])/(l[0]-h[0]):(o[1]-h[1])/(l[1]-h[1]),y=a[0]!=c[0]?(o[0]-c[0])/(a[0]-c[0]):(o[1]-c[1])/(a[1]-c[1]),v>=1||v<=0||y>=1||y<=0||(w=o,b=!p[w],b&&(p[w]=!0),t?s.push(t(o,n,i,h,l,v,u,f,c,a,y,b)):s.push(o)))}function y(n,t){var i=e[n][t],r=e[n][t+1],u,f,o,s;return i[0]<r[0]?(u=i[0],f=r[0]):(u=r[0],f=i[0]),i[1]<r[1]?(o=i[1],s=r[1]):(o=r[1],s=i[1]),{minX:u,minY:o,maxX:f,maxY:s,ring:n,edge:t}}var l,a,f,o,w,h,c;if("Polygon"!=n.geometry.type)throw new Error("The input feature must be a Polygon");void 0==i&&(i=1);var e=n.geometry.coordinates,s=[],p={};if(i){for(l=[],f=0;f<e.length;f++)for(o=0;o<e[f].length-1;o++)l.push(y(f,o));a=u();a.load(l)}for(f=0;f<e.length;f++)for(o=0;o<e[f].length-1;o++)if(i)w=a.search(y(f,o)),w.forEach(function(n){var t=n.ring,i=n.edge;v(f,o,t,i)});else for(h=0;h<e.length;h++)for(c=0;c<e[h].length-1;c++)v(f,o,h,c);return t||(s={type:"Feature",geometry:{type:"MultiPoint",coordinates:s}}),s}},{rbush:1045}],1043:[function(n,t){function o(n){var e,t;if((n=String(n),!(n.length>100))&&(e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(n),e)){t=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return t*c;case"days":case"day":case"d":return t*f;case"hours":case"hour":case"hrs":case"hr":case"h":return t*u;case"minutes":case"minute":case"mins":case"min":case"m":return t*r;case"seconds":case"second":case"secs":case"sec":case"s":return t*i;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}function s(n){return n>=f?Math.round(n/f)+"d":n>=u?Math.round(n/u)+"h":n>=r?Math.round(n/r)+"m":n>=i?Math.round(n/i)+"s":n+"ms"}function h(n){return e(n,f,"day")||e(n,u,"hour")||e(n,r,"minute")||e(n,i,"second")||n+" ms"}function e(n,t,i){if(!(n<t))return n<1.5*t?Math.floor(n/t)+" "+i:Math.ceil(n/t)+" "+i+"s"}var i=1e3,r=60*i,u=60*r,f=24*u,c=365.25*f;t.exports=function(n,t){t=t||{};var i=typeof n;if("string"===i&&n.length>0)return o(n);if("number"===i&&!1===isNaN(n))return t.long?h(n):s(n);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(n));}},{}],1044:[function(n,t,i){arguments[4][56][0].apply(i,arguments)},{dup:56}],1045:[function(n,t,i){arguments[4][57][0].apply(i,arguments)},{dup:57,quickselect:1044}],1046:[function(n,t){function e(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 h(n){for(var r,t=0,i=0;i<n.length-1;i++)n[i][0]<n[t][0]&&(t=i);return e([n[(t-1).modulo(n.length-1)],n[t],n[(t+1).modulo(n.length-1)]],!0)?1:-1}function u(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(!u(n[i],t[i]))return!1}else if(n[i]!=t[i])return!1;return!0}function c(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}var l=n("geojson-polygon-self-intersections"),f=n("@turf/helpers"),a=n("@turf/inside"),v=n("@turf/area"),y=n("rbush"),r=n("debug")("simplepolygon"),i=n("debug")("simplepolygon:all"),o,s;t.exports=function(n){function ii(){for(var u,r,t=[],n=0;n<d.features.length;n++)i("Output ring "+n+" has parent "+d.features[n].properties.parent),-1==d.features[n].properties.parent&&t.push(n);if(i("The following output ring(s) have no parent: "+t),t.length>1)for(n=0;n<t.length;n++){for(u=-1,r=0;r<d.features.length;r++)t[n]!=r&&a(f.point(d.features[t[n]].geometry.coordinates[0][0]),d.features[r],!0)&&v(d.features[r])<1/0&&(u=r,i("Ring "+t[n]+" lies inside output ring "+r));d.features[t[n]].properties.parent=u;i("Ring "+t[n]+" is assigned parent "+u)}}function ri(){for(var t,n=0;n<d.features.length;n++)-1==d.features[n].properties.parent&&(t=d.features[n].properties.winding,d.features[n].properties.netWinding=t,ui(n,t))}function ui(n,t){for(var r,i=0;i<d.features.length;i++)d.features[i].properties.parent==n&&(r=t+d.features[i].properties.winding,d.features[i].properties.netWinding=r,ui(i,r))}var ot,bt,nt,kt,fi,yt,rt,pt,w,st,ei,k,oi,si,et,ct,ft,b,wt,t,tt,d;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 at=n.geometry.coordinates.length,vt=[],t=0;t<at;t++)ot=n.geometry.coordinates[t],u(ot[0],ot[ot.length-1])||ot.push(ot[0]),vt.push.apply(vt,ot.slice(0,ot.length-1));if(!c(vt))throw new Error("The input polygon may not have duplicate vertices (except for the first and last vertex of each ring)");if(bt=vt.length,r("Processing input"),nt=l(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]}),kt=nt.length,r("Computing self-intersections"),0==kt){for(et=[],t=0;t<at;t++)et.push(f.polygon([n.geometry.coordinates[t]],{parent:-1,winding:h(n.geometry.coordinates[t])}));return d=f.featureCollection(et),ii(),ri(),i("No self-intersections found. Input rings are output rings. Computed winding numbers, net winding numbers and parents"),r("Finishing without self-intersections"),d}for(var g=[],p=[],t=0;t<at;t++)for(g.push([]),w=0;w<n.geometry.coordinates[t].length-1;w++)g[t].push([new o(n.geometry.coordinates[t][(w+1).modulo(n.geometry.coordinates[t].length-1)],1,[t,w],[t,(w+1).modulo(n.geometry.coordinates[t].length-1)],void 0)]),p.push(new s(n.geometry.coordinates[t][w],[t,(w-1).modulo(n.geometry.coordinates[t].length-1)],[t,w],void 0,void 0,!1,!0));for(t=0;t<kt;t++)g[nt[t][1]][nt[t][2]].push(new o(nt[t][0],nt[t][5],[nt[t][1],nt[t][2]],[nt[t][6],nt[t][7]],void 0)),nt[t][11]&&p.push(new s(nt[t][0],[nt[t][1],nt[t][2]],[nt[t][6],nt[t][7]],void 0,void 0,!0,!0));for(fi=p.length,t=0;t<g.length;t++)for(w=0;w<g[t].length;w++)g[t][w].sort(function(n,t){return n.param<t.param?-1:1});for(r("Setting up pseudoVtxListByRingAndEdge and isectList"),allIsectsAsIsectRbushTreeItem=[],t=0;t<fi;t++)allIsectsAsIsectRbushTreeItem.push({minX:p[t].coord[0],minY:p[t].coord[1],maxX:p[t].coord[0],maxY:p[t].coord[1],index:t});for(yt=y(),yt.load(allIsectsAsIsectRbushTreeItem),t=0;t<g.length;t++)for(w=0;w<g[t].length;w++)for(k=0;k<g[t][w].length;k++)rt=k==g[t][w].length-1?g[t][(w+1).modulo(n.geometry.coordinates[t].length-1)][0].coord:g[t][w][k+1].coord,pt=yt.search({minX:rt[0],minY:rt[1],maxX:rt[0],maxY:rt[1]})[0],g[t][w][k].nxtIsectAlongEdgeIn=pt.index;for(r("Computing nextIsect for pseudoVtxListByRingAndEdge"),t=0;t<g.length;t++)for(w=0;w<g[t].length;w++)for(k=0;k<g[t][w].length;k++){var rt=g[t][w][k].coord,pt=yt.search({minX:rt[0],minY:rt[1],maxX:rt[0],maxY:rt[1]})[0],lt=pt.index;lt<bt?p[lt].nxtIsectAlongRingAndEdge2=g[t][w][k].nxtIsectAlongEdgeIn:u(p[lt].ringAndEdge1,g[t][w][k].ringAndEdgeIn)?p[lt].nxtIsectAlongRingAndEdge1=g[t][w][k].nxtIsectAlongEdgeIn:p[lt].nxtIsectAlongRingAndEdge2=g[t][w][k].nxtIsectAlongEdgeIn}r("Porting nextIsect to isectList");for(var it=[],t=0,w=0;w<at;w++){for(st=t,k=0;k<n.geometry.coordinates[w].length-1;k++)p[t].coord[0]<p[st].coord[0]&&(st=t),t++;for(ei=p[st].nxtIsectAlongRingAndEdge2,k=0;k<p.length;k++)if(p[k].nxtIsectAlongRingAndEdge1==st||p[k].nxtIsectAlongRingAndEdge2==st){oi=k;break}si=e([p[oi].coord,p[st].coord,p[ei].coord],!0)?1:-1;it.push({isect:st,parent:-1,winding:si})}for(it.sort(function(n,t){return p[n.isect].coord>p[t.isect].coord?-1:1}),i("Initial state of the queue: "+JSON.stringify(it)),r("Setting up queue"),et=[];it.length>0;){var dt=it.pop(),ut=dt.isect,gt=dt.parent,ht=dt.winding,ni=et.length,ti=[p[ut].coord];for(i("# Starting output ring number "+et.length+" with winding "+ht+" from intersection "+ut),ut<bt&&i("This is a ring-vertex-intersections, which means this output ring does not touch existing output rings"),ct=ut,p[ut].ringAndEdge1Walkable?(ft=p[ut].ringAndEdge1,b=p[ut].nxtIsectAlongRingAndEdge1):(ft=p[ut].ringAndEdge2,b=p[ut].nxtIsectAlongRingAndEdge2);!u(p[ut].coord,p[b].coord);){for(i("Walking from intersection "+ct+" to "+b+" over ring "+ft[0]+" and edge "+ft[1]),ti.push(p[b].coord),i("Adding intersection "+b+" to current output ring"),wt=void 0,t=0;t<it.length;t++)if(it[t].isect==b){wt=t;break}(void 0!=wt&&(i("Removing intersection "+b+" from queue"),it.splice(wt,1)),u(ft,p[b].ringAndEdge1))?((ft=p[b].ringAndEdge2,p[b].ringAndEdge2Walkable=!1,p[b].ringAndEdge1Walkable)&&(i("Adding intersection "+b+" to queue"),tt={isect:b},e([p[ct].coord,p[b].coord,p[p[b].nxtIsectAlongRingAndEdge2].coord],1==ht)?(tt.parent=gt,tt.winding=-ht):(tt.parent=ni,tt.winding=ht),it.push(tt)),ct=b,b=p[b].nxtIsectAlongRingAndEdge2):((ft=p[b].ringAndEdge1,p[b].ringAndEdge1Walkable=!1,p[b].ringAndEdge2Walkable)&&(i("Adding intersection "+b+" to queue"),tt={isect:b},e([p[ct].coord,p[b].coord,p[p[b].nxtIsectAlongRingAndEdge1].coord],1==ht)?(tt.parent=gt,tt.winding=-ht):(tt.parent=ni,tt.winding=ht),it.push(tt)),ct=b,b=p[b].nxtIsectAlongRingAndEdge1);i("Current state of the queue: "+JSON.stringify(it))}i("Walking from intersection "+ct+" to "+b+" over ring "+ft[0]+" and edge "+ft[1]+" and closing ring");ti.push(p[b].coord);et.push(f.polygon([ti],{index:ni,parent:gt,winding:ht,netWinding:void 0}))}return d=f.featureCollection(et),r("Walking"),ii(),r("Determining parents"),ri(),r("Setting winding number"),i("# Total of "+d.features.length+" rings"),d};o=function(n,t,i,r,u){this.coord=n;this.param=t;this.ringAndEdgeIn=i;this.ringAndEdgeOut=r;this.nxtIsectAlongEdgeIn=u};s=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}},{"@turf/area":1035,"@turf/helpers":1036,"@turf/inside":1037,debug:1040,"geojson-polygon-self-intersections":1042,rbush:1045}],1047:[function(n,t,i){arguments[4][15][0].apply(i,arguments)},{dup:15}],1048:[function(n,t){var i=n("@turf/inside"),r=n("@turf/helpers").featureCollection;t.exports=function(n,t){for(var u,o,e=r([]),f=0;f<t.features.length;f++)for(u=0;u<n.features.length;u++)o=i(n.features[u],t.features[f]),o&&e.features.push(n.features[u]);return e}},{"@turf/helpers":1049,"@turf/inside":1050}],1049:[function(n,t,i){arguments[4][6][0].apply(i,arguments)},{dup:6}],1050:[function(n,t,i){arguments[4][36][0].apply(i,arguments)},{"@turf/invariant":1051,dup:36}],1051:[function(n,t,i){arguments[4][4][0].apply(i,arguments)},{dup:4}],1052:[function(n,t){function e(){var i,n,t;if(!f){for(f=!0,n=u.length;n;){for(i=u,u=[],t=-1;++t<n;)i[t]();n=u.length}f=!1}}function r(){}var i=t.exports={},u=[],f=!1;i.nextTick=function(n){u.push(n);f||setTimeout(e,0)};i.title="browser";i.browser=!0;i.env={};i.argv=[];i.version="";i.versions={};i.on=r;i.addListener=r;i.once=r;i.off=r;i.removeListener=r;i.removeAllListeners=r;i.emit=r;i.binding=function(){throw new Error("process.binding is not supported");};i.cwd=function(){return"/"};i.chdir=function(){throw new Error("process.chdir is not supported");};i.umask=function(){return 0}},{}]},{},[1])(1)});CryptoJS=CryptoJS||function(n,t){var h=Object.create||function(){function n(){}return function(t){var i;return n.prototype=t,i=new n,n.prototype=null,i}}(),u={},f=u.lib={},i=f.Base=function(){return{extend:function(n){var t=h(this);return n&&t.mixIn(n),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var n=this.extend();return n.init.apply(n,arguments),n},init:function(){},mixIn:function(n){for(var t in n)n.hasOwnProperty(t)&&(this[t]=n[t]);n.hasOwnProperty("toString")&&(this.toString=n.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),r=f.WordArray=i.extend({init:function(n,i){n=this.words=n||[];this.sigBytes=i!=t?i:n.length*4},toString:function(n){return(n||c).stringify(this)},concat:function(n){var u=this.words,f=n.words,i=this.sigBytes,r=n.sigBytes,e,t;if(this.clamp(),i%4)for(t=0;t<r;t++)e=f[t>>>2]>>>24-t%4*8&255,u[i+t>>>2]|=e<<24-(i+t)%4*8;else for(t=0;t<r;t+=4)u[i+t>>>2]=f[t>>>2];return this.sigBytes+=r,this},clamp:function(){var i=this.words,t=this.sigBytes;i[t>>>2]&=4294967295<<32-t%4*8;i.length=n.ceil(t/4)},clone:function(){var n=i.clone.call(this);return n.words=this.words.slice(0),n},random:function(t){for(var f=[],o=function(t){var t=t,i=987654321,r=4294967295;return function(){i=36969*(i&65535)+(i>>16)&r;t=18e3*(t&65535)+(t>>16)&r;var u=(i<<16)+t&r;return u/=4294967296,u+=.5,u*(n.random()>.5?1:-1)}},e,u,i=0;i<t;i+=4)u=o((e||n.random())*4294967296),e=u()*987654071,f.push(u()*4294967296|0);return new r.init(f,t)}}),e=u.enc={},c=e.Hex={stringify:function(n){for(var u=n.words,f=n.sigBytes,i=[],r,t=0;t<f;t++)r=u[t>>>2]>>>24-t%4*8&255,i.push((r>>>4).toString(16)),i.push((r&15).toString(16));return i.join("")},parse:function(n){for(var i=n.length,u=[],t=0;t<i;t+=2)u[t>>>3]|=parseInt(n.substr(t,2),16)<<24-t%8*4;return new r.init(u,i/2)}},o=e.Latin1={stringify:function(n){for(var u=n.words,f=n.sigBytes,i=[],r,t=0;t<f;t++)r=u[t>>>2]>>>24-t%4*8&255,i.push(String.fromCharCode(r));return i.join("")},parse:function(n){for(var i=n.length,u=[],t=0;t<i;t++)u[t>>>2]|=(n.charCodeAt(t)&255)<<24-t%4*8;return new r.init(u,i)}},l=e.Utf8={stringify:function(n){try{return decodeURIComponent(escape(o.stringify(n)))}catch(t){throw new Error("Malformed UTF-8 data");}},parse:function(n){return o.parse(unescape(encodeURIComponent(n)))}},s=f.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new r.init;this._nDataBytes=0},_append:function(n){typeof n=="string"&&(n=l.parse(n));this._data.concat(n);this._nDataBytes+=n.sigBytes},_process:function(t){var e=this._data,h=e.words,c=e.sigBytes,o=this.blockSize,a=o*4,u=c/a,i,s,f,l;if(u=t?n.ceil(u):n.max((u|0)-this._minBufferSize,0),i=u*o,s=n.min(i*4,c),i){for(f=0;f<i;f+=o)this._doProcessBlock(h,f);l=h.splice(0,i);e.sigBytes-=s}return new r.init(l,s)},clone:function(){var n=i.clone.call(this);return n._data=this._data.clone(),n},_minBufferSize:0}),v=f.Hasher=s.extend({cfg:i.extend(),init:function(n){this.cfg=this.cfg.extend(n);this.reset()},reset:function(){s.reset.call(this);this._doReset()},update:function(n){return this._append(n),this._process(),this},finalize:function(n){n&&this._append(n);return this._doFinalize()},blockSize:16,_createHelper:function(n){return function(t,i){return new n.init(i).finalize(t)}},_createHmacHelper:function(n){return function(t,i){return new a.HMAC.init(n,i).finalize(t)}}}),a=u.algo={};return u}(Math),function(){if(typeof ArrayBuffer=="function"){var i=CryptoJS,r=i.lib,n=r.WordArray,t=n.init,u=n.init=function(n){var r,u,i;if(n instanceof ArrayBuffer&&(n=new Uint8Array(n)),(n instanceof Int8Array||typeof Uint8ClampedArray!="undefined"&&n instanceof Uint8ClampedArray||n instanceof Int16Array||n instanceof Uint16Array||n instanceof Int32Array||n instanceof Uint32Array||n instanceof Float32Array||n instanceof Float64Array)&&(n=new Uint8Array(n.buffer,n.byteOffset,n.byteLength)),n instanceof Uint8Array){for(r=n.byteLength,u=[],i=0;i<r;i++)u[i>>>2]|=n[i]<<24-i%4*8;t.call(this,u,r)}else t.apply(this,arguments)};u.prototype=n}}(),function(n){var i=CryptoJS,r=i.lib,t=r.Base,f=r.WordArray,u=i.x64={},e=u.Word=t.extend({init:function(n,t){this.high=n;this.low=t}}),o=u.WordArray=t.extend({init:function(t,i){t=this.words=t||[];this.sigBytes=i!=n?i:t.length*8},toX32:function(){for(var r=this.words,u=r.length,t=[],i,n=0;n<u;n++)i=r[n],t.push(i.high),t.push(i.low);return f.create(t,this.sigBytes)},clone:function(){for(var r=t.clone.call(this),i=r.words=this.words.slice(0),u=i.length,n=0;n<u;n++)i[n]=i[n].clone();return r}})}(),function(){function r(n){return n<<8&4278255360|n>>>8&16711935}var t=CryptoJS,u=t.lib,i=u.WordArray,n=t.enc,f=n.Utf16=n.Utf16BE={stringify:function(n){for(var u=n.words,f=n.sigBytes,i=[],r,t=0;t<f;t+=2)r=u[t>>>2]>>>16-t%4*8&65535,i.push(String.fromCharCode(r));return i.join("")},parse:function(n){for(var r=n.length,u=[],t=0;t<r;t++)u[t>>>1]|=n.charCodeAt(t)<<16-t%2*16;return i.create(u,r*2)}};n.Utf16LE={stringify:function(n){for(var f=n.words,e=n.sigBytes,i=[],u,t=0;t<e;t+=2)u=r(f[t>>>2]>>>16-t%4*8&65535),i.push(String.fromCharCode(u));return i.join("")},parse:function(n){for(var u=n.length,f=[],t=0;t<u;t++)f[t>>>1]|=r(n.charCodeAt(t)<<16-t%2*16);return i.create(f,u*2)}}}(),function(){function u(n,t,r){for(var e=[],f=0,o,s,u=0;u<t;u++)u%4&&(o=r[n.charCodeAt(u-1)]<<u%4*2,s=r[n.charCodeAt(u)]>>>6-u%4*2,e[f>>>2]|=(o|s)<<24-f%4*8,f++);return i.create(e,f)}var n=CryptoJS,t=n.lib,i=t.WordArray,r=n.enc,f=r.Base64={stringify:function(n){var u=n.words,e=n.sigBytes,o=this._map,i,t,r,f;for(n.clamp(),i=[],t=0;t<e;t+=3){var s=u[t>>>2]>>>24-t%4*8&255,h=u[t+1>>>2]>>>24-(t+1)%4*8&255,c=u[t+2>>>2]>>>24-(t+2)%4*8&255,l=s<<16|h<<8|c;for(r=0;r<4&&t+r*.75<e;r++)i.push(o.charAt(l>>>6*(3-r)&63))}if(f=o.charAt(64),f)while(i.length%4)i.push(f);return i.join("")},parse:function(n){var o=n.length,r=this._map,i=this._reverseMap,t,f,e;if(!i)for(i=this._reverseMap=[],t=0;t<r.length;t++)i[r.charCodeAt(t)]=t;return f=r.charAt(64),f&&(e=n.indexOf(f),e!==-1&&(o=e)),u(n,o,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),function(n){function i(n,t,i,r,u,f,e){var o=n+(t&i|~t&r)+u+e;return(o<<f|o>>>32-f)+t}function r(n,t,i,r,u,f,e){var o=n+(t&r|i&~r)+u+e;return(o<<f|o>>>32-f)+t}function u(n,t,i,r,u,f,e){var o=n+(t^i^r)+u+e;return(o<<f|o>>>32-f)+t}function f(n,t,i,r,u,f,e){var o=n+(i^(t|~r))+u+e;return(o<<f|o>>>32-f)+t}var e=CryptoJS,h=e.lib,c=h.WordArray,o=h.Hasher,l=e.algo,t=[],s;(function(){for(var i=0;i<64;i++)t[i]=n.abs(n.sin(i+1))*4294967296|0})();s=l.MD5=o.extend({_doReset:function(){this._hash=new c.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(n,e){for(var ht,a,v=0;v<16;v++)ht=e+v,a=n[ht],n[ht]=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360;var l=this._hash.words,y=n[e+0],p=n[e+1],w=n[e+2],b=n[e+3],k=n[e+4],d=n[e+5],g=n[e+6],nt=n[e+7],tt=n[e+8],it=n[e+9],rt=n[e+10],ut=n[e+11],ft=n[e+12],et=n[e+13],ot=n[e+14],st=n[e+15],o=l[0],s=l[1],h=l[2],c=l[3];o=i(o,s,h,c,y,7,t[0]);c=i(c,o,s,h,p,12,t[1]);h=i(h,c,o,s,w,17,t[2]);s=i(s,h,c,o,b,22,t[3]);o=i(o,s,h,c,k,7,t[4]);c=i(c,o,s,h,d,12,t[5]);h=i(h,c,o,s,g,17,t[6]);s=i(s,h,c,o,nt,22,t[7]);o=i(o,s,h,c,tt,7,t[8]);c=i(c,o,s,h,it,12,t[9]);h=i(h,c,o,s,rt,17,t[10]);s=i(s,h,c,o,ut,22,t[11]);o=i(o,s,h,c,ft,7,t[12]);c=i(c,o,s,h,et,12,t[13]);h=i(h,c,o,s,ot,17,t[14]);s=i(s,h,c,o,st,22,t[15]);o=r(o,s,h,c,p,5,t[16]);c=r(c,o,s,h,g,9,t[17]);h=r(h,c,o,s,ut,14,t[18]);s=r(s,h,c,o,y,20,t[19]);o=r(o,s,h,c,d,5,t[20]);c=r(c,o,s,h,rt,9,t[21]);h=r(h,c,o,s,st,14,t[22]);s=r(s,h,c,o,k,20,t[23]);o=r(o,s,h,c,it,5,t[24]);c=r(c,o,s,h,ot,9,t[25]);h=r(h,c,o,s,b,14,t[26]);s=r(s,h,c,o,tt,20,t[27]);o=r(o,s,h,c,et,5,t[28]);c=r(c,o,s,h,w,9,t[29]);h=r(h,c,o,s,nt,14,t[30]);s=r(s,h,c,o,ft,20,t[31]);o=u(o,s,h,c,d,4,t[32]);c=u(c,o,s,h,tt,11,t[33]);h=u(h,c,o,s,ut,16,t[34]);s=u(s,h,c,o,ot,23,t[35]);o=u(o,s,h,c,p,4,t[36]);c=u(c,o,s,h,k,11,t[37]);h=u(h,c,o,s,nt,16,t[38]);s=u(s,h,c,o,rt,23,t[39]);o=u(o,s,h,c,et,4,t[40]);c=u(c,o,s,h,y,11,t[41]);h=u(h,c,o,s,b,16,t[42]);s=u(s,h,c,o,g,23,t[43]);o=u(o,s,h,c,it,4,t[44]);c=u(c,o,s,h,ft,11,t[45]);h=u(h,c,o,s,st,16,t[46]);s=u(s,h,c,o,w,23,t[47]);o=f(o,s,h,c,y,6,t[48]);c=f(c,o,s,h,nt,10,t[49]);h=f(h,c,o,s,ot,15,t[50]);s=f(s,h,c,o,d,21,t[51]);o=f(o,s,h,c,ft,6,t[52]);c=f(c,o,s,h,b,10,t[53]);h=f(h,c,o,s,rt,15,t[54]);s=f(s,h,c,o,p,21,t[55]);o=f(o,s,h,c,tt,6,t[56]);c=f(c,o,s,h,st,10,t[57]);h=f(h,c,o,s,g,15,t[58]);s=f(s,h,c,o,et,21,t[59]);o=f(o,s,h,c,k,6,t[60]);c=f(c,o,s,h,ut,10,t[61]);h=f(h,c,o,s,w,15,t[62]);s=f(s,h,c,o,it,21,t[63]);l[0]=l[0]+o|0;l[1]=l[1]+s|0;l[2]=l[2]+h|0;l[3]=l[3]+c|0},_doFinalize:function(){var o=this._data,f=o.words,c=this._nDataBytes*8,e=o.sigBytes*8,t,i,s,h,r,u;for(f[e>>>5]|=128<<24-e%32,t=n.floor(c/4294967296),i=c,f[(e+64>>>9<<4)+15]=(t<<8|t>>>24)&16711935|(t<<24|t>>>8)&4278255360,f[(e+64>>>9<<4)+14]=(i<<8|i>>>24)&16711935|(i<<24|i>>>8)&4278255360,o.sigBytes=(f.length+1)*4,this._process(),s=this._hash,h=s.words,r=0;r<4;r++)u=h[r],h[r]=(u<<8|u>>>24)&16711935|(u<<24|u>>>8)&4278255360;return s},clone:function(){var n=o.clone.call(this);return n._hash=this._hash.clone(),n}});e.MD5=o._createHelper(s);e.HmacMD5=o._createHmacHelper(s)}(Math),function(){var n=CryptoJS,t=n.lib,i=t.Base,u=t.WordArray,r=n.algo,f=r.MD5,e=r.EvpKDF=i.extend({cfg:i.extend({keySize:4,hasher:f,iterations:1}),init:function(n){this.cfg=this.cfg.extend(n)},compute:function(n,t){for(var e=this.cfg,r=e.hasher.create(),f=u.create(),h=f.words,s=e.keySize,c=e.iterations,i,o;h.length<s;){for(i&&r.update(i),i=r.update(n).finalize(t),r.reset(),o=1;o<c;o++)i=r.finalize(i),r.reset();f.concat(i)}return f.sigBytes=s*4,f}});n.EvpKDF=function(n,t,i){return e.create(i).compute(n,t)}}();CryptoJS.lib.Cipher||function(n){var i=CryptoJS,t=i.lib,r=t.Base,u=t.WordArray,s=t.BufferedBlockAlgorithm,h=i.enc,it=h.Utf8,c=h.Base64,l=i.algo,a=l.EvpKDF,e=t.Cipher=s.extend({cfg:r.extend(),createEncryptor:function(n,t){return this.create(this._ENC_XFORM_MODE,n,t)},createDecryptor:function(n,t){return this.create(this._DEC_XFORM_MODE,n,t)},init:function(n,t,i){this.cfg=this.cfg.extend(i);this._xformMode=n;this._key=t;this.reset()},reset:function(){s.reset.call(this);this._doReset()},process:function(n){return this._append(n),this._process()},finalize:function(n){n&&this._append(n);return this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function n(n){return typeof n=="string"?tt:f}return function(t){return{encrypt:function(i,r,u){return n(r).encrypt(t,i,r,u)},decrypt:function(i,r,u){return n(r).decrypt(t,i,r,u)}}}}()}),rt=t.StreamCipher=e.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),v=i.mode={},y=t.BlockCipherMode=r.extend({createEncryptor:function(n,t){return this.Encryptor.create(n,t)},createDecryptor:function(n,t){return this.Decryptor.create(n,t)},init:function(n,t){this._cipher=n;this._iv=t}}),p=v.CBC=function(){function i(t,i,r){var e=this._iv,f,u;for(e?(f=e,this._iv=n):f=this._prevBlock,u=0;u<r;u++)t[i+u]^=f[u]}var t=y.extend();return t.Encryptor=t.extend({processBlock:function(n,t){var r=this._cipher,u=r.blockSize;i.call(this,n,t,u);r.encryptBlock(n,t);this._prevBlock=n.slice(t,t+u)}}),t.Decryptor=t.extend({processBlock:function(n,t){var r=this._cipher,u=r.blockSize,f=n.slice(t,t+u);r.decryptBlock(n,t);i.call(this,n,t,u);this._prevBlock=f}}),t}(),w=i.pad={},b=w.Pkcs7={pad:function(n,t){for(var f=t*4,i=f-n.sigBytes%f,s=i<<24|i<<16|i<<8|i,e=[],o,r=0;r<i;r+=4)e.push(s);o=u.create(e,i);n.concat(o)},unpad:function(n){var t=n.words[n.sigBytes-1>>>2]&255;n.sigBytes-=t}},ut=t.BlockCipher=e.extend({cfg:e.cfg.extend({mode:p,padding:b}),reset:function(){var n;e.reset.call(this);var r=this.cfg,t=r.iv,i=r.mode;this._xformMode==this._ENC_XFORM_MODE?n=i.createEncryptor:(n=i.createDecryptor,this._minBufferSize=1);this._mode&&this._mode.__creator==n?this._mode.init(this,t&&t.words):(this._mode=n.call(i,this,t&&t.words),this._mode.__creator=n)},_doProcessBlock:function(n,t){this._mode.processBlock(n,t)},_doFinalize:function(){var t=this.cfg.padding,n;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),n=this._process(!0)):(n=this._process(!0),t.unpad(n)),n},blockSize:4}),o=t.CipherParams=r.extend({init:function(n){this.mixIn(n)},toString:function(n){return(n||this.formatter).stringify(this)}}),k=i.format={},d=k.OpenSSL={stringify:function(n){var i=n.ciphertext,r=n.salt,t;return t=r?u.create([1398893684,1701076831]).concat(r).concat(i):i,t.toString(c)},parse:function(n){var i=c.parse(n),t=i.words,r;return t[0]==1398893684&&t[1]==1701076831&&(r=u.create(t.slice(2,4)),t.splice(0,4),i.sigBytes-=16),o.create({ciphertext:i,salt:r})}},f=t.SerializableCipher=r.extend({cfg:r.extend({format:d}),encrypt:function(n,t,i,r){r=this.cfg.extend(r);var f=n.createEncryptor(i,r),e=f.finalize(t),u=f.cfg;return o.create({ciphertext:e,key:i,iv:u.iv,algorithm:n,mode:u.mode,padding:u.padding,blockSize:n.blockSize,formatter:r.format})},decrypt:function(n,t,i,r){r=this.cfg.extend(r);t=this._parse(t,r.format);return n.createDecryptor(i,r).finalize(t.ciphertext)},_parse:function(n,t){return typeof n=="string"?t.parse(n,this):n}}),g=i.kdf={},nt=g.OpenSSL={execute:function(n,t,i,r){r||(r=u.random(8));var f=a.create({keySize:t+i}).compute(n,r),e=u.create(f.words.slice(t),i*4);return f.sigBytes=t*4,o.create({key:f,iv:e,salt:r})}},tt=t.PasswordBasedCipher=f.extend({cfg:f.cfg.extend({kdf:nt}),encrypt:function(n,t,i,r){var u,e;return r=this.cfg.extend(r),u=r.kdf.execute(i,n.keySize,n.ivSize),r.iv=u.iv,e=f.encrypt.call(this,n,t,u.key,r),e.mixIn(u),e},decrypt:function(n,t,i,r){var u;return r=this.cfg.extend(r),t=this._parse(t,r.format),u=r.kdf.execute(i,n.keySize,n.ivSize,t.salt),r.iv=u.iv,f.decrypt.call(this,n,t,u.key,r)}})}(),function(){var t=CryptoJS,y=t.lib,e=y.BlockCipher,p=t.algo,n=[],o=[],s=[],h=[],c=[],l=[],i=[],r=[],u=[],f=[],a,v;(function(){for(var y=[],e,p,a,t,v=0;v<256;v++)y[v]=v<128?v<<1:v<<1^283;for(e=0,p=0,v=0;v<256;v++){a=p^p<<1^p<<2^p<<3^p<<4;a=a>>>8^a&255^99;n[e]=a;o[a]=e;var w=y[e],b=y[w],k=y[b],t=y[a]*257^a*16843008;s[e]=t<<24|t>>>8;h[e]=t<<16|t>>>16;c[e]=t<<8|t>>>24;l[e]=t;t=k*16843009^b*65537^w*257^e*16843008;i[a]=t<<24|t>>>8;r[a]=t<<16|t>>>16;u[a]=t<<8|t>>>24;f[a]=t;e?(e=w^y[y[y[k^w]]],p^=y[y[p]]):e=p=1}})();a=[0,1,2,4,8,16,32,64,128,27,54];v=p.AES=e.extend({_doReset:function(){var v,s,e,t;if(!this._nRounds||this._keyPriorReset!==this._key){var l=this._keyPriorReset=this._key,y=l.words,o=l.sigBytes/4,p=this._nRounds=o+6,c=(p+1)*4,h=this._keySchedule=[];for(e=0;e<c;e++)e<o?h[e]=y[e]:(t=h[e-1],e%o?o>6&&e%o==4&&(t=n[t>>>24]<<24|n[t>>>16&255]<<16|n[t>>>8&255]<<8|n[t&255]):(t=t<<8|t>>>24,t=(n[t>>>24]<<24|n[t>>>16&255]<<16|n[t>>>8&255]<<8|n[t&255])^a[e/o|0]<<24),h[e]=h[e-o]^t);for(v=this._invKeySchedule=[],s=0;s<c;s++)e=c-s,t=s%4?h[e]:h[e-4],v[s]=s<4||e<=4?t:i[n[t>>>24]]^r[n[t>>>16&255]]^u[n[t>>>8&255]]^f[n[t&255]]}},encryptBlock:function(t,i){this._doCryptBlock(t,i,this._keySchedule,s,h,c,l,n)},decryptBlock:function(n,t){var e=n[t+1];n[t+1]=n[t+3];n[t+3]=e;this._doCryptBlock(n,t,this._invKeySchedule,i,r,u,f,o);e=n[t+1];n[t+1]=n[t+3];n[t+3]=e},_doCryptBlock:function(n,t,i,r,u,f,e,o){for(var k=this._nRounds,s=n[t]^i[0],h=n[t+1]^i[1],c=n[t+2]^i[2],l=n[t+3]^i[3],a=4,v=1;v<k;v++){var y=r[s>>>24]^u[h>>>16&255]^f[c>>>8&255]^e[l&255]^i[a++],p=r[h>>>24]^u[c>>>16&255]^f[l>>>8&255]^e[s&255]^i[a++],w=r[c>>>24]^u[l>>>16&255]^f[s>>>8&255]^e[h&255]^i[a++],b=r[l>>>24]^u[s>>>16&255]^f[h>>>8&255]^e[c&255]^i[a++];s=y;h=p;c=w;l=b}var y=(o[s>>>24]<<24|o[h>>>16&255]<<16|o[c>>>8&255]<<8|o[l&255])^i[a++],p=(o[h>>>24]<<24|o[c>>>16&255]<<16|o[l>>>8&255]<<8|o[s&255])^i[a++],w=(o[c>>>24]<<24|o[l>>>16&255]<<16|o[s>>>8&255]<<8|o[h&255])^i[a++],b=(o[l>>>24]<<24|o[s>>>16&255]<<16|o[h>>>8&255]<<8|o[c&255])^i[a++];n[t]=y;n[t+1]=p;n[t+2]=w;n[t+3]=b},keySize:8});t.AES=e._createHelper(v)}();var C_MAPBOX_ACESS_TOKEN="pk.eyJ1IjoibWl4YW5kYmxlbmQiLCJhIjoiY2o4cTB4cjB1MGcxdjM0bzR3cjk0dzUwZiJ9.uSkTS6XyhpuE0rIXtMnY0Q",C_MAPBOX_MAP_STYLE="mapbox://styles/mixandblend/cjab0udl52y0f2sqihikwvkfm",C_MAPBOX_SOURCE_LAYER="MapboxSourceLayer",C_DEFAULT_ZOOM_PORTUGAL=6,C_DEFAULT_ZOOM_ESPANHA=5.5,C_DEFAULT_ZOOM_PERU=4.5,C_DEFAULT_ZOOM_CENTRAL_AMERICA=5,C_DEFAULT_ZOOM_COLOMBIA=5,C_DEFAULT_ZOOM_BOLIVIA=5,C_DEFAULT_ZOOM_FLYTO=13,C_ZOOM_TO_SHOW_DRAW_CONTROL=10,C_ZOOM_TO_HIDE_MARKERS=9,C_CIPHER_KEY="8080808080808080",C_LANGUAGE,C_NUMBER_FEATURES=500,C_MOUSEOVER_LAYER="C_MOUSEOVER_LAYER",C_MOUSEOVER_SOURCE="C_MOUSEOVER_SOURCE",EMPTY_SOURCE_FEATURE_COLLECTION={type:"FeatureCollection",features:[]},C_GEOLOCATION_DISTANCE_KM=5,C_GETCLOSEST_POINTS=!0,C_LIMIT_COORDS_TO_WS=20,C_SHOW_USEFULL_INFO_CHECKBOXS=!0,C_SHOW_USEFULL_LAYERS_WHITOUT_CHECKBOXS=!0,notAllowedUseRegionsPolygon=["8","11"],map,geolocate;stores=[];originalStores=[];$(document).ready(function(){})