data
, is the returned server data.\n * @example\n * braintree.client
module. It is used for creating {@link Client} instances that service communication to Braintree servers.\n * @param {object} options Object containing all {@link Client} options:\n * @param {string} options.authorization A tokenizationKey or clientToken.\n * @param {callback} [callback] The second argument, data
, is the {@link Client} instance.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n * @example\n * var createClient = require('braintree-web/client').create;\n *\n * createClient({\n * authorization: CLIENT_AUTHORIZATION\n * }, function (createErr, clientInstance) {\n * if (createErr) {\n * if (createErr.code === 'CLIENT_AUTHORIZATION_INVALID') {\n * // either the client token has expired, and a new one should be generated\n * // or the tokenization key was deactivated or deleted\n * } else {\n * console.log('something went wrong creating the client instance', createErr);\n * }\n * return;\n * }\n *\n * // set up other components\n * });\n * @static\n */\nfunction create(options) {\n if (!options.authorization) {\n return Promise.reject(\n new BraintreeError({\n type: sharedErrors.INSTANTIATION_OPTION_REQUIRED.type,\n code: sharedErrors.INSTANTIATION_OPTION_REQUIRED.code,\n message:\n \"options.authorization is required when instantiating a client.\",\n })\n );\n }\n\n return Client.initialize(options);\n}\n\nmodule.exports = {\n create: wrapPromise(create),\n /**\n * @description The current version of the SDK, i.e. `{@pkg version}`.\n * @type {string}\n */\n VERSION: VERSION,\n};\n\n},{\"../lib/braintree-error\":42,\"../lib/errors\":49,\"../lib/promise\":55,\"./client\":17,\"@braintree/wrap-promise\":14}],22:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar querystring = _dereq_(\"../../lib/querystring\");\nvar assign = _dereq_(\"../../lib/assign\").assign;\nvar prepBody = _dereq_(\"./prep-body\");\nvar parseBody = _dereq_(\"./parse-body\");\nvar xhr = _dereq_(\"./xhr\");\nvar isXHRAvailable = xhr.isAvailable;\nvar GraphQLRequest = _dereq_(\"./graphql/request\");\nvar DefaultRequest = _dereq_(\"./default-request\");\n\nvar MAX_TCP_RETRYCOUNT = 1;\nvar TCP_PRECONNECT_BUG_STATUS_CODE = 408;\n\nfunction requestShouldRetry(status) {\n return !status || status === TCP_PRECONNECT_BUG_STATUS_CODE;\n}\n\nfunction graphQLRequestShouldRetryWithClientApi(body) {\n var errorClass =\n !body.data &&\n body.errors &&\n body.errors[0] &&\n body.errors[0].extensions &&\n body.errors[0].extensions.errorClass;\n\n return errorClass === \"UNKNOWN\" || errorClass === \"INTERNAL\";\n}\n\nfunction _requestWithRetry(options, tcpRetryCount, cb) {\n var status, resBody, ajaxRequest, body, method, headers, parsedBody;\n var url = options.url;\n var graphQL = options.graphQL;\n var timeout = options.timeout;\n var req = xhr.getRequestObject();\n var callback = cb;\n var isGraphQLRequest = Boolean(\n graphQL && graphQL.isGraphQLRequest(url, options.data)\n );\n\n options.headers = assign(\n { \"Content-Type\": \"application/json\" },\n options.headers\n );\n\n if (isGraphQLRequest) {\n ajaxRequest = new GraphQLRequest(options);\n } else {\n ajaxRequest = new DefaultRequest(options);\n }\n\n url = ajaxRequest.getUrl();\n body = ajaxRequest.getBody();\n method = ajaxRequest.getMethod();\n headers = ajaxRequest.getHeaders();\n\n if (method === \"GET\") {\n url = querystring.queryify(url, body);\n body = null;\n }\n\n if (isXHRAvailable) {\n req.onreadystatechange = function () {\n if (req.readyState !== 4) {\n return;\n }\n\n if (req.status === 0 && isGraphQLRequest) {\n // If a merchant experiences a connection\n // issue to the GraphQL endpoint (possibly\n // due to a Content Security Policy), retry\n // the request against the old client API.\n delete options.graphQL;\n _requestWithRetry(options, tcpRetryCount, cb);\n\n return;\n }\n\n parsedBody = parseBody(req.responseText);\n resBody = ajaxRequest.adaptResponseBody(parsedBody);\n status = ajaxRequest.determineStatus(req.status, parsedBody);\n\n if (status >= 400 || status < 200) {\n if (\n isGraphQLRequest &&\n graphQLRequestShouldRetryWithClientApi(parsedBody)\n ) {\n delete options.graphQL;\n _requestWithRetry(options, tcpRetryCount, cb);\n\n return;\n }\n\n if (tcpRetryCount < MAX_TCP_RETRYCOUNT && requestShouldRetry(status)) {\n tcpRetryCount++;\n _requestWithRetry(options, tcpRetryCount, cb);\n\n return;\n }\n callback(resBody || \"error\", null, status || 500);\n } else {\n callback(null, resBody, status);\n }\n };\n } else {\n if (options.headers) {\n url = querystring.queryify(url, headers);\n }\n\n req.onload = function () {\n callback(null, parseBody(req.responseText), req.status);\n };\n\n req.onerror = function () {\n // XDomainRequest does not report a body or status for errors, so\n // hardcode to 'error' and 500, respectively\n callback(\"error\", null, 500);\n };\n\n // This must remain for IE9 to work\n req.onprogress = function () {};\n\n req.ontimeout = function () {\n callback(\"timeout\", null, -1);\n };\n }\n\n try {\n req.open(method, url, true);\n } catch (requestOpenError) {\n // If a merchant has a Content Security Policy and they have\n // not allowed our endpoints, some browsers may\n // synchronously throw an error. If it is not a GraphQL\n // request, we throw the error. If it is a GraphQL request\n // we remove the GraphQL option and try the request against\n // the old client API.\n if (!isGraphQLRequest) {\n throw requestOpenError;\n }\n\n delete options.graphQL;\n\n _requestWithRetry(options, tcpRetryCount, cb);\n\n return;\n }\n\n req.timeout = timeout;\n\n if (isXHRAvailable) {\n Object.keys(headers).forEach(function (headerKey) {\n req.setRequestHeader(headerKey, headers[headerKey]);\n });\n }\n\n try {\n req.send(prepBody(method, body));\n } catch (e) {\n /* ignored */\n }\n}\n\nfunction request(options, cb) {\n _requestWithRetry(options, 0, cb);\n}\n\nmodule.exports = {\n request: request,\n};\n\n},{\"../../lib/assign\":41,\"../../lib/querystring\":56,\"./default-request\":23,\"./graphql/request\":31,\"./parse-body\":35,\"./prep-body\":36,\"./xhr\":37}],23:[function(_dereq_,module,exports){\n\"use strict\";\n\nfunction DefaultRequest(options) {\n this._url = options.url;\n this._data = options.data;\n this._method = options.method;\n this._headers = options.headers;\n}\n\nDefaultRequest.prototype.getUrl = function () {\n return this._url;\n};\n\nDefaultRequest.prototype.getBody = function () {\n return this._data;\n};\n\nDefaultRequest.prototype.getMethod = function () {\n return this._method;\n};\n\nDefaultRequest.prototype.getHeaders = function () {\n return this._headers;\n};\n\nDefaultRequest.prototype.adaptResponseBody = function (parsedBody) {\n return parsedBody;\n};\n\nDefaultRequest.prototype.determineStatus = function (status) {\n return status;\n};\n\nmodule.exports = DefaultRequest;\n\n},{}],24:[function(_dereq_,module,exports){\n\"use strict\";\n\nmodule.exports = function getUserAgent() {\n return window.navigator.userAgent;\n};\n\n},{}],25:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar errorResponseAdapter = _dereq_(\"./error\");\nvar assign = _dereq_(\"../../../../lib/assign\").assign;\n\n/* eslint-disable camelcase */\nvar cardTypeTransforms = {\n creditCard: {\n AMERICAN_EXPRESS: \"American Express\",\n DISCOVER: \"Discover\",\n INTERNATIONAL_MAESTRO: \"Maestro\",\n JCB: \"JCB\",\n MASTERCARD: \"MasterCard\",\n SOLO: \"Solo\",\n UK_MAESTRO: \"UK Maestro\",\n UNION_PAY: \"UnionPay\",\n VISA: \"Visa\",\n ELO: \"Elo\",\n HIPER: \"Hiper\",\n HIPERCARD: \"Hipercard\",\n },\n applePayWeb: {\n VISA: \"visa\",\n MASTERCARD: \"mastercard\",\n DISCOVER: \"discover\",\n AMERICAN_EXPRESS: \"amex\",\n INTERNATIONAL_MAESTRO: \"maestro\",\n ELO: \"elo\",\n },\n visaCheckout: {\n VISA: \"Visa\",\n MASTERCARD: \"MasterCard\",\n DISCOVER: \"Discover\",\n AMERICAN_EXPRESS: \"American Express\",\n },\n googlePay: {\n VISA: \"visa\",\n MASTERCARD: \"mastercard\",\n DISCOVER: \"discover\",\n AMERICAN_EXPRESS: \"amex\",\n INTERNATIONAL_MAESTRO: \"maestro\",\n ELO: \"elo\",\n },\n masterpass: {\n VISA: \"visa\",\n MASTERCARD: \"master\",\n DISCOVER: \"discover\",\n AMERICAN_EXPRESS: \"amex\",\n DINERS: \"diners\",\n INTERNATIONAL_MAESTRO: \"maestro\",\n JCB: \"jcb\",\n },\n};\n/* eslint-enable camelcase */\n\nfunction configurationResponseAdapter(responseBody, ctx) {\n var adaptedResponse;\n\n if (responseBody.data && !responseBody.errors) {\n adaptedResponse = adaptConfigurationResponseBody(responseBody, ctx);\n } else {\n adaptedResponse = errorResponseAdapter(responseBody);\n }\n\n return adaptedResponse;\n}\n\nfunction adaptConfigurationResponseBody(body, ctx) {\n var configuration = body.data.clientConfiguration;\n var response;\n\n response = {\n environment: configuration.environment.toLowerCase(),\n clientApiUrl: configuration.clientApiUrl,\n assetsUrl: configuration.assetsUrl,\n analytics: {\n url: configuration.analyticsUrl,\n },\n merchantId: configuration.merchantId,\n venmo: \"off\",\n };\n\n if (configuration.supportedFeatures) {\n response.graphQL = {\n url: ctx._graphQL._config.url,\n features: configuration.supportedFeatures.map(function (feature) {\n return feature.toLowerCase();\n }),\n };\n }\n\n if (configuration.braintreeApi) {\n response.braintreeApi = configuration.braintreeApi;\n }\n\n if (configuration.applePayWeb) {\n response.applePayWeb = configuration.applePayWeb;\n response.applePayWeb.supportedNetworks = mapCardTypes(\n configuration.applePayWeb.supportedCardBrands,\n cardTypeTransforms.applePayWeb\n );\n\n delete response.applePayWeb.supportedCardBrands;\n }\n\n if (configuration.ideal) {\n response.ideal = configuration.ideal;\n }\n\n if (configuration.kount) {\n response.kount = {\n kountMerchantId: configuration.kount.merchantId,\n };\n }\n\n if (configuration.creditCard) {\n response.challenges = configuration.creditCard.challenges.map(function (\n challenge\n ) {\n return challenge.toLowerCase();\n });\n\n response.creditCards = {\n supportedCardTypes: mapCardTypes(\n configuration.creditCard.supportedCardBrands,\n cardTypeTransforms.creditCard\n ),\n };\n response.threeDSecureEnabled = configuration.creditCard.threeDSecureEnabled;\n response.threeDSecure = configuration.creditCard.threeDSecure;\n } else {\n response.challenges = [];\n response.creditCards = {\n supportedCardTypes: [],\n };\n response.threeDSecureEnabled = false;\n }\n\n if (configuration.googlePay) {\n response.androidPay = {\n displayName: configuration.googlePay.displayName,\n enabled: true,\n environment: configuration.googlePay.environment.toLowerCase(),\n googleAuthorizationFingerprint:\n configuration.googlePay.googleAuthorization,\n paypalClientId: configuration.googlePay.paypalClientId,\n supportedNetworks: mapCardTypes(\n configuration.googlePay.supportedCardBrands,\n cardTypeTransforms.googlePay\n ),\n };\n }\n\n if (configuration.venmo) {\n response.payWithVenmo = {\n merchantId: configuration.venmo.merchantId,\n accessToken: configuration.venmo.accessToken,\n environment: configuration.venmo.environment.toLowerCase(),\n };\n }\n\n if (configuration.paypal) {\n response.paypalEnabled = true;\n response.paypal = assign({}, configuration.paypal);\n response.paypal.currencyIsoCode = response.paypal.currencyCode;\n response.paypal.environment = response.paypal.environment.toLowerCase();\n\n delete response.paypal.currencyCode;\n } else {\n response.paypalEnabled = false;\n }\n\n if (configuration.unionPay) {\n response.unionPay = {\n enabled: true,\n merchantAccountId: configuration.unionPay.merchantAccountId,\n };\n }\n\n if (configuration.visaCheckout) {\n response.visaCheckout = {\n apikey: configuration.visaCheckout.apiKey,\n encryptionKey: configuration.visaCheckout.encryptionKey,\n externalClientId: configuration.visaCheckout.externalClientId,\n supportedCardTypes: mapCardTypes(\n configuration.visaCheckout.supportedCardBrands,\n cardTypeTransforms.visaCheckout\n ),\n };\n }\n\n if (configuration.masterpass) {\n response.masterpass = {\n merchantCheckoutId: configuration.masterpass.merchantCheckoutId,\n supportedNetworks: mapCardTypes(\n configuration.masterpass.supportedCardBrands,\n cardTypeTransforms.masterpass\n ),\n };\n }\n\n if (configuration.usBankAccount) {\n response.usBankAccount = {\n routeId: configuration.usBankAccount.routeId,\n plaid: {\n publicKey: configuration.usBankAccount.plaidPublicKey,\n },\n };\n }\n\n return response;\n}\n\nfunction mapCardTypes(cardTypes, cardTypeTransformMap) {\n return cardTypes.reduce(function (acc, type) {\n if (cardTypeTransformMap.hasOwnProperty(type)) {\n return acc.concat(cardTypeTransformMap[type]);\n }\n\n return acc;\n }, []);\n}\n\nmodule.exports = configurationResponseAdapter;\n\n},{\"../../../../lib/assign\":41,\"./error\":27}],26:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar errorResponseAdapter = _dereq_(\"./error\");\n\nvar CARD_BRAND_MAP = {\n /* eslint-disable camelcase */\n AMERICAN_EXPRESS: \"American Express\",\n DINERS: \"Discover\",\n DISCOVER: \"Discover\",\n ELO: \"Elo\",\n HIPER: \"Hiper\",\n HIPERCARD: \"Hipercard\",\n INTERNATIONAL_MAESTRO: \"Maestro\",\n JCB: \"JCB\",\n MASTERCARD: \"MasterCard\",\n UK_MAESTRO: \"Maestro\",\n UNION_PAY: \"UnionPay\",\n VISA: \"Visa\",\n /* eslint-enable camelcase */\n};\n\nvar BIN_DATA_MAP = {\n YES: \"Yes\",\n NO: \"No\",\n UNKNOWN: \"Unknown\",\n};\n\nvar AUTHENTICATION_INSIGHT_MAP = {\n PSDTWO: \"psd2\",\n};\n\nfunction creditCardTokenizationResponseAdapter(responseBody) {\n var adaptedResponse;\n\n if (responseBody.data && !responseBody.errors) {\n adaptedResponse = adaptTokenizeCreditCardResponseBody(responseBody);\n } else {\n adaptedResponse = errorResponseAdapter(responseBody);\n }\n\n return adaptedResponse;\n}\n\nfunction adaptTokenizeCreditCardResponseBody(body) {\n var data = body.data.tokenizeCreditCard;\n var creditCard = data.creditCard;\n var lastTwo = creditCard.last4 ? creditCard.last4.substr(2, 4) : \"\";\n var binData = creditCard.binData;\n var response, regulationEnvironment;\n\n if (binData) {\n [\n \"commercial\",\n \"debit\",\n \"durbinRegulated\",\n \"healthcare\",\n \"payroll\",\n \"prepaid\",\n ].forEach(function (key) {\n if (binData[key]) {\n binData[key] = BIN_DATA_MAP[binData[key]];\n } else {\n binData[key] = \"Unknown\";\n }\n });\n\n [\"issuingBank\", \"countryOfIssuance\", \"productId\"].forEach(function (key) {\n if (!binData[key]) {\n binData[key] = \"Unknown\";\n }\n });\n }\n\n response = {\n creditCards: [\n {\n binData: binData,\n consumed: false,\n description: lastTwo ? \"ending in \" + lastTwo : \"\",\n nonce: data.token,\n details: {\n cardholderName: creditCard.cardholderName,\n expirationMonth: creditCard.expirationMonth,\n expirationYear: creditCard.expirationYear,\n bin: creditCard.bin || \"\",\n cardType: CARD_BRAND_MAP[creditCard.brandCode] || \"Unknown\",\n lastFour: creditCard.last4 || \"\",\n lastTwo: lastTwo,\n },\n type: \"CreditCard\",\n threeDSecureInfo: null,\n },\n ],\n };\n\n if (data.authenticationInsight) {\n regulationEnvironment =\n data.authenticationInsight.customerAuthenticationRegulationEnvironment;\n response.creditCards[0].authenticationInsight = {\n regulationEnvironment:\n AUTHENTICATION_INSIGHT_MAP[regulationEnvironment] ||\n regulationEnvironment.toLowerCase(),\n };\n }\n\n return response;\n}\n\nmodule.exports = creditCardTokenizationResponseAdapter;\n\n},{\"./error\":27}],27:[function(_dereq_,module,exports){\n\"use strict\";\n\nfunction errorResponseAdapter(responseBody) {\n var response;\n var errorClass =\n responseBody.errors &&\n responseBody.errors[0] &&\n responseBody.errors[0].extensions &&\n responseBody.errors[0].extensions.errorClass;\n\n if (errorClass === \"VALIDATION\") {\n response = userErrorResponseAdapter(responseBody);\n } else if (errorClass) {\n response = errorWithClassResponseAdapter(responseBody);\n } else {\n response = {\n error: { message: \"There was a problem serving your request\" },\n fieldErrors: [],\n };\n }\n\n return response;\n}\n\nfunction errorWithClassResponseAdapter(responseBody) {\n return {\n error: { message: responseBody.errors[0].message },\n fieldErrors: [],\n };\n}\n\nfunction userErrorResponseAdapter(responseBody) {\n var fieldErrors = buildFieldErrors(responseBody.errors);\n\n if (fieldErrors.length === 0) {\n return { error: { message: responseBody.errors[0].message } };\n }\n\n return {\n error: { message: getLegacyMessage(fieldErrors) },\n fieldErrors: fieldErrors,\n };\n}\n\nfunction buildFieldErrors(errors) {\n var fieldErrors = [];\n\n errors.forEach(function (error) {\n if (!(error.extensions && error.extensions.inputPath)) {\n return;\n }\n addFieldError(error.extensions.inputPath.slice(1), error, fieldErrors);\n });\n\n return fieldErrors;\n}\n\nfunction addFieldError(inputPath, errorDetail, fieldErrors) {\n var fieldError;\n var legacyCode = errorDetail.extensions.legacyCode;\n var inputField = inputPath[0];\n\n if (inputPath.length === 1) {\n fieldErrors.push({\n code: legacyCode,\n field: inputField,\n message: errorDetail.message,\n });\n\n return;\n }\n\n fieldErrors.forEach(function (candidate) {\n if (candidate.field === inputField) {\n fieldError = candidate;\n }\n });\n\n if (!fieldError) {\n fieldError = { field: inputField, fieldErrors: [] };\n fieldErrors.push(fieldError);\n }\n\n addFieldError(inputPath.slice(1), errorDetail, fieldError.fieldErrors);\n}\n\nfunction getLegacyMessage(errors) {\n var legacyMessages = {\n creditCard: \"Credit card is invalid\",\n };\n\n var field = errors[0].field;\n\n return legacyMessages[field];\n}\n\nmodule.exports = errorResponseAdapter;\n\n},{}],28:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar CONFIGURATION_QUERY =\n \"query ClientConfiguration { \" +\n \" clientConfiguration { \" +\n \" analyticsUrl \" +\n \" environment \" +\n \" merchantId \" +\n \" assetsUrl \" +\n \" clientApiUrl \" +\n \" creditCard { \" +\n \" supportedCardBrands \" +\n \" challenges \" +\n \" threeDSecureEnabled \" +\n \" threeDSecure { \" +\n \" cardinalAuthenticationJWT \" +\n \" } \" +\n \" } \" +\n \" applePayWeb { \" +\n \" countryCode \" +\n \" currencyCode \" +\n \" merchantIdentifier \" +\n \" supportedCardBrands \" +\n \" } \" +\n \" googlePay { \" +\n \" displayName \" +\n \" supportedCardBrands \" +\n \" environment \" +\n \" googleAuthorization \" +\n \" paypalClientId \" +\n \" } \" +\n \" ideal { \" +\n \" routeId \" +\n \" assetsUrl \" +\n \" } \" +\n \" kount { \" +\n \" merchantId \" +\n \" } \" +\n \" masterpass { \" +\n \" merchantCheckoutId \" +\n \" supportedCardBrands \" +\n \" } \" +\n \" paypal { \" +\n \" displayName \" +\n \" clientId \" +\n \" privacyUrl \" +\n \" userAgreementUrl \" +\n \" assetsUrl \" +\n \" environment \" +\n \" environmentNoNetwork \" +\n \" unvettedMerchant \" +\n \" braintreeClientId \" +\n \" billingAgreementsEnabled \" +\n \" merchantAccountId \" +\n \" currencyCode \" +\n \" payeeEmail \" +\n \" } \" +\n \" unionPay { \" +\n \" merchantAccountId \" +\n \" } \" +\n \" usBankAccount { \" +\n \" routeId \" +\n \" plaidPublicKey \" +\n \" } \" +\n \" venmo { \" +\n \" merchantId \" +\n \" accessToken \" +\n \" environment \" +\n \" } \" +\n \" visaCheckout { \" +\n \" apiKey \" +\n \" externalClientId \" +\n \" supportedCardBrands \" +\n \" } \" +\n \" braintreeApi { \" +\n \" accessToken \" +\n \" url \" +\n \" } \" +\n \" supportedFeatures \" +\n \" } \" +\n \"}\";\n\nfunction configuration() {\n return {\n query: CONFIGURATION_QUERY,\n operationName: \"ClientConfiguration\",\n };\n}\n\nmodule.exports = configuration;\n\n},{}],29:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar assign = _dereq_(\"../../../../lib/assign\").assign;\n\nfunction createMutation(config) {\n var hasAuthenticationInsight = config.hasAuthenticationInsight;\n var mutation = \"mutation TokenizeCreditCard($input: TokenizeCreditCardInput!\";\n\n if (hasAuthenticationInsight) {\n mutation += \", $authenticationInsightInput: AuthenticationInsightInput!\";\n }\n\n mutation +=\n \") { \" +\n \" tokenizeCreditCard(input: $input) { \" +\n \" token \" +\n \" creditCard { \" +\n \" bin \" +\n \" brandCode \" +\n \" last4 \" +\n \" cardholderName \" +\n \" expirationMonth\" +\n \" expirationYear\" +\n \" binData { \" +\n \" prepaid \" +\n \" healthcare \" +\n \" debit \" +\n \" durbinRegulated \" +\n \" commercial \" +\n \" payroll \" +\n \" issuingBank \" +\n \" countryOfIssuance \" +\n \" productId \" +\n \" } \" +\n \" } \";\n\n if (hasAuthenticationInsight) {\n mutation +=\n \" authenticationInsight(input: $authenticationInsightInput) {\" +\n \" customerAuthenticationRegulationEnvironment\" +\n \" }\";\n }\n\n mutation += \" } }\";\n\n return mutation;\n}\n\nfunction createCreditCardTokenizationBody(body, options) {\n var cc = body.creditCard;\n var billingAddress = cc && cc.billingAddress;\n var expDate = cc && cc.expirationDate;\n var expirationMonth =\n cc && (cc.expirationMonth || (expDate && expDate.split(\"/\")[0].trim()));\n var expirationYear =\n cc && (cc.expirationYear || (expDate && expDate.split(\"/\")[1].trim()));\n var variables = {\n input: {\n creditCard: {\n number: cc && cc.number,\n expirationMonth: expirationMonth,\n expirationYear: expirationYear,\n cvv: cc && cc.cvv,\n cardholderName: cc && cc.cardholderName,\n },\n options: {},\n },\n };\n\n if (options.hasAuthenticationInsight) {\n variables.authenticationInsightInput = {\n merchantAccountId: body.merchantAccountId,\n };\n }\n\n if (billingAddress) {\n variables.input.creditCard.billingAddress = billingAddress;\n }\n\n variables.input = addValidationRule(body, variables.input);\n\n return variables;\n}\n\nfunction addValidationRule(body, input) {\n var validate;\n\n if (\n body.creditCard &&\n body.creditCard.options &&\n typeof body.creditCard.options.validate === \"boolean\"\n ) {\n validate = body.creditCard.options.validate;\n } else if (\n (body.authorizationFingerprint && body.tokenizationKey) ||\n body.authorizationFingerprint\n ) {\n validate = true;\n } else if (body.tokenizationKey) {\n validate = false;\n }\n\n if (typeof validate === \"boolean\") {\n input.options = assign(\n {\n validate: validate,\n },\n input.options\n );\n }\n\n return input;\n}\n\nfunction creditCardTokenization(body) {\n var options = {\n hasAuthenticationInsight: Boolean(\n body.authenticationInsight && body.merchantAccountId\n ),\n };\n\n return {\n query: createMutation(options),\n variables: createCreditCardTokenizationBody(body, options),\n operationName: \"TokenizeCreditCard\",\n };\n}\n\nmodule.exports = creditCardTokenization;\n\n},{\"../../../../lib/assign\":41}],30:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar browserDetection = _dereq_(\"../../browser-detection\");\n\nvar features = {\n tokenize_credit_cards: \"payment_methods/credit_cards\", // eslint-disable-line camelcase\n configuration: \"configuration\",\n};\n\nvar disallowedInputPaths = [\"creditCard.options.unionPayEnrollment\"];\n\nfunction GraphQL(config) {\n this._config = config.graphQL;\n}\n\nGraphQL.prototype.getGraphQLEndpoint = function () {\n return this._config.url;\n};\n\nGraphQL.prototype.isGraphQLRequest = function (url, body) {\n var featureEnabled;\n var path = this.getClientApiPath(url);\n\n if (!this._isGraphQLEnabled() || !path || browserDetection.isIe9()) {\n return false;\n }\n\n featureEnabled = this._config.features.some(function (feature) {\n return features[feature] === path;\n });\n\n if (containsDisallowedlistedKeys(body)) {\n return false;\n }\n\n return featureEnabled;\n};\n\nGraphQL.prototype.getClientApiPath = function (url) {\n var path;\n var clientApiPrefix = \"/client_api/v1/\";\n var pathParts = url.split(clientApiPrefix);\n\n if (pathParts.length > 1) {\n path = pathParts[1].split(\"?\")[0];\n }\n\n return path;\n};\n\nGraphQL.prototype._isGraphQLEnabled = function () {\n return Boolean(this._config);\n};\n\nfunction containsDisallowedlistedKeys(body) {\n return disallowedInputPaths.some(function (keys) {\n var value = keys.split(\".\").reduce(function (accumulator, key) {\n return accumulator && accumulator[key];\n }, body);\n\n return value !== undefined; // eslint-disable-line no-undefined\n });\n}\n\nmodule.exports = GraphQL;\n\n},{\"../../browser-detection\":16}],31:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar BRAINTREE_VERSION = _dereq_(\"../../constants\").BRAINTREE_VERSION;\n\nvar assign = _dereq_(\"../../../lib/assign\").assign;\nvar snakeCaseToCamelCase = _dereq_(\"../../../lib/snake-case-to-camel-case\");\n\nvar creditCardTokenizationBodyGenerator = _dereq_(\"./generators/credit-card-tokenization\");\nvar creditCardTokenizationResponseAdapter = _dereq_(\"./adapters/credit-card-tokenization\");\n\nvar configurationBodyGenerator = _dereq_(\"./generators/configuration\");\nvar configurationResponseAdapter = _dereq_(\"./adapters/configuration\");\n\nvar generators = {\n \"payment_methods/credit_cards\": creditCardTokenizationBodyGenerator,\n configuration: configurationBodyGenerator,\n};\nvar adapters = {\n \"payment_methods/credit_cards\": creditCardTokenizationResponseAdapter,\n configuration: configurationResponseAdapter,\n};\n\nfunction GraphQLRequest(options) {\n var clientApiPath = options.graphQL.getClientApiPath(options.url);\n\n this._graphQL = options.graphQL;\n this._data = options.data;\n this._method = options.method;\n this._headers = options.headers;\n this._clientSdkMetadata = {\n source: options.metadata.source,\n integration: options.metadata.integration,\n sessionId: options.metadata.sessionId,\n };\n this._sendAnalyticsEvent = options.sendAnalyticsEvent || Function.prototype;\n\n this._generator = generators[clientApiPath];\n this._adapter = adapters[clientApiPath];\n\n this._sendAnalyticsEvent(\"graphql.init\");\n}\n\nGraphQLRequest.prototype.getUrl = function () {\n return this._graphQL.getGraphQLEndpoint();\n};\n\nGraphQLRequest.prototype.getBody = function () {\n var formattedBody = formatBodyKeys(this._data);\n var generatedBody = this._generator(formattedBody);\n var body = assign(\n { clientSdkMetadata: this._clientSdkMetadata },\n generatedBody\n );\n\n return JSON.stringify(body);\n};\n\nGraphQLRequest.prototype.getMethod = function () {\n return \"POST\";\n};\n\nGraphQLRequest.prototype.getHeaders = function () {\n var authorization, headers;\n\n if (this._data.authorizationFingerprint) {\n this._sendAnalyticsEvent(\"graphql.authorization-fingerprint\");\n authorization = this._data.authorizationFingerprint;\n } else {\n this._sendAnalyticsEvent(\"graphql.tokenization-key\");\n authorization = this._data.tokenizationKey;\n }\n\n headers = {\n Authorization: \"Bearer \" + authorization,\n \"Braintree-Version\": BRAINTREE_VERSION,\n };\n\n return assign({}, this._headers, headers);\n};\n\nGraphQLRequest.prototype.adaptResponseBody = function (parsedBody) {\n return this._adapter(parsedBody, this);\n};\n\nGraphQLRequest.prototype.determineStatus = function (\n httpStatus,\n parsedResponse\n) {\n var status, errorClass;\n\n if (httpStatus === 200) {\n errorClass =\n parsedResponse.errors &&\n parsedResponse.errors[0] &&\n parsedResponse.errors[0].extensions &&\n parsedResponse.errors[0].extensions.errorClass;\n\n if (parsedResponse.data && !parsedResponse.errors) {\n status = 200;\n } else if (errorClass === \"VALIDATION\") {\n status = 422;\n } else if (errorClass === \"AUTHORIZATION\") {\n status = 403;\n } else if (errorClass === \"AUTHENTICATION\") {\n status = 401;\n } else if (isGraphQLError(errorClass, parsedResponse)) {\n status = 403;\n } else {\n status = 500;\n }\n } else if (!httpStatus) {\n status = 500;\n } else {\n status = httpStatus;\n }\n\n this._sendAnalyticsEvent(\"graphql.status.\" + httpStatus);\n this._sendAnalyticsEvent(\"graphql.determinedStatus.\" + status);\n\n return status;\n};\n\nfunction isGraphQLError(errorClass, parsedResponse) {\n return !errorClass && parsedResponse.errors[0].message;\n}\n\nfunction formatBodyKeys(originalBody) {\n var body = {};\n\n Object.keys(originalBody).forEach(function (key) {\n var camelCaseKey = snakeCaseToCamelCase(key);\n\n if (typeof originalBody[key] === \"object\") {\n body[camelCaseKey] = formatBodyKeys(originalBody[key]);\n } else if (typeof originalBody[key] === \"number\") {\n body[camelCaseKey] = String(originalBody[key]);\n } else {\n body[camelCaseKey] = originalBody[key];\n }\n });\n\n return body;\n}\n\nmodule.exports = GraphQLRequest;\n\n},{\"../../../lib/assign\":41,\"../../../lib/snake-case-to-camel-case\":57,\"../../constants\":18,\"./adapters/configuration\":25,\"./adapters/credit-card-tokenization\":26,\"./generators/configuration\":28,\"./generators/credit-card-tokenization\":29}],32:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar ajaxIsAvaliable;\nvar once = _dereq_(\"../../lib/once\");\nvar JSONPDriver = _dereq_(\"./jsonp-driver\");\nvar AJAXDriver = _dereq_(\"./ajax-driver\");\nvar getUserAgent = _dereq_(\"./get-user-agent\");\nvar isHTTP = _dereq_(\"./is-http\");\n\nfunction isAjaxAvailable() {\n if (ajaxIsAvaliable == null) {\n ajaxIsAvaliable = !(isHTTP() && /MSIE\\s(8|9)/.test(getUserAgent()));\n }\n\n return ajaxIsAvaliable;\n}\n\nmodule.exports = function (options, cb) {\n cb = once(cb || Function.prototype);\n options.method = (options.method || \"GET\").toUpperCase();\n options.timeout = options.timeout == null ? 60000 : options.timeout;\n options.data = options.data || {};\n\n if (isAjaxAvailable()) {\n AJAXDriver.request(options, cb);\n } else {\n JSONPDriver.request(options, cb);\n }\n};\n\n},{\"../../lib/once\":54,\"./ajax-driver\":22,\"./get-user-agent\":24,\"./is-http\":33,\"./jsonp-driver\":34}],33:[function(_dereq_,module,exports){\n\"use strict\";\n\nmodule.exports = function () {\n return window.location.protocol === \"http:\";\n};\n\n},{}],34:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar head;\nvar uuid = _dereq_(\"@braintree/uuid\");\nvar querystring = _dereq_(\"../../lib/querystring\");\nvar timeouts = {};\n\nfunction _removeScript(script) {\n if (script && script.parentNode) {\n script.parentNode.removeChild(script);\n }\n}\n\nfunction _createScriptTag(url, callbackName) {\n var script = document.createElement(\"script\");\n var done = false;\n\n script.src = url;\n script.async = true;\n script.onerror = function () {\n window[callbackName]({ message: \"error\", status: 500 });\n };\n\n script.onload = script.onreadystatechange = function () {\n if (done) {\n return;\n }\n\n if (\n !this.readyState ||\n this.readyState === \"loaded\" ||\n this.readyState === \"complete\"\n ) {\n done = true;\n script.onload = script.onreadystatechange = null;\n }\n };\n\n return script;\n}\n\nfunction _cleanupGlobal(callbackName) {\n try {\n delete window[callbackName];\n } catch (_) {\n window[callbackName] = null;\n }\n}\n\nfunction _setupTimeout(timeout, callbackName) {\n timeouts[callbackName] = setTimeout(function () {\n timeouts[callbackName] = null;\n\n window[callbackName]({\n error: \"timeout\",\n status: -1,\n });\n\n window[callbackName] = function () {\n _cleanupGlobal(callbackName);\n };\n }, timeout);\n}\n\nfunction _setupGlobalCallback(script, callback, callbackName) {\n window[callbackName] = function (response) {\n var status = response.status || 500;\n var err = null;\n var data = null;\n\n delete response.status;\n\n if (status >= 400 || status < 200) {\n err = response;\n } else {\n data = response;\n }\n\n _cleanupGlobal(callbackName);\n _removeScript(script);\n\n clearTimeout(timeouts[callbackName]);\n callback(err, data, status);\n };\n}\n\nfunction request(options, callback) {\n var script;\n var callbackName = \"callback_json_\" + uuid().replace(/-/g, \"\");\n var url = options.url;\n var attrs = options.data;\n var method = options.method;\n var timeout = options.timeout;\n\n url = querystring.queryify(url, attrs);\n url = querystring.queryify(url, {\n _method: method,\n callback: callbackName,\n });\n\n script = _createScriptTag(url, callbackName);\n _setupGlobalCallback(script, callback, callbackName);\n _setupTimeout(timeout, callbackName);\n\n if (!head) {\n head = document.getElementsByTagName(\"head\")[0];\n }\n\n head.appendChild(script);\n}\n\nmodule.exports = {\n request: request,\n};\n\n},{\"../../lib/querystring\":56,\"@braintree/uuid\":10}],35:[function(_dereq_,module,exports){\n\"use strict\";\n\nmodule.exports = function (body) {\n try {\n body = JSON.parse(body);\n } catch (e) {\n /* ignored */\n }\n\n return body;\n};\n\n},{}],36:[function(_dereq_,module,exports){\n\"use strict\";\n\nmodule.exports = function (method, body) {\n if (typeof method !== \"string\") {\n throw new Error(\"Method must be a string\");\n }\n\n if (method.toLowerCase() !== \"get\" && body != null) {\n body = typeof body === \"string\" ? body : JSON.stringify(body);\n }\n\n return body;\n};\n\n},{}],37:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar isXHRAvailable =\n typeof window !== \"undefined\" &&\n window.XMLHttpRequest &&\n \"withCredentials\" in new window.XMLHttpRequest();\n\nfunction getRequestObject() {\n return isXHRAvailable\n ? new window.XMLHttpRequest()\n : new window.XDomainRequest();\n}\n\nmodule.exports = {\n isAvailable: isXHRAvailable,\n getRequestObject: getRequestObject,\n};\n\n},{}],38:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar createAuthorizationData = _dereq_(\"./create-authorization-data\");\nvar jsonClone = _dereq_(\"./json-clone\");\nvar constants = _dereq_(\"./constants\");\n\nfunction addMetadata(configuration, data) {\n var key;\n var attrs = data ? jsonClone(data) : {};\n var authAttrs = createAuthorizationData(configuration.authorization).attrs;\n var _meta = jsonClone(configuration.analyticsMetadata);\n\n attrs.braintreeLibraryVersion = constants.BRAINTREE_LIBRARY_VERSION;\n\n for (key in attrs._meta) {\n if (attrs._meta.hasOwnProperty(key)) {\n _meta[key] = attrs._meta[key];\n }\n }\n\n attrs._meta = _meta;\n\n if (authAttrs.tokenizationKey) {\n attrs.tokenizationKey = authAttrs.tokenizationKey;\n } else {\n attrs.authorizationFingerprint = authAttrs.authorizationFingerprint;\n }\n\n return attrs;\n}\n\nmodule.exports = addMetadata;\n\n},{\"./constants\":43,\"./create-authorization-data\":46,\"./json-clone\":52}],39:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar Promise = _dereq_(\"./promise\");\nvar constants = _dereq_(\"./constants\");\nvar addMetadata = _dereq_(\"./add-metadata\");\n\nfunction sendAnalyticsEvent(clientInstanceOrPromise, kind, callback) {\n var timestamp = Date.now(); // milliseconds\n\n return Promise.resolve(clientInstanceOrPromise)\n .then(function (client) {\n var timestampInPromise = Date.now();\n var configuration = client.getConfiguration();\n var request = client._request;\n var url = configuration.gatewayConfiguration.analytics.url;\n var data = {\n analytics: [\n {\n kind: constants.ANALYTICS_PREFIX + kind,\n isAsync:\n Math.floor(timestampInPromise / 1000) !==\n Math.floor(timestamp / 1000),\n timestamp: timestamp,\n },\n ],\n };\n\n request(\n {\n url: url,\n method: \"post\",\n data: addMetadata(configuration, data),\n timeout: constants.ANALYTICS_REQUEST_TIMEOUT_MS,\n },\n callback\n );\n })\n .catch(function (err) {\n // for all non-test cases, we don't provide a callback,\n // so this error will always be swallowed. In this case,\n // that's fine, it should only error when the deferred\n // client fails to set up, in which case we don't want\n // that error to report over and over again via these\n // deferred analytics events\n if (callback) {\n callback(err);\n }\n });\n}\n\nmodule.exports = {\n sendEvent: sendAnalyticsEvent,\n};\n\n},{\"./add-metadata\":38,\"./constants\":43,\"./promise\":55}],40:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar loadScript = _dereq_(\"@braintree/asset-loader/load-script\");\n\nmodule.exports = {\n loadScript: loadScript,\n};\n\n},{\"@braintree/asset-loader/load-script\":3}],41:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar assignNormalized =\n typeof Object.assign === \"function\" ? Object.assign : assignPolyfill;\n\nfunction assignPolyfill(destination) {\n var i, source, key;\n\n for (i = 1; i < arguments.length; i++) {\n source = arguments[i];\n for (key in source) {\n if (source.hasOwnProperty(key)) {\n destination[key] = source[key];\n }\n }\n }\n\n return destination;\n}\n\nmodule.exports = {\n assign: assignNormalized,\n _assign: assignPolyfill,\n};\n\n},{}],42:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar enumerate = _dereq_(\"./enumerate\");\n\n/**\n * @class\n * @global\n * @param {object} options Construction options\n * @classdesc This class is used to report error conditions, frequently as the first parameter to callbacks throughout the Braintree SDK.\n * @description You cannot use this constructor directly. Interact with instances of this class through {@link callback callbacks}.\n */\nfunction BraintreeError(options) {\n if (!BraintreeError.types.hasOwnProperty(options.type)) {\n throw new Error(options.type + \" is not a valid type.\");\n }\n\n if (!options.code) {\n throw new Error(\"Error code required.\");\n }\n\n if (!options.message) {\n throw new Error(\"Error message required.\");\n }\n\n this.name = \"BraintreeError\";\n\n /**\n * @type {string}\n * @description A code that corresponds to specific errors.\n */\n this.code = options.code;\n\n /**\n * @type {string}\n * @description A short description of the error.\n */\n this.message = options.message;\n\n /**\n * @type {BraintreeError.types}\n * @description The type of error.\n */\n this.type = options.type;\n\n /**\n * @type {object=}\n * @description Additional information about the error, such as an underlying network error response.\n */\n this.details = options.details;\n}\n\nBraintreeError.prototype = Object.create(Error.prototype);\nBraintreeError.prototype.constructor = BraintreeError;\n\n/**\n * Enum for {@link BraintreeError} types.\n * @name BraintreeError.types\n * @enum\n * @readonly\n * @memberof BraintreeError\n * @property {string} CUSTOMER An error caused by the customer.\n * @property {string} MERCHANT An error that is actionable by the merchant.\n * @property {string} NETWORK An error due to a network problem.\n * @property {string} INTERNAL An error caused by Braintree code.\n * @property {string} UNKNOWN An error where the origin is unknown.\n */\nBraintreeError.types = enumerate([\n \"CUSTOMER\",\n \"MERCHANT\",\n \"NETWORK\",\n \"INTERNAL\",\n \"UNKNOWN\",\n]);\n\nBraintreeError.findRootError = function (err) {\n if (\n err instanceof BraintreeError &&\n err.details &&\n err.details.originalError\n ) {\n return BraintreeError.findRootError(err.details.originalError);\n }\n\n return err;\n};\n\nmodule.exports = BraintreeError;\n\n},{\"./enumerate\":48}],43:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar VERSION = \"3.92.1\";\nvar PLATFORM = \"web\";\n\nvar CLIENT_API_URLS = {\n production: \"https://api.braintreegateway.com:443\",\n sandbox: \"https://api.sandbox.braintreegateway.com:443\",\n};\n\nvar ASSETS_URLS = {\n production: \"https://assets.braintreegateway.com\",\n sandbox: \"https://assets.braintreegateway.com\",\n};\n\nvar GRAPHQL_URLS = {\n production: \"https://payments.braintree-api.com/graphql\",\n sandbox: \"https://payments.sandbox.braintree-api.com/graphql\",\n};\n\n// endRemoveIf(production)\n\nmodule.exports = {\n ANALYTICS_PREFIX: PLATFORM + \".\",\n ANALYTICS_REQUEST_TIMEOUT_MS: 2000,\n ASSETS_URLS: ASSETS_URLS,\n CLIENT_API_URLS: CLIENT_API_URLS,\n FRAUDNET_SOURCE: \"BRAINTREE_SIGNIN\",\n FRAUDNET_FNCLS: \"fnparams-dede7cc5-15fd-4c75-a9f4-36c430ee3a99\",\n FRAUDNET_URL: \"https://c.paypal.com/da/r/fb.js\",\n BUS_CONFIGURATION_REQUEST_EVENT: \"BUS_CONFIGURATION_REQUEST\",\n GRAPHQL_URLS: GRAPHQL_URLS,\n INTEGRATION_TIMEOUT_MS: 60000,\n VERSION: VERSION,\n INTEGRATION: \"custom\",\n SOURCE: \"client\",\n PLATFORM: PLATFORM,\n BRAINTREE_LIBRARY_VERSION: \"braintree/\" + PLATFORM + \"/\" + VERSION,\n};\n\n},{}],44:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar BraintreeError = _dereq_(\"./braintree-error\");\nvar sharedErrors = _dereq_(\"./errors\");\n\nmodule.exports = function (instance, methodNames) {\n methodNames.forEach(function (methodName) {\n instance[methodName] = function () {\n throw new BraintreeError({\n type: sharedErrors.METHOD_CALLED_AFTER_TEARDOWN.type,\n code: sharedErrors.METHOD_CALLED_AFTER_TEARDOWN.code,\n message: methodName + \" cannot be called after teardown.\",\n });\n };\n });\n};\n\n},{\"./braintree-error\":42,\"./errors\":49}],45:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar BraintreeError = _dereq_(\"./braintree-error\");\n\nfunction convertToBraintreeError(originalErr, btErrorObject) {\n if (originalErr instanceof BraintreeError) {\n return originalErr;\n }\n\n return new BraintreeError({\n type: btErrorObject.type,\n code: btErrorObject.code,\n message: btErrorObject.message,\n details: {\n originalError: originalErr,\n },\n });\n}\n\nmodule.exports = convertToBraintreeError;\n\n},{\"./braintree-error\":42}],46:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar atob = _dereq_(\"../lib/vendor/polyfill\").atob;\nvar CLIENT_API_URLS = _dereq_(\"../lib/constants\").CLIENT_API_URLS;\n\nfunction _isTokenizationKey(str) {\n return /^[a-zA-Z0-9]+_[a-zA-Z0-9]+_[a-zA-Z0-9_]+$/.test(str);\n}\n\nfunction _parseTokenizationKey(tokenizationKey) {\n var tokens = tokenizationKey.split(\"_\");\n var environment = tokens[0];\n var merchantId = tokens.slice(2).join(\"_\");\n\n return {\n merchantId: merchantId,\n environment: environment,\n };\n}\n\nfunction createAuthorizationData(authorization) {\n var parsedClientToken, parsedTokenizationKey;\n var data = {\n attrs: {},\n configUrl: \"\",\n };\n\n if (_isTokenizationKey(authorization)) {\n parsedTokenizationKey = _parseTokenizationKey(authorization);\n data.environment = parsedTokenizationKey.environment;\n data.attrs.tokenizationKey = authorization;\n data.configUrl =\n CLIENT_API_URLS[parsedTokenizationKey.environment] +\n \"/merchants/\" +\n parsedTokenizationKey.merchantId +\n \"/client_api/v1/configuration\";\n } else {\n parsedClientToken = JSON.parse(atob(authorization));\n data.environment = parsedClientToken.environment;\n data.attrs.authorizationFingerprint =\n parsedClientToken.authorizationFingerprint;\n data.configUrl = parsedClientToken.configUrl;\n data.graphQL = parsedClientToken.graphQL;\n }\n\n return data;\n}\n\nmodule.exports = createAuthorizationData;\n\n},{\"../lib/constants\":43,\"../lib/vendor/polyfill\":58}],47:[function(_dereq_,module,exports){\n\"use strict\";\n\nmodule.exports = function (fn) {\n return function () {\n // IE9 doesn't support passing arguments to setTimeout so we have to emulate it.\n var args = arguments;\n\n setTimeout(function () {\n fn.apply(null, args);\n }, 1);\n };\n};\n\n},{}],48:[function(_dereq_,module,exports){\n\"use strict\";\n\nfunction enumerate(values, prefix) {\n prefix = prefix == null ? \"\" : prefix;\n\n return values.reduce(function (enumeration, value) {\n enumeration[value] = prefix + value;\n\n return enumeration;\n }, {});\n}\n\nmodule.exports = enumerate;\n\n},{}],49:[function(_dereq_,module,exports){\n\"use strict\";\n\n/**\n * @name BraintreeError.Shared Internal Error Codes\n * @ignore\n * @description These codes should never be experienced by the merchant directly.\n * @property {INTERNAL} INVALID_USE_OF_INTERNAL_FUNCTION Occurs when the client is created without a gateway configuration. Should never happen.\n */\n\n/**\n * @name BraintreeError.Shared Errors - Component Creation Error Codes\n * @description Errors that occur when creating components.\n * @property {MERCHANT} INSTANTIATION_OPTION_REQUIRED Occurs when a component is created that is missing a required option.\n * @property {MERCHANT} INCOMPATIBLE_VERSIONS Occurs when a component is created with a client with a different version than the component.\n * @property {NETWORK} CLIENT_SCRIPT_FAILED_TO_LOAD Occurs when a component attempts to load the Braintree client script, but the request fails.\n */\n\n/**\n * @name BraintreeError.Shared Errors - Component Instance Error Codes\n * @description Errors that occur when using instances of components.\n * @property {MERCHANT} METHOD_CALLED_AFTER_TEARDOWN Occurs when a method is called on a component instance after it has been torn down.\n */\n\nvar BraintreeError = _dereq_(\"./braintree-error\");\n\nmodule.exports = {\n INVALID_USE_OF_INTERNAL_FUNCTION: {\n type: BraintreeError.types.INTERNAL,\n code: \"INVALID_USE_OF_INTERNAL_FUNCTION\",\n },\n INSTANTIATION_OPTION_REQUIRED: {\n type: BraintreeError.types.MERCHANT,\n code: \"INSTANTIATION_OPTION_REQUIRED\",\n },\n INCOMPATIBLE_VERSIONS: {\n type: BraintreeError.types.MERCHANT,\n code: \"INCOMPATIBLE_VERSIONS\",\n },\n CLIENT_SCRIPT_FAILED_TO_LOAD: {\n type: BraintreeError.types.NETWORK,\n code: \"CLIENT_SCRIPT_FAILED_TO_LOAD\",\n message: \"Braintree client script could not be loaded.\",\n },\n METHOD_CALLED_AFTER_TEARDOWN: {\n type: BraintreeError.types.MERCHANT,\n code: \"METHOD_CALLED_AFTER_TEARDOWN\",\n },\n};\n\n},{\"./braintree-error\":42}],50:[function(_dereq_,module,exports){\n\"use strict\";\n\nfunction convertDateStringToDate(dateString) {\n var splitDate = dateString.split(\"-\");\n\n return new Date(splitDate[0], splitDate[1], splitDate[2]);\n}\n\nfunction isDateStringBeforeOrOn(firstDate, secondDate) {\n return (\n convertDateStringToDate(firstDate) <= convertDateStringToDate(secondDate)\n );\n}\n\nmodule.exports = isDateStringBeforeOrOn;\n\n},{}],51:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar parser;\nvar legalHosts = {\n \"paypal.com\": 1,\n \"braintreepayments.com\": 1,\n \"braintreegateway.com\": 1,\n \"braintree-api.com\": 1,\n};\n\n// endRemoveIf(production)\n\nfunction stripSubdomains(domain) {\n return domain.split(\".\").slice(-2).join(\".\");\n}\n\nfunction isVerifiedDomain(url) {\n var mainDomain;\n\n url = url.toLowerCase();\n\n if (!/^https:/.test(url)) {\n return false;\n }\n\n parser = parser || document.createElement(\"a\");\n parser.href = url;\n mainDomain = stripSubdomains(parser.hostname);\n\n return legalHosts.hasOwnProperty(mainDomain);\n}\n\nmodule.exports = isVerifiedDomain;\n\n},{}],52:[function(_dereq_,module,exports){\n\"use strict\";\n\nmodule.exports = function (value) {\n return JSON.parse(JSON.stringify(value));\n};\n\n},{}],53:[function(_dereq_,module,exports){\n\"use strict\";\n\nmodule.exports = function (obj) {\n return Object.keys(obj).filter(function (key) {\n return typeof obj[key] === \"function\";\n });\n};\n\n},{}],54:[function(_dereq_,module,exports){\n\"use strict\";\n\nfunction once(fn) {\n var called = false;\n\n return function () {\n if (!called) {\n called = true;\n fn.apply(null, arguments);\n }\n };\n}\n\nmodule.exports = once;\n\n},{}],55:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar PromisePolyfill = _dereq_(\"promise-polyfill\");\nvar ExtendedPromise = _dereq_(\"@braintree/extended-promise\");\n\n// eslint-disable-next-line no-undef\nvar PromiseGlobal = typeof Promise !== \"undefined\" ? Promise : PromisePolyfill;\n\nExtendedPromise.suppressUnhandledPromiseMessage = true;\nExtendedPromise.setPromise(PromiseGlobal);\n\nmodule.exports = PromiseGlobal;\n\n},{\"@braintree/extended-promise\":9,\"promise-polyfill\":15}],56:[function(_dereq_,module,exports){\n\"use strict\";\n\nfunction _notEmpty(obj) {\n var key;\n\n for (key in obj) {\n if (obj.hasOwnProperty(key)) {\n return true;\n }\n }\n\n return false;\n}\n\n/* eslint-disable no-mixed-operators */\nfunction _isArray(value) {\n return (\n (value &&\n typeof value === \"object\" &&\n typeof value.length === \"number\" &&\n Object.prototype.toString.call(value) === \"[object Array]\") ||\n false\n );\n}\n/* eslint-enable no-mixed-operators */\n\nfunction hasQueryParams(url) {\n url = url || window.location.href;\n\n return /\\?/.test(url);\n}\n\nfunction parse(url) {\n var query, params;\n\n url = url || window.location.href;\n\n if (!hasQueryParams(url)) {\n return {};\n }\n\n query = url.split(\"?\")[1] || \"\";\n query = query.replace(/#.*$/, \"\").split(\"&\");\n\n params = query.reduce(function (toReturn, keyValue) {\n var parts = keyValue.split(\"=\");\n var key = decodeURIComponent(parts[0]);\n var value = decodeURIComponent(parts[1]);\n\n toReturn[key] = value;\n\n return toReturn;\n }, {});\n\n return params;\n}\n\nfunction stringify(params, namespace) {\n var k, v, p;\n var query = [];\n\n for (p in params) {\n if (!params.hasOwnProperty(p)) {\n continue;\n }\n\n v = params[p];\n\n if (namespace) {\n if (_isArray(params)) {\n k = namespace + \"[]\";\n } else {\n k = namespace + \"[\" + p + \"]\";\n }\n } else {\n k = p;\n }\n if (typeof v === \"object\") {\n query.push(stringify(v, k));\n } else {\n query.push(encodeURIComponent(k) + \"=\" + encodeURIComponent(v));\n }\n }\n\n return query.join(\"&\");\n}\n\nfunction queryify(url, params) {\n url = url || \"\";\n\n if (params != null && typeof params === \"object\" && _notEmpty(params)) {\n url += url.indexOf(\"?\") === -1 ? \"?\" : \"\";\n url += url.indexOf(\"=\") !== -1 ? \"&\" : \"\";\n url += stringify(params);\n }\n\n return url;\n}\n\nmodule.exports = {\n parse: parse,\n stringify: stringify,\n queryify: queryify,\n hasQueryParams: hasQueryParams,\n};\n\n},{}],57:[function(_dereq_,module,exports){\n\"use strict\";\n\nmodule.exports = function (snakeString) {\n if (snakeString.indexOf(\"_\") === -1) {\n return snakeString;\n }\n\n return snakeString.toLowerCase().replace(/(\\_\\w)/g, function (match) {\n return match[1].toUpperCase();\n });\n};\n\n},{}],58:[function(_dereq_,module,exports){\n\"use strict\";\n\n// NEXT_MAJOR_VERSION old versions of IE don't have atob, in the\n// next major version, we're dropping support for those versions\n// so we can eliminate the need to have this atob polyfill\nvar atobNormalized = typeof atob === \"function\" ? atob : atobPolyfill;\n\nfunction atobPolyfill(base64String) {\n var a, b, c, b1, b2, b3, b4, i;\n var base64Matcher = new RegExp(\n \"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})([=]{1,2})?$\"\n );\n var characters =\n \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n var result = \"\";\n\n if (!base64Matcher.test(base64String)) {\n throw new Error(\"Non base64 encoded input passed to window.atob polyfill\");\n }\n\n i = 0;\n do {\n b1 = characters.indexOf(base64String.charAt(i++));\n b2 = characters.indexOf(base64String.charAt(i++));\n b3 = characters.indexOf(base64String.charAt(i++));\n b4 = characters.indexOf(base64String.charAt(i++));\n\n a = ((b1 & 0x3f) << 2) | ((b2 >> 4) & 0x3);\n b = ((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf);\n c = ((b3 & 0x3) << 6) | (b4 & 0x3f);\n\n result +=\n String.fromCharCode(a) +\n (b ? String.fromCharCode(b) : \"\") +\n (c ? String.fromCharCode(c) : \"\");\n } while (i < base64String.length);\n\n return result;\n}\n\nmodule.exports = {\n atob: function (base64String) {\n return atobNormalized.call(window, base64String);\n },\n _atob: atobPolyfill,\n};\n\n},{}]},{},[21])(21)\n});\n","var scope = (typeof global !== \"undefined\" && global) ||\n (typeof self !== \"undefined\" && self) ||\n window;\nvar apply = Function.prototype.apply;\n\n// DOM APIs, for completeness\n\nexports.setTimeout = function() {\n return new Timeout(apply.call(setTimeout, scope, arguments), clearTimeout);\n};\nexports.setInterval = function() {\n return new Timeout(apply.call(setInterval, scope, arguments), clearInterval);\n};\nexports.clearTimeout =\nexports.clearInterval = function(timeout) {\n if (timeout) {\n timeout.close();\n }\n};\n\nfunction Timeout(id, clearFn) {\n this._id = id;\n this._clearFn = clearFn;\n}\nTimeout.prototype.unref = Timeout.prototype.ref = function() {};\nTimeout.prototype.close = function() {\n this._clearFn.call(scope, this._id);\n};\n\n// Does not start the time, just sets up the members needed.\nexports.enroll = function(item, msecs) {\n clearTimeout(item._idleTimeoutId);\n item._idleTimeout = msecs;\n};\n\nexports.unenroll = function(item) {\n clearTimeout(item._idleTimeoutId);\n item._idleTimeout = -1;\n};\n\nexports._unrefActive = exports.active = function(item) {\n clearTimeout(item._idleTimeoutId);\n\n var msecs = item._idleTimeout;\n if (msecs >= 0) {\n item._idleTimeoutId = setTimeout(function onTimeout() {\n if (item._onTimeout)\n item._onTimeout();\n }, msecs);\n }\n};\n\n// setimmediate attaches itself to the global object\nrequire(\"setimmediate\");\n// On some exotic environments, it's not clear which object `setimmediate` was\n// able to install onto. Search each possibility in the same order as the\n// `setimmediate` library.\nexports.setImmediate = (typeof self !== \"undefined\" && self.setImmediate) ||\n (typeof global !== \"undefined\" && global.setImmediate) ||\n (this && this.setImmediate);\nexports.clearImmediate = (typeof self !== \"undefined\" && self.clearImmediate) ||\n (typeof global !== \"undefined\" && global.clearImmediate) ||\n (this && this.clearImmediate);\n","'use strict'\n\nmodule.exports = Schema\n\nvar proto = Schema.prototype\n\nproto.space = null\nproto.normal = {}\nproto.property = {}\n\nfunction Schema(property, normal, space) {\n this.property = property\n this.normal = normal\n\n if (space) {\n this.space = space\n }\n}\n","'use strict'\n\nvar Info = require('./info')\nvar types = require('./types')\n\nmodule.exports = DefinedInfo\n\nDefinedInfo.prototype = new Info()\nDefinedInfo.prototype.defined = true\n\nvar checks = [\n 'boolean',\n 'booleanish',\n 'overloadedBoolean',\n 'number',\n 'commaSeparated',\n 'spaceSeparated',\n 'commaOrSpaceSeparated'\n]\nvar checksLength = checks.length\n\nfunction DefinedInfo(property, attribute, mask, space) {\n var index = -1\n var check\n\n mark(this, 'space', space)\n\n Info.call(this, property, attribute)\n\n while (++index < checksLength) {\n check = checks[index]\n mark(this, check, (mask & types[check]) === types[check])\n }\n}\n\nfunction mark(values, key, value) {\n if (value) {\n values[key] = value\n }\n}\n","'use strict'\n\nmodule.exports = Info\n\nvar proto = Info.prototype\n\nproto.space = null\nproto.attribute = null\nproto.property = null\nproto.boolean = false\nproto.booleanish = false\nproto.overloadedBoolean = false\nproto.number = false\nproto.commaSeparated = false\nproto.spaceSeparated = false\nproto.commaOrSpaceSeparated = false\nproto.mustUseProperty = false\nproto.defined = false\n\nfunction Info(property, attribute) {\n this.property = property\n this.attribute = attribute\n}\n","'use strict'\n\nvar caseSensitiveTransform = require('./case-sensitive-transform')\n\nmodule.exports = caseInsensitiveTransform\n\nfunction caseInsensitiveTransform(attributes, property) {\n return caseSensitiveTransform(attributes, property.toLowerCase())\n}\n","'use strict'\n\nmodule.exports = decimal\n\n// Check if the given character code, or the character code at the first\n// character, is decimal.\nfunction decimal(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character\n\n return code >= 48 && code <= 57 /* 0-9 */\n}\n","function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n}\n\nmodule.exports = _arrayLikeToArray;","export default function symbolObservablePonyfill(root) {\n\tvar result;\n\tvar Symbol = root.Symbol;\n\n\tif (typeof Symbol === 'function') {\n\t\tif (Symbol.observable) {\n\t\t\tresult = Symbol.observable;\n\t\t} else {\n\t\t\tresult = Symbol('observable');\n\t\t\tSymbol.observable = result;\n\t\t}\n\t} else {\n\t\tresult = '@@observable';\n\t}\n\n\treturn result;\n};\n","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ReactPaginate\"] = factory(require(\"react\"));\n\telse\n\t\troot[\"ReactPaginate\"] = factory(root[\"React\"]);\n})(global, function(__WEBPACK_EXTERNAL_MODULE__1__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 4);\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactIs = require('react-is');\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n","module.exports = __WEBPACK_EXTERNAL_MODULE__1__;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nfunction emptyFunction() {}\nfunction emptyFunctionWithReset() {}\nemptyFunctionWithReset.resetWarningCache = emptyFunction;\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n elementType: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim,\n\n checkPropTypes: emptyFunctionWithReset,\n resetWarningCache: emptyFunction\n };\n\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n","'use strict';\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\n\nconst PageView = (props) => {\n let { pageClassName, pageLinkClassName } = props;\n const {\n page,\n selected,\n activeClassName,\n activeLinkClassName,\n getEventListener,\n pageSelectedHandler,\n href,\n extraAriaContext\n } = props;\n\n let ariaLabel =\n props.ariaLabel ||\n 'Page ' +\n page +\n (extraAriaContext ? ' ' + extraAriaContext : '');\n let ariaCurrent = null;\n\n if (selected) {\n ariaCurrent = 'page';\n\n ariaLabel =\n props.ariaLabel || 'Page ' + page + ' is your current page';\n\n if (typeof pageClassName !== 'undefined') {\n pageClassName = pageClassName + ' ' + activeClassName;\n } else {\n pageClassName = activeClassName;\n }\n\n if (typeof pageLinkClassName !== 'undefined') {\n if (typeof activeLinkClassName !== 'undefined') {\n pageLinkClassName = pageLinkClassName + ' ' + activeLinkClassName;\n }\n } else {\n pageLinkClassName = activeLinkClassName;\n }\n }\n\n return (\n