{"version":3,"sources":["serviceWorker.js","strings/index.js","lib/use-fetch.js","lib/spinner.js","components/OauthConsumer.js","components/OauthError.js","containers/Callback.js","containers/OauthCallback.js","components/SocialLogin.js","containers/Login.js","App.js","index.js"],"names":["Boolean","window","location","hostname","match","en","it","useFetch","method","url","body","headers","useState","status","setStatus","redirectLocation","setRedirectLocation","error","setError","loading","setLoading","responseBody","setResponseBody","useEffect","axios","toLowerCase","data","then","response","locationHeader","catch","Spinner","style","textAlign","marginTop","headersContentType","emptyHeaders","OauthTokenConsumer","tokenQuery","tokenBody","onError","replaceLocation","origin","replace","styles","container","display","justifyContent","alignItems","flexDirection","height","width","alert","minWidth","maxWidth","marginBottom","button","OauthError","errorDescription","onClick","description","message","type","id","Callback","history","query","qs","parse","search","ignoreQueryPrefix","error_description","push","stringify","code","state","addQueryPrefix","OauthCallback","getIconByProviderType","buttons","SocialLogin","appId","authorizeUrl","redirectUrl","Array","isArray","length","defaultMessage","map","provider","providerId","redirect","href","icon","key","margin","paddingLeft","label","values","providerType","startcase","Login","queryString","App","intl","useIntl","e","statusCode","notification","warn","formatMessage","exact","path","render","props","component","to","Intl","PluralRules","require","navigatorLanguage","navigator","language","substring","messages","ReactDOM","locale","basename","process","document","getElementById","serviceWorker","ready","registration","unregister"],"mappings":"+wBAaoBA,QACW,cAA7BC,OAAOC,SAASC,UAEe,UAA7BF,OAAOC,SAASC,UAEhBF,OAAOC,SAASC,SAASC,MACvB,2D,ICXS,GACbC,G,OACAC,G,8ECLK,SAASC,EAAUC,EAAQC,EAAKC,EAAMC,GAC3C,MAA4BC,mBAAS,GAArC,mBAAOC,EAAP,KAAeC,EAAf,KACA,EAAgDF,mBAJ5B,mBAIpB,mBAAOG,EAAP,KAAyBC,EAAzB,KACA,EAA0BJ,mBAAS,MAAnC,mBAAOK,EAAP,KAAcC,EAAd,KACA,EAA8BN,oBAAS,GAAvC,mBAAOO,EAAP,KAAgBC,EAAhB,KACA,EAAwCR,mBAAS,MAAjD,mBAAOS,E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EK,IAASZ,OACP,kBAAC,IAAD,CAAca,OAAQJ,EAAUE,SAAUA,EAASF,IACjD,kBAAC,IAAD,CAAeK,SAAUC,cACvB,kBAAC,IAAD,CAAOb,UAAWZ,MAGtB0B,SAASC,eAAe,SXwGpB,kBAAmBT,WACrBA,UAAUU,cAAcC,MAAMzG,MAAK,SAAA0G,GACjCA,EAAaC,kB","file":"static/js/main.43db5b13.chunk.js","sourcesContent":["/* eslint no-console: 0 */\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","/*\n * Copyright © 2019-present Mia s.r.l.\n * All rights reserved\n */\n\nimport en from '../strings/locales/en.json'\nimport it from '../strings/locales/it.json'\n\nexport default {\n en,\n it\n}\n","import axios from 'axios'\nimport {useEffect, useState} from 'react'\n\nconst cmsEntryPoint = '/app_dataentry/'\n\nexport function useFetch (method, url, body, headers) {\n const [status, setStatus] = useState(0)\n const [redirectLocation, setRedirectLocation] = useState(cmsEntryPoint)\n const [error, setError] = useState(null)\n const [loading, setLoading] = useState(true)\n const [responseBody, setResponseBody] = useState(null)\n useEffect(\n () => {\n setLoading(true)\n axios({\n url,\n method: method.toLowerCase(),\n headers,\n data: body\n })\n .then(response => {\n setStatus(response.status)\n const locationHeader = response.headers.location\n if (locationHeader) {\n setRedirectLocation(locationHeader)\n }\n setLoading(false)\n setResponseBody(response.data)\n return response\n })\n .catch(error => {\n if (error.response) {\n setStatus(error.response.status)\n }\n setError(error)\n setLoading(false)\n })\n },\n [body, headers, method, url]\n )\n return {status, redirectLocation, error, loading, responseBody}\n}\n","import React from 'react'\nimport {Spin} from 'antd'\n\nfunction Spinner () {\n return