{"version":3,"sources":["components/utils/Utils.js","components/DemoMapTooltip.js","components/DemoMap.js","App.js","serviceWorker.js","index.js"],"names":["defaultMapState","lat","lng","zoom","minZoom","mountains","id","name","elevation","point","DemoMapTooltip","mountain","this","props","className","Component","DemoMap","state","Map","center","style","width","position","top","bottom","zIndex","updateWhenZooming","updateWhenIdle","preferCanvas","TileLayer","attribution","url","map","idx","CircleMarker","key","color","radius","weight","onClick","setState","activeMountain","Popup","onClose","App","Boolean","window","location","hostname","match","ReactDOM","render","StrictMode","document","getElementById","navigator","serviceWorker","ready","then","registration","unregister","catch","error","console","message"],"mappings":"mSAMaA,EAAkB,CAC7BC,IAAK,UACLC,KAAM,WACNC,KAAM,EACNC,QAAS,GAGEC,EAAY,CAAC,CACxBC,GAAI,EACJC,KAAM,aACNC,UAAW,SACXC,MAAO,CAAC,WAAY,aACnB,CACDH,GAAI,EACJC,KAAM,kBACNC,UAAW,SACXC,MAAO,CAAC,SAAU,aACjB,CACDH,GAAI,EACJC,KAAM,eACNC,UAAW,SACXC,MAAO,CAAC,WAAY,aACnB,CACDH,GAAI,EACJC,KAAM,eACNC,UAAW,SACXC,MAAO,CAAC,WAAY,aACnB,CACDH,GAAI,EACJC,KAAM,gBACNC,UAAW,SACXC,MAAO,CAAC,WAAY,aACnB,CACDH,GAAI,EACJC,KAAM,mBACNC,UAAW,QACXC,MAAO,CAAC,WAAY,aACnB,CACDH,GAAI,EACJC,KAAM,iBACNC,UAAW,QACXC,MAAO,CAAC,WAAY,aACnB,CACDH,GAAI,EACJC,KAAM,aACNC,UAAW,QACXC,MAAO,CAAC,WAAY,aACnB,CACDH,GAAI,EACJC,KAAM,iBACNC,UAAW,QACXC,MAAO,CAAC,WAAY,aACnB,CACDH,GAAI,GACJC,KAAM,cACNC,UAAW,QACXC,MAAO,CAAC,WAAY,aC5DDC,E,uKAEjB,IAAIC,EAAWC,KAAKC,MAAMF,SAC1B,OAAOA,EACL,yBAAKG,UAAU,cACb,sEAA2C,6BAC3C,+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cAAcC,MACrBC,MAAK,SAAAC,GACJA,EAAaC,gBAEdC,OAAM,SAAAC,GACLC,QAAQD,MAAMA,EAAME,c","file":"static/js/main.a9857466.chunk.js","sourcesContent":["export const attribution = \n '© OpenStreetMap contributors'\n\nexport const tileUrl = \n 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';\n\nexport const defaultMapState = {\n lat: 44.148358, \n lng: -121.784154,\n zoom: 8,\n minZoom: 2,\n}\n\nexport const mountains = [{\n id: 1,\n name: \"Mount Hood\", \t\t\n elevation: \"11,239\",\n point: [45.373496, -121.695966],\n}, {\n id: 2,\n name: \"Mount Jefferson\", \t\t\n elevation: \"10,497\",\n point: [44.6743, -121.799565],\n}, {\n id: 3,\n name: \"South Sister\",\n elevation: \"10,358\",\n point: [44.103548, -121.769378],\n}, {\n id: 4,\n name: \"North Sister\",\t\t\n elevation: \"10,085\",\n point: [44.166553, -121.772335],\n}, {\n id: 5,\n name: \"Middle Sister\",\t\t\n elevation: \"10,047\",\n point: [44.148358, -121.784154],\n}, {\n id: 6,\n name: \"Mount McLoughlin\", \t\n elevation: \"9,495\",\n point: [42.444515, -122.315881],\n}, {\n id: 7,\n name: \"Mount Thielsen\", \t\t\n elevation: \"9,182\",\n point: [43.152769, -122.066502],\n}, {\n id: 8,\n name: \"Broken Top\", \t\t\n elevation: \"9,175\",\n point: [44.082987, -121.699447],\n}, {\n id: 9,\n name: \"Mount Bachelor\", \t\t\n elevation: \"9,065\",\n point: [43.979347, -121.688467],\n}, {\n id: 10,\n name: \"Mount Scott\", \t\t\n elevation: \"8,929\",\n point: [42.922808, -122.01624],\n}];","import React, { Component } from \"react\";\n\nexport default class DemoMapTooltip extends Component {\n render() {\n let mountain = this.props.mountain;\n return mountain ? (\n
\n

Ten Highest Peaks of the Oregon Cascades
\n #{mountain.id}: {mountain.name}
\n {mountain.elevation} ft.

\n
\n ) : (\n \"\"\n );\n }\n}","import React, { Component } from \"react\";\nimport { \n Map, \n TileLayer, \n CircleMarker, \n Popup \n} from \"react-leaflet\";\nimport {\n attribution,\n tileUrl,\n defaultMapState,\n} from './utils/Utils';\nimport DemoMapTooltip from \"./DemoMapTooltip\";\nimport \"leaflet/dist/leaflet.css\";\n\nexport default class DemoMap extends Component {\n state = defaultMapState;\n render() {\n return this.props.mountains ? (\n \n \n {this.props.mountains.map((mountain, idx) => \n { \n this.setState({ activeMountain: mountain });\n }}\n center={mountain.point}>\n \n )}\n {this.state.activeMountain && {\n this.setState({ activeMountain: null })\n }}\n >\n \n }\n \n ) : (\n \"Data is loading...\"\n );\n }\n}","import React, { Component } from \"react\";\nimport DemoMap from \"./components/DemoMap\";\nimport { mountains } from \"./components/utils/Utils\"\nimport \"leaflet/dist/leaflet.css\";\n\nclass App extends Component {\n state = {\n mountains: mountains,\n };\n\n render() {\n return (\n
\n \n
\n );\n }\n}\nexport default App;","// This optional code is used to register a service worker.\n// register() is not called by default.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on subsequent visits to a page, after all the\n// existing tabs open on the page have been closed, since previously cached\n// resources are updated in the background.\n\n// To learn more about the benefits of this model and instructions on how to\n// opt-in, read https://bit.ly/CRA-PWA\n\nconst isLocalhost = Boolean(\n window.location.hostname === 'localhost' ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === '[::1]' ||\n // 127.0.0.0/8 are considered localhost for IPv4.\n window.location.hostname.match(\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\n )\n);\n\nexport function register(config) {\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\n return;\n }\n\n window.addEventListener('load', () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n\n if (isLocalhost) {\n // This is running on localhost. Let's check if a service worker still exists or not.\n checkValidServiceWorker(swUrl, config);\n\n // Add some additional logging to localhost, pointing developers to the\n // service worker/PWA documentation.\n navigator.serviceWorker.ready.then(() => {\n console.log(\n 'This web app is being served cache-first by a service ' +\n 'worker. To learn more, visit https://bit.ly/CRA-PWA'\n );\n });\n } else {\n // Is not localhost. Just register service worker\n registerValidSW(swUrl, config);\n }\n });\n }\n}\n\nfunction registerValidSW(swUrl, config) {\n navigator.serviceWorker\n .register(swUrl)\n .then(registration => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n if (installingWorker == null) {\n return;\n }\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the updated precached content has been fetched,\n // but the previous service worker will still serve the older\n // content until all client tabs are closed.\n console.log(\n 'New content is available and will be used when all ' +\n 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'\n );\n\n // Execute callback\n if (config && config.onUpdate) {\n config.onUpdate(registration);\n }\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n console.log('Content is cached for offline use.');\n\n // Execute callback\n if (config && config.onSuccess) {\n config.onSuccess(registration);\n }\n }\n }\n };\n };\n })\n .catch(error => {\n console.error('Error during service worker registration:', error);\n });\n}\n\nfunction checkValidServiceWorker(swUrl, config) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl, {\n headers: { 'Service-Worker': 'script' },\n })\n .then(response => {\n // Ensure service worker exists, and that we really are getting a JS file.\n const contentType = response.headers.get('content-type');\n if (\n response.status === 404 ||\n (contentType != null && contentType.indexOf('javascript') === -1)\n ) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister().then(() => {\n window.location.reload();\n });\n });\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl, config);\n }\n })\n .catch(() => {\n console.log(\n 'No internet connection found. App is running in offline mode.'\n );\n });\n}\n\nexport function unregister() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready\n .then(registration => {\n registration.unregister();\n })\n .catch(error => {\n console.error(error.message);\n });\n }\n}\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './css/styles.css';\nimport App from './App';\nimport * as serviceWorker from './serviceWorker';\n\nReactDOM.render(\n \n \n ,\n document.getElementById('root')\n);\n\n// If you want your app to work offline and load faster, you can change\n// unregister() to register() below. Note this comes with some pitfalls.\n// Learn more about service workers: https://bit.ly/CRA-PWA\nserviceWorker.unregister();\n"],"sourceRoot":""}