{\n render() {\n const {\n error,\n errorMessage,\n ...props\n } = this.props;\n return(\n \n \n \n \n {errorMessage && (\n \n \n {errorMessage}\n \n \n )}\n
\n );\n }\n}\n","import { ButtonProps } from './SyntheticButton';\nimport { css } from 'react-emotion';\n\nconst styles = {\n getBaseStyle: (props: ButtonProps) => {\n const {\n theme,\n color,\n fontColor,\n inverse,\n size,\n disabled,\n minimal\n } = props;\n\n const componentStyles = theme.components.button;\n const primary = (inverse || minimal) ? fontColor : color;\n const secondary = (inverse || minimal) ? color : fontColor;\n\n const options = {\n ...props,\n primary,\n secondary\n };\n\n const defaultStyles = componentStyles.defaults(options);\n const sizeStyles = componentStyles.sizes[size];\n const disabledStyles = disabled ? componentStyles.disabled(options) : {};\n const inverseStyles = inverse ? componentStyles.inverse(options) : {};\n const linkStyled = minimal ? componentStyles.minimal(options) : {};\n\n return {\n ...defaultStyles,\n ...sizeStyles,\n ...inverseStyles,\n ...linkStyled,\n ...disabledStyles\n };\n },\n getBlockStyle: ({ fullWidth }: ButtonProps) => fullWidth ? css({ width: '100%' }) : {},\n getCircleButtonStyle: ({ theme, shape, size, minimal, disabled }: ButtonProps) => {\n const minimalStyles = minimal && !disabled && theme.components.button.circle.minimal ? { ...theme.components.button.circle.minimal.enabled } : {};\n return shape === 'circle' ? ({\n paddingLeft: 0,\n paddingRight: 0,\n height: theme.components.button.circle[size],\n width: theme.components.button.circle[size],\n ...minimalStyles\n }) : null;\n }\n};\n\nexport default styles;\n","import styled from 'react-emotion';\nimport style from './styles';\n\n\nexport interface ButtonProps {\n children?: React.ReactNode;\n color?: string;\n disabled?: boolean;\n fontColor?: string;\n fullWidth?: boolean;\n inverse?: boolean;\n minimal?: boolean;\n shape?: string;\n size: string;\n transparent?: boolean;\n innerRef?: any;\n theme?: any;\n}\n\n\nconst SyntheticButton = styled('div') `\n padding-top: 0px;\n padding-bottom: 0px;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n backgroundColor: transparent;\n vertical-align: middle;\n ${style.getBaseStyle}\n ${style.getBlockStyle}\n ${style.getCircleButtonStyle}\n`;\n\nSyntheticButton.defaultProps = {\n color: 'ctaPrimary',\n fontColor: 'light',\n size: 'medium',\n fullWidth: false,\n};\n\nexport default SyntheticButton;\n","import React from 'react';\nimport {\n Box,\n Text,\n constants\n} from '@match/react-component-library';\nimport {\n SyntheticButton\n} from '../../../app-core-components';\n\nimport { PageLayout } from '../../layouts';\n\nconst { SPACE, TYPOGRAPHY, FONT_WEIGHT, SEMANTIC_COLOR_NAME } = constants\n\nclass LandingPage extends React.Component<{}> {\n render() {\n return (\n \n \n \n The gift of love\n \n \n \n Ready to unwrap the perfect match?\n \n \n \n \n Create an account\n \n \n \n \n \n \n Already a member\n \n \n \n \n )\n }\n}\n\nexport default LandingPage;\n","import axios from 'axios';\nimport {\n GiftCardEligibilityGetResponse,\n RedeemGiftCardPostRequest,\n RedeemGiftCardPostResponse\n} from 'types';\n\nconst API_URL = `${process.env.PUBLIC_URL}/api`;\n\nconst axiosInstance = axios.create({\n baseURL: API_URL,\n});\n\n// Request middleware\naxiosInstance.interceptors.request.use((config) => {\n // Add something to each request\n return config;\n}, (error) => {\n // Do something for each request error.\n return Promise.reject(error);\n});\n\n// Targeting criteria response middleware\naxiosInstance.interceptors.response.use((response) => {\n // Do something after each successful response\n return response;\n}, (error) => {\n // Do something for each api error.\n // e.g. redirect 401 responses to login page\n return Promise.reject(error);\n});\n\nconst request = (config = {}) => axiosInstance(config);\n\nexport default {\n getUserEligibility: async () => {\n return request({\n method: 'get',\n url: '/user/eligibility',\n })\n .then(({ data }) => {\n return {\n ...(data as GiftCardEligibilityGetResponse),\n isAuthenticated: true\n };\n })\n .catch((err: any) => {\n const isAuthenticated = (err && err.response && err.response.status === 200);\n return {\n isAuthenticated: isAuthenticated,\n isEligible: false,\n errorMessage: err.toString()\n }\n });\n },\n postRedeemGiftCard: async (values: RedeemGiftCardPostRequest) => {\n return request({\n method: 'post',\n url: '/user/redeem',\n data: values\n })\n .then(({ data }) => data as RedeemGiftCardPostResponse)\n .catch((err: any) => {\n return err.response.data\n });\n }\n};\n","import React from 'react';\nimport { Loading } from '@match/react-component-library';\nimport { Redirect } from 'react-router-dom';\nimport api from 'utils/api-services';\nimport { PageLayout } from '../../layouts';\n\ninterface UserState {\n isAuthenticated: boolean;\n isEligible: boolean;\n isLoading: boolean;\n}\n\nclass PreLandingPage extends React.Component<{}, UserState> {\n state = {\n isAuthenticated: false,\n isEligible: false,\n isLoading: true\n }\n\n componentDidMount() {\n this.fetchUser();\n }\n\n fetchUser = async () => {\n const res = await api.getUserEligibility();\n console.log(res);\n if (res instanceof Error) {\n this.setState({\n isAuthenticated: false,\n isLoading: false\n });\n } else if (!res.isAuthenticated) {\n this.setState({\n isAuthenticated: false,\n isLoading: false\n });\n } else if (res.isEligible) {\n this.setState({\n isAuthenticated: true,\n isEligible: true,\n isLoading: false\n })\n } else {\n this.setState({\n isAuthenticated: true,\n isEligible: false,\n isLoading: false\n })\n }\n\n }\n\n render() {\n const { isAuthenticated, isEligible, isLoading } = this.state;\n\n return (\n \n {isLoading && }\n {!isLoading && !isAuthenticated && (\n \n )}\n {!isLoading && isAuthenticated && !isEligible && (\n \n )}\n {!isLoading && isAuthenticated && isEligible && (\n \n )}\n \n )\n }\n}\n\nexport default PreLandingPage;\n","import React from 'react';\nimport { Formik, FormikConfig, FormikErrors, FormikProps } from 'formik';\nimport {\n Alert,\n Button,\n Box,\n Text,\n constants\n } from '@match/react-component-library';\nimport { RedemptionFormData, RedemptionFormProps } from './types';\nimport { OutlinedInput } from '../../../app-core-components';\nconst { SPACE, TYPOGRAPHY, FONT_WEIGHT, SEMANTIC_COLOR_NAME } = constants;\n\nclass RedemptionForm extends React.Component {\n handleFormSubmit: FormikConfig['onSubmit'] = (values, parameters) => {\n this.props.onSubmit(values, parameters.setSubmitting);\n }\n\n handleValidate: FormikConfig['validate'] = (values) => {\n const errors: FormikErrors = {};\n\n if (!values.firstName) {\n errors.firstName = 'required';\n }\n if (!values.lastName) {\n errors.lastName = 'required';\n }\n if (!values.giftCardCode) {\n errors.giftCardCode = 'required';\n }\n if (values.giftCardCode.length !== 16) {\n errors.giftCardCode = 'must be 16 digits';\n }\n if (!values.giftCardCvv) {\n errors.giftCardCvv = 'required';\n }\n if (!values.giftCardExpirationMonth) {\n errors.giftCardExpirationMonth = 'required';\n }\n if (!values.giftCardExpirationYear) {\n errors.giftCardExpirationYear = 'required';\n }\n const month = parseInt(values.giftCardExpirationMonth);\n if (!month || month < 1 || month > 12) {\n errors.giftCardExpirationMonth = 'invalid';\n }\n\n const year = parseInt(values.giftCardExpirationYear);\n if (!year || year < 2000 || year > 2100) {\n errors.giftCardExpirationYear = 'invalid';\n }\n\n return errors;\n }\n\n render() {\n return (\n ) => {\n const { errors, handleChange, handleSubmit, isSubmitting, values } = props;\n return (\n \n )\n }}\n />\n );\n }\n}\n\nexport default RedemptionForm;\n","import React from 'react';\nimport { Redirect } from 'react-router-dom';\nimport RedemptionForm from './RedemptionForm';\nimport { RedemptionFormData } from './types';\nimport api from 'utils/api-services';\nimport { PageLayout } from '../../layouts';\n\nconst PAGE_STATUS: {\n REDEEMING: 'redeeming',\n FAILED: 'failed',\n SUCCESS: 'success'\n} = {\n REDEEMING: 'redeeming',\n FAILED: 'failed',\n SUCCESS: 'success'\n};\n\ntype PageStatus = typeof PAGE_STATUS[keyof typeof PAGE_STATUS];\n\ninterface Props {\n onNameChange: (name: string) => void\n}\n\ninterface State {\n status: PageStatus;\n errorMessage?: string;\n}\n\nclass RedeemPage extends React.Component {\n constructor(props: Props) {\n super(props);\n\n this.state = {\n status: PAGE_STATUS.REDEEMING\n }\n }\n\n handleSubmit = async (values: RedemptionFormData, setSubmitting: (isSubmitted: boolean) => void) => {\n const res = await api.postRedeemGiftCard({\n cardNumber: values.giftCardCode,\n cvvCode: values.giftCardCvv,\n expirationMonth: parseInt(values.giftCardExpirationMonth),\n expirationYear: parseInt(values.giftCardExpirationYear),\n firstName: values.firstName,\n lastName: values.lastName\n });\n\n setSubmitting(true);\n\n if (!res.isSuccess) {\n console.log('got an error');\n if (res.status === 422) {\n this.setState({\n errorMessage: res.errorMessage,\n status: PAGE_STATUS.REDEEMING\n });\n setSubmitting(false);\n } else {\n this.setState({\n errorMessage: res.errorMessage,\n status: PAGE_STATUS.FAILED\n });\n }\n } else if (res.isSuccess) {\n this.props.onNameChange(values.firstName);\n this.setState({\n status: PAGE_STATUS.SUCCESS\n });\n console.log('success');\n } else {\n console.log('failure');\n }\n }\n\n render() {\n const { errorMessage, status } = this.state;\n return (\n \n\n {status === PAGE_STATUS.REDEEMING && (\n \n )}\n {status === PAGE_STATUS.SUCCESS && (\n \n )}\n {status === PAGE_STATUS.FAILED && (\n \n )}\n \n );\n }\n}\nexport default RedeemPage;\n","import React from 'react';\nimport {\n Box,\n Text,\n constants,\n Icon\n} from '@match/react-component-library';\nimport {\n SyntheticButton\n} from '../../../app-core-components';\nimport { PageLayout } from '../../layouts';\n\nconst { SPACE, TYPOGRAPHY, FONT_WEIGHT } = constants;\n\ninterface Props {\n name?: string;\n}\n\nclass SuccessPage extends React.Component {\n render() {\n return (\n \n \n \n \n \n \n Now you're in{this.props.name ? ` ${this.props.name}`: undefined}!\n \n \n \n • Make connections with local singles
\n • Send and receive unlimited messages
\n • Get priority access to Match Events
\n\n \n \n \n \n \n Get started\n \n \n \n \n );\n }\n}\n\nexport default SuccessPage;\n","import React from 'react';\nimport { BrowserRouter, Route } from 'react-router-dom';\nimport { \n ThemeProvider, \n themeFantasticLlama,\n GlobalFontFace\n} from '@match/react-component-library';\nimport ContainerQueryProvider from 'modules/components/ContainerQuery/ContainerQueryProvider';\nimport { IneligiblePage, LandingPage, PreLandingPage, RedeemPage, SuccessPage } from 'modules/pages';\n\n\ninterface State {\n name?: string\n}\n\nclass App extends React.Component<{}, State> {\n state: State = {};\n\n handleNameChange = (name: string) => {\n this.setState({\n name\n });\n }\n\n render() {\n return (\n \n \n \n \n \n \n \n } />\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.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\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 as { env: { [key: string]: string } }).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 .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","import 'react-app-polyfill/ie11';\nimport 'react-app-polyfill/stable';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport App from './App';\nimport * as serviceWorker from './serviceWorker';\nimport './index.css';\nimport './normalize.css';\nimport './reset.css';\n\nReactDOM.render(, document.getElementById('root'));\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\nserviceWorker.unregister();\n\nif (module.hot) {\n module.hot.accept('./App', () => {\n ReactDOM.render(\n ,\n document.getElementById('root') as HTMLElement\n );\n });\n}"],"sourceRoot":""}