{"version":3,"sources":["components/CustomSpinner.jsx","theme/palette.js","services/axios.config.js","redux/actions/portal.actions.js","routers/PrivateRoute.js","routers/PublicRoute.js","routers/AppRouter.js","theme/typography.js","theme/index.js","components/Snackbar.jsx","App.js","serviceWorkerRegistration.js","reportWebVitals.js","firebase/firebase.config.js","index.js","firebase/init-service-worker.js","config/config.js","routers/Routes.js","utils/constants.js","redux/actions/snackbar.actions.js","redux/reducers/auth.reducer.js","redux/reducers/snackbar.reducer.js","redux/reducers/properties.reducer.js","redux/reducers/beneficiaries.reducer.js","redux/reducers/profile.reducer.js","redux/reducers/catalogs.reducer.js","redux/reducers/portal.reducer.js","redux/reducers/token.reducer.js","redux/reducers/print.reducer.js","redux/root.reducers.js","redux/actions/token.actions.js","redux/store.js","services/warranty_api.js","utils/functions.js"],"names":["CustomSpinner","color","size","classes","useStyles","className","spinner_wrapper","spinner","style","makeStyles","height","display","flexDirection","justifyContent","alignSelf","palette","createTheme","text","secondary","primary","main","COLOR","PRIMARY","SECONDARY","dark","tertiary","quaternary","SKYBLUE","quinary","BLUE","textColor","GRAY","status","success","error","axios","interceptors","request","use","config","baseURL","BASE_URL","JwtToken","store","getState","token","tokens","headers","Authorization","Promise","reject","response","message","data","get","post","put","delete","patch","ACTION_TYPE","activateNewPortalUser","role","history","dispatch","a","type","approvePortalUserInvite","push","PATH","LOGIN","showSnackbar","PrivateRoute","isAuthenticated","setInactive","Component","component","rest","localStorage","setItem","location","pathname","useDispatch","useState","isTimeout","setIsTimeout","isInactive","useSelector","state","auth","idleTimer","useIdleTimer","onIdle","reset","timeout","start","pause","props","to","PublicRoute","DASHBOARD","HOME","Documents","lazy","DashboardRoutes","Tutorial","Login","ForgotPassword","ResetPassword","ApproveInvite","ApproveInvitePortal","AppRouter","Inactive","useEffect","ENABLE_NEW_DOMAIN_REDIRECT","window","hostname","match","newDomain","includes","url","URL","setTimeout","assign","redirectifNeeded","basename","process","fallback","Dialog","open","DialogTitle","id","Typography","variant","DialogContent","DialogActions","Button","onClick","path","FORGOTPASSWORD","DOCUMENTS","RESETPASSWORD","INVITE","INVITE_PORTAL","TUTORIAL","typography","fontFamily","join","h3","fontWeight","h4","h5","button","textTransform","themeConfig","overrides","MuiButton","raisedPrimary","contained","backgroundColor","outlined","breakpoints","values","xs","mobile","sm","md","lg","xl","SlideTransition","Slide","direction","SnackbarProvider","snackbar","snackbarMessage","snackbarType","snackbarOpen","handleClose","e","reason","clearSnackbar","Snackbar","anchorOrigin","vertical","horizontal","TransitionComponent","autoHideDuration","onClose","action","IconButton","Icon","elevation","severity","theme","up","fontSize","h6","responsiveTypography","responsiveFontSizes","queryClient","QueryClient","defaultOptions","queries","refetchOnWindowFocus","staleTime","keepPreviousData","App","client","persistor","ThemeProvider","isLocalhost","Boolean","registerValidSW","swUrl","navigator","serviceWorker","register","then","registration","onupdatefound","installingWorker","installing","onstatechange","controller","onUpdate","onSuccess","catch","console","reportWebVitals","onPerfEntry","Function","getCLS","getFID","getFCP","getLCP","getTTFB","firebaseConfig","apiKey","API_KEY","authDomain","AUTH_DOMAIN","projectId","PROJECT_ID","storageBucket","STORAGE_BUCKED","messagingSenderId","MESSAGING_SENDER_ID","appId","APP_ID","measurementId","MEASUREMENT_ID","firebaseInit","firebase","initializeApp","messaging","isSupported","ReactDOM","render","document","getElementById","href","origin","addEventListener","fetch","contentType","indexOf","ready","unregister","reload","checkValidServiceWorker","serviceWorkerRegistration","Error","credentials","useServiceWorker","requestPermission","getToken","vapidKey","CERTIFICATEPUSHWEB","removeItem","onMessage","payload","notificationTitle","notification","title","notificationOptions","body","Notification","getRegistrations","registrations","log","startMessaginSW","PROFILE","MAIN","EDIT","BENEFICIARIES","CREATE","PROPERTIES","UNITS","MANAGE_UNITS_IMAGES","CREATE_UNIT_IMAGES","CREATE_CASE","EDIT_CASE","SELECT_ROLE","PRINTCASES","REQUESTS","ORANGE","GREEN","RED","YELLOW","GREEN_DARK","DISABLED","DEFAULT","STATUS","RECIBIDO","EN_EVALUACION","INSPECCION_PROGRAMADA","EN_ESPERA","REPARACION","EN_EJECUCION","COMPLETADO","CERRADO","mainMenu","icon","showLogo","restriction","mustHaveReferenceId","onlyTo","tutorialSteps","label","anim","key","photo","charts","RelationshipTypes","value","initState","isValidUser","isRegisterUser","user","Name","Roles","RolSalesForce","activeRole","resetEmailSend","resetSuccess","isLoading","settingUser","produce","draft","setAutoFreeze","currentProperty","currentUnit","cases","currentCase","caseForm","description","unit_id","files","isPunchLine","caseFormUpdate","selectedImages","gettingUnitCases","creatingCase","updatingCase","deletingCase","filteringUnit","properties","images","filter","c","Id","i","sort","b","length","splice","isSelected","index","val","beneficiaries","currentBeneficiary","getBeneficiaries","creatingBeneficiaries","profile_form","name","surname","phone","email","avatar","customProfileImage","updating_profile","profile","loadingCatalogs","avatars","catalogs","creatingPortalUser","getActions","actions","CREATE_PORTAL_USER_START","CREATE_PORTAL_USER_END","default","portal","change","base64","print","appReducer","combineReducers","rootReducer","sessionStorage","undefined","refreshTokenAction","refresh_Token","refreshToken","RefreshToken","persistConfig","storage","middlewares","thunk","promise","persistedReducer","persistReducer","reducers","createStore","compose","applyMiddleware","persistStore","setInterval","verifyEmail","Email","signInUser","Password","password","FirebaseDeviceCode","getItem","signUpUser","ConfirmPassword","confirmPassword","hasCheckedTermsAndConditions","refreshTok","generatePDF","_data","ReportInitialDate","initialDate","ReportFinalDate","finalDate","AssetId","AccountId","AssetName","generatePdfFromCases","CasesId","forgotPassword","resetPassword","Token","getUserUnits","account_id","params","rol","getWarrantyRole","referenceId","getAssetsCommercial","page","ReferenceId","pageSize","getAssetsResidential","getBeneficiaryUnits","getUnitMaintenanceCases","getUnitCases","active_role","createMaintenanceCase","report","allFiles","formData","FormData","forEach","file","append","dataURLtoFile","imgBase64","ext","accountId","correoCreador","nombreCreador","telefonoCreador","createUnitCase","updateUnitCase","updateUnitMaintenanceCase","CaseId","Description","EsPunchLine","DocumentacionDelCaso","settings","AllowEmailNotification","checkedEmail","AllowPushNotification","checkedNotification","deleteUnitCase","case_id","uploadCaseImages","caseId","image","src","getCaseImagesId","getCaseImagesFile","fileId","createBeneficiary","beneficiary","Relationship","user_type","PhoneNumber","BeneficiaryInviteAssets","assets","updateBeneficiary","identity","ownerId","beneficiaryId","approveBeneficiaryInvite","Role","addBeneficiaryAssets","deleteBeneficiaryAssets","deleteBeneficiary","updateUser","FirstName","LastName","AvatarId","split","getAvatarsCatalog","getDocuments","dataurl","filename","arr","mime","bstr","atob","n","u8arr","Uint8Array","charCodeAt","File","CheckRoles","restrictions","isValid","restrinction","GetAvatarURL","find"],"mappings":"sHAAA,oEAGe,SAASA,EAAT,GAAyC,IAAhBC,EAAe,EAAfA,MAAOC,EAAQ,EAARA,KACvCC,EAAUC,IAEhB,OACE,qBAAKC,UAAWF,EAAQG,gBAAxB,SACE,cAAC,IAAD,CACED,UAAWF,EAAQI,QACnBC,MAAOP,GAAS,CAAEA,SAClBC,KAAMA,GAAQ,GACdD,MAAM,gBAMd,IAAMG,EAAYK,aAAW,iBAAO,CAClCH,gBAAiB,CACfI,OAAQ,OACRC,QAAS,OACTC,cAAe,SACfC,eAAgB,UAElBN,QAAS,CACPO,UAAW,e,iCC1Bf,qBAKMC,GAF4BC,cAA1BD,QAEQ,CACdE,KAAM,CAEJC,UAAW,WAEbC,QAAS,CACPC,KAAMC,IAAMC,SAEdJ,UAAW,CACTE,KAAMC,IAAME,UAEZC,KAAM,WAERC,SAAU,CAAEL,KAAM,WAClBM,WAAY,CAAEN,KAAMC,IAAMM,SAC1BC,QAAS,CAAER,KAAMC,IAAMQ,MACvBC,UAAW,CAAEV,KAAMC,IAAMU,MACzBC,OAAQ,CACNC,QAAS,UACTC,MAAO,aAIInB,O,gCC5Bf,qCAIAoB,IAAMC,aAAaC,QAAQC,KACzB,SAAUC,GACRA,EAAOC,QAAUC,IAEjB,IAEcC,EAEVC,IAAMC,WAHRC,MACEC,OAAUJ,SAMd,OAFIA,IAAUH,EAAOQ,QAAQC,cAAf,iBAAyCN,IAEhDH,KAET,SA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AAoB,SAAAL,GAC/B,OAAO9d,IAAMsB,OAAN,4CAAkDwc,KAG9CM,EAAa,SAAAtL,GACxB,OAAO9S,IAAMqB,IAAN,mCACLgd,UAAWvL,EAAKuL,UAChBC,SAAUxL,EAAKwL,SACfd,YAAa1K,EAAK0K,YAClBe,SAAUzL,EAAKyL,SACftI,mBAAoBnD,EAAKmD,mBAAL,2BAEXnD,EAAKmD,oBAFM,IAGdwF,UAAW3I,EAAKmD,mBAAmBwF,UAAU+C,MAAM,KAAK,KAE1D,MACA1L,EAAKmG,6BAA+B,CAAEA,8BAA8B,GAAS,MAIxEwF,EAAoB,WAC/B,OAAOze,IAAMmB,IAAI,YAGNud,EAAe,SAAApM,GAC1B,OAAOtS,IAAMmB,IAAN,wCAA2CmR,M,gCCnUpD,sGAAO,IAAMkJ,EAAgB,SAACmD,EAASC,GAOrC,IANA,IAAIC,EAAMF,EAAQH,MAAM,KACtBM,EAAOD,EAAI,GAAG5Z,MAAM,WAAW,GAC/B8Z,EAAOC,KAAKH,EAAI,IAChBI,EAAIF,EAAK7J,OACTgK,EAAQ,IAAIC,WAAWF,GAElBA,KACLC,EAAMD,GAAKF,EAAKK,WAAWH,GAG7B,OAAO,IAAII,KAAK,CAACH,GAAQN,EAAU,CAAE9c,KAAMgd,KAGhCQ,EAAa,SAACpM,EAAYqM,EAActN,EAAqBwI,EAAavI,GACrF,IAAIsN,GAAU,EAEd,OAAItN,EACKA,GAAUgB,GAGfjB,IAAwBwI,IAC1B+E,GAAU,GAGZD,EAAalE,SAAQ,SAAAoE,GACfvM,IAAeuM,IAAcD,GAAU,MAGtCA,IAGIE,EAAe,SAACrJ,EAAStQ,GACpC,OAAc,OAAPsQ,QAAO,IAAPA,OAAA,EAAAA,EAASsJ,MAAK,SAAA3J,GAAM,OAAIA,EAAOlB,KAAO/O,OAAO,Q","file":"static/js/main.b0a3de22.chunk.js","sourcesContent":["import React from \"react\";\r\nimport { makeStyles, CircularProgress } from \"@material-ui/core\";\r\n\r\nexport default function CustomSpinner({ color, size }) {\r\n const classes = useStyles();\r\n\r\n return (\r\n
\r\n \r\n
\r\n );\r\n}\r\n\r\nconst useStyles = makeStyles(() => ({\r\n spinner_wrapper: {\r\n height: \"100%\",\r\n display: \"flex\",\r\n flexDirection: \"column\",\r\n justifyContent: \"center\",\r\n },\r\n spinner: {\r\n alignSelf: \"center\",\r\n },\r\n}));\r\n","import { createTheme } from \"@material-ui/core\";\r\nimport { COLOR } from \"../utils/constants\";\r\n\r\nconst { palette: paletteExtra } = createTheme();\r\n\r\nconst palette = {\r\n text: {\r\n // primary: COLOR.DEFAULT,\r\n secondary: \"#1a2e59\",\r\n },\r\n primary: {\r\n main: COLOR.PRIMARY,\r\n },\r\n secondary: {\r\n main: COLOR.SECONDARY,\r\n // main: \"#FFC82C\",\r\n dark: \"#f5ac0c\",\r\n },\r\n tertiary: { main: \"#1a2e59\" },\r\n quaternary: { main: COLOR.SKYBLUE },\r\n quinary: { main: COLOR.BLUE },\r\n textColor: { main: COLOR.GRAY },\r\n status: {\r\n success: \"#77D353\",\r\n error: \"#F95F62\",\r\n },\r\n};\r\n\r\nexport default palette;\r\n","import axios from \"axios\";\r\nimport { store } from \"../redux/store\";\r\nimport { BASE_URL } from \"../config/config\";\r\n\r\naxios.interceptors.request.use(\r\n function (config) {\r\n config.baseURL = BASE_URL;\r\n\r\n const {\r\n token: {\r\n tokens: { JwtToken },\r\n },\r\n } = store.getState();\r\n\r\n if (JwtToken) config.headers.Authorization = `Bearer ${JwtToken}`;\r\n\r\n return config;\r\n },\r\n function (error) {\r\n return Promise.reject(error);\r\n }\r\n);\r\n\r\naxios.interceptors.response.use(\r\n response => response,\r\n error => {\r\n let message = \"Ha ocurrido un error\";\r\n\r\n if (error.response) {\r\n const { status, data } = error.response;\r\n\r\n if (status === 401) {\r\n // store.dispatch(userLogIn({}))\r\n // message = \"Su sesión ha expirado\";\r\n // store.dispatch({ type: \"USER_LOGOUT\" });\r\n } else if (data && status !== 401) message = data[0];\r\n else if (status > 500) message = \"Network Error\";\r\n }\r\n\r\n return Promise.reject(message);\r\n }\r\n);\r\n\r\nexport default {\r\n get: axios.get,\r\n post: axios.post,\r\n put: axios.put,\r\n delete: axios.delete,\r\n patch: axios.patch,\r\n};\r\n","import { PATH } from \"../../routers/Routes\";\r\nimport { approvePortalUserInvite } from \"../../services/warranty_api\";\r\nimport { showSnackbar } from \"./snackbar.actions\";\r\n\r\nexport const ACTION_TYPE = {\r\n CREATE_PORTAL_USER_START: \"CREATE_PORTAL_USER_START\",\r\n CREATE_PORTAL_USER_END: \"CREATE_PORTAL_USER_END\",\r\n};\r\n\r\nexport const activateNewPortalUser = (token, role, history) => {\r\n return async dispatch => {\r\n dispatch({ type: ACTION_TYPE.CREATE_PORTAL_USER_START });\r\n try {\r\n await approvePortalUserInvite(token, role);\r\n } catch (error) {\r\n history.push(PATH.LOGIN);\r\n dispatch(showSnackbar(error, \"error\"));\r\n }\r\n dispatch({ type: ACTION_TYPE.CREATE_PORTAL_USER_END });\r\n };\r\n};\r\n","import PropTypes from \"prop-types\";\r\nimport { useState } from \"react\";\r\nimport { useIdleTimer } from \"react-idle-timer\";\r\nimport { useDispatch, useSelector } from \"react-redux\";\r\nimport { Redirect, Route } from \"react-router-dom\";\r\nimport { PATH } from \"./Routes\";\r\n\r\nconst PrivateRoute = ({ isAuthenticated, setInactive, component: Component, ...rest }) => {\r\n localStorage.setItem(\"lastPath\", rest.location.pathname);\r\n\r\n const dispatch = useDispatch();\r\n const [isTimeout, setIsTimeout] = useState(false);\r\n const { isInactive } = useSelector(state => state.auth);\r\n const onIdle = () => {\r\n dispatch({ type: \"USER_ONIDLE\" });\r\n setInactive(true);\r\n\r\n if (isTimeout && isInactive) {\r\n dispatch({ type: \"USER_ACTIVE\" });\r\n setInactive(false);\r\n dispatch({ type: \"USER_LOGOUT\" });\r\n return;\r\n }\r\n\r\n reset();\r\n setIsTimeout(true);\r\n };\r\n\r\n let idleTimer = useIdleTimer({ onIdle: onIdle, timeout: 300000 });\r\n const { reset, start, pause } = idleTimer;\r\n isAuthenticated ? start : pause;\r\n return (\r\n \r\n isAuthenticated ? : \r\n }\r\n />\r\n );\r\n};\r\n\r\nPrivateRoute.propTypes = {\r\n isAuthenticated: PropTypes.bool.isRequired,\r\n component: PropTypes.object.isRequired,\r\n setInactive: PropTypes.bool.isRequired,\r\n};\r\n\r\nexport default PrivateRoute;\r\n","import PropTypes from \"prop-types\";\r\nimport { useState } from \"react\";\r\nimport { useIdleTimer } from \"react-idle-timer\";\r\nimport { useDispatch, useSelector } from \"react-redux\";\r\nimport { Redirect, Route } from \"react-router-dom\";\r\nimport { PATH } from \"./Routes\";\r\n\r\nconst PublicRoute = ({ isAuthenticated, setInactive, component: Component, ...rest }) => {\r\n const { DASHBOARD } = PATH;\r\n\r\n const dispatch = useDispatch();\r\n const [isTimeout, setIsTimeout] = useState(false);\r\n const { isInactive } = useSelector(state => state.auth);\r\n const onIdle = () => {\r\n dispatch({ type: \"USER_ONIDLE\" });\r\n setInactive(true);\r\n\r\n if (isTimeout && isInactive) {\r\n dispatch({ type: \"USER_ACTIVE\" });\r\n setInactive(false);\r\n dispatch({ type: \"USER_LOGOUT\" });\r\n return;\r\n }\r\n\r\n reset();\r\n setIsTimeout(true);\r\n };\r\n\r\n let idleTimer = useIdleTimer({ onIdle: onIdle, timeout: 300000 });\r\n const { reset, start, pause } = idleTimer;\r\n isAuthenticated ? start : pause;\r\n return (\r\n \r\n !isAuthenticated ? : \r\n }\r\n />\r\n );\r\n};\r\n\r\nPublicRoute.propTypes = {\r\n isAuthenticated: PropTypes.bool.isRequired,\r\n component: PropTypes.object.isRequired,\r\n setInactive: PropTypes.bool.isRequired,\r\n};\r\n\r\nexport default PublicRoute;\r\n","import React, { Suspense, useEffect, useState } from \"react\";\r\nimport { useDispatch, useSelector } from \"react-redux\";\r\nimport { BrowserRouter as Router, Route, Switch } from \"react-router-dom\";\r\nimport PrivateRoute from \"./PrivateRoute\";\r\nimport PublicRoute from \"./PublicRoute\";\r\nimport CustomSpinner from \"../components/CustomSpinner\";\r\nimport { lazy } from \"@loadable/component\";\r\nimport { PATH } from \"./Routes\";\r\nimport {\r\n Button,\r\n Dialog,\r\n DialogActions,\r\n DialogContent,\r\n DialogTitle,\r\n Typography,\r\n} from \"@material-ui/core\";\r\nimport { showSnackbar } from \"../redux/actions/snackbar.actions\";\r\nimport { ENABLE_NEW_DOMAIN_REDIRECT, newDomain } from \"../config/config\";\r\n\r\nconst Documents = lazy(() => import(\"../screens/Documents/Documents\"));\r\nconst DashboardRoutes = lazy(() => import(\"./DashboardRoutes\"));\r\nconst Tutorial = lazy(() => import(\"../screens/Tutorial\"));\r\nconst Login = lazy(() => import(\"../screens/Login\"));\r\nconst ForgotPassword = lazy(() => import(\"../screens/ForgotPassword\"));\r\nconst ResetPassword = lazy(() => import(\"../screens/ResetPassword\"));\r\nconst ApproveInvite = lazy(() => import(\"../screens/ApproveInvite\"));\r\nconst ApproveInvitePortal = lazy(() => import(\"../screens/ApproveInvitePortal\"));\r\n\r\nconst baseURL = process.env.PUBLIC_URL;\r\n\r\nconst AppRouter = () => {\r\n const { isAuthenticated } = useSelector(state => state.auth);\r\n const [Inactive, setInactive] = useState(false);\r\n\r\n const dispatch = useDispatch();\r\n\r\n const handleLogout = () => {\r\n dispatch({ type: \"USER_LOGOUT\" });\r\n setInactive(false);\r\n };\r\n\r\n const handleContinueBrowsing = () => {\r\n dispatch({ type: \"USER_ACTIVE\" });\r\n setInactive(false);\r\n };\r\n\r\n const redirectifNeeded = () => {\r\n if (\r\n ENABLE_NEW_DOMAIN_REDIRECT !== \"true\" ||\r\n window.location.hostname.match(/(\\d{1,3}\\.){3}\\d{1,3}/) ||\r\n window.location.hostname === \"localhost\" ||\r\n newDomain.includes(window.location.hostname)\r\n ) {\r\n return;\r\n }\r\n const url = new URL(newDomain);\r\n dispatch(showSnackbar(`¡Redireccionando a ${url.hostname}!`, \"info\"));\r\n setTimeout(() => {\r\n window.location.assign(newDomain);\r\n }, 3000);\r\n };\r\n useEffect(() => {\r\n redirectifNeeded();\r\n }, []);\r\n\r\n return (\r\n \r\n }>\r\n {isAuthenticated ? (\r\n \r\n \r\n ¡La sesión va a cerrarse!\r\n \r\n \r\n \r\n Se ha detectado inactividad, ¿qué acción desea realizar?\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ) : null}\r\n \r\n \r\n\r\n \r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n {/*TODO: Configurar `NotFound`, para no dejar en blanco pagina */}\r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default AppRouter;\r\n","import { COLOR } from \"../utils/constants\";\r\n\r\nconst typography = {\r\n fontFamily: [\"Lato\", \"sans-serif\"].join(\",\"),\r\n h3: {\r\n fontWeight: 300,\r\n color: COLOR.PRIMARY,\r\n },\r\n h4: {\r\n fontWeight: 700,\r\n color: COLOR.PRIMARY,\r\n },\r\n h5: {\r\n fontWeight: 500,\r\n color: COLOR.GRAY,\r\n },\r\n button: {\r\n textTransform: \"none\",\r\n },\r\n};\r\n\r\n//Helper to setup responsive for the typography font size\r\nconst responsiveTypography = theme => {\r\n (theme.typography.h3 = {\r\n [theme.breakpoints.up(\"xs\")]: {\r\n ...theme.typography.h3,\r\n fontSize: \"1.35rem\",\r\n },\r\n [theme.breakpoints.up(\"mobile\")]: {\r\n ...theme.typography.h3,\r\n fontSize: \"1.35rem\",\r\n },\r\n [theme.breakpoints.up(\"sm\")]: {\r\n ...theme.typography.h3,\r\n fontSize: \"2.3rem !important\",\r\n },\r\n }),\r\n (theme.typography.h4 = {\r\n [theme.breakpoints.up(\"xs\")]: {\r\n ...theme.typography.h4,\r\n fontSize: \"1rem\",\r\n },\r\n [theme.breakpoints.up(\"mobile\")]: {\r\n ...theme.typography.h4,\r\n fontSize: \"1.2rem\",\r\n },\r\n [theme.breakpoints.up(\"sm\")]: {\r\n ...theme.typography.h4,\r\n fontSize: \"1.5rem !important\",\r\n },\r\n }),\r\n (theme.typography.h5 = {\r\n [theme.breakpoints.up(\"xs\")]: {\r\n ...theme.typography.h5,\r\n fontSize: \"0.8rem\",\r\n },\r\n [theme.breakpoints.up(\"mobile\")]: {\r\n ...theme.typography.h5,\r\n fontSize: \"1rem\",\r\n },\r\n }),\r\n (theme.typography.h6 = {\r\n [theme.breakpoints.up(\"xs\")]: {\r\n ...theme.typography.h6,\r\n fontSize: \"0.6rem\",\r\n },\r\n [theme.breakpoints.up(\"mobile\")]: {\r\n ...theme.typography.h6,\r\n fontSize: \"0.8rem\",\r\n },\r\n });\r\n};\r\n\r\nexport { typography, responsiveTypography };\r\n","import { COLOR } from \"../utils/constants\";\r\nimport palette from \"./palette\";\r\nimport { typography } from \"./typography\";\r\n\r\nconst themeConfig = {\r\n overrides: {\r\n MuiButton: {\r\n raisedPrimary: {\r\n color: \"white\",\r\n },\r\n contained: {\r\n \"&:hover\": {\r\n backgroundColor: `${COLOR.SKYBLUE} !important`,\r\n },\r\n },\r\n outlined: {\r\n \"&:hover\": {\r\n backgroundColor: `${COLOR.SKYBLUE} !important`,\r\n },\r\n },\r\n },\r\n },\r\n palette,\r\n typography,\r\n breakpoints: {\r\n values: {\r\n xs: 0,\r\n mobile: 340,\r\n sm: 600,\r\n md: 960,\r\n lg: 1280,\r\n xl: 1920,\r\n },\r\n },\r\n};\r\n\r\nexport default themeConfig;\r\n","import React from \"react\";\r\nimport { useDispatch, useSelector } from \"react-redux\";\r\nimport Snackbar from \"@material-ui/core/Snackbar\";\r\nimport MuiAlert from \"@material-ui/lab/Alert\";\r\nimport IconButton from \"@material-ui/core/IconButton\";\r\nimport { Icon } from \"@material-ui/core\";\r\nimport { clearSnackbar } from \"../redux/actions/snackbar.actions\";\r\n\r\nimport Slide from \"@material-ui/core/Slide\";\r\n\r\nfunction SlideTransition(props) {\r\n return ;\r\n}\r\n\r\nexport default function SnackbarProvider() {\r\n const dispatch = useDispatch();\r\n\r\n const { snackbarMessage, snackbarType, snackbarOpen } = useSelector(state => state.snackbar);\r\n\r\n const handleClose = (e, reason) => {\r\n reason !== \"clickaway\" && dispatch(clearSnackbar());\r\n };\r\n\r\n return (\r\n \r\n close\r\n ,\r\n ]}\r\n >\r\n \r\n {snackbarMessage}\r\n \r\n \r\n );\r\n}\r\n","import { ThemeProvider, responsiveFontSizes, createTheme } from \"@material-ui/core/styles\";\r\n\r\nimport AppRouter from \"./routers/AppRouter\";\r\nimport themeConfig from \"./theme\";\r\nimport { responsiveTypography } from \"./theme/typography\";\r\nimport { Provider } from \"react-redux\";\r\nimport { persistor, store } from \"./redux/store\";\r\nimport { PersistGate } from \"redux-persist/integration/react\";\r\nimport { QueryClient, QueryClientProvider } from \"react-query\";\r\nimport SnackbarProvider from \"./components/Snackbar\";\r\n\r\nlet theme = createTheme(themeConfig);\r\ntheme = responsiveFontSizes(theme);\r\nresponsiveTypography(theme);\r\nconst queryClient = new QueryClient({\r\n defaultOptions: {\r\n queries: {\r\n refetchOnWindowFocus: false,\r\n staleTime: 1000 * 60,\r\n keepPreviousData: true,\r\n },\r\n },\r\n});\r\n\r\n/**TODO: Agregar un ErrorBoundary */\r\n\r\nconst App = () => {\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default App;\r\n","// This optional code is used to register a service worker.\r\n// register() is not called by default.\r\n\r\n// This lets the app load faster on subsequent visits in production, and gives\r\n// it offline capabilities. However, it also means that developers (and users)\r\n// will only see deployed updates on subsequent visits to a page, after all the\r\n// existing tabs open on the page have been closed, since previously cached\r\n// resources are updated in the background.\r\n\r\n// To learn more about the benefits of this model and instructions on how to\r\n// opt-in, read https://cra.link/PWA\r\n\r\nconst isLocalhost = Boolean(\r\n window.location.hostname === \"localhost\" ||\r\n // [::1] is the IPv6 localhost address.\r\n window.location.hostname === \"[::1]\" ||\r\n // 127.0.0.0/8 are considered localhost for IPv4.\r\n window.location.hostname.match(/^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/)\r\n);\r\n\r\nexport function register(config) {\r\n if (process.env.NODE_ENV === \"production\" && \"serviceWorker\" in navigator) {\r\n // The URL constructor is available in all browsers that support SW.\r\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\r\n if (publicUrl.origin !== window.location.origin) {\r\n // Our service worker won't work if PUBLIC_URL is on a different origin\r\n // from what our page is served on. This might happen if a CDN is used to\r\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\r\n return;\r\n }\r\n\r\n window.addEventListener(\"load\", () => {\r\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\r\n\r\n if (isLocalhost) {\r\n // This is running on localhost. Let's check if a service worker still exists or not.\r\n checkValidServiceWorker(swUrl, config);\r\n\r\n // Add some additional logging to localhost, pointing developers to the\r\n // service worker/PWA documentation.\r\n navigator.serviceWorker.ready.then(() => {\r\n // console.log(\r\n // \"This web app is being served cache-first by a service \" +\r\n // \"worker. To learn more, visit https://cra.link/PWA\"\r\n // );\r\n });\r\n } else {\r\n // Is not localhost. Just register service worker\r\n registerValidSW(swUrl, config);\r\n }\r\n });\r\n }\r\n}\r\n\r\nfunction registerValidSW(swUrl, config) {\r\n navigator.serviceWorker\r\n .register(swUrl)\r\n .then(registration => {\r\n registration.onupdatefound = () => {\r\n const installingWorker = registration.installing;\r\n if (installingWorker == null) {\r\n return;\r\n }\r\n installingWorker.onstatechange = () => {\r\n if (installingWorker.state === \"installed\") {\r\n if (navigator.serviceWorker.controller) {\r\n // At this point, the updated precached content has been fetched,\r\n // but the previous service worker will still serve the older\r\n // content until all client tabs are closed.\r\n // console.log(\r\n // \"New content is available and will be used when all \" +\r\n // \"tabs for this page are closed. See https://cra.link/PWA.\"\r\n // );\r\n\r\n // Execute callback\r\n if (config && config.onUpdate) {\r\n config.onUpdate(registration);\r\n }\r\n } else {\r\n // At this point, everything has been precached.\r\n // It's the perfect time to display a\r\n // \"Content is cached for offline use.\" message.\r\n // console.log(\"Content is cached for offline use.\");\r\n\r\n // Execute callback\r\n if (config && config.onSuccess) {\r\n config.onSuccess(registration);\r\n }\r\n }\r\n }\r\n };\r\n };\r\n })\r\n .catch(error => {\r\n console.error(\"Error during service worker registration:\", error);\r\n });\r\n}\r\n\r\nfunction checkValidServiceWorker(swUrl, config) {\r\n // Check if the service worker can be found. If it can't reload the page.\r\n fetch(swUrl, {\r\n headers: { \"Service-Worker\": \"script\" },\r\n })\r\n .then(response => {\r\n // Ensure service worker exists, and that we really are getting a JS file.\r\n const contentType = response.headers.get(\"content-type\");\r\n if (\r\n response.status === 404 ||\r\n (contentType != null && contentType.indexOf(\"javascript\") === -1)\r\n ) {\r\n // No service worker found. Probably a different app. Reload the page.\r\n navigator.serviceWorker.ready.then(registration => {\r\n registration.unregister().then(() => {\r\n window.location.reload();\r\n });\r\n });\r\n } else {\r\n // Service worker found. Proceed as normal.\r\n registerValidSW(swUrl, config);\r\n }\r\n })\r\n .catch(() => {\r\n // console.log(\"No internet connection found. App is running in offline mode.\");\r\n });\r\n}\r\n\r\nexport function unregister() {\r\n if (\"serviceWorker\" in navigator) {\r\n navigator.serviceWorker.ready\r\n .then(registration => {\r\n registration.unregister();\r\n })\r\n .catch(error => {\r\n console.error(error.message);\r\n });\r\n }\r\n}\r\n","const reportWebVitals = onPerfEntry => {\r\n if (onPerfEntry && onPerfEntry instanceof Function) {\r\n import(\"web-vitals\").then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {\r\n getCLS(onPerfEntry);\r\n getFID(onPerfEntry);\r\n getFCP(onPerfEntry);\r\n getLCP(onPerfEntry);\r\n getTTFB(onPerfEntry);\r\n });\r\n }\r\n};\r\n\r\nexport default reportWebVitals;\r\n","import firebase from \"firebase\";\r\nimport {\r\n API_KEY,\r\n APP_ID,\r\n AUTH_DOMAIN,\r\n MEASUREMENT_ID,\r\n MESSAGING_SENDER_ID,\r\n PROJECT_ID,\r\n STORAGE_BUCKED,\r\n} from \"../config/config\";\r\n\r\nconst firebaseConfig = {\r\n apiKey: API_KEY,\r\n authDomain: AUTH_DOMAIN,\r\n projectId: PROJECT_ID,\r\n storageBucket: STORAGE_BUCKED,\r\n messagingSenderId: MESSAGING_SENDER_ID,\r\n appId: APP_ID,\r\n measurementId: MEASUREMENT_ID,\r\n};\r\n\r\nconst firebaseInit = firebase.initializeApp(firebaseConfig);\r\nconst messaging = firebase.messaging.isSupported()\r\n ? firebase.messaging(firebaseInit)\r\n : null;\r\n\r\nexport default messaging;\r\n","import React from \"react\";\r\nimport ReactDOM from \"react-dom\";\r\nimport \"./index.css\";\r\nimport App from \"./App\";\r\nimport * as serviceWorkerRegistration from \"./serviceWorkerRegistration\";\r\nimport reportWebVitals from \"./reportWebVitals\";\r\nimport \"./custom.scss\";\r\nimport { startMessaginSW } from \"./firebase/init-service-worker\";\r\n\r\nReactDOM.render(, document.getElementById(\"root\"));\r\n\r\n// If you want your app to work offline and load faster, you can change\r\n// unregister() to register() below. Note this comes with some pitfalls.\r\n// Learn more about service workers: https://cra.link/PWA\r\ntry{\r\n serviceWorkerRegistration.register();\r\n startMessaginSW();\r\n\r\n}catch(e){\r\n console.log(e)\r\n}\r\n\r\n// If you want to start measuring performance in your app, pass a function\r\n// to log results (for example: reportWebVitals(console.log))\r\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\r\nreportWebVitals();\r\n","import messaging from \"./firebase.config\";\r\nimport { store } from \"../redux/store\";\r\nimport { showSnackbar } from \"../redux/actions/snackbar.actions\";\r\nimport {\r\n API_KEY,\r\n AUTH_DOMAIN,\r\n PROJECT_ID,\r\n STORAGE_BUCKED,\r\n MESSAGING_SENDER_ID,\r\n APP_ID,\r\n MEASUREMENT_ID,\r\n CERTIFICATEPUSHWEB,\r\n} from \"../config/config\";\r\n\r\nexport const startMessaginSW = () => {\r\n if (!(\"serviceWorker\" in navigator)) {\r\n throw new Error(\"serviceWorker API not support\");\r\n }\r\n\r\n window.addEventListener(\"load\", () => {\r\n const {\r\n auth: { isAuthenticated },\r\n } = store.getState();\r\n\r\n const credentials = [\r\n API_KEY,\r\n AUTH_DOMAIN,\r\n PROJECT_ID,\r\n STORAGE_BUCKED,\r\n MESSAGING_SENDER_ID,\r\n APP_ID,\r\n MEASUREMENT_ID,\r\n ];\r\n if (messaging) {\r\n navigator.serviceWorker\r\n .register(\r\n `${process.env.PUBLIC_URL}/firebase-messaging-sw.js?messagingSenderId=${credentials}`,\r\n )\r\n .then((registration) => {\r\n messaging.useServiceWorker(registration);\r\n\r\n if (!isAuthenticated) {\r\n messaging\r\n .requestPermission()\r\n .then(() => {\r\n return messaging.getToken(messaging, {\r\n vapidKey: CERTIFICATEPUSHWEB,\r\n });\r\n })\r\n .then((data) => {\r\n localStorage.setItem(\"Token\", data);\r\n return;\r\n })\r\n .catch(() => {\r\n localStorage.removeItem(\"Token\");\r\n store.dispatch(\r\n showSnackbar(\r\n \"¡Active las notificaciones del navegador!\",\r\n \"warning\",\r\n ),\r\n );\r\n });\r\n }\r\n\r\n messaging.onMessage((payload) => {\r\n const notificationTitle = payload.notification.title;\r\n const notificationOptions = { body: payload.notification.body };\r\n return new Notification(notificationTitle, notificationOptions);\r\n });\r\n });\r\n }\r\n });\r\n\r\n navigator.serviceWorker.getRegistrations().then(function (registrations) {\r\n for (let registration of registrations) {\r\n registration.unregister();\r\n }\r\n }).catch(console.log);\r\n};\r\n","export const ENVIRONMENT = process.env.REACT_APP_ENVIRONMENT;\r\nexport const BASE_URL = process.env.REACT_APP_BASE_URL;\r\nexport const API_KEY = process.env.REACT_APP_API_KEY;\r\nexport const AUTH_DOMAIN = process.env.REACT_APP_AUTH_DOMAIN;\r\nexport const PROJECT_ID = process.env.REACT_APP_PROJECT_ID;\r\nexport const STORAGE_BUCKED = process.env.REACT_APP_STORAGE_BUCKED;\r\nexport const MESSAGING_SENDER_ID = process.env.REACT_APP_MESSAGING_SENDER_ID;\r\nexport const APP_ID = process.env.REACT_APP_APPID;\r\nexport const MEASUREMENT_ID = process.env.REACT_APP_MEASUREMENT_ID;\r\nexport const CERTIFICATEPUSHWEB = process.env.CERTIFICATEPUSHWEB;\r\nexport const ENABLE_NEW_DOMAIN_REDIRECT = process.env.REACT_APP_ENABLE_NEW_DOMAIN_REDIRECT;\r\n\r\nexport const newDomain =\r\n ENVIRONMENT === \"qa\" || ENVIRONMENT === \"dev\"\r\n ? \"https://qa.conecta.panamapacifico.com/WarrantyApp/\"\r\n : \"https://conecta.panamapacifico.com/WarrantyApp/\";\r\n","const PATH = {\r\n DASHBOARD: {\r\n HOME: \"/\",\r\n PROFILE: {\r\n MAIN: \"/profile\",\r\n EDIT: \"/profile/edit\",\r\n },\r\n BENEFICIARIES: {\r\n MAIN: \"/beneficiaries\",\r\n CREATE: \"/beneficiaries/create\",\r\n EDIT: \"/beneficiaries/edit\",\r\n },\r\n PROPERTIES: \"/properties/:id\",\r\n UNITS: \"/units/:id\",\r\n MANAGE_UNITS_IMAGES: \"/manageImages\",\r\n CREATE_UNIT_IMAGES: \"/manageImages/create\",\r\n CREATE_CASE: \"/case/create\",\r\n EDIT_CASE: \"/case/edit/:id\",\r\n SELECT_ROLE: \"/select-role\",\r\n PRINTCASES: \"/printCases\",\r\n REQUESTS: {\r\n CREATE: \"/requests/create\",\r\n MAIN: \"/requests\",\r\n },\r\n },\r\n LOGIN: \"/login\",\r\n FORGOTPASSWORD: \"/forgot-password\",\r\n RESETPASSWORD: \"/reset-password/:email/:token\",\r\n INVITE: \"/invite/\",\r\n INVITE_PORTAL: \"/invitePortal/\",\r\n TUTORIAL: \"/tutorial\",\r\n DOCUMENTS: \"/DocumentsView\",\r\n};\r\n\r\nexport { PATH };\r\n","import {\r\n HomeWorkOutlined,\r\n SupervisedUserCircleOutlined,\r\n AccountCircleOutlined,\r\n Queue,\r\n PermMedia,\r\n} from \"@material-ui/icons\";\r\nimport key from \"../assets/animations/key.json\";\r\nimport photo from \"../assets/animations/photo_uploading.json\";\r\nimport charts from \"../assets/animations/charts.json\";\r\nimport { PATH } from \"../routers/Routes\";\r\n\r\nconst { DASHBOARD } = PATH;\r\n\r\nconst COLOR = {\r\n PRIMARY: \"#4bb94d\",\r\n SECONDARY: \"#4bb94d\",\r\n BLUE: \"#0f753a\",\r\n ORANGE: \"#FF8200\",\r\n GREEN: \"#43B02A\",\r\n RED: \"#DA291C\",\r\n YELLOW: \"#FFB81C\",\r\n GREEN_DARK: \"#009639\",\r\n GRAY: \"#959499\",\r\n DISABLED: \"rgba(95, 95, 95, 0.64)\",\r\n DEFAULT: \"#FFFFFF\",\r\n SKYBLUE: \"#01acef\",\r\n};\r\n\r\nconst STATUS = {\r\n RECIBIDO: \"Recibido\",\r\n EN_EVALUACION: \"En evaluación\",\r\n INSPECCION_PROGRAMADA: \"Inspección programada\",\r\n EN_ESPERA: \"En espera de insumos\",\r\n REPARACION: \"Reparación programada\",\r\n EN_EJECUCION: \"En ejecución\",\r\n COMPLETADO: \"Trabajo completado\",\r\n CERRADO: \"Caso cerrado\",\r\n};\r\n\r\nconst mainMenu = [\r\n {\r\n title: \"Mis Propiedades\",\r\n path: DASHBOARD.HOME,\r\n icon: ,\r\n showLogo: true,\r\n restriction: [],\r\n },\r\n {\r\n title: \"Invitados\",\r\n path: DASHBOARD.BENEFICIARIES.MAIN,\r\n icon: ,\r\n restriction: [\"Beneficiary\", \"Administrator\", \"HelpDesk\", \"Supervisor\"],\r\n },\r\n {\r\n title: \"Solicitudes\",\r\n path: DASHBOARD.REQUESTS.MAIN,\r\n icon: ,\r\n mustHaveReferenceId: true,\r\n restriction: [],\r\n },\r\n {\r\n title: \"Adiministración de imágenes\",\r\n path: DASHBOARD.MANAGE_UNITS_IMAGES,\r\n icon: ,\r\n onlyTo: \"Supervisor\",\r\n restriction: [\"Beneficiary\", \"Administrator\", \"HelpDesk\"],\r\n },\r\n {\r\n title: \"Perfil\",\r\n path: DASHBOARD.PROFILE.MAIN,\r\n icon: ,\r\n restriction: [],\r\n },\r\n];\r\n\r\nconst tutorialSteps = [\r\n {\r\n id: 0,\r\n label: \"Crea tu reporte de garantías en 5 minutos y ¡adjunta fotos!\",\r\n color: COLOR.GREEN,\r\n anim: key,\r\n },\r\n {\r\n id: 1,\r\n label:\r\n \"Como propietario puedes darle acceso a terceros para que creen y visualicen tus casos de garantía... \" +\r\n \"administradores, inquilinos, familiares\",\r\n color: COLOR.ORANGE,\r\n anim: photo,\r\n },\r\n {\r\n id: 2,\r\n label:\r\n \"Puedes visualizar el estatus de tus reportes y tener todo un historial ordenado y fácil de consultar\",\r\n color: COLOR.PRIMARY,\r\n anim: charts,\r\n },\r\n];\r\n\r\nconst RelationshipTypes = [\r\n {\r\n label: \"Ninguno\",\r\n value: \"Ninguno\",\r\n },\r\n {\r\n label: \"Esposa(o)\",\r\n value: \"Esposa(o)\",\r\n },\r\n {\r\n label: \"Pareja\",\r\n value: \"Pareja\",\r\n },\r\n {\r\n label: \"Hijo(a)\",\r\n value: \"Hijo(a)\",\r\n },\r\n {\r\n label: \"Mamá\",\r\n value: \"Mamá\",\r\n },\r\n {\r\n label: \"Papá\",\r\n value: \"Papá\",\r\n },\r\n {\r\n label: \"Suegros\",\r\n value: \"Suegros\",\r\n },\r\n {\r\n label: \"Doméstica\",\r\n value: \"Doméstica\",\r\n },\r\n {\r\n label: \"Inquilino\",\r\n value: \"Inquilino\",\r\n },\r\n {\r\n label: \"Administrador\",\r\n value: \"Administrador\",\r\n },\r\n {\r\n label: \"Otro familiar\",\r\n value: \"Otro familiar\",\r\n },\r\n];\r\n\r\nexport { COLOR, STATUS, mainMenu, tutorialSteps, RelationshipTypes };\r\n","export const showSnackbar = (message, type) => {\r\n return dispatch => {\r\n dispatch({ type: \"SNACKBAR_OPEN\", payload: { message, type } });\r\n };\r\n};\r\n\r\nexport const clearSnackbar = () => {\r\n return dispatch => {\r\n dispatch({ type: \"SNACKBAR_HIDE\" });\r\n };\r\n};\r\n","import produce from \"immer\";\r\n\r\nconst initState = {\r\n isValidUser: false,\r\n isRegisterUser: false,\r\n isAuthenticated: false,\r\n user: { Name: \"\", Roles: [], RolSalesForce: \"\" },\r\n activeRole: null,\r\n resetEmailSend: false,\r\n resetSuccess: false,\r\n isLoading: false,\r\n isInactive: false,\r\n settingUser: false,\r\n};\r\n\r\nconst auth = (state = initState, action) =>\r\n produce(state, draft => {\r\n switch (action.type) {\r\n case \"VALIDATE_USER_SUCCESS\":\r\n draft.isValidUser = true;\r\n draft.user = action.payload;\r\n break;\r\n case \"REGISTER_USER_SUCCESS\":\r\n draft.isValidUser = true;\r\n draft.isRegisterUser = true;\r\n draft.user = action.payload;\r\n break;\r\n case \"AUTHENTICATION_SUCCESS\":\r\n draft.isAuthenticated = true;\r\n draft.user = action.payload;\r\n break;\r\n case \"UPDATE_USER_INFO\":\r\n draft.user = { ...draft.user, ...action.payload };\r\n break;\r\n case \"SET_USER_ROLE\":\r\n draft.activeRole = action.payload;\r\n break;\r\n case \"RESET_EMAIL_SENDED\":\r\n draft.resetEmailSend = true;\r\n break;\r\n case \"RESET_PASSWORD_SUCCESS\":\r\n draft.resetSuccess = true;\r\n break;\r\n case \"CLEAR_RESET_PASSWORD\":\r\n draft.resetEmailSend = initState.resetEmailSend;\r\n draft.resetSuccess = initState.resetSuccess;\r\n break;\r\n case \"CLEAR_AUTH\":\r\n draft.isAuthenticated = initState.isAuthenticated;\r\n draft.isValidUser = initState.isValidUser;\r\n draft.isRegisterUser = initState.isRegisterUser;\r\n draft.user = initState.user;\r\n draft.activeRole = initState.activeRole;\r\n break;\r\n case \"LOADING_START\":\r\n draft.isLoading = true;\r\n break;\r\n case \"LOADING_END\":\r\n draft.isLoading = false;\r\n break;\r\n case \"USER_ACTIVE\":\r\n draft.isInactive = false;\r\n break;\r\n case \"SETTING_USER_START\":\r\n draft.settingUser = true;\r\n break;\r\n case \"SETTING_USER\":\r\n draft.user = { ...draft.user, ...action.payload };\r\n break;\r\n case \"SETTING_USER_END\":\r\n draft.settingUser = false;\r\n break;\r\n case \"USER_ONIDLE\":\r\n draft.isInactive = true;\r\n break;\r\n default:\r\n return state;\r\n }\r\n });\r\n\r\nexport default auth;\r\n","import produce from \"immer\";\r\n\r\nconst initState = {\r\n snackbarMessage: \"\",\r\n snackbarType: null,\r\n snackbarOpen: false,\r\n};\r\n\r\nconst snackbar = (state = initState, action) =>\r\n produce(state, draft => {\r\n switch (action.type) {\r\n case \"SNACKBAR_OPEN\":\r\n draft.snackbarOpen = true;\r\n draft.snackbarMessage = action.payload.message;\r\n draft.snackbarType = action.payload.type;\r\n break;\r\n case \"SNACKBAR_HIDE\":\r\n draft.snackbarOpen = initState.snackbarOpen;\r\n break;\r\n default:\r\n return state;\r\n }\r\n });\r\n\r\nexport default snackbar;\r\n","import produce, { setAutoFreeze } from \"immer\";\r\n\r\n/* React Photo Gallery needs to rewrite state without dispatching,\r\nso auto freeze is set to false to avoid read-only inmmutble objects\r\nbehavior from immer, not recommended */\r\nsetAutoFreeze(false);\r\n\r\nconst initState = {\r\n currentProperty: null,\r\n currentUnit: null,\r\n cases: null,\r\n currentCase: null,\r\n caseForm: {\r\n description: \"\",\r\n unit_id: \"\",\r\n files: [],\r\n isPunchLine: false,\r\n },\r\n caseFormUpdate: {\r\n description: \"\",\r\n unit_id: \"\",\r\n id: \"\",\r\n isPunchLine: false,\r\n },\r\n selectedImages: [],\r\n gettingUnitCases: false,\r\n creatingCase: false,\r\n updatingCase: false,\r\n deletingCase: false,\r\n filteringUnit: false,\r\n};\r\n\r\nconst properties = (state = initState, action) =>\r\n produce(state, draft => {\r\n switch (action.type) {\r\n case \"SET_CURRENT_PROPERTY\":\r\n draft.currentProperty = action.payload;\r\n break;\r\n case \"SET_CURRENT_UNIT\":\r\n draft.currentUnit = action.payload;\r\n break;\r\n case \"GET_CASES_SUCCESS\":\r\n draft.cases = action.payload;\r\n break;\r\n case \"GET_CASES_START\":\r\n draft.gettingUnitCases = true;\r\n break;\r\n case \"GET_CASES_END\":\r\n draft.gettingUnitCases = false;\r\n break;\r\n case \"SET_CURRENT_CASE\":\r\n draft.currentCase = action.payload;\r\n break;\r\n case \"SET_CURRENT_CASE_IMAGE\":\r\n draft.currentCase = { ...draft.currentCase, images: action.payload };\r\n break;\r\n case \"CREATE_CASES_START\":\r\n draft.creatingCase = true;\r\n break;\r\n case \"CREATE_CASES_END\":\r\n draft.creatingCase = false;\r\n break;\r\n case \"UPDATE_FORM\":\r\n draft.caseForm = { ...draft.caseForm, ...action.payload };\r\n break;\r\n case \"UPDATE_CASE_START\":\r\n draft.updatingCase = true;\r\n break;\r\n case \"UPDATE_CASE_END\":\r\n draft.updatingCase = false;\r\n break;\r\n case \"UPDATE_CASE\":\r\n draft.caseFormUpdate = { ...draft.caseFormUpdate, ...action.payload };\r\n break;\r\n case \"DELETE_CASE_START\":\r\n draft.deletingCase = true;\r\n break;\r\n case \"DELETE_CASE_END\":\r\n draft.deletingCase = false;\r\n break;\r\n case \"DELETE_CASE\":\r\n draft.cases = draft.cases.filter(c => c.Id !== action.payload);\r\n break;\r\n case \"SEARCH_UNIT_START\":\r\n draft.filteringUnit = true;\r\n break;\r\n case \"SEARCH_UNIT_END\":\r\n draft.filteringUnit = false;\r\n break;\r\n case \"ADD_FILES_FORM\":\r\n draft.caseForm.files = [...draft.caseForm.files, action.payload];\r\n break;\r\n case \"ADD_SEVERAL_FILES_FORM\":\r\n draft.caseForm.files = [...draft.caseForm.files, ...action.payload];\r\n break;\r\n case \"REMOVE_IMAGES_FORM\":\r\n const new_arr = action.payload.sort(function (a, b) {\r\n return a - b;\r\n });\r\n\r\n for (var i = new_arr.length - 1; i >= 0; i--)\r\n draft.caseForm.files.splice(action.payload[i], 1);\r\n\r\n draft.selectedImages = initState.selectedImages;\r\n break;\r\n case \"UPDATED_SELECTED_FILES\":\r\n if (action.isSelected) draft.selectedImages = [...draft.selectedImages, action.index];\r\n else draft.selectedImages = draft.selectedImages.filter(val => val !== action.index);\r\n break;\r\n case \"CLEAR_FORM\":\r\n draft.caseForm = initState.caseForm;\r\n draft.selectedImages = initState.selectedImages;\r\n break;\r\n case \"RESET_PROPERTIES\":\r\n draft.currentProperty = initState.currentProperty;\r\n draft.currentUnit = initState.currentUnit;\r\n draft.cases = initState.cases;\r\n draft.currentCase = initState.currentCase;\r\n draft.caseForm = initState.caseForm;\r\n draft.selectedImages = initState.selectedImages;\r\n draft.gettingUnitCases = initState.gettingUnitCases;\r\n break;\r\n default:\r\n return state;\r\n }\r\n });\r\n\r\nexport default properties;\r\n","import produce from \"immer\";\r\n\r\nconst initState = {\r\n beneficiaries: null,\r\n currentBeneficiary: null,\r\n getBeneficiaries: false,\r\n creatingBeneficiaries: false,\r\n};\r\n\r\nconst beneficiaries = (state = initState, action) =>\r\n produce(state, draft => {\r\n switch (action.type) {\r\n case \"CREATE_BENEFICIARY_START\":\r\n draft.creatingBeneficiaries = true;\r\n break;\r\n case \"BENEFICIARY_CREATED_SUCCESSFULL\":\r\n break;\r\n case \"CREATE_BENEFICIARY_END\":\r\n draft.creatingBeneficiaries = false;\r\n break;\r\n case \"GET_BENEFICIARIES_START\":\r\n draft.getBeneficiaries = true;\r\n break;\r\n case \"GET_BENEFICIARIES_SUCCESS\":\r\n draft.beneficiaries = action.payload;\r\n break;\r\n case \"GET_BENEFICIARIES_END\":\r\n draft.getBeneficiaries = false;\r\n break;\r\n case \"SET_CURRENT_BENEFICIARY\":\r\n draft.currentBeneficiary = action.payload;\r\n break;\r\n case \"UPDATE_CURRENT_BENEFICIARY\":\r\n draft.currentBeneficiary = { ...draft.currentBeneficiary, ...action.payload };\r\n break;\r\n default:\r\n return state;\r\n }\r\n });\r\n\r\nexport default beneficiaries;\r\n","import produce from \"immer\";\r\n\r\nconst initState = {\r\n profile_form: {\r\n name: null,\r\n surname: null,\r\n phone: null,\r\n email: null,\r\n avatar: null,\r\n customProfileImage: null,\r\n },\r\n updating_profile: false,\r\n};\r\n\r\nconst profile = (state = initState, action) =>\r\n produce(state, draft => {\r\n switch (action.type) {\r\n case \"UPDATING_USER_START\":\r\n draft.updating_profile = true;\r\n break;\r\n case \"UPDATING_USER_END\":\r\n draft.updating_profile = false;\r\n break;\r\n case \"UPDATE_PROFILE_FORM\":\r\n draft.profile_form = { ...draft.profile_form, ...action.payload };\r\n break;\r\n default:\r\n return state;\r\n }\r\n });\r\n\r\nexport default profile;\r\n","import produce from \"immer\";\r\n\r\nconst initState = {\r\n loadingCatalogs: false,\r\n avatars: null,\r\n};\r\n\r\nconst catalogs = (state = initState, action) =>\r\n produce(state, draft => {\r\n switch (action.type) {\r\n case \"SET_AVATARS_CATALOG\":\r\n draft.avatars = action.payload;\r\n break;\r\n case \"LOADING_CATALOGS_START\":\r\n draft.loadingCatalogs = true;\r\n break;\r\n case \"LOADING_CATALOGS_END\":\r\n draft.loadingCatalogs = false;\r\n break;\r\n default:\r\n return state;\r\n }\r\n });\r\n\r\nexport default catalogs;\r\n","import produce from \"immer\";\r\nimport { ACTION_TYPE } from \"../actions/portal.actions\";\r\n\r\nconst initState = {\r\n creatingPortalUser: false,\r\n};\r\n\r\nconst getActions = (state, draft, { type, payload }) => {\r\n const actions = {\r\n CREATE_PORTAL_USER_START: () => {\r\n draft.creatingPortalUser = true;\r\n },\r\n CREATE_PORTAL_USER_END: () => {\r\n draft.creatingPortalUser = false;\r\n },\r\n default: () => {\r\n return state;\r\n },\r\n };\r\n\r\n return (actions[type] || actions[\"default\"])();\r\n};\r\n\r\n// reducers\r\nconst portal = (state = initState, action) =>\r\n produce(state, draft => {\r\n return getActions(state, draft, action);\r\n });\r\nexport default portal;\r\n","import produce from \"immer\";\r\n\r\nconst initState = {\r\n tokens: [],\r\n change: false,\r\n};\r\n\r\nconst auth = (state = initState, action) =>\r\n produce(state, draft => {\r\n switch (action.type) {\r\n case \"TOKEN_SUCCESS\":\r\n draft.tokens = action.payload;\r\n break;\r\n case \"TOKEN_START\":\r\n draft.change = true;\r\n break;\r\n case \"TOKEN_END\":\r\n draft.change = false;\r\n break;\r\n default:\r\n return state;\r\n }\r\n });\r\n\r\nexport default auth;\r\n","import produce from \"immer\";\r\n\r\nconst initState = {\r\n isLoading: false,\r\n base64: null,\r\n};\r\n\r\nconst print = (state = initState, action) =>\r\n produce(state, draft => {\r\n switch (action.type) {\r\n case \"GENERATE_PDF_START\":\r\n draft.isLoading = true;\r\n break;\r\n case \"GENERATE_PDF_SUCCESS\":\r\n draft.base64 = action.payload;\r\n break;\r\n case \"GENERATE_PDF_END\":\r\n draft.isLoading = false;\r\n break;\r\n default:\r\n return state;\r\n }\r\n });\r\n\r\nexport default print;\r\n","import { combineReducers } from \"redux\";\r\n\r\n/* IMPORT REDUCERS */\r\nimport auth from \"./reducers/auth.reducer\";\r\nimport snackbar from \"./reducers/snackbar.reducer\";\r\nimport properties from \"./reducers/properties.reducer\";\r\nimport beneficiaries from \"./reducers/beneficiaries.reducer\";\r\nimport profile from \"./reducers/profile.reducer\";\r\nimport catalogs from \"./reducers/catalogs.reducer\";\r\nimport portal from \"./reducers/portal.reducer\";\r\nimport token from \"./reducers/token.reducer\";\r\nimport print from \"./reducers/print.reducer\";\r\nconst appReducer = combineReducers({\r\n auth,\r\n snackbar,\r\n properties,\r\n beneficiaries,\r\n profile,\r\n catalogs,\r\n portal,\r\n token,\r\n print,\r\n});\r\n\r\nconst rootReducer = (state, action) => {\r\n if (action.type === \"USER_LOGOUT\") {\r\n sessionStorage.removeItem(\"persist:root\");\r\n localStorage.removeItem(\"Token\");\r\n return appReducer(undefined, action);\r\n }\r\n\r\n return appReducer(state, action);\r\n};\r\n\r\nexport default rootReducer;\r\n","import { refreshToken } from \"../../services/warranty_api\";\r\nimport { showSnackbar } from \"./snackbar.actions\";\r\n\r\nexport const refreshTokenAction = (token, refresh_Token) => {\r\n return async dispatch => {\r\n dispatch({ type: \"TOKEN_START\" });\r\n try {\r\n const response = await refreshToken(token, refresh_Token);\r\n const { data } = response;\r\n const { JwtToken, RefreshToken } = data;\r\n dispatch({ type: \"TOKEN_SUCCESS\", payload: { JwtToken, RefreshToken } });\r\n } catch (error) {\r\n dispatch(showSnackbar(error, \"error\"));\r\n }\r\n dispatch({ type: \"TOKEN_END\" });\r\n };\r\n};\r\n","import { applyMiddleware, compose, createStore } from \"redux\";\r\nimport { persistStore, persistReducer } from \"redux-persist\";\r\nimport promise from \"redux-promise\";\r\nimport thunk from \"redux-thunk\";\r\nimport logger from \"redux-logger\";\r\nimport sessionStorage from \"redux-persist/lib/storage/session\";\r\n\r\nimport reducers from \"../redux/root.reducers\";\r\nimport { ENVIRONMENT } from \"../config/config\";\r\nimport { refreshTokenAction } from \"./actions/token.actions\";\r\n\r\nconst persistConfig = {\r\n key: \"@pty_warrantyapp2021\",\r\n storage: sessionStorage,\r\n};\r\n\r\nlet middlewares = [thunk, promise];\r\n\r\n// if (ENVIRONMENT !== \"prod\") middlewares.push(logger);\r\n\r\nconst persistedReducer = persistReducer(persistConfig, reducers);\r\n\r\nconst configureStore = () => {\r\n return createStore(persistedReducer, compose(applyMiddleware(...middlewares)));\r\n};\r\n\r\nconst store = configureStore();\r\nconst persistor = persistStore(store);\r\n\r\nsetInterval(() => {\r\n const {\r\n auth: { isAuthenticated },\r\n token: {\r\n tokens: { JwtToken, RefreshToken },\r\n },\r\n } = store.getState();\r\n if (isAuthenticated) {\r\n store.dispatch(refreshTokenAction(JwtToken, RefreshToken));\r\n }\r\n}, 240000);\r\n\r\nsetTimeout(() => {\r\n const {\r\n auth: { isAuthenticated },\r\n token: {\r\n tokens: { JwtToken, RefreshToken },\r\n },\r\n } = store.getState();\r\n if (isAuthenticated && window.location.reload)\r\n store.dispatch(refreshTokenAction(JwtToken, RefreshToken));\r\n}, 0);\r\n\r\nexport { store, persistor };\r\n","import axios from \"./axios.config\";\r\nimport { dataURLtoFile } from \"../utils/functions\";\r\n\r\n/** AUTH SERVICES **/\r\n\r\nexport const verifyEmail = email => {\r\n return axios.post(\"Auth/Sign\", { Email: email });\r\n};\r\n\r\nexport const signInUser = user => {\r\n return axios.post(\"/Auth/SignIn\", {\r\n Email: user.email,\r\n Password: user.password,\r\n FirebaseDeviceCode: localStorage.getItem(\"Token\"),\r\n });\r\n};\r\n\r\nexport const signUpUser = user => {\r\n return axios.post(\"/Auth/SignUp\", {\r\n Email: user.email,\r\n Password: user.password,\r\n ConfirmPassword: user.confirmPassword,\r\n hasCheckedTermsAndConditions: user.hasCheckedTermsAndConditions,\r\n });\r\n};\r\n\r\nexport const refreshToken = (token, refresh_Token) => {\r\n let refreshTok = { RefreshToken: `${refresh_Token}` };\r\n return axios.post(`Auth/refresh-token`, refreshTok, {\r\n headers: {\r\n Authorization: `Bearer ${token}`,\r\n \"Content-Type\": \"application/json\",\r\n },\r\n });\r\n};\r\n\r\nexport const generatePDF = _data => {\r\n return axios.post(`Cases/GetCasesReport`, {\r\n ReportInitialDate: _data.initialDate,\r\n ReportFinalDate: _data.finalDate,\r\n AssetId: _data.AssetId,\r\n AccountId: _data.AccountId,\r\n AssetName: _data.AssetName,\r\n });\r\n};\r\nexport const generatePdfFromCases = _data => {\r\n return axios.post(`Cases/GetCasesReportExt`, {\r\n CasesId: _data.CasesId,\r\n ReportInitialDate: _data.initialDate,\r\n ReportFinalDate: _data.finalDate,\r\n AssetId: _data.AssetId,\r\n AccountId: _data.AccountId,\r\n AssetName: _data.AssetName,\r\n });\r\n};\r\n\r\nexport const forgotPassword = email => {\r\n return axios.post(\"/Auth/ForgotPassword\", {\r\n Email: email,\r\n });\r\n};\r\n\r\nexport const resetPassword = user => {\r\n return axios.post(\"/Auth/ResetPassword\", {\r\n Email: user.email,\r\n Token: user.token,\r\n Password: user.password,\r\n ConfirmPassword: user.confirmPassword,\r\n });\r\n};\r\n\r\n/** APP SERVICES **/\r\n\r\nexport const getUserUnits = async (account_id, role) => {\r\n try {\r\n const { data } = await axios.get(`/User/${account_id}/Assets`, {\r\n params: { rol: role },\r\n });\r\n\r\n if (typeof data === \"string\") return [];\r\n return data;\r\n } catch (error) {\r\n return [];\r\n }\r\n};\r\n\r\nexport const getWarrantyRole = async (referenceId, email) => {\r\n try {\r\n const { data } = await axios.get(`/User/contact/${referenceId}/${email}`);\r\n if (typeof data === \"string\") {\r\n throw new Error(data);\r\n }\r\n return data;\r\n } catch (error) {\r\n throw new Error(error);\r\n }\r\n};\r\n\r\nexport const getAssetsCommercial = async (page, ReferenceId, pageSize = 10000) => {\r\n try {\r\n const { data } = await axios.get(\r\n `/User/GetAssetsCommercial/${ReferenceId}?page=${page}&pageSize=${pageSize}`\r\n );\r\n if (typeof data === \"string\") return [];\r\n return data;\r\n } catch (error) {\r\n return [];\r\n }\r\n};\r\nexport const getAssetsResidential = async (page, ReferenceId, pageSize = 10000) => {\r\n try {\r\n const { data } = await axios.get(\r\n `/User/GetAssetsResidential/${ReferenceId}?page=${page}&pageSize=${pageSize}`\r\n );\r\n if (typeof data === \"string\") {\r\n return [];\r\n }\r\n return data;\r\n } catch (error) {\r\n return [];\r\n }\r\n};\r\n\r\nexport const getBeneficiaryUnits = async account_id => {\r\n try {\r\n const { data } = await axios.get(`/User/Beneficiary/${account_id}/Assets`);\r\n if (typeof data === \"string\") return [];\r\n return data;\r\n } catch (error) {\r\n return [];\r\n }\r\n};\r\n\r\nexport const getUnitMaintenanceCases = async (account_id, unit_id) => {\r\n try {\r\n const { data } = await axios.get(`/Maintenance/account/${account_id}/asset/${unit_id}`);\r\n if (typeof data === \"string\") return [];\r\n return data;\r\n } catch (error) {\r\n return [];\r\n }\r\n};\r\nexport const getUnitCases = async (account_id, unit_id, active_role) => {\r\n try {\r\n const { data } = await axios.get(\r\n `/User/${account_id}/Assets/${unit_id}/cases?referencesId=${active_role}`\r\n );\r\n if (typeof data === \"string\") return [];\r\n return data;\r\n } catch (error) {\r\n return [];\r\n }\r\n};\r\n\r\nexport const createMaintenanceCase = (report, allFiles) => {\r\n const formData = new FormData();\r\n\r\n allFiles.forEach(file => {\r\n formData.append(\"DocumentacionCaso\", dataURLtoFile(file.imgBase64, `${file.name}.${file.ext}`));\r\n });\r\n formData.append(\"assetId\", report.unit_id);\r\n formData.append(\"accountId\", report.accountId);\r\n formData.append(\"correoCreador\", report.correoCreador);\r\n formData.append(\"nombreCreador\", report.nombreCreador);\r\n formData.append(\"telefonoCreador\", report.telefonoCreador);\r\n formData.append(\"description\", report.description);\r\n formData.append(\"isPunchLine\", report.isPunchLine);\r\n\r\n return axios.post(\"/Maintenance/createCase\", formData, {\r\n headers: {\r\n \"Content-Type\": \"multipart/form-data\",\r\n },\r\n });\r\n};\r\n\r\nexport const createUnitCase = (report, referenceId, allFiles) => {\r\n const formData = new FormData();\r\n\r\n allFiles.forEach(file => {\r\n formData.append(\"DocumentacionCaso\", dataURLtoFile(file.imgBase64, `${file.name}.${file.ext}`));\r\n });\r\n\r\n formData.append(\"AssetId\", report.unit_id);\r\n formData.append(\"Description\", report.description);\r\n formData.append(\"EsPunchLine\", report.isPunchLine);\r\n\r\n return axios.post(`/Cases?referencesId=${referenceId}`, formData, {\r\n headers: {\r\n \"Content-Type\": \"multipart/form-data\",\r\n },\r\n });\r\n};\r\n\r\nexport const updateUnitCase = report => {\r\n const formData = new FormData();\r\n formData.append(\"CaseId\", report.id);\r\n formData.append(\"AssetId\", report.unit_id);\r\n formData.append(\"Description\", report.description);\r\n formData.append(\"EsPunchLine\", report.isPunchLine);\r\n\r\n return axios.put(`/Cases`, formData, {\r\n headers: {\r\n \"Content-Type\": \"multipart/form-data\",\r\n },\r\n });\r\n};\r\nexport const updateUnitMaintenanceCase = report => {\r\n return axios.post(`/Maintenance/updateCase`, {\r\n CaseId: report.id,\r\n AssetId: report.unit_id,\r\n Description: report.description,\r\n EsPunchLine: report.isPunchLine,\r\n correoCreador: report.correoCreador,\r\n nombreCreador: report.nombreCreador,\r\n telefonoCreador: report.telefonoCreador,\r\n DocumentacionDelCaso: report.DocumentacionDelCaso,\r\n });\r\n};\r\n\r\nexport const settingUser = settings => {\r\n return axios.put(`User/UpdateNotificationConfiguration`, {\r\n AllowEmailNotification: settings.checkedEmail,\r\n AllowPushNotification: settings.checkedNotification,\r\n });\r\n};\r\n\r\nexport const deleteUnitCase = case_id => {\r\n return axios.delete(`/Cases?caseId=${case_id}`);\r\n};\r\n\r\nexport const uploadCaseImages = (caseId, images) => {\r\n const formData = new FormData();\r\n\r\n images.forEach((image, index) => {\r\n formData.append(\"image\", dataURLtoFile(image.src, `image${index + 1}.jpg`));\r\n });\r\n\r\n return axios.post(`/Cases/${caseId}/AttachImage`, formData, {\r\n headers: {\r\n \"Content-Type\": \"multipart/form-data\",\r\n },\r\n });\r\n};\r\n\r\nexport const getCaseImagesId = caseId => {\r\n return axios.get(`/Cases/${caseId}/Files`);\r\n};\r\n\r\nexport const getCaseImagesFile = fileId => {\r\n return axios.get(`/Cases/${fileId}/File`);\r\n};\r\n\r\nexport const getBeneficiaries = () => {\r\n return axios.get(\"/User/Beneficiaries\");\r\n};\r\n\r\nexport const createBeneficiary = beneficiary => {\r\n return axios.post(`/User/InviteBeneficiary`, {\r\n Email: beneficiary.email,\r\n Relationship: beneficiary.user_type,\r\n PhoneNumber: beneficiary.phone,\r\n BeneficiaryInviteAssets: beneficiary.assets,\r\n });\r\n};\r\n\r\nexport const updateBeneficiary = (user_type, identity) => {\r\n const { ownerId, beneficiaryId } = identity;\r\n\r\n return axios.put(`/User/${ownerId}/profile/${beneficiaryId}`, {\r\n Relationship: user_type,\r\n });\r\n};\r\n\r\nexport const approveBeneficiaryInvite = token => {\r\n return axios.post(`/User/ApproveInvite`, { Token: token });\r\n};\r\n\r\nexport const approvePortalUserInvite = (token, role) => {\r\n return axios.post(`/User/ApproveInvitePortal`, { Token: token, Role: role });\r\n};\r\n\r\nexport const addBeneficiaryAssets = (accountId, assets) => {\r\n return axios.post(`/User/${accountId}/Assets/Link`, assets, {\r\n headers: {\r\n \"Content-Type\": \"application/json-patch+json\",\r\n },\r\n });\r\n};\r\n\r\nexport const deleteBeneficiaryAssets = (accountId, assets) => {\r\n return axios.delete(`/User/${accountId}/Assets/Unlink`, {\r\n headers: {\r\n \"Content-Type\": \"application/json-patch+json\",\r\n },\r\n data: assets,\r\n });\r\n};\r\n\r\nexport const deleteBeneficiary = beneficiaryId => {\r\n return axios.delete(`/User/Beneficiaries?beneficiaryId=${beneficiaryId}`);\r\n};\r\n\r\nexport const updateUser = user => {\r\n return axios.put(`/User/UpdateProfile`, {\r\n FirstName: user.FirstName,\r\n LastName: user.LastName,\r\n PhoneNumber: user.PhoneNumber,\r\n AvatarId: user.AvatarId,\r\n customProfileImage: user.customProfileImage\r\n ? {\r\n ...user.customProfileImage,\r\n imgBase64: user.customProfileImage.imgBase64.split(\",\")[1],\r\n }\r\n : null,\r\n ...(user.hasCheckedTermsAndConditions ? { hasCheckedTermsAndConditions: true } : {}),\r\n });\r\n};\r\n\r\nexport const getAvatarsCatalog = () => {\r\n return axios.get(\"/Avatar\");\r\n};\r\n\r\nexport const getDocuments = key => {\r\n return axios.get(`/Cases/GetDocumentByCases?key=${key}`);\r\n};\r\n","export const dataURLtoFile = (dataurl, filename) => {\r\n var arr = dataurl.split(\",\"),\r\n mime = arr[0].match(/:(.*?);/)[1],\r\n bstr = atob(arr[1]),\r\n n = bstr.length,\r\n u8arr = new Uint8Array(n);\r\n\r\n while (n--) {\r\n u8arr[n] = bstr.charCodeAt(n);\r\n }\r\n\r\n return new File([u8arr], filename, { type: mime });\r\n};\r\n\r\nexport const CheckRoles = (activeRole, restrictions, mustHaveReferenceId, ReferenceId, onlyTo) => {\r\n let isValid = true;\r\n\r\n if (onlyTo) {\r\n return onlyTo == activeRole;\r\n }\r\n\r\n if (mustHaveReferenceId && !ReferenceId) {\r\n isValid = false;\r\n }\r\n\r\n restrictions.forEach(restrinction => {\r\n if (activeRole === restrinction) isValid = false;\r\n });\r\n\r\n return isValid;\r\n};\r\n\r\nexport const GetAvatarURL = (avatars, id) => {\r\n return avatars?.find(avatar => avatar.Id === id) || null;\r\n};\r\n"],"sourceRoot":""}