{"version":3,"sources":["webpack:///./transfer/components/unilateral.js"],"names":["i18n","content","Container","styled","div","_objectSpread","background","border","padding","BOX_BORDER_STYLES","rowMarginBottom","css","marginBottom","toString","UnilateralFields","React","Component","constructor","arguments","_defineProperty","event","this","props","clearNameError","dispatch","UnilateralActions","target","value","render","countries","cannotReceiveCountries","serverProps","isMgm","name","nameInputRef","nameError","griffinSupportedCountries","filter","country","countryCode","map","countryName","primaryText","includes","createElement","_Row","className","_Col","_TextInput","type","id","data-nemo","pattern","label","onChange","handleChangeName","theme","ref","errorText","_DropdownMenu","required","options","handleChangeCountryCode","connect","_ref","unilateral","server","external"],"mappings":"mbAuBA,IAAMA,EAAOC,YAAQ,+BAEfC,EAAYC,IAAOC,I,iWAAGC,CAAC,CAC3BC,WAAY,QACZC,OAAQ,oBACRC,QAAS,OACNC,MAGCC,EAAkBC,cAAI,CAAEC,aAAc,QAASC,WAErD,MAAMC,UAAyBC,IAAMC,UAAUC,cAAA,SAAAC,WAAAC,IAAA,wBAc1BC,IACjBC,KAAKC,MAAMC,iBAEXF,KAAKC,MAAME,SACTC,IAAuCL,EAAMM,OAAOC,UAEvDR,IAAA,+BAEyBC,IACxBC,KAAKC,MAAME,SACTC,IAA8CL,EAAMM,OAAOC,UAI/DC,SACE,IAEIC,GAFE,uBAAEC,EAAyB,IAAOC,KAClC,MAAEC,EAAK,KAAEC,EAAI,aAAEC,EAAY,UAAEC,GAAcd,KAAKC,MAiCtD,OA9BEO,EADEG,EACUX,KAAKC,MAAMc,0BACpBC,OAECC,GAAWA,EAAQC,cAAgBlB,KAAKC,MAAMiB,aAE/CC,IAAIF,IACH,IAAM,YAAEC,EAAW,YAAEE,GAAgBH,EACrC,MAAO,CACLX,MAAOY,EACPG,YAAaD,KAIPpB,KAAKC,MAAMc,0BACpBC,OAECC,IAAYR,EAAuBa,SAASL,EAAQC,cAErDC,IAAIF,IACH,IAAM,YAAEC,EAAW,YAAEE,GAAgBH,EACrC,MAAO,CACLX,MAAOY,EACPG,YAAaD,KAIRT,GACkBhC,EAAK,gCADpC6B,EAGIA,EAEFd,IAAA6B,cAAC1C,EAAS,KACRa,IAAA6B,cAAAC,IAAA,CAAKC,UAAWpC,GACdK,IAAA6B,cAAAG,IAAA,KACEhC,IAAA6B,cAAAI,IAAA,CACEC,KAAK,OACLhB,KAAK,gBACLiB,GAAG,gBACHC,YAAU,iBACVC,QAAQ,SACRC,MAAOrD,EAAK,2BACZ2B,MAAOM,EACPqB,SAAUjC,KAAKkC,iBACfC,MAAM,KACNC,IAAKvB,EACLwB,UAAWvB,GAAanC,EAAK,yBAInCe,IAAA6B,cAAAC,IAAA,KACE9B,IAAA6B,cAAAG,IAAA,KACEhC,IAAA6B,cAAAe,IAAA,CACEC,UAAQ,EACRV,GAAG,mBACHG,MAAOrD,EAAK,gCACZ6D,QAAShC,EACTsB,YAAU,oBACVxB,MAAON,KAAKC,MAAMiB,YAClBe,SAAUjC,KAAKyC,8BASdC,gBAAQC,IAAA,IAAC,WAAEC,EAAU,OAAEC,EAAM,SAAEC,GAAUH,EAAA,MAAM,CAC5D/B,KAAMgC,EAAWhC,KACjBM,YAAa0B,EAAW1B,YACxBH,0BAA2B8B,EAAO9B,0BAClCJ,MAAOkC,EAAOlC,QAJD+B,CAKXjD","file":"default~guest~send-page~universal-preview.esm.js","sourcesContent":["/**\n * This component is an input for first and last name, along with a dropdown of\n * countries to choose from. When a user sends more than $15 to a non-PayPal email\n * or phone, we render this component and make them fill out the name and country\n * of the recipient to whom they are sending\n */\nimport PropTypes from 'prop-types'\n\nimport React from 'react'\nimport { connect } from 'transfer/utils/p2p-connect'\nimport {\n Row,\n Col,\n TextInput as PPTextInput,\n DropdownMenu,\n} from '@paypalcorp/pp-react'\nimport * as UnilateralActions from '../actions/unilateral'\nimport styled from '@emotion/styled'\nimport { css } from 'glamor'\nimport content from 'pp-react-l10n'\nimport serverProps from '../utils/serverProps'\nimport { BOX_BORDER_STYLES } from 'lib/styles/styles'\n\nconst i18n = content('transfer/send/recipientInfo')\n\nconst Container = styled.div({\n background: 'white',\n border: '1px solid #f2f2f2',\n padding: '1em',\n ...BOX_BORDER_STYLES,\n})\n\nconst rowMarginBottom = css({ marginBottom: '1em' }).toString()\n\nclass UnilateralFields extends React.Component {\n static propTypes = {\n dispatch: PropTypes.func.isRequired,\n name: PropTypes.string.isRequired,\n countryCode: PropTypes.string.isRequired,\n griffinSupportedCountries: PropTypes.array.isRequired,\n styleOverrides: PropTypes.object,\n showENSubTextRTR: PropTypes.bool,\n isMgm: PropTypes.bool,\n nameError: PropTypes.string,\n nameInputRef: PropTypes.any,\n clearNameError: PropTypes.func.isRequired,\n }\n\n handleChangeName = event => {\n this.props.clearNameError()\n\n this.props.dispatch(\n UnilateralActions.changeUnilateralName(event.target.value)\n )\n }\n\n handleChangeCountryCode = event => {\n this.props.dispatch(\n UnilateralActions.changeUnilateralCountryCode(event.target.value)\n )\n }\n\n render() {\n const { cannotReceiveCountries = [] } = serverProps\n const { isMgm, name, nameInputRef, nameError } = this.props\n let countries\n if (isMgm) {\n countries = this.props.griffinSupportedCountries\n .filter(\n /* do not show in the dropdown countries we shouldn't send */\n country => country.countryCode === this.props.countryCode\n )\n .map(country => {\n const { countryCode, countryName } = country\n return {\n value: countryCode,\n primaryText: countryName,\n }\n })\n } else {\n countries = this.props.griffinSupportedCountries\n .filter(\n /* do not show in the dropdown countries we shouldn't send */\n country => !cannotReceiveCountries.includes(country.countryCode)\n )\n .map(country => {\n const { countryCode, countryName } = country\n return {\n value: countryCode,\n primaryText: countryName,\n }\n })\n }\n countries = !isMgm\n ? ({ value: '', primaryText: i18n('recipientInfo.defaultCountry') },\n countries)\n : countries\n return (\n \n \n \n \n \n \n \n \n \n \n \n \n )\n }\n}\n\nexport default connect(({ unilateral, server, external }) => ({\n name: unilateral.name,\n countryCode: unilateral.countryCode,\n griffinSupportedCountries: server.griffinSupportedCountries,\n isMgm: server.isMgm,\n}))(UnilateralFields)\n"],"sourceRoot":""}