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ASA,GAAO,SAAS9D,GAC9B,OAAOjE,EAAOiE,EAChB,GACF,E,eCeA,QAJA,SAAkBjE,GAChB,OAAiB,MAAVA,EAAiB,GAAK,EAAWA,GAAQ,EAAAgI,EAAA,GAAOhI,GACzD,C","sources":["webpack://printivity/./client/app/bundles/App/pages/auth/SignIn/SignInPage.tsx","webpack://printivity/./client/app/styleguide/components/HtmlContent/HtmlContent.tsx","webpack://printivity/./client/app/styleguide/components/Meta/Meta.tsx","webpack://printivity/./client/app/styleguide/components/PageLevelError/PageLevelError.tsx","webpack://printivity/./client/app/styleguide/components/PageLevelError/PageLevelErrorItem.tsx","webpack://printivity/./node_modules/lodash-es/_baseValues.js","webpack://printivity/./node_modules/lodash-es/valuesIn.js"],"sourcesContent":["import * as React from 'react';\nimport cn from 'classnames';\nimport { boolean, object, string } from 'yup';\nimport mapValues from 'lodash-es/valuesIn';\nimport { postUsersSignIn } from 'api/userAuthentication';\nimport { Button, Link } from 'styleguide/components';\nimport { H4 } from 'styleguide/components/Heading';\nimport FormWrapper from '../FormWrapper/FormWrapper';\nimport PageLevelError from 'styleguide/components/PageLevelError/PageLevelError';\nimport { Status } from 'libs/utils/api/types';\nimport { OperatorResponse } from 'api/types';\nimport { resetPasswordPath, signUpPath, privacyPath, termsAndConditionsPath } from 'bundles/App/routes';\nimport Meta from 'styleguide/components/Meta/Meta';\nimport UserContext from 'contexts/UserContextContainer/UserContext';\nimport { Form, Formik, FormikErrors, FormikValues } from 'formik';\nimport Loader from 'styleguide/components/Loader/Loader';\nimport Label from 'styleguide/components/Formik/Label/Label';\nimport { formikStatus, updateFormikStatus } from 'libs/utils/updateFormik';\nimport { useHistory } from 'react-router';\nimport FormikFieldWrapper from 'app/styleguide/components/Formik/FormikFieldWrapper/FormikFieldWrapper';\n\ninterface Props {\n hideRememberMe?: boolean;\n leftAlign?: boolean;\n fullWidthButton?: boolean;\n repositionForgetPassword?: boolean;\n onSuccess?: () => void;\n}\n\nconst SignInFormSchema = object().shape({\n email: string()\n .strict()\n .email('Please enter a valid email.')\n .trim('Email cannot begin or end with spaces.')\n .required('Email is required.'),\n password: string().ensure().required('Please enter your password.'),\n rememberMe: boolean(),\n});\n\nconst SignInPage = ({ hideRememberMe, leftAlign, repositionForgetPassword, onSuccess }: Props) => {\n const history = useHistory();\n const userContext = React.useContext(UserContext);\n\n const signIn = (\n values: FormikValues,\n setStatus: (status?: formikStatus) => void,\n setSubmitting: (isSubmitting: boolean) => void,\n setErrors: (errors: FormikErrors) => void,\n ) => {\n const handleSuccess = (response: OperatorResponse) => {\n // TODO: there might be a problem if there will be a transition\n // from another website directly to the sign-in page.\n // After signing-in, there will be a redirect to the\n // previous website.\n // There is no clear way to avoid this:\n // https://github.com/ReactTraining/history/issues/573\n if (history.length > 2) {\n /*\n https://developer.mozilla.org/en-US/docs/Web/API/History/length\n `For example, for a page loaded in a new tab this property returns 1.`\n So, first page is the new tab, second page is the /sign-in\n */\n // TODO: probably update csrf result disappearing after goBack\n history.goBack();\n } else {\n history.push('/');\n }\n userContext.logIn(response.user);\n if (onSuccess) {\n onSuccess();\n }\n };\n\n postUsersSignIn(values).then(res => {\n updateFormikStatus(res, setStatus, setSubmitting, setErrors);\n if (res.status === Status.Ok) {\n handleSuccess(res.payload);\n }\n });\n };\n\n return (\n \n \n \n Sign In\n \n
\n Welcome back! Please enter your details.\n
\n {\n signIn(formikValues, setStatus, setSubmitting, setErrors);\n }}\n validationSchema={SignInFormSchema}\n >\n {formikProps => (\n <>\n {formikProps.status && (\n <>\n
\n \n {!!formikProps.status.errors &&\n mapValues(formikProps.status.errors).map((value, index) => (\n \n ))}\n \n
\n \n )}\n
\n \n \n\n \n
\n \n Remember Me\n \n }\n />\n
\n {!repositionForgetPassword && (\n \n Forgot password?\n \n )}\n \n {formikProps.isSubmitting ? (\n \n ) : (\n formikProps.submitForm()}\n color=\"blue\"\n data-cy=\"signInBtn\"\n >\n Sign In\n \n )}\n \n \n )}\n \n
\n
or
\n \n Create An Account\n \n
\n
\n By signing in, you are agreeing to our{' '}\n \n Terms and Conditions\n {' '}\n and{' '}\n \n Privacy Policy\n \n .\n
\n
\n );\n};\nexport default SignInPage;\n","import * as React from 'react';\nimport cn from 'classnames';\n\ninterface Props extends React.DetailedHTMLProps, HTMLDivElement> {\n content: string;\n noStyle?: boolean;\n onClick?: (e: React.MouseEvent) => void;\n}\n\nconst HtmlContent = ({ className, content, noStyle, onClick, ...otherProps }: Props) =>\n noStyle ? (\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events\n \n ) : (\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events\n \n );\n\nexport default HtmlContent;\n","import * as React from 'react';\nimport { Helmet } from 'react-helmet-async';\nimport { Faq } from 'bundles/App/pages/HelpCenter/types';\n\nexport type RobotsType =\n | 'all'\n | 'noindex'\n | 'nofollow'\n | 'index'\n | 'follow'\n | 'none'\n | 'noarchive'\n | 'nosnippet'\n | 'notranslate'\n | 'noimageindex';\n\ninterface Props {\n title: string;\n description?: string;\n keywords?: string;\n canonical?: string;\n robots?: RobotsType[];\n faqs?: Faq[];\n}\n\nconst createFaqJson = (faqs: Faq[]): string =>\n JSON.stringify({\n '@context': `https://schema.org`,\n '@type': 'FAQPage',\n mainEntity: faqs.map(faq => ({\n '@type': 'Question',\n name: faq.question,\n acceptedAnswer: {\n '@type': 'Answer',\n text: faq.answer,\n },\n })),\n });\n\nconst Meta = ({ canonical, description, faqs, keywords, robots, title }: Props) => (\n \n {title}\n {!!description && }\n {!!keywords && }\n {!!canonical && }\n {!!robots && }\n {!!faqs && }\n \n);\nexport default Meta;\n","import * as React from 'react';\nimport Span from '../Span/Span';\nimport { IconExclamationMark } from 'styleguide/icons';\nimport PageLevelErrorItem from './PageLevelErrorItem';\n\ninterface Props {\n message: string;\n children?: React.ReactNode;\n}\n\nconst PageLevelError = ({ message, children }: Props) => (\n
\n \n {message}\n
    {children}
\n
\n);\n\nPageLevelError.Item = PageLevelErrorItem;\n\nexport default PageLevelError;\n","import * as React from 'react';\nimport HtmlContent from 'styleguide/components/HtmlContent/HtmlContent';\n\ninterface Props {\n children?: React.ReactNode;\n value?: string;\n}\n\nconst PageLevelErrorItem = ({ children, value }: Props) => (\n
  • \n \n {children}\n
  • \n);\n\nexport default PageLevelErrorItem;\n","import arrayMap from './_arrayMap.js';\n\n/**\n * The base implementation of `_.values` and `_.valuesIn` which creates an\n * array of `object` property values corresponding to the property names\n * of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the array of property values.\n */\nfunction baseValues(object, props) {\n return arrayMap(props, function(key) {\n return object[key];\n });\n}\n\nexport default baseValues;\n","import baseValues from './_baseValues.js';\nimport keysIn from './keysIn.js';\n\n/**\n * Creates an array of the own and inherited enumerable string keyed property\n * values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.valuesIn(new Foo);\n * // => [1, 2, 3] (iteration order is not guaranteed)\n */\nfunction valuesIn(object) {\n return object == null ? [] : baseValues(object, keysIn(object));\n}\n\nexport default valuesIn;\n"],"names":["SignInFormSchema","object","shape","email","string","strict","trim","required","password","ensure","rememberMe","boolean","_ref","hideRememberMe","leftAlign","repositionForgetPassword","onSuccess","history","useHistory","userContext","React","UserContext","signIn","values","setStatus","setSubmitting","setErrors","postUsersSignIn","then","res","response","updateFormikStatus","status","Status","Ok","payload","length","goBack","push","logIn","user","FormWrapper","Meta","title","description","keywords","robots","canonical","H4","className","cn","Formik","initialValues","onSubmit","formikValues","_ref2","validationSchema","formikProps","PageLevelError","message","errors","mapValues","map","value","index","Item","key","Form","FormikFieldWrapper","inPlaceError","type","name","componentType","labelComponent","size","Label","placement","normalFontWeight","asSpan","Link","color","underline","to","resetPasswordPath","isSubmitting","Loader","Button","onClick","submitForm","AsNativeLink","buttonType","outline","target","signUpPath","dataCy","termsAndConditionsPath","privacyPath","content","noStyle","otherProps","_objectWithoutProperties","_excluded","Object","assign","dangerouslySetInnerHTML","__html","role","tabIndex","faqs","Helmet","rel","href","_toConsumableArray","join","JSON","stringify","mainEntity","faq","question","acceptedAnswer","text","answer","createFaqJson","children","IconExclamationMark","Span","PageLevelErrorItem","HtmlContent","props","keysIn"],"sourceRoot":""}