{"version":3,"sources":["App.js","serviceWorker.js","index.js"],"names":["COUNTRIES","window","location","DAILY","D4","MODALSTYLE","overlay","position","top","bottom","content","left","right","ReactModal","setAppElement","App","props","_onViewportChange","viewport","setState","state","_resize","width","innerWidth","height","innerHeight","longitude","latitude","zoom","maxZoom","points","showModalAbout","showModalControls","_getData","bind","_processData","handleOpenModalAbout","handleCloseModalAbout","handleOpenModalControls","handleCloseModalControls","loc","up","this","uri","protocol","host","pathname","ws","WebSocket","onopen","console","log","onmessage","ev","json","JSON","parse","data","hasOwnProperty","command","length","push","fetch","then","response","text","split","forEach","event","err","addEventListener","reduce","accu","curr","Number","geoip_lon","geoip_lat","removeEventListener","closeAllModals","style","zIndex","Navbar","collapseOnSelect","expand","bg","variant","fixed","Brand","href","Toggle","aria-controls","Collapse","id","Nav","className","Link","onClick","NavDropdown","title","Item","isOpen","contentLabel","onRequestClose","handleCloseModal","class","controller","type","MapController","scrollZoom","dragPan","dragRotate","doubleClickZoom","touchZoom","touchRotate","keyboard","initialViewState","stroked","filled","lineWidthMinPixels","opacity","getLineColor","getFillColor","getSourcePosition","f","getTargetPosition","getSourceColor","getTargetColor","getWidth","pickable","Component","Boolean","hostname","match","ReactDOM","render","StrictMode","document","getElementById","navigator","serviceWorker","ready","registration","unregister","catch","error","message"],"mappings":"4XAMMA,EAAYC,OAAOC,SAAW,wCAC9BC,EAAQF,OAAOC,SAAW,aAC1BE,EAAK,GAELC,EAAa,CACjBC,QAAS,CAEPC,SAAU,WACVC,IAAK,OACLC,OAAQ,QAEVC,QAAS,CACPH,SAAU,WACVC,IAAK,OACLG,KAAM,OACNC,MAAO,OACPH,OAAQ,SAIZI,IAAWC,cAAc,Q,IAEJC,E,kDACnB,WAAYC,GAAQ,IAAD,8BACjB,cAAMA,IA4GRC,kBAAoB,SAACC,GACnB,EAAKC,SAAS,CACZD,SAAS,2BAAM,EAAKE,MAAMF,UAAaA,MA/GxB,EAmHnBG,QAAU,WACR,EAAKJ,kBAAkB,CACrBK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AA7BlI,OAAOC,SAASiI,UAEhBlI,OAAOC,SAASiI,SAASC,MACvB,2DCXNC,IAASC,OACP,kBAAC,IAAMC,WAAP,KACE,kBAAC,EAAD,OAEFC,SAASC,eAAe,QDwHpB,kBAAmBC,WACrBA,UAAUC,cAAcC,MACrB7E,MAAK,SAAA8E,GACJA,EAAaC,gBAEdC,OAAM,SAAAC,GACL9F,QAAQ8F,MAAMA,EAAMC,c","file":"static/js/main.32ebe75f.chunk.js","sourcesContent":["/* global window */\nimport React, { Component } from 'react';\nimport DeckGL, { GeoJsonLayer, ArcLayer, MapController } from 'deck.gl';\nimport { Nav, Navbar, NavDropdown } from 'react-bootstrap';\nimport ReactModal from 'react-modal';\n\nconst COUNTRIES = window.location + 'map/ne_50m_admin_0_scale_rank.geojson';\nconst DAILY = window.location + \"daily.json\";\nconst D4 = [];\n\nconst MODALSTYLE = {\n overlay: {\n // backgroundColor: 'papayawhip'\n position: 'absolute',\n top: '56px',\n bottom: '40px'\n },\n content: {\n position: 'absolute',\n top: '40px',\n left: '40px',\n right: '40px',\n bottom: '40px'\n }\n};\n\nReactModal.setAppElement('#map');\n\nexport default class App extends Component {\n constructor(props) {\n super(props);\n this.state = {\n // deck.gl related\n viewport: {\n width: window.innerWidth,\n height: window.innerHeight,\n longitude: 6.1319346,\n latitude: 49.611621,\n zoom: 4,\n maxZoom: 12\n },\n points: [],\n // modal related\n showModalAbout: false,\n showModalControls: false\n };\n // deck.gl related\n this._getData = this._getData.bind(this);\n this._processData = this._processData.bind(this);\n // modal related\n this.handleOpenModalAbout = this.handleOpenModalAbout.bind(this);\n this.handleCloseModalAbout = this.handleCloseModalAbout.bind(this);\n this.handleOpenModalControls = this.handleOpenModalControls.bind(this);\n this.handleCloseModalControls = this.handleCloseModalControls.bind(this);\n }\n\n // deck.gl related\n\n _getData() {\n var loc = window.location;\n // js binding \n var up = this;\n var uri = 'ws:';\n\n if (loc.protocol === 'https:') {\n uri = 'wss:';\n }\n uri += '//' + loc.host;\n uri += loc.pathname + 'ws';\n\n var ws = new WebSocket(uri)\n\n ws.onopen = function () {\n console.log('Connected')\n }\n\n ws.onmessage = function (ev) {\n var json = JSON.parse(ev.data);\n if (json.hasOwnProperty('command')) {\n if (json.command == \"flush\") {\n // Flushing the data\n D4.length = 0;\n this.setState({\n points: []\n });\n }\n } else {\n D4.push(json[0]);\n up._processData();\n }\n }\n }\n\n componentDidMount() {\n // js binding \n var up = this;\n fetch(DAILY)\n .then(response => response.text())\n .then((data) => {\n if (data) {\n var events = data.split(/\\r\\n|\\r|\\n/g);\n events.forEach(function (event) {\n if (event) {\n var json = JSON.parse(event);\n D4.push(json[0]);\n }\n });\n up._processData();\n }\n }, (err) => {\n console.log('Could not fetch ' + DAILY + ' ' + err); // Erreur !\n });\n\n this._getData();\n this._processData();\n window.addEventListener('resize', this._resize);\n this._resize();\n }\n\n _processData() {\n if (D4) {\n const points = D4.reduce((accu, curr) => {\n accu.push({\n position: [Number(curr.geoip_lon), Number(curr.geoip_lat)],\n });\n return accu;\n }, []);\n // Add the point to the ARCS\n this.setState({\n points\n });\n }\n }\n\n componentWillUnmount() {\n window.removeEventListener('resize', this._resize);\n }\n\n _onViewportChange = (viewport) => {\n this.setState({\n viewport: { ...this.state.viewport, ...viewport }\n });\n }\n\n _resize = () => {\n this._onViewportChange({\n width: window.innerWidth,\n height: window.innerHeight\n });\n }\n\n // modal related\n handleOpenModalAbout() {\n this.closeAllModals()\n this.setState({ showModalAbout: true });\n }\n\n handleCloseModalAbout() {\n this.setState({ showModalAbout: false });\n }\n\n handleOpenModalControls() {\n this.closeAllModals()\n this.setState({ showModalControls: true });\n }\n\n handleCloseModalControls() {\n this.setState({ showModalControls: false });\n }\n\n closeAllModals() {\n this.setState({ showModalAbout: false });\n this.setState({ showModalControls: false });\n }\n\n render() {\n return (\n <>\n
\n \n D4 attack map\n \n \n \n \n \n
\n \n

About this page

\n

This page displays realtime SSH bruteforce attacks registered against d4-project's main instance, hosted in Luxembourg.

\n

This page flushed every day at midnight.

\n\n \n \n \n

On a Desktop

\n

Using the Mouse

\n \n

Using the Keyboard

\n \n

On a Mobile Phone

\n \n \n \n
\n \n \n [6.1319346, 49.611621]}\n getTargetPosition={f => f.position}\n getSourceColor={[0, 128, 200]}\n getTargetColor={[200, 0, 80]}\n getWidth={24}\n pickable={true}\n />\n \n
\n \n );\n }\n}","// 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 './index.css';\nimport 'bootstrap/dist/css/bootstrap.min.css';\nimport App from './App';\nimport * as serviceWorker from './serviceWorker';\n\nReactDOM.render(\n \n \n ,\n document.getElementById('map')\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":""}