{"version":3,"sources":["components/NavMenu.js","components/Layout.js","components/LauncherForm.js","App.js","registerServiceWorker.js","index.js"],"names":["NavMenu","props","toggleNavbar","bind","state","collapsed","this","setState","Navbar","className","light","Container","NavbarBrand","Component","displayName","name","Layout","children","LauncherForm","infos","game","language","currency","user","token","loading","operator","handleGameChange","handleLanguageChange","handleCurrencyChange","handleUserChange","handleTokenChange","handleOperatorChange","populateLauncherInfo","aria-labelledby","htmlFor","type","id","value","onChange","checked","games","map","g","key","languages","l","currencies","c","style","display","colSpan","onClick","handleLaunch","data","game_identifier","authenticity_token","operator_code","toLowerCase","axios","method","url","JSON","stringify","headers","then","response","window","location","href","e","target","contents","renderLauncher","fetch","json","App","isHide","get","res","exact","path","component","isLocalhost","Boolean","hostname","match","registerValidSW","swUrl","navigator","serviceWorker","register","registration","onupdatefound","installingWorker","installing","onstatechange","controller","console","log","catch","error","baseUrl","document","getElementsByTagName","getAttribute","rootElement","getElementById","ReactDOM","render","basename","URL","process","origin","addEventListener","status","indexOf","ready","unregister","reload","checkValidServiceWorker","registerServiceWorker"],"mappings":";oUAKaA,G,MAAb,kDAGE,WAAaC,GAAQ,IAAD,8BAClB,cAAMA,IAEDC,aAAe,EAAKA,aAAaC,KAAlB,gBACpB,EAAKC,MAAQ,CACXC,WAAW,GALK,EAHtB,gDAYE,WACEC,KAAKC,SAAS,CACZF,WAAYC,KAAKF,MAAMC,cAd7B,oBAkBE,WACE,OACE,gCACE,kBAACG,EAAA,EAAD,CAAQC,UAAU,+EAA+EC,OAAK,GACpG,kBAACC,EAAA,EAAD,KACE,kBAACC,EAAA,EAAD,6BAvBZ,GAA6BC,cAAhBb,EACJc,YAAcd,EAAQe,KCFxB,IAAMC,EAAb,4JAGE,WACE,OACE,6BACE,kBAAC,EAAD,MACA,kBAACL,EAAA,EAAD,KACGL,KAAKL,MAAMgB,eARtB,GAA4BJ,aAAfG,EACJF,YAAcE,EAAOD,K,qzMCDvB,IAAMG,EAAb,kDAGE,WAAYjB,GAAQ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iBC,GACxBC,UAAUC,cACPC,SAASH,GACTvB,MAAK,SAAA2B,GACJA,EAAaC,cAAgB,WAC3B,IAAMC,EAAmBF,EAAaG,WACtCD,EAAiBE,cAAgB,WACA,cAA3BF,EAAiB1F,QACfqF,UAAUC,cAAcO,WAK1BC,QAAQC,IAAI,6CAKZD,QAAQC,IAAI,4CAMrBC,OAAM,SAAAC,GACLH,QAAQG,MAAM,4CAA6CA,MC/DjE,IAAMC,EAAUC,SAASC,qBAAqB,QAAQ,GAAGC,aAAa,QAChEC,EAAcH,SAASI,eAAe,QAE5CC,IAASC,OACP,kBAAC,IAAD,CAAeC,SAAUR,GACvB,kBAAC,EAAD,OAEFI,GDMa,WACb,GAA6C,kBAAmBjB,UAAW,CAGzE,GADkB,IAAIsB,IAAIC,GAAwB7C,OAAOC,UAC3C6C,SAAW9C,OAAOC,SAAS6C,OAIvC,OAGF9C,OAAO+C,iBAAiB,QAAQ,WAC9B,IAAM1B,EAAK,UAAMwB,GAAN,sBAEP7B,EAwCV,SAAkCK,GAEhCd,MAAMc,GACHvB,MAAK,SAAAC,GAGkB,MAApBA,EAASiD,SACuD,IAAhEjD,EAASF,QAAQc,IAAI,gBAAgBsC,QAAQ,cAG7C3B,UAAUC,cAAc2B,MAAMpD,MAAK,SAAA2B,GACjCA,EAAa0B,aAAarD,MAAK,WAC7BE,OAAOC,SAASmD,eAKpBhC,EAAgBC,MAGnBY,OAAM,WACLF,QAAQC,IACN,oEA5DAqB,CAAwBhC,GAGxBD,EAAgBC,OCvBxBiC,K","file":"static/js/main.d5411de3.chunk.js","sourcesContent":["import React, { Component } from 'react';\nimport { Collapse, Container, Navbar, NavbarBrand, NavbarToggler, NavItem, NavLink } from 'reactstrap';\nimport { Link } from 'react-router-dom';\nimport './NavMenu.css';\n\nexport class NavMenu extends Component {\n static displayName = NavMenu.name;\n\n constructor (props) {\n super(props);\n\n this.toggleNavbar = this.toggleNavbar.bind(this);\n this.state = {\n collapsed: true\n };\n }\n\n toggleNavbar () {\n this.setState({\n collapsed: !this.state.collapsed\n });\n }\n\n render () {\n return (\n
\n \n \n Game Launcher\n \n \n
\n );\n }\n}\n","import React, { Component } from 'react';\nimport { Container } from 'reactstrap';\nimport { NavMenu } from './NavMenu';\n\nexport class Layout extends Component {\n static displayName = Layout.name;\n\n render () {\n return (\n
\n \n \n {this.props.children}\n \n
\n );\n }\n}\n","import React, { Component } from 'react';\nimport axios from 'axios';\nimport { BrowserRouter as Router, Route } from \"react-router-dom\";\n\nexport class LauncherForm extends Component {\n static displayName = LauncherForm.name;\n\n constructor(props) {\n super(props);\n this.state = { infos: [], game: '', language: '', currency: '', user: 'testx01', token: '', loading: true, operator: 'qm' };\n\n this.handleGameChange = this.handleGameChange.bind(this);\n this.handleLanguageChange = this.handleLanguageChange.bind(this);\n this.handleCurrencyChange = this.handleCurrencyChange.bind(this);\n this.handleUserChange = this.handleUserChange.bind(this);\n this.handleTokenChange = this.handleTokenChange.bind(this);\n this.handleOperatorChange = this.handleOperatorChange.bind(this);\n }\n\n componentDidMount() {\n this.populateLauncherInfo();\n }\n\n renderLauncher(infos) {\n return (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n QM\n
\n \n
\n \n
\n \n
\n \n
\n \n
\n );\n }\n\n handleLaunch() {\n let data = {\n game_identifier: this.state.game,\n language: this.state.language,\n currency: this.state.currency,\n user: this.state.user,\n authenticity_token: this.state.token,\n operator_code: this.state.operator.toLowerCase()\n };\n\n axios({\n method: \"POST\",\n url: 'launcher',\n data: JSON.stringify(data),\n headers: {\n 'Content-Type': 'application/json'\n }\n })\n .then((response) => {\n window.location.href = `${response.data}`;\n })\n }\n\n handleOperatorChange(e) {\n this.setState({ operator: e.target.value });\n }\n\n handleGameChange(e) {\n this.setState({ game: e.target.value });\n }\n\n handleLanguageChange(e) {\n this.setState({ language: e.target.value });\n }\n\n handleCurrencyChange(e) {\n this.setState({ currency: e.target.value });\n }\n\n handleUserChange(e) {\n this.setState({ user: e.target.value });\n }\n\n handleTokenChange(e) {\n this.setState({ token: e.target.value });\n }\n\n render() {\n let contents = this.state.loading\n ?

Loading...

\n : this.renderLauncher(this.state.infos);\n\n return (\n
\n {contents}\n
\n );\n }\n\n async populateLauncherInfo() {\n const response = await fetch('launcher');\n const data = await response.json();\n this.setState({ game: data.games[0] });\n this.setState({ language: data.languages[0] });\n this.setState({ currency: data.currencies[0] });\n this.setState({ infos: data, loading: false });\n this.setState({ token: \"\"});\n }\n}\n","import React, { Component } from 'react';\nimport axios from 'axios';\nimport { Route } from 'react-router';\nimport { Layout } from './components/Layout';\nimport { LauncherForm } from './components/LauncherForm';\n\nimport './custom.css'\n\nexport default class App extends Component {\n static displayName = App.name;\n state = { isHide: false }\n\n componentDidMount() {\n axios.get('launcher/hide')\n .then(res => {\n const isHide = res.data;\n this.setState({ isHide });\n });\n }\n\n render() {\n return (\n this.state.isHide ?\n (
) :\n ())\n }\n}\n","// In production, we register a service worker to serve assets from local cache.\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 the \"N+1\" visit to a page, since previously\n// cached resources are updated in the background.\n\n// To learn more about the benefits of this model, read https://goo.gl/KwvDNy.\n// This link also includes instructions on opting out of this behavior.\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.1/8 is 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 default function register () {\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);\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/facebookincubator/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. Lets check if a service worker still exists or not.\n checkValidServiceWorker(swUrl);\n } else {\n // Is not local host. Just register service worker\n registerValidSW(swUrl);\n }\n });\n }\n}\n\nfunction registerValidSW (swUrl) {\n navigator.serviceWorker\n .register(swUrl)\n .then(registration => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the old content will have been purged and\n // the fresh content will have been added to the cache.\n // It's the perfect time to display a \"New content is\n // available; please refresh.\" message in your web app.\n console.log('New content is available; please refresh.');\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 }\n };\n };\n })\n .catch(error => {\n console.error('Error during service worker registration:', error);\n });\n}\n\nfunction checkValidServiceWorker (swUrl) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl)\n .then(response => {\n // Ensure service worker exists, and that we really are getting a JS file.\n if (\n response.status === 404 ||\n response.headers.get('content-type').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);\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.then(registration => {\n registration.unregister();\n });\n }\n}\n","import 'bootstrap/dist/css/bootstrap.css';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport { BrowserRouter } from 'react-router-dom';\nimport App from './App';\nimport registerServiceWorker from './registerServiceWorker';\n\nconst baseUrl = document.getElementsByTagName('base')[0].getAttribute('href');\nconst rootElement = document.getElementById('root');\n\nReactDOM.render(\n \n \n ,\n rootElement);\n\nregisterServiceWorker();\n\n"],"sourceRoot":""}