{"version":3,"sources":["assets/logo.png","components/Button/index.tsx","components/Input/index.tsx","utils/validationYup.ts","pages/Recovery/index.tsx","App.tsx","serviceWorker.ts","index.tsx"],"names":["module","exports","Button","className","children","type","onClick","cn","Input","name","onChange","required","e","target","value","FormValidation","Yup","shape","email","password","min","passwordConfirm","oneOf","ZAMPYLIFE_LOGO","require","RecoveryPassword","key","useParams","useState","success","setSuccess","error","setError","onFormSubmit","useCallback","values","a","undefined","Axios","post","process","src","alt","initialValues","validateOnMount","validationSchema","onSubmit","form","preventDefault","stopPropagation","handleSubmit","t","setFieldValue","trim","style","maxWidth","Object","errors","App","path","component","Recovery","Boolean","window","location","hostname","match","ReactDOM","render","document","getElementById","navigator","serviceWorker","ready","then","registration","unregister","catch","console","message"],"mappings":"uFAAAA,EAAOC,QAAU,IAA0B,kC,oKCkB5BC,MARf,YAAoF,IAAD,IAAjEC,iBAAiE,MAArD,GAAqD,EAAjDC,EAAiD,EAAjDA,SAAiD,IAAvCC,YAAuC,MAAhC,SAAgC,EAAtBC,EAAsB,EAAtBA,QACzD,OACI,4BAAQD,KAAMA,EAAMF,UAAWI,IAAG,kEAAmEJ,GAAYG,QAASA,GACrHF,ICeEI,MAhBf,YAAgG,IAAD,IAA9EL,iBAA8E,MAAlE,GAAkE,EAA9DM,EAA8D,EAA9DA,KAA8D,IAAxDJ,YAAwD,MAAjD,OAAiD,EAAzCK,EAAyC,EAAzCA,SAAyC,IAA/BC,gBAA+B,SAC3F,OACI,oCACI,yBAAKR,UAAWI,IAAG,uBAAwBJ,MACpCM,GAAQ,0BAAMN,UAAU,qCAAqCM,GAChE,2BACIN,UAAU,yHACVE,KAAMA,EACNM,SAAUA,EACVD,SAAU,SAAAE,GAAC,OAAIF,GAAYA,EAASE,EAAEC,OAAOC,a,iCCXlDC,EARQC,MAAaC,MAAM,CACtCC,MAAOF,MAAaE,MAAM,6BAA6BP,SAAS,yBAChEQ,SAAUH,MAAaI,IAAI,EAAG,8DAA2DT,SAAS,kCAClGU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AAIJ,EAAKK,cAAc,WAAYD,MAClJ,kBAAC,EAAD,CACIxC,UAAQ,EACRN,KAAK,WACLF,UAAU,OACVM,KAAK,0BACLK,MAAOiC,EAAKZ,OAAOd,gBACnBX,SAAU,SAAAyC,GAAC,OAAIJ,EAAKK,cAAc,kBAAmBD,MAEzD,yBAAKhD,UAAU,mDACX,uBAAGA,UAAU,uBAAuBmD,MAAO,CAAEC,SAAU,QAAvD,UACMxB,GAASyB,OAAOrB,OAAOY,EAAKU,QAAQ,UAD1C,QACiD,IAEjD,kBAAC,EAAD,CAAQpD,KAAK,SAASC,QAASyC,EAAKG,cAApC,8BChDzBQ,MAVf,WACI,OACI,kBAAC,IAAD,KACI,kBAAC,IAAD,KACI,kBAAC,IAAD,CAAOC,KAAK,iBAAiBC,UAAWC,OCApCC,QACW,cAA7BC,OAAOC,SAASC,UAEe,UAA7BF,OAAOC,SAASC,UAEhBF,OAAOC,SAASC,SAASC,MACvB,2DCZNC,IAASC,OACL,kBAAC,EAAD,MACAC,SAASC,eAAe,SDmItB,kBAAmBC,WACrBA,UAAUC,cAAcC,MACrBC,MAAK,SAAAC,GACJA,EAAaC,gBAEdC,OAAM,SAAA9C,GACL+C,QAAQ/C,MAAMA,EAAMgD,a","file":"static/js/main.c981f61c.chunk.js","sourcesContent":["module.exports = __webpack_public_path__ + \"static/media/logo.9f649c48.png\";","import cn from 'classnames';\nimport React from 'react';\n\ninterface InputProp {\n className?: string;\n children: any;\n onClick?: () => void;\n type?: 'button' | 'submit' | 'reset' | undefined;\n}\n\nfunction Button({ className = '', children, type = 'button', onClick }: InputProp) {\n return (\n \n );\n}\n\nexport default Button;\n","import cn from 'classnames';\nimport React from 'react';\n\ninterface InputProp {\n className?: string;\n name?: string;\n value: string;\n type?: string;\n required?: boolean;\n onChange?: (t: string) => void;\n}\n\nfunction Input({ className = '', name, type = 'text', onChange, required = false }: InputProp) {\n return (\n <>\n
\n {!!name && {name}}\n onChange && onChange(e.target.value)}\n />\n
\n \n );\n}\n\nexport default Input;\n","import * as Yup from 'yup';\n\nconst FormValidation = Yup.object().shape({\n email: Yup.string().email('Inserire una email valida').required('Campo Email richiesto'),\n password: Yup.string().min(5, 'La password è troppo corta inserisci almeno 5 caratteri').required('Campo Nuova Password richiesto'),\n passwordConfirm: Yup.string()\n .required('Campo Conferma Nuova Password richiesto')\n .oneOf([Yup.ref('password')], 'La nuova password e la conferma della nuova password non corrispondono'),\n});\n\nexport default FormValidation;\n","import Button from 'components/Button';\nimport Input from 'components/Input';\nimport React, { useCallback, useState } from 'react';\nimport Axios from 'axios';\nimport { Formik } from 'formik';\n\nimport { useParams } from 'react-router';\nimport FormValidation from 'utils/validationYup';\n\nconst ZAMPYLIFE_LOGO = require('assets/logo.png');\n\nfunction RecoveryPassword() {\n const { key } = useParams<{ key: string }>();\n\n const [success, setSuccess] = useState();\n const [error, setError] = useState();\n\n const onFormSubmit = useCallback(\n async (values: any) => {\n try {\n setSuccess(undefined);\n setError(undefined);\n await Axios.post(process.env.REACT_APP_API_HOST + '/authentication/change-password', { ...values, key });\n setSuccess(true);\n } catch (err) {\n setSuccess(false);\n setError('Si è verificato un errore, riprova');\n }\n },\n [key],\n );\n\n return (\n
\n
\n
\n
\n \"\"\n
\n {!success ? (\n \n {form => (\n {\n e.preventDefault();\n e.stopPropagation();\n form.handleSubmit();\n }}\n >\n

Recupero password

\n\n form.setFieldValue('email', t.trim())} />\n form.setFieldValue('password', t)} />\n form.setFieldValue('passwordConfirm', t)}\n />\n
\n

\n {(error || Object.values(form.errors)[0]) ?? ''}\n

\n \n
\n \n )}\n
\n ) : (\n
\n

La tua password è stata modificata con successo!

\n
\n )}\n
\n
\n
\n );\n}\nexport default RecoveryPassword;\n","import React, { useEffect } from 'react';\nimport { BrowserRouter as Router, Switch, Route } from 'react-router-dom';\n\nimport './styles/index.css';\nimport './styles/globals.css';\n\nimport Recovery from 'pages/Recovery';\n\nfunction App() {\n return (\n \n \n \n \n \n );\n}\n\nexport default App;\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\ntype Config = {\n onSuccess?: (registration: ServiceWorkerRegistration) => void;\n onUpdate?: (registration: ServiceWorkerRegistration) => void;\n};\n\nexport function register(config?: 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(\n process.env.PUBLIC_URL,\n window.location.href\n );\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: string, config?: 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: string, config?: 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 App from './App';\nimport * as serviceWorker from './serviceWorker';\n\n\nReactDOM.render(\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\n\nserviceWorker.unregister();\n"],"sourceRoot":""}