You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
hy-screen-2.0/docs/assets/index-007453d8-178413279283...

4 lines
174 KiB

var Li=Object.defineProperty,Ri=Object.defineProperties;var Ti=Object.getOwnPropertyDescriptors;var ua=Object.getOwnPropertySymbols;var Oi=Object.prototype.hasOwnProperty,Fi=Object.prototype.propertyIsEnumerable;var ca=(t,e,s)=>e in t?Li(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,Ot=(t,e)=>{for(var s in e||(e={}))Oi.call(e,s)&&ca(t,s,e[s]);if(ua)for(var s of ua(e))Fi.call(e,s)&&ca(t,s,e[s]);return t},kt=(t,e)=>Ri(t,Ti(e));var nt=(t,e,s)=>new Promise((a,i)=>{var r=h=>{try{n(s.next(h))}catch(l){i(l)}},o=h=>{try{n(s.throw(h))}catch(l){i(l)}},n=h=>h.done?a(h.value):Promise.resolve(h.value).then(r,o);n((s=s.apply(t,e)).next())});import{g as fa}from"./index-e9f36657-1784132792831.js";/* empty css */import{_ as ga}from"./index-a4d3ff67-1784132792831.js";import{i as Se,g as ji,b as va}from"./townshipBoundaries-822b7d9e-1784132792831.js";import{r as ki,n as qi}from"./index-a1b5e9c0-1784132792831.js";import{c as $i,F as Di,b as Ui}from"./featurePanelLayout-9d4ef87e-1784132792831.js";import{A as Bi}from"./assets-8cd57427-1784132792831.js";import{q as zi,r as Wi,s as Vi}from"./screen2Standard-41868f75-1784132792831.js";import{M as Hi}from"./index-24267a69-1784132792831.js";import{_ as Qi}from"./LayerPanel-fa97fc8c-1784132792831.js";import{a as da,_ as Ji}from"./FeatureInfoPanel-8ee1b2b1-1784132792831.js";import{_ as Xi}from"./TopicSwitcher-2e4ca291-1784132792831.js";import{_ as Ki,g as z,q as Ba,o as J,c as tt,a as R,t as ut,j as It,n as Ft,f as Yt,F as fs,y as gs,d as Q,h as Zi,w as ss,A as Pe,b as te,C as Ls,x as _a,u as as,J as Ma,z as Yi}from"./index-1784132792831.js";import{b as is,e as Rs,r as tr,a as er,p as sr,g as ar,c as Ts,d as ir}from"./data-85b25709-1784132792831.js";import"./data-ee410ed3-1784132792831.js";const rr="/openApi";function nr(t){return nt(this,null,function*(){const e=yield ki(`${rr}/ecologicalProtection/rangeStats`,{method:"POST",timeout:3e4,params:{scopeKey:t},headers:{"Content-Type":"application/json"},body:JSON.stringify({scopeKey:t})}),s=qi(e);return hr(Array.isArray(s)?s[0]||{}:s||{})})}const or={scope_key:"scopeKey",scope_name:"scopeName",scope_area_wan_mu:"scopeAreaWanMu",source_feature_count:"sourceFeatureCount",grassland_area_wan_mu:"grasslandAreaWanMu",wetland_area_wan_mu:"wetlandAreaWanMu",woodland_area_wan_mu:"woodlandAreaWanMu",grassland_fresh_yield_wan_ton:"grasslandFreshYieldWanTon",wetland_fresh_yield_wan_ton:"wetlandFreshYieldWanTon",grassland_mu_yield_jin:"grasslandMuYieldJin",wetland_mu_yield_jin:"wetlandMuYieldJin",grassland_vegetation_cover_percent:"grasslandVegetationCoverPercent",grassland_patch_count:"grasslandPatchCount",wetland_patch_count:"wetlandPatchCount",woodland_patch_count:"woodlandPatchCount",grassland_distribution:"grasslandDistribution",wetland_distribution:"wetlandDistribution",woodland_distribution:"woodlandDistribution",grassland_productivity:"grasslandProductivity",grassland_types:"grasslandTypes",zoning_structure:"zoningStructure",grassland_levels:"grasslandLevels",vegetation_cover_bands:"vegetationCoverBands",woodland_types:"woodlandTypes",woodland_quality:"woodlandQuality",area_method:"areaMethod",area_unit:"areaUnit",productivity_method:"productivityMethod"};function hr(t={}){return!t||typeof t!="object"?{}:Object.entries(t).reduce((e,[s,a])=>{e[s]=a;const i=or[s];return i&&e[i]===void 0&&(e[i]=a),e},{})}function lr(t){t("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),t("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),t("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs");for(var e=1;e<=60;++e)t("EPSG:"+(32600+e),"+proj=utm +zone="+e+" +datum=WGS84 +units=m"),t("EPSG:"+(32700+e),"+proj=utm +zone="+e+" +south +datum=WGS84 +units=m");t("EPSG:5041","+title=WGS 84 / UPS North (E,N) +proj=stere +lat_0=90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m"),t("EPSG:5042","+title=WGS 84 / UPS South (E,N) +proj=stere +lat_0=-90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m"),t.WGS84=t["EPSG:4326"],t["EPSG:3785"]=t["EPSG:3857"],t.GOOGLE=t["EPSG:3857"],t["EPSG:900913"]=t["EPSG:3857"],t["EPSG:102113"]=t["EPSG:3857"]}var Jt=1,Xt=2,ne=3,ur=4,$s=5,ma=6378137,cr=6356752314e-3,ya=.0066943799901413165,Ne=484813681109536e-20,P=Math.PI/2,fr=.16666666666666666,gr=.04722222222222222,vr=.022156084656084655,x=1e-10,Z=.017453292519943295,yt=57.29577951308232,U=Math.PI/4,Re=Math.PI*2,et=3.14159265359,wt={};wt.greenwich=0;wt.lisbon=-9.131906111111;wt.paris=2.337229166667;wt.bogota=-74.080916666667;wt.madrid=-3.687938888889;wt.rome=12.452333333333;wt.bern=7.439583333333;wt.jakarta=106.807719444444;wt.ferro=-17.666666666667;wt.brussels=4.367975;wt.stockholm=18.058277777778;wt.athens=23.7163375;wt.oslo=10.722916666667;const dr={mm:{to_meter:.001},cm:{to_meter:.01},ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937},fath:{to_meter:1.8288},kmi:{to_meter:1852},"us-ch":{to_meter:20.1168402336805},"us-mi":{to_meter:1609.34721869444},km:{to_meter:1e3},"ind-ft":{to_meter:.30479841},"ind-yd":{to_meter:.91439523},mi:{to_meter:1609.344},yd:{to_meter:.9144},ch:{to_meter:20.1168},link:{to_meter:.201168},dm:{to_meter:.1},in:{to_meter:.0254},"ind-ch":{to_meter:20.11669506},"us-in":{to_meter:.025400050800101},"us-yd":{to_meter:.914401828803658}};var wa=/[\s_\-\/\(\)]/g;function $t(t,e){if(t[e])return t[e];for(var s=Object.keys(t),a=e.toLowerCase().replace(wa,""),i=-1,r,o;++i<s.length;)if(r=s[i],o=r.toLowerCase().replace(wa,""),o===a)return t[r]}function Ds(t){var e={},s=t.split("+").map(function(n){return n.trim()}).filter(function(n){return n}).reduce(function(n,h){var l=h.split("=");return l.push(!0),n[l[0].toLowerCase()]=l[1],n},{}),a,i,r,o={proj:"projName",datum:"datumCode",rf:function(n){e.rf=parseFloat(n)},lat_0:function(n){e.lat0=n*Z},lat_1:function(n){e.lat1=n*Z},lat_2:function(n){e.lat2=n*Z},lat_ts:function(n){e.lat_ts=n*Z},lon_0:function(n){e.long0=n*Z},lon_1:function(n){e.long1=n*Z},lon_2:function(n){e.long2=n*Z},alpha:function(n){e.alpha=parseFloat(n)*Z},gamma:function(n){e.rectified_grid_angle=parseFloat(n)*Z},lonc:function(n){e.longc=n*Z},x_0:function(n){e.x0=parseFloat(n)},y_0:function(n){e.y0=parseFloat(n)},k_0:function(n){e.k0=parseFloat(n)},k:function(n){e.k0=parseFloat(n)},a:function(n){e.a=parseFloat(n)},b:function(n){e.b=parseFloat(n)},r:function(n){e.a=e.b=parseFloat(n)},r_a:function(){e.R_A=!0},zone:function(n){e.zone=parseInt(n,10)},south:function(){e.utmSouth=!0},towgs84:function(n){e.datum_params=n.split(",").map(function(h){return parseFloat(h)})},to_meter:function(n){e.to_meter=parseFloat(n)},units:function(n){e.units=n;var h=$t(dr,n);h&&(e.to_meter=h.to_meter)},from_greenwich:function(n){e.from_greenwich=n*Z},pm:function(n){var h=$t(wt,n);e.from_greenwich=(h||parseFloat(n))*Z},nadgrids:function(n){n==="@null"?e.datumCode="none":e.nadgrids=n},axis:function(n){var h="ewnsud";n.length===3&&h.indexOf(n.substr(0,1))!==-1&&h.indexOf(n.substr(1,1))!==-1&&h.indexOf(n.substr(2,1))!==-1&&(e.axis=n)},approx:function(){e.approx=!0},over:function(){e.over=!0}};for(a in s)i=s[a],a in o?(r=o[a],typeof r=="function"?r(i):e[r]=i):e[a]=i;return typeof e.datumCode=="string"&&e.datumCode!=="WGS84"&&(e.datumCode=e.datumCode.toLowerCase()),e.projStr=t,e}class za{static getId(e){const s=e.find(a=>Array.isArray(a)&&a[0]==="ID");return s&&s.length>=3?{authority:s[1],code:parseInt(s[2],10)}:null}static convertUnit(e,s="unit"){if(!e||e.length<3)return{type:s,name:"unknown",conversion_factor:null};const a=e[1],i=parseFloat(e[2])||null,r=e.find(n=>Array.isArray(n)&&n[0]==="ID"),o=r?{authority:r[1],code:parseInt(r[2],10)}:null;return{type:s,name:a,conversion_factor:i,id:o}}static convertAxis(e){const s=e[1]||"Unknown";let a;const i=s.match(/^\((.)\)$/);if(i){const l=i[1].toUpperCase();if(l==="E")a="east";else if(l==="N")a="north";else if(l==="U")a="up";else if(e[2])a=e[2];else throw new Error(`Unknown axis abbreviation: ${l}`)}else a=e[2]||"unknown";const r=e.find(l=>Array.isArray(l)&&l[0]==="ORDER"),o=r?parseInt(r[1],10):null,n=e.find(l=>Array.isArray(l)&&(l[0]==="LENGTHUNIT"||l[0]==="ANGLEUNIT"||l[0]==="SCALEUNIT")),h=this.convertUnit(n);return{name:s,direction:a,unit:h,order:o}}static extractAxes(e){return e.filter(s=>Array.isArray(s)&&s[0]==="AXIS").map(s=>this.convertAxis(s)).sort((s,a)=>(s.order||0)-(a.order||0))}static convert(e,s={}){switch(e[0]){case"PROJCRS":s.type="ProjectedCRS",s.name=e[1],s.base_crs=e.find(u=>Array.isArray(u)&&u[0]==="BASEGEOGCRS")?this.convert(e.find(u=>Array.isArray(u)&&u[0]==="BASEGEOGCRS")):null,s.conversion=e.find(u=>Array.isArray(u)&&u[0]==="CONVERSION")?this.convert(e.find(u=>Array.isArray(u)&&u[0]==="CONVERSION")):null;const a=e.find(u=>Array.isArray(u)&&u[0]==="CS");a&&(s.coordinate_system={type:a[1],axis:this.extractAxes(e)});const i=e.find(u=>Array.isArray(u)&&u[0]==="LENGTHUNIT");if(i){const u=this.convertUnit(i);s.coordinate_system.unit=u}s.id=this.getId(e);break;case"BASEGEOGCRS":case"GEOGCRS":case"GEODCRS":s.type=e[0]==="GEODCRS"?"GeodeticCRS":"GeographicCRS",s.name=e[1];const r=e.find(u=>Array.isArray(u)&&(u[0]==="DATUM"||u[0]==="ENSEMBLE"));if(r){const u=this.convert(r);r[0]==="ENSEMBLE"?s.datum_ensemble=u:s.datum=u;const y=e.find(w=>Array.isArray(w)&&w[0]==="PRIMEM");y&&y[1]!=="Greenwich"&&(u.prime_meridian={name:y[1],longitude:parseFloat(y[2])})}s.coordinate_system={type:"ellipsoidal",axis:this.extractAxes(e)},s.id=this.getId(e);break;case"DATUM":s.type="GeodeticReferenceFrame",s.name=e[1],s.ellipsoid=e.find(u=>Array.isArray(u)&&u[0]==="ELLIPSOID")?this.convert(e.find(u=>Array.isArray(u)&&u[0]==="ELLIPSOID")):null;break;case"ENSEMBLE":s.type="DatumEnsemble",s.name=e[1],s.members=e.filter(u=>Array.isArray(u)&&u[0]==="MEMBER").map(u=>({type:"DatumEnsembleMember",name:u[1],id:this.getId(u)}));const o=e.find(u=>Array.isArray(u)&&u[0]==="ENSEMBLEACCURACY");o&&(s.accuracy=parseFloat(o[1]));const n=e.find(u=>Array.isArray(u)&&u[0]==="ELLIPSOID");n&&(s.ellipsoid=this.convert(n)),s.id=this.getId(e);break;case"ELLIPSOID":s.type="Ellipsoid",s.name=e[1],s.semi_major_axis=parseFloat(e[2]),s.inverse_flattening=parseFloat(e[3]),e.find(u=>Array.isArray(u)&&u[0]==="LENGTHUNIT")&&this.convert(e.find(u=>Array.isArray(u)&&u[0]==="LENGTHUNIT"),s);break;case"CONVERSION":s.type="Conversion",s.name=e[1],s.method=e.find(u=>Array.isArray(u)&&u[0]==="METHOD")?this.convert(e.find(u=>Array.isArray(u)&&u[0]==="METHOD")):null,s.parameters=e.filter(u=>Array.isArray(u)&&u[0]==="PARAMETER").map(u=>this.convert(u));break;case"METHOD":s.type="Method",s.name=e[1],s.id=this.getId(e);break;case"PARAMETER":s.type="Parameter",s.name=e[1],s.value=parseFloat(e[2]),s.unit=this.convertUnit(e.find(u=>Array.isArray(u)&&(u[0]==="LENGTHUNIT"||u[0]==="ANGLEUNIT"||u[0]==="SCALEUNIT"))),s.id=this.getId(e);break;case"BOUNDCRS":s.type="BoundCRS";const h=e.find(u=>Array.isArray(u)&&u[0]==="SOURCECRS");if(h){const u=h.find(y=>Array.isArray(y));s.source_crs=u?this.convert(u):null}const l=e.find(u=>Array.isArray(u)&&u[0]==="TARGETCRS");if(l){const u=l.find(y=>Array.isArray(y));s.target_crs=u?this.convert(u):null}const g=e.find(u=>Array.isArray(u)&&u[0]==="ABRIDGEDTRANSFORMATION");g?s.transformation=this.convert(g):s.transformation=null;break;case"ABRIDGEDTRANSFORMATION":if(s.type="Transformation",s.name=e[1],s.method=e.find(u=>Array.isArray(u)&&u[0]==="METHOD")?this.convert(e.find(u=>Array.isArray(u)&&u[0]==="METHOD")):null,s.parameters=e.filter(u=>Array.isArray(u)&&(u[0]==="PARAMETER"||u[0]==="PARAMETERFILE")).map(u=>{if(u[0]==="PARAMETER")return this.convert(u);if(u[0]==="PARAMETERFILE")return{name:u[1],value:u[2],id:{authority:"EPSG",code:8656}}}),s.parameters.length===7){const u=s.parameters[6];u.name==="Scale difference"&&(u.value=Math.round((u.value-1)*1e12)/1e6)}s.id=this.getId(e);break;case"AXIS":s.coordinate_system||(s.coordinate_system={type:"unspecified",axis:[]}),s.coordinate_system.axis.push(this.convertAxis(e));break;case"LENGTHUNIT":const f=this.convertUnit(e,"LinearUnit");s.coordinate_system&&s.coordinate_system.axis&&s.coordinate_system.axis.forEach(u=>{u.unit||(u.unit=f)}),f.conversion_factor&&f.conversion_factor!==1&&s.semi_major_axis&&(s.semi_major_axis={value:s.semi_major_axis,unit:f});break;default:s.keyword=e[0];break}return s}}class _r extends za{static convert(e,s={}){return super.convert(e,s),s.coordinate_system&&s.coordinate_system.subtype==="Cartesian"&&delete s.coordinate_system,s.usage&&delete s.usage,s}}class Mr extends za{static convert(e,s={}){super.convert(e,s);const a=e.find(r=>Array.isArray(r)&&r[0]==="CS");a&&(s.coordinate_system={subtype:a[1],axis:this.extractAxes(e)});const i=e.find(r=>Array.isArray(r)&&r[0]==="USAGE");if(i){const r=i.find(h=>Array.isArray(h)&&h[0]==="SCOPE"),o=i.find(h=>Array.isArray(h)&&h[0]==="AREA"),n=i.find(h=>Array.isArray(h)&&h[0]==="BBOX");s.usage={},r&&(s.usage.scope=r[1]),o&&(s.usage.area=o[1]),n&&(s.usage.bbox=n.slice(1))}return s}}function mr(t){return t.find(e=>Array.isArray(e)&&e[0]==="USAGE")?"2019":(t.find(e=>Array.isArray(e)&&e[0]==="CS")||t[0]==="BOUNDCRS"||t[0]==="PROJCRS"||t[0]==="GEOGCRS","2015")}function yr(t){return(mr(t)==="2019"?Mr:_r).convert(t)}function wr(t){const e=t.toUpperCase();return e.includes("PROJCRS")||e.includes("GEOGCRS")||e.includes("BOUNDCRS")||e.includes("VERTCRS")||e.includes("LENGTHUNIT")||e.includes("ANGLEUNIT")||e.includes("SCALEUNIT")?"WKT2":(e.includes("PROJCS")||e.includes("GEOGCS")||e.includes("LOCAL_CS")||e.includes("VERT_CS")||e.includes("UNIT"),"WKT1")}var Te=1,Wa=2,Va=3,vs=4,Ha=5,Hs=-1,Er=/\s/,Sr=/[A-Za-z]/,Pr=/[A-Za-z84_]/,Ss=/[,\]]/,Qa=/[\d\.E\-\+]/;function jt(t){if(typeof t!="string")throw new Error("not a string");this.text=t.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=Te}jt.prototype.readCharicter=function(){var t=this.text[this.place++];if(this.state!==vs)for(;Er.test(t);){if(this.place>=this.text.length)return;t=this.text[this.place++]}switch(this.state){case Te:return this.neutral(t);case Wa:return this.keyword(t);case vs:return this.quoted(t);case Ha:return this.afterquote(t);case Va:return this.number(t);case Hs:return}};jt.prototype.afterquote=function(t){if(t==='"'){this.word+='"',this.state=vs;return}if(Ss.test(t)){this.word=this.word.trim(),this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in afterquote yet, index '+this.place)};jt.prototype.afterItem=function(t){if(t===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=Te;return}if(t==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=Te,this.currentObject=this.stack.pop(),this.currentObject||(this.state=Hs);return}};jt.prototype.number=function(t){if(Qa.test(t)){this.word+=t;return}if(Ss.test(t)){this.word=parseFloat(this.word),this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in number yet, index '+this.place)};jt.prototype.quoted=function(t){if(t==='"'){this.state=Ha;return}this.word+=t};jt.prototype.keyword=function(t){if(Pr.test(t)){this.word+=t;return}if(t==="["){var e=[];e.push(this.word),this.level++,this.root===null?this.root=e:this.currentObject.push(e),this.stack.push(this.currentObject),this.currentObject=e,this.state=Te;return}if(Ss.test(t)){this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in keyword yet, index '+this.place)};jt.prototype.neutral=function(t){if(Sr.test(t)){this.word=t,this.state=Wa;return}if(t==='"'){this.word="",this.state=vs;return}if(Qa.test(t)){this.word=t,this.state=Va;return}if(Ss.test(t)){this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in neutral yet, index '+this.place)};jt.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(this.state===Hs)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};function pr(t){var e=new jt(t);return e.output()}function Os(t,e,s){Array.isArray(e)&&(s.unshift(e),e=null);var a=e?{}:t,i=s.reduce(function(r,o){return se(o,r),r},a);e&&(t[e]=i)}function se(t,e){if(!Array.isArray(t)){e[t]=!0;return}var s=t.shift();if(s==="PARAMETER"&&(s=t.shift()),t.length===1){if(Array.isArray(t[0])){e[s]={},se(t[0],e[s]);return}e[s]=t[0];return}if(!t.length){e[s]=!0;return}if(s==="TOWGS84"){e[s]=t;return}if(s==="AXIS"){s in e||(e[s]=[]),e[s].push(t);return}Array.isArray(s)||(e[s]={});var a;switch(s){case"UNIT":case"PRIMEM":case"VERT_DATUM":e[s]={name:t[0].toLowerCase(),convert:t[1]},t.length===3&&se(t[2],e[s]);return;case"SPHEROID":case"ELLIPSOID":e[s]={name:t[0],a:t[1],rf:t[2]},t.length===4&&se(t[3],e[s]);return;case"EDATUM":case"ENGINEERINGDATUM":case"LOCAL_DATUM":case"DATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":t[0]=["name",t[0]],Os(e,s,t);return;case"COMPD_CS":case"COMPOUNDCRS":case"FITTED_CS":case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"ENGCRS":case"ENGINEERINGCRS":t[0]=["name",t[0]],Os(e,s,t),e[s].type=s;return;default:for(a=-1;++a<t.length;)if(!Array.isArray(t[a]))return se(t,e[s]);return Os(e,s,t)}}var xr=.017453292519943295;function St(t){return t*xr}function Ja(t){const e=(t.projName||"").toLowerCase().replace(/_/g," ");t.long0===void 0&&t.longc!==void 0&&(t.long0=t.longc),!t.lat_ts&&t.lat1&&(e==="stereographic south pole"||e==="polar stereographic (variant b)")?(t.lat0=St(t.lat1>0?90:-90),t.lat_ts=t.lat1,delete t.lat1):!t.lat_ts&&t.lat0&&(e==="polar stereographic"||e==="polar stereographic (variant a)")&&(t.lat_ts=t.lat0,t.lat0=St(t.lat0>0?90:-90),delete t.lat1)}function Ea(t){let e={units:null,to_meter:void 0};return typeof t=="string"?(e.units=t.toLowerCase(),e.units==="metre"&&(e.units="meter"),e.units==="meter"&&(e.to_meter=1)):t&&t.name&&(e.units=t.name.toLowerCase(),e.units==="metre"&&(e.units="meter"),e.to_meter=t.conversion_factor),e}function Sa(t){return typeof t=="object"?t.value*t.unit.conversion_factor:t}function Pa(t,e){t.ellipsoid.radius?(e.a=t.ellipsoid.radius,e.rf=0):(e.a=Sa(t.ellipsoid.semi_major_axis),t.ellipsoid.inverse_flattening!==void 0?e.rf=t.ellipsoid.inverse_flattening:t.ellipsoid.semi_major_axis!==void 0&&t.ellipsoid.semi_minor_axis!==void 0&&(e.rf=e.a/(e.a-Sa(t.ellipsoid.semi_minor_axis))))}function ds(t,e={}){return!t||typeof t!="object"?t:t.type==="BoundCRS"?(ds(t.source_crs,e),t.transformation&&(t.transformation.method&&t.transformation.method.name==="NTv2"?e.nadgrids=t.transformation.parameters[0].value:e.datum_params=t.transformation.parameters.map(s=>s.value)),e):(Object.keys(t).forEach(s=>{const a=t[s];if(a!==null)switch(s){case"name":if(e.srsCode)break;e.name=a,e.srsCode=a;break;case"type":a==="GeographicCRS"?e.projName="longlat":a==="GeodeticCRS"?t.coordinate_system&&t.coordinate_system.subtype==="Cartesian"?e.projName="geocent":e.projName="longlat":a==="ProjectedCRS"&&t.conversion&&t.conversion.method&&(e.projName=t.conversion.method.name);break;case"datum":case"datum_ensemble":a.ellipsoid&&(e.ellps=a.ellipsoid.name,Pa(a,e)),a.prime_meridian&&(e.from_greenwich=a.prime_meridian.longitude*Math.PI/180);break;case"ellipsoid":e.ellps=a.name,Pa(a,e);break;case"prime_meridian":e.long0=(a.longitude||0)*Math.PI/180;break;case"coordinate_system":if(a.axis){const i={east:"e",north:"n",west:"w",south:"s",up:"u",down:"d",geocentricx:"e",geocentricy:"n",geocentricz:"u"},r=a.axis.map(o=>i[o.direction.toLowerCase()]);if(r.every(Boolean)&&(e.axis=r.join(""),e.axis.length===2&&(e.axis+="u")),a.unit){const{units:o,to_meter:n}=Ea(a.unit);e.units=o,e.to_meter=n}else if(a.axis[0]&&a.axis[0].unit){const{units:o,to_meter:n}=Ea(a.axis[0].unit);e.units=o,e.to_meter=n}}break;case"id":a.authority&&a.code&&(e.title=a.authority+":"+a.code);break;case"conversion":a.method&&a.method.name&&(e.projName=a.method.name),a.parameters&&a.parameters.forEach(i=>{const r=i.name.toLowerCase().replace(/\s+/g,"_"),o=i.value;i.unit&&i.unit.conversion_factor?e[r]=o*i.unit.conversion_factor:i.unit==="degree"?e[r]=o*Math.PI/180:e[r]=o});break;case"unit":a.name&&(e.units=a.name.toLowerCase(),e.units==="metre"&&(e.units="meter")),a.conversion_factor&&(e.to_meter=a.conversion_factor);break;case"base_crs":ds(a,e),e.datumCode=a.id?a.id.authority+"_"+a.id.code:a.name;break}}),e.latitude_of_false_origin!==void 0&&(e.lat0=e.latitude_of_false_origin),e.longitude_of_false_origin!==void 0&&(e.long0=e.longitude_of_false_origin),e.latitude_of_standard_parallel!==void 0&&(e.lat0=e.latitude_of_standard_parallel,e.lat1=e.latitude_of_standard_parallel),e.latitude_of_1st_standard_parallel!==void 0&&(e.lat1=e.latitude_of_1st_standard_parallel),e.latitude_of_2nd_standard_parallel!==void 0&&(e.lat2=e.latitude_of_2nd_standard_parallel),e.latitude_of_projection_centre!==void 0&&(e.lat0=e.latitude_of_projection_centre),e.longitude_of_projection_centre!==void 0&&(e.longc=e.longitude_of_projection_centre),e.easting_at_false_origin!==void 0&&(e.x0=e.easting_at_false_origin),e.northing_at_false_origin!==void 0&&(e.y0=e.northing_at_false_origin),e.latitude_of_natural_origin!==void 0&&(e.lat0=e.latitude_of_natural_origin),e.longitude_of_natural_origin!==void 0&&(e.long0=e.longitude_of_natural_origin),e.longitude_of_origin!==void 0&&(e.long0=e.longitude_of_origin),e.false_easting!==void 0&&(e.x0=e.false_easting),e.easting_at_projection_centre&&(e.x0=e.easting_at_projection_centre),e.false_northing!==void 0&&(e.y0=e.false_northing),e.northing_at_projection_centre&&(e.y0=e.northing_at_projection_centre),e.standard_parallel_1!==void 0&&(e.lat1=e.standard_parallel_1),e.standard_parallel_2!==void 0&&(e.lat2=e.standard_parallel_2),e.scale_factor_at_natural_origin!==void 0&&(e.k0=e.scale_factor_at_natural_origin),e.scale_factor_at_projection_centre!==void 0&&(e.k0=e.scale_factor_at_projection_centre),e.scale_factor_on_pseudo_standard_parallel!==void 0&&(e.k0=e.scale_factor_on_pseudo_standard_parallel),e.azimuth!==void 0&&(e.alpha=e.azimuth),e.azimuth_at_projection_centre!==void 0&&(e.alpha=e.azimuth_at_projection_centre),e.angle_from_rectified_to_skew_grid&&(e.rectified_grid_angle=e.angle_from_rectified_to_skew_grid),Ja(e),e)}var br=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function Gr(t,e){var s=e[0],a=e[1];!(s in t)&&a in t&&(t[s]=t[a],e.length===3&&(t[s]=e[2](t[s])))}function Xa(t){for(var e=Object.keys(t),s=0,a=e.length;s<a;++s){var i=e[s];br.indexOf(i)!==-1&&Nr(t[i]),typeof t[i]=="object"&&Xa(t[i])}}function Nr(t){if(t.AUTHORITY){var e=Object.keys(t.AUTHORITY)[0];e&&e in t.AUTHORITY&&(t.title=e+":"+t.AUTHORITY[e])}if(t.type==="GEOGCS"?t.projName="longlat":t.type==="LOCAL_CS"?(t.projName="identity",t.local=!0):typeof t.PROJECTION=="object"?t.projName=Object.keys(t.PROJECTION)[0]:t.projName=t.PROJECTION,t.AXIS){for(var s="",a=0,i=t.AXIS.length;a<i;++a){var r=[t.AXIS[a][0].toLowerCase(),t.AXIS[a][1].toLowerCase()];r[0].indexOf("north")!==-1||(r[0]==="y"||r[0]==="lat")&&r[1]==="north"?s+="n":r[0].indexOf("south")!==-1||(r[0]==="y"||r[0]==="lat")&&r[1]==="south"?s+="s":r[0].indexOf("east")!==-1||(r[0]==="x"||r[0]==="lon")&&r[1]==="east"?s+="e":(r[0].indexOf("west")!==-1||(r[0]==="x"||r[0]==="lon")&&r[1]==="west")&&(s+="w")}s.length===2&&(s+="u"),s.length===3&&(t.axis=s)}t.UNIT&&(t.units=t.UNIT.name.toLowerCase(),t.units==="metre"&&(t.units="meter"),t.UNIT.convert&&(t.type==="GEOGCS"?t.DATUM&&t.DATUM.SPHEROID&&(t.to_meter=t.UNIT.convert*t.DATUM.SPHEROID.a):t.to_meter=t.UNIT.convert));var o=t.GEOGCS;t.type==="GEOGCS"&&(o=t),o&&(o.PRIMEM&&o.PRIMEM.convert&&(t.from_greenwich=St(o.PRIMEM.convert)),o.DATUM?t.datumCode=o.DATUM.name.toLowerCase():t.datumCode=o.name.toLowerCase(),t.datumCode.slice(0,2)==="d_"&&(t.datumCode=t.datumCode.slice(2)),t.datumCode==="new_zealand_1949"&&(t.datumCode="nzgd49"),(t.datumCode==="wgs_1984"||t.datumCode==="world_geodetic_system_1984")&&(t.PROJECTION==="Mercator_Auxiliary_Sphere"&&(t.sphere=!0),t.datumCode="wgs84"),t.datumCode==="belge_1972"&&(t.datumCode="rnb72"),o.DATUM&&o.DATUM.SPHEROID&&(t.ellps=o.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),t.ellps.toLowerCase().slice(0,13)==="international"&&(t.ellps="intl"),t.a=o.DATUM.SPHEROID.a,t.rf=parseFloat(o.DATUM.SPHEROID.rf)),o.DATUM&&o.DATUM.TOWGS84&&(t.datum_params=o.DATUM.TOWGS84),~t.datumCode.indexOf("osgb_1936")&&(t.datumCode="osgb36"),~t.datumCode.indexOf("osni_1952")&&(t.datumCode="osni52"),(~t.datumCode.indexOf("tm65")||~t.datumCode.indexOf("geodetic_datum_of_1965"))&&(t.datumCode="ire65"),t.datumCode==="ch1903+"&&(t.datumCode="ch1903"),~t.datumCode.indexOf("israel")&&(t.datumCode="isr93")),t.b&&!isFinite(t.b)&&(t.b=t.a),t.rectified_grid_angle&&(t.rectified_grid_angle=St(t.rectified_grid_angle));function n(g){var f=t.to_meter||1;return g*f}var h=function(g){return Gr(t,g)},l=[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",St],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",St],["x0","false_easting",n],["y0","false_northing",n],["long0","central_meridian",St],["lat0","latitude_of_origin",St],["lat0","standard_parallel_1",St],["lat1","standard_parallel_1",St],["lat2","standard_parallel_2",St],["azimuth","Azimuth"],["alpha","azimuth",St],["srsCode","name"]];l.forEach(h),Ja(t)}function _s(t){if(typeof t=="object")return ds(t);const e=wr(t);var s=pr(t);if(e==="WKT2"){const r=yr(s);return ds(r)}var a=s[0],i={};return se(s,i),Xa(i),i[a]}function ot(t){var e=this;if(arguments.length===2){var s=arguments[1];typeof s=="string"?s.charAt(0)==="+"?ot[t]=Ds(arguments[1]):ot[t]=_s(arguments[1]):s&&typeof s=="object"&&!("projName"in s)?ot[t]=_s(arguments[1]):(ot[t]=s,s||delete ot[t])}else if(arguments.length===1){if(Array.isArray(t))return t.map(function(a){return Array.isArray(a)?ot.apply(e,a):ot(a)});if(typeof t=="string"){if(t in ot)return ot[t]}else"EPSG"in t?ot["EPSG:"+t.EPSG]=t:"ESRI"in t?ot["ESRI:"+t.ESRI]=t:"IAU2000"in t?ot["IAU2000:"+t.IAU2000]=t:console.log(t);return}}lr(ot);function Ar(t){return typeof t=="string"}function Ir(t){return t in ot}function Cr(t){return t.indexOf("+")!==0&&t.indexOf("[")!==-1||typeof t=="object"&&!("srsCode"in t)}var pa=["3857","900913","3785","102113"];function Lr(t){if(t.title)return t.title.toLowerCase().indexOf("epsg:")===0&&pa.indexOf(t.title.substr(5))>-1;var e=$t(t,"authority");if(e){var s=$t(e,"epsg");return s&&pa.indexOf(s)>-1}}function Rr(t){var e=$t(t,"extension");if(e)return $t(e,"proj4")}function Tr(t){return t[0]==="+"}function Or(t){let e;if(Ar(t))if(Ir(t))e=ot[t];else if(Cr(t)){e=_s(t);var s=Rr(e);s&&(e=Ds(s))}else Tr(t)&&(e=Ds(t));else"projName"in t?e=t:e=_s(t);return e&&Lr(e)?ot["EPSG:3857"]:e}function xa(t,e){t=t||{};var s,a;if(!e)return t;for(a in e)s=e[a],s!==void 0&&(t[a]=s);return t}function Lt(t,e,s){var a=t*e;return s/Math.sqrt(1-a*a)}function ke(t){return t<0?-1:1}function G(t,e){return e||Math.abs(t)<=et?t:t-ke(t)*Re}function Nt(t,e,s){var a=t*s,i=.5*t;return a=Math.pow((1-a)/(1+a),i),Math.tan(.5*(P-e))/a}function Oe(t,e){for(var s=.5*t,a,i,r=P-2*Math.atan(e),o=0;o<=15;o++)if(a=t*Math.sin(r),i=P-2*Math.atan(e*Math.pow((1-a)/(1+a),s))-r,r+=i,Math.abs(i)<=1e-10)return r;return-9999}function Fr(){var t=this.b/this.a;this.es=1-t*t,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=Lt(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function jr(t){var e=t.x,s=t.y;if(s*yt>90&&s*yt<-90&&e*yt>180&&e*yt<-180)return null;var a,i;if(Math.abs(Math.abs(s)-P)<=x)return null;if(this.sphere)a=this.x0+this.a*this.k0*G(e-this.long0,this.over),i=this.y0+this.a*this.k0*Math.log(Math.tan(U+.5*s));else{var r=Math.sin(s),o=Nt(this.e,s,r);a=this.x0+this.a*this.k0*G(e-this.long0,this.over),i=this.y0-this.a*this.k0*Math.log(o)}return t.x=a,t.y=i,t}function kr(t){var e=t.x-this.x0,s=t.y-this.y0,a,i;if(this.sphere)i=P-2*Math.atan(Math.exp(-s/(this.a*this.k0)));else{var r=Math.exp(-s/(this.a*this.k0));if(i=Oe(this.e,r),i===-9999)return null}return a=G(this.long0+e/(this.a*this.k0),this.over),t.x=a,t.y=i,t}var qr=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","Mercator_Variant_A","merc"];const $r={init:Fr,forward:jr,inverse:kr,names:qr};function Dr(){}function ba(t){return t}var Ka=["longlat","identity"];const Ur={init:Dr,forward:ba,inverse:ba,names:Ka};var Br=[$r,Ur],Ht={},ae=[];function Za(t,e){var s=ae.length;return t.names?(ae[s]=t,t.names.forEach(function(a){Ht[a.toLowerCase()]=s}),this):(console.log(e),!0)}function Ya(t){return t.replace(/[-\(\)\s]+/g," ").trim().replace(/ /g,"_")}function zr(t){if(!t)return!1;var e=t.toLowerCase();if(typeof Ht[e]!="undefined"&&ae[Ht[e]]||(e=Ya(e),e in Ht&&ae[Ht[e]]))return ae[Ht[e]]}function Wr(){Br.forEach(Za)}const Vr={start:Wr,add:Za,get:zr};var ti={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"},andrae:{a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"},clrk80:{a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:63782492e-1,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:63558348467e-4,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"},WGS84:{a:6378137,rf:298.257223563,ellipseName:"WGS 84"},sphere:{a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"}};const Hr=ti.WGS84;function Qr(t,e,s,a){var i=t*t,r=e*e,o=(i-r)/i,n=0;a?(t*=1-o*(fr+o*(gr+o*vr)),i=t*t,o=0):n=Math.sqrt(o);var h=(i-r)/r;return{es:o,e:n,ep2:h}}function Jr(t,e,s,a,i){if(!t){var r=$t(ti,a);r||(r=Hr),t=r.a,e=r.b,s=r.rf}return s&&!e&&(e=(1-1/s)*t),(s===0||Math.abs(t-e)<x)&&(i=!0,e=t),{a:t,b:e,rf:s,sphere:i}}var hs={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},mgi:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Militar-Geographische Institut"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Ordnance Survey of Great Britain 1936"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"},EPSG_5451:{towgs84:"6.41,-49.05,-11.28,1.5657,0.5242,6.9718,-5.7649"},IGNF_LURESG:{towgs84:"-192.986,13.673,-39.309,-0.4099,-2.9332,2.6881,0.43"},EPSG_4614:{towgs84:"-119.4248,-303.65872,-11.00061,1.164298,0.174458,1.096259,3.657065"},EPSG_4615:{towgs84:"-494.088,-312.129,279.877,-1.423,-1.013,1.59,-0.748"},ESRI_37241:{towgs84:"-76.822,257.457,-12.817,2.136,-0.033,-2.392,-0.031"},ESRI_37249:{towgs84:"-440.296,58.548,296.265,1.128,10.202,4.559,-0.438"},ESRI_37245:{towgs84:"-511.151,-181.269,139.609,1.05,2.703,1.798,3.071"},EPSG_4178:{towgs84:"24.9,-126.4,-93.2,-0.063,-0.247,-0.041,1.01"},EPSG_4622:{towgs84:"-472.29,-5.63,-304.12,0.4362,-0.8374,0.2563,1.8984"},EPSG_4625:{towgs84:"126.93,547.94,130.41,-2.7867,5.1612,-0.8584,13.8227"},EPSG_5252:{towgs84:"0.023,0.036,-0.068,0.00176,0.00912,-0.01136,0.00439"},EPSG_4314:{towgs84:"597.1,71.4,412.1,0.894,0.068,-1.563,7.58"},EPSG_4282:{towgs84:"-178.3,-316.7,-131.5,5.278,6.077,10.979,19.166"},EPSG_4231:{towgs84:"-83.11,-97.38,-117.22,0.005693,-0.044698,0.044285,0.1218"},EPSG_4274:{towgs84:"-230.994,102.591,25.199,0.633,-0.239,0.9,1.95"},EPSG_4134:{towgs84:"-180.624,-225.516,173.919,-0.81,-1.898,8.336,16.71006"},EPSG_4254:{towgs84:"18.38,192.45,96.82,0.056,-0.142,-0.2,-0.0013"},EPSG_4159:{towgs84:"-194.513,-63.978,-25.759,-3.4027,3.756,-3.352,-0.9175"},EPSG_4687:{towgs84:"0.072,-0.507,-0.245,0.0183,-0.0003,0.007,-0.0093"},EPSG_4227:{towgs84:"-83.58,-397.54,458.78,-17.595,-2.847,4.256,3.225"},EPSG_4746:{towgs84:"599.4,72.4,419.2,-0.062,-0.022,-2.723,6.46"},EPSG_4745:{towgs84:"612.4,77,440.2,-0.054,0.057,-2.797,2.55"},EPSG_6311:{towgs84:"8.846,-4.394,-1.122,-0.00237,-0.146528,0.130428,0.783926"},EPSG_4289:{towgs84:"565.7381,50.4018,465.2904,-0.395026,0.330772,-1.876073,4.07244"},EPSG_4230:{towgs84:"-68.863,-134.888,-111.49,-0.53,-0.14,0.57,-3.4"},EPSG_4154:{towgs84:"-123.02,-158.95,-168.47"},EPSG_4156:{towgs84:"570.8,85.7,462.8,4.998,1.587,5.261,3.56"},EPSG_4299:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4179:{towgs84:"33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84"},EPSG_4313:{towgs84:"-106.8686,52.2978,-103.7239,0.3366,-0.457,1.8422,-1.2747"},EPSG_4194:{towgs84:"163.511,127.533,-159.789"},EPSG_4195:{towgs84:"105,326,-102.5"},EPSG_4196:{towgs84:"-45,417,-3.5"},EPSG_4611:{towgs84:"-162.619,-276.959,-161.764,0.067753,-2.243648,-1.158828,-1.094246"},EPSG_4633:{towgs84:"137.092,131.66,91.475,-1.9436,-11.5993,-4.3321,-7.4824"},EPSG_4641:{towgs84:"-408.809,366.856,-412.987,1.8842,-0.5308,2.1655,-121.0993"},EPSG_4643:{towgs84:"-480.26,-438.32,-643.429,16.3119,20.1721,-4.0349,-111.7002"},EPSG_4300:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4188:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4660:{towgs84:"982.6087,552.753,-540.873,6.681627,-31.611492,-19.848161,16.805"},EPSG_4662:{towgs84:"97.295,-263.247,310.882,-1.5999,0.8386,3.1409,13.3259"},EPSG_3906:{towgs84:"577.88891,165.22205,391.18289,4.9145,-0.94729,-13.05098,7.78664"},EPSG_4307:{towgs84:"-209.3622,-87.8162,404.6198,0.0046,3.4784,0.5805,-1.4547"},EPSG_6892:{towgs84:"-76.269,-16.683,68.562,-6.275,10.536,-4.286,-13.686"},EPSG_4690:{towgs84:"221.597,152.441,176.523,2.403,1.3893,0.884,11.4648"},EPSG_4691:{towgs84:"218.769,150.75,176.75,3.5231,2.0037,1.288,10.9817"},EPSG_4629:{towgs84:"72.51,345.411,79.241,-1.5862,-0.8826,-0.5495,1.3653"},EPSG_4630:{towgs84:"165.804,216.213,180.26,-0.6251,-0.4515,-0.0721,7.4111"},EPSG_4692:{towgs84:"217.109,86.452,23.711,0.0183,-0.0003,0.007,-0.0093"},EPSG_9333:{towgs84:"0,0,0,-0.008393,0.000749,-0.010276,0"},EPSG_9059:{towgs84:"0,0,0"},EPSG_4312:{towgs84:"601.705,84.263,485.227,4.7354,1.3145,5.393,-2.3887"},EPSG_4123:{towgs84:"-96.062,-82.428,-121.753,4.801,0.345,-1.376,1.496"},EPSG_4309:{towgs84:"-124.45,183.74,44.64,-0.4384,0.5446,-0.9706,-2.1365"},ESRI_104106:{towgs84:"-283.088,-70.693,117.445,-1.157,0.059,-0.652,-4.058"},EPSG_4281:{towgs84:"-219.247,-73.802,269.529"},EPSG_4322:{towgs84:"0,0,4.5"},EPSG_4324:{towgs84:"0,0,1.9"},EPSG_4284:{towgs84:"43.822,-108.842,-119.585,1.455,-0.761,0.737,0.549"},EPSG_4277:{towgs84:"446.448,-125.157,542.06,0.15,0.247,0.842,-20.489"},EPSG_4207:{towgs84:"-282.1,-72.2,120,-1.529,0.145,-0.89,-4.46"},EPSG_4688:{towgs84:"347.175,1077.618,2623.677,33.9058,-70.6776,9.4013,186.0647"},EPSG_4689:{towgs84:"410.793,54.542,80.501,-2.5596,-2.3517,-0.6594,17.3218"},EPSG_4720:{towgs84:"0,0,4.5"},EPSG_4273:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},EPSG_4240:{towgs84:"204.64,834.74,293.8"},EPSG_4817:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},ESRI_104131:{towgs84:"426.62,142.62,460.09,4.98,4.49,-12.42,-17.1"},EPSG_4265:{towgs84:"-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68"},EPSG_4263:{towgs84:"-111.92,-87.85,114.5,1.875,0.202,0.219,0.032"},EPSG_4298:{towgs84:"-689.5937,623.84046,-65.93566,-0.02331,1.17094,-0.80054,5.88536"},EPSG_4270:{towgs84:"-253.4392,-148.452,386.5267,0.15605,0.43,-0.1013,-0.0424"},EPSG_4229:{towgs84:"-121.8,98.1,-10.7"},EPSG_4220:{towgs84:"-55.5,-348,-229.2"},EPSG_4214:{towgs84:"12.646,-155.176,-80.863"},EPSG_4232:{towgs84:"-345,3,223"},EPSG_4238:{towgs84:"-1.977,-13.06,-9.993,0.364,0.254,0.689,-1.037"},EPSG_4168:{towgs84:"-170,33,326"},EPSG_4131:{towgs84:"199,931,318.9"},EPSG_4152:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_5228:{towgs84:"572.213,85.334,461.94,4.9732,1.529,5.2484,3.5378"},EPSG_8351:{towgs84:"485.021,169.465,483.839,7.786342,4.397554,4.102655,0"},EPSG_4683:{towgs84:"-127.62,-67.24,-47.04,-3.068,4.903,1.578,-1.06"},EPSG_4133:{towgs84:"0,0,0"},EPSG_7373:{towgs84:"0.819,-0.5762,-1.6446,-0.00378,-0.03317,0.00318,0.0693"},EPSG_9075:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9072:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9294:{towgs84:"1.16835,-1.42001,-2.24431,-0.00822,-0.05508,0.01818,0.23388"},EPSG_4212:{towgs84:"-267.434,173.496,181.814,-13.4704,8.7154,7.3926,14.7492"},EPSG_4191:{towgs84:"-44.183,-0.58,-38.489,2.3867,2.7072,-3.5196,-8.2703"},EPSG_4237:{towgs84:"52.684,-71.194,-13.975,-0.312,-0.1063,-0.3729,1.0191"},EPSG_4740:{towgs84:"-1.08,-0.27,-0.9"},EPSG_4124:{towgs84:"419.3836,99.3335,591.3451,0.850389,1.817277,-7.862238,-0.99496"},EPSG_5681:{towgs84:"584.9636,107.7175,413.8067,1.1155,0.2824,-3.1384,7.9922"},EPSG_4141:{towgs84:"23.772,17.49,17.859,-0.3132,-1.85274,1.67299,-5.4262"},EPSG_4204:{towgs84:"-85.645,-273.077,-79.708,2.289,-1.421,2.532,3.194"},EPSG_4319:{towgs84:"226.702,-193.337,-35.371,-2.229,-4.391,9.238,0.9798"},EPSG_4200:{towgs84:"24.82,-131.21,-82.66"},EPSG_4130:{towgs84:"0,0,0"},EPSG_4127:{towgs84:"-82.875,-57.097,-156.768,-2.158,1.524,-0.982,-0.359"},EPSG_4149:{towgs84:"674.374,15.056,405.346"},EPSG_4617:{towgs84:"-0.991,1.9072,0.5129,0.02579,0.00965,0.01166,0"},EPSG_4663:{towgs84:"-210.502,-66.902,-48.476,2.094,-15.067,-5.817,0.485"},EPSG_4664:{towgs84:"-211.939,137.626,58.3,-0.089,0.251,0.079,0.384"},EPSG_4665:{towgs84:"-105.854,165.589,-38.312,-0.003,-0.026,0.024,-0.048"},EPSG_4666:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},EPSG_4756:{towgs84:"-192.873,-39.382,-111.202,-0.00205,-0.0005,0.00335,0.0188"},EPSG_4723:{towgs84:"-179.483,-69.379,-27.584,-7.862,8.163,6.042,-13.925"},EPSG_4726:{towgs84:"8.853,-52.644,180.304,-0.393,-2.323,2.96,-24.081"},EPSG_4267:{towgs84:"-8.0,160.0,176.0"},EPSG_5365:{towgs84:"-0.16959,0.35312,0.51846,0.03385,-0.16325,0.03446,0.03693"},EPSG_4218:{towgs84:"304.5,306.5,-318.1"},EPSG_4242:{towgs84:"-33.722,153.789,94.959,-8.581,-4.478,4.54,8.95"},EPSG_4216:{towgs84:"-292.295,248.758,429.447,4.9971,2.99,6.6906,1.0289"},ESRI_104105:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},ESRI_104129:{towgs84:"0,0,0"},EPSG_4673:{towgs84:"174.05,-25.49,112.57"},EPSG_4202:{towgs84:"-124,-60,154"},EPSG_4203:{towgs84:"-117.763,-51.51,139.061,0.292,0.443,0.277,-0.191"},EPSG_3819:{towgs84:"595.48,121.69,515.35,4.115,-2.9383,0.853,-3.408"},EPSG_8694:{towgs84:"-93.799,-132.737,-219.073,-1.844,0.648,-6.37,-0.169"},EPSG_4145:{towgs84:"275.57,676.78,229.6"},EPSG_4283:{towgs84:"0.06155,-0.01087,-0.04019,0.039492,0.032722,0.032898,-0.009994"},EPSG_4317:{towgs84:"2.3287,-147.0425,-92.0802,-0.309248,0.324822,0.497299,5.689063"},EPSG_4272:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993"},EPSG_4248:{towgs84:"-307.7,265.3,-363.5"},EPSG_5561:{towgs84:"24,-121,-76"},EPSG_5233:{towgs84:"-0.293,766.95,87.713,0.195704,1.695068,3.473016,-0.039338"},ESRI_104130:{towgs84:"-86,-98,-119"},ESRI_104102:{towgs84:"682,-203,480"},ESRI_37207:{towgs84:"7,-10,-26"},EPSG_4675:{towgs84:"59.935,118.4,-10.871"},ESRI_104109:{towgs84:"-89.121,-348.182,260.871"},ESRI_104112:{towgs84:"-185.583,-230.096,281.361"},ESRI_104113:{towgs84:"25.1,-275.6,222.6"},IGNF_WGS72G:{towgs84:"0,12,6"},IGNF_NTFG:{towgs84:"-168,-60,320"},IGNF_EFATE57G:{towgs84:"-127,-769,472"},IGNF_PGP50G:{towgs84:"324.8,153.6,172.1"},IGNF_REUN47G:{towgs84:"94,-948,-1262"},IGNF_CSG67G:{towgs84:"-186,230,110"},IGNF_GUAD48G:{towgs84:"-467,-16,-300"},IGNF_TAHI51G:{towgs84:"162,117,154"},IGNF_TAHAAG:{towgs84:"65,342,77"},IGNF_NUKU72G:{towgs84:"84,274,65"},IGNF_PETRELS72G:{towgs84:"365,194,166"},IGNF_WALL78G:{towgs84:"253,-133,-127"},IGNF_MAYO50G:{towgs84:"-382,-59,-262"},IGNF_TANNAG:{towgs84:"-139,-967,436"},IGNF_IGN72G:{towgs84:"-13,-348,292"},IGNF_ATIGG:{towgs84:"1118,23,66"},IGNF_FANGA84G:{towgs84:"150.57,158.33,118.32"},IGNF_RUSAT84G:{towgs84:"202.13,174.6,-15.74"},IGNF_KAUE70G:{towgs84:"126.74,300.1,-75.49"},IGNF_MOP90G:{towgs84:"-10.8,-1.8,12.77"},IGNF_MHPF67G:{towgs84:"338.08,212.58,-296.17"},IGNF_TAHI79G:{towgs84:"160.61,116.05,153.69"},IGNF_ANAA92G:{towgs84:"1.5,3.84,4.81"},IGNF_MARQUI72G:{towgs84:"330.91,-13.92,58.56"},IGNF_APAT86G:{towgs84:"143.6,197.82,74.05"},IGNF_TUBU69G:{towgs84:"237.17,171.61,-77.84"},IGNF_STPM50G:{towgs84:"11.363,424.148,373.13"},EPSG_4150:{towgs84:"674.374,15.056,405.346"},EPSG_4754:{towgs84:"-208.4058,-109.8777,-2.5764"},ESRI_104101:{towgs84:"372.87,149.23,585.29"},EPSG_4693:{towgs84:"0,-0.15,0.68"},EPSG_6207:{towgs84:"293.17,726.18,245.36"},EPSG_4153:{towgs84:"-133.63,-157.5,-158.62"},EPSG_4132:{towgs84:"-241.54,-163.64,396.06"},EPSG_4221:{towgs84:"-154.5,150.7,100.4"},EPSG_4266:{towgs84:"-80.7,-132.5,41.1"},EPSG_4193:{towgs84:"-70.9,-151.8,-41.4"},EPSG_5340:{towgs84:"-0.41,0.46,-0.35"},EPSG_4246:{towgs84:"-294.7,-200.1,525.5"},EPSG_4318:{towgs84:"-3.2,-5.7,2.8"},EPSG_4121:{towgs84:"-199.87,74.79,246.62"},EPSG_4223:{towgs84:"-260.1,5.5,432.2"},EPSG_4158:{towgs84:"-0.465,372.095,171.736"},EPSG_4285:{towgs84:"-128.16,-282.42,21.93"},EPSG_4613:{towgs84:"-404.78,685.68,45.47"},EPSG_4607:{towgs84:"195.671,332.517,274.607"},EPSG_4475:{towgs84:"-381.788,-57.501,-256.673"},EPSG_4208:{towgs84:"-157.84,308.54,-146.6"},EPSG_4743:{towgs84:"70.995,-335.916,262.898"},EPSG_4710:{towgs84:"-323.65,551.39,-491.22"},EPSG_7881:{towgs84:"-0.077,0.079,0.086"},EPSG_4682:{towgs84:"283.729,735.942,261.143"},EPSG_4739:{towgs84:"-156,-271,-189"},EPSG_4679:{towgs84:"-80.01,253.26,291.19"},EPSG_4750:{towgs84:"-56.263,16.136,-22.856"},EPSG_4644:{towgs84:"-10.18,-350.43,291.37"},EPSG_4695:{towgs84:"-103.746,-9.614,-255.95"},EPSG_4292:{towgs84:"-355,21,72"},EPSG_4302:{towgs84:"-61.702,284.488,472.052"},EPSG_4143:{towgs84:"-124.76,53,466.79"},EPSG_4606:{towgs84:"-153,153,307"},EPSG_4699:{towgs84:"-770.1,158.4,-498.2"},EPSG_4247:{towgs84:"-273.5,110.6,-357.9"},EPSG_4160:{towgs84:"8.88,184.86,106.69"},EPSG_4161:{towgs84:"-233.43,6.65,173.64"},EPSG_9251:{towgs84:"-9.5,122.9,138.2"},EPSG_9253:{towgs84:"-78.1,101.6,133.3"},EPSG_4297:{towgs84:"-198.383,-240.517,-107.909"},EPSG_4269:{towgs84:"0,0,0"},EPSG_4301:{towgs84:"-147,506,687"},EPSG_4618:{towgs84:"-59,-11,-52"},EPSG_4612:{towgs84:"0,0,0"},EPSG_4678:{towgs84:"44.585,-131.212,-39.544"},EPSG_4250:{towgs84:"-130,29,364"},EPSG_4144:{towgs84:"214,804,268"},EPSG_4147:{towgs84:"-17.51,-108.32,-62.39"},EPSG_4259:{towgs84:"-254.1,-5.36,-100.29"},EPSG_4164:{towgs84:"-76,-138,67"},EPSG_4211:{towgs84:"-378.873,676.002,-46.255"},EPSG_4182:{towgs84:"-422.651,-172.995,84.02"},EPSG_4224:{towgs84:"-143.87,243.37,-33.52"},EPSG_4225:{towgs84:"-205.57,168.77,-4.12"},EPSG_5527:{towgs84:"-67.35,3.88,-38.22"},EPSG_4752:{towgs84:"98,390,-22"},EPSG_4310:{towgs84:"-30,190,89"},EPSG_9248:{towgs84:"-192.26,65.72,132.08"},EPSG_4680:{towgs84:"124.5,-63.5,-281"},EPSG_4701:{towgs84:"-79.9,-158,-168.9"},EPSG_4706:{towgs84:"-146.21,112.63,4.05"},EPSG_4805:{towgs84:"682,-203,480"},EPSG_4201:{towgs84:"-165,-11,206"},EPSG_4210:{towgs84:"-157,-2,-299"},EPSG_4183:{towgs84:"-104,167,-38"},EPSG_4139:{towgs84:"11,72,-101"},EPSG_4668:{towgs84:"-86,-98,-119"},EPSG_4717:{towgs84:"-2,151,181"},EPSG_4732:{towgs84:"102,52,-38"},EPSG_4280:{towgs84:"-377,681,-50"},EPSG_4209:{towgs84:"-138,-105,-289"},EPSG_4261:{towgs84:"31,146,47"},EPSG_4658:{towgs84:"-73,46,-86"},EPSG_4721:{towgs84:"265.025,384.929,-194.046"},EPSG_4222:{towgs84:"-136,-108,-292"},EPSG_4601:{towgs84:"-255,-15,71"},EPSG_4602:{towgs84:"725,685,536"},EPSG_4603:{towgs84:"72,213.7,93"},EPSG_4605:{towgs84:"9,183,236"},EPSG_4621:{towgs84:"137,248,-430"},EPSG_4657:{towgs84:"-28,199,5"},EPSG_4316:{towgs84:"103.25,-100.4,-307.19"},EPSG_4642:{towgs84:"-13,-348,292"},EPSG_4698:{towgs84:"145,-187,103"},EPSG_4192:{towgs84:"-206.1,-174.7,-87.7"},EPSG_4311:{towgs84:"-265,120,-358"},EPSG_4135:{towgs84:"58,-283,-182"},ESRI_104138:{towgs84:"198,-226,-347"},EPSG_4245:{towgs84:"-11,851,5"},EPSG_4142:{towgs84:"-125,53,467"},EPSG_4213:{towgs84:"-106,-87,188"},EPSG_4253:{towgs84:"-133,-77,-51"},EPSG_4129:{towgs84:"-132,-110,-335"},EPSG_4713:{towgs84:"-77,-128,142"},EPSG_4239:{towgs84:"217,823,299"},EPSG_4146:{towgs84:"295,736,257"},EPSG_4155:{towgs84:"-83,37,124"},EPSG_4165:{towgs84:"-173,253,27"},EPSG_4672:{towgs84:"175,-38,113"},EPSG_4236:{towgs84:"-637,-549,-203"},EPSG_4251:{towgs84:"-90,40,88"},EPSG_4271:{towgs84:"-2,374,172"},EPSG_4175:{towgs84:"-88,4,101"},EPSG_4716:{towgs84:"298,-304,-375"},EPSG_4315:{towgs84:"-23,259,-9"},EPSG_4744:{towgs84:"-242.2,-144.9,370.3"},EPSG_4244:{towgs84:"-97,787,86"},EPSG_4293:{towgs84:"616,97,-251"},EPSG_4714:{towgs84:"-127,-769,472"},EPSG_4736:{towgs84:"260,12,-147"},EPSG_6883:{towgs84:"-235,-110,393"},EPSG_6894:{towgs84:"-63,176,185"},EPSG_4205:{towgs84:"-43,-163,45"},EPSG_4256:{towgs84:"41,-220,-134"},EPSG_4262:{towgs84:"639,405,60"},EPSG_4604:{towgs84:"174,359,365"},EPSG_4169:{towgs84:"-115,118,426"},EPSG_4620:{towgs84:"-106,-129,165"},EPSG_4184:{towgs84:"-203,141,53"},EPSG_4616:{towgs84:"-289,-124,60"},EPSG_9403:{towgs84:"-307,-92,127"},EPSG_4684:{towgs84:"-133,-321,50"},EPSG_4708:{towgs84:"-491,-22,435"},EPSG_4707:{towgs84:"114,-116,-333"},EPSG_4709:{towgs84:"145,75,-272"},EPSG_4712:{towgs84:"-205,107,53"},EPSG_4711:{towgs84:"124,-234,-25"},EPSG_4718:{towgs84:"230,-199,-752"},EPSG_4719:{towgs84:"211,147,111"},EPSG_4724:{towgs84:"208,-435,-229"},EPSG_4725:{towgs84:"189,-79,-202"},EPSG_4735:{towgs84:"647,1777,-1124"},EPSG_4722:{towgs84:"-794,119,-298"},EPSG_4728:{towgs84:"-307,-92,127"},EPSG_4734:{towgs84:"-632,438,-609"},EPSG_4727:{towgs84:"912,-58,1227"},EPSG_4729:{towgs84:"185,165,42"},EPSG_4730:{towgs84:"170,42,84"},EPSG_4733:{towgs84:"276,-57,149"},ESRI_37218:{towgs84:"230,-199,-752"},ESRI_37240:{towgs84:"-7,215,225"},ESRI_37221:{towgs84:"252,-209,-751"},ESRI_4305:{towgs84:"-123,-206,219"},ESRI_104139:{towgs84:"-73,-247,227"},EPSG_4748:{towgs84:"51,391,-36"},EPSG_4219:{towgs84:"-384,664,-48"},EPSG_4255:{towgs84:"-333,-222,114"},EPSG_4257:{towgs84:"-587.8,519.75,145.76"},EPSG_4646:{towgs84:"-963,510,-359"},EPSG_6881:{towgs84:"-24,-203,268"},EPSG_6882:{towgs84:"-183,-15,273"},EPSG_4715:{towgs84:"-104,-129,239"},IGNF_RGF93GDD:{towgs84:"0,0,0"},IGNF_RGM04GDD:{towgs84:"0,0,0"},IGNF_RGSPM06GDD:{towgs84:"0,0,0"},IGNF_RGTAAF07GDD:{towgs84:"0,0,0"},IGNF_RGFG95GDD:{towgs84:"0,0,0"},IGNF_RGNCG:{towgs84:"0,0,0"},IGNF_RGPFGDD:{towgs84:"0,0,0"},IGNF_ETRS89G:{towgs84:"0,0,0"},IGNF_RGR92GDD:{towgs84:"0,0,0"},EPSG_4173:{towgs84:"0,0,0"},EPSG_4180:{towgs84:"0,0,0"},EPSG_4619:{towgs84:"0,0,0"},EPSG_4667:{towgs84:"0,0,0"},EPSG_4075:{towgs84:"0,0,0"},EPSG_6706:{towgs84:"0,0,0"},EPSG_7798:{towgs84:"0,0,0"},EPSG_4661:{towgs84:"0,0,0"},EPSG_4669:{towgs84:"0,0,0"},EPSG_8685:{towgs84:"0,0,0"},EPSG_4151:{towgs84:"0,0,0"},EPSG_9702:{towgs84:"0,0,0"},EPSG_4758:{towgs84:"0,0,0"},EPSG_4761:{towgs84:"0,0,0"},EPSG_4765:{towgs84:"0,0,0"},EPSG_8997:{towgs84:"0,0,0"},EPSG_4023:{towgs84:"0,0,0"},EPSG_4670:{towgs84:"0,0,0"},EPSG_4694:{towgs84:"0,0,0"},EPSG_4148:{towgs84:"0,0,0"},EPSG_4163:{towgs84:"0,0,0"},EPSG_4167:{towgs84:"0,0,0"},EPSG_4189:{towgs84:"0,0,0"},EPSG_4190:{towgs84:"0,0,0"},EPSG_4176:{towgs84:"0,0,0"},EPSG_4659:{towgs84:"0,0,0"},EPSG_3824:{towgs84:"0,0,0"},EPSG_3889:{towgs84:"0,0,0"},EPSG_4046:{towgs84:"0,0,0"},EPSG_4081:{towgs84:"0,0,0"},EPSG_4558:{towgs84:"0,0,0"},EPSG_4483:{towgs84:"0,0,0"},EPSG_5013:{towgs84:"0,0,0"},EPSG_5264:{towgs84:"0,0,0"},EPSG_5324:{towgs84:"0,0,0"},EPSG_5354:{towgs84:"0,0,0"},EPSG_5371:{towgs84:"0,0,0"},EPSG_5373:{towgs84:"0,0,0"},EPSG_5381:{towgs84:"0,0,0"},EPSG_5393:{towgs84:"0,0,0"},EPSG_5489:{towgs84:"0,0,0"},EPSG_5593:{towgs84:"0,0,0"},EPSG_6135:{towgs84:"0,0,0"},EPSG_6365:{towgs84:"0,0,0"},EPSG_5246:{towgs84:"0,0,0"},EPSG_7886:{towgs84:"0,0,0"},EPSG_8431:{towgs84:"0,0,0"},EPSG_8427:{towgs84:"0,0,0"},EPSG_8699:{towgs84:"0,0,0"},EPSG_8818:{towgs84:"0,0,0"},EPSG_4757:{towgs84:"0,0,0"},EPSG_9140:{towgs84:"0,0,0"},EPSG_8086:{towgs84:"0,0,0"},EPSG_4686:{towgs84:"0,0,0"},EPSG_4737:{towgs84:"0,0,0"},EPSG_4702:{towgs84:"0,0,0"},EPSG_4747:{towgs84:"0,0,0"},EPSG_4749:{towgs84:"0,0,0"},EPSG_4674:{towgs84:"0,0,0"},EPSG_4755:{towgs84:"0,0,0"},EPSG_4759:{towgs84:"0,0,0"},EPSG_4762:{towgs84:"0,0,0"},EPSG_4763:{towgs84:"0,0,0"},EPSG_4764:{towgs84:"0,0,0"},EPSG_4166:{towgs84:"0,0,0"},EPSG_4170:{towgs84:"0,0,0"},EPSG_5546:{towgs84:"0,0,0"},EPSG_7844:{towgs84:"0,0,0"},EPSG_4818:{towgs84:"589,76,480"},EPSG_10328:{towgs84:"0,0,0"},EPSG_9782:{towgs84:"0,0,0"},EPSG_9777:{towgs84:"0,0,0"},EPSG_10690:{towgs84:"0,0,0"},EPSG_10639:{towgs84:"0,0,0"},EPSG_10739:{towgs84:"0,0,0"},EPSG_7686:{towgs84:"0,0,0"},EPSG_8900:{towgs84:"0,0,0"},EPSG_5886:{towgs84:"0,0,0"},EPSG_7683:{towgs84:"0,0,0"},EPSG_6668:{towgs84:"0,0,0"},EPSG_20046:{towgs84:"0,0,0"},EPSG_10299:{towgs84:"0,0,0"},EPSG_10310:{towgs84:"0,0,0"},EPSG_10475:{towgs84:"0,0,0"},EPSG_4742:{towgs84:"0,0,0"},EPSG_10671:{towgs84:"0,0,0"},EPSG_10762:{towgs84:"0,0,0"},EPSG_10725:{towgs84:"0,0,0"},EPSG_10791:{towgs84:"0,0,0"},EPSG_10800:{towgs84:"0,0,0"},EPSG_10305:{towgs84:"0,0,0"},EPSG_10941:{towgs84:"0,0,0"},EPSG_10968:{towgs84:"0,0,0"},EPSG_10875:{towgs84:"0,0,0"},EPSG_6318:{towgs84:"0,0,0"},EPSG_10910:{towgs84:"0,0,0"}};for(var Xr in hs){var Fs=hs[Xr];Fs.datumName&&(hs[Fs.datumName]=Fs)}function Kr(t,e,s,a,i,r,o){var n={};return n.datum_type=$s,e&&(n.datum_type=ur,n.datum_params=e.map(parseFloat),(n.datum_params[0]!==0||n.datum_params[1]!==0||n.datum_params[2]!==0)&&(n.datum_type=Jt),n.datum_params.length>3&&(n.datum_params[3]!==0||n.datum_params[4]!==0||n.datum_params[5]!==0||n.datum_params[6]!==0)&&(n.datum_type=Xt,n.datum_params[3]*=Ne,n.datum_params[4]*=Ne,n.datum_params[5]*=Ne,n.datum_params[6]=n.datum_params[6]/1e6+1)),o&&(n.datum_type=ne,n.grids=o),n.a=s,n.b=a,n.es=i,n.ep2=r,n}var Qs={};function Zr(t,e,s){return e instanceof ArrayBuffer?Yr(t,e,s):{ready:tn(t,e)}}function Yr(t,e,s){var a=!0;s!==void 0&&s.includeErrorFields===!1&&(a=!1);var i=new DataView(e),r=an(i),o=rn(i,r),n=nn(i,o,r,a),h={header:o,subgrids:n};return Qs[t]=h,h}function tn(t,e){return nt(this,null,function*(){for(var s=[],a=yield e.getImageCount(),i=a-1;i>=0;i--){var r=yield e.getImage(i),o=yield r.readRasters(),n=o,h=[r.getWidth(),r.getHeight()],l=r.getBoundingBox().map(Ga),g=typeof r.fileDirectory.getValue=="function"?r.fileDirectory.getValue("ModelPixelScale"):r.fileDirectory.ModelPixelScale,f=[g[0],g[1]].map(Ga),u=l[0]+(h[0]-1)*f[0],y=l[3]-(h[1]-1)*f[1],w=n[0],E=n[1],S=[];for(let I=h[1]-1;I>=0;I--)for(let T=h[0]-1;T>=0;T--){var b=I*h[0]+T;S.push([-qt(E[b]),qt(w[b])])}s.push({del:f,lim:h,ll:[-u,y],cvs:S})}var A={header:{nSubgrids:a},subgrids:s};return Qs[t]=A,A})}function en(t){if(t===void 0)return null;var e=t.split(",");return e.map(sn)}function sn(t){if(t.length===0)return null;var e=t[0]==="@";return e&&(t=t.slice(1)),t==="null"?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:t,mandatory:!e,grid:Qs[t]||null,isNull:!1}}function Ga(t){return t*Math.PI/180}function qt(t){return t/3600*Math.PI/180}function an(t){var e=t.getInt32(8,!1);return e===11?!1:(e=t.getInt32(8,!0),e!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function rn(t,e){return{nFields:t.getInt32(8,e),nSubgridFields:t.getInt32(24,e),nSubgrids:t.getInt32(40,e),shiftType:Us(t,56,56+8).trim(),fromSemiMajorAxis:t.getFloat64(120,e),fromSemiMinorAxis:t.getFloat64(136,e),toSemiMajorAxis:t.getFloat64(152,e),toSemiMinorAxis:t.getFloat64(168,e)}}function Us(t,e,s){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(e,s)))}function nn(t,e,s,a){for(var i=176,r=[],o=0;o<e.nSubgrids;o++){var n=hn(t,i,s),h=ln(t,i,n,s,a),l=Math.round(1+(n.upperLongitude-n.lowerLongitude)/n.longitudeInterval),g=Math.round(1+(n.upperLatitude-n.lowerLatitude)/n.latitudeInterval);r.push({ll:[qt(n.lowerLongitude),qt(n.lowerLatitude)],del:[qt(n.longitudeInterval),qt(n.latitudeInterval)],lim:[l,g],count:n.gridNodeCount,cvs:on(h)});var f=16;a===!1&&(f=8),i+=176+n.gridNodeCount*f}return r}function on(t){return t.map(function(e){return[qt(e.longitudeShift),qt(e.latitudeShift)]})}function hn(t,e,s){return{name:Us(t,e+8,e+16).trim(),parent:Us(t,e+24,e+24+8).trim(),lowerLatitude:t.getFloat64(e+72,s),upperLatitude:t.getFloat64(e+88,s),lowerLongitude:t.getFloat64(e+104,s),upperLongitude:t.getFloat64(e+120,s),latitudeInterval:t.getFloat64(e+136,s),longitudeInterval:t.getFloat64(e+152,s),gridNodeCount:t.getInt32(e+168,s)}}function ln(t,e,s,a,i){var r=e+176,o=16;i===!1&&(o=8);for(var n=[],h=0;h<s.gridNodeCount;h++){var l={latitudeShift:t.getFloat32(r+h*o,a),longitudeShift:t.getFloat32(r+h*o+4,a)};i!==!1&&(l.latitudeAccuracy=t.getFloat32(r+h*o+8,a),l.longitudeAccuracy=t.getFloat32(r+h*o+12,a)),n.push(l)}return n}function pt(t,e){if(!(this instanceof pt))return new pt(t);this.forward=null,this.inverse=null,this.init=null,this.name,this.axis,this.names=null,this.title,e=e||function(l){if(l)throw l};var s=Or(t);if(typeof s!="object"){e("Could not parse to valid json: "+t);return}var a=pt.projections.get(s.projName);if(!a){e("Could not get projection name from: "+t);return}if(s.datumCode&&s.datumCode!=="none"){var i=$t(hs,s.datumCode);i&&(s.datum_params=s.datum_params||(i.towgs84?i.towgs84.split(","):null),s.ellps=i.ellipse,s.datumName=i.datumName?i.datumName:s.datumCode)}s.k0=s.k0||1,s.axis=s.axis||"enu",s.ellps=s.ellps||"wgs84",s.lat1=s.lat1||s.lat0;var r=Jr(s.a,s.b,s.rf,s.ellps,s.sphere),o=Qr(r.a,r.b,r.rf,s.R_A),n=en(s.nadgrids),h=s.datum||Kr(s.datumCode,s.datum_params,r.a,r.b,o.es,o.ep2,n);xa(this,s),xa(this,a),this.a=r.a,this.b=r.b,this.rf=r.rf,this.sphere=r.sphere,this.es=o.es,this.e=o.e,this.ep2=o.ep2,this.datum=h,"init"in this&&typeof this.init=="function"&&this.init(),e(null,this)}pt.projections=Vr;pt.projections.start();function un(t,e){return t.datum_type!==e.datum_type||t.a!==e.a||Math.abs(t.es-e.es)>5e-11?!1:t.datum_type===Jt?t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]:t.datum_type===Xt?t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]&&t.datum_params[3]===e.datum_params[3]&&t.datum_params[4]===e.datum_params[4]&&t.datum_params[5]===e.datum_params[5]&&t.datum_params[6]===e.datum_params[6]:!0}function ei(t,e,s){var a=t.x,i=t.y,r=t.z?t.z:0,o,n,h,l;if(i<-P&&i>-1.001*P)i=-P;else if(i>P&&i<1.001*P)i=P;else{if(i<-P)return{x:-1/0,y:-1/0,z:t.z};if(i>P)return{x:1/0,y:1/0,z:t.z}}return a>Math.PI&&(a-=2*Math.PI),n=Math.sin(i),l=Math.cos(i),h=n*n,o=s/Math.sqrt(1-e*h),{x:(o+r)*l*Math.cos(a),y:(o+r)*l*Math.sin(a),z:(o*(1-e)+r)*n}}function si(t,e,s,a){var i=1e-12,r=i*i,o=30,n,h,l,g,f,u,y,w,E,S,b,A,I,T=t.x,j=t.y,O=t.z?t.z:0,F,K,W;if(n=Math.sqrt(T*T+j*j),h=Math.sqrt(T*T+j*j+O*O),n/s<i){if(F=0,h/s<i)return K=P,W=-a,{x:t.x,y:t.y,z:t.z}}else F=Math.atan2(j,T);l=O/h,g=n/h,f=1/Math.sqrt(1-e*(2-e)*g*g),w=g*(1-e)*f,E=l*f,I=0;do I++,y=s/Math.sqrt(1-e*E*E),W=n*w+O*E-y*(1-e*E*E),u=e*y/(y+W),f=1/Math.sqrt(1-u*(2-u)*g*g),S=g*(1-u)*f,b=l*f,A=b*w-S*E,w=S,E=b;while(A*A>r&&I<o);return K=Math.atan(b/Math.abs(S)),{x:F,y:K,z:W}}function cn(t,e,s){if(e===Jt)return{x:t.x+s[0],y:t.y+s[1],z:t.z+s[2]};if(e===Xt){var a=s[0],i=s[1],r=s[2],o=s[3],n=s[4],h=s[5],l=s[6];return{x:l*(t.x-h*t.y+n*t.z)+a,y:l*(h*t.x+t.y-o*t.z)+i,z:l*(-n*t.x+o*t.y+t.z)+r}}}function fn(t,e,s){if(e===Jt)return{x:t.x-s[0],y:t.y-s[1],z:t.z-s[2]};if(e===Xt){var a=s[0],i=s[1],r=s[2],o=s[3],n=s[4],h=s[5],l=s[6],g=(t.x-a)/l,f=(t.y-i)/l,u=(t.z-r)/l;return{x:g+h*f-n*u,y:-h*g+f+o*u,z:n*g-o*f+u}}}function rs(t){return t===Jt||t===Xt}function gn(t,e,s){if(un(t,e)||t.datum_type===$s||e.datum_type===$s)return s;var a=t.a,i=t.es;if(t.datum_type===ne){var r=Na(t,!1,s);if(r!==0)return;a=ma,i=ya}var o=e.a,n=e.b,h=e.es;if(e.datum_type===ne&&(o=ma,n=cr,h=ya),i===h&&a===o&&!rs(t.datum_type)&&!rs(e.datum_type))return s;if(s=ei(s,i,a),rs(t.datum_type)&&(s=cn(s,t.datum_type,t.datum_params)),rs(e.datum_type)&&(s=fn(s,e.datum_type,e.datum_params)),s=si(s,h,o,n),e.datum_type===ne){var l=Na(e,!0,s);if(l!==0)return}return s}function Na(t,e,s){if(t.grids===null||t.grids.length===0)return console.log("Grid shift grids not found"),-1;var a={x:-s.x,y:s.y},i={x:Number.NaN,y:Number.NaN},r=[];t:for(var o=0;o<t.grids.length;o++){var n=t.grids[o];if(r.push(n.name),n.isNull){i=a;break}if(n.grid===null){if(n.mandatory)return console.log("Unable to find mandatory grid '"+n.name+"'"),-1;continue}for(var h=n.grid.subgrids,l=0,g=h.length;l<g;l++){var f=h[l],u=(Math.abs(f.del[1])+Math.abs(f.del[0]))/1e4,y=f.ll[0]-u,w=f.ll[1]-u,E=f.ll[0]+(f.lim[0]-1)*f.del[0]+u,S=f.ll[1]+(f.lim[1]-1)*f.del[1]+u;if(!(w>a.y||y>a.x||S<a.y||E<a.x)&&(i=vn(a,e,f),!isNaN(i.x)))break t}}return isNaN(i.x)?(console.log("Failed to find a grid shift table for location '"+-a.x*yt+" "+a.y*yt+" tried: '"+r+"'"),-1):(s.x=-i.x,s.y=i.y,0)}function vn(t,e,s){var a={x:Number.NaN,y:Number.NaN};if(isNaN(t.x))return a;var i={x:t.x,y:t.y};i.x-=s.ll[0],i.y-=s.ll[1],i.x=G(i.x-Math.PI)+Math.PI;var r=Aa(i,s);if(e){if(isNaN(r.x))return a;r.x=i.x-r.x,r.y=i.y-r.y;var o=9,n=1e-12,h,l;do{if(l=Aa(r,s),isNaN(l.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}h={x:i.x-(l.x+r.x),y:i.y-(l.y+r.y)},r.x+=h.x,r.y+=h.y}while(o--&&Math.abs(h.x)>n&&Math.abs(h.y)>n);if(o<0)return console.log("Inverse grid shift iterator failed to converge."),a;a.x=G(r.x+s.ll[0]),a.y=r.y+s.ll[1]}else isNaN(r.x)||(a.x=t.x+r.x,a.y=t.y+r.y);return a}function Aa(t,e){var s={x:t.x/e.del[0],y:t.y/e.del[1]},a={x:Math.floor(s.x),y:Math.floor(s.y)},i={x:s.x-1*a.x,y:s.y-1*a.y},r={x:Number.NaN,y:Number.NaN},o;if(a.x<0||a.x>=e.lim[0]||a.y<0||a.y>=e.lim[1])return r;o=a.y*e.lim[0]+a.x;var n={x:e.cvs[o][0],y:e.cvs[o][1]};o++;var h={x:e.cvs[o][0],y:e.cvs[o][1]};o+=e.lim[0];var l={x:e.cvs[o][0],y:e.cvs[o][1]};o--;var g={x:e.cvs[o][0],y:e.cvs[o][1]},f=i.x*i.y,u=i.x*(1-i.y),y=(1-i.x)*(1-i.y),w=(1-i.x)*i.y;return r.x=y*n.x+u*h.x+w*g.x+f*l.x,r.y=y*n.y+u*h.y+w*g.y+f*l.y,r}var Qt=["x","y","z"];function dn(t,e){const s={};for(let a=0,i=t.axis.length;a<i;a++){if(a===2&&e.z===void 0)continue;let r=e[Qt[a]];switch(t.axis[a]){case"e":s.x=r;break;case"w":s.x=-r;break;case"n":s.y=r;break;case"s":s.y=-r;break;case"u":s.z=r;break;case"d":s.z=-r;break;default:return null}}return s}function _n(t,e){const s={};for(let a=0,i=t.axis.length;a<i;a++)if(!(a===2&&e.z===void 0))switch(t.axis[a]){case"e":s[Qt[a]]=e.x;break;case"w":s[Qt[a]]=-e.x;break;case"n":s[Qt[a]]=e.y;break;case"s":s[Qt[a]]=-e.y;break;case"u":s[Qt[a]]=e.z;break;case"d":s[Qt[a]]=-e.z;break;default:return null}return s}function Js(t){var e={x:t[0],y:t[1]};return t.length>2&&(e.z=t[2]),t.length>3&&(e.m=t[3]),e}function Mn(t){Ia(t.x),Ia(t.y)}function Ia(t){if(typeof Number.isFinite=="function"){if(Number.isFinite(t))return;throw new TypeError("coordinates must be finite numbers")}if(typeof t!="number"||t!==t||!isFinite(t))throw new TypeError("coordinates must be finite numbers")}function mn(t,e){return(t.datum.datum_type===Jt||t.datum.datum_type===Xt||t.datum.datum_type===ne)&&e.datumCode!=="WGS84"||(e.datum.datum_type===Jt||e.datum.datum_type===Xt||e.datum.datum_type===ne)&&t.datumCode!=="WGS84"}function Ms(t,e,s,a){var i,r=s.z!==void 0;if(Mn(s),t.datum&&e.datum&&mn(t,e)&&(i=new pt("WGS84"),s=Ms(t,i,s,a),t=i),a&&t.axis!=="enu"&&(s=dn(t,s)),t.projName==="longlat")s={x:s.x*Z,y:s.y*Z,z:s.z||0};else if(t.to_meter&&(s={x:s.x*t.to_meter,y:s.y*t.to_meter,z:s.z||0}),s=t.inverse(s),!s)return;if(t.from_greenwich&&(s.x+=t.from_greenwich),s=gn(t.datum,e.datum,s),!!s)return s=s,e.from_greenwich&&(s={x:s.x-e.from_greenwich,y:s.y,z:s.z||0}),e.projName==="longlat"?s={x:s.x*yt,y:s.y*yt,z:s.z||0}:(s=e.forward(s),e.to_meter&&(s={x:s.x/e.to_meter,y:s.y/e.to_meter,z:s.z||0})),a&&e.axis!=="enu"?_n(e,s):(s&&!r&&e.projName!=="geocent"&&delete s.z,s)}function yn(t,e,s,a){var i;return Array.isArray(s)?i=Js(s):i={x:s.x,y:s.y,z:s.z,m:s.m},Ms(t,e,i,a)}var Ca=pt("WGS84");function js(t,e,s,a){var i,r,o;return Array.isArray(s)?(i=Ms(t,e,Js(s),a)||{x:NaN,y:NaN},s.length>2?(r=typeof t.name!="undefined"&&t.name==="geocent"||typeof e.name!="undefined"&&e.name==="geocent",r?typeof i.z=="number"?[i.x,i.y,i.z].concat(s.slice(3)):[i.x,i.y,s[2]].concat(s.slice(3)):a&&typeof i.z=="number"?[i.x,i.y,i.z].concat(s.slice(3)):[i.x,i.y].concat(s.slice(2))):[i.x,i.y]):(i=Ms(t,e,{x:s.x,y:s.y,z:s.z,m:s.m},a)||{x:NaN,y:NaN},o=Object.keys(s),o.length===2||(r=typeof t.name!="undefined"&&t.name==="geocent"||typeof e.name!="undefined"&&e.name==="geocent",o.forEach(function(n){n==="x"||n==="y"||n==="z"&&(r||a)||(i[n]=s[n])})),i)}function ns(t){return t instanceof pt?t:typeof t=="object"&&"oProj"in t?t.oProj:pt(t)}function wn(t,e,s){var a,i,r=!1,o;return typeof e=="undefined"?(i=ns(t),a=Ca,r=!0):(typeof e.x!="undefined"||Array.isArray(e))&&(s=e,i=ns(t),a=Ca,r=!0),a||(a=ns(t)),i||(i=ns(e)),s?js(a,i,s):(o={forward:function(n,h){return js(a,i,n,h)},inverse:function(n,h){return js(i,a,n,h)}},r&&(o.oProj=i),o)}var La=6,ai="AJSAJS",ii="AFAFAF",ie=65,Mt=73,Pt=79,xe=86,be=90;const En={forward:ri,inverse:Sn,toPoint:ni};function ri(t,e){return e=e||5,xn(Pn({lat:t[1],lon:t[0]}),e)}function Sn(t){var e=Xs(hi(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat,e.lon,e.lat]:[e.left,e.bottom,e.right,e.top]}function ni(t){var e=Xs(hi(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function ks(t){return t*(Math.PI/180)}function Ra(t){return 180*(t/Math.PI)}function Pn(t){var e=t.lat,s=t.lon,a=6378137,i=.00669438,r=.9996,o,n,h,l,g,f,u,y=ks(e),w=ks(s),E,S;S=Math.floor((s+180)/6)+1,s===180&&(S=60),e>=56&&e<64&&s>=3&&s<12&&(S=32),e>=72&&e<84&&(s>=0&&s<9?S=31:s>=9&&s<21?S=33:s>=21&&s<33?S=35:s>=33&&s<42&&(S=37)),o=(S-1)*6-180+3,E=ks(o),n=i/(1-i),h=a/Math.sqrt(1-i*Math.sin(y)*Math.sin(y)),l=Math.tan(y)*Math.tan(y),g=n*Math.cos(y)*Math.cos(y),f=Math.cos(y)*(w-E),u=a*((1-i/4-3*i*i/64-5*i*i*i/256)*y-(3*i/8+3*i*i/32+45*i*i*i/1024)*Math.sin(2*y)+(15*i*i/256+45*i*i*i/1024)*Math.sin(4*y)-35*i*i*i/3072*Math.sin(6*y));var b=r*h*(f+(1-l+g)*f*f*f/6+(5-18*l+l*l+72*g-58*n)*f*f*f*f*f/120)+5e5,A=r*(u+h*Math.tan(y)*(f*f/2+(5-l+9*g+4*g*g)*f*f*f*f/24+(61-58*l+l*l+600*g-330*n)*f*f*f*f*f*f/720));return e<0&&(A+=1e7),{northing:Math.round(A),easting:Math.round(b),zoneNumber:S,zoneLetter:pn(e)}}function Xs(t){var e=t.northing,s=t.easting,a=t.zoneLetter,i=t.zoneNumber;if(i<0||i>60)return null;var r=.9996,o=6378137,n=.00669438,h,l=(1-Math.sqrt(1-n))/(1+Math.sqrt(1-n)),g,f,u,y,w,E,S,b,A,I=s-5e5,T=e;a<"N"&&(T-=1e7),S=(i-1)*6-180+3,h=n/(1-n),E=T/r,b=E/(o*(1-n/4-3*n*n/64-5*n*n*n/256)),A=b+(3*l/2-27*l*l*l/32)*Math.sin(2*b)+(21*l*l/16-55*l*l*l*l/32)*Math.sin(4*b)+151*l*l*l/96*Math.sin(6*b),g=o/Math.sqrt(1-n*Math.sin(A)*Math.sin(A)),f=Math.tan(A)*Math.tan(A),u=h*Math.cos(A)*Math.cos(A),y=o*(1-n)/Math.pow(1-n*Math.sin(A)*Math.sin(A),1.5),w=I/(g*r);var j=A-g*Math.tan(A)/y*(w*w/2-(5+3*f+10*u-4*u*u-9*h)*w*w*w*w/24+(61+90*f+298*u+45*f*f-252*h-3*u*u)*w*w*w*w*w*w/720);j=Ra(j);var O=(w-(1+2*f+u)*w*w*w/6+(5-2*u+28*f-3*u*u+8*h+24*f*f)*w*w*w*w*w/120)/Math.cos(A);O=S+Ra(O);var F;if(t.accuracy){var K=Xs({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});F={top:K.lat,right:K.lon,bottom:j,left:O}}else F={lat:j,lon:O};return F}function pn(t){var e="Z";return 84>=t&&t>=72?e="X":72>t&&t>=64?e="W":64>t&&t>=56?e="V":56>t&&t>=48?e="U":48>t&&t>=40?e="T":40>t&&t>=32?e="S":32>t&&t>=24?e="R":24>t&&t>=16?e="Q":16>t&&t>=8?e="P":8>t&&t>=0?e="N":0>t&&t>=-8?e="M":-8>t&&t>=-16?e="L":-16>t&&t>=-24?e="K":-24>t&&t>=-32?e="J":-32>t&&t>=-40?e="H":-40>t&&t>=-48?e="G":-48>t&&t>=-56?e="F":-56>t&&t>=-64?e="E":-64>t&&t>=-72?e="D":-72>t&&t>=-80&&(e="C"),e}function xn(t,e){var s="00000"+t.easting,a="00000"+t.northing;return t.zoneNumber+t.zoneLetter+bn(t.easting,t.northing,t.zoneNumber)+s.substr(s.length-5,e)+a.substr(a.length-5,e)}function bn(t,e,s){var a=oi(s),i=Math.floor(t/1e5),r=Math.floor(e/1e5)%20;return Gn(i,r,a)}function oi(t){var e=t%La;return e===0&&(e=La),e}function Gn(t,e,s){var a=s-1,i=ai.charCodeAt(a),r=ii.charCodeAt(a),o=i+t-1,n=r+e,h=!1;o>be&&(o=o-be+ie-1,h=!0),(o===Mt||i<Mt&&o>Mt||(o>Mt||i<Mt)&&h)&&o++,(o===Pt||i<Pt&&o>Pt||(o>Pt||i<Pt)&&h)&&(o++,o===Mt&&o++),o>be&&(o=o-be+ie-1),n>xe?(n=n-xe+ie-1,h=!0):h=!1,(n===Mt||r<Mt&&n>Mt||(n>Mt||r<Mt)&&h)&&n++,(n===Pt||r<Pt&&n>Pt||(n>Pt||r<Pt)&&h)&&(n++,n===Mt&&n++),n>xe&&(n=n-xe+ie-1);var l=String.fromCharCode(o)+String.fromCharCode(n);return l}function hi(t){if(t&&t.length===0)throw"MGRSPoint coverting from nothing";for(var e=t.length,s=null,a="",i,r=0;!/[A-Z]/.test(i=t.charAt(r));){if(r>=2)throw"MGRSPoint bad conversion from: "+t;a+=i,r++}var o=parseInt(a,10);if(r===0||r+3>e)throw"MGRSPoint bad conversion from: "+t;var n=t.charAt(r++);if(n<="A"||n==="B"||n==="Y"||n>="Z"||n==="I"||n==="O")throw"MGRSPoint zone letter "+n+" not handled: "+t;s=t.substring(r,r+=2);for(var h=oi(o),l=Nn(s.charAt(0),h),g=An(s.charAt(1),h);g<In(n);)g+=2e6;var f=e-r;if(f%2!==0)throw`MGRSPoint has to have an even number
of digits after the zone letter and two 100km letters - front
half for easting meters, second half for
northing meters`+t;var u=f/2,y=0,w=0,E,S,b,A,I;return u>0&&(E=1e5/Math.pow(10,u),S=t.substring(r,r+u),y=parseFloat(S)*E,b=t.substring(r+u),w=parseFloat(b)*E),A=y+l,I=w+g,{easting:A,northing:I,zoneLetter:n,zoneNumber:o,accuracy:E}}function Nn(t,e){for(var s=ai.charCodeAt(e-1),a=1e5,i=!1;s!==t.charCodeAt(0);){if(s++,s===Mt&&s++,s===Pt&&s++,s>be){if(i)throw"Bad character: "+t;s=ie,i=!0}a+=1e5}return a}function An(t,e){if(t>"V")throw"MGRSPoint given invalid Northing "+t;for(var s=ii.charCodeAt(e-1),a=0,i=!1;s!==t.charCodeAt(0);){if(s++,s===Mt&&s++,s===Pt&&s++,s>xe){if(i)throw"Bad character: "+t;s=ie,i=!0}a+=1e5}return a}function In(t){var e;switch(t){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1}if(e>=0)return e;throw"Invalid zone letter: "+t}function he(t,e,s){if(!(this instanceof he))return new he(t,e,s);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if(typeof t=="object")this.x=t.x,this.y=t.y,this.z=t.z||0;else if(typeof t=="string"&&typeof e=="undefined"){var a=t.split(",");this.x=parseFloat(a[0]),this.y=parseFloat(a[1]),this.z=parseFloat(a[2])||0}else this.x=t,this.y=e,this.z=s||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}he.fromMGRS=function(t){return new he(ni(t))};he.prototype.toMGRS=function(t){return ri([this.x,this.y],t)};var Cn=1,Ln=.25,Ta=.046875,Oa=.01953125,Fa=.01068115234375,Rn=.75,Tn=.46875,On=.013020833333333334,Fn=.007120768229166667,jn=.3645833333333333,kn=.005696614583333333,qn=.3076171875;function Ks(t){var e=[];e[0]=Cn-t*(Ln+t*(Ta+t*(Oa+t*Fa))),e[1]=t*(Rn-t*(Ta+t*(Oa+t*Fa)));var s=t*t;return e[2]=s*(Tn-t*(On+t*Fn)),s*=t,e[3]=s*(jn-t*kn),e[4]=s*t*qn,e}function ue(t,e,s,a){return s*=e,e*=e,a[0]*t-s*(a[1]+e*(a[2]+e*(a[3]+e*a[4])))}var $n=20;function Zs(t,e,s){for(var a=1/(1-e),i=t,r=$n;r;--r){var o=Math.sin(i),n=1-e*o*o;if(n=(ue(i,o,Math.cos(i),s)-t)*(n*Math.sqrt(n))*a,i-=n,Math.abs(n)<x)return i}return i}function Dn(){this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.es&&(this.en=Ks(this.es),this.ml0=ue(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function Un(t){var e=t.x,s=t.y,a=G(e-this.long0,this.over),i,r,o,n=Math.sin(s),h=Math.cos(s);if(this.es){var g=h*a,f=Math.pow(g,2),u=this.ep2*Math.pow(h,2),y=Math.pow(u,2),w=Math.abs(h)>x?Math.tan(s):0,E=Math.pow(w,2),S=Math.pow(E,2);i=1-this.es*Math.pow(n,2),g=g/Math.sqrt(i);var b=ue(s,n,h,this.en);r=this.a*(this.k0*g*(1+f/6*(1-E+u+f/20*(5-18*E+S+14*u-58*E*u+f/42*(61+179*S-S*E-479*E)))))+this.x0,o=this.a*(this.k0*(b-this.ml0+n*a*g/2*(1+f/12*(5-E+9*u+4*y+f/30*(61+S-58*E+270*u-330*E*u+f/56*(1385+543*S-S*E-3111*E))))))+this.y0}else{var l=h*Math.sin(a);if(Math.abs(Math.abs(l)-1)<x)return 93;if(r=.5*this.a*this.k0*Math.log((1+l)/(1-l))+this.x0,o=h*Math.cos(a)/Math.sqrt(1-Math.pow(l,2)),l=Math.abs(o),l>=1){if(l-1>x)return 93;o=0}else o=Math.acos(o);s<0&&(o=-o),o=this.a*this.k0*(o-this.lat0)+this.y0}return t.x=r,t.y=o,t}function Bn(t){var e,s,a,i,r=(t.x-this.x0)*(1/this.a),o=(t.y-this.y0)*(1/this.a);if(this.es)if(e=this.ml0+o/this.k0,s=Zs(e,this.es,this.en),Math.abs(s)<P){var f=Math.sin(s),u=Math.cos(s),y=Math.abs(u)>x?Math.tan(s):0,w=this.ep2*Math.pow(u,2),E=Math.pow(w,2),S=Math.pow(y,2),b=Math.pow(S,2);e=1-this.es*Math.pow(f,2);var A=r*Math.sqrt(e)/this.k0,I=Math.pow(A,2);e=e*y,a=s-e*I/(1-this.es)*.5*(1-I/12*(5+3*S-9*w*S+w-4*E-I/30*(61+90*S-252*w*S+45*b+46*w-I/56*(1385+3633*S+4095*b+1574*b*S)))),i=G(this.long0+A*(1-I/6*(1+2*S+w-I/20*(5+28*S+24*b+8*w*S+6*w-I/42*(61+662*S+1320*b+720*b*S))))/u,this.over)}else a=P*ke(o),i=0;else{var n=Math.exp(r/this.k0),h=.5*(n-1/n),l=this.lat0+o/this.k0,g=Math.cos(l);e=Math.sqrt((1-Math.pow(g,2))/(1+Math.pow(h,2))),a=Math.asin(e),o<0&&(a=-a),h===0&&g===0?i=0:i=G(Math.atan2(h,g)+this.long0,this.over)}return t.x=i,t.y=a,t}var zn=["Fast_Transverse_Mercator","Fast Transverse Mercator"];const ls={init:Dn,forward:Un,inverse:Bn,names:zn};function li(t){var e=Math.exp(t);return e=(e-1/e)/2,e}function mt(t,e){t=Math.abs(t),e=Math.abs(e);var s=Math.max(t,e),a=Math.min(t,e)/(s||1);return s*Math.sqrt(1+Math.pow(a,2))}function Wn(t){var e=1+t,s=e-1;return s===0?t:t*Math.log(e)/s}function Vn(t){var e=Math.abs(t);return e=Wn(e*(1+e/(mt(1,e)+1))),t<0?-e:e}function Ys(t,e){for(var s=2*Math.cos(2*e),a=t.length-1,i=t[a],r=0,o;--a>=0;)o=-r+s*i+t[a],r=i,i=o;return e+o*Math.sin(2*e)}function Hn(t,e){for(var s=2*Math.cos(e),a=t.length-1,i=t[a],r=0,o;--a>=0;)o=-r+s*i+t[a],r=i,i=o;return Math.sin(e)*o}function Qn(t){var e=Math.exp(t);return e=(e+1/e)/2,e}function ui(t,e,s){for(var a=Math.sin(e),i=Math.cos(e),r=li(s),o=Qn(s),n=2*i*o,h=-2*a*r,l=t.length-1,g=t[l],f=0,u=0,y=0,w,E;--l>=0;)w=u,E=f,u=g,f=y,g=-w+n*u-h*f+t[l],y=-E+h*u+n*f;return n=a*o,h=i*r,[n*g-h*y,n*y+h*g]}function Jn(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(ls.init.apply(this),this.forward=ls.forward,this.inverse=ls.inverse),this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es)),e=t/(2-t),s=e;this.cgb[0]=e*(2+e*(-2/3+e*(-2+e*(116/45+e*(26/45+e*(-2854/675)))))),this.cbg[0]=e*(-2+e*(2/3+e*(4/3+e*(-82/45+e*(32/45+e*(4642/4725)))))),s=s*e,this.cgb[1]=s*(7/3+e*(-8/5+e*(-227/45+e*(2704/315+e*(2323/945))))),this.cbg[1]=s*(5/3+e*(-16/15+e*(-13/9+e*(904/315+e*(-1522/945))))),s=s*e,this.cgb[2]=s*(56/15+e*(-136/35+e*(-1262/105+e*(73814/2835)))),this.cbg[2]=s*(-26/15+e*(34/21+e*(8/5+e*(-12686/2835)))),s=s*e,this.cgb[3]=s*(4279/630+e*(-332/35+e*(-399572/14175))),this.cbg[3]=s*(1237/630+e*(-12/5+e*(-24832/14175))),s=s*e,this.cgb[4]=s*(4174/315+e*(-144838/6237)),this.cbg[4]=s*(-734/315+e*(109598/31185)),s=s*e,this.cgb[5]=s*(601676/22275),this.cbg[5]=s*(444337/155925),s=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+s*(1/4+s*(1/64+s/256))),this.utg[0]=e*(-.5+e*(2/3+e*(-37/96+e*(1/360+e*(81/512+e*(-96199/604800)))))),this.gtu[0]=e*(.5+e*(-2/3+e*(5/16+e*(41/180+e*(-127/288+e*(7891/37800)))))),this.utg[1]=s*(-1/48+e*(-1/15+e*(437/1440+e*(-46/105+e*(1118711/3870720))))),this.gtu[1]=s*(13/48+e*(-3/5+e*(557/1440+e*(281/630+e*(-1983433/1935360))))),s=s*e,this.utg[2]=s*(-17/480+e*(37/840+e*(209/4480+e*(-5569/90720)))),this.gtu[2]=s*(61/240+e*(-103/140+e*(15061/26880+e*(167603/181440)))),s=s*e,this.utg[3]=s*(-4397/161280+e*(11/504+e*(830251/7257600))),this.gtu[3]=s*(49561/161280+e*(-179/168+e*(6601661/7257600))),s=s*e,this.utg[4]=s*(-4583/161280+e*(108847/3991680)),this.gtu[4]=s*(34729/80640+e*(-3418889/1995840)),s=s*e,this.utg[5]=s*(-20648693/638668800),this.gtu[5]=s*(212378941/319334400);var a=Ys(this.cbg,this.lat0);this.Zb=-this.Qn*(a+Hn(this.gtu,2*a))}function Xn(t){var e=G(t.x-this.long0,this.over),s=t.y;s=Ys(this.cbg,s);var a=Math.sin(s),i=Math.cos(s),r=Math.sin(e),o=Math.cos(e);s=Math.atan2(a,o*i),e=Math.atan2(r*i,mt(a,i*o)),e=Vn(Math.tan(e));var n=ui(this.gtu,2*s,2*e);s=s+n[0],e=e+n[1];var h,l;return Math.abs(e)<=2.623395162778?(h=this.a*(this.Qn*e)+this.x0,l=this.a*(this.Qn*s+this.Zb)+this.y0):(h=1/0,l=1/0),t.x=h,t.y=l,t}function Kn(t){var e=(t.x-this.x0)*(1/this.a),s=(t.y-this.y0)*(1/this.a);s=(s-this.Zb)/this.Qn,e=e/this.Qn;var a,i;if(Math.abs(e)<=2.623395162778){var r=ui(this.utg,2*s,2*e);s=s+r[0],e=e+r[1],e=Math.atan(li(e));var o=Math.sin(s),n=Math.cos(s),h=Math.sin(e),l=Math.cos(e);s=Math.atan2(o*l,mt(h,l*n)),e=Math.atan2(h,l*n),a=G(e+this.long0,this.over),i=Ys(this.cgb,s)}else a=1/0,i=1/0;return t.x=a,t.y=i,t}var Zn=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"];const us={init:Jn,forward:Xn,inverse:Kn,names:Zn};function Yn(t,e){if(t===void 0){if(t=Math.floor((G(e)+Math.PI)*30/Math.PI)+1,t<0)return 0;if(t>60)return 60}return t}var to="etmerc";function eo(){var t=Yn(this.zone,this.long0);if(t===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*Z,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,us.init.apply(this),this.forward=us.forward,this.inverse=us.inverse}var so=["Universal Transverse Mercator System","utm"];const ao={init:eo,names:so,dependsOn:to};function ta(t,e){return Math.pow((1-t)/(1+t),e)}var io=20;function ro(){var t=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+U)/(Math.pow(Math.tan(.5*this.lat0+U),this.C)*ta(this.e*t,this.ratexp))}function no(t){var e=t.x,s=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*s+U),this.C)*ta(this.e*Math.sin(s),this.ratexp))-P,t.x=this.C*e,t}function oo(t){for(var e=1e-14,s=t.x/this.C,a=t.y,i=Math.pow(Math.tan(.5*a+U)/this.K,1/this.C),r=io;r>0&&(a=2*Math.atan(i*ta(this.e*Math.sin(t.y),-.5*this.e))-P,!(Math.abs(a-t.y)<e));--r)t.y=a;return r?(t.x=s,t.y=a,t):null}var ho=["gauss"];const ea={init:ro,forward:no,inverse:oo,names:ho};function lo(){ea.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))}function uo(t){var e,s,a,i;return t.x=G(t.x-this.long0,this.over),ea.forward.apply(this,[t]),e=Math.sin(t.y),s=Math.cos(t.y),a=Math.cos(t.x),i=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*s*a),t.x=i*s*Math.sin(t.x),t.y=i*(this.cosc0*e-this.sinc0*s*a),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function co(t){var e,s,a,i,r;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,r=mt(t.x,t.y)){var o=2*Math.atan2(r,this.R2);e=Math.sin(o),s=Math.cos(o),i=Math.asin(s*this.sinc0+t.y*e*this.cosc0/r),a=Math.atan2(t.x*e,r*this.cosc0*s-t.y*this.sinc0*e)}else i=this.phic0,a=0;return t.x=a,t.y=i,ea.inverse.apply(this,[t]),t.x=G(t.x+this.long0,this.over),t}var fo=["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"];const go={init:lo,forward:uo,inverse:co,names:fo};function sa(t,e,s){return e*=s,Math.tan(.5*(P+t))*Math.pow((1-e)/(1+e),.5*s)}function vo(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=x&&(this.k0=.5*(1+ke(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=x&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=x&&Math.abs(Math.cos(this.lat_ts))>x&&(this.k0=.5*this.cons*Lt(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/Nt(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=Lt(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(sa(this.lat0,this.sinlat0,this.e))-P,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function _o(t){var e=t.x,s=t.y,a=Math.sin(s),i=Math.cos(s),r,o,n,h,l,g,f=G(e-this.long0,this.over);return Math.abs(Math.abs(e-this.long0)-Math.PI)<=x&&Math.abs(s+this.lat0)<=x?(t.x=NaN,t.y=NaN,t):this.sphere?(r=2*this.k0/(1+this.sinlat0*a+this.coslat0*i*Math.cos(f)),t.x=this.a*r*i*Math.sin(f)+this.x0,t.y=this.a*r*(this.coslat0*a-this.sinlat0*i*Math.cos(f))+this.y0,t):(o=2*Math.atan(sa(s,a,this.e))-P,h=Math.cos(o),n=Math.sin(o),Math.abs(this.coslat0)<=x?(l=Nt(this.e,s*this.con,this.con*a),g=2*this.a*this.k0*l/this.cons,t.x=this.x0+g*Math.sin(e-this.long0),t.y=this.y0-this.con*g*Math.cos(e-this.long0),t):(Math.abs(this.sinlat0)<x?(r=2*this.a*this.k0/(1+h*Math.cos(f)),t.y=r*n):(r=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*n+this.cosX0*h*Math.cos(f))),t.y=r*(this.cosX0*n-this.sinX0*h*Math.cos(f))+this.y0),t.x=r*h*Math.sin(f)+this.x0,t))}function Mo(t){t.x-=this.x0,t.y-=this.y0;var e,s,a,i,r,o=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var n=2*Math.atan(o/(2*this.a*this.k0));return e=this.long0,s=this.lat0,o<=x?(t.x=e,t.y=s,t):(s=Math.asin(Math.cos(n)*this.sinlat0+t.y*Math.sin(n)*this.coslat0/o),Math.abs(this.coslat0)<x?this.lat0>0?e=G(this.long0+Math.atan2(t.x,-1*t.y),this.over):e=G(this.long0+Math.atan2(t.x,t.y),this.over):e=G(this.long0+Math.atan2(t.x*Math.sin(n),o*this.coslat0*Math.cos(n)-t.y*this.sinlat0*Math.sin(n)),this.over),t.x=e,t.y=s,t)}else if(Math.abs(this.coslat0)<=x){if(o<=x)return s=this.lat0,e=this.long0,t.x=e,t.y=s,t;t.x*=this.con,t.y*=this.con,a=o*this.cons/(2*this.a*this.k0),s=this.con*Oe(this.e,a),e=this.con*G(this.con*this.long0+Math.atan2(t.x,-1*t.y),this.over)}else i=2*Math.atan(o*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,o<=x?r=this.X0:(r=Math.asin(Math.cos(i)*this.sinX0+t.y*Math.sin(i)*this.cosX0/o),e=G(this.long0+Math.atan2(t.x*Math.sin(i),o*this.cosX0*Math.cos(i)-t.y*this.sinX0*Math.sin(i)),this.over)),s=-1*Oe(this.e,Math.tan(.5*(P+r)));return t.x=e,t.y=s,t}var mo=["stere","Stereographic_South_Pole","Polar_Stereographic_variant_A","Polar_Stereographic_variant_B","Polar_Stereographic"];const yo={init:vo,forward:_o,inverse:Mo,names:mo,ssfn_:sa};function wo(){var t=this.lat0;this.lambda0=this.long0;var e=Math.sin(t),s=this.a,a=this.rf,i=1/a,r=2*i-Math.pow(i,2),o=this.e=Math.sqrt(r);this.R=this.k0*s*Math.sqrt(1-r)/(1-r*Math.pow(e,2)),this.alpha=Math.sqrt(1+r/(1-r)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(e/this.alpha);var n=Math.log(Math.tan(Math.PI/4+this.b0/2)),h=Math.log(Math.tan(Math.PI/4+t/2)),l=Math.log((1+o*e)/(1-o*e));this.K=n-this.alpha*h+this.alpha*o/2*l}function Eo(t){var e=Math.log(Math.tan(Math.PI/4-t.y/2)),s=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),a=-this.alpha*(e+s)+this.K,i=2*(Math.atan(Math.exp(a))-Math.PI/4),r=this.alpha*(t.x-this.lambda0),o=Math.atan(Math.sin(r)/(Math.sin(this.b0)*Math.tan(i)+Math.cos(this.b0)*Math.cos(r))),n=Math.asin(Math.cos(this.b0)*Math.sin(i)-Math.sin(this.b0)*Math.cos(i)*Math.cos(r));return t.y=this.R/2*Math.log((1+Math.sin(n))/(1-Math.sin(n)))+this.y0,t.x=this.R*o+this.x0,t}function So(t){for(var e=t.x-this.x0,s=t.y-this.y0,a=e/this.R,i=2*(Math.atan(Math.exp(s/this.R))-Math.PI/4),r=Math.asin(Math.cos(this.b0)*Math.sin(i)+Math.sin(this.b0)*Math.cos(i)*Math.cos(a)),o=Math.atan(Math.sin(a)/(Math.cos(this.b0)*Math.cos(a)-Math.sin(this.b0)*Math.tan(i))),n=this.lambda0+o/this.alpha,h=0,l=r,g=-1e3,f=0;Math.abs(l-g)>1e-7;){if(++f>20)return;h=1/this.alpha*(Math.log(Math.tan(Math.PI/4+r/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(l))/2)),g=l,l=2*Math.atan(Math.exp(h))-Math.PI/2}return t.x=n,t.y=l,t}var Po=["somerc"];const po={init:wo,forward:Eo,inverse:So,names:Po};var ee=1e-7;function xo(t){var e=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],s=typeof t.projName=="object"?Object.keys(t.projName)[0]:t.projName;return"no_uoff"in t||"no_off"in t||e.indexOf(s)!==-1||e.indexOf(Ya(s))!==-1}function bo(){var t,e,s,a,i,r,o,n,h,l,g=0,f,u=0,y=0,w=0,E=0,S=0,b=0;this.no_off=xo(this),this.no_rot="no_rot"in this;var A=!1;"alpha"in this&&(A=!0);var I=!1;if("rectified_grid_angle"in this&&(I=!0),A&&(b=this.alpha),I&&(g=this.rectified_grid_angle,A||(b=0,A=!0)),A||I)u=this.longc;else if(y=this.long1,E=this.lat1,w=this.long2,S=this.lat2,Math.abs(E-S)<=ee||(t=Math.abs(E))<=ee||Math.abs(t-P)<=ee||Math.abs(Math.abs(this.lat0)-P)<=ee||Math.abs(Math.abs(S)-P)<=ee)throw new Error;var T=1-this.es;e=Math.sqrt(T),Math.abs(this.lat0)>x?(n=Math.sin(this.lat0),s=Math.cos(this.lat0),t=1-this.es*n*n,this.B=s*s,this.B=Math.sqrt(1+this.es*this.B*this.B/T),this.A=this.B*this.k0*e/t,a=this.B*e/(s*Math.sqrt(t)),i=a*a-1,i<=0?i=0:(i=Math.sqrt(i),this.lat0<0&&(i=-i)),this.E=i+=a,this.E*=Math.pow(Nt(this.e,this.lat0,n),this.B)):(this.B=1/e,this.A=this.k0,this.E=a=i=1),A||I?(A?(f=Math.asin(Math.sin(b)/a),I||(g=b)):(f=g,b=Math.asin(a*Math.sin(f))),this.lam0=u-Math.asin(.5*(i-1/i)*Math.tan(f))/this.B):(r=Math.pow(Nt(this.e,E,Math.sin(E)),this.B),o=Math.pow(Nt(this.e,S,Math.sin(S)),this.B),i=this.E/r,h=(o-r)/(o+r),l=this.E*this.E,l=(l-o*r)/(l+o*r),t=y-w,t<-Math.PI?w-=Re:t>Math.PI&&(w+=Re),this.lam0=G(.5*(y+w)-Math.atan(l*Math.tan(.5*this.B*(y-w))/h)/this.B,this.over),f=Math.atan(2*Math.sin(this.B*G(y-this.lam0,this.over))/(i-1/i)),g=b=Math.asin(a*Math.sin(f))),this.singam=Math.sin(f),this.cosgam=Math.cos(f),this.sinrot=Math.sin(g),this.cosrot=Math.cos(g),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(a*a-1)/Math.cos(b))),this.lat0<0&&(this.u_0=-this.u_0)),i=.5*f,this.v_pole_n=this.ArB*Math.log(Math.tan(U-i)),this.v_pole_s=this.ArB*Math.log(Math.tan(U+i))}function Go(t){var e={},s,a,i,r,o,n,h,l;if(t.x=t.x-this.lam0,Math.abs(Math.abs(t.y)-P)>x){if(o=this.E/Math.pow(Nt(this.e,t.y,Math.sin(t.y)),this.B),n=1/o,s=.5*(o-n),a=.5*(o+n),r=Math.sin(this.B*t.x),i=(s*this.singam-r*this.cosgam)/a,Math.abs(Math.abs(i)-1)<x)throw new Error;l=.5*this.ArB*Math.log((1-i)/(1+i)),n=Math.cos(this.B*t.x),Math.abs(n)<ee?h=this.A*t.x:h=this.ArB*Math.atan2(s*this.cosgam+r*this.singam,n)}else l=t.y>0?this.v_pole_n:this.v_pole_s,h=this.ArB*t.y;return this.no_rot?(e.x=h,e.y=l):(h-=this.u_0,e.x=l*this.cosrot+h*this.sinrot,e.y=h*this.cosrot-l*this.sinrot),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function No(t){var e,s,a,i,r,o,n,h={};if(t.x=(t.x-this.x0)*(1/this.a),t.y=(t.y-this.y0)*(1/this.a),this.no_rot?(s=t.y,e=t.x):(s=t.x*this.cosrot-t.y*this.sinrot,e=t.y*this.cosrot+t.x*this.sinrot+this.u_0),a=Math.exp(-this.BrA*s),i=.5*(a-1/a),r=.5*(a+1/a),o=Math.sin(this.BrA*e),n=(o*this.cosgam+i*this.singam)/r,Math.abs(Math.abs(n)-1)<x)h.x=0,h.y=n<0?-P:P;else{if(h.y=this.E/Math.sqrt((1+n)/(1-n)),h.y=Oe(this.e,Math.pow(h.y,1/this.B)),h.y===1/0)throw new Error;h.x=-this.rB*Math.atan2(i*this.cosgam-o*this.singam,Math.cos(this.BrA*e))}return h.x+=this.lam0,h}var Ao=["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Variant_B","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"];const Io={init:bo,forward:Go,inverse:No,names:Ao};function Co(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<x)){var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var e=Math.sin(this.lat1),s=Math.cos(this.lat1),a=Lt(this.e,e,s),i=Nt(this.e,this.lat1,e),r=Math.sin(this.lat2),o=Math.cos(this.lat2),n=Lt(this.e,r,o),h=Nt(this.e,this.lat2,r),l=Math.abs(Math.abs(this.lat0)-P)<x?0:Nt(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>x?this.ns=Math.log(a/n)/Math.log(i/h):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=a/(this.ns*Math.pow(i,this.ns)),this.rh=this.a*this.f0*Math.pow(l,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function Lo(t){var e=t.x,s=t.y;Math.abs(2*Math.abs(s)-Math.PI)<=x&&(s=ke(s)*(P-2*x));var a=Math.abs(Math.abs(s)-P),i,r;if(a>x)i=Nt(this.e,s,Math.sin(s)),r=this.a*this.f0*Math.pow(i,this.ns);else{if(a=s*this.ns,a<=0)return null;r=0}var o=this.ns*G(e-this.long0,this.over);return t.x=this.k0*(r*Math.sin(o))+this.x0,t.y=this.k0*(this.rh-r*Math.cos(o))+this.y0,t}function Ro(t){var e,s,a,i,r,o=(t.x-this.x0)/this.k0,n=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(o*o+n*n),s=1):(e=-Math.sqrt(o*o+n*n),s=-1);var h=0;if(e!==0&&(h=Math.atan2(s*o,s*n)),e!==0||this.ns>0){if(s=1/this.ns,a=Math.pow(e/(this.a*this.f0),s),i=Oe(this.e,a),i===-9999)return null}else i=-P;return r=G(h/this.ns+this.long0,this.over),t.x=r,t.y=i,t}var To=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"];const Oo={init:Co,forward:Lo,inverse:Ro,names:To};function Fo(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.7417649320975901-.308341501185665),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function jo(t){var e,s,a,i,r,o,n,h=t.x,l=t.y,g=G(h-this.long0,this.over);return e=Math.pow((1+this.e*Math.sin(l))/(1-this.e*Math.sin(l)),this.alfa*this.e/2),s=2*(Math.atan(this.k*Math.pow(Math.tan(l/2+this.s45),this.alfa)/e)-this.s45),a=-g*this.alfa,i=Math.asin(Math.cos(this.ad)*Math.sin(s)+Math.sin(this.ad)*Math.cos(s)*Math.cos(a)),r=Math.asin(Math.cos(s)*Math.sin(a)/Math.cos(i)),o=this.n*r,n=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(i/2+this.s45),this.n),t.y=n*Math.cos(o)/1,t.x=n*Math.sin(o)/1,this.czech||(t.y*=-1,t.x*=-1),t}function ko(t){var e,s,a,i,r,o,n,h,l=t.x;t.x=t.y,t.y=l,this.czech||(t.y*=-1,t.x*=-1),o=Math.sqrt(t.x*t.x+t.y*t.y),r=Math.atan2(t.y,t.x),i=r/Math.sin(this.s0),a=2*(Math.atan(Math.pow(this.ro0/o,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(a)-Math.sin(this.ad)*Math.cos(a)*Math.cos(i)),s=Math.asin(Math.cos(a)*Math.sin(i)/Math.cos(e)),t.x=this.long0-s/this.alfa,n=e,h=0;var g=0;do t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(n))/(1-this.e*Math.sin(n)),this.e/2))-this.s45),Math.abs(n-t.y)<1e-10&&(h=1),n=t.y,g+=1;while(h===0&&g<15);return g>=15?null:t}var qo=["Krovak","Krovak Modified","Krovak (North Orientated)","Krovak Modified (North Orientated)","krovak"];const $o={init:Fo,forward:jo,inverse:ko,names:qo};function vt(t,e,s,a,i){return t*i-e*Math.sin(2*i)+s*Math.sin(4*i)-a*Math.sin(6*i)}function qe(t){return 1-.25*t*(1+t/16*(3+1.25*t))}function $e(t){return .375*t*(1+.25*t*(1+.46875*t))}function De(t){return .05859375*t*t*(1+.75*t)}function Ue(t){return t*t*t*(35/3072)}function aa(t,e,s){var a=e*s;return t/Math.sqrt(1-a*a)}function Ut(t){return Math.abs(t)<P?t:t-ke(t)*Math.PI}function ms(t,e,s,a,i){var r,o;r=t/e;for(var n=0;n<15;n++)if(o=(t-(e*r-s*Math.sin(2*r)+a*Math.sin(4*r)-i*Math.sin(6*r)))/(e-2*s*Math.cos(2*r)+4*a*Math.cos(4*r)-6*i*Math.cos(6*r)),r+=o,Math.abs(o)<=1e-10)return r;return NaN}function Do(){this.sphere||(this.e0=qe(this.es),this.e1=$e(this.es),this.e2=De(this.es),this.e3=Ue(this.es),this.ml0=this.a*vt(this.e0,this.e1,this.e2,this.e3,this.lat0))}function Uo(t){var e,s,a=t.x,i=t.y;if(a=G(a-this.long0,this.over),this.sphere)e=this.a*Math.asin(Math.cos(i)*Math.sin(a)),s=this.a*(Math.atan2(Math.tan(i),Math.cos(a))-this.lat0);else{var r=Math.sin(i),o=Math.cos(i),n=aa(this.a,this.e,r),h=Math.tan(i)*Math.tan(i),l=a*Math.cos(i),g=l*l,f=this.es*o*o/(1-this.es),u=this.a*vt(this.e0,this.e1,this.e2,this.e3,i);e=n*l*(1-g*h*(1/6-(8-h+8*f)*g/120)),s=u-this.ml0+n*r/o*g*(.5+(5-h+6*f)*g/24)}return t.x=e+this.x0,t.y=s+this.y0,t}function Bo(t){t.x-=this.x0,t.y-=this.y0;var e=t.x/this.a,s=t.y/this.a,a,i;if(this.sphere){var r=s+this.lat0;a=Math.asin(Math.sin(r)*Math.cos(e)),i=Math.atan2(Math.tan(e),Math.cos(r))}else{var o=this.ml0/this.a+s,n=ms(o,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(n)-P)<=x)return t.x=this.long0,t.y=P,s<0&&(t.y*=-1),t;var h=aa(this.a,this.e,Math.sin(n)),l=h*h*h/this.a/this.a*(1-this.es),g=Math.pow(Math.tan(n),2),f=e*this.a/h,u=f*f;a=n-h*Math.tan(n)/l*f*f*(.5-(1+3*g)*f*f/24),i=f*(1-u*(g/3+(1+3*g)*g*u/15))/Math.cos(n)}return t.x=G(i+this.long0,this.over),t.y=Ut(a),t}var zo=["Cassini","Cassini_Soldner","cass"];const Wo={init:Do,forward:Uo,inverse:Bo,names:zo};function Ct(t,e){var s;return t>1e-7?(s=t*e,(1-t*t)*(e/(1-s*s)-.5/t*Math.log((1-s)/(1+s)))):2*e}var Vo=.3333333333333333,Ho=.17222222222222222,Qo=.10257936507936508,Jo=.06388888888888888,Xo=.0664021164021164,Ko=.016415012942191543;function ci(t){var e,s=[];return s[0]=t*Vo,e=t*t,s[0]+=e*Ho,s[1]=e*Jo,e*=t,s[0]+=e*Qo,s[1]+=e*Xo,s[2]=e*Ko,s}function fi(t,e){var s=t+t;return t+e[0]*Math.sin(s)+e[1]*Math.sin(s+s)+e[2]*Math.sin(s+s+s)}var Bs=1,zs=2,Ws=3,cs=4;function Zo(){var t=Math.abs(this.lat0);if(Math.abs(t-P)<x?this.mode=this.lat0<0?Bs:zs:Math.abs(t)<x?this.mode=Ws:this.mode=cs,this.es>0){var e;switch(this.qp=Ct(this.e,1),this.mmf=.5/(1-this.es),this.apa=ci(this.es),this.mode){case zs:this.dd=1;break;case Bs:this.dd=1;break;case Ws:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case cs:this.rq=Math.sqrt(.5*this.qp),e=Math.sin(this.lat0),this.sinb1=Ct(this.e,e)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*e*e)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===cs&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function Yo(t){var e,s,a,i,r,o,n,h,l,g,f=t.x,u=t.y;if(f=G(f-this.long0,this.over),this.sphere){if(r=Math.sin(u),g=Math.cos(u),a=Math.cos(f),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(s=this.mode===this.EQUIT?1+g*a:1+this.sinph0*r+this.cosph0*g*a,s<=x)return null;s=Math.sqrt(2/s),e=s*g*Math.sin(f),s*=this.mode===this.EQUIT?r:this.cosph0*r-this.sinph0*g*a}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(a=-a),Math.abs(u+this.lat0)<x)return null;s=U-u*.5,s=2*(this.mode===this.S_POLE?Math.cos(s):Math.sin(s)),e=s*Math.sin(f),s*=a}}else{switch(n=0,h=0,l=0,a=Math.cos(f),i=Math.sin(f),r=Math.sin(u),o=Ct(this.e,r),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(n=o/this.qp,h=Math.sqrt(1-n*n)),this.mode){case this.OBLIQ:l=1+this.sinb1*n+this.cosb1*h*a;break;case this.EQUIT:l=1+h*a;break;case this.N_POLE:l=P+u,o=this.qp-o;break;case this.S_POLE:l=u-P,o=this.qp+o;break}if(Math.abs(l)<x)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:l=Math.sqrt(2/l),this.mode===this.OBLIQ?s=this.ymf*l*(this.cosb1*n-this.sinb1*h*a):s=(l=Math.sqrt(2/(1+h*a)))*n*this.ymf,e=this.xmf*l*h*i;break;case this.N_POLE:case this.S_POLE:o>=0?(e=(l=Math.sqrt(o))*i,s=a*(this.mode===this.S_POLE?l:-l)):e=s=0;break}}return t.x=this.a*e+this.x0,t.y=this.a*s+this.y0,t}function th(t){t.x-=this.x0,t.y-=this.y0;var e=t.x/this.a,s=t.y/this.a,a,i,r,o,n,h,l;if(this.sphere){var g=0,f,u=0;if(f=Math.sqrt(e*e+s*s),i=f*.5,i>1)return null;switch(i=2*Math.asin(i),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(u=Math.sin(i),g=Math.cos(i)),this.mode){case this.EQUIT:i=Math.abs(f)<=x?0:Math.asin(s*u/f),e*=u,s=g*f;break;case this.OBLIQ:i=Math.abs(f)<=x?this.lat0:Math.asin(g*this.sinph0+s*u*this.cosph0/f),e*=u*this.cosph0,s=(g-Math.sin(i)*this.sinph0)*f;break;case this.N_POLE:s=-s,i=P-i;break;case this.S_POLE:i-=P;break}a=s===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(e,s)}else{if(l=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(e/=this.dd,s*=this.dd,h=Math.sqrt(e*e+s*s),h<x)return t.x=this.long0,t.y=this.lat0,t;o=2*Math.asin(.5*h/this.rq),r=Math.cos(o),e*=o=Math.sin(o),this.mode===this.OBLIQ?(l=r*this.sinb1+s*o*this.cosb1/h,n=this.qp*l,s=h*this.cosb1*r-s*this.sinb1*o):(l=s*o/h,n=this.qp*l,s=h*r)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(s=-s),n=e*e+s*s,!n)return t.x=this.long0,t.y=this.lat0,t;l=1-n/this.qp,this.mode===this.S_POLE&&(l=-l)}a=Math.atan2(e,s),i=fi(Math.asin(l),this.apa)}return t.x=G(this.long0+a,this.over),t.y=i,t}var eh=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"];const sh={init:Zo,forward:Yo,inverse:th,names:eh,S_POLE:Bs,N_POLE:zs,EQUIT:Ws,OBLIQ:cs};function Dt(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)}function ah(){Math.abs(this.lat1+this.lat2)<x||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=Lt(this.e3,this.sin_po,this.cos_po),this.qs1=Ct(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=Lt(this.e3,this.sin_po,this.cos_po),this.qs2=Ct(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=Ct(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>x?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function ih(t){var e=t.x,s=t.y;this.sin_phi=Math.sin(s),this.cos_phi=Math.cos(s);var a=Ct(this.e3,this.sin_phi),i=this.a*Math.sqrt(this.c-this.ns0*a)/this.ns0,r=this.ns0*G(e-this.long0,this.over),o=i*Math.sin(r)+this.x0,n=this.rh-i*Math.cos(r)+this.y0;return t.x=o,t.y=n,t}function rh(t){var e,s,a,i,r,o;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(e=Math.sqrt(t.x*t.x+t.y*t.y),a=1):(e=-Math.sqrt(t.x*t.x+t.y*t.y),a=-1),i=0,e!==0&&(i=Math.atan2(a*t.x,a*t.y)),a=e*this.ns0/this.a,this.sphere?o=Math.asin((this.c-a*a)/(2*this.ns0)):(s=(this.c-a*a)/this.ns0,o=this.phi1z(this.e3,s)),r=G(i/this.ns0+this.long0,this.over),t.x=r,t.y=o,t}function nh(t,e){var s,a,i,r,o,n=Dt(.5*e);if(t<x)return n;for(var h=t*t,l=1;l<=25;l++)if(s=Math.sin(n),a=Math.cos(n),i=t*s,r=1-i*i,o=.5*r*r/a*(e/(1-h)-s/r+.5/t*Math.log((1-i)/(1+i))),n=n+o,Math.abs(o)<=1e-7)return n;return null}var oh=["Albers_Conic_Equal_Area","Albers_Equal_Area","Albers","aea"];const hh={init:ah,forward:ih,inverse:rh,names:oh,phi1z:nh};function lh(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function uh(t){var e,s,a,i,r,o,n,h,l=t.x,g=t.y;return a=G(l-this.long0,this.over),e=Math.sin(g),s=Math.cos(g),i=Math.cos(a),o=this.sin_p14*e+this.cos_p14*s*i,r=1,o>0||Math.abs(o)<=x?(n=this.x0+this.a*r*s*Math.sin(a)/o,h=this.y0+this.a*r*(this.cos_p14*e-this.sin_p14*s*i)/o):(n=this.x0+this.infinity_dist*s*Math.sin(a),h=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*s*i)),t.x=n,t.y=h,t}function ch(t){var e,s,a,i,r,o;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(e=Math.sqrt(t.x*t.x+t.y*t.y))?(i=Math.atan2(e,this.rc),s=Math.sin(i),a=Math.cos(i),o=Dt(a*this.sin_p14+t.y*s*this.cos_p14/e),r=Math.atan2(t.x*s,e*this.cos_p14*a-t.y*this.sin_p14*s),r=G(this.long0+r,this.over)):(o=this.phic0,r=0),t.x=r,t.y=o,t}var fh=["gnom"];const gh={init:lh,forward:uh,inverse:ch,names:fh};function vh(t,e){var s=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(e)-s)<1e-6)return e<0?-1*P:P;for(var a=Math.asin(.5*e),i,r,o,n,h=0;h<30;h++)if(r=Math.sin(a),o=Math.cos(a),n=t*r,i=Math.pow(1-n*n,2)/(2*o)*(e/(1-t*t)-r/(1-n*n)+.5/t*Math.log((1-n)/(1+n))),a+=i,Math.abs(i)<=1e-10)return a;return NaN}function dh(){this.sphere||(this.k0=Lt(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function _h(t){var e=t.x,s=t.y,a,i,r=G(e-this.long0,this.over);if(this.sphere)a=this.x0+this.a*r*Math.cos(this.lat_ts),i=this.y0+this.a*Math.sin(s)/Math.cos(this.lat_ts);else{var o=Ct(this.e,Math.sin(s));a=this.x0+this.a*this.k0*r,i=this.y0+this.a*o*.5/this.k0}return t.x=a,t.y=i,t}function Mh(t){t.x-=this.x0,t.y-=this.y0;var e,s;return this.sphere?(e=G(this.long0+t.x/this.a/Math.cos(this.lat_ts),this.over),s=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(s=vh(this.e,2*t.y*this.k0/this.a),e=G(this.long0+t.x/(this.a*this.k0),this.over)),t.x=e,t.y=s,t}var mh=["cea"];const yh={init:dh,forward:_h,inverse:Mh,names:mh};function wh(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)}function Eh(t){var e=t.x,s=t.y,a=G(e-this.long0,this.over),i=Ut(s-this.lat0);return t.x=this.x0+this.a*a*this.rc,t.y=this.y0+this.a*i,t}function Sh(t){var e=t.x,s=t.y;return t.x=G(this.long0+(e-this.x0)/(this.a*this.rc),this.over),t.y=Ut(this.lat0+(s-this.y0)/this.a),t}var Ph=["Equirectangular","Equidistant_Cylindrical","Equidistant_Cylindrical_Spherical","eqc"];const ph={init:wh,forward:Eh,inverse:Sh,names:Ph};var ja=20;function xh(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=qe(this.es),this.e1=$e(this.es),this.e2=De(this.es),this.e3=Ue(this.es),this.ml0=this.a*vt(this.e0,this.e1,this.e2,this.e3,this.lat0)}function bh(t){var e=t.x,s=t.y,a,i,r,o=G(e-this.long0,this.over);if(r=o*Math.sin(s),this.sphere)Math.abs(s)<=x?(a=this.a*o,i=-1*this.a*this.lat0):(a=this.a*Math.sin(r)/Math.tan(s),i=this.a*(Ut(s-this.lat0)+(1-Math.cos(r))/Math.tan(s)));else if(Math.abs(s)<=x)a=this.a*o,i=-1*this.ml0;else{var n=aa(this.a,this.e,Math.sin(s))/Math.tan(s);a=n*Math.sin(r),i=this.a*vt(this.e0,this.e1,this.e2,this.e3,s)-this.ml0+n*(1-Math.cos(r))}return t.x=a+this.x0,t.y=i+this.y0,t}function Gh(t){var e,s,a,i,r,o,n,h,l;if(a=t.x-this.x0,i=t.y-this.y0,this.sphere)if(Math.abs(i+this.a*this.lat0)<=x)e=G(a/this.a+this.long0,this.over),s=0;else{o=this.lat0+i/this.a,n=a*a/this.a/this.a+o*o,h=o;var g;for(r=ja;r;--r)if(g=Math.tan(h),l=-1*(o*(h*g+1)-h-.5*(h*h+n)*g)/((h-o)/g-1),h+=l,Math.abs(l)<=x){s=h;break}e=G(this.long0+Math.asin(a*Math.tan(h)/this.a)/Math.sin(s),this.over)}else if(Math.abs(i+this.ml0)<=x)s=0,e=G(this.long0+a/this.a,this.over);else{o=(this.ml0+i)/this.a,n=a*a/this.a/this.a+o*o,h=o;var f,u,y,w,E;for(r=ja;r;--r)if(E=this.e*Math.sin(h),f=Math.sqrt(1-E*E)*Math.tan(h),u=this.a*vt(this.e0,this.e1,this.e2,this.e3,h),y=this.e0-2*this.e1*Math.cos(2*h)+4*this.e2*Math.cos(4*h)-6*this.e3*Math.cos(6*h),w=u/this.a,l=(o*(f*w+1)-w-.5*f*(w*w+n))/(this.es*Math.sin(2*h)*(w*w+n-2*o*w)/(4*f)+(o-w)*(f*y-2/Math.sin(2*h))-y),h-=l,Math.abs(l)<=x){s=h;break}f=Math.sqrt(1-this.es*Math.pow(Math.sin(s),2))*Math.tan(s),e=G(this.long0+Math.asin(a*f/this.a)/Math.sin(s),this.over)}return t.x=e,t.y=s,t}var Nh=["Polyconic","American_Polyconic","poly"];const Ah={init:xh,forward:bh,inverse:Gh,names:Nh};function Ih(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function Ch(t){var e,s=t.x,a=t.y,i=a-this.lat0,r=s-this.long0,o=i/Ne*1e-5,n=r,h=1,l=0;for(e=1;e<=10;e++)h=h*o,l=l+this.A[e]*h;var g=l,f=n,u=1,y=0,w,E,S=0,b=0;for(e=1;e<=6;e++)w=u*g-y*f,E=y*g+u*f,u=w,y=E,S=S+this.B_re[e]*u-this.B_im[e]*y,b=b+this.B_im[e]*u+this.B_re[e]*y;return t.x=b*this.a+this.x0,t.y=S*this.a+this.y0,t}function Lh(t){var e,s=t.x,a=t.y,i=s-this.x0,r=a-this.y0,o=r/this.a,n=i/this.a,h=1,l=0,g,f,u=0,y=0;for(e=1;e<=6;e++)g=h*o-l*n,f=l*o+h*n,h=g,l=f,u=u+this.C_re[e]*h-this.C_im[e]*l,y=y+this.C_im[e]*h+this.C_re[e]*l;for(var w=0;w<this.iterations;w++){var E=u,S=y,b,A,I=o,T=n;for(e=2;e<=6;e++)b=E*u-S*y,A=S*u+E*y,E=b,S=A,I=I+(e-1)*(this.B_re[e]*E-this.B_im[e]*S),T=T+(e-1)*(this.B_im[e]*E+this.B_re[e]*S);E=1,S=0;var j=this.B_re[1],O=this.B_im[1];for(e=2;e<=6;e++)b=E*u-S*y,A=S*u+E*y,E=b,S=A,j=j+e*(this.B_re[e]*E-this.B_im[e]*S),O=O+e*(this.B_im[e]*E+this.B_re[e]*S);var F=j*j+O*O;u=(I*j+T*O)/F,y=(T*j-I*O)/F}var K=u,W=y,dt=1,ht=0;for(e=1;e<=9;e++)dt=dt*K,ht=ht+this.D[e]*dt;var D=this.lat0+ht*Ne*1e5,_t=this.long0+W;return t.x=_t,t.y=D,t}var Rh=["New_Zealand_Map_Grid","nzmg"];const Th={init:Ih,forward:Ch,inverse:Lh,names:Rh};function Oh(){}function Fh(t){var e=t.x,s=t.y,a=G(e-this.long0,this.over),i=this.x0+this.a*a,r=this.y0+this.a*Math.log(Math.tan(Math.PI/4+s/2.5))*1.25;return t.x=i,t.y=r,t}function jh(t){t.x-=this.x0,t.y-=this.y0;var e=G(this.long0+t.x/this.a,this.over),s=2.5*(Math.atan(Math.exp(.8*t.y/this.a))-Math.PI/4);return t.x=e,t.y=s,t}var kh=["Miller_Cylindrical","mill"];const qh={init:Oh,forward:Fh,inverse:jh,names:kh};var $h=20;function Dh(){this.long0=this.long0||0,this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=Ks(this.es)}function gi(t){var e,s,a=t.x,i=t.y;if(a=G(a-this.long0,this.over),this.sphere){if(!this.m)i=this.n!==1?Math.asin(this.n*Math.sin(i)):i;else for(var r=this.n*Math.sin(i),o=$h;o;--o){var n=(this.m*i+Math.sin(i)-r)/(this.m+Math.cos(i));if(i-=n,Math.abs(n)<x)break}e=this.a*this.C_x*a*(this.m+Math.cos(i)),s=this.a*this.C_y*i}else{var h=Math.sin(i),l=Math.cos(i);s=this.a*ue(i,h,l,this.en),e=this.a*a*l/Math.sqrt(1-this.es*h*h)}return t.x=e,t.y=s,t}function vi(t){var e,s,a,i;return t.x-=this.x0,a=t.x/this.a,t.y-=this.y0,e=t.y/this.a,this.sphere?(e/=this.C_y,a=a/(this.C_x*(this.m+Math.cos(e))),this.m?e=Dt((this.m*e+Math.sin(e))/this.n):this.n!==1&&(e=Dt(Math.sin(e)/this.n)),a=G(a+this.long0,this.over),e=Ut(e)):(e=Zs(t.y/this.a,this.es,this.en),i=Math.abs(e),i<P?(i=Math.sin(e),s=this.long0+t.x*Math.sqrt(1-this.es*i*i)/(this.a*Math.cos(e)),a=G(s,this.over)):i-x<P&&(a=this.long0)),t.x=a,t.y=e,t}var Uh=["Sinusoidal","sinu"];const Bh={init:Dh,forward:gi,inverse:vi,names:Uh};function zh(){this.sphere=!0,this.b=this.a,this.m=1,this.n=2.5707963267948966,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)}var Wh=gi,Vh=vi,Hh=["Eckert_VI","eck6"];const Qh={init:zh,forward:Wh,inverse:Vh,names:Hh};function Jh(){this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0}function Xh(t){for(var e=t.x,s=t.y,a=G(e-this.long0,this.over),i=s,r=Math.PI*Math.sin(s);;){var o=-(i+Math.sin(i)-r)/(1+Math.cos(i));if(i+=o,Math.abs(o)<x)break}i/=2,Math.PI/2-Math.abs(s)<x&&(a=0);var n=.900316316158*this.a*a*Math.cos(i)+this.x0,h=1.4142135623731*this.a*Math.sin(i)+this.y0;return t.x=n,t.y=h,t}function Kh(t){var e,s;t.x-=this.x0,t.y-=this.y0,s=t.y/(1.4142135623731*this.a),Math.abs(s)>.999999999999&&(s=.999999999999),e=Math.asin(s);var a=G(this.long0+t.x/(.900316316158*this.a*Math.cos(e)),this.over);a<-Math.PI&&(a=-Math.PI),a>Math.PI&&(a=Math.PI),s=(2*e+Math.sin(2*e))/Math.PI,Math.abs(s)>1&&(s=1);var i=Math.asin(s);return t.x=a,t.y=i,t}var Zh=["Mollweide","moll"];const Yh={init:Jh,forward:Xh,inverse:Kh,names:Zh};function t0(){Math.abs(this.lat1+this.lat2)<x||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=qe(this.es),this.e1=$e(this.es),this.e2=De(this.es),this.e3=Ue(this.es),this.sin_phi=Math.sin(this.lat1),this.cos_phi=Math.cos(this.lat1),this.ms1=Lt(this.e,this.sin_phi,this.cos_phi),this.ml1=vt(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<x?this.ns=this.sin_phi:(this.sin_phi=Math.sin(this.lat2),this.cos_phi=Math.cos(this.lat2),this.ms2=Lt(this.e,this.sin_phi,this.cos_phi),this.ml2=vt(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=vt(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function e0(t){var e=t.x,s=t.y,a;if(this.sphere)a=this.a*(this.g-s);else{var i=vt(this.e0,this.e1,this.e2,this.e3,s);a=this.a*(this.g-i)}var r=this.ns*G(e-this.long0,this.over),o=this.x0+a*Math.sin(r),n=this.y0+this.rh-a*Math.cos(r);return t.x=o,t.y=n,t}function s0(t){t.x-=this.x0,t.y=this.rh-t.y+this.y0;var e,s,a,i;this.ns>=0?(s=Math.sqrt(t.x*t.x+t.y*t.y),e=1):(s=-Math.sqrt(t.x*t.x+t.y*t.y),e=-1);var r=0;if(s!==0&&(r=Math.atan2(e*t.x,e*t.y)),this.sphere)return i=G(this.long0+r/this.ns,this.over),a=Ut(this.g-s/this.a),t.x=i,t.y=a,t;var o=this.g-s/this.a;return a=ms(o,this.e0,this.e1,this.e2,this.e3),i=G(this.long0+r/this.ns,this.over),t.x=i,t.y=a,t}var a0=["Equidistant_Conic","eqdc"];const i0={init:t0,forward:e0,inverse:s0,names:a0};function r0(){this.R=this.a}function n0(t){var e=t.x,s=t.y,a=G(e-this.long0,this.over),i,r;Math.abs(s)<=x&&(i=this.x0+this.R*a,r=this.y0);var o=Dt(2*Math.abs(s/Math.PI));(Math.abs(a)<=x||Math.abs(Math.abs(s)-P)<=x)&&(i=this.x0,s>=0?r=this.y0+Math.PI*this.R*Math.tan(.5*o):r=this.y0+Math.PI*this.R*-Math.tan(.5*o));var n=.5*Math.abs(Math.PI/a-a/Math.PI),h=n*n,l=Math.sin(o),g=Math.cos(o),f=g/(l+g-1),u=f*f,y=f*(2/l-1),w=y*y,E=Math.PI*this.R*(n*(f-w)+Math.sqrt(h*(f-w)*(f-w)-(w+h)*(u-w)))/(w+h);a<0&&(E=-E),i=this.x0+E;var S=h+f;return E=Math.PI*this.R*(y*S-n*Math.sqrt((w+h)*(h+1)-S*S))/(w+h),s>=0?r=this.y0+E:r=this.y0-E,t.x=i,t.y=r,t}function o0(t){var e,s,a,i,r,o,n,h,l,g,f,u,y;return t.x-=this.x0,t.y-=this.y0,f=Math.PI*this.R,a=t.x/f,i=t.y/f,r=a*a+i*i,o=-Math.abs(i)*(1+r),n=o-2*i*i+a*a,h=-2*o+1+2*i*i+r*r,y=i*i/h+(2*n*n*n/h/h/h-9*o*n/h/h)/27,l=(o-n*n/3/h)/h,g=2*Math.sqrt(-l/3),f=3*y/l/g,Math.abs(f)>1&&(f>=0?f=1:f=-1),u=Math.acos(f)/3,t.y>=0?s=(-g*Math.cos(u+Math.PI/3)-n/3/h)*Math.PI:s=-(-g*Math.cos(u+Math.PI/3)-n/3/h)*Math.PI,Math.abs(a)<x?e=this.long0:e=G(this.long0+Math.PI*(r-1+Math.sqrt(1+2*(a*a-i*i)+r*r))/2/a,this.over),t.x=e,t.y=s,t}var h0=["Van_der_Grinten_I","VanDerGrinten","Van_der_Grinten","vandg"];const l0={init:r0,forward:n0,inverse:o0,names:h0};function u0(t,e,s,a,i,r){const o=a-e,n=Math.atan((1-r)*Math.tan(t)),h=Math.atan((1-r)*Math.tan(s)),l=Math.sin(n),g=Math.cos(n),f=Math.sin(h),u=Math.cos(h);let y=o,w,E=100,S,b,A,I,T,j,O,F,K,W,dt,ht,D,_t;do{if(S=Math.sin(y),b=Math.cos(y),A=Math.sqrt(u*S*(u*S)+(g*f-l*u*b)*(g*f-l*u*b)),A===0)return{azi1:0,s12:0};I=l*f+g*u*b,T=Math.atan2(A,I),j=g*u*S/A,O=1-j*j,F=O!==0?I-2*l*f/O:0,K=r/16*O*(4+r*(4-3*O)),w=y,y=o+(1-K)*r*j*(T+K*A*(F+K*I*(-1+2*F*F)))}while(Math.abs(y-w)>1e-12&&--E>0);return E===0?{azi1:NaN,s12:NaN}:(W=O*(i*i-i*(1-r)*(i*(1-r)))/(i*(1-r)*(i*(1-r))),dt=1+W/16384*(4096+W*(-768+W*(320-175*W))),ht=W/1024*(256+W*(-128+W*(74-47*W))),D=ht*A*(F+ht/4*(I*(-1+2*F*F)-ht/6*F*(-3+4*A*A)*(-3+4*F*F))),_t=i*(1-r)*dt*(T-D),{azi1:Math.atan2(u*S,g*f-l*u*b),s12:_t})}function c0(t,e,s,a,i,r){const o=Math.atan((1-r)*Math.tan(t)),n=Math.sin(o),h=Math.cos(o),l=Math.sin(s),g=Math.cos(s),f=Math.atan2(n,h*g),u=h*l,y=1-u*u,w=y*(i*i-i*(1-r)*(i*(1-r)))/(i*(1-r)*(i*(1-r))),E=1+w/16384*(4096+w*(-768+w*(320-175*w))),S=w/1024*(256+w*(-128+w*(74-47*w)));let b=a/(i*(1-r)*E),A,I=100,T,j,O,F;do T=Math.cos(2*f+b),j=Math.sin(b),O=Math.cos(b),F=S*j*(T+S/4*(O*(-1+2*T*T)-S/6*T*(-3+4*j*j)*(-3+4*T*T))),A=b,b=a/(i*(1-r)*E)+F;while(Math.abs(b-A)>1e-12&&--I>0);if(I===0)return{lat2:NaN,lon2:NaN};const K=n*j-h*O*g,W=Math.atan2(n*O+h*j*g,(1-r)*Math.sqrt(u*u+K*K)),dt=Math.atan2(j*l,h*O-n*j*g),ht=r/16*y*(4+r*(4-3*y)),D=dt-(1-ht)*r*u*(b+ht*j*(T+ht*O*(-1+2*T*T))),_t=e+D;return{lat2:W,lon2:_t}}function f0(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0),this.f=this.es/(1+Math.sqrt(1-this.es))}function g0(t){var e=t.x,s=t.y,a=Math.sin(t.y),i=Math.cos(t.y),r=G(e-this.long0,this.over),o,n,h,l,g,f,u,y,w,E,S;return this.sphere?Math.abs(this.sin_p12-1)<=x?(t.x=this.x0+this.a*(P-s)*Math.sin(r),t.y=this.y0-this.a*(P-s)*Math.cos(r),t):Math.abs(this.sin_p12+1)<=x?(t.x=this.x0+this.a*(P+s)*Math.sin(r),t.y=this.y0+this.a*(P+s)*Math.cos(r),t):(w=this.sin_p12*a+this.cos_p12*i*Math.cos(r),u=Math.acos(w),y=u?u/Math.sin(u):1,t.x=this.x0+this.a*y*i*Math.sin(r),t.y=this.y0+this.a*y*(this.cos_p12*a-this.sin_p12*i*Math.cos(r)),t):(o=qe(this.es),n=$e(this.es),h=De(this.es),l=Ue(this.es),Math.abs(this.sin_p12-1)<=x?(g=this.a*vt(o,n,h,l,P),f=this.a*vt(o,n,h,l,s),t.x=this.x0+(g-f)*Math.sin(r),t.y=this.y0-(g-f)*Math.cos(r),t):Math.abs(this.sin_p12+1)<=x?(g=this.a*vt(o,n,h,l,P),f=this.a*vt(o,n,h,l,s),t.x=this.x0+(g+f)*Math.sin(r),t.y=this.y0+(g+f)*Math.cos(r),t):Math.abs(e)<x&&Math.abs(s-this.lat0)<x?(t.x=t.y=0,t):(E=u0(this.lat0,this.long0,s,e,this.a,this.f),S=E.azi1,t.x=E.s12*Math.sin(S),t.y=E.s12*Math.cos(S),t))}function v0(t){t.x-=this.x0,t.y-=this.y0;var e,s,a,i,r,o,n,h,l,g,f,u,y,w,E,S;return this.sphere?(e=Math.sqrt(t.x*t.x+t.y*t.y),e>2*P*this.a?void 0:(s=e/this.a,a=Math.sin(s),i=Math.cos(s),r=this.long0,Math.abs(e)<=x?o=this.lat0:(o=Dt(i*this.sin_p12+t.y*a*this.cos_p12/e),n=Math.abs(this.lat0)-P,Math.abs(n)<=x?this.lat0>=0?r=G(this.long0+Math.atan2(t.x,-t.y),this.over):r=G(this.long0-Math.atan2(-t.x,t.y),this.over):r=G(this.long0+Math.atan2(t.x*a,e*this.cos_p12*i-t.y*this.sin_p12*a),this.over)),t.x=r,t.y=o,t)):(h=qe(this.es),l=$e(this.es),g=De(this.es),f=Ue(this.es),Math.abs(this.sin_p12-1)<=x?(u=this.a*vt(h,l,g,f,P),e=Math.sqrt(t.x*t.x+t.y*t.y),y=u-e,o=ms(y/this.a,h,l,g,f),r=G(this.long0+Math.atan2(t.x,-1*t.y),this.over),t.x=r,t.y=o,t):Math.abs(this.sin_p12+1)<=x?(u=this.a*vt(h,l,g,f,P),e=Math.sqrt(t.x*t.x+t.y*t.y),y=e-u,o=ms(y/this.a,h,l,g,f),r=G(this.long0+Math.atan2(t.x,t.y),this.over),t.x=r,t.y=o,t):(w=Math.atan2(t.x,t.y),E=Math.sqrt(t.x*t.x+t.y*t.y),S=c0(this.lat0,this.long0,w,E,this.a,this.f),t.x=S.lon2,t.y=S.lat2,t))}var d0=["Azimuthal_Equidistant","aeqd"];const _0={init:f0,forward:g0,inverse:v0,names:d0};function M0(){this.sin_p14=Math.sin(this.lat0||0),this.cos_p14=Math.cos(this.lat0||0)}function m0(t){var e,s,a,i,r,o,n,h,l=t.x,g=t.y;return a=G(l-(this.long0||0),this.over),e=Math.sin(g),s=Math.cos(g),i=Math.cos(a),o=this.sin_p14*e+this.cos_p14*s*i,r=1,(o>0||Math.abs(o)<=x)&&(n=this.a*r*s*Math.sin(a),h=(this.y0||0)+this.a*r*(this.cos_p14*e-this.sin_p14*s*i)),t.x=n,t.y=h,t}function y0(t){var e,s,a,i,r,o,n,h,l;return t.x-=this.x0||0,t.y-=this.y0||0,e=Math.sqrt(t.x*t.x+t.y*t.y),s=Dt(e/this.a),a=Math.sin(s),i=Math.cos(s),h=this.long0||0,l=this.lat0||0,o=h,Math.abs(e)<=x?(n=l,t.x=o,t.y=n,t):(n=Dt(i*this.sin_p14+t.y*a*this.cos_p14/e),r=Math.abs(l)-P,Math.abs(r)<=x?(l>=0?o=G(h+Math.atan2(t.x,-t.y),this.over):o=G(h-Math.atan2(-t.x,t.y),this.over),t.x=o,t.y=n,t):(o=G(h+Math.atan2(t.x*a,e*this.cos_p14*i-t.y*this.sin_p14*a),this.over),t.x=o,t.y=n,t))}var w0=["ortho"];const E0={init:M0,forward:m0,inverse:y0,names:w0};var X={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},B={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function S0(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=P-U/2?this.face=X.TOP:this.lat0<=-(P-U/2)?this.face=X.BOTTOM:Math.abs(this.long0)<=U?this.face=X.FRONT:Math.abs(this.long0)<=P+U?this.face=this.long0>0?X.RIGHT:X.LEFT:this.face=X.BACK,this.es!==0&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function P0(t){var e={x:0,y:0},s,a,i,r,o,n,h={value:0};if(t.x-=this.long0,this.es!==0?s=Math.atan(this.one_minus_f_squared*Math.tan(t.y)):s=t.y,a=t.x,this.face===X.TOP)r=P-s,a>=U&&a<=P+U?(h.value=B.AREA_0,i=a-P):a>P+U||a<=-(P+U)?(h.value=B.AREA_1,i=a>0?a-et:a+et):a>-(P+U)&&a<=-U?(h.value=B.AREA_2,i=a+P):(h.value=B.AREA_3,i=a);else if(this.face===X.BOTTOM)r=P+s,a>=U&&a<=P+U?(h.value=B.AREA_0,i=-a+P):a<U&&a>=-U?(h.value=B.AREA_1,i=-a):a<-U&&a>=-(P+U)?(h.value=B.AREA_2,i=-a-P):(h.value=B.AREA_3,i=a>0?-a+et:-a-et);else{var l,g,f,u,y,w,E;this.face===X.RIGHT?a=oe(a,+P):this.face===X.BACK?a=oe(a,+et):this.face===X.LEFT&&(a=oe(a,-P)),u=Math.sin(s),y=Math.cos(s),w=Math.sin(a),E=Math.cos(a),l=y*E,g=y*w,f=u,this.face===X.FRONT?(r=Math.acos(l),i=os(r,f,g,h)):this.face===X.RIGHT?(r=Math.acos(g),i=os(r,f,-l,h)):this.face===X.BACK?(r=Math.acos(-l),i=os(r,f,-g,h)):this.face===X.LEFT?(r=Math.acos(-g),i=os(r,f,l,h)):(r=i=0,h.value=B.AREA_0)}return n=Math.atan(12/et*(i+Math.acos(Math.sin(i)*Math.cos(U))-P)),o=Math.sqrt((1-Math.cos(r))/(Math.cos(n)*Math.cos(n))/(1-Math.cos(Math.atan(1/Math.cos(i))))),h.value===B.AREA_1?n+=P:h.value===B.AREA_2?n+=et:h.value===B.AREA_3&&(n+=1.5*et),e.x=o*Math.cos(n),e.y=o*Math.sin(n),e.x=e.x*this.a+this.x0,e.y=e.y*this.a+this.y0,t.x=e.x,t.y=e.y,t}function p0(t){var e={lam:0,phi:0},s,a,i,r,o,n,h,l,g,f={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,a=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),s=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?f.value=B.AREA_0:t.y>=0&&t.y>=Math.abs(t.x)?(f.value=B.AREA_1,s-=P):t.x<0&&-t.x>=Math.abs(t.y)?(f.value=B.AREA_2,s=s<0?s+et:s-et):(f.value=B.AREA_3,s+=P),g=et/12*Math.tan(s),o=Math.sin(g)/(Math.cos(g)-1/Math.sqrt(2)),n=Math.atan(o),i=Math.cos(s),r=Math.tan(a),h=1-i*i*r*r*(1-Math.cos(Math.atan(1/Math.cos(n)))),h<-1?h=-1:h>1&&(h=1),this.face===X.TOP)l=Math.acos(h),e.phi=P-l,f.value===B.AREA_0?e.lam=n+P:f.value===B.AREA_1?e.lam=n<0?n+et:n-et:f.value===B.AREA_2?e.lam=n-P:e.lam=n;else if(this.face===X.BOTTOM)l=Math.acos(h),e.phi=l-P,f.value===B.AREA_0?e.lam=-n+P:f.value===B.AREA_1?e.lam=-n:f.value===B.AREA_2?e.lam=-n-P:e.lam=n<0?-n-et:-n+et;else{var u,y,w;u=h,g=u*u,g>=1?w=0:w=Math.sqrt(1-g)*Math.sin(n),g+=w*w,g>=1?y=0:y=Math.sqrt(1-g),f.value===B.AREA_1?(g=y,y=-w,w=g):f.value===B.AREA_2?(y=-y,w=-w):f.value===B.AREA_3&&(g=y,y=w,w=-g),this.face===X.RIGHT?(g=u,u=-y,y=g):this.face===X.BACK?(u=-u,y=-y):this.face===X.LEFT&&(g=u,u=y,y=-g),e.phi=Math.acos(-w)-P,e.lam=Math.atan2(y,u),this.face===X.RIGHT?e.lam=oe(e.lam,-P):this.face===X.BACK?e.lam=oe(e.lam,-et):this.face===X.LEFT&&(e.lam=oe(e.lam,+P))}if(this.es!==0){var E,S,b;E=e.phi<0?1:0,S=Math.tan(e.phi),b=this.b/Math.sqrt(S*S+this.one_minus_f_squared),e.phi=Math.atan(Math.sqrt(this.a*this.a-b*b)/(this.one_minus_f*b)),E&&(e.phi=-e.phi)}return e.lam+=this.long0,t.x=e.lam,t.y=e.phi,t}function os(t,e,s,a){var i;return t<x?(a.value=B.AREA_0,i=0):(i=Math.atan2(e,s),Math.abs(i)<=U?a.value=B.AREA_0:i>U&&i<=P+U?(a.value=B.AREA_1,i-=P):i>P+U||i<=-(P+U)?(a.value=B.AREA_2,i=i>=0?i-et:i+et):(a.value=B.AREA_3,i+=P)),i}function oe(t,e){var s=t+e;return s<-et?s+=Re:s>+et&&(s-=Re),s}var x0=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const b0={init:S0,forward:P0,inverse:p0,names:x0};var Vs=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],Ge=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],di=.8487,_i=1.3523,Mi=yt/5,G0=1/Mi,re=18,ys=function(t,e){return t[0]+e*(t[1]+e*(t[2]+e*t[3]))},N0=function(t,e){return t[1]+e*(2*t[2]+e*3*t[3])};function A0(t,e,s,a){for(var i=e;a;--a){var r=t(i);if(i-=r,Math.abs(r)<s)break}return i}function I0(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"}function C0(t){var e=G(t.x-this.long0,this.over),s=Math.abs(t.y),a=Math.floor(s*Mi);a<0?a=0:a>=re&&(a=re-1),s=yt*(s-G0*a);var i={x:ys(Vs[a],s)*e,y:ys(Ge[a],s)};return t.y<0&&(i.y=-i.y),i.x=i.x*this.a*di+this.x0,i.y=i.y*this.a*_i+this.y0,i}function L0(t){var e={x:(t.x-this.x0)/(this.a*di),y:Math.abs(t.y-this.y0)/(this.a*_i)};if(e.y>=1)e.x/=Vs[re][0],e.y=t.y<0?-P:P;else{var s=Math.floor(e.y*re);for(s<0?s=0:s>=re&&(s=re-1);;)if(Ge[s][0]>e.y)--s;else if(Ge[s+1][0]<=e.y)++s;else break;var a=Ge[s],i=5*(e.y-a[0])/(Ge[s+1][0]-a[0]);i=A0(function(r){return(ys(a,r)-e.y)/N0(a,r)},i,x,100),e.x/=ys(Vs[s],i),e.y=(5*s+i)*Z,t.y<0&&(e.y=-e.y)}return e.x=G(e.x+this.long0,this.over),e}var R0=["Robinson","robin"];const T0={init:I0,forward:C0,inverse:L0,names:R0};function O0(){this.name="geocent"}function F0(t){var e=ei(t,this.es,this.a);return e}function j0(t){var e=si(t,this.es,this.a,this.b);return e}var k0=["Geocentric","geocentric","geocent","Geocent"];const q0={init:O0,forward:F0,inverse:j0,names:k0};var ct={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},pe={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};function $0(){if(Object.keys(pe).forEach(function(s){if(typeof this[s]=="undefined")this[s]=pe[s].def;else{if(pe[s].num&&isNaN(this[s]))throw new Error("Invalid parameter value, must be numeric "+s+" = "+this[s]);pe[s].num&&(this[s]=parseFloat(this[s]))}pe[s].degrees&&(this[s]=this[s]*Z)}.bind(this)),Math.abs(Math.abs(this.lat0)-P)<x?this.mode=this.lat0<0?ct.S_POLE:ct.N_POLE:Math.abs(this.lat0)<x?this.mode=ct.EQUIT:(this.mode=ct.OBLIQ,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var t=this.tilt,e=this.azi;this.cg=Math.cos(e),this.sg=Math.sin(e),this.cw=Math.cos(t),this.sw=Math.sin(t)}function D0(t){t.x-=this.long0;var e=Math.sin(t.y),s=Math.cos(t.y),a=Math.cos(t.x),i,r;switch(this.mode){case ct.OBLIQ:r=this.sinph0*e+this.cosph0*s*a;break;case ct.EQUIT:r=s*a;break;case ct.S_POLE:r=-e;break;case ct.N_POLE:r=e;break}switch(r=this.pn1/(this.p-r),i=r*s*Math.sin(t.x),this.mode){case ct.OBLIQ:r*=this.cosph0*e-this.sinph0*s*a;break;case ct.EQUIT:r*=e;break;case ct.N_POLE:r*=-(s*a);break;case ct.S_POLE:r*=s*a;break}var o,n;return o=r*this.cg+i*this.sg,n=1/(o*this.sw*this.h1+this.cw),i=(i*this.cg-r*this.sg)*this.cw*n,r=o*n,t.x=i*this.a,t.y=r*this.a,t}function U0(t){t.x/=this.a,t.y/=this.a;var e={x:t.x,y:t.y},s,a,i;i=1/(this.pn1-t.y*this.sw),s=this.pn1*t.x*i,a=this.pn1*t.y*this.cw*i,t.x=s*this.cg+a*this.sg,t.y=a*this.cg-s*this.sg;var r=mt(t.x,t.y);if(Math.abs(r)<x)e.x=0,e.y=t.y;else{var o,n;switch(n=1-r*r*this.pfact,n=(this.p-Math.sqrt(n))/(this.pn1/r+r/this.pn1),o=Math.sqrt(1-n*n),this.mode){case ct.OBLIQ:e.y=Math.asin(o*this.sinph0+t.y*n*this.cosph0/r),t.y=(o-this.sinph0*Math.sin(e.y))*r,t.x*=n*this.cosph0;break;case ct.EQUIT:e.y=Math.asin(t.y*n/r),t.y=o*r,t.x*=n;break;case ct.N_POLE:e.y=Math.asin(o),t.y=-t.y;break;case ct.S_POLE:e.y=-Math.asin(o);break}e.x=Math.atan2(t.x,t.y)}return t.x=e.x+this.long0,t.y=e.y,t}var B0=["Tilted_Perspective","tpers"];const z0={init:$0,forward:D0,inverse:U0,names:B0};function W0(){if(this.flip_axis=this.sweep==="x"?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,this.es!==0){var t=1-this.es,e=1/t;this.radius_p=Math.sqrt(t),this.radius_p2=t,this.radius_p_inv2=e,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")}function V0(t){var e=t.x,s=t.y,a,i,r,o;if(e=e-this.long0,this.shape==="ellipse"){s=Math.atan(this.radius_p2*Math.tan(s));var n=this.radius_p/mt(this.radius_p*Math.cos(s),Math.sin(s));if(i=n*Math.cos(e)*Math.cos(s),r=n*Math.sin(e)*Math.cos(s),o=n*Math.sin(s),(this.radius_g-i)*i-r*r-o*o*this.radius_p_inv2<0)return t.x=Number.NaN,t.y=Number.NaN,t;a=this.radius_g-i,this.flip_axis?(t.x=this.radius_g_1*Math.atan(r/mt(o,a)),t.y=this.radius_g_1*Math.atan(o/a)):(t.x=this.radius_g_1*Math.atan(r/a),t.y=this.radius_g_1*Math.atan(o/mt(r,a)))}else this.shape==="sphere"&&(a=Math.cos(s),i=Math.cos(e)*a,r=Math.sin(e)*a,o=Math.sin(s),a=this.radius_g-i,this.flip_axis?(t.x=this.radius_g_1*Math.atan(r/mt(o,a)),t.y=this.radius_g_1*Math.atan(o/a)):(t.x=this.radius_g_1*Math.atan(r/a),t.y=this.radius_g_1*Math.atan(o/mt(r,a))));return t.x=t.x*this.a,t.y=t.y*this.a,t}function H0(t){var e=-1,s=0,a=0,i,r,o,n;if(t.x=t.x/this.a,t.y=t.y/this.a,this.shape==="ellipse"){this.flip_axis?(a=Math.tan(t.y/this.radius_g_1),s=Math.tan(t.x/this.radius_g_1)*mt(1,a)):(s=Math.tan(t.x/this.radius_g_1),a=Math.tan(t.y/this.radius_g_1)*mt(1,s));var h=a/this.radius_p;if(i=s*s+h*h+e*e,r=2*this.radius_g*e,o=r*r-4*i*this.C,o<0)return t.x=Number.NaN,t.y=Number.NaN,t;n=(-r-Math.sqrt(o))/(2*i),e=this.radius_g+n*e,s*=n,a*=n,t.x=Math.atan2(s,e),t.y=Math.atan(a*Math.cos(t.x)/e),t.y=Math.atan(this.radius_p_inv2*Math.tan(t.y))}else if(this.shape==="sphere"){if(this.flip_axis?(a=Math.tan(t.y/this.radius_g_1),s=Math.tan(t.x/this.radius_g_1)*Math.sqrt(1+a*a)):(s=Math.tan(t.x/this.radius_g_1),a=Math.tan(t.y/this.radius_g_1)*Math.sqrt(1+s*s)),i=s*s+a*a+e*e,r=2*this.radius_g*e,o=r*r-4*i*this.C,o<0)return t.x=Number.NaN,t.y=Number.NaN,t;n=(-r-Math.sqrt(o))/(2*i),e=this.radius_g+n*e,s*=n,a*=n,t.x=Math.atan2(s,e),t.y=Math.atan(a*Math.cos(t.x)/e)}return t.x=t.x+this.long0,t}var Q0=["Geostationary Satellite View","Geostationary_Satellite","geos"];const J0={init:W0,forward:V0,inverse:H0,names:Q0};var Ae=1.340264,Ie=-.081106,Ce=893e-6,Le=.003796,ws=Math.sqrt(3)/2;function X0(){this.long0=this.long0!==void 0?this.long0:0,this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.es!==0&&(this.apa=ci(this.es),this.qp=Ct(this.e,1),this.rqda=Math.sqrt(.5*this.qp))}function K0(t){var e=G(t.x-this.long0,this.over),s=t.y,a=Math.sin(s);this.es!==0&&(a=Ct(this.e,a)/this.qp);var i=Math.asin(ws*a),r=i*i,o=r*r*r;return t.x=e*Math.cos(i)/(ws*(Ae+3*Ie*r+o*(7*Ce+9*Le*r))),t.y=i*(Ae+Ie*r+o*(Ce+Le*r)),this.es!==0&&(t.x*=this.rqda,t.y*=this.rqda),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function Z0(t){t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,this.es!==0&&(t.x/=this.rqda,t.y/=this.rqda);var e=1e-9,s=12,a=t.y,i,r,o,n,h,l;for(l=0;l<s&&(i=a*a,r=i*i*i,o=a*(Ae+Ie*i+r*(Ce+Le*i))-t.y,n=Ae+3*Ie*i+r*(7*Ce+9*Le*i),a-=h=o/n,!(Math.abs(h)<e));++l);return i=a*a,r=i*i*i,t.x=ws*t.x*(Ae+3*Ie*i+r*(7*Ce+9*Le*i))/Math.cos(a),t.y=Math.asin(Math.sin(a)/ws),this.es!==0&&(t.y=fi(t.y,this.apa)),t.x=G(t.x+this.long0,this.over),t}var Y0=["eqearth","Equal Earth","Equal_Earth"];const tl={init:X0,forward:K0,inverse:Z0,names:Y0};var Fe=1e-10;function el(){var t;if(this.phi1=this.lat1,Math.abs(this.phi1)<Fe)throw new Error;this.es?(this.en=Ks(this.es),this.m1=ue(this.phi1,this.am1=Math.sin(this.phi1),t=Math.cos(this.phi1),this.en),this.am1=t/(Math.sqrt(1-this.es*this.am1*this.am1)*this.am1),this.inverse=al,this.forward=sl):(Math.abs(this.phi1)+Fe>=P?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=rl,this.forward=il)}function sl(t){var e=G(t.x-(this.long0||0),this.over),s=t.y,a,i,r;return a=this.am1+this.m1-ue(s,i=Math.sin(s),r=Math.cos(s),this.en),i=r*e/(a*Math.sqrt(1-this.es*i*i)),t.x=a*Math.sin(i),t.y=this.am1-a*Math.cos(i),t.x=this.a*t.x+(this.x0||0),t.y=this.a*t.y+(this.y0||0),t}function al(t){t.x=(t.x-(this.x0||0))/this.a,t.y=(t.y-(this.y0||0))/this.a;var e,s,a,i;if(s=mt(t.x,t.y=this.am1-t.y),i=Zs(this.am1+this.m1-s,this.es,this.en),(e=Math.abs(i))<P)e=Math.sin(i),a=s*Math.atan2(t.x,t.y)*Math.sqrt(1-this.es*e*e)/Math.cos(i);else if(Math.abs(e-P)<=Fe)a=0;else throw new Error;return t.x=G(a+(this.long0||0),this.over),t.y=Ut(i),t}function il(t){var e=G(t.x-(this.long0||0),this.over),s=t.y,a,i;return i=this.cphi1+this.phi1-s,Math.abs(i)>Fe?(t.x=i*Math.sin(a=e*Math.cos(s)/i),t.y=this.cphi1-i*Math.cos(a)):t.x=t.y=0,t.x=this.a*t.x+(this.x0||0),t.y=this.a*t.y+(this.y0||0),t}function rl(t){t.x=(t.x-(this.x0||0))/this.a,t.y=(t.y-(this.y0||0))/this.a;var e,s,a=mt(t.x,t.y=this.cphi1-t.y);if(s=this.cphi1+this.phi1-a,Math.abs(s)>P)throw new Error;return Math.abs(Math.abs(s)-P)<=Fe?e=0:e=a*Math.atan2(t.x,t.y)/Math.cos(s),t.x=G(e+(this.long0||0),this.over),t.y=Ut(s),t}var nl=["bonne","Bonne (Werner lat_1=90)"];const ol={init:el,names:nl},ka={OBLIQUE:{forward:fl,inverse:vl},TRANSVERSE:{forward:gl,inverse:dl}},Es={ROTATE:{o_alpha:"oAlpha",o_lon_c:"oLongC",o_lat_c:"oLatC"},NEW_POLE:{o_lat_p:"oLatP",o_lon_p:"oLongP"},NEW_EQUATOR:{o_lon_1:"oLong1",o_lat_1:"oLat1",o_lon_2:"oLong2",o_lat_2:"oLat2"}};function hl(){if(this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.title=this.title||"General Oblique Transformation",this.isIdentity=Ka.includes(this.o_proj),!this.o_proj)throw new Error("Missing parameter: o_proj");if(this.o_proj==="ob_tran")throw new Error("Invalid value for o_proj: "+this.o_proj);const t=this.projStr.replace("+proj=ob_tran","").replace("+o_proj=","+proj=").trim(),e=pt(t);if(!e)throw new Error("Invalid parameter: o_proj. Unknown projection "+this.o_proj);e.long0=0,this.obliqueProjection=e;let s;const a=Object.keys(Es),i=n=>{if(typeof this[n]=="undefined")return;const h=parseFloat(this[n])*Z;if(isNaN(h))throw new Error("Invalid value for "+n+": "+this[n]);return h};for(let n=0;n<a.length;n++){const h=a[n],l=Es[h],g=Object.entries(l);if(g.some(([u])=>typeof this[u]!="undefined")){s=l;for(let u=0;u<g.length;u++){const[y,w]=g[u],E=i(y);if(typeof E=="undefined")throw new Error("Missing parameter: "+y+".");this[w]=E}break}}if(!s)throw new Error("No valid parameters provided for ob_tran projection.");const{lamp:r,phip:o}=cl(this,s);this.lamp=r,Math.abs(o)>x?(this.cphip=Math.cos(o),this.sphip=Math.sin(o),this.projectionType=ka.OBLIQUE):this.projectionType=ka.TRANSVERSE}function ll(t){return this.projectionType.forward(this,t)}function ul(t){return this.projectionType.inverse(this,t)}function cl(t,e){let s,a;if(e===Es.ROTATE){let i=t.oLongC,r=t.oLatC,o=t.oAlpha;if(Math.abs(Math.abs(r)-P)<=x)throw new Error("Invalid value for o_lat_c: "+t.o_lat_c+" should be < 90°");a=i+Math.atan2(-1*Math.cos(o),-1*Math.sin(o)*Math.sin(r)),s=Math.asin(Math.cos(r)*Math.sin(o))}else if(e===Es.NEW_POLE)a=t.oLongP,s=t.oLatP;else{let i=t.oLong1,r=t.oLat1,o=t.oLong2,n=t.oLat2,h=Math.abs(r);if(Math.abs(r)>P-x)throw new Error("Invalid value for o_lat_1: "+t.o_lat_1+" should be < 90°");if(Math.abs(n)>P-x)throw new Error("Invalid value for o_lat_2: "+t.o_lat_2+" should be < 90°");if(Math.abs(r-n)<x)throw new Error("Invalid value for o_lat_1 and o_lat_2: o_lat_1 should be different from o_lat_2");if(h<x)throw new Error("Invalid value for o_lat_1: o_lat_1 should be different from zero");a=Math.atan2(Math.cos(r)*Math.sin(n)*Math.cos(i)-Math.sin(r)*Math.cos(n)*Math.cos(o),Math.sin(r)*Math.cos(n)*Math.sin(o)-Math.cos(r)*Math.sin(n)*Math.sin(i)),s=Math.atan(-1*Math.cos(a-i)/Math.tan(r))}return{lamp:a,phip:s}}function fl(t,e){let{x:s,y:a}=e;s=G(s-t.long0,t.over);const i=Math.cos(s),r=Math.sin(a),o=Math.cos(a);e.x=G(Math.atan2(o*Math.sin(s),t.sphip*o*i+t.cphip*r)+t.lamp),e.y=Math.asin(t.sphip*r-t.cphip*o*i);const n=t.obliqueProjection.forward(e);return t.isIdentity&&(n.x*=yt,n.y*=yt),n}function gl(t,e){let{x:s,y:a}=e;s=G(s-t.long0,t.over);const i=Math.cos(a),r=Math.cos(s);e.x=G(Math.atan2(i*Math.sin(s),Math.sin(a))+t.lamp),e.y=Math.asin(-1*i*r);const o=t.obliqueProjection.forward(e);return t.isIdentity&&(o.x*=yt,o.y*=yt),o}function vl(t,e){t.isIdentity&&(e.x*=Z,e.y*=Z);const s=t.obliqueProjection.inverse(e);let{x:a,y:i}=s;if(a<Number.MAX_VALUE){a-=t.lamp;const r=Math.cos(a),o=Math.sin(i),n=Math.cos(i);e.x=Math.atan2(n*Math.sin(a),t.sphip*n*r-t.cphip*o),e.y=Math.asin(t.sphip*o+t.cphip*n*r)}return e.x=G(e.x+t.long0),e}function dl(t,e){t.isIdentity&&(e.x*=Z,e.y*=Z);const s=t.obliqueProjection.inverse(e);let{x:a,y:i}=s;if(a<Number.MAX_VALUE){const r=Math.cos(i);a-=t.lamp,e.x=Math.atan2(r*Math.sin(a),-1*Math.sin(i)),e.y=Math.asin(r*Math.cos(a))}return e.x=G(e.x+t.long0),e}var _l=["General Oblique Transformation","General_Oblique_Transformation","ob_tran"];const Ml={init:hl,forward:ll,inverse:ul,names:_l};function ml(t){t.Proj.projections.add(ls),t.Proj.projections.add(us),t.Proj.projections.add(ao),t.Proj.projections.add(go),t.Proj.projections.add(yo),t.Proj.projections.add(po),t.Proj.projections.add(Io),t.Proj.projections.add(Oo),t.Proj.projections.add($o),t.Proj.projections.add(Wo),t.Proj.projections.add(sh),t.Proj.projections.add(hh),t.Proj.projections.add(gh),t.Proj.projections.add(yh),t.Proj.projections.add(ph),t.Proj.projections.add(Ah),t.Proj.projections.add(Th),t.Proj.projections.add(qh),t.Proj.projections.add(Bh),t.Proj.projections.add(Qh),t.Proj.projections.add(Yh),t.Proj.projections.add(i0),t.Proj.projections.add(l0),t.Proj.projections.add(_0),t.Proj.projections.add(E0),t.Proj.projections.add(b0),t.Proj.projections.add(T0),t.Proj.projections.add(q0),t.Proj.projections.add(z0),t.Proj.projections.add(J0),t.Proj.projections.add(tl),t.Proj.projections.add(ol),t.Proj.projections.add(Ml)}const Ps=Object.assign(wn,{defaultDatum:"WGS84",Proj:pt,WGS84:new pt("WGS84"),Point:he,toPoint:Js,defs:ot,nadgrid:Zr,transform:yn,mgrs:En,version:"__VERSION__"});ml(Ps);try{let t=()=>new DecompressionStream("deflate-raw"),e=s=>new Response(s);t(),mi=s=>e(e(s).body.pipeThrough(t())).arrayBuffer().then(a=>new Uint8Array(a))}catch(t){}var mi,qa=new TextDecoder,qs=t=>{throw Error("but-unzip~"+t)};function*yl(t,e=mi){let s=t.length-21,a=s-65536,i=new DataView(t.buffer,t.byteOffset),r=h=>i.getUint16(h+s,1),o=h=>i.getUint32(h+s,1),n=(h,l)=>t.subarray(s+=h,s+=l);for(;s>a&&(s=t.lastIndexOf(80,s-1))+1&&(t[s+1]-75||t[s+2]-5||t[s+3]-6););for(s<0&&qs(2),a=r(10),a-r(8)&&qs(3),s=o(16);a--;){let h=r(10),l=r(28),g=r(30),f=r(32),u=o(20),y=o(42),w=qa.decode(n(46,l)),E=qa.decode(n(g,f)),S=s,b;s=y,b=n(30+r(26)+r(28),u),yield{filename:w,comment:E,read:()=>h-8?h?qs(1):b:e(b)},s=S}}const wl=/.+\.(shp|dbf|json|prj|cpg)$/i,El=t=>nt(void 0,null,function*(){const e={},s=[];for(const r of yl(t))wl.test(r.filename)&&s.push(Promise.resolve(r.read()).then(o=>e[r.filename]=o));yield Promise.all(s);const a={},i=new TextDecoder;for(const[r,o]of Object.entries(e))r.slice(-3).toLowerCase()==="shp"||r.slice(-3).toLowerCase()==="dbf"?a[r]=new DataView(o.buffer,o.byteOffset,o.byteLength):a[r]=i.decode(o);return a}),Sl=globalThis.URL,Pl=(t,e)=>{if(!e)return t;const s=new Sl(t);return s.pathname=`${s.pathname}.${e}`,s.href};function je(t,e){return nt(this,null,function*(){const s=Pl(t,e),a=e==="prj"||e==="cpg";try{const i=yield fetch(s);if(i.status>399)throw new Error(i.statusText);if(a)return i.text();const r=yield i.arrayBuffer();return new DataView(r)}catch(i){if(a||e==="dbf")return!1;throw i}})}function pl(t){let e=0,s=1;const a=t.length;let i,r;const o=[t[0][0],t[0][1],t[0][0],t[0][1]];for(;s<a;)i=r||t[0],r=t[s],e+=(r[0]-i[0])*(r[1]+i[1]),s++,r[0]<o[0]&&(o[0]=r[0]),r[1]<o[1]&&(o[1]=r[1]),r[0]>o[2]&&(o[2]=r[0]),r[1]>o[3]&&(o[3]=r[1]);return{ring:t,clockWise:e>0,bbox:o,children:[]}}function $a(t,e){return!(t.bbox[0]>e.bbox[0]||t.bbox[1]>e.bbox[1]||t.bbox[2]<e.bbox[2]||t.bbox[3]<e.bbox[3])}function yi(t,e=!1){const s=[],a=[];for(const o of t){const n=pl(o);n.clockWise!==e?s.push(n):a.push(n)}const i=[];for(const o of a){let n;for(const h of s)$a(h,o)&&(n?$a(n,h)&&(n=h):n=h);n?n.children.push(o.ring):i.push(o)}if(e)return{outers:s,orphens:i};if(i.length&&!e){const o=yi(t,!0);if(o.orphens.length===0){const n=[];for(const h of o.outers)n.push([h.ring.toReversed()].concat(h.children.map(l=>l.toReversed())));return n}}const r=[];for(const o of s)r.push([o.ring].concat(o.children));return r}st.prototype.parsePoint=function(t){return{type:"Point",coordinates:this.parseCoord(t,0)}};st.prototype.parseZPoint=function(t){const e=this.parsePoint(t);return e.coordinates.push(t.getFloat64(16,!0)),e};st.prototype.parsePointArray=function(t,e,s){const a=[];let i=0;for(;i<s;)a.push(this.parseCoord(t,e)),e+=16,i++;return a};st.prototype.parseZPointArray=function(t,e,s,a){let i=0;for(;i<s;)a[i].push(t.getFloat64(e,!0)),i++,e+=8;return a};st.prototype.parseArrayGroup=function(t,e,s,a,i){const r=[];let o=0,n,h=0,l;for(;o<a;)o++,s+=4,n=h,o===a?h=i:h=t.getInt32(s,!0),l=h-n,l&&(r.push(this.parsePointArray(t,e,l)),e+=l<<4);return r};st.prototype.parseZArrayGroup=function(t,e,s,a){let i=0;for(;i<s;)a[i]=this.parseZPointArray(t,e,a[i].length,a[i]),e+=a[i].length<<3,i++;return a};st.prototype.parseMultiPoint=function(t){const e={},s=t.getInt32(32,!0);if(!s)return null;const a=this.parseCoord(t,0),i=this.parseCoord(t,16);e.bbox=[a[0],a[1],i[0],i[1]];const r=36;return s===1?(e.type="Point",e.coordinates=this.parseCoord(t,r)):(e.type="MultiPoint",e.coordinates=this.parsePointArray(t,r,s)),e};st.prototype.parseZMultiPoint=function(t){const e=this.parseMultiPoint(t);if(!e)return null;let s;if(e.type==="Point")return e.coordinates.push(t.getFloat64(72,!0)),e;s=e.coordinates.length;const a=52+(s<<4);return e.coordinates=this.parseZPointArray(t,a,s,e.coordinates),e};st.prototype.parsePolyline=function(t){const e={},s=t.getInt32(32,!0);if(!s)return null;const a=this.parseCoord(t,0),i=this.parseCoord(t,16);e.bbox=[a[0],a[1],i[0],i[1]];const r=t.getInt32(36,!0);let o,n;return s===1?(e.type="LineString",o=44,e.coordinates=this.parsePointArray(t,o,r)):(e.type="MultiLineString",o=40+(s<<2),n=40,e.coordinates=this.parseArrayGroup(t,o,n,s,r)),e};st.prototype.parseZPolyline=function(t){const e=this.parsePolyline(t);if(!e)return null;const s=e.coordinates.length;let a;return e.type==="LineString"?(a=60+(s<<4),e.coordinates=this.parseZPointArray(t,a,s,e.coordinates),e):(a=56+(e.coordinates.reduce(function(r,o){return r+o.length},0)<<4)+(s<<2),e.coordinates=this.parseZArrayGroup(t,a,s,e.coordinates),e)};st.prototype.polyFuncs=function(t){return t&&(t.type==="LineString"?(t.type="Polygon",t.coordinates=[t.coordinates],t):(t.coordinates=yi(t.coordinates),t.coordinates.length===1?(t.type="Polygon",t.coordinates=t.coordinates[0],t):(t.type="MultiPolygon",t)))};st.prototype.parsePolygon=function(t){return this.polyFuncs(this.parsePolyline(t))};st.prototype.parseZPolygon=function(t){return this.polyFuncs(this.parseZPolyline(t))};const Da={1:"parsePoint",3:"parsePolyline",5:"parsePolygon",8:"parseMultiPoint",11:"parseZPoint",13:"parseZPolyline",15:"parseZPolygon",18:"parseZMultiPoint"};function xl(t){return t?function(e,s){const a=[e.getFloat64(s,!0),e.getFloat64(s+8,!0)];return t.inverse(a)}:function(e,s){return[e.getFloat64(s,!0),e.getFloat64(s+8,!0)]}}function st(t,e){if(!(this instanceof st))return new st(t,e);this.buffer=t,this.headers=this.parseHeader(),this.shpFuncs(e),this.rows=this.getRows()}st.prototype.shpFuncs=function(t){let e=this.headers.shpCode;if(e>20&&(e-=20),!(e in Da))throw new Error(`I don't know shp type "${e}"`);this.parseFunc=this[Da[e]],this.parseCoord=xl(t)};st.prototype.getShpCode=function(){return this.parseHeader().shpCode};st.prototype.parseHeader=function(){const t=this.buffer;return{length:t.getInt32(24)<<1,version:t.getInt32(28,!0),shpCode:t.getInt32(32,!0),bbox:[t.getFloat64(36,!0),t.getFloat64(44,!0),t.getFloat64(52,!0),t.getFloat64(60,!0)]}};st.prototype.getRows=function(){let t=100;const e=this.buffer.byteLength-8,s=[];let a;for(;t<=e&&(a=this.getRow(t),!!a);)t+=8,t+=a.len,a.type?s.push(this.parseFunc(a.data)):s.push(null);return s};st.prototype.getRow=function(t){const e=this.buffer.getInt32(t),s=this.buffer.getInt32(t+4)<<1;if(s===0)return{id:e,len:s,type:0};if(!(t+s+8>this.buffer.byteLength))return{id:e,len:s,data:new DataView(this.buffer.buffer,this.buffer.byteOffset+t+12,s-4),type:this.buffer.getInt32(t+8,!0)}};function ia(t,e){return new st(t,e).rows}var bl=/^(?:ANSI\s)?(\d+)$/m;function wi(t,e){if(!t)return a;try{new TextDecoder(t.trim())}catch(i){var s=bl.exec(t);return s&&!e?wi("windows-"+s[1],!0):(t=void 0,a)}return a;function a(i){var r=new TextDecoder(t||void 0),o=r.decode(i,{stream:!0})+r.decode();return o.replace(/\0/g,"").trim()}}function Gl(t){var e={};return e.lastUpdated=new Date(t.getUint8(1)+1900,t.getUint8(2),t.getUint8(3)),e.records=t.getUint32(4,!0),e.headerLen=t.getUint16(8,!0),e.recLen=t.getUint16(10,!0),e}function Nl(t,e,s){for(var a=[],i=32;i<e&&(a.push({name:s(new Uint8Array(t.buffer.slice(t.byteOffset+i,t.byteOffset+i+11))),dataType:String.fromCharCode(t.getUint8(i+11)),len:t.getUint8(i+16),decimal:t.getUint8(i+17)}),t.getUint8(i+32)!==13);)i+=32;return a}function Al(t,e,s,a,i){const r=new Uint8Array(t.buffer.slice(t.byteOffset+e,t.byteOffset+e+s));var o=i(r);switch(a){case"N":case"F":case"O":return parseFloat(o,10);case"D":return new Date(o.slice(0,4),parseInt(o.slice(4,6),10)-1,o.slice(6,8));case"L":return o.toLowerCase()==="y"||o.toLowerCase()==="t";default:return o}}function Il(t,e,s,a){for(var i={},r=0,o=s.length,n,h;r<o;)h=s[r],n=Al(t,e,h.len,h.dataType,a),e+=h.len,typeof n!="undefined"&&(i[h.name]=n),r++;return i}function ra(t,e){for(var s=wi(e),a=Gl(t),i=Nl(t,a.headerLen-1,s),r=(i.length+1<<5)+2,o=a.recLen,n=a.records,h=[];n;)h.push(Il(t,r,i,s)),r+=o,n--;return h}const Cl=globalThis.URL,Ll=t=>{if(!t)throw new Error("forgot to pass buffer");if(le(t))return new Uint8Array(t);if(le(t.buffer))return t.BYTES_PER_ELEMENT===1?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("invalid buffer like object")},Rl=new TextDecoder,Ei=t=>{if(t){if(typeof t=="string")return t;if(le(t)||ArrayBuffer.isView(t)||na(t))return Rl.decode(t)}},Si=t=>{if(!t)throw new Error("forgot to pass buffer");if(na(t))return t;if(le(t))return new DataView(t);if(le(t.buffer))return new DataView(t.buffer,t.byteOffset,t.byteLength);throw new Error("invalid buffer like object")};function le(t){return t instanceof globalThis.ArrayBuffer||Object.prototype.toString.call(t)==="[object ArrayBuffer]"}function na(t){return t instanceof globalThis.DataView||Object.prototype.toString.call(t)==="[object DataView]"}const oa=function([t,e]){const s={};s.type="FeatureCollection",s.features=[];let a=0;const i=t.length;for(e||(e=[]);a<i;)s.features.push({type:"Feature",geometry:t[a],properties:e[a]||{}}),a++;return s},Pi=function(t,e){return nt(this,null,function*(){let s;t=Ll(t);const a=yield El(t),i=[];e=e||[];for(s in a)s.indexOf("__MACOSX")===-1&&(s.slice(-4).toLowerCase()===".shp"?(i.push(s.slice(0,-4)),a[s.slice(0,-3)+s.slice(-3).toLowerCase()]=a[s]):s.slice(-4).toLowerCase()===".prj"?a[s.slice(0,-3)+s.slice(-3).toLowerCase()]=Ps(a[s]):s.slice(-5).toLowerCase()===".json"||e.indexOf(s.split(".").pop())>-1?i.push(s.slice(0,-3)+s.slice(-3).toLowerCase()):(s.slice(-4).toLowerCase()===".dbf"||s.slice(-4).toLowerCase()===".cpg")&&(a[s.slice(0,-3)+s.slice(-3).toLowerCase()]=a[s]));if(!i.length)throw new Error("no layers founds");const r=i.map(function(o){let n,h;const l=o.lastIndexOf(".");return l>-1&&o.slice(l).indexOf("json")>-1?(n=JSON.parse(a[o]),n.fileName=o.slice(0,l)):e.indexOf(o.slice(l+1))>-1?(n=a[o],n.fileName=o):(a[o+".dbf"]&&(h=ra(a[o+".dbf"],a[o+".cpg"])),n=oa([ia(a[o+".shp"],a[o+".prj"]),h]),n.fileName=o),n});return r.length===1?r[0]:r})};function Tl(t,e){return nt(this,null,function*(){const s=yield je(t);return Pi(s,e)})}const Ol=t=>nt(void 0,null,function*(){const e=yield Promise.all([je(t,"shp"),je(t,"prj")]);let s=!1;try{e[1]&&(s=Ps(e[1]))}catch(a){s=!1}return ia(e[0],s)}),Fl=t=>nt(void 0,null,function*(){const[e,s]=yield Promise.all([je(t,"dbf"),je(t,"cpg")]);if(e)return ra(e,s)}),Ua=(t,e)=>{var a;return new Cl(t,(a=globalThis==null?void 0:globalThis.document)==null?void 0:a.location).pathname.slice(-4).toLowerCase()===e},jl=({shp:t,dbf:e,cpg:s,prj:a})=>{const i=[ql(t,a)];return e&&i.push($l(e,s)),oa(i)},kl=function(t,e){return nt(this,null,function*(){if(typeof t!="string"){if(le(t)||ArrayBuffer.isView(t)||na(t))return Pi(t);if(t.shp)return jl(t);throw new TypeError("must be a string, some sort of Buffer, or an object with at least a .shp property")}if(Ua(t,".zip"))return Tl(t,e);Ua(t,".shp")&&(t=t.slice(0,-4));const s=yield Promise.all([Ol(t),Fl(t)]);return oa(s)})},ql=function(t,e){if(t=Si(t),e=Ei(e),typeof e=="string")try{e=Ps(e)}catch(s){e=!1}return ia(t,e)},$l=function(t,e){return t=Si(t),e=Ei(e),ra(t,e)};const Dl={class:"engineering-analysis-panel"},Ul={class:"analysis-card-head"},Bl={key:0},zl=["disabled"],Wl=["disabled"],Vl={key:1,class:"analysis-drawing-stage"},Hl={class:"analysis-point-count"},Ql=["disabled"],Jl=["disabled"],Xl={key:2,class:"analysis-boundary-bar"},Kl={class:"analysis-card-head"},Zl={key:0,class:"analysis-running"},Yl={class:"analysis-conclusion-head"},t1={class:"analysis-conclusion-tags"},e1={key:2,class:"analysis-empty is-success"},s1={key:3,class:"analysis-project-list"},a1=["onPointerup"],i1={class:"analysis-project-name"},r1={class:"analysis-project-meta"},n1={__name:"EngineeringAnalysisPanel",props:{drawingPointCount:{type:Number,default:0}},emits:["drawing-change","finish-drawing","undo-point","clear-boundary","analysis-result","focus-project"],setup(t,{expose:e,emit:s}){const a=t,i=s,r=Q(!1),o=Q(null),n=Q([]),h=Q([]),l=Q(""),g=Q("idle"),f=Q([]),u=Q("idle"),y=Q("");let w=null,E=0;const S=z(()=>{var p;const v=h.value.length,d=n.value.length,M=n.value.reduce((C,$)=>C+Number($.overlapAreaWanMu||0),0);return{boundaryAreaWanMu:Zt((p=o.value)==null?void 0:p.geometry),featureCount:v,projectCount:d,overlapAreaWanMu:M}}),b=z(()=>l.value?l.value:I.value?"自动分析中":g.value==="loading"?"项目库加载中":g.value==="error"?"项目库加载失败":""),A=z(()=>o.value?I.value?"正在分析":u.value==="error"?"分析异常":n.value.length?"已发现建设记录":"未发现建设记录":"未分析"),I=z(()=>u.value==="running"),T=z(()=>!!o.value&&u.value==="done"),j=z(()=>I.value?"正在自动分析":u.value==="error"?"分析失败":n.value.length?`命中 ${n.value.length}`:A.value),O=z(()=>r.value&&a.drawingPointCount>=3),F=z(()=>{if(!o.value)return{levelClass:"",verdict:"",summary:"",tags:[],advice:""};if(!n.value.length)return{levelClass:"is-clear",verdict:"未发现建设记录",summary:"该边界范围暂未与项目库中的已建设工程形成空间叠加。",tags:[`分析范围 ${As(S.value.boundaryAreaWanMu)} 万亩`,"项目库未命中"],advice:"可进入新增工程选址论证,仍需结合保护红线、审批台账和现场踏勘复核。"};const v=Ye(n.value),d=we(n.value),M=[...n.value].sort(($,V)=>Number(V.overlapAreaWanMu||0)-Number($.overlapAreaWanMu||0))[0],p=Vt(S.value.overlapAreaWanMu),C=n.value.length>=6||S.value.overlapAreaWanMu>=1?"存在建设叠加":"存在局部叠加";return{levelClass:n.value.length>=6?"is-heavy":"is-hit",verdict:C,summary:`该边界命中 ${n.value.length} 个历史项目,叠加约 ${p} 亩,项目类型以${v.name}为主,年份集中在 ${d}`,tags:[`主类型 ${v.name}`,`年份 ${d}`,`最大叠加 ${Vt(M==null?void 0:M.overlapAreaWanMu)}`],advice:`重点复核“${ts(M==null?void 0:M.projectName)}”(${(M==null?void 0:M.year)||"未知"}${(M==null?void 0:M.category)||"未知类型"})与拟建范围的重合边界。`}});Ba(()=>{ge().catch(()=>{})});function K(v){return nt(this,null,function*(){var M;const d=(M=v.target.files)==null?void 0:M[0];if(v.target.value="",!!d){l.value="";try{const p=yield W(d);r.value&&(r.value=!1,i("drawing-change",!1)),i("clear-boundary"),yield Bt(p)}catch(p){l.value="边界文件解析失败"}}})}function W(v){return nt(this,null,function*(){const d=String(v.name||"").toLowerCase();if(d.endsWith(".json")||d.endsWith(".geojson"))return dt(JSON.parse(yield v.text()));if(d.endsWith(".zip")){const M=yield kl(yield v.arrayBuffer());return dt(M)}throw new Error("unsupported file")})}function dt(v){const d=zt(v).filter(M=>Ve(M==null?void 0:M.geometry));if(d.length)return Rt(d);throw new Error("no polygon")}function ht(){r.value||(E+=1,l.value="",u.value="idle",y.value="",r.value=!0,o.value=null,n.value=[],h.value=[],i("analysis-result",{boundary:null,matches:[],rows:[],summary:S.value}),i("drawing-change",!0))}function D(){r.value&&(E+=1,r.value=!1,u.value="idle",y.value="",i("clear-boundary"),i("analysis-result",{boundary:null,matches:[],rows:[],summary:S.value}))}function _t(){O.value&&i("finish-drawing")}function ce(){i("undo-point")}function ps(){E+=1,r.value=!1,o.value=null,n.value=[],h.value=[],l.value="",u.value="idle",y.value="",i("clear-boundary"),i("analysis-result",{boundary:null,matches:[],rows:[],summary:S.value})}function xt(v){v!=null&&v.geometry&&(r.value=!1,Bt(v))}function Bt(v){return nt(this,null,function*(){const d=++E;o.value=v,h.value=[],n.value=[],y.value="",l.value="",u.value="running";let M=[];i("analysis-result",{boundary:v,matches:[],rows:[],summary:S.value});try{const p=yield ge();if(d!==E)return;M=Be(v,p),h.value=M,n.value=xs(M),u.value="done"}catch(p){if(d!==E)return;l.value="项目库加载失败",u.value="error"}d===E&&i("analysis-result",{boundary:v,matches:M,rows:n.value,summary:S.value})})}function fe(v){y.value=(v==null?void 0:v.key)||"",i("focus-project",kt(Ot({},v),{boundary:o.value}))}function ge(){return nt(this,null,function*(){return f.value.length?f.value:w||(g.value="loading",w=fetch(ve("datas/ecological-protection/ecological_restoration_projects.geojson"),{credentials:"include"}).then(d=>{if(!d.ok)throw new Error(`HTTP ${d.status}`);return d.json()}).then(d=>{const M=zt(d).filter(p=>{var C;return(C=p==null?void 0:p.geometry)==null?void 0:C.coordinates}).map((p,C)=>kt(Ot({},p),{properties:kt(Ot({},p.properties||{}),{source_index:C})}));return f.value=M,g.value="success",M}).catch(d=>{throw g.value="error",w=null,d}),w)})}function ve(v){return v?/^https?:\/\//.test(v)||v.startsWith("/")?v:`./${v}`:""}function zt(v){return v?Array.isArray(v)?v.flatMap(d=>zt(d)):v.type==="FeatureCollection"?(v.features||[]).filter(Boolean):v.type==="Feature"?v.geometry?[v]:[]:He(v)?[{type:"Feature",properties:{},geometry:v}]:typeof v=="object"?Object.values(v).flatMap(d=>zt(d)):[]:[]}function Rt(v){const d=v.flatMap(M=>M.geometry.type==="Polygon"?[M.geometry.coordinates]:M.geometry.coordinates);return d.length===1?{type:"Feature",properties:v[0].properties||{},geometry:{type:"Polygon",coordinates:d[0]}}:{type:"Feature",properties:{sourceFeatureCount:v.length},geometry:{type:"MultiPolygon",coordinates:d}}}function Be(v,d=f.value){const M=Je(v.geometry);return d.filter(p=>bs(p.geometry,v.geometry,M)).map(p=>({feature:p,properties:p.properties||{},overlapAreaWanMu:Gs(p,v.geometry)}))}function xs(v){const d=new Map;return v.forEach(M=>{const p=M.properties||{},C=p.project_name||p.projectName||"未命名项目",$=d.get(C)||{key:C,projectName:C,category:p.project_category||"未知类型",year:p.year||"未知",featureCount:0,overlapAreaWanMu:0,features:[],sourceIndex:Number(p.source_index||0)};$.featureCount+=1,$.overlapAreaWanMu+=Number(M.overlapAreaWanMu||0),$.features.push(M.feature),d.set(C,$)}),[...d.values()].map(M=>kt(Ot({},M),{overlapAreaWanMu:Number(M.overlapAreaWanMu.toFixed(4))}))}function bs(v,d,M){if(!Xe(Je(v),M))return!1;const p=Wt(d);return p.length?Ve(v)?ze(v,p):(v==null?void 0:v.type)==="Point"?Tt(v.coordinates,p):(v==null?void 0:v.type)==="MultiPoint"?v.coordinates.some(C=>Tt(C,p)):(v==null?void 0:v.type)==="LineString"?de(v.coordinates,p):(v==null?void 0:v.type)==="MultiLineString"?v.coordinates.some(C=>de(C,p)):!1:!1}function ze(v,d){const M=Wt(v);return M.length?M.some(p=>p.some(C=>Tt(C,d)))||d.some(p=>p.some(C=>Tt(C,M)))||M.some(p=>d.some(C=>Qe(p,C))):!1}function de(v=[],d){return!Array.isArray(v)||!v.length?!1:v.some(M=>Tt(M,d))?!0:d.some(M=>We(v,M))}function We(v,d){for(let M=1;M<v.length;M+=1)for(let p=1;p<d.length;p+=1)if(_e(v[M-1],v[M],d[p-1],d[p]))return!0;return!1}function Gs(v,d){const M=v==null?void 0:v.geometry,p=Wt(M),C=Wt(d),$=me(v),V=Zt(d);if(!p.length||!C.length)return 0;const Y=p.reduce((at,it)=>at+it.filter(bt=>Tt(bt,C)).length,0),rt=p.reduce((at,it)=>at+it.length,0);return Y?Number(($*Math.max(.08,Math.min(1,Y/Math.max(rt,1)))).toFixed(4)):C.reduce((at,it)=>at+it.filter(bt=>Tt(bt,p)).length,0)?Number(Math.min($,V).toFixed(4)):p.some(at=>C.some(it=>Qe(at,it)))?Number((Math.min($,V)*.12).toFixed(4)):0}function Wt(v){var d;return(v==null?void 0:v.type)==="Polygon"?[((d=v.coordinates)==null?void 0:d[0])||[]]:(v==null?void 0:v.type)==="MultiPolygon"?v.coordinates.map(M=>(M==null?void 0:M[0])||[]).filter(M=>M.length):[]}function Ve(v){return(v==null?void 0:v.type)==="Polygon"||(v==null?void 0:v.type)==="MultiPolygon"}function He(v){return["Polygon","MultiPolygon","LineString","MultiLineString","Point","MultiPoint"].includes(v==null?void 0:v.type)}function Tt(v,d){return d.some(M=>Ns(v,M))}function Ns(v,d){var $,V,Y,rt;let M=!1;const p=Number(v==null?void 0:v[0]),C=Number(v==null?void 0:v[1]);for(let lt=0,at=d.length-1;lt<d.length;at=lt++){const it=Number(($=d[lt])==null?void 0:$[0]),bt=Number((V=d[lt])==null?void 0:V[1]),Is=Number((Y=d[at])==null?void 0:Y[0]),es=Number((rt=d[at])==null?void 0:rt[1]);bt>C!=es>C&&p<(Is-it)*(C-bt)/(es-bt)+it&&(M=!M)}return M}function Qe(v,d){for(let M=1;M<v.length;M+=1)for(let p=1;p<d.length;p+=1)if(_e(v[M-1],v[M],d[p-1],d[p]))return!0;return!1}function _e(v,d,M,p){if(!Me(v,d,M,p))return!1;const C=(lt,at,it)=>(Number(at[0])-Number(lt[0]))*(Number(it[1])-Number(lt[1]))-(Number(at[1])-Number(lt[1]))*(Number(it[0])-Number(lt[0])),$=C(v,d,M),V=C(v,d,p),Y=C(M,p,v),rt=C(M,p,d);return $===0&&Kt(M,v,d)||V===0&&Kt(p,v,d)||Y===0&&Kt(v,M,p)||rt===0&&Kt(d,M,p)?!0:($>0&&V<0||$<0&&V>0)&&(Y>0&&rt<0||Y<0&&rt>0)}function Me(v,d,M,p){const C=Ze([v,d]),$=Ze([M,p]);return Xe(C,$)}function Kt(v,d,M){const p=Number(v==null?void 0:v[0]),C=Number(v==null?void 0:v[1]),$=Number(d==null?void 0:d[0]),V=Number(d==null?void 0:d[1]),Y=Number(M==null?void 0:M[0]),rt=Number(M==null?void 0:M[1]),lt=(p-$)*(rt-V)-(C-V)*(Y-$);return Math.abs(lt)>1e-10?!1:p>=Math.min($,Y)-1e-10&&p<=Math.max($,Y)+1e-10&&C>=Math.min(V,rt)-1e-10&&C<=Math.max(V,rt)+1e-10}function Je(v){const d=[];return ye(v==null?void 0:v.coordinates,d),d.length?d.reduce((M,p)=>({minLng:Math.min(M.minLng,Number(p[0])),minLat:Math.min(M.minLat,Number(p[1])),maxLng:Math.max(M.maxLng,Number(p[0])),maxLat:Math.max(M.maxLat,Number(p[1]))}),{minLng:Number.POSITIVE_INFINITY,minLat:Number.POSITIVE_INFINITY,maxLng:Number.NEGATIVE_INFINITY,maxLat:Number.NEGATIVE_INFINITY}):null}function Xe(v,d){return!v||!d?!1:!(v.maxLng<d.minLng||v.minLng>d.maxLng||v.maxLat<d.minLat||v.minLat>d.maxLat)}function me(v){return Zt(v==null?void 0:v.geometry)}function Zt(v){return(v==null?void 0:v.type)==="Polygon"?Ke(v.coordinates):(v==null?void 0:v.type)==="MultiPolygon"?v.coordinates.reduce((d,M)=>d+Ke(M),0):0}function Ke(v=[]){const d=v[0]||[];if(d.length<3)return 0;const M=d.reduce((V,Y)=>V+Number(Y[1]||0),0)/d.length,p=111320*Math.cos(M*Math.PI/180),C=110540;let $=0;for(let V=0;V<d.length;V+=1){const Y=d[V],rt=d[(V+1)%d.length],lt=Number(Y[0]||0)*p,at=Number(Y[1]||0)*C,it=Number(rt[0]||0)*p,bt=Number(rt[1]||0)*C;$+=lt*bt-it*at}return Math.abs($)/2/666.6666667/1e4}function ye(v,d){if(Array.isArray(v)){if(typeof v[0]=="number"&&typeof v[1]=="number"){d.push(v);return}v.forEach(M=>ye(M,d))}}function Ze(v){return v.reduce((d,M)=>({minLng:Math.min(d.minLng,Number(M==null?void 0:M[0])),minLat:Math.min(d.minLat,Number(M==null?void 0:M[1])),maxLng:Math.max(d.maxLng,Number(M==null?void 0:M[0])),maxLat:Math.max(d.maxLat,Number(M==null?void 0:M[1]))}),{minLng:Number.POSITIVE_INFINITY,minLat:Number.POSITIVE_INFINITY,maxLng:Number.NEGATIVE_INFINITY,maxLat:Number.NEGATIVE_INFINITY})}function As(v){const d=Number(v||0);return Number.isFinite(d)?Number(d.toFixed(d>=10?2:4)).toString():"0"}function Vt(v){const d=Number(v||0)*1e4;return Number.isFinite(d)?d>=1e3?Number(d.toFixed(0)).toLocaleString("zh-CN"):d>=10?Number(d.toFixed(1)).toLocaleString("zh-CN"):Number(d.toFixed(2)).toString():"0"}function Ye(v=[]){const d=new Map;return v.forEach(M=>{const p=M.category||"未知类型",C=d.get(p)||{name:p,count:0,area:0};C.count+=1,C.area+=Number(M.overlapAreaWanMu||0),d.set(p,C)}),[...d.values()].sort((M,p)=>p.area-M.area||p.count-M.count)[0]||{name:"未知类型",count:0,area:0}}function we(v=[]){const d=v.map(C=>Number(C.year)).filter(C=>Number.isFinite(C));if(!d.length)return"未知年份";const M=Math.min(...d),p=Math.max(...d);return M===p?`${M}`:`${M}-${p}`}function ts(v,d=18){const M=String(v||"未命名项目");return M.length>d?`${M.slice(0,d)}...`:M}return e({applyDrawnBoundary:xt}),(v,d)=>(J(),tt("div",Dl,[R("div",{class:Ft(["analysis-card analysis-workbench",{"is-running":I.value,"is-complete":T.value}])},[R("div",Ul,[d[0]||(d[0]=R("span",null,"生态工程分析",-1)),b.value?(J(),tt("strong",Bl,ut(b.value),1)):It("",!0)]),r.value?It("",!0):(J(),tt("div",{key:0,class:Ft(["analysis-operation",{"has-boundary":o.value}])},[R("label",{class:Ft(["analysis-entry is-upload",{"is-disabled":r.value||I.value}])},[R("input",{type:"file",accept:".zip,.json,.geojson",disabled:r.value||I.value,onChange:K},null,40,zl),R("span",null,ut(o.value?"更换边界":"上传边界"),1),d[1]||(d[1]=R("strong",null,"SHP / GeoJSON",-1))],2),R("button",{type:"button",class:"analysis-entry is-draw",disabled:r.value||I.value,onPointerup:Yt(ht,["stop","prevent"])},[R("span",null,ut(o.value?"重新绘制":"在线绘制"),1),d[2]||(d[2]=R("strong",null,"地图圈定",-1))],40,Wl)],2)),r.value?(J(),tt("div",Vl,[R("div",Hl,[d[3]||(d[3]=R("span",null,"已落点",-1)),R("strong",null,ut(t.drawingPointCount),1),d[4]||(d[4]=R("em",null,"点",-1)),d[5]||(d[5]=R("small",null,"至少 3 点",-1))]),R("button",{type:"button",class:"analysis-control is-primary",disabled:!O.value||I.value,onPointerup:Yt(_t,["stop","prevent"])}," 完成绘制 ",40,Ql),R("button",{type:"button",class:"analysis-control",disabled:!t.drawingPointCount,onPointerup:Yt(ce,["stop","prevent"])},"撤销",40,Jl),R("button",{type:"button",class:"analysis-control is-danger",onPointerup:Yt(D,["stop","prevent"])},"删除图形",32)])):o.value?(J(),tt("div",Xl,[d[6]||(d[6]=R("span",null,"边界已加载",-1)),R("strong",null,ut(j.value),1),R("button",{type:"button",onPointerup:Yt(ps,["stop","prevent"])},"删除图形",32)])):It("",!0)],2),o.value?(J(),tt("div",{key:0,class:Ft(["analysis-card analysis-result",{"is-running":I.value,"is-empty":T.value&&!n.value.length}])},[R("div",Kl,[d[7]||(d[7]=R("span",null,"建设记录核查",-1)),R("strong",null,ut(A.value),1)]),I.value?(J(),tt("div",Zl,[...d[8]||(d[8]=[R("div",{class:"analysis-running-orbit","aria-hidden":"true"},null,-1),R("div",null,[R("strong",null,"空间叠加分析中"),R("span",null,"正在核对边界与建设项目库")],-1)])])):(J(),tt("div",{key:1,class:Ft(["analysis-conclusion",F.value.levelClass])},[R("div",Yl,[d[9]||(d[9]=R("span",null,"分析结论",-1)),R("strong",null,ut(F.value.verdict),1)]),R("p",null,ut(F.value.summary),1),R("div",t1,[(J(!0),tt(fs,null,gs(F.value.tags,M=>(J(),tt("span",{key:M},ut(M),1))),128))]),R("small",null,ut(F.value.advice),1)],2)),T.value&&!n.value.length?(J(),tt("div",e1,"该边界范围内暂未匹配到已建设项目")):T.value?(J(),tt("div",s1,[(J(!0),tt(fs,null,gs(n.value,M=>(J(),tt("button",{key:M.key,type:"button",class:Ft(["analysis-project-row",{"is-active":M.key===y.value}]),onPointerup:Yt(p=>fe(M),["stop","prevent"])},[R("span",i1,ut(M.projectName),1),R("div",r1,[R("strong",null,ut(M.year),1),R("em",null,ut(M.category),1),R("small",null,"叠加 "+ut(Vt(M.overlapAreaWanMu))+" 亩",1)]),R("b",null,ut(M.featureCount)+" 个要素",1)],42,a1))),128))])):It("",!0)],2)):It("",!0)]))}},o1=Ki(n1,[["__scopeId","data-v-96bdd213"]]);const h1={class:"forest-grass-wet ecological-protection"},l1={class:"forest-grass-wet-ui ecological-protection-ui"},u1={key:0,class:"fgw-left"},c1={class:"fgw-side-stack is-left"},f1={key:1,class:"fgw-right"},g1={class:"fgw-side-stack is-right"},v1={class:"fgw-bottom-topic ecological-bottom-topic"},d1={key:0,class:"loading"},_1={class:"loading-progress"},M1={class:"value"},T1={__name:"index",props:{activeView:{type:String,default:"ecological-redline"},showLoading:{type:Boolean,default:!0},active:{type:Boolean,default:!0}},emits:["module-stats","view-change"],setup(t,{expose:e,emit:s}){const a=t,i=s,r=Q(null),o=Q(null),n=Q(""),h=Q(""),l=Q(is({},"ecological-redline")),g=Q(null),f=Q(!1),u=Q(!1),y=Q(null),w=Q(0),E=Q(a.showLoading),S=Q(null),b=Q(0),A=Q({type:"idle",text:"等待生态保护图层加载"});let I=null,T=!1,j=!1,O=!1,F=null,K=0,W=0;const dt=new Map,ht=new Set(["code","msg","message","success","data","result","project","progress","dycolumn","geom","wkt","geometry","the_geom","raw_properties","gid","id","objectid","object_id","fid","key_uid","bsm","ysdm"]),D=z(()=>Se.some(c=>c.key===a.activeView)?a.activeView:"ecological-redline"),_t=z(()=>D.value==="engineering-analysis"),ce=z(()=>["restoration","engineering-analysis"].includes(D.value)),ps=z(()=>Rs.includes(D.value)),xt=z(()=>n.value?ji(D.value,n.value):null),Bt=z(()=>{var c;return(((c=xt.value)==null?void 0:c.legends)||[]).find(_=>_.key===h.value)||null}),fe=z(()=>{var c;return((c=xt.value)==null?void 0:c.legends)||[]}),ge=z(()=>va(D.value)),ve=z(()=>!_t.value&&ge.value.length<=2&&fe.value.length<=6),zt=z(()=>{if(!ve.value)return 430;const c=Math.max(1,ge.value.length),m=30+Math.max(1,fe.value.length)*28;return Math.max(220,Math.min(360,96+c*32+m))}),Rt=z(()=>{const c=xt.value;return c?Bt.value?kt(Ot({},c),{cqlFilter:Bt.value.cqlFilter||c.cqlFilter,activeLegend:Bt.value,name:Bt.value.name||c.name}):c:null}),Be=z(()=>ps.value?l.value:D.value==="restoration"?tr:D.value==="engineering-analysis"?er:sr),xs=z(()=>Be.value.left||[]),bs=z(()=>Be.value.right||[]),ze=Q(typeof window=="undefined"?1080:window.innerHeight),de=zi.sideCardWidth,We=z(()=>Wi(ze.value)),Gs=z(()=>Vi(We.value,2)),Wt=z(()=>!!y.value),Ve=Di,He=z(()=>$i({point:y.value?As(y.value):null,rowCount:g.value?v(g.value):0,loading:u.value,empty:f.value||!g.value})),Tt=z(()=>He.value.height),Ns=z(()=>He.value.style),Qe=z(()=>{var _;return{"ecological-redline":"生态保护红线详情","natural-protected-area":"自然保护地详情","national-park":"国家公园详情",restoration:"生态修复详情","engineering-analysis":"生态工程详情"}[D.value]||`${((_=xt.value)==null?void 0:_.name)||"生态图斑"}详情`});Ba(()=>{Vt(),window.addEventListener("resize",Vt),document.addEventListener("pointerdown",la,!0),Xe(),_e(D.value)}),Zi(()=>{T=!0,F&&window.clearTimeout(F),window.removeEventListener("resize",Vt),document.removeEventListener("pointerdown",la,!0)}),ss(D,c=>{_e(c)}),ss(n,()=>{h.value="",ft()}),ss(h,()=>{ft()}),ss(()=>a.active,c=>{var _,m,N,L;r.value&&(c?(me(),(m=(_=r.value).resume)==null||m.call(_)):(L=(N=r.value).pause)==null||L.call(N))});function _e(c){var N,L,k,q,H;const _=Se.find(gt=>gt.key===c)||Se[0],m=va(c);h.value="",n.value=_.defaultLayerKey||((N=m[0])==null?void 0:N.key)||"",S.value=ar(c),b.value=0,(k=(L=r.value)==null?void 0:L.setBoundaryDrawing)==null||k.call(L,!1),c!=="engineering-analysis"&&((H=(q=r.value)==null?void 0:q.clearAnalysisBoundary)==null||H.call(q)),ft(),Rs.includes(c)&&(l.value=is({},c),Je(c)),i("module-stats",{moduleKey:"ecological-protection",viewKey:c,items:Rs.includes(c)?Ts({},c):ir(c)}),Me()}function Me(c=0){const _=Rt.value||xt.value;!(_!=null&&_.mapView)&&!(_!=null&&_.cameraPosition)||Pe(()=>{var N,L;!((L=(N=r.value)==null?void 0:N.focusLayerMapView)==null?void 0:L.call(N,_))&&c<12&&window.setTimeout(()=>Me(c+1),120)})}function Kt(c){const _=Se.some(m=>m.key===c)?c:"ecological-redline";_!==D.value&&i("view-change",_)}function Je(c){return nt(this,null,function*(){const _=++K;try{const N=dt.get(c)||(yield nr(c));if(_!==K||D.value!==c)return;dt.set(c,N),l.value=is(N,c),i("module-stats",{moduleKey:"ecological-protection",viewKey:c,items:Ts(N,c)})}catch(m){if(_!==K||D.value!==c)return;l.value=is({},c),i("module-stats",{moduleKey:"ecological-protection",viewKey:c,items:Ts({},c)}),A.value={type:"error",text:"保护范围统计加载失败"},console.warn("Failed to load ecological scope statistics",m)}})}function Xe(){var m;I=new Bi;const c={progress:0};I.instance.on("onProgress",(N,L,k)=>{const q=Math.floor(L/k*100);fa.to(c,{progress:q,onUpdate:()=>{w.value=Math.floor(c.progress)}})});const _=()=>{T||j||(j=!0,me())};I.instance.on("onLoad",_),(m=I.ready)==null||m.then(_).catch(()=>{T||(A.value={type:"error",text:"地图资源加载失败"})})}function me(){T||!a.active||!j||O||(O=!0,F&&window.clearTimeout(F),F=window.setTimeout(()=>{F=null,Zt()},600))}function Zt(c=0){return nt(this,null,function*(){var m,N,L,k,q;if(T)return;if(!a.active){O=!1;return}if(yield Pe(),!a.active){O=!1;return}if(!!((N=(m=r.value)==null?void 0:m.loadMap)!=null&&N.call(m,I)||(k=(L=r.value)==null?void 0:L.hasMap)!=null&&k.call(L))){yield Ci(),yield Pe(),(q=r.value)==null||q.play(),Me();return}if(c<24){window.setTimeout(()=>Zt(c+1),120);return}O=!1})}function Ke(){F&&(window.clearTimeout(F),F=null)}function ye(){var c,_,m,N;(_=(c=r.value)==null?void 0:c.resume)==null||_.call(c),(N=(m=r.value)==null?void 0:m.refreshView)==null||N.call(m)}function Ze(){var c,_,m,N,L,k;if(ft(),(_=(c=r.value)==null?void 0:c.setBoundaryDrawing)==null||_.call(c,!1),(N=(m=r.value)==null?void 0:m.clearAnalysisBoundary)==null||N.call(m),(k=(L=r.value)==null?void 0:L.hasMap)!=null&&k.call(L)){ye();return}Ke(),O=!1,Pe(()=>{me()})}e({refreshMapView:ye,resetMap:Ze});function As(c){const _=document.querySelector(".ecological-protection"),m=_==null?void 0:_.getBoundingClientRect();return!(m!=null&&m.width)||!(m!=null&&m.height)?c:{x:(c.x-m.left)/m.width*1920,y:(c.y-m.top)/m.height*1080}}function Vt(){ze.value=typeof window=="undefined"?1080:window.innerHeight}function Ye(c,_){return`${D.value}-${_}-${(c==null?void 0:c.key)||(c==null?void 0:c.title)||"panel"}`}function we(c){return(c==null?void 0:c.span)===2}function ts(c){return we(c)?Gs.value:We.value}function v(c){const _=(c==null?void 0:c.properties)||{};return Object.keys(_).filter(m=>d(m,_[m])).length}function d(c,_){return _==null||_===""||Array.isArray(_)||typeof _=="object"?!1:!ht.has(String(c||"").toLowerCase())}function M(c={}){const _=p(c.lng),m=p(c.lat);return _===""||m===""?"":`POINT(${_} ${m})`}function p(c){const _=Number(c);return Number.isFinite(_)?_.toFixed(8).replace(/\.?0+$/,""):""}function C(){return nt(this,arguments,function*(c={}){var k,q,H,gt,Et,Gt;if(!ce.value)return;if($(c.overlayLayer||Rt.value||xt.value)){ft();return}const _=Number((k=c==null?void 0:c.lngLat)==null?void 0:k.lng),m=Number((q=c==null?void 0:c.lngLat)==null?void 0:q.lat);if(!Number.isFinite(_)||!Number.isFinite(m)){ft();return}const N=++W,L=c.screen||{x:960,y:540};y.value=null,g.value=null,f.value=!1,u.value=!0;try{const At=yield Ui(M({lng:_,lat:m}));if(N!==W||T)return;const Ee=V(At,c);if(!Ee||v(Ee)<=0){ft();return}g.value=Ee,y.value=((gt=(H=r.value)==null?void 0:H.getVectorFeatureAnchorScreen)==null?void 0:gt.call(H,Ee))||L,f.value=!1,(Gt=(Et=r.value)==null?void 0:Et.highlightFeature)==null||Gt.call(Et,Ee,{highlightTone:"v21"})}catch(At){if(N!==W)return;ft()}finally{N===W&&(u.value=!1)}})}function $(c=Rt.value){const _=String((c==null?void 0:c.sourceType)||"").toLowerCase();return["geojson","wkt-api","wfs"].includes(_)||String((c==null?void 0:c.dataPath)||"").includes("ecological_restoration_projects")}function V(c,_={}){var k,q,H;const m=rt((c==null?void 0:c.project)||((k=c==null?void 0:c.data)==null?void 0:k.project)||(c==null?void 0:c.data)||c);if(!lt(m))return null;const N=it(m,c),L=m.geom||m.geometry||m.wkt||null;return{id:m.id||N.id||N.project_name||`project-${(q=_==null?void 0:_.lngLat)==null?void 0:q.lng}-${(H=_==null?void 0:_.lngLat)==null?void 0:H.lat}`,properties:N,feature:{type:"Feature",properties:N,geometry:L},geometry:L,layer:_.overlayLayer||Rt.value||xt.value,lngLat:_.lngLat}}function Y(c,_={}){var gt,Et,Gt;const m=c!=null&&c.feature&&c.feature.type==="Feature"?kt(Ot({},c.feature),{id:c.id||c.feature.id,layer:c.layer,lngLat:c.lngLat}):c,N=(m==null?void 0:m.type)==="Feature"?m:((gt=m==null?void 0:m.feature)==null?void 0:gt.type)==="Feature"?m.feature:null,L=(m==null?void 0:m.properties)||(N==null?void 0:N.properties)||{},k=(m==null?void 0:m.geometry)||(N==null?void 0:N.geometry)||L.geometry||L.geom||L.wkt||null,q=it(L,_),H=(m==null?void 0:m.id)||(N==null?void 0:N.id)||q.id||q.gid||q.project_id||q.project_name||`project-${((Et=_==null?void 0:_.lngLat)==null?void 0:Et.lng)||""}-${((Gt=_==null?void 0:_.lngLat)==null?void 0:Gt.lat)||""}`;return{id:H,properties:q,feature:{type:"Feature",id:H,properties:q,geometry:k},geometry:k,layer:(m==null?void 0:m.layer)||_.overlayLayer||Rt.value||xt.value,lngLat:(m==null?void 0:m.lngLat)||_.lngLat}}function rt(c){return Array.isArray(c)?c.find(_=>_&&typeof _=="object")||null:c&&typeof c=="object"?c:null}function lt(c){return!c||typeof c!="object"?!1:Array.isArray(c.dyColumn)&&c.dyColumn.some(at)?!0:Object.keys(c).some(_=>d(_,c[_]))}function at(c={}){const _=c==null?void 0:c.value;return _==null||_===""?!1:!!String((c==null?void 0:c.field)||(c==null?void 0:c.title)||"").trim()}function it(c={},_={}){const m=Ot({},c);(Array.isArray(c.dyColumn)?c.dyColumn:[]).forEach(H=>{const gt=H==null?void 0:H.value;if(gt==null||gt==="")return;const Et=String((H==null?void 0:H.field)||"").trim();[Et,bt(Et)].filter(Boolean).forEach(At=>{(m[At]===void 0||m[At]===null||m[At]==="")&&(m[At]=gt)})});const L=m.project_name||m.projectName||m.name,k=m.area_mu||m.areaMu||m.acreage,q=m.project_status||m.projectStatus;return kt(Ot({},m),{project_name:L,name:L||m.name,area_mu:k,project_status:q,progress_count:Array.isArray(_==null?void 0:_.progress)?_.progress.length:void 0})}function bt(c){return String(c||"").replace(/[A-Z]/g,_=>`_${_.toLowerCase()}`)}function Is(c){var m,N,L,k;const _=(N=(m=c==null?void 0:c.feature)!=null?m:c)!=null?N:null;if(!_||v(_)<=0){ft();return}if(ce.value){W+=1;const q=Y(_,c);if(!q||v(q)<=0){ft();return}g.value=q,f.value=!1,u.value=!1,y.value=((k=(L=r.value)==null?void 0:L.getVectorFeatureAnchorScreen)==null?void 0:k.call(L,q))||(c==null?void 0:c.screen)||null;return}g.value=_,f.value=!1,c!=null&&c.screen&&(y.value=c.screen)}function es(c){A.value=c}function Cs(c,_){var L,k;if(D.value==="national-park"&&(_!=null&&_.name)){ft(),(k=(L=r.value)==null?void 0:L.focusTown)==null||k.call(L,_.name,{distanceScale:.66,targetLocalZ:.84,cameraOffset:{x:0,y:1.05,z:0},select:!0});return}if(D.value!=="restoration"||(c==null?void 0:c.key)!=="restoration-projects"||!((_==null?void 0:_.projectName)||(_==null?void 0:_.name)))return;ft();const N=()=>ha(_);if(h.value){h.value="",Pe(()=>window.setTimeout(N,80));return}N()}function ha(c,_=0){var k,q,H,gt,Et,Gt,At;if(D.value!=="restoration")return;const m=(c==null?void 0:c.projectName)||(c==null?void 0:c.name);if(!m)return;const N=(q=(k=r.value)==null?void 0:k.focusProject)==null?void 0:q.call(k,{id:c==null?void 0:c.id,key:c==null?void 0:c.key,name:m,projectName:m,project_name:m,highlightTone:"white"});if(!(N!=null&&N.feature)){if(_<10){window.setTimeout(()=>ha(c,_+1),120);return}A.value={type:"warning",text:"当前项目图斑尚未加载"};return}const L=Y({id:N.feature.id,properties:N.feature.properties||{},geometry:N.feature.geometry,feature:N.feature,layer:Rt.value||xt.value},{});g.value=L,f.value=!1,u.value=!1,y.value=N.screen||((Et=(H=r.value)==null?void 0:H.getVectorFeaturesAnchorScreen)==null?void 0:Et.call(H,(gt=N.highlightFeatures)!=null&&gt.length?N.highlightFeatures:N.features))||((At=(Gt=r.value)==null?void 0:Gt.getVectorFeatureAnchorScreen)==null?void 0:At.call(Gt,L))}function pi(c){var _,m;ft(),b.value=0,(m=(_=r.value)==null?void 0:_.setBoundaryDrawing)==null||m.call(_,c)}function xi(){var c,_;(_=(c=r.value)==null?void 0:c.finishBoundaryDrawing)==null||_.call(c)}function bi(){var c,_;(_=(c=r.value)==null?void 0:c.undoBoundaryPoint)==null||_.call(c)}function Gi(){var c,_;b.value=0,(_=(c=r.value)==null?void 0:c.clearAnalysisBoundary)==null||_.call(c)}function Ni(c={}){var _,m,N;b.value=c.pointCount||((_=c.points)==null?void 0:_.length)||0,c.status==="complete"&&c.feature&&(b.value=0,(N=(m=o.value)==null?void 0:m.applyDrawnBoundary)==null||N.call(m,c.feature)),c.status==="clear"&&(b.value=0)}function Ai(c={}){var _,m;(m=(_=r.value)==null?void 0:_.showAnalysisResult)==null||m.call(_,{boundary:c.boundary,matches:c.matches,preserveView:D.value==="engineering-analysis"}),D.value}function Ii(c){var m,N;const _=((c==null?void 0:c.features)||[]).filter(Boolean);(N=(m=r.value)==null?void 0:m.showAnalysisResult)==null||N.call(m,{boundary:c==null?void 0:c.boundary,matches:_})}function ft(){var c,_;W+=1,g.value=null,f.value=!1,u.value=!1,y.value=null,(_=(c=r.value)==null?void 0:c.clearSelectedFeature)==null||_.call(c)}function la(c){if(!Wt.value)return;const _=document.querySelector(".fgw-map-feature-info"),m=c.target;_&&m instanceof Node&&_.contains(m)||ft()}function Ci(){return E.value?new Promise(c=>{fa.to(".ecological-protection .loading",{opacity:0,duration:.8,delay:.2,onComplete:()=>{E.value=!1,c()}})}):Promise.resolve()}return(c,_)=>(J(),tt("div",h1,[te(Hi,{ref_key:"mapSceneRef",ref:r,"active-layer":Rt.value,"map-ranking":S.value,"admin-boundary-line-scale":2.4,"auto-apply-layer-map-view":!1,"max-zoom":21,onFeatureLoading:_[0]||(_[0]=m=>u.value=m),onFeatureInfo:Is,onMapClick:C,onLayerStatus:es,onDrawBoundary:Ni},null,8,["active-layer","map-ranking"]),R("div",l1,[_t.value?It("",!0):(J(),tt("div",u1,[R("div",c1,[(J(!0),tt(fs,null,gs(xs.value,m=>(J(),Ls(ga,{key:Ye(m,"left"),class:Ft(["fgw-side-card left-card",{"is-double":we(m)}]),title:m.title,width:as(de),height:ts(m)},{default:_a(()=>[te(da,{panel:m,compact:"","column-label-standard":"","visual-version":"v21",onRowSelect:N=>Cs(m,N)},null,8,["panel","onRowSelect"])]),_:2},1032,["class","title","width","height"]))),128))])])),_t.value?It("",!0):(J(),tt("div",f1,[R("div",g1,[(J(!0),tt(fs,null,gs(bs.value,m=>(J(),Ls(ga,{key:Ye(m,"right"),class:Ft(["fgw-side-card right-card",{"is-double":we(m)}]),title:m.title,width:as(de),height:ts(m)},{default:_a(()=>[te(da,{panel:m,compact:"","column-label-standard":"","visual-version":"v21",onRowSelect:N=>Cs(m,N)},null,8,["panel","onRowSelect"])]),_:2},1032,["class","title","width","height"]))),128))])])),_t.value?(J(),Ls(o1,{key:2,ref_key:"engineeringAnalysisRef",ref:o,"drawing-point-count":b.value,onDrawingChange:pi,onFinishDrawing:xi,onUndoPoint:bi,onClearBoundary:Gi,onAnalysisResult:Ai,onFocusProject:Ii},null,8,["drawing-point-count"])):It("",!0),R("div",{class:Ft(["fgw-map-layer-tools",{"is-analysis":_t.value,"is-compact":ve.value}]),style:Ma({height:`${zt.value}px`})},[te(Qi,{modelValue:n.value,"onUpdate:modelValue":_[1]||(_[1]=m=>n.value=m),"selected-legend-key":h.value,"onUpdate:selectedLegendKey":_[2]||(_[2]=m=>h.value=m),"topic-key":D.value,legends:fe.value,width:248,height:zt.value,compact:ve.value},null,8,["modelValue","selected-legend-key","topic-key","legends","height","compact"])],6),Wt.value?(J(),tt("div",{key:3,class:"fgw-map-feature-info",style:Ma(Ns.value)},[te(Ji,{title:Qe.value,feature:g.value,empty:f.value,loading:u.value,width:as(Ve),height:Tt.value,closable:"",onClose:ft},null,8,["title","feature","empty","loading","width","height"])],4)):It("",!0),R("div",v1,[te(Xi,{"model-value":D.value,topics:as(Se),"onUpdate:modelValue":Kt},null,8,["model-value","topics"])])]),E.value?(J(),tt("div",d1,[_[4]||(_[4]=Yi('<div class="loading-text"><span style="--index:1;">L</span><span style="--index:2;">O</span><span style="--index:3;">A</span><span style="--index:4;">D</span><span style="--index:5;">I</span><span style="--index:6;">N</span><span style="--index:7;">G</span></div>',1)),R("div",_1,[R("span",M1,ut(w.value),1),_[3]||(_[3]=R("span",{class:"unit"},"%",-1))])])):It("",!0)]))}};export{T1 as default};