aboutsummaryrefslogtreecommitdiff
path: root/build/static/js/main.21f287cc.chunk.js.map
blob: 0bb388f764f0703dc518ce755e2c9a14dd3e97f9 (plain) (blame)
1
{"version":3,"sources":["App.js","serviceWorker.js","index.js"],"names":["default_chart_data","name","value","color","cyan","gapi_base","theme","createMuiTheme","palette","primary","light","orange","main","dark","contrastText","to_params","dict","Object","entries","map","_ref","_ref2","slicedToArray","k","v","concat","encodeURIComponent","join","getCalendars","token","fetch","access_token","method","async","then","response","json","data","items","getColors","customizedLabel","props","cx","cy","x","y","fill","stroke","anchor","dx","dy","react_default","a","createElement","textAnchor","ChromiclePieChart","Grid_default","container","spacing","item","xs","lg","PieChart","width","height","className","classes","pieChart","Pie","patternGraphData","outerRadius","deepOrange","label","Tooltip","formatter","toFixed","calendarGraphData","innerRadius","d","Cell","Dashboard","state","open","patterns","page","rowsPerPage","timeRange","Promise","resolver","chrome","identity","getAuthToken","interactive","activePattern","cached","calendars","handleChangePage","event","_this","setState","handleChangeRowsPerPage","target","updatePattern","field","idx","removePattern","splice","i","length","analyze","startDate","endDate","start","toISOString","end","event_pms","_loop","id","calId","timeMin","timeMax","push","events","all","results","cal_results","_loop2","calName","filter","p","RegExp","cal","test","filterPatterns","regex","forEach","status","summary","undefined","duration","Date","dateTime","background","alert","loadPatterns","colors","calendar","cals","_ref3","_ref4","colorId","_this2","this","_this$state","rows","nDummy","Math","min","styles","root","AppBar_default","position","appBar","Toolbar_default","disableGutters","toolbar","Typography_default","component","variant","noWrap","title","content","appBarSpacer","CssBaseline_default","md","FormControl_default","fullWidth","FormGroup_default","gutterBottom","Table_default","TableHead_default","TableRow_default","patternHead","s","TableCell_default","TableBody_default","slice","onMouseOver","onMouseOut","TextField_default","onChange","style","right","display","DeleteOutlined_default","icon","cursor","onClick","colSpan","TablePagination_default","rowsPerPageOptions","count","backIconButtonProps","aria-label","nextIconButtonProps","onChangePage","onChangeRowsPerPage","textAlign","react_dates","startDateId","endDateId","onDatesChange","_ref5","focusedInput","onFocusChange","isOutsideRange","buttonSpacer","Button_default","React","Component","withStyles","margin","unit","zIndex","drawer","transition","transitions","create","easing","sharp","leavingScreen","flexGrow","sectionTitle","flex","mixins","padding","overflow","marginBottom","patternTable","overflowX","fab","Boolean","window","location","hostname","match","ReactDOM","render","App","document","getElementById","navigator","serviceWorker","ready","registration","unregister"],"mappings":"0oBAgCMA,GAAqB,CAAC,CAACC,KAAM,OAAQC,MAAO,GAAIC,MAAOC,IAAK,MACtC,CAACH,KAAM,SAAUC,MAAO,GAAIC,MAAOC,IAAK,OAE9DC,GAAY,yCAEZC,GAAQC,yBAAe,CACzBC,QAAS,CACLC,QAAS,CACLC,MAAOC,IAAO,KACdC,KAAMD,IAAO,KACbE,KAAMF,IAAO,KACbG,aAAc,WAO1B,SAASC,GAAUC,GACf,OAAOC,OAAOC,QAAQF,GAAMG,IAAI,SAAAC,GAAA,IAAAC,EAAAJ,OAAAK,EAAA,EAAAL,CAAAG,EAAA,GAAEG,EAAFF,EAAA,GAAKG,EAALH,EAAA,YAAAI,OAAeC,mBAAmBH,GAAlC,KAAAE,OAAwCC,mBAAmBF,MAAMG,KAAK,KAS1G,SAASC,GAAaC,GAClB,OAAOC,MAAMzB,GAAY,0BAA4BU,GAAU,CAACgB,aAAcF,IACtE,CAAEG,OAAQ,MAAOC,OAAO,IAC3BC,KAAK,SAAAC,GAAQ,OAAIA,EAASC,SAC1BF,KAAK,SAAAG,GAAI,OAAIA,EAAKC,QAa3B,SAASC,GAAUV,GACf,OAAOC,MAAMzB,GAAY,WAAaU,GAAU,CAACgB,aAAcF,IAAS,CAAEG,OAAQ,MAAOC,OAAO,IAC3FC,KAAK,SAAAC,GAAQ,OAAIA,EAASC,SAmDnC,SAASI,GAAgBC,GAAO,IACrBC,EAA2CD,EAA3CC,GAAIC,EAAuCF,EAAvCE,GAAIC,EAAmCH,EAAnCG,EAAGC,EAAgCJ,EAAhCI,EAAWC,GAAqBL,EAA7BM,OAA6BN,EAArBK,MAAM7C,EAAewC,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AMoD,QAAQoK,QAiTfF,CAAmB5I,ICnadiK,QACW,cAA7BC,OAAOC,SAASC,UAEe,UAA7BF,OAAOC,SAASC,UAEhBF,OAAOC,SAASC,SAASC,MACvB,2DCbNC,IAASC,OAAOpM,EAAAC,EAAAC,cAACmM,GAAD,MAASC,SAASC,eAAe,SD4H3C,kBAAmBC,WACrBA,UAAUC,cAAcC,MAAM3N,KAAK,SAAA4N,GACjCA,EAAaC","file":"static/js/main.21f287cc.chunk.js","sourcesContent":["import 'typeface-roboto';\nimport 'react-dates/initialize';\nimport 'react-dates/lib/css/_datepicker.css';\nimport { DateRangePicker, DayPickerRangeController } from 'react-dates';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { withStyles } from '@material-ui/core/styles';\nimport { MuiThemeProvider, createMuiTheme } from '@material-ui/core/styles';\nimport orange from '@material-ui/core/colors/orange';\nimport cyan from '@material-ui/core/colors/cyan';\nimport deepOrange from '@material-ui/core/colors/deepOrange';\nimport CssBaseline from '@material-ui/core/CssBaseline';\nimport AppBar from '@material-ui/core/AppBar';\nimport Toolbar from '@material-ui/core/Toolbar';\nimport TextField from '@material-ui/core/TextField';\nimport Typography from '@material-ui/core/Typography';\nimport Divider from '@material-ui/core/Divider';\nimport Table from '@material-ui/core/Table';\nimport TableBody from '@material-ui/core/TableBody';\nimport TableRow from '@material-ui/core/TableRow';\nimport TableCell from '@material-ui/core/TableCell';\nimport TableHead from '@material-ui/core/TableHead';\nimport TablePagination from '@material-ui/core/TablePagination';\nimport Paper from '@material-ui/core/Paper';\nimport Button from '@material-ui/core/Button';\nimport FormControl from '@material-ui/core/FormControl';\nimport FormGroup from '@material-ui/core/FormGroup';\nimport Grid from '@material-ui/core/Grid';\nimport DeleteOutlinedIcon from '@material-ui/icons/DeleteOutlined';\nimport { PieChart, Pie, Cell, Tooltip } from 'recharts';\n\nconst default_chart_data = [{name: 'Work', value: 10, color: cyan[300]},\n                            {name: 'Wasted', value: 10, color: cyan[300]}];\n\nconst gapi_base = 'https://www.googleapis.com/calendar/v3';\n\nconst theme = createMuiTheme({\n    palette: {\n        primary: {\n            light: orange[300],\n            main: orange[500],\n            dark: orange[700],\n            contrastText: \"#fff\"\n        }\n    }\n});\n\n/* eslint-disable no-undef */\n\nfunction to_params(dict) {\n    return Object.entries(dict).map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(v)}`).join('&');\n}\n\nfunction getAuthToken() {\n    return new Promise(resolver =>\n        chrome.identity.getAuthToken(\n            {interactive: true}, token => resolver(token)));\n}\n\nfunction getCalendars(token) {\n    return fetch(gapi_base + '/users/me/calendarList?' + to_params({access_token: token}),\n            { method: 'GET', async: true })\n        .then(response => response.json())\n        .then(data => data.items);\n}\n\nfunction genEventsGetter(calId, timeMin, timeMax) {\n    return token => fetch(gapi_base + '/calendars/' + calId + '/events?' + to_params({\n        access_token: token,\n        timeMin,\n        timeMax\n    }), { method: 'GET', async: true })\n        .then(response => response.json())\n        .then(data => data.items);\n}\n\nfunction getColors(token) {\n    return fetch(gapi_base + '/colors?' + to_params({access_token: token}), { method: 'GET', async: true })\n        .then(response => response.json());\n}\n\nfunction filterPatterns(patterns, calName) {\n    return patterns.filter(p => {\n        let re = new RegExp(p.cal);\n        return re.test(calName);\n    });\n}\n\nconst styles = theme => ({\n    root: {\n        display: 'flex',\n        height: '100vh',\n    },\n    icon: {\n        margin: theme.spacing.unit * 2,\n    },\n    appBar: {\n        zIndex: theme.zIndex.drawer + 1,\n        transition: theme.transitions.create(['width', 'margin'], {\n            easing: theme.transitions.easing.sharp,\n            duration: theme.transitions.duration.leavingScreen,\n        }),\n    },\n    title: {\n        flexGrow: 1,\n    },\n    sectionTitle: {\n        flex: '0 0 auto'\n    },\n    appBarSpacer: theme.mixins.toolbar,\n    content: {\n        flexGrow: 1,\n        padding: theme.spacing.unit * 3,\n        overflow: 'auto',\n    },\n    buttonSpacer: {\n        marginBottom: theme.spacing.unit * 4,\n    },\n    patternTable: {\n        overflowX: 'auto'\n    },\n    pieChart: {\n        margin: '0 auto'\n    },\n    fab: {\n        margin: theme.spacing.unit,\n    }\n});\n\nfunction customizedLabel(props) {\n    const {cx, cy, x, y, stroke, fill, name, value} = props;\n    let anchor = \"middle\";\n    const EPS = 2;\n    let dx = 0;\n    let dy = 0;\n    if (x < cx - EPS) {\n        dx = -5;\n        anchor = \"end\"\n    } else if (x > cx + EPS) {\n        dx = 5;\n        anchor = \"start\";\n    }\n\n    if (y < cy - EPS) {\n        dy = -5;\n    } else if (y > cy + EPS) {\n        dy = 10;\n    }\n\n    return (<text x={x} y={y} dx={dx} dy={dy} fill={fill} textAnchor={anchor}>{`${name}`}</text>);\n}\n\nfunction ChromiclePieChart(props) {\n    return (\n    <Grid container spacing={0}>\n      <Grid item xs={12} lg={6}>\n        <PieChart width={400} height={300} className={props.classes.pieChart}>\n          <Pie data={props.patternGraphData}\n               cx={200}\n               cy={150}\n               outerRadius={60}\n               fill={deepOrange[300]}\n               label={customizedLabel}/>\n          <Tooltip formatter={(value) => `${value.toFixed(2)} hr`}/>\n        </PieChart>\n      </Grid>\n      <Grid item xs={12} lg={6}>\n        <PieChart width={400} height={300} className={props.classes.pieChart}>\n          <Pie data={props.calendarGraphData}\n               cx={200}\n               cy={150}\n               innerRadius={40}\n               outerRadius={70}\n               fill={cyan[300]}\n               label={customizedLabel}>\n            {props.calendarGraphData.map(d => <Cell fill={d.color}/>)}\n          </Pie>\n          <Tooltip formatter={(value) => `${value.toFixed(2)} hr`}/>\n        </PieChart>\n      </Grid>\n    </Grid>);\n}\n\nChromiclePieChart.propTypes = {\n    patternGraphData: PropTypes.object.isRequired,\n    patterncalendarData: PropTypes.object.isRequired,\n};\n\nclass Dashboard extends React.Component {\n    state = {\n        open: true,\n        patterns: [],\n        page: 0,\n        rowsPerPage: 5,\n        timeRange: null,\n        token: getAuthToken(),\n        patternGraphData: default_chart_data,\n        calendarGraphData: default_chart_data,\n        activePattern: null\n    };\n\n    cached = {\n        calendars: {}\n    };\n\n    static patternHead = [\n        {label: \"Name\", field: \"name\"},\n        {label: \"Calendar\", field: \"cal\"},\n        {label: \"Event\", field: 'event'}];\n\n    handleChangePage = (event, page) => {\n        this.setState({ page });\n    };\n\n    handleChangeRowsPerPage = event => {\n        this.setState({ rowsPerPage: event.target.value });\n    };\n\n    updatePattern = (field, idx, value) => {\n        let patterns = this.state.patterns;\n        patterns[idx][field] = value;\n        this.setState({ patterns });\n    };\n\n    removePattern = idx => {\n        let patterns = this.state.patterns;\n        patterns.splice(idx, 1);\n        for (let i = 0; i < patterns.length; i++)\n            patterns[i].idx = i;\n        this.setState({ patterns });\n    };\n\n    analyze = () => {\n        if (!(this.state.startDate && this.state.endDate)) {\n            alert(\"Please choose a valid time range.\");\n            return;\n        }\n        let start = this.state.startDate.toISOString();\n        let end = this.state.endDate.toISOString();\n        let event_pms = [];\n        for (let id in this.cached.calendars) {\n            event_pms.push(\n                this.state.token\n                .then(genEventsGetter(id, start, end))\n                .then(items => this.cached.calendars[id].events = items));\n        }\n\n        Promise.all(event_pms).then(() => {\n            let results = {}; // pattern idx => time\n            let cal_results = {}; // cal id => time\n            for (let i = 0; i < this.state.patterns.length; i++)\n                results[i] = 0;\n            for (let id in this.cached.calendars) {\n                let patterns = filterPatterns(this.state.patterns, this.cached.calendars[id].name)\n                    .map(p => { return { regex: new RegExp(p.event), idx: p.idx } });\n                if (!this.cached.calendars[id].events) continue;\n                this.cached.calendars[id].events.forEach(event => {\n                    if (event.status != \"confirmed\") return;\n                    patterns.forEach(p => {\n                        if (!p.regex.test(event.summary)) return;\n                        if (cal_results[id] === undefined) {\n                            cal_results[id] = 0;\n                        }\n                        let duration = (new Date(event.end.dateTime) - new Date(event.start.dateTime)) / 60000;\n                        results[p.idx] += duration;\n                        cal_results[id] += duration;\n                    });\n                });\n            }\n            let patternGraphData = [];\n            let calendarGraphData = [];\n            for (let i = 0; i < this.state.patterns.length; i++) {\n                patternGraphData.push({ name: this.state.patterns[i].name, value: results[i] / 60.0 });\n            }\n            for (let id in cal_results) {\n                calendarGraphData.push({\n                    name: this.cached.calendars[id].name,\n                    value: (cal_results[id] / 60.0),\n                    color: this.cached.calendars[id].color.background});\n            }\n            this.setState({ patternGraphData, calendarGraphData });\n        });\n    };\n\n    loadPatterns = () => {\n        let token = this.state.token;\n        let colors = token.then(getColors).then(color => {\n            return color.calendar;\n        });\n        let cals = token.then(getCalendars);\n        Promise.all([colors, cals]).then(([colors, items]) => {\n            items.forEach(item => {\n                this.cached.calendars[item.id] = {\n                    name: item.summary,\n                    events: {},\n                    color: colors[item.colorId]\n                };\n            });\n            this.setState({ patterns: items.map((item, idx) => {\n                return { name: item.summary,\n                         cal: item.summary,\n                         event: '.*',\n                         idx }\n            })});\n        });\n    };\n\n    render() {\n      const { classes } = this.props;\n      const { patterns, rows, rowsPerPage, page } = this.state;\n      const nDummy = rowsPerPage - Math.min(rowsPerPage, patterns.length - page * rowsPerPage);\n\n      return (\n      <MuiThemeProvider theme={theme}>\n        <div className={classes.root}>\n          <AppBar\n           position=\"absolute\"\n           className={classes.appBar}>\n            <Toolbar disableGutters={!this.state.open} className={classes.toolbar}>\n              <Typography component=\"h1\" variant=\"h6\" color=\"inherit\" noWrap className={classes.title}>\n                Chromicle\n              </Typography>\n            </Toolbar>\n          </AppBar>\n          <main className={classes.content}>\n            <div className={classes.appBarSpacer} />\n              <Grid container  spacing={16}>\n              <CssBaseline />\n              <Grid item md={6} xs={12}>\n                <FormControl fullWidth={true}>\n                  <FormGroup>\n                    <Typography variant=\"h6\" component=\"h1\" gutterBottom>\n                      Event Patterns\n                    </Typography>\n                    <Table>\n                      <TableHead>\n                        <TableRow>{Dashboard.patternHead.map(s => (<TableCell>{s.label}</TableCell>))}</TableRow>\n                      </TableHead>\n                      <TableBody>\n                        {patterns.slice(page * rowsPerPage, (page + 1) * rowsPerPage).map(p => (\n                            <TableRow\n                             onMouseOver={() => this.setState({ activePattern: p.idx })}\n                             onMouseOut={() => this.setState({ activePattern: null })}>\n                              {Dashboard.patternHead.map(s => (\n                                <TableCell>\n                                  <TextField\n                                   value={p[s.field]}\n                                   onChange={event => this.updatePattern(s.field, p.idx, event.target.value)}/>\n                                  </TableCell>))}\n                                  <span style={(this.state.activePattern == p.idx &&\n                                                  { position: 'absolute', right: 0, height: 48 }) ||\n                                                  { display: 'none' }}>\n                                    <DeleteOutlinedIcon\n                                     className={classes.icon}\n                                     style={{ height: '100%', cursor: 'pointer' }}\n                                     onClick={() => this.removePattern(p.idx)} />\n                                  </span>\n                            </TableRow>))}\n                        {nDummy > 0 && (\n                            <TableRow style={{ height: 48 * nDummy }}>\n                              <TableCell colSpan={Dashboard.patternHead.length} />\n                            </TableRow>)}\n                      </TableBody>\n                    </Table>\n                    <TablePagination\n                       rowsPerPageOptions={[5, 10, 25]}\n                       component=\"div\"\n                       count={patterns.length}\n                       rowsPerPage={rowsPerPage}\n                       page={page}\n                       backIconButtonProps={{'aria-label': 'Previous Page'}}\n                       nextIconButtonProps={{'aria-label': 'Next Page'}}\n                       onChangePage={this.handleChangePage}\n                       onChangeRowsPerPage={this.handleChangeRowsPerPage}/>\n                  </FormGroup>\n                  <FormGroup>\n            \t    <Typography variant=\"h6\" component=\"h1\" gutterBottom>\n            \t      Time Range\n            \t    </Typography>\n                    <div style={{textAlign: 'center'}}>\n                      <DateRangePicker\n    \t\t\t       startDate={this.state.startDate} // momentPropTypes.momentObj or null,\n    \t\t\t       startDateId=\"your_unique_start_date_id\" // PropTypes.string.isRequired,\n    \t\t\t       endDate={this.state.endDate} // momentPropTypes.momentObj or null,\n    \t\t\t       endDateId=\"your_unique_end_date_id\" // PropTypes.string.isRequired,\n    \t\t\t       onDatesChange={({ startDate, endDate }) => {\n                         //if (startDate && endDate)\n                         //    this.setState({ timeRange: [startDate.toISOString(), endDate.toISOString()]});\n                         this.setState({ startDate, endDate });\n                       }} // PropTypes.func.isRequired,\n    \t\t\t       focusedInput={this.state.focusedInput} // PropTypes.oneOf([START_DATE, END_DATE]) or null,\n    \t\t\t       onFocusChange={focusedInput => this.setState({ focusedInput })} // PropTypes.func.isRequired,\n                       isOutsideRange={() => false}/>\n                    </div>\n                  </FormGroup>\n                  <div className={classes.buttonSpacer} />\n                  <Grid container spacing={16}>\n                    <Grid item md={6} xs={12}>\n                      <FormGroup>\n                        <Button variant=\"contained\" color=\"primary\" onClick={this.loadPatterns}>Load</Button>\n                        </FormGroup>\n                    </Grid>\n                    <Grid item md={6} xs={12}>\n                      <FormGroup>\n                        <Button variant=\"contained\" color=\"primary\" onClick={this.analyze}>Analyze</Button>\n                      </FormGroup>\n                    </Grid>\n                  </Grid>\n                </FormControl>\n              </Grid>\n              <Grid item md={6} xs={12}>\n                <Typography variant=\"h6\" component=\"h1\" gutterBottom>\n                  Graph\n                </Typography>\n                  <ChromiclePieChart\n                   patternGraphData={this.state.patternGraphData}\n                   calendarGraphData={this.state.calendarGraphData}\n                   classes={classes}/>\n              </Grid>\n            </Grid>\n          </main>\n        </div>\n      </MuiThemeProvider>);\n    }\n}\n\nDashboard.propTypes = {\n  classes: PropTypes.object.isRequired,\n};\n\nexport default withStyles(styles)(Dashboard);\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 http://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.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 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 http://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 http://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    .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.then(registration => {\n      registration.unregister();\n    });\n  }\n}\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport App from './App';\nimport * as serviceWorker from './serviceWorker';\n\nReactDOM.render(<App />, document.getElementById('root'));\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: http://bit.ly/CRA-PWA\nserviceWorker.unregister();\n"],"sourceRoot":""}