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AAOf,MACXA,GAeG,oMAAqMgB,KAAKhB,GAGtNgM,WAAYA,CAACjL,EAAOf,KACXA,GA+BG,gIAAiIgB,KAAKhB,IAwEtJY,EAAOC,QAAQ9B,aAAeA,EAC9B6B,EAAOC,QAAQtC,iBAAmBA,EAClCqC,EAAOC,QAAQP,YAAcA,C","sources":["webpack://bizsignupnodeweb/./lib/flow-bundles/validations/base.js"],"sourcesContent":["const XRegExp = require('xregexp'),\n _ = require('lodash'),\n IBAN = require('iban'),\n CONSTANTS = require('../../constants'),\n { PhoneNumberFormat, NameFormat } = require('@paypalcorp/worldready'),\n { initWorldReady, initializeNameFormat } = require('../../worldready-util'),\n { isPostalCodeValid } = require('../../../lib/utils');\n\nconst worldReadyPhoneHandlerInstances = {};\n\nmodule.exports = {\n emailCheck: (store, data) => {\n // existing regex to check email format in UnifiedLoginNodeWeb\n // https://github.paypal.com/Identity-R/UnifiedLoginNodeWeb/blob/6e975ec59b5a8f7a0711f3c59429c2fd1f245e8b/public/js/widgets/validation.js#L46\n // Fixed the previous regex issue which valid this invalid email mama@12314.567\n var regex = /^(([^<>()[\\]\\\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n\n return regex.test(data.trim());\n },\n\n passwordSequence: (store, data) => {\n // if string contains four key sequence, return false\n var reverseValue = data.split('').reverse().join(''),\n sequences = [\n '`123', '1234', '2345', '3456', '4567', '5678', '6789', '7890', '890-', '90-=', // row 1\n 'qwer', 'wert', 'erty', 'rtyu', 'tyui', 'yuio', 'uiop', 'iop[', 'op[]', 'p[]\\\\', // row 2\n 'asdf', 'sdfg', 'dfgh', 'fghj', 'ghjk', 'hjkl', 'jkl;', 'kl;\\'',\n 'zxcv', 'xcvb', 'cvbn', 'vbnm', 'bnm,', 'nm,.', 'm,./', // row 4\n '~!@#', '!@#$', '@#$%', '#$%^', '$%^&', '%^&*', '^&*(', '&*()', '*()_', '()_+', // shift + row 1\n 'QWER', 'WERT', 'ERTY', 'RTYU', 'TYUI', 'YUIO', 'UIOP', 'IOP{', 'OP{}', 'P{}|', // shift + row 2\n 'ASDF', 'SDFG', 'DFGH', 'FGHJ', 'GHJK', 'HJKL', 'JKL:', 'KL:\"', // shift + row 3\n 'ZXCV', 'XCVB', 'CVBN', 'VBNM', 'BNM<', 'NM<>', 'M<>?' // shift + row 4\n ];\n\n // go through each sequence and check it against the input value forward and reverse\n return !(sequences.some((sequence) => {\n return data.indexOf(sequence) !== -1 || reverseValue.indexOf(sequence) !== -1;\n }));\n },\n\n isPasswordConfirmationValid: (store, data) => {\n return _.get(store, 'password.value') === data;\n },\n\n isEmailUnique: (store, data) => {\n return _.get(store, 'email.isUnique', true);\n },\n\n isEmailNetworkCallSuccessful: (store, data) => {\n return _.get(store, 'email.isCheckCallSuccessful', true);\n },\n\n lengthRange: (store, data, args) => {\n const minLength = args.minLength,\n maxLength = args.maxLength;\n if (!minLength || !maxLength) {\n throw new Error('validations.lengthRange: Both minLength and maxLength arguments must be specified');\n }\n return data.length >= minLength && data.length <= maxLength;\n },\n\n hasNumberOrSymbol: (store, data) => {\n if (!data) {\n return false;\n }\n\n // if string has numbers or symbols, return true\n return (/\\d/).test(data) || (/[0-9\\-!@#$%\\^&*()_+|~=`{}\\[\\]:\";'<>?,.\\/\\\\]/).test(data);\n },\n hasEasyPassword: (store, data) => {\n if (!data) {\n return false;\n }\n\n // if string has numbers or symbols, return true\n return !(/access14|americanidol|baseball|baseball1|bigdaddy|blink182|butthead|cocacola|computer|corvette|cowboys|danielle|dolphins|einstein|firebird|football|football1|iloveyou|iloveyou1|internet|jennifer|jordan23|liverpool|liverpool1|marlboro|maverick|melanie|michelle|midnight|mistress|mountain|myspace1|password|password1|princess1|qwertyui|redwings|rush2112|samantha|scorpion|slipknot1|srinivas|startrek|starwars|sunshine|superman|superman1|swimming|trustno1|victoria|whatever|passwort|passwort1|frankfurt|fussball/i).test(data);\n },\n hasUpperAndLowerCase: (store, data) => {\n if (!data) {\n return false;\n }\n\n // if string has numbers or symbols, return true\n return (/^(?=.*[a-z])(?=.*[A-Z]).{1,21}$/).test(data);\n },\n hasNoFourRepeatedChars: (store, data) => {\n // if string contains repeated characters, return false\n return !(/(.)\\1{3}/).test(data);\n },\n\n hasFiveDigitNumber: (store, data) => {\n if (!data) {\n return false;\n }\n // if string has numbers or symbols, return true\n return (/^[0-9]{5}$/).test(data);\n },\n\n hasNoSpace: (store, data) => {\n // if string has no space, return true\n return !(/\\s/).test(data);\n },\n\n // validates that the passed string (if any) contains only printable ASCII characters;\n // that's this table: https://en.wikipedia.org/wiki/ASCII#Printable_characters\n // PayPal account passwords MUST NOT contain any characters that are NOT part of this set\n hasOnlyPrintableASCIIChars: (store, data = '') =>\n data.split('').every(c => {\n const charCode = c.charCodeAt();\n return charCode > 31 && charCode < 127;\n }),\n\n matchPassword: (store, data) => {\n var pwd = store.password && store.password.value;\n return ((data === pwd) && (pwd.length !== 0));\n },\n\n urlCheck: (store, data) => {\n if (!data) {\n return true;\n }\n // check to see if the url matches with http://www.yourdomain.com or https://www.yourdomain.com\n // https://github.paypal.com/Customers-R/merchantsignupnodeweb/blob/3fda5c9644da329ce0e7f1eed3f36f9383a42e0a/public/js/app/validations.js#L159\n var regex = new XRegExp('^((http|https)\\\\:\\\\/\\\\/)?([a-zA-Z0-9\\\\.\\\\-]+(\\\\:[a-zA-Z0-9\\\\.&%\\\\$\\\\-]+)*@)*(([a-zA-Z0-9\\\\-]+\\\\.)*[a-zA-Z0-9\\\\p{L}\\\\p{N}\\\\-]+\\\\.([a-zA-Z]*))(\\\\:[0-9]+)*(\\\\/($|[a-zA-Z0-9\\\\.\\\\,\\\\?\\\\\\'\\\\\\+&%\\\\$#\\\\=~_\\\\-]+))*$');\n return regex.test(data.trim());\n },\n\n safeUrlCheck: (store, data) => {\n if (!data) {\n return true;\n }\n // check to see if the url matches with http://www.yourdomain.com or https://www.yourdomain.com\n // https://github.paypal.com/Customers-R/merchantsignupnodeweb/blob/3fda5c9644da329ce0e7f1eed3f36f9383a42e0a/public/js/app/validations.js#L159\n var regex = new XRegExp('^((http|https)\\\\:\\\\/\\\\/)([a-zA-Z0-9\\\\.\\\\-]+(\\\\:[a-zA-Z0-9\\\\.&%\\\\$\\\\-]+)*@)*(([a-zA-Z0-9\\\\-]+\\\\.)*[a-zA-Z0-9\\\\p{L}\\\\p{N}\\\\-]+\\\\.([a-zA-Z]*))(\\\\:[0-9]+)*(\\\\/($|[a-zA-Z0-9\\\\.\\\\,\\\\?\\\\\\'\\\\\\+&%\\\\$#\\\\=~_\\\\-]+))*$');\n return regex.test(data.trim());\n },\n\n hasOnlyEnglishCharacters: (store, data) => {\n if (!data) {\n return true;\n }\n return (/^[\\w\\s\\-!@#$%\\^&*()_+|~=`{}\\[\\]:\";'<>?,.\\/\\\\]+$/i).test(data);\n },\n\n hasNoNumber: (store, data) => {\n // if string has no number, return true\n return !((/\\d/).test(data));\n },\n\n hasNoSpecialChar: (store, data) => {\n return !((/[\\-!@#$%\\^&*()_+|~=`{}\\[\\]:\";'<>?,.\\/\\\\]/).test(data));\n },\n\n isEmptyOrValidRegex: (store, data, pattern) => {\n if (!pattern || !data) {\n return true;\n }\n\n var regex = new RegExp(pattern);\n return regex.test(data.trim());\n },\n\n isNotDefault: (store, data, defaultVal) => {\n return data !== defaultVal;\n },\n\n isPhoneFlagsDropdownValid: (store) => {\n return store.businessPhoneNumber && store.businessPhoneNumber.isValid || false;\n },\n\n minValuePercentage: (store, data, minValue) => {\n if (!data) {\n return false;\n }\n if (data.indexOf('%') !== -1) {\n data = data.replace('%', '');\n }\n return data >= minValue;\n },\n\n maxValuePercentage: (store, data, maxValue) => {\n if (!data) {\n return false;\n }\n if (data.indexOf('%') !== -1) {\n data = data.replace('%', '');\n }\n return data <= maxValue;\n },\n\n requiredStakeholder: (store, data) => Array.isArray(data) && !!data.filter(stakeholder => stakeholder.status === CONSTANTS.ACTIVE_STAKEHOLDER).length,\n\n requiredBeneficialOwners: (store, data) => Array.isArray(data) && !!data.filter(stakeholder => stakeholder.status === CONSTANTS.ACTIVE_STAKEHOLDER &&\n stakeholder.roleCode === CONSTANTS.BENEFICIAL_OWNER_ROLE_CODE).length,\n\n requiredDirector: (store, data) => Array.isArray(data) && !!data.filter(stakeholder => stakeholder.status === CONSTANTS.ACTIVE_STAKEHOLDER &&\n stakeholder.roleCode === CONSTANTS.DIRECTORS_ROLE_CODE).length,\n\n requiredOfficer: (store, data) => Array.isArray(data) && !!data.filter(stakeholder => stakeholder.status === CONSTANTS.ACTIVE_STAKEHOLDER &&\n stakeholder.roleCode === CONSTANTS.OFFICIAL_BEARER_ROLE_CODE).length,\n\n validateInlineDirectors: (store, data) => Array.isArray(data) && !data.filter(stakeholder => stakeholder.status === CONSTANTS.ACTIVE_STAKEHOLDER &&\n stakeholder.roleCode === CONSTANTS.DIRECTORS_ROLE_CODE).some(record => !_.isEmpty(record.errors)),\n\n // like `required`, but for DateInput\n // checks that there is something in at least one of the fields, not necessarily valid\n requiredDate: (store, data) => {\n const name = _.get(store, 'formField.attributes.name');\n const date = (store[name] || {}).value;\n if (!date) {\n return false;\n }\n return Object.values(date).every(x => !Number.isNaN(x));\n },\n\n // like `isEmptyOrValidRegex`, but for DateInput\n // checks that all fields are valid\n isEmptyOrValidDate: (store, data) => {\n const fieldName = _.get(store, 'formField.attributes.name');\n const date = _.get(store, fieldName + '.value');\n if (!date) {\n return true;\n }\n const isEmpty = (d) => Object.keys(d).reduce((result, field) =>\n result && !d[field] && d[field] !== 0, true);\n return isEmpty(date) || validateDate(date);\n },\n\n // check to see if the user is over 18\n isOver18: (store, data) => {\n const fieldName = _.get(store, 'formField.attributes.name');\n const date = _.get(store, fieldName + '.value');\n if (!date || !validateDate(date)) {\n return true;\n }\n const dateObj = createDateObject(date);\n const today = new Date();\n return dateObj <= new Date(today.setFullYear(today.getFullYear() - 18));\n },\n\n // check to see if the user is under 100\n isUnder100: (store, data) => {\n const fieldName = _.get(store, 'formField.attributes.name');\n const date = _.get(store, fieldName + '.value');\n if (!date || !validateDate(date)) {\n return true;\n }\n const dateObj = createDateObject(date);\n const today = new Date();\n return dateObj >= new Date(today.setFullYear(today.getFullYear() - 100, today.getMonth(), today.getDate()));\n },\n\n isNotFutureDate: (store, data) => {\n const fieldName = _.get(store, 'formField.attributes.name');\n const date = _.get(store, fieldName + '.value');\n if (date && _.size(date) === 1 && date.year && !date.month && !date.day) {\n const currentYear = new Date().getFullYear();\n return date.year <= currentYear;\n }\n if (!date || !validateDate(date)) {\n return true;\n }\n const dateObj = createDateObject(date);\n const today = new Date();\n return dateObj <= today;\n },\n\n isNotFutureDatePPH: (store, data) => {\n let dateFormat = _.get(store, 'formField.dateFormat.format');\n if (!data || !dateFormat) {\n return true;\n }\n dateFormat = dateFormat.replace(/[^a-zA-Z]/g, '');\n let date = convertDateFormat(data, dateFormat),\n age = getAge(date);\n return (!age) ? true : age > 0;\n },\n\n // check to see if the user is over 18 given the date format mm/dd/yyyy or yyyy/mm/dd\n isOver18PPH: (store, data) => {\n let dateFormat = _.get(store, 'formField.dateFormat.format');\n if (!data || !dateFormat) {\n return true;\n }\n\n dateFormat = dateFormat.replace(/[^a-zA-Z]/g, '');\n let date = convertDateFormat(data, dateFormat),\n age = getAge(date);\n\n // If the date is in future it will return negative value. This will avoid multiple error messages.\n // If the age returned is NaN, the below if condition is never executed\n if (age < 0) {\n return true;\n }\n return (!age && age !== 0) ? true : age >= 18;\n\n },\n\n // check to see if the user is under 100 given the date format mm/dd/yyyy or yyyy/mm/dd\n isUnder100PPH: (store, data) => {\n let dateFormat = _.get(store, 'formField.dateFormat.format');\n if (!data || !dateFormat) {\n return true;\n }\n dateFormat = dateFormat.replace(/[^a-zA-Z]/g, '');\n let date = convertDateFormat(data, dateFormat),\n age = getAge(date);\n return (!age) ? true : age < 100;\n },\n\n hasOnlyNumber: (store, data) => {\n if (!data) {\n return true;\n }\n // if string has only numbers, return false\n return !((/^[0-9]*$/).test(data));\n },\n isValidMCC: (store, data) => {\n\n if (!data || _.isNaN(data) || _.isEmpty(store.mccResponse)) {\n return false;\n }\n\n const mccResponseDefault = _.get(store, 'mccResponse.value.DEFAULT', []);\n const mccResponseCharity = _.get(store, 'mccResponse.value.CHARITY', []);\n\n const mccDefaultResponseData = mccResponseDefault.find(item => item.payload.value === data);\n const mccCharityResponseData = mccResponseCharity.find(item => item.payload.value === data);\n\n if (mccDefaultResponseData || mccCharityResponseData) {\n return true;\n }\n return false;\n },\n\n isValidOCC: (store, data) => {\n if (!data || _.isNaN(data) || _.isEmpty(store.occResponse)) {\n return false;\n }\n const occResponseDefault = _.get(store, 'occResponse.value', []);\n const occDefaultResponseData = occResponseDefault.find(item => item.value === data);\n if (occDefaultResponseData) {\n return true;\n }\n return false;\n },\n\n isValidIndustryList: (store, data) => {\n if (!data || _.isNaN(data) || _.isEmpty(store.industriesList)) {\n return false;\n }\n const industriesList = _.get(store, 'industriesList.value', []);\n const industriesListesponseData = industriesList.find(item => item.value === data);\n if (industriesListesponseData) {\n return true;\n }\n return false;\n },\n\n isValidIBAN: (store, data) => {\n return (/^[a-zA-Z0-9 ]+$/).test(data) && IBAN.isValid(data);\n },\n\n // by default apply no validation; this is overridden in country-specific\n // validation functions\n isNotPoBox: (store, data) => true,\n\n // By default apply no validation.\n // Currently, this is overridden in server side(signup controller) based on the reponse from AMS.\n isInvalidAddress: (store, data) => true,\n\n // check that the required address fields are completed\n requiredAddress: (store, data) => {\n if (!data) {\n return false;\n }\n const fields = _.get(store, 'formField.addressFormat.properties', {});\n const requiredFields = Object.keys(fields).filter(field => fields[field].required);\n return requiredFields.every(field => data[field]);\n },\n\n validPostcode: (store, data) => {\n const postalCodeProperties = _.get(store, 'formField.addressFormat.properties.postal_code', {});\n const required = _.get(postalCodeProperties, 'required', false);\n const locale = _.get(postalCodeProperties, 'validation.locale', '');\n const country = _.get(postalCodeProperties, 'validation.country', '');\n const postalCode = _.get(data, 'postal_code', '');\n\n if (!data || !data.postal_code) {\n return !required;\n }\n\n return isPostalCodeValid(locale, country, postalCode);\n },\n\n validCreditCard: (store, data) => {\n // This is a bit of an abuse of F0 validator because the validations\n // come from the react-payment-inputs component. We get errors from\n // that component and store them on an `error` property within the\n // element. In order to properly allow or prevent the user from\n // proceeding to the next page on clicking the submit button, we need\n // to be able to check for the presence of errors in a validation\n // function, so this is basically a getter function for those error's\n // to satisfy f0-validator's inversion of control model.\n return !_.get(store, 'creditCard.error');\n },\n\n // clear the WorldReady phone handler singleton (probably as a precursor to replacing it)\n clearWorldReadyPhoneHandler: (country) => delete worldReadyPhoneHandlerInstances[country],\n\n phoneNumber: (store, data, worldReadyMetadata) => {\n if (!data) {\n return;\n }\n const fieldName = _.get(store, 'formField.attributes.name');\n let country = _.get(store, `${fieldName}-iso2.value`, '').toUpperCase();\n // not getting phonenumber iso2 value for C2 since metadata not loaded for it using fullstack-phone module so\n // taking country value from countryCode.\n if (!country) {\n country = _.get(store, 'countryCode.value').toUpperCase(); \n }\n const worldReadyPhoneHandler = getWorldReadyPhoneHandler(country), // metadata argument is not required for phone number validations with worldready\n options = {};\n /* istanbul ignore else */\n if (country) {\n // only add the country option if available. otherwise we won't\n // pass country so WorldReady will default to the current locale's country\n Object.assign(options, { country });\n }\n let phoneFormatErrors = getErrorMsg(worldReadyPhoneHandler.parse(data).errors);\n\n return phoneFormatErrors;\n },\n\n businessName: (store, data, worldReadyMetadata) => {\n const country = _.get(store, 'countryCode.value', 'US').toUpperCase();\n const businessTypeString = _.get(store, 'businessType.value', '').toUpperCase();\n const isNonRegisteredBiz = (businessTypeString === CONSTANTS.BUSINESS_TYPE_INDIVIDUAL || businessTypeString === CONSTANTS.BUSINESS_TYPE_PROPRIETORSHIP);\n const registeredType = isNonRegisteredBiz ? CONSTANTS.GRIFFIN_NON_REGISTERED_BUSINESS : CONSTANTS.GRIFFIN_REGISTERED_BUSINESS;\n\n let worldReady = initWorldReady(worldReadyMetadata.locality.locale),\n nameFormatter = new NameFormat(worldReady, {\n nameRegion: country, // e.g., \"US\"\n type: CONSTANTS.TYPE.business,\n style: CONSTANTS.STYLE_FULL,\n registeredBusinessType: registeredType\n });\n\n const businessName = {\n 'businessName': data\n };\n\n \n let errorMsg = '';\n let nameFormatErrors = getErrorMsg(nameFormatter.validate(businessName)); \n if (nameFormatErrors && nameFormatErrors.length > 0 && nameFormatErrors[0].name) {\n if (nameFormatErrors[0].name === CONSTANTS.WORLDREADY_REGISTERED_BUSINESS_NAME_ERROR) {\n errorMsg = 'griffinBusinessName.INVALID_VALUE_TYPE';\n } else {\n errorMsg = 'worldreadyBusinessName.INVALID_VALUE';\n }\n }\n return (\n errorMsg ? [errorMsg] : undefined\n );\n },\n\n hasXSSTags: (store, data) => {\n if (!data) {\n return false;\n }\n const regexList = [/<\\/?(\\w|<|>)*>/g, /<\\/?(.)*>/g, /\\{/g, /\\{/g, /\\}/g, //g, /\\\"/g, /\\;/g];\n return !(regexList.some((regexPattern) => {\n return regexPattern.test(data);\n }));\n },\n\n personName: (store, data, worldReadyMetadata) => {\n // don't handle \"required\" validation here because not all name components are required\n if (!data) {\n return;\n }\n const country = _.get(store, 'countryCode.value', 'US').toUpperCase();\n\n const fieldName = _.get(store, 'formField.attributes.name'),\n nationality = _.get(store, 'nationality.value'),\n worldReadyNameMapping = {\n firstName: 'givenName',\n lastName: 'surname',\n middleName: 'middleName',\n secondSurname: 'secondSurname',\n relationFirstName: 'givenName',\n relationLastName: 'surname'\n };\n let worldReady = initWorldReady(worldReadyMetadata.locality.locale);\n let nameFormatter = initializeNameFormat(worldReady, country);\n worldReadyNameMapping[fieldName] = worldReadyNameMapping[fieldName] || 'givenName';\n\n const name = {\n [worldReadyNameMapping[fieldName]]: data\n };\n let errorMsg = '';\n let errors = nameFormatter.validate(name);\n /* istanbul ignore else*/\n if (errors.length) {\n errors = errors.filter((item) => item.element === worldReadyNameMapping[fieldName]);\n }\n let nameFormatErrors = getErrorMsg(errors);\n\n if (nameFormatErrors && nameFormatErrors.length > 0 && nameFormatErrors[0].name) {\n switch (country) {\n // Japan has error messages specific to that country\n case 'JP':\n // JP is the only country where we are doing nationality-specific\n // name validation\n if (nationality === 'JP') {\n errorMsg = 'worldreadyPersonName.INVALID_CHARACTERS_JAPAN';\n } else {\n errorMsg = 'worldreadyPersonName.INVALID_CHARACTERS_OTHER';\n }\n break;\n case 'TH':\n // Validations for Thailand\n errorMsg = 'worldreadyPersonName.INVALID_CHARACTERS_THAI';\n break;\n default:\n errorMsg = 'worldreadyPersonName.INVALID_VALUE';\n }\n }\n return errorMsg ? [errorMsg] : undefined;\n },\n\n globalNameInput: (store, data, worldReadyMetadata) => {\n const elementName = _.get(store, 'formField.attributes.name');\n const nameValues = _.get(store, `${elementName}.value`);\n const country = _.get(store, 'countryCode.value', 'US').toUpperCase();\n\n let worldReady = initWorldReady(worldReadyMetadata.locality.locale);\n let nameFormatter = initializeNameFormat(worldReady, country);\n \n let validationErrors = [];\n\n const response = nameFormatter.validate(nameValues);\n /* istanbul ignore else */\n if (response) {\n response.forEach(error => {\n const errorFieldName = error.element; \n validationErrors.push(`${errorFieldName}InvalidInput`);\n });\n }\n return validationErrors;\n },\n\n requiredName: (store, data) => {\n\n const elementName = _.get(store, 'formField.attributes.name');\n const nameFields = _.get(store, 'formField.nameFormat.layout', []);\n\n const nameValues = _.get(store, `${elementName}.value`);\n\n const requiredElements = nameFields.filter(field => {\n return field.required;\n });\n\n return requiredElements.every(field => {\n return nameValues[field.$];\n });\n },\n\n isValidYear: (store, data) => {\n // Do not allow future year\n const fieldName = _.get(store, 'formField.attributes.name');\n const year = _.get(store, fieldName + '.value');\n if (!year) {\n return true;\n }\n const today = new Date();\n return year <= today.getFullYear() && year >= 1000;\n },\n\n // checks that the value contains numLimit or fewer number characters (0-9)\n // this validation is required by downstream services for credit card\n // statement name\n hasFewerThanXNumbers: (store, data, numLimit) => {\n if (!data) {\n return true;\n }\n return data\n .split('')\n .reduce((acc, cur) => (/\\d/).test(cur) ? acc + 1 : acc, 0) < numLimit;\n },\n\n requiredArray: (store, data) => {\n const fieldName = _.get(store, 'formField.attributes.name');\n const fieldValue = _.get(store, fieldName + '.value');\n\n return _.isArray(fieldValue) && fieldValue.length > 0;\n },\n\n isValidSsn: (store, data) => {\n if (!data) {\n return false;\n }\n // source: https://github.paypal.com/Customers-R/merchantsignupnodeweb/blob/develop/public/js/US/pps/partials/validations.js#L35\n\n /* the following SSNs are also disallowed:\n\n greater than or less than 9 numerical digits.\n any non-numerical (0-9) digit.\n sequence 123456789 (i.e. 123-45-6789, 12-3456789, 123 45 6789).\n sequence 111111111, 222222222 (i.e. 111-11-1111, 11-1111111, 222-22-2222, 22-2222222, etc).\n \"0\" for the 1st, 2nd, and 3rd digits i.e. 000-xx-xxxx.\n \"0\" for the 4th and 5th digit i.e. xxx-00-xxxx.\n \"0\" for the 6th, 7th, 8th, and 9th digits i.e. xxx-xx-0000.\n \"6\" for the 1st, 2nd, and 3rd digits i.e. 666-xx-xxxx numbers as these are obviously invalid. */\n return (/^(?!\\b(\\d)\\1+([ \\-]?)(\\d)\\1+([ \\-]?)(\\d)\\1+\\b)(?!123-45-6789|123 45 6789|123456789|219-09-9999|219099999|078-05-1120|078051120)(?!(000|666)|9\\d{2})\\d{3}([ \\-]?)(?!00)\\d{2}([ \\-]?)(?!0{4})\\d{4}$/).test(data);\n },\n\n isValidEin: (store, data) => {\n if (!data) {\n return true;\n }\n\n /**\n * the following EINs are disallowed:\n - with any of the following for the 1st and 2nd digits:\n • 07\n • 08\n • 09\n • 17\n • 18\n • 19\n • 28\n • 29\n • 49\n • 69\n • 70\n • 78\n • 79\n • 89\n • 96\n • 97\n\n * the following EINs are also disallowed:\n\n - greater than or less than 9 numerical digits.\n - any non-numerical (0-9) digit.\n - sequence 123456789 (i.e. 123-45-6789, 12-3456789, 123 45 6789).\n - sequence 111111111, 222222222 (i.e. 111-11-1111, 11-1111111, 222-22-2222, 22-2222222, ..., 999-99-9999, etc).\n */\n return (/^(?!\\b(\\d)\\1+([ \\-]?)(\\d)\\1+\\b)(?!12-3456789|12 3456789|123456789)(?![01][789]|2[89]|[46]9|7[089]|89|9[67])\\d\\d([ \\-]?)\\d{7}$/).test(data);\n }\n};\n\n// input is in the form { month, day, year }\nfunction createDateObject(date) {\n const d = new Date(date.year, date.month, date.day);\n d.setFullYear(date.year); // because values 0-99 map to 1900-1999\n return d;\n}\n\n// returns boolean\nfunction validateDate(date) {\n if (Object.keys(date).length < 3) {\n return false;\n }\n const isValidForField = { // inputs are ints already\n day: (d) => d,\n month: (m) => m >= 0, // the zero is to account for the valid value of January being 0\n year: (y) => y\n };\n const isFilled = Object.keys(date).reduce((result, field) => isValidForField[field](date[field]) && result, true);\n // https://stackoverflow.com/questions/5812220/how-to-validate-a-date\n // checking month isn't enough, otherwise a date like January 366, 1990 is valid\n const isValid = date.month === createDateObject(date).getMonth() && date.day > 0 && date.day < 32 && date.year > 0;\n return isValid && isFilled;\n}\n\nfunction convertDateFormat(value, format) {\n if (format === 'dmy') {\n value = value.replace(/(..).(..).(....)/, '$3-$2-$1');\n } else if (format === 'mdy') {\n value = value.replace(/(..).(..).(....)/, '$3-$1-$2');\n } else if (format === 'ymd') {\n value = value.replace(/(....).(..).(..)/, '$1-$2-$3');\n }\n return value;\n}\n\nfunction getAge(data) {\n let today = new Date(),\n dateOfBirth = new Date(data),\n age = today.getFullYear() - dateOfBirth.getFullYear(),\n month = today.getMonth() - dateOfBirth.getMonth();\n\n if (month < 0 || (month === 0 && today.getDate() < dateOfBirth.getDate())) {\n age--;\n }\n return age;\n}\n\nfunction getWorldReadyPhoneHandler(country) {\n if (!worldReadyPhoneHandlerInstances.hasOwnProperty(country)) {\n worldReadyPhoneHandlerInstances[country] = new PhoneNumberFormat({\n phoneRegion: country // e.g., \"US\"\n });\n }\n return worldReadyPhoneHandlerInstances[country];\n}\n\n// format the error object and return which is supported by our locales\nfunction getErrorMsg(errors) {\n if (errors && errors.length) {\n errors = errors.map(error => {\n error.name = error.code;\n delete (error.code);\n return error;\n });\n }\n return errors;\n}\n\nmodule.exports.validateDate = validateDate;\nmodule.exports.createDateObject = createDateObject;\nmodule.exports.getErrorMsg = getErrorMsg;\n"],"names":["XRegExp","require","_","IBAN","CONSTANTS","PhoneNumberFormat","NameFormat","initWorldReady","initializeNameFormat","isPostalCodeValid","worldReadyPhoneHandlerInstances","createDateObject","date","d","Date","year","month","day","setFullYear","validateDate","Object","keys","length","isValidForField","m","y","isFilled","reduce","result","field","getMonth","convertDateFormat","value","format","replace","getAge","data","today","dateOfBirth","age","getFullYear","getDate","getErrorMsg","errors","map","error","name","code","module","exports","emailCheck","store","test","trim","passwordSequence","reverseValue","split","reverse","join","some","sequence","indexOf","isPasswordConfirmationValid","get","isEmailUnique","isEmailNetworkCallSuccessful","lengthRange","args","minLength","maxLength","Error","hasNumberOrSymbol","hasEasyPassword","hasUpperAndLowerCase","hasNoFourRepeatedChars","hasFiveDigitNumber","hasNoSpace","hasOnlyPrintableASCIIChars","arguments","undefined","every","c","charCode","charCodeAt","matchPassword","pwd","password","urlCheck","safeUrlCheck","hasOnlyEnglishCharacters","hasNoNumber","hasNoSpecialChar","isEmptyOrValidRegex","pattern","RegExp","isNotDefault","defaultVal","isPhoneFlagsDropdownValid","businessPhoneNumber","isValid","minValuePercentage","minValue","maxValuePercentage","maxValue","requiredStakeholder","Array","isArray","filter","stakeholder","status","ACTIVE_STAKEHOLDER","requiredBeneficialOwners","roleCode","BENEFICIAL_OWNER_ROLE_CODE","requiredDirector","DIRECTORS_ROLE_CODE","requiredOfficer","OFFICIAL_BEARER_ROLE_CODE","validateInlineDirectors","record","isEmpty","requiredDate","values","x","Number","isNaN","isEmptyOrValidDate","fieldName","isOver18","dateObj","isUnder100","isNotFutureDate","size","currentYear","isNotFutureDatePPH","dateFormat","isOver18PPH","isUnder100PPH","hasOnlyNumber","isValidMCC","mccResponse","mccResponseDefault","mccResponseCharity","mccDefaultResponseData","find","item","payload","mccCharityResponseData","isValidOCC","occResponse","isValidIndustryList","industriesList","isValidIBAN","isNotPoBox","isInvalidAddress","requiredAddress","fields","required","validPostcode","postalCodeProperties","locale","country","postalCode","postal_code","validCreditCard","clearWorldReadyPhoneHandler","phoneNumber","worldReadyMetadata","toUpperCase","worldReadyPhoneHandler","hasOwnProperty","phoneRegion","getWorldReadyPhoneHandler","options","assign","parse","businessName","businessTypeString","registeredType","BUSINESS_TYPE_INDIVIDUAL","BUSINESS_TYPE_PROPRIETORSHIP","GRIFFIN_NON_REGISTERED_BUSINESS","GRIFFIN_REGISTERED_BUSINESS","worldReady","locality","errorMsg","nameFormatErrors","nameRegion","type","TYPE","business","style","STYLE_FULL","registeredBusinessType","validate","WORLDREADY_REGISTERED_BUSINESS_NAME_ERROR","hasXSSTags","regexPattern","personName","nationality","worldReadyNameMapping","firstName","lastName","middleName","secondSurname","relationFirstName","relationLastName","nameFormatter","element","globalNameInput","elementName","nameValues","validationErrors","response","forEach","errorFieldName","push","requiredName","nameFields","$","isValidYear","hasFewerThanXNumbers","numLimit","acc","cur","requiredArray","fieldValue","isValidSsn","isValidEin"],"sourceRoot":""}