{"version":3,"sources":["util-geo.js"],"names":["UtilGeo","constructor","this","endpoint","getLocation","geo","localStorage","getItem","JSON","parse","locale","jsonData","await","fetch","json","setItem","stringify"],"mappings":"qBAAqBA,QACjBC,cAEIC,KAAKC,SAAW,yCAChBD,KAAKE,YAAY,CACrB,CAEAA,oBAEI,IAAIC,EAAMC,aAAaC,QAAQ,KAAK,EACpC,GAAU,MAAPF,GAE8B,KAAA,IADfG,KAAKC,MAAMJ,CAAG,EACVK,OACd,OAAOL,EAKTM,EAAWC,MADAA,MAAMC,MAAMX,KAAKC,QAAQ,GACVW,KAAK,EAErCR,aAAaS,QAAQ,MAAOP,KAAKQ,UAAUL,CAAQ,CAAC,CACxD,CACJ","file":"util-geo.min.js","sourcesContent":["export default class UtilGeo {\r\n constructor()\r\n {\r\n this.endpoint = 'https://where-am-i.teeg.cloud?geo=true'\r\n this.getLocation();\r\n }\r\n\r\n async getLocation() {\r\n // We only want to call this once per user really\r\n var geo = localStorage.getItem('geo');\r\n if(geo != null) {\r\n var geoData = JSON.parse(geo);\r\n if(typeof geoData.locale !== 'undefined') {\r\n return geo; \r\n }\r\n }\r\n \r\n const response = await fetch(this.endpoint);\r\n const jsonData = await response.json();\r\n\r\n localStorage.setItem('geo', JSON.stringify(jsonData));\r\n }\r\n}"]}