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OACzBE,EAAW,EAAQ,OAGnBC,EAAkB,WAClBC,EAAqBxD,OAAOuD,EAAgBE,QAqChDrM,EAAOC,QAPP,SAAgBqM,GAEd,OADAA,EAASJ,EAASI,KACAF,EAAmB7C,KAAK+C,GACtCA,EAAOnI,QAAQgI,EAAiBH,GAChCM,CACN","sources":["webpack:///./transfer/components/addressDropdown.js","webpack:///./transfer/utils/address-utils.js","webpack:///./transfer/actions/card.js","webpack:///./transfer/components/shippingAddressDropdown.js","webpack:///./transfer/components/share-my-address.styles.js","webpack:///./transfer/components/share-my-address.js","webpack:///./transfer/components/amount-donation-validation-error.js","webpack:///./transfer/components/note-max-char-limit-error.js","webpack:///./transfer/components/separator.js","webpack:///./transfer/hooks/donate.js","webpack:///./transfer/hooks/index.js","webpack:///../../node_modules/griffin-paypal/address.js","webpack:///../../node_modules/griffin-paypal/lib/addressCommon.js","webpack:///../../node_modules/griffin-paypal/lib/client/address.js","webpack:///../../node_modules/lodash/_escapeHtmlChar.js","webpack:///../../node_modules/lodash/escape.js"],"sourcesContent":["import PropTypes from 'prop-types'\nimport React from 'react'\nimport glamorous from 'glamorous'\nimport content from 'pp-react-l10n'\nimport * as AddressUtils from '../utils/address-utils'\nimport * as CardActions from '../actions/card'\nimport enRTRStrings from '../../../../config/enRTRStrings'\nimport { Button, CaptionText, DropdownMenu } from '@paypalcorp/pp-react'\nimport { tracking } from '../../lib/analytics/mParticle'\nimport Events from '../../lib/analytics/eventTags'\nimport { greyBackgroundAndSmaller } from 'lib/styles/media-queries'\nimport { SHIPPING_ADDRESS_OPTIONS } from '../../../../lib/constants'\nimport cssTokens from '../../lib/styles/tokens'\nimport { escape as escapeHtml } from 'lodash'\nimport { isFeeTransparencyUpliftTrmt } from '../../experiments/feeTransparencyUplift'\n\nconst { sysColorBackgroundMediumContrast } = cssTokens\nconst i18n = content('widgets/addressDropdown')\nconst Container = glamorous.div(({ isTrmt }) => ({\n margin: isTrmt ? '4px 0' : '1rem 0',\n [greyBackgroundAndSmaller]: {\n margin: isTrmt ? '4px 0' : '1rem 0',\n },\n}))\n\nclass AddressDropdown extends React.Component {\n static propTypes = {\n addresses: PropTypes.array.isRequired,\n addressEntryFormat: PropTypes.object.isRequired,\n selectedAddress: PropTypes.object.isRequired,\n handleAddAddress: PropTypes.func.isRequired,\n handleSelectAddress: PropTypes.func.isRequired,\n selectElementId: PropTypes.string.isRequired,\n yourAddressContentKey: PropTypes.string.isRequired,\n addNewAddressContentKey: PropTypes.string.isRequired,\n shouldRenderLabel: PropTypes.bool.isRequired,\n hasNoAddressNeededOption: PropTypes.bool.isRequired,\n shakeBillingLabel: PropTypes.bool,\n dispatch: PropTypes.func,\n dir: PropTypes.string.isRequired,\n showENSubTextRTR: PropTypes.bool,\n }\n\n renderDropdownOptions = () => {\n return this.props.addresses\n .map(address => {\n const selectedAddressSingleLine = this.convertAddressToSingleLine(\n address\n )\n // Do not show invalid address\n return selectedAddressSingleLine\n ? {\n value: address.id,\n label: escapeHtml(selectedAddressSingleLine),\n }\n : undefined\n })\n .filter(option => option !== undefined) // remove invalid addresses\n }\n\n convertAddressToSingleLine = address => {\n const ellipsis = i18n('label.ellipsis')\n\n const griffinMappedAddress = {\n address_line_1:\n (address.addressLine1 && address.addressLine1.value) ||\n address.address_line_1,\n address_line_2:\n (address.addressLine2 && address.addressLine2.value) ||\n address.address_line_2,\n admin_area_2:\n (address.city && address.city.value) || address.admin_area_2,\n admin_area_1:\n (address.state && address.state.value) || address.admin_area_1,\n postal_code:\n (address.zipcode && address.zipcode.value) || address.postal_code,\n country_code: address.countryCode || address.country_code,\n }\n const singleLine = AddressUtils.formatAddressToSingleLine(\n griffinMappedAddress\n )\n\n return singleLine.length > 75\n ? singleLine.substring(0, 75) + ellipsis\n : singleLine\n }\n\n handleChange = event => {\n if (event.target.value === SHIPPING_ADDRESS_OPTIONS.ADD_ADDRESS) {\n return this.props.handleAddAddress()\n }\n\n this.props.handleSelectAddress(event.target.value)\n }\n\n handleClick = () => {\n this.props.handleAddAddress()\n tracking(Events.p2p_review_shipping_address_pressed())\n }\n\n componentDidUpdate(prevProps) {\n if (this.props.shakeBillingLabel && !prevProps.shakeBillingLabel) {\n setTimeout(() => {\n this.props.dispatch(\n CardActions.handleNoBillingAddress(this.props.shakeBillingLabel)\n )\n }, 2000)\n }\n }\n\n render() {\n const {\n yourAddressContentKey,\n selectElementId,\n addresses,\n selectedAddress,\n hasNoAddressNeededOption,\n addNewAddressContentKey,\n showENSubTextRTR,\n shakeBillingLabel,\n } = this.props\n\n return (\n \n {addresses.length > 0 && (\n \n {i18n(yourAddressContentKey)}\n {showENSubTextRTR && `(${enRTRStrings[yourAddressContentKey]})`}\n \n }\n options={[\n ...(hasNoAddressNeededOption\n ? [\n {\n value: SHIPPING_ADDRESS_OPTIONS.NO_ADDRESS_NEEDED,\n label: i18n('label.noAddressNeeded'),\n },\n ]\n : []),\n ...this.renderDropdownOptions(),\n {\n value: SHIPPING_ADDRESS_OPTIONS.ADD_ADDRESS,\n label: i18n(addNewAddressContentKey),\n },\n ]}\n data-nemo=\"add-shipping-address\"\n value={selectedAddress.id}\n onChange={this.handleChange}\n onClick={() =>\n tracking(Events.p2p_review_shipping_address_pressed())\n }\n />\n )}\n {addresses.length === 0 && (\n <>\n \n {i18n(addNewAddressContentKey)}\n \n {showENSubTextRTR && (\n \n {enRTRStrings[addNewAddressContentKey]}\n \n )}\n \n )}\n \n )\n }\n}\n\nexport default AddressDropdown\n","/**\n * Utilities that deal with address, leveraging client-side Griffin 🎉\n */\nimport griffinAddress from 'griffin-paypal/address'\nimport getGriffinMetadata from './griffin-utils'\n\n/**\n * Get the supported currency pattern for specific style for the current locale\n * @param {Object} address griffin portable address object\n * @return {String} the address into single line\n */\n\nexport function formatAddressToSingleLine(address: Object) {\n const griffinMetadata = getGriffinMetadata()\n const griffinHandler = griffinAddress.createHandler(griffinMetadata)\n\n try {\n const result = griffinHandler.formatAddress(address, {\n style: griffinHandler.ADDRESS_FORMAT_DISPLAY_SINGLE,\n })\n if (typeof result === 'string') {\n return result\n }\n throw result\n } catch (error) {\n // for error scenario griffin returns an error object so this fn must return empty string to downstream\n window.onerror('griffin::formatAddressToSingleLine', '', 0, 0, error)\n return ''\n }\n}\n","import { ActionTypes as types } from '../constants'\n\nexport function handleNoBillingAddress(shakeBillingLabel) {\n return {\n type: types.ADDRESS.NO_BILLING_ADDRESS,\n shakeBillingLabel: !shakeBillingLabel,\n }\n}\n","import PropTypes from 'prop-types'\nimport React from 'react'\nimport { connect } from 'transfer/utils/p2p-connect'\nimport AddressDropdown from './addressDropdown'\nimport * as OverpanelActions from '../actions/overpanels'\nimport * as AddressActions from '../actions/address'\nimport { ENV_TYPE } from '../../../../lib/constants'\n\nclass ShippingAddressDropdown extends React.Component {\n static propTypes = {\n hasNoAddressNeededOption: PropTypes.bool,\n dispatch: PropTypes.func.isRequired,\n env: PropTypes.string.isRequired,\n handleSelectAddress: PropTypes.func.isRequired,\n selectedAddress: PropTypes.shape({\n id: PropTypes.string,\n }),\n onAddressChanged: PropTypes.func,\n dir: PropTypes.string.isRequired,\n validateAmount: PropTypes.func,\n }\n\n static defaultProps = {\n hasNoAddressNeededOption: true,\n handleSelectAddress: () => {},\n }\n\n handleAddAddress = () => {\n const { env = '', validateAmount = () => {} } = this.props\n if (env === ENV_TYPE.DONATE && !validateAmount()) {\n return\n }\n this.props.dispatch(\n OverpanelActions.toggleAddShippingAddressOverpanel({ show: true })\n )\n }\n\n handleSelectAddress = id => {\n const {\n onAddressChanged = () => {},\n validateAmount = () => {},\n dispatch,\n env = '',\n } = this.props\n if (env === ENV_TYPE.DONATE && !validateAmount()) {\n return\n }\n dispatch(AddressActions.changeSelectedShippingAddress(id))\n onAddressChanged(id)\n }\n\n render() {\n // TODO: avoid env. specific stuff in components\n const isDonate = this.props.env === ENV_TYPE.DONATE\n const selectElementId = isDonate ? 'mailingAddress' : 'shippingAddress'\n const yourAddressContentKey = `label.your${\n isDonate ? 'Mailing' : 'Shipping'\n }Address`\n const addNewAddressContentKey = `label.addNew${\n isDonate ? 'Mailing' : 'Shipping'\n }Address`\n return (\n \n )\n }\n}\n\nfunction noAddressNeededOption(defaultOption, env, shippingType, isCharity) {\n if (env === ENV_TYPE.DONATE) {\n return defaultOption\n }\n return !isCharity\n}\n\nexport default connect(\n (\n { address, server, recipient, transaction },\n { hasNoAddressNeededOption }\n ) => ({\n addressEntryFormat: address.addressEntryFormat,\n addresses: address.addresses,\n selectedAddress: address.selectedShippingAddress,\n env: server.env,\n dir: server.directionality,\n hasNoAddressNeededOption: noAddressNeededOption(\n hasNoAddressNeededOption,\n server.env,\n transaction.shippingType,\n recipient.isCharity\n ),\n })\n)(ShippingAddressDropdown)\n","import { StyleSheet } from 'lib/paypalphrodite'\n\nexport default StyleSheet.create({\n addressWrapper: {\n padding: '0px 28px 0px',\n },\n toolCheckboxWrapper: {\n position: 'absolute',\n width: 'inherit',\n display: 'inline',\n },\n inputCheckBox: {\n width: 25,\n height: 20,\n },\n toolCheckbox: {\n ':before': {\n overflow: 'hidden',\n height: '1em',\n width: '1em',\n padding: '0.3em 0em',\n },\n },\n addressContent: {\n margin: '0 0 0 40px',\n display: 'inline-block',\n },\n srLabel: {\n position: 'absolute',\n width: 1,\n height: 1,\n overflow: 'hidden',\n },\n tipIcon: {\n color: '#005EA6',\n cursor: 'pointer',\n textDecoration: 'none',\n width: 0,\n height: 0,\n padding: 0,\n },\n toolTipTxt: {\n backgroundColor: '#e1e7eb',\n fontSize: 12,\n lineHeight: 1.8,\n textAlign: 'left',\n borderRadius: 6,\n padding: '5px 7px',\n display: 'block',\n },\n})\n","// Add amount to props\nimport PropTypes from 'prop-types'\nimport React from 'react'\nimport { rtlConvertInline, css } from 'lib/paypalphrodite'\nimport { connect } from 'transfer/utils/p2p-connect'\nimport ShippingAddressDropdown from './shippingAddressDropdown'\nimport content from 'pp-react-l10n'\nimport {\n amountIsZero,\n amountAboveMinimumDonation,\n amountBelowMaximumDonation,\n} from '../../lib/amountUtils'\nimport { ActionTypes as types, DONATION_VALIDATION_TYPES } from '../constants'\nimport styles from './share-my-address.styles'\nimport * as SendActions from 'transfer/actions/send'\n\nconst i18n = content('transfer/inc/donateDropdown')\n\nclass ShareMyAddress extends React.Component {\n static propTypes = {\n shareAddress: PropTypes.bool,\n shippingRequired: PropTypes.bool.isRequired,\n dispatch: PropTypes.func.isRequired,\n amount: PropTypes.string,\n currencyCode: PropTypes.string,\n currencyDecimal: PropTypes.string,\n isAmountReadOnly: PropTypes.bool,\n dir: PropTypes.string,\n donationContext: PropTypes.object,\n }\n\n validateAmount = () => {\n if (amountIsZero(this.props.amount, this.props.currencyDecimal)) {\n this.props.dispatch({\n type: types.EXTERNAL.SHOW_AMOUNT_IS_ZERO_ERROR,\n })\n return false\n }\n\n if (\n !amountAboveMinimumDonation(\n this.props.isAmountReadOnly,\n this.props.amount,\n this.props.donationContext.minimum_amount,\n this.props.currencyCode\n )\n ) {\n this.props.dispatch({\n type: types.EXTERNAL.SHOW_AMOUNT_DONATION_ERROR,\n data: DONATION_VALIDATION_TYPES.AMOUNT_BELOW_MINIMUM,\n })\n return false\n }\n\n if (\n !amountBelowMaximumDonation(\n this.props.isAmountReadOnly,\n this.props.amount,\n this.props.donationContext.maximum_amount,\n this.props.currencyCode\n )\n ) {\n this.props.dispatch({\n type: types.EXTERNAL.SHOW_AMOUNT_DONATION_ERROR,\n data: DONATION_VALIDATION_TYPES.AMOUNT_ABOVE_MAXIMUM,\n })\n return false\n }\n return true\n }\n\n reFetchFundingOptions = () => {\n if (this.validateAmount()) {\n this.props.dispatch(SendActions.fetchFundingOptions())\n }\n return\n }\n\n render() {\n if (!this.props.shippingRequired) {\n return null\n }\n\n return (\n
\n \n \n
\n \n {i18n('label.helperText')}\n \n \n )\n }\n}\n\nexport default connect(({ external, amount, server }) => ({\n shippingRequired: external.shippingRequired,\n shareAddress: external.shareAddress,\n amount: amount.amount,\n currencyCode: amount.currencyCode,\n currencyDecimal: amount.currencyDecimal,\n isAmountReadOnly: !!external.isAmountReadOnly,\n dir: server.directionality,\n donationContext: external.donationContext,\n}))(ShareMyAddress)\n","import React, { Component } from 'react'\nimport PropTypes from 'prop-types'\nimport { connect } from 'transfer/utils/p2p-connect'\nimport content from 'pp-react-l10n'\nimport { formatAmount } from '../utils/currencyUtils'\nimport { get } from 'lodash'\nimport { DONATION_VALIDATION_TYPES } from '../constants'\n\nconst i18n = content('transfer/inc/amount')\n\nconst STYLES = {\n error: {\n color: 'grey700',\n fontSize: '13px',\n },\n criticalIcon: {\n color: '#D20000',\n position: 'relative',\n top: '-2px',\n height: 13.18,\n width: 14.83,\n },\n}\n\n/**\n * Component for displaying amount validation error message\n */\nexport class AmountDonationValidationError extends Component {\n render() {\n if (\n this.props.donationValidationType ===\n DONATION_VALIDATION_TYPES.AMOUNT_VALID\n ) {\n return null\n }\n\n let errorMessageKey = 'errorText.minimumDonationUS'\n let amount = '1.00'\n let currencyCode = 'USD'\n\n if (\n this.props.donationValidationType ===\n DONATION_VALIDATION_TYPES.AMOUNT_ABOVE_MAXIMUM\n ) {\n amount = get(this.props.donationContext, 'maximum_amount.value')\n currencyCode = get(this.props.donationContext, 'maximum_amount.currency')\n errorMessageKey = 'errorText.maximumDonation'\n } else {\n amount = get(this.props.donationContext, 'minimum_amount.value', '1.00')\n currencyCode = get(\n this.props.donationContext,\n 'minimum_amount.currency',\n 'USD'\n )\n if (currencyCode === 'USD' && Number(amount) < 1) {\n amount = '1.00'\n }\n errorMessageKey = 'errorText.minimumDonationUS'\n }\n\n const formattedAmount = formatAmount(\n amount,\n currencyCode,\n 'CURRENCY_FORMAT'\n )\n return (\n \n \n \n {i18n(errorMessageKey, { amount: formattedAmount })}\n \n \n )\n }\n}\n\nAmountDonationValidationError.propTypes = {\n donationValidationType: PropTypes.string,\n donationContext: PropTypes.object,\n}\n\nexport default connect(({ external }) => ({\n donationValidationType: external.donationValidationType,\n donationContext: external.donationContext,\n}))(AmountDonationValidationError)\n","import React from 'react'\nimport PropTypes from 'prop-types'\nimport { connect } from 'transfer/utils/p2p-connect'\nimport content from 'pp-react-l10n'\nimport { Icon } from '@paypalcorp/pp-react'\nconst i18n = content('transfer/inc/note')\n\nconst STYLES = {\n errorField: {\n textAlign: 'left',\n paddingLeft: '10px',\n },\n errorText: {\n color: '#687173',\n fontSize: '14px',\n },\n criticalIcon: {\n color: '#D20000',\n marginRight: '0.75rem',\n verticalAlign: 'bottom',\n },\n}\n\nexport function NoteMaxCharLimitError(props) {\n const errorText = 'note.errorMaxCharacterLimit'\n\n if (!props.showNoteMaxCharLimitError) {\n return null\n }\n\n return (\n
\n \n \n \n {i18n(errorText)}\n \n \n
\n )\n}\n\nNoteMaxCharLimitError.propTypes = {\n showNoteMaxCharLimitError: PropTypes.bool,\n}\n\nexport default connect(({ external }) => ({\n showNoteMaxCharLimitError: external.showNoteMaxCharLimitError,\n}))(NoteMaxCharLimitError)\n","import glamorous from 'glamorous'\n\nconst Separator = glamorous.div({\n border: 0, // override defaults\n borderTop: '1px solid #dedede !important',\n maxWidth: 444,\n margin: '0 auto',\n padding: 0,\n height: 0,\n})\n\nexport default Separator\n","/**\n * This file gets loaded when we are operating within a \"donate\" environment.\n * The donate environment comes from coming from the donation flow and transitioning to '/transfer/buy/external/donate',\n * which redirects to the preview page.\n */\n\nimport React from 'react'\nimport { postMessageUp } from 'iframe-support'\nimport * as fpti from '../../lib/analytics/fpti'\nimport store from '../stores/configureStore'\nimport ShareMyAddress from '../components/share-my-address'\nimport AmountDonationValidationError from '../components/amount-donation-validation-error'\nimport NoteMaxCharLimitError from '../components/note-max-char-limit-error'\nimport Separator from '../components/separator'\nimport { ENV_TYPE } from '../../../../lib/constants'\n\nexport default {\n // experimental way to pass in components from hooks\n // TODO: find a way to externalize these components\n // or just bring them into the app fully\n customComponents: [\n {\n page: 'preview',\n position: 'before:userAgreement',\n component: ,\n },\n {\n page: 'send-amount-field',\n position: 'after:firstTimeHelp',\n component: ,\n },\n {\n page: 'send-amount-field',\n position: 'before:firstTimeHelp',\n component: ,\n },\n {\n page: 'note-with-gift',\n position: 'after:note',\n component: ,\n },\n ],\n\n // TODO: find a way to externalize this as well\n initializeHook() {\n fpti.overrideEnvironment(ENV_TYPE.DONATE)\n },\n\n // DEPRECATED: THESE ARE ONLY USED IN THE LEGACY DONATE IFRAME\n\n loadingStateChangedHook({ isLoading }) {\n // TODO: update donatenodeweb:p2pframe.js to support true/false\n if (isLoading) {\n postMessageUp({ toggleLoading: isLoading })\n } else {\n // there's no current way to send a \"stop loading\" message\n postMessageUp({ statusMessage: 'fundingOptionsRendered' })\n }\n },\n\n sessionTimerOverlayRenderedHook() {\n postMessageUp({ statusMessage: 'sessionTimerOverlayRendered' })\n },\n\n // see: donatenodeweb:public/js//member/review.js\n showAddNewFIHook() {\n postMessageUp({ statusMessage: 'addNewFIRendered' })\n },\n\n previewPageAfterRenderHook() {\n postMessageUp({ statusMessage: 'fundingOptionsRendered' })\n },\n\n previewPageSendSubmitHook(props = {}) {\n const {\n amount = {},\n external = {},\n donate = {},\n transaction = {},\n address: {\n selectedShippingAddress: { id: selectedShippingAddressId },\n },\n } = store.getState() || {}\n const donatedAmount = amount.amount\n const currencyCode = amount.currencyCode\n const giftAidItFlag = external.donationGiftAidCheckbox\n const donationAnonymousStatus = donate.donationAnonymousStatus\n const selectedRecurringFrequency = external.selectedRecurringFrequency\n const {\n cvv,\n threeDS2ReferenceId,\n threeDS2TransactionId,\n is3DS2ChallengeRequired,\n } = transaction\n\n const { isRecurring, recipient, selectedFundingOption } = props\n postMessageUp({\n statusMessage: 'previewPageSendAction',\n data: {\n isRecurring,\n recipient,\n selectedFundingOption,\n selectedShippingAddressId,\n giftAidItFlag,\n donatedAmount,\n currencyCode,\n threeDS2ReferenceId,\n threeDS2TransactionId,\n cvv,\n donationAnonymousStatus,\n selectedRecurringFrequency,\n is3DS2ChallengeRequired,\n },\n })\n },\n\n successPageAfterRenderHook() {\n const {\n amount = {},\n external = {},\n transaction: { paymentDetails = {}, selectedFundingOption = {} } = {},\n } = store.getState() || {}\n const donatedAmount = amount.amount\n const currencyCode = amount.currencyCode\n const giftAidCheckboxFlag =\n external.donationGiftAidCheckbox ||\n external.donationGiftAid?.isAlreadyEnrolled\n\n postMessageUp({\n statusMessage: 'successPageRendered',\n data: {\n paymentId: paymentDetails.payment_id,\n selectedFundingOption: selectedFundingOption,\n donationGiftaid: giftAidCheckboxFlag,\n donatedAmount: donatedAmount,\n currencyCode: currencyCode,\n },\n })\n // TODO: move to this thing, by changing donateweb:p2pFrame.js\n // postMessageUp({ successPageRendered: paymentDetails.payment_id })\n },\n\n requestUnifiedLoginHook() {\n postMessageUp({\n statusMessage: 'requestUnifiedLogin',\n })\n },\n}\n","/**\n * This file returns a map of all 3rd party hooks stored in the hooks directory.\n * To import the hooks, you can use `import { donate } from '../path/to/hooks'`\n */\n\nimport donate from './donate'\nimport { ENV_TYPE } from '../../../../lib/constants'\n\nconst hooks = {\n [ENV_TYPE.DONATE]: donate,\n}\n\nexport function getExternalComponents(env, page) {\n const hook = hooks[env] || {}\n const customComponents = hook.customComponents || []\n return function(position) {\n const filteredComponents = customComponents\n .filter(x => x.page === page && x.position === position)\n .map(x => x.component)\n\n // TODO: return all components? will have to add `key` prop somehow\n return filteredComponents[0]\n }\n}\n\nexport { hooks }\nexport default hooks\n","\"use strict\";\nmodule.exports = require(\"./lib/client/address\");\n","/**\n * Shared code between Griffin Node.js and Griffin client.\n *\n * Important: Do NOT include anything in here that isn't meant to be part of both libraries.\n */\n\n\"use strict\";\n\nvar assertion = require(\"./client/utils/assertion\");\nvar assertRange = assertion.assertRange;\nvar assertType = assertion.assertType;\n\nvar basic = require(\"./client/utils/basic\");\nvar defineProperties = basic.defineProperties;\nvar getValueOrDefault = basic.getValueOrDefault;\nvar isLatin = basic.isLatin;\nvar jsonDeepMerge = basic.jsonDeepMerge;\nvar objectGet = basic.objectGet;\nvar objectValues = basic.objectValues;\nvar trimObject = basic.trimObject;\nvar objectAssign = require(\"object-assign\");\n\nvar STYLES = {\n ADDRESS_FORMAT_INPUT: \"input\",\n ADDRESS_FORMAT_DISPLAY_SINGLE: \"single_line\",\n ADDRESS_FORMAT_DISPLAY_MULTI: \"multi_line\"\n};\n\nvar TYPES = {\n ADDRESS_COARSE: \"coarse\",\n ADDRESS_PORTABLE: \"portable\",\n ADDRESS_PORTABLE_WITH_DETAILS: \"detailed\"\n};\n\nvar tranformFromTypeToTypeMapping = {\n coarse: [TYPES.ADDRESS_PORTABLE],\n portable: [TYPES.ADDRESS_COARSE],\n detailed: [TYPES.ADDRESS_PORTABLE]\n};\n\nvar styleValues = objectValues(STYLES);\nvar typeValues = [TYPES.ADDRESS_COARSE, TYPES.ADDRESS_PORTABLE];\nvar transformTypeValues = objectValues(TYPES);\n\n// PPaaS: https://github.paypal.com/ApiSpecifications-R/CommonComponentsSpecification/blob/v3/schema/address.json\nvar COARSE_ADDRESS_FIELDS = [\n \"line1\",\n \"line2\",\n \"state\",\n \"city\",\n \"postal_code\",\n \"country_code\"\n];\nvar COARSE_CONTEXT_FIELD_MAP = {\n DISPLAY: COARSE_ADDRESS_FIELDS // array of all display fields for coarse address\n};\n\n// PPaaS: https://github.paypal.com/ApiSpecifications-R/CommonComponentsSpecification/blob/v3/schema/address_portable.json\nvar ADDRESS_LINES = [\"address_line_1\", \"address_line_2\", \"address_line_3\"];\nvar PORTABLE_ADDRESS_FIELDS = ADDRESS_LINES.concat([\n \"admin_area_4\",\n \"admin_area_3\",\n \"admin_area_2\",\n \"admin_area_1\",\n \"postal_code\",\n \"country_code\"\n]);\nvar PORTABLE_ADDRESS_DETAILED_ONLY_FIELDS = [\n \"address_details.building_name\",\n \"address_details.delivery_service\",\n \"address_details.street_name\",\n \"address_details.street_number\",\n \"address_details.street_type\",\n \"address_details.sub_building\"\n];\nvar PORTABLE_ADDRESS_WITH_DETAILS_FIELDS = PORTABLE_ADDRESS_FIELDS.concat(\n PORTABLE_ADDRESS_DETAILED_ONLY_FIELDS\n);\nvar _addressNameFields = [\"full_name\", \"business_name\"];\nvar PORTABLE_CONTEXT_FIELD_MAP = {\n DISPLAY: _addressNameFields.concat(PORTABLE_ADDRESS_FIELDS) // array of all display fields for portable address (includes name fields)\n};\n\nvar TYPE_FIELDS_MAP = {\n coarse: COARSE_ADDRESS_FIELDS,\n portable: PORTABLE_ADDRESS_FIELDS,\n detailed: PORTABLE_ADDRESS_WITH_DETAILS_FIELDS\n};\n\nvar POSTAL_CODE_TYPE = \"postal_code\";\n\nvar PORTABLE_DETAIL_REQUIRED_ERROR = [\n {\n name: \"ADDRESS_REQUIRED_FIELD_MISSING\",\n message: \"A required address field is missing\",\n detail: \"address_details\"\n }\n];\n\nfunction metadataLayoutAndProperties(props) {\n var script;\n var address = props.address;\n var handlerDefaultScript = props.handlerDefaultScript;\n var metadata = props.metadata;\n var style = props.style || STYLES.ADDRESS_FORMAT_INPUT;\n var type = props.type;\n\n if (style === STYLES.ADDRESS_FORMAT_INPUT) {\n // The preferred script for input format is the handler default script (if available) or Latn.\n script = objectGet(metadata, [\n \"territory\",\n address.country_code,\n \"script\",\n handlerDefaultScript\n ])\n ? handlerDefaultScript\n : \"Latn\";\n } else {\n script = addressScript({\n address: address,\n metadata: metadata,\n type: type\n });\n }\n\n // Note: No fallback to 'Default' because address_v2 has metadata for all assigned countries.\n // return { layout, properties } || {}.\n return (\n objectGet(metadata, [\n \"territory\",\n address.country_code,\n \"script\",\n script,\n \"layout_type\",\n type + \"_\" + style\n ]) || {}\n );\n}\n\nfunction metadataTransformMapping(metadata, territory, fromType, toType) {\n return objectGet(metadata, [\n \"territory\",\n territory,\n \"transform_mapping\",\n fromType + \"_to_\" + toType\n ]);\n}\n\n/**\n * Given a parameter, assert it's a valid address.\n * @param {Object} address the address object\n * @throws TypeError\n */\nfunction assertAddress(address) {\n assertType(address, \"address\", [\"plain object\"]);\n var props = Object.keys(address);\n if (address.address_details) {\n props = props.concat(\n Object.keys(address.address_details).map(function(addressDetailsField) {\n return \"address_details.\" + addressDetailsField;\n })\n );\n }\n props.forEach(function(propName) {\n var propValue = objectGet(address, propName.split(\".\"));\n if (propName === \"address_details\") {\n assertType(propValue, \"address.\" + propName, [\"plain object\"]);\n return;\n }\n assertType(propValue, \"address.\" + propName, [\n \"undefined\",\n \"null\",\n \"string\"\n ]);\n });\n}\n\n/**\n * Given a parameter, assert it's a valid country code parameter.\n * @param {string} address the address object\n * @param {Object} environment (Node or client) dependencies\n * @throws TypeError\n */\nfunction assertCountryCode(countryCode, metadata, dependencies) {\n var getCountry = dependencies.getCountry;\n countryCode = getCountry(countryCode); // resolve country_code or fall back to handler country\n\n // 1: Territory keys corresponds to all loaded/supported countries.\n assertRange(\n countryCode,\n metadata.territory /* 1 */,\n \"Unsupported value for address.country_code: {countryCode}\",\n { countryCode: countryCode }\n );\n return countryCode;\n}\n\n/**\n * Given a parameter, assert it's a valid options.type.\n * @param {Object} optionsType the options.type object\n * @throws TypeError\n */\nfunction assertOptionsType(optionsType) {\n var type = getValueOrDefault(optionsType, TYPES.ADDRESS_PORTABLE);\n assertType(type, \"options.type\", [\"string\"]);\n assertRange(type, typeValues, \"Invalid value for options.type: {type}\", {\n type: type\n });\n return type;\n}\n\n/**\n * Given an address object and a type (coarse or portable),\n * return true if the address is completely Latin characters\n * @param {Object} address the address object to test\n * @param {string} type 'portable' or 'coarse' (default)\n * @return {boolean} true if the address is completely Latin\n */\nfunction isLatinAddress(address, type) {\n // get list of fields to check based on type (default to coarse)\n var fieldsToCheck =\n type === \"portable\"\n ? PORTABLE_CONTEXT_FIELD_MAP.DISPLAY // use full set of display fields (including name)\n : COARSE_CONTEXT_FIELD_MAP.DISPLAY;\n\n // filter out postal_code, which should not be checked\n fieldsToCheck = fieldsToCheck.filter(function(field) {\n return field !== \"postal_code\";\n });\n\n // return true if all checked fields are Latin in the given address\n return fieldsToCheck.every(function(field) {\n return isLatin(address[field]);\n });\n}\n\n/**\n * Determine the script to use when attempting to load address metadata\n * cf. https://github.paypal.com/Globalization-Playground/griffin-client-address-design#script-detection\n * If input style: Script = default script of handler language\n * If display style: Script = Latn if address is all Latin, otherwise country default address script\n *\n * NOTE: This assumes that `country` has already been resolved to address.country_code\n * or handler country if address.country_code didn't exist\n *\n * @param {Object} props.address the address object\n * @param {string} props.handlerDefaultScript the default script for the handler language\n * @param {Object} props.metadata\n * @param {string} props.style input, multi_line, or single_line\n * @param {string} props.type coarse or portable\n */\nfunction addressScript(props) {\n var address = props.address;\n var metadata = props.metadata;\n var type = props.type;\n\n // If address is all Latin, always use Latn script\n if (isLatinAddress(address, type)) {\n return \"Latn\";\n }\n\n // Otherwise, use the default address script for the country (which is guaranteed to be in the metadata)\n return objectGet(metadata, [\n \"territory\",\n address.country_code,\n \"primary_script\"\n ]);\n}\n\n/**\n * Given \"{abc}\", return \"abc\"\n * @param {string} str string wrapped in curly braces\n * @return {string} what's inside the curly braces\n */\nfunction unwrapBraces(str) {\n if (!str) {\n return;\n }\n return str.replace(/^{(.*?)}$/, \"$1\"); // e.g., \"{state}\" --> \"state\"\n}\n\n/**\n * Given an address object and metadata (from addressV2Meta)\n * Munge them together to produce an address input object (the return value for ADDRESS_FORMAT_INPUT style)\n *\n * @param {Object} address\n * @param {Object} metadata\n *\n * @return {Object} address input object: {layout, properties}\n */\nfunction createInputObject(props) {\n var address = props.address;\n var detailedLayout = props.detailedLayout;\n var layout = props.layout;\n var metadata = props.metadata;\n var properties = props.properties;\n var type = props.type;\n\n var strings = objectGet(metadata, [\n \"territory\",\n address.country_code,\n \"strings\"\n ]);\n\n // 1: Metadata at this point includes one only handler\n strings = strings[Object.keys(strings)[0] /* 1 */];\n\n var labels = objectGet(strings, [\"address_\" + type, \"labels\"]);\n var presetValues = objectGet(strings, \"preset_values\");\n strings = objectGet(strings, \"address_\" + type);\n\n return jsonDeepMerge(\n {\n layout: layout,\n\n properties: Object.keys(properties).reduce(function(accumulator, field) {\n var fieldProperties = properties[field] || {};\n var list = objectGet(strings, [\"preset_values\", field, \"list\"]);\n var groupList = objectGet(strings, [\n \"preset_values\",\n field,\n \"group_list\"\n ]);\n\n // pick out field properties to expose in input object (exclude validation_regex)\n accumulator[field] = {\n casing: fieldProperties && fieldProperties.casing,\n\n // note max_length --> maxLength\n maxLength: fieldProperties && fieldProperties.max_length,\n\n required: fieldProperties && fieldProperties.required,\n\n hidden: fieldProperties && fieldProperties.hidden,\n\n disabled: fieldProperties && fieldProperties.disabled,\n\n label: labels[field],\n\n // for value, use the preset_data from metadata, or the address input, or just empty string\n // Note: using `objectGet` due to portable address detailed fields like address_details.street_name.\n value:\n fieldProperties.preset_data ||\n objectGet(address, field.split(\".\")) ||\n \"\",\n\n list: presetValues[unwrapBraces(list)],\n\n groupList: presetValues[unwrapBraces(groupList)]\n };\n\n stripUndefined(accumulator[field]); // strip any undefined properties\n\n if (fieldProperties && fieldProperties.disabled) {\n delete accumulator[field];\n }\n\n return accumulator;\n }, {})\n },\n detailedLayout && { detailedLayout: detailedLayout }\n );\n}\n\n/**\n * Given an object with properties, remove any undefined properties\n * Note: Mutates the input object\n * @param {Object} obj\n * @return {Object}\n */\nfunction stripUndefined(obj) {\n Object.keys(obj).forEach(function(key) {\n if (obj[key] === undefined) {\n delete obj[key];\n }\n });\n return obj;\n}\n\n/**\n * Given an address, layout (from metadata), and list of relevant fields,\n * populate a layout array with values from the address object to create a \"parts\" array\n *\n * @param {Object} address the address object\n * @param {Object} layout\n * @param {string} type the address type\n *\n * @returns {array} the parts array populated with values from the address object\n * This allows for further processing to prevent consecutive/trailing/leading separators:\n * [\n * [\n * { type: 'address_line_1', value: '123 Smith Dr.' }\n * ],\n * ...\n * [\n * { type: 'admin_area_2', value: 'San Jose' },\n * { type: 'separator', value: ', ' },\n * { type: 'admin_area_1', value: 'CA' },\n * { type: 'separator', value: ' ' },\n * { type: 'postal_code', value: '95131' }\n * ],\n * [\n * { type: 'country_code', value: 'UNITED STATES OF AMERICA' }\n * ]\n * ]\n *\n */\nfunction addressToParts(address, layout, type) {\n // get all possible display fields for this address type\n var displayFields =\n type === TYPES.ADDRESS_COARSE\n ? COARSE_CONTEXT_FIELD_MAP.DISPLAY\n : PORTABLE_CONTEXT_FIELD_MAP.DISPLAY; // includes full_name and organization\n\n // Note: loop over all components in the layout metadata, not just the fields present in the address object,\n // because we need to display some fields (e.g. SG city) even when address object doesn't have it\n\n // loop over lines in layout\n return layout.map(toParts.bind(null, address, displayFields));\n}\n\n/**\n * Performs address transformations, e.g., preset_data, casing, etc.\n * @param {array} addressParts address parts as returned by addressToParts().\n * @param {Object} properties address metadata properties.\n * @example\n * applyDisplayTransforms([[... { type: 'admin_area_1', value: 'ca' }, ...], ...], properties);\n * // > [[..., { type: 'admin_area_1', value: 'CA' }, ...], ...]\n * // (note CA)\n */\nfunction applyDisplayTransforms(addressParts, properties) {\n addressParts.forEach(function(parts) {\n parts.forEach(function(part) {\n if (part.type === \"separator\") {\n return part;\n }\n\n // pull out properties for this field (to get preset_data and casing)\n var fieldProperties = properties[part.type] || {};\n\n // construct field value based on preset_data, casing, etc.\n part.value = produceFieldText(part.value, fieldProperties);\n });\n });\n}\n\n/**\n * Return an address line \"parts\".\n * @param {Object} address the address object.\n * @param {array} addressFields list of fields of the address (according to its type).\n * @param {array} line metadata layout line\n * @return {array} the line parts populated with values from the address object.\n * [\n * { type: 'address_line_1', value: '123 Smith Dr.' }\n * ]\n */\nfunction toParts(address, addressFields, line) {\n // loop over fields in this line\n return line.map(function(field) {\n // if the field name from the metadata doesn't match one of the display fields,\n // then it's just a literal separator\n if (addressFields.indexOf(field) === -1) {\n return {\n type: \"separator\",\n value: field\n };\n }\n return {\n // Note: using `objectGet` due to portable address detailed fields like address_details.street_name.\n type: field,\n value: objectGet(address, field.split(\".\"))\n };\n });\n}\n\n/**\n * Given address field text and metadata, return the text to display for this field\n * Returns preset_data if it exists, otherwise applies casing and appends affixes\n *\n * @param {string|undefined} inputText text from the address object for this field\n * @param {Object} fieldProperties metadata 'properties' section for this field\n * @return {string} the appropriate text to display for this field\n */\nfunction produceFieldText(inputText, fieldProperties) {\n // preset_data (like \"SINGAPORE\") overrides anything\n if (fieldProperties.preset_data !== undefined) {\n return fieldProperties.preset_data;\n }\n\n var prefix = fieldProperties.prefix || \"\";\n var postfix = fieldProperties.postfix || \"\";\n var casing = fieldProperties.casing; // 'uppercase', 'lowercase', or undefined\n\n return prefix + applyCasing(inputText || \"\", casing) + postfix || \"\";\n}\n\n/**\n * Apply casing to a string\n *\n * @param {string} text the string to change\n * @param {string} casing 'uppercase' or 'lowercase'\n * @return {string} the text with casing (if any) applied\n */\nfunction applyCasing(text, casing) {\n if (casing === \"uppercase\") {\n return text.toUpperCase();\n } else if (casing === \"lowercase\") {\n return text.toLowerCase();\n }\n return text; // if no casing supplied, don't apply any casing\n}\n\n/**\n * Given address parts array (see 'addressToParts'), return an array of strings representing each line\n * With blank lines filtered and no consecutive, initial, or trailing separators\n * @param {array} addressParts\n * @return {array} array of strings (lines)\n */\nfunction partsToTextArray(addressParts) {\n return addressParts\n .map(function(parts) {\n return collapseParts(parts); // collapse this line parts array into a string\n })\n .filter(function(line) {\n return line !== \"\"; // remove any blank lines\n });\n}\n\n/**\n * Given a line parts array like this:\n * [\n * { type: 'admin_area_2', value: 'San Jose' },\n * { type: 'separator', value: ', ' },\n * { type: 'admin_area_1', value: 'CA' },\n * ...\n * ]\n * Collapse it into a string but without any consecutive, initial, or trailing separators\n *\n * @param {array} parts\n * @return {string} the line parts array collapsed into a string\n */\nfunction collapseParts(parts) {\n return parts\n .filter(function(part) {\n // filter any blank values\n return part.value;\n })\n .filter(function(part, index, array) {\n // filter any consecutive separators\n // skip non-separators\n if (part.type !== \"separator\") {\n return true;\n }\n // filter a separator if the next part is going to be a separator\n if (array[index + 1] && array[index + 1].type === \"separator\") {\n return false;\n }\n\n return true;\n })\n .filter(function(part, index, array) {\n // filter any initial or final separator\n // skip non-separators\n if (part.type !== \"separator\") {\n return true;\n }\n\n // filter any line-initial or line-final separators\n if (index === 0 || index === array.length - 1) {\n return false;\n }\n\n return true;\n })\n .reduce(function(lineString, part) {\n // combine all 'value' properties into a single string\n return (lineString += part.value);\n }, \"\");\n}\n\nfunction trimAddress(address, type) {\n // pare down to only relevant fields and trim string fields themselves\n // remove full_name and business_name because those values are passed in via options.name and options.organization\n var addressEntryFields =\n type === TYPES.ADDRESS_PORTABLE\n ? PORTABLE_ADDRESS_FIELDS.concat(\"address_details\")\n : COARSE_ADDRESS_FIELDS;\n\n return trimObject(address, addressEntryFields);\n}\n\n/**\n * Validates a specific field (`field` parameter, e.g. 'address_line_1') of the passed `address` object\n * based on the metadata `properties`.\n */\nfunction validateField(address, field, properties) {\n if (!properties[field]) {\n return [];\n }\n var re;\n var errors = [];\n var fieldValue = objectGet(address, field.split(\".\"));\n // Check for missing required address properties.\n if (properties[field].required && !fieldValue) {\n errors.push({\n name: \"ADDRESS_REQUIRED_FIELD_MISSING\",\n message: \"A required address field is missing\",\n detail: field\n });\n }\n // Check for invalid postal code.\n if (field === POSTAL_CODE_TYPE && properties[field].validation_regex) {\n // TODO Create the regular expression instance once elsewhere, not in here everytime.\n re = new RegExp(\"^\" + properties[field].validation_regex + \"$\");\n if (fieldValue && !re.test(fieldValue)) {\n errors.push({\n name: \"ADDRESS_PATTERN_VALIDATION_ERROR\",\n message: \"The field provided does not match the validation pattern\",\n detail: {\n field: field\n }\n });\n }\n }\n return errors;\n}\n\nfunction oldGriffinCoarseSupport(address) {\n var fixes = {};\n if (address.postcode !== undefined && address.postal_code === undefined) {\n fixes.postal_code = address.postcode;\n }\n if (address.country !== undefined && address.country_code === undefined) {\n fixes.country_code = address.country;\n }\n // Clone and set coarse address \"fixes\".\n if (Object.keys(fixes).length) {\n address = jsonDeepMerge(address, fixes);\n }\n return address;\n}\n\nfunction filterDisabledLayout(layout, properties) {\n if (!layout) {\n return layout;\n }\n var filterdLayout = [];\n for (var i = 0; i < layout.length; i = i + 1) {\n filterdLayout[i] = layout[i].filter(function(ele) {\n return properties[ele] ? !properties[ele].disabled : 1;\n });\n }\n return filterdLayout.filter(function(ele) {\n return ele.length;\n });\n}\n\n/**\n * The core formatAddress function, i.e., the full implementation should be in this function\n * except for environment dependent variables, which are passed via *dependencies* parameter.\n * @param {Object} address See README for details.\n * @param {Object} options See README for details.\n * @param {Object} dependencies Environment dependencies variables (Node.js vs client).\n * @returns See README for details.\n * @example See README for details.\n */\nfunction formatAddress(address, options, metadata, dependencies) {\n assertAddress(address);\n\n options = getValueOrDefault(options, {}); // Note that options is optional, since all its properties are optional\n assertType(options, \"options\", [\"plain object\"]);\n\n // extract options and validate them\n var style = getValueOrDefault(\n options.style,\n STYLES.ADDRESS_FORMAT_DISPLAY_MULTI\n );\n assertType(style, \"options.style\", [\"string\"]);\n assertRange(style, styleValues, \"Invalid value for options.style: {style}\", {\n style: style\n });\n var type = assertOptionsType(options.type);\n var showCountryName = getValueOrDefault(options.showCountryName, false); // omit country name by default\n assertType(showCountryName, \"options.showCountryName\", [\"boolean\"]);\n assertType(options.name, \"options.name\", [\"string\", \"undefined\"]);\n assertType(options.organization, \"options.organization\", [\n \"string\",\n \"undefined\"\n ]);\n\n if (type === TYPES.ADDRESS_COARSE) {\n address = oldGriffinCoarseSupport(address);\n }\n\n address = trimAddress(address, type);\n try {\n address.country_code = assertCountryCode(\n address.country_code,\n metadata,\n dependencies\n );\n } catch (err) {\n return {\n errors: [\n {\n name: \"ADDRESS_INVALID_COUNTRY_ERROR\",\n message:\n \"Unsupported country/region: \" +\n address.country_code +\n \" or was not loaded on the client metadata\",\n detail: { field: \"country_code\" }\n }\n ]\n };\n }\n var propertiesAndLayout = metadataLayoutAndProperties({\n address: address,\n handlerDefaultScript: dependencies.handlerDefaultScript,\n metadata: metadata,\n style: style,\n type: type\n });\n var properties = propertiesAndLayout.properties;\n var layout = filterDisabledLayout(propertiesAndLayout.layout, properties);\n var detailedLayout = filterDisabledLayout(\n propertiesAndLayout.detailedLayout,\n properties\n );\n\n if (style === STYLES.ADDRESS_FORMAT_INPUT) {\n return createInputObject({\n address: address,\n detailedLayout: detailedLayout,\n layout: layout,\n metadata: metadata,\n properties: properties,\n type: type\n });\n }\n\n if (type === TYPES.ADDRESS_PORTABLE && address.address_details) {\n address = portableAddressDetailedToRegular(\n address,\n metadataTransformMapping(\n metadata,\n address.country_code,\n \"detailed\",\n \"portable\"\n )\n );\n }\n\n // add options.name and options.organization as full_name and business_name, respectively\n address.full_name = options.name;\n address.business_name = options.organization;\n\n var addressParts = addressToParts(address, detailedLayout || layout, type);\n\n // Blank out country name if showCountryName is false.\n if (!showCountryName) {\n addressParts = addressParts.map(function(parts) {\n return parts.filter(function(part) {\n return part.type !== \"country_code\";\n });\n });\n }\n\n applyDisplayTransforms(addressParts, properties);\n var addressLines = partsToTextArray(addressParts);\n\n // if style is multi_line, just return the addressLines\n // but if single_line, join it into a string and return\n return style === STYLES.ADDRESS_FORMAT_DISPLAY_SINGLE\n ? addressLines.join(\"\")\n : addressLines;\n}\n\n/**\n * Set constants in the passed object.\n * @param {object} Object where constants such as ADDRESS_PORTABLE should be set.\n */\nfunction setConstants(object) {\n defineProperties(object, STYLES);\n defineProperties(object, TYPES);\n}\n\nfunction portableAddressDetailedToRegular(fromAddress, transformMapping) {\n var addressLines = transformMapping[\"address_lines\"]\n .map(function(addressLine) {\n var parts = toParts(\n fromAddress,\n PORTABLE_ADDRESS_WITH_DETAILS_FIELDS,\n addressLine\n );\n return collapseParts(parts);\n })\n .filter(function(value) {\n return value !== \"\";\n });\n\n // assigning address_lines to address_line_1, address_line_2 and address_line_3\n var toAddressLine = addressLines.reduce(function(object, item, index) {\n object[\"address_line_\" + (index + 1)] = item;\n return object;\n }, {});\n\n // deleting address_lines from transform mapping\n var transformMappingCopy = objectAssign({}, transformMapping);\n delete transformMappingCopy.address_lines;\n\n var toAddress = _transformAddress({\n fromAddress: fromAddress,\n fromAddressFields: PORTABLE_ADDRESS_WITH_DETAILS_FIELDS,\n patternsData: {},\n transformMapping: transformMappingCopy\n });\n return jsonDeepMerge(toAddressLine, toAddress);\n}\n\nfunction _transformAddress(props) {\n var fromAddress = props.fromAddress;\n var fromAddressFields = props.fromAddressFields;\n var patternsData = props.patternsData;\n var transformMapping = props.transformMapping;\n\n var patternsRe = {};\n var patternsMatchElement = {};\n var processPatternTransforms = function(toField, lineItem) {\n return lineItem.replace(/^patterns\\.(.*?)\\.\\$([0-9])$/, function(\n garbage,\n fromField,\n matchElement\n ) {\n patternsRe[toField] = new RegExp(\"^\" + patternsData[fromField] + \"$\");\n patternsMatchElement[toField] = +matchElement;\n return fromField;\n });\n };\n\n return Object.keys(transformMapping)\n .map(function(toField) {\n var line = transformMapping[toField];\n line = line.map(processPatternTransforms.bind(null, toField));\n var parts = toParts(fromAddress, fromAddressFields, line);\n return { toField: toField, value: collapseParts(parts) };\n })\n .filter(function(pair) {\n return pair.value !== \"\";\n })\n .reduce(function(toAddress, pair) {\n var match;\n var toField = pair.toField;\n var value = pair.value;\n\n // Patterns processing.\n if (patternsRe[toField]) {\n match = value.match(patternsRe[toField]);\n value = match[patternsMatchElement[toField]];\n }\n\n if (value) {\n toAddress[toField] = value;\n }\n return toAddress;\n }, {});\n}\n\n/**\n * The core transformAddress function, i.e., the full implementation should be in this function\n * except for environment dependent variables, which are passed via *dependencies* parameter.\n * @param {Object} address See README for details.\n * @param {Object} options See README for details.\n * @param {Object} dependencies Environment dependencies variables (Node.js vs client).\n * @returns See README for details.\n * @example See README for details.\n */\nfunction transformAddress(fromAddress, options, metadata, dependencies) {\n // address\n assertAddress(fromAddress);\n\n // options\n options = getValueOrDefault(options, {});\n assertType(options, \"options\", [\"plain object\"]);\n\n // options.fromType\n var fromType = options.fromType;\n assertType(fromType, \"options.fromType\", [\"string\"]);\n assertRange(\n fromType,\n transformTypeValues,\n \"Invalid value for options.fromType: {type}\",\n { type: fromType }\n );\n var fromAddressFields = TYPE_FIELDS_MAP[fromType];\n\n // options.toType\n var toType = options.toType;\n assertType(toType, \"options.toType\", [\"string\"]);\n assertRange(\n toType,\n transformTypeValues,\n \"Invalid value for options.toType: {type}\",\n {\n type: toType\n }\n );\n\n if (fromType === TYPES.ADDRESS_COARSE) {\n fromAddress = oldGriffinCoarseSupport(fromAddress);\n }\n\n try {\n var countryCode = assertCountryCode(\n fromAddress.country_code,\n metadata,\n dependencies\n );\n } catch (err) {\n return {\n errors: [\n {\n name: \"ADDRESS_INVALID_COUNTRY_ERROR\",\n message:\n \"Unsupported country/region: \" +\n fromAddress.country_code +\n \" or was not loaded on the client metadata\",\n detail: { field: \"country_code\" }\n }\n ]\n };\n }\n\n if (fromType === toType) {\n // No need to perform tranformation as from and to address type is same.\n return fromAddress;\n }\n\n assertRange(\n toType,\n tranformFromTypeToTypeMapping[fromType],\n \"Address transformation is not allowed options.fromType: {fromType} to options.toType: {toType}\",\n {\n fromType: fromType,\n toType: toType\n }\n );\n\n if (\n fromType === TYPES.ADDRESS_PORTABLE_WITH_DETAILS &&\n toType === TYPES.ADDRESS_PORTABLE\n ) {\n return portableAddressDetailedToRegular(\n fromAddress,\n metadataTransformMapping(metadata, countryCode, \"detailed\", \"portable\")\n );\n }\n\n var transformMapping = metadataTransformMapping(\n metadata,\n countryCode,\n fromType,\n toType\n );\n\n var isAddressDetailsEmpty =\n fromAddress.address_details &&\n Object.keys(fromAddress.address_details).length\n ? false\n : true;\n\n if (fromType === TYPES.ADDRESS_PORTABLE && !isAddressDetailsEmpty) {\n fromAddress = portableAddressDetailedToRegular(\n fromAddress,\n metadataTransformMapping(metadata, countryCode, \"detailed\", \"portable\")\n );\n }\n\n var patternsData = objectGet(metadata, [\n \"territory\",\n countryCode,\n \"transform_mapping\",\n \"transform_properties\",\n \"patterns\"\n ]);\n\n return _transformAddress({\n fromAddress: fromAddress,\n fromAddressFields: fromAddressFields,\n patternsData: patternsData,\n transformMapping: transformMapping\n });\n}\n\nfunction _validateAddress(address, fields, properties) {\n return fields.reduce(function(errors, field) {\n return errors.concat(validateField(address, field, properties));\n }, []);\n}\n\n/**\n * The core validateAddress function, i.e., the full implementation should be in this function\n * except for environment dependent variables, which are passed via *dependencies* parameter.\n * @param {Object} address See README for details.\n * @param {Object} options See README for details.\n * @param {Object} dependencies Environment dependencies variables (Node.js vs client).\n * @returns See README for details.\n * @example See README for details.\n */\nfunction validateAddress(address, options, metadata, dependencies) {\n // address\n assertAddress(address);\n\n // options\n options = getValueOrDefault(options, {});\n assertType(options, \"options\", [\"plain object\"]);\n\n // options.type\n var type = assertOptionsType(options.type);\n var fields =\n type === TYPES.ADDRESS_PORTABLE\n ? PORTABLE_ADDRESS_WITH_DETAILS_FIELDS\n : TYPE_FIELDS_MAP[type];\n\n // options.field\n var field = options.field;\n assertType(field, \"options.field\", [\"undefined\", \"string\"]);\n if (field) {\n assertRange(field, fields, \"Invalid value for options.field: {field}\", {\n field: field\n });\n fields = [field];\n }\n\n if (type === TYPES.ADDRESS_COARSE) {\n address = oldGriffinCoarseSupport(address);\n }\n\n address = trimAddress(address, type);\n try {\n address.country_code = assertCountryCode(\n address.country_code,\n metadata,\n dependencies\n );\n } catch (err) {\n return {\n errors: [\n {\n name: \"ADDRESS_INVALID_COUNTRY_ERROR\",\n message:\n \"Unsupported country/region: \" +\n address.country_code +\n \" or was not loaded on the client metadata\",\n detail: { field: \"country_code\" }\n }\n ]\n };\n }\n var propertiesAndLayout = metadataLayoutAndProperties({\n address: address,\n handlerDefaultScript: dependencies.handlerDefaultScript,\n metadata: metadata,\n type: type\n });\n var properties = propertiesAndLayout.properties;\n var detailedLayout = propertiesAndLayout.detailedLayout;\n\n // For portable address on countries that include detailed data and options.field not\n // specified, return:\n // - No errors `{}` in case either regular or detailed layout would be fullfiled\n // - All errors (regular + detailed) otherwise\n if (type === TYPES.ADDRESS_PORTABLE && detailedLayout && !field) {\n var regularErrors = _validateAddress(\n address,\n PORTABLE_ADDRESS_FIELDS,\n properties\n );\n var thisDetailedFields = detailedLayout.reduce(function(memo, line) {\n line.forEach(function(part) {\n if (PORTABLE_ADDRESS_WITH_DETAILS_FIELDS.indexOf(part) !== -1) {\n memo.push(part);\n }\n });\n return memo;\n }, []);\n\n var detailedErrors = _validateAddress(\n address,\n thisDetailedFields,\n properties\n );\n if (regularErrors.length && detailedErrors.length) {\n return {\n errors: regularErrors.concat(\n detailedErrors.filter(function(error) {\n return /address_details/.test(error.detail);\n })\n )\n };\n }\n\n // if address_line_* is missing and address_details object is empty\n // then we need to return error on field \"address_details\".\n if (regularErrors.length) {\n // check if \"address_line_*\" is missing or not\n var addressLineErrors = regularErrors.filter(function(error) {\n return (\n error.name === \"ADDRESS_REQUIRED_FIELD_MISSING\" &&\n ADDRESS_LINES.includes(error.detail)\n );\n });\n if (addressLineErrors) {\n // get list of non empty detail object\n var detailedFieldsValue = [];\n if (address.address_details) {\n var addressDetails = address.address_details;\n Object.keys(addressDetails).forEach(function(key) {\n if (addressDetails[key] && addressDetails[key] !== \"\") {\n detailedFieldsValue.push(addressDetails[key]);\n }\n });\n }\n // check if detail object is empty or not\n if (!detailedFieldsValue.length) {\n return {\n errors: PORTABLE_DETAIL_REQUIRED_ERROR.concat(addressLineErrors)\n };\n }\n }\n }\n\n return {};\n }\n\n var errors = _validateAddress(address, fields, properties);\n return errors.length ? { errors: errors } : {};\n}\n\nmodule.exports = {\n formatAddress: formatAddress,\n setConstants: setConstants,\n transformAddress: transformAddress,\n validateAddress: validateAddress\n};\n","/* jslint node: true */\n\n\"use strict\";\n\nvar addressCommon = require(\"../addressCommon\");\n\nvar assertion = require(\"./utils/assertion\");\nvar assertMetadata = assertion.assertMetadata;\nvar assertType = assertion.assertType;\n\nvar basic = require(\"./utils/basic\");\nvar definePrivateProperty = basic.definePrivateProperty;\nvar formatMessage = basic.formatMessage;\n\nvar unsupportedCountryCodeRe = /Unsupported value for address.country_code/;\n\nfunction AddressHandler() {}\naddressCommon.setConstants(AddressHandler);\n\nfunction getCountry(metadata, countryCode) {\n return (\n metadata.countryAliasMapping[countryCode] || countryCode || metadata.country\n );\n}\n\nfunction interceptError(error) {\n if (unsupportedCountryCodeRe.test(error.message)) {\n throw new Error(\n formatMessage(\"You have not loaded metadata for `{{country}}` country\", {\n country: error.attributes.countryCode\n })\n );\n }\n throw error;\n}\n\nObject.defineProperty(AddressHandler.prototype, \"formatAddress\", {\n value: function formatAddress(address, options) {\n var metadata = this.metadata;\n try {\n return addressCommon.formatAddress(address, options, metadata, {\n getCountry: getCountry.bind(null, metadata),\n handlerDefaultScript: metadata.script\n });\n } catch (error) {\n interceptError(error);\n }\n },\n enumerable: true\n});\n\nObject.defineProperty(AddressHandler.prototype, \"validateAddress\", {\n value: function validateAddress(address, options) {\n var metadata = this.metadata;\n try {\n return addressCommon.validateAddress(address, options, metadata, {\n handlerDefaultScript: metadata.script,\n getCountry: getCountry.bind(null, metadata)\n });\n } catch (error) {\n interceptError(error);\n }\n },\n enumerable: true\n});\n\nObject.defineProperty(AddressHandler.prototype, \"transformAddress\", {\n value: function transformAddress(address, options) {\n var metadata = this.metadata;\n try {\n return addressCommon.transformAddress(address, options, metadata, {\n getCountry: getCountry.bind(null, metadata)\n });\n } catch (error) {\n interceptError(error);\n }\n },\n enumerable: true\n});\n\nfunction createHandler(metadata) {\n assertType(metadata, \"metadata\", [\"plain object\"]);\n\n assertMetadata(metadata.griffin);\n assertMetadata(metadata.griffin.address);\n metadata = metadata.griffin.address;\n\n assertMetadata(metadata.country, [\"string\"]);\n assertMetadata(metadata.language, [\"string\"]);\n assertMetadata(metadata.script, [\"string\"]);\n assertMetadata(metadata.territory);\n\n var handler = new AddressHandler();\n definePrivateProperty(handler, \"metadata\", metadata);\n\n return handler;\n}\n\nmodule.exports = {\n createHandler: createHandler\n};\n","var basePropertyOf = require('./_basePropertyOf');\n\n/** Used to map characters to HTML entities. */\nvar htmlEscapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n};\n\n/**\n * Used by `_.escape` to convert characters to HTML entities.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\nvar escapeHtmlChar = basePropertyOf(htmlEscapes);\n\nmodule.exports = escapeHtmlChar;\n","var escapeHtmlChar = require('./_escapeHtmlChar'),\n toString = require('./toString');\n\n/** Used to match HTML entities and HTML characters. */\nvar reUnescapedHtml = /[&<>\"']/g,\n reHasUnescapedHtml = RegExp(reUnescapedHtml.source);\n\n/**\n * Converts the characters \"&\", \"<\", \">\", '\"', and \"'\" in `string` to their\n * corresponding HTML entities.\n *\n * **Note:** No other characters are escaped. To escape additional\n * characters use a third-party library like [_he_](https://mths.be/he).\n *\n * Though the \">\" character is escaped for symmetry, characters like\n * \">\" and \"/\" don't need escaping in HTML and have no special meaning\n * unless they're part of a tag or unquoted attribute value. See\n * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)\n * (under \"semi-related fun fact\") for more details.\n *\n * When working with HTML you should always\n * [quote attribute values](http://wonko.com/post/html-escaping) to reduce\n * XSS vectors.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escape('fred, barney, & pebbles');\n * // => 'fred, barney, & pebbles'\n */\nfunction escape(string) {\n string = toString(string);\n return (string && reHasUnescapedHtml.test(string))\n ? string.replace(reUnescapedHtml, escapeHtmlChar)\n : string;\n}\n\nmodule.exports = escape;\n"],"names":["sysColorBackgroundMediumContrast","cssTokens","i18n","content","Container","glamorous","div","_ref","isTrmt","margin","greyBackgroundAndSmaller","AddressDropdown","React","constructor","arguments","_defineProperty","this","props","addresses","map","address","selectedAddressSingleLine","convertAddressToSingleLine","value","id","label","_escape","undefined","filter","option","ellipsis","singleLine","griffinMetadata","getGriffinMetadata","griffinHandler","griffinAddress","result","formatAddress","style","ADDRESS_FORMAT_DISPLAY_SINGLE","error","window","onerror","AddressUtils","address_line_1","addressLine1","address_line_2","addressLine2","admin_area_2","city","admin_area_1","state","postal_code","zipcode","country_code","countryCode","length","substring","event","target","SHIPPING_ADDRESS_OPTIONS","ADD_ADDRESS","handleAddAddress","handleSelectAddress","tracking","Events","p2p_review_shipping_address_pressed","componentDidUpdate","prevProps","shakeBillingLabel","setTimeout","dispatch","type","types","ADDRESS","NO_BILLING_ADDRESS","render","yourAddressContentKey","selectElementId","selectedAddress","hasNoAddressNeededOption","addNewAddressContentKey","showENSubTextRTR","isFeeTransparencyUpliftTrmt","_DropdownMenu","concat","enRTRStrings","options","NO_ADDRESS_NEEDED","renderDropdownOptions","onChange","handleChange","onClick","_Button","variant","padding","handleClick","className","_CaptionText","color","ShippingAddressDropdown","env","validateAmount","ENV_TYPE","DONATE","OverpanelActions","show","onAddressChanged","AddressActions","isDonate","_extends","shouldRenderLabel","connect","_ref2","defaultOption","isCharity","server","recipient","transaction","addressEntryFormat","selectedShippingAddress","dir","directionality","shippingType","StyleSheet","create","addressWrapper","toolCheckboxWrapper","position","width","display","inputCheckBox","height","toolCheckbox","overflow","addressContent","srLabel","tipIcon","cursor","textDecoration","toolTipTxt","backgroundColor","fontSize","lineHeight","textAlign","borderRadius","ShareMyAddress","amountIsZero","amount","currencyDecimal","EXTERNAL","SHOW_AMOUNT_IS_ZERO_ERROR","amountAboveMinimumDonation","isAmountReadOnly","donationContext","minimum_amount","currencyCode","amountBelowMaximumDonation","maximum_amount","SHOW_AMOUNT_DONATION_ERROR","data","DONATION_VALIDATION_TYPES","AMOUNT_ABOVE_MAXIMUM","AMOUNT_BELOW_MINIMUM","SendActions","shippingRequired","css","styles","rtlConvertInline","reFetchFundingOptions","external","shareAddress","STYLES","criticalIcon","top","AmountDonationValidationError","Component","donationValidationType","AMOUNT_VALID","errorMessageKey","_get","Number","formattedAmount","formatAmount","_objectSpread","errorField","paddingLeft","errorText","marginRight","verticalAlign","showNoteMaxCharLimitError","_Icon","name","size","role","border","borderTop","maxWidth","customComponents","page","component","Separator","NoteMaxCharLimitError","initializeHook","fpti","loadingStateChangedHook","isLoading","postMessageUp","toggleLoading","statusMessage","sessionTimerOverlayRenderedHook","showAddNewFIHook","previewPageAfterRenderHook","previewPageSendSubmitHook","donate","selectedShippingAddressId","store","getState","donatedAmount","giftAidItFlag","donationGiftAidCheckbox","donationAnonymousStatus","selectedRecurringFrequency","cvv","threeDS2ReferenceId","threeDS2TransactionId","is3DS2ChallengeRequired","isRecurring","selectedFundingOption","successPageAfterRenderHook","_external$donationGif","paymentDetails","giftAidCheckboxFlag","donationGiftAid","isAlreadyEnrolled","paymentId","payment_id","donationGiftaid","requestUnifiedLoginHook","hooks","getExternalComponents","x","module","exports","assertion","assertRange","assertType","basic","defineProperties","getValueOrDefault","isLatin","jsonDeepMerge","objectGet","objectValues","trimObject","objectAssign","ADDRESS_FORMAT_INPUT","ADDRESS_FORMAT_DISPLAY_MULTI","TYPES","ADDRESS_COARSE","ADDRESS_PORTABLE","ADDRESS_PORTABLE_WITH_DETAILS","tranformFromTypeToTypeMapping","coarse","portable","detailed","styleValues","typeValues","transformTypeValues","COARSE_ADDRESS_FIELDS","COARSE_CONTEXT_FIELD_MAP","DISPLAY","ADDRESS_LINES","PORTABLE_ADDRESS_FIELDS","PORTABLE_ADDRESS_WITH_DETAILS_FIELDS","PORTABLE_CONTEXT_FIELD_MAP","TYPE_FIELDS_MAP","PORTABLE_DETAIL_REQUIRED_ERROR","message","detail","metadataLayoutAndProperties","script","handlerDefaultScript","metadata","fieldsToCheck","field","every","isLatinAddress","addressScript","metadataTransformMapping","territory","fromType","toType","assertAddress","Object","keys","address_details","addressDetailsField","forEach","propName","propValue","split","assertCountryCode","dependencies","getCountry","assertOptionsType","optionsType","unwrapBraces","str","replace","createInputObject","detailedLayout","layout","properties","strings","labels","presetValues","reduce","accumulator","obj","fieldProperties","list","groupList","casing","maxLength","max_length","required","hidden","disabled","preset_data","key","applyDisplayTransforms","addressParts","parts","part","inputText","prefix","postfix","text","toUpperCase","toLowerCase","applyCasing","produceFieldText","toParts","addressFields","line","indexOf","collapseParts","index","array","lineString","trimAddress","addressEntryFields","oldGriffinCoarseSupport","fixes","postcode","country","filterDisabledLayout","filterdLayout","i","ele","portableAddressDetailedToRegular","fromAddress","transformMapping","toAddressLine","addressLine","object","item","transformMappingCopy","address_lines","toAddress","_transformAddress","fromAddressFields","patternsData","patternsRe","patternsMatchElement","processPatternTransforms","toField","lineItem","garbage","fromField","matchElement","RegExp","bind","pair","match","_validateAddress","fields","errors","re","fieldValue","push","validation_regex","test","validateField","showCountryName","organization","err","propertiesAndLayout","full_name","business_name","displayFields","addressToParts","addressLines","partsToTextArray","join","setConstants","transformAddress","isAddressDetailsEmpty","validateAddress","regularErrors","detailedErrors","memo","addressLineErrors","includes","detailedFieldsValue","addressDetails","addressCommon","assertMetadata","definePrivateProperty","formatMessage","unsupportedCountryCodeRe","AddressHandler","countryAliasMapping","interceptError","Error","attributes","defineProperty","prototype","enumerable","createHandler","griffin","language","handler","escapeHtmlChar","basePropertyOf","toString","reUnescapedHtml","reHasUnescapedHtml","source","string"],"sourceRoot":""}