function e(r,t,o){if(null!==r)for(var n,l,i,a,g,u,f,s,c=0,y=0,h=r.type,b="FeatureCollection"===h,m="Feature"===h,P=b?r.features.length:1,k=0;k<P;k++){g=(s=!!(f=b?r.features[k].geometry:m?r.geometry:r)&&"GeometryCollection"===f.type)?f.geometries.length:1;for(var p=0;p<g;p++){var M=0,v=0;if(null!==(a=s?f.geometries[p]:f)){u=a.coordinates;var L=a.type;switch(c=!o||"Polygon"!==L&&"MultiPolygon"!==L?0:1,L){case null:break;case"Point":if(!1===t(u,y,k,M,v))return!1;y++,M++;break;case"LineString":case"MultiPoint":for(n=0;n<u.length;n++){if(!1===t(u[n],y,k,M,v))return!1;y++,"MultiPoint"===L&&M++}"LineString"===L&&M++;break;case"Polygon":case"MultiLineString":for(n=0;n<u.length;n++){for(l=0;l<u[n].length-c;l++){if(!1===t(u[n][l],y,k,M,v))return!1;y++}"MultiLineString"===L&&M++,"Polygon"===L&&v++}"Polygon"===L&&M++;break;case"MultiPolygon":for(n=0;n<u.length;n++){for(v=0,l=0;l<u[n].length;l++){for(i=0;i<u[n][l].length-c;i++){if(!1===t(u[n][l][i],y,k,M,v))return!1;y++}v++}M++}break;case"GeometryCollection":for(n=0;n<a.geometries.length;n++)if(!1===e(a.geometries[n],t,o))return!1;break;default:throw Error("Unknown Geometry Type")}}}}}var r=function(r,t={}){if(null!=r.bbox&&!0!==t.recompute)return r.bbox;let o=[1/0,1/0,-1/0,-1/0];return e(r,e=>{o[0]>e[0]&&(o[0]=e[0]),o[1]>e[1]&&(o[1]=e[1]),o[2]<e[0]&&(o[2]=e[0]),o[3]<e[1]&&(o[3]=e[1])}),o};export{r as t};
//# sourceMappingURL=esm-k7KI3vER-DWALg7MX.js.map