(()=>{var e={488:e=>{function r(e,r){var n=t(e,r);return n.whole+"° "+(n.minutes?n.minutes+"' ":"")+(n.seconds?n.seconds+'" ':"")+n.dir}function t(e,r){var t=({lat:["N","S"],lon:["E","W"]}[r]||"")[e>=0?0:1],n=Math.abs(e),o=Math.floor(n),i=60*(n-o),a=Math.floor(i);return{whole:o,minutes:a,seconds:Math.floor(60*(i-a)),dir:t}}function n(e,r){if(r||(r="NSEW"),"string"!=typeof e)return null;var t=(e=e.toUpperCase()).match(/^[\s\,]*([NSEW])?\s*([\-|\—|\―]?[0-9.]+)[°º˚]?\s*(?:([0-9.]+)['’′‘]\s*)?(?:([0-9.]+)(?:''|"|”|″)\s*)?([NSEW])?/);if(!t)return null;var n,o=t[0];if(t[1]&&t[5]?(n=t[1],o=o.slice(0,-1)):n=t[1]||t[5],n&&-1===r.indexOf(n))return null;var i=t[2]?parseFloat(t[2]):0,a=t[3]?parseFloat(t[3])/60:0,u=t[4]?parseFloat(t[4])/3600:0,s=i<0?-1:1;return"S"!==n&&"W"!==n||(s*=-1),{val:(Math.abs(i)+a+u)*s,dim:n,matched:o,remain:e.slice(o.length)}}e.exports=function(e,r){var t=n(e,r);return null===t?null:t.val},e.exports.pair=function(e,r){var t=n(e=e.trim(),r);if(!t)return null;var o=n(e=t.remain.trim(),r);if(!o||o.remain)return null;return t.dim?function(e,r,t){if("N"===t||"S"===t)return[e,r];if("W"===t||"E"===t)return[r,e]}(t.val,o.val,t.dim):[t.val,o.val]},e.exports.format=r,e.exports.formatPair=function(e){return r(e.lat,"lat")+" "+r(e.lon,"lon")},e.exports.coordToDMS=t},734:(e,r,t)=>{"use strict";var n=t(325),o=t(488),i=/(Lat)(itude)?/gi,a=/(L)(on|ng)(gitude)?/i;function u(e,r){var t,n,o;for(var i in e)(n=i.match(r))&&(!t||n[0].length/i.length>o)&&(o=n[0].length/i.length,t=i);return t}function s(e){return u(e,i)}function l(e){return u(e,a)}function c(e){return"object"==typeof e?Object.keys(e).length:0}function f(e){var r=[];return[",",";","\t","|"].forEach((function(t){var o=n.dsvFormat(t).parse(e);if(o.length>=1){for(var i=c(o[0]),a=0;a<o.length;a++)if(c(o[a])!==i)return;r.push({delimiter:t,arity:Object.keys(o[0]).length})}})),r.length?r.sort((function(e,r){return r.arity-e.arity}))[0].delimiter:null}e.exports={isLon:function(e){return!!e.match(a)},isLat:function(e){return!!e.match(i)},guessLatHeader:s,guessLonHeader:l,csv:n.csvParse,tsv:n.tsvParse,dsv:n,auto:function(e){var r=f(e);return r?function(e){return delete e.columns,e}(n.dsvFormat(r).parse(e)):null},csv2geojson:function(e,r,t){t||(t=r,r={}),r.delimiter=r.delimiter||",";var i=r.latfield||"",a=r.lonfield||"",u=r.crs||"",c=[],p={type:"FeatureCollection",features:c};if(""!==u&&(p.crs={type:"name",properties:{name:u}}),"auto"!==r.delimiter||"string"!=typeof e||(r.delimiter=f(e),r.delimiter)){var d=r.numericFields?r.numericFields.split(","):null,v="string"==typeof e?n.dsvFormat(r.delimiter).parse(e,(function(e){if(d)for(var r in e)d.includes(r)&&(e[r]=+e[r]);return e})):e;if(v.length){var m,h=[];if(i||(i=s(v[0])),a||(a=l(v[0])),!i||!a){for(m=0;m<v.length;m++)c.push({type:"Feature",properties:v[m],geometry:null});t(h.length?h:null,p)}else{for(m=0;m<v.length;m++)if(void 0!==v[m][a]&&void 0!==v[m][i]){var g,y,F,w=v[m][a],j=v[m][i];(F=o(w,"EW"))&&(w=F),(F=o(j,"NS"))&&(j=F),g=parseFloat(w),y=parseFloat(j),isNaN(g)||isNaN(y)?h.push({message:"A row contained an invalid value for latitude or longitude",row:v[m],index:m}):(r.includeLatLon||(delete v[m][a],delete v[m][i]),c.push({type:"Feature",properties:v[m],geometry:{type:"Point",coordinates:[parseFloat(g),parseFloat(y)]}}))}t(h.length?h:null,p)}}else t(null,p)}else t({type:"Error",message:"Could not autodetect delimiter"})},toLine:function(e){for(var r=e.features,t={type:"Feature",geometry:{type:"LineString",coordinates:[]}},n=0;n<r.length;n++)t.geometry.coordinates.push(r[n].geometry.coordinates);return t.properties=r.reduce((function(e,r){for(var t in r.properties)e[t]||(e[t]=[]),e[t].push(r.properties[t]);return e}),{}),{type:"FeatureCollection",features:[t]}},toPolygon:function(e){for(var r=e.features,t={type:"Feature",geometry:{type:"Polygon",coordinates:[[]]}},n=0;n<r.length;n++)t.geometry.coordinates[0].push(r[n].geometry.coordinates);return t.properties=r.reduce((function(e,r){for(var t in r.properties)e[t]||(e[t]=[]),e[t].push(r.properties[t]);return e}),{}),{type:"FeatureCollection",features:[t]}}}},325:(e,r,t)=>{"use strict";function n(e){return new Function("d","return {"+e.map((function(e,r){return JSON.stringify(e)+": d["+r+"]"})).join(",")+"}")}function o(e){var r=new RegExp('["'+e+"\n]"),t=e.charCodeAt(0);function o(e,r){var n,o,i={},a={},u=[],s=e.length,l=0,c=0;function f(){if(l>=s)return a;if(o)return o=!1,i;var r,n=l;if(34===e.charCodeAt(n)){for(var u=n;u++<s;)if(34===e.charCodeAt(u)){if(34!==e.charCodeAt(u+1))break;++u}return l=u+2,13===(r=e.charCodeAt(u+1))?(o=!0,10===e.charCodeAt(u+2)&&++l):10===r&&(o=!0),e.slice(n+1,u).replace(/""/g,'"')}for(;l<s;){var c=1;if(10===(r=e.charCodeAt(l++)))o=!0;else if(13===r)o=!0,10===e.charCodeAt(l)&&(++l,++c);else if(r!==t)continue;return e.slice(n,l-c)}return e.slice(n)}for(;(n=f())!==a;){for(var p=[];n!==i&&n!==a;)p.push(n),n=f();r&&null==(p=r(p,c++))||u.push(p)}return u}function i(r){return r.map(a).join(e)}function a(e){return null==e?"":r.test(e+="")?'"'+e.replace(/\"/g,'""')+'"':e}return{parse:function(e,r){var t,i,a=o(e,(function(e,o){if(t)return t(e,o-1);i=e,t=r?function(e,r){var t=n(e);return function(n,o){return r(t(n),o,e)}}(e,r):n(e)}));return a.columns=i,a},parseRows:o,format:function(r,t){return null==t&&(t=function(e){var r=Object.create(null),t=[];return e.forEach((function(e){for(var n in e)n in r||t.push(r[n]=n)})),t}(r)),[t.map(a).join(e)].concat(r.map((function(r){return t.map((function(e){return a(r[e])})).join(e)}))).join("\n")},formatRows:function(e){return e.map(i).join("\n")}}}t.r(r),t.d(r,{csvFormat:()=>s,csvFormatRows:()=>l,csvParse:()=>a,csvParseRows:()=>u,dsvFormat:()=>o,tsvFormat:()=>d,tsvFormatRows:()=>v,tsvParse:()=>f,tsvParseRows:()=>p});var i=o(","),a=i.parse,u=i.parseRows,s=i.format,l=i.formatRows,c=o("\t"),f=c.parse,p=c.parseRows,d=c.format,v=c.formatRows}},r={};function t(n){var o=r[n];if(void 0!==o)return o.exports;var i=r[n]={exports:{}};return e[n](i,i.exports,t),i.exports}t.d=(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n=t(734);window.csv2geojson=n})();