{"version":3,"file":"defaults-tzwdQNHT.js","sources":["../../../app/assets/javascripts/app/map/defaults.ts"],"sourcesContent":["import DataRetriever from \"app/data_retriever\"\n\n// The following are just something to fallback to in case of worst scenario.\n// Hardcoded Hong Kong.\nconst DEFAULT_COORDINATES = [22.294020222179054, 114.16477203369142] as [number, number]\nconst DEFAULT_ZOOM_LEVEL = 11\nconst DEFAULT_COUNTRY_CODE = \"HK\"\n\n\nconst getDefaultCoordinate = (): [number, number] => {\n const latitude = parseFloat(DataRetriever.get(\"city-default-latitude\"))\n const longitude = parseFloat(DataRetriever.get(\"city-default-longitude\"))\n\n if ([latitude, longitude].some(isNaN)){\n return DEFAULT_COORDINATES\n }\n\n return [latitude, longitude]\n}\n\nconst getDefaultZoom = () => {\n const result = parseInt(DataRetriever.get(\"city-default-zoom-level\"), 10)\n\n if (isNaN(result)) { return DEFAULT_ZOOM_LEVEL }\n\n return result\n}\n\nconst getDefaultCountryCode = () => {\n const result = DataRetriever.get(\"city-default-country-code\")\n if (typeof result !== \"string\") { return DEFAULT_COUNTRY_CODE }\n return result\n}\n\nexport default {\n getDefaultCoordinate,\n getDefaultZoom,\n getDefaultCountryCode,\n}\n"],"names":["DEFAULT_COORDINATES","DEFAULT_ZOOM_LEVEL","DEFAULT_COUNTRY_CODE","getDefaultCoordinate","latitude","DataRetriever","longitude","getDefaultZoom","result","getDefaultCountryCode","AppMapDefaults"],"mappings":"iDAIA,MAAMA,EAAwB,CAAC,mBAAoB,kBAAkB,EAC/DC,EAAwB,GACxBC,EAAwB,KAGxBC,EAAuB,IAAwB,CACnD,MAAMC,EAAW,WAAWC,EAAc,IAAI,uBAAuB,CAAC,EAChEC,EAAY,WAAWD,EAAc,IAAI,wBAAwB,CAAC,EAExE,MAAI,CAACD,EAAUE,CAAS,EAAE,KAAK,KAAK,EAC3BN,EAGF,CAACI,EAAUE,CAAS,CAC7B,EAEMC,EAAkB,IAAM,CAC5B,MAAMC,EAAS,SAASH,EAAc,IAAI,yBAAyB,EAAG,EAAE,EAEpE,OAAA,MAAMG,CAAM,EAAYP,EAErBO,CACT,EAEMC,EAAwB,IAAM,CAC5B,MAAAD,EAASH,EAAc,IAAI,2BAA2B,EACxD,OAAA,OAAOG,GAAW,SAAmBN,EAClCM,CACT,EAEeE,EAAA,CACb,qBAAAP,EACA,eAAAI,EACA,sBAAAE,CACF"}