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zCzEE,OAAOC,SAAWD,OAAOC,UAAY,IAAIC,KAAK,CAC7C,+DACA,WACE,OAAO,EAAQ,Y","sources":["webpack://_N_E/./pages/covid-19-resources/covid-19-state-lawsuit-abuse-protections.js","webpack://_N_E/./src/shared/components/MembershipPageWrap/index.js","webpack://_N_E/?6d40"],"sourcesContent":["import { css, jsx } from '@emotion/core';\nimport React from 'react';\nimport { connect } from 'react-redux';\n\nimport ContentPage from '@/src/cms/components/CMSPage/Content';\nimport withMembershipAccessWrap, {\n mapStateToProps,\n} from '@/src/shared/components/MembershipPageWrap';\nimport { bp } from '@/styles';\n\nfunction Covid19StateLawsuitAbuseProtections(props) {\n return (\n div > ul {\n display: block;\n list-style-position: inside;\n @media ${bp.sm} {\n margin-left: 32px;\n }\n > li {\n list-style-type: disc;\n }\n }\n `}\n />\n );\n}\n\nexport async function getStaticProps() {\n return { props: { sitepageid: 411 } };\n}\n\nexport default connect(mapStateToProps)(\n withMembershipAccessWrap(Covid19StateLawsuitAbuseProtections)\n);\n","import { useAuth0 } from '@auth0/auth0-react';\nimport Router from 'next/router';\nimport React, { useEffect } from 'react';\nimport { useSelector } from 'react-redux';\n\nimport Error from '@/pages/_error';\nimport { checkAccess } from '@/src/shared/constants';\n\nimport LoadingPage from '../LoadingPage/LoadingPage';\n\nconst isBrowser = typeof window !== 'undefined';\n\nconst withMembershipAccessWrap = (PageComponent, memberLevels, ssr = false) => {\n return function PageComponentWithAccess(props) {\n const { loginWithRedirect, isLoading } = useAuth0();\n const { isLoggedIn, role } = useSelector(state => state.auth);\n const stateLoading = useSelector(state => state.auth.isLoading);\n const personId = useSelector(state => state.auth.userinfo.PersonID);\n\n useEffect(() => {\n if (!stateLoading && !isLoggedIn) {\n loginWithRedirect({\n appState: {\n returnTo: Router.pathname,\n },\n });\n }\n }, [isLoggedIn, stateLoading]);\n\n const hasAccess = checkAccess(memberLevels, role);\n const isAuthorized = personId && Array.isArray(role) && hasAccess;\n const errorCode = isLoggedIn && !hasAccess ? 401.4 : 401;\n\n if (!ssr || isBrowser) {\n if (isLoading || stateLoading) return ;\n if (!stateLoading && !isLoggedIn) {\n loginWithRedirect({\n appState: {\n returnTo: Router.pathname,\n },\n });\n }\n if (!stateLoading && isLoggedIn && !isAuthorized) return ;\n }\n\n return ;\n };\n};\n\nexport const mapStateToProps = state => {\n const {\n auth: {\n isLoggedIn,\n isLoading,\n role,\n userinfo: { PersonID },\n },\n } = state;\n return {\n isLoggedIn,\n isLoading,\n role,\n personId: PersonID,\n };\n};\n\nexport default withMembershipAccessWrap;\n","\n (window.__NEXT_P = window.__NEXT_P || []).push([\n \"/covid-19-resources/covid-19-state-lawsuit-abuse-protections\",\n function () {\n return require(\"private-next-pages/covid-19-resources/covid-19-state-lawsuit-abuse-protections.js\");\n }\n ]);\n if(module.hot) {\n module.hot.dispose(function () {\n window.__NEXT_P.push([\"/covid-19-resources/covid-19-state-lawsuit-abuse-protections\"])\n });\n }\n "],"names":["connect","mapStateToProps","withMembershipAccessWrap","props","bodyStyle","css","bp","state","auth","isLoggedIn","isLoading","role","personId","userinfo","PersonID","PageComponent","memberLevels","useAuth0","loginWithRedirect","useSelector","stateLoading","useEffect","appState","returnTo","Router","hasAccess","checkAccess","isAuthorized","Array","isArray","errorCode","status","window","__NEXT_P","push"],"sourceRoot":""}