1import{i as e,o as t,t as n}from"./rolldown-runtime-C0FnF6B9.js";import{a as r,o as i}from"./country-gzpb8V1n.js";import{n as a,r as o}from"./apm-utils-CiVaR-i6.js";import{t as s}from"./i18n-BHr0cF6m.js";var c=n(((t,n)=>{(function(e){if(typeof t==`object`&&n!==void 0)n.exports=e();else if(typeof define==`function`&&define.amd)define([],e);else{var r=typeof window<`u`?window:typeof globalThis<`u`?globalThis:typeof self<`u`?self:this;(r.braintree||={}).paypalCheckout=e()}})(function(){var t;return(function(){function t(n,r,i){function a(s,c){if(!r[s]){if(!n[s]){var l=typeof e==`function`&&e;if(!c&&l)return l(s,!0);if(o)return o(s,!0);var u=Error(`Cannot find module '`+s+`'`);throw u.code=`MODULE_NOT_FOUND`,u}var d=r[s]={exports:{}};n[s][0].call(d.exports,function(e){var t=n[s][1][e];return a(t||e)},d,d.exports,t,n,r,i)}return r[s].exports}for(var o=typeof e==`function`&&e,s=0;s<i.length;s++)a(i[s]);return a}return t})()({1:[function(e,t,n){var r={};function i(e){var t,n=JSON.stringify(e);if(!e.forceScriptReload&&(t=r[n],t))return t;var i=document.createElement(`script`),a=e.dataAttributes||{},o=e.container||document.head;return i.src=e.src,i.id=e.id||``,i.async=!0,e.type&&i.setAttribute(`type`,`${e.type}`),e.crossorigin&&i.setAttribute(`crossorigin`,`${e.crossorigin}`),e.integrity&&i.setAttribute(`integrity`,`${e.integrity}`),Object.keys(a).forEach(function(e){i.setAttribute(`data-${e}`,`${a[e]}`)}),t=new Promise(function(t,n){i.addEventListener(`load`,function(){t(i)}),i.addEventListener(`error`,function(){n(Error(`${e.src} failed to load.`))}),i.addEventListener(`abort`,function(){n(Error(`${e.src} has aborted.`))}),o.appendChild(i)}),r[n]=t,t}i.clearCache=function(){r={}},t.exports=i},{}],2:[function(e,t,n){t.exports=e(`./dist/load-script`)},{"./dist/load-script":1}],3:[function(e,t,n){t.exports=function(e){return e||=window.navigator.userAgent,/Android/i.test(e)}},{}],4:[function(e,t,n){var r=e(`./is-edge`),i=e(`./is-samsung`),a=e(`./is-duckduckgo`),o=e(`./is-opera`),s=e(`./is-silk`);t.exports=function(e){return e||=window.navigator.userAgent,(e.indexOf(`Chrome`)!==-1||e.indexOf(`CriOS`)!==-1)&&!r(e)&&!i(e)&&!a(e)&&!o(e)&&!s(e)}},{"./is-duckduckgo":5,"./is-edge":6,"./is-opera":13,"./is-samsung":14,"./is-silk":15}],5:[function(e,t,n){t.exports=function(e){return e||=window.navigator.userAgent,e.indexOf(`DuckDuckGo/`)!==-1}},{}],6:[function(e,t,n){t.exports=function(e){return e||=window.navigator.userAgent,e.indexOf(`Edge/`)!==-1||e.indexOf(`Edg/`)!==-1}},{}],7:[function(e,t,n){t.exports=function(e){return e||=window.navigator.userAgent,/FxiOS/i.test(e)}},{}],8:[function(e,t,n){var r=e(`./is-ios`);function i(e){return/\bGSA\b/.test(e)}t.exports=function(e){return e||=window.navigator.userAgent,r(e)&&i(e)}},{"./is-ios":11}],9:[function(e,t,n){var r=e(`./is-ios`),i=e(`./is-ios-google-search-app`);t.exports=function(e){return e||=window.navigator.userAgent,r(e)?i(e)?!0:/.+AppleWebKit(?!.*Safari)/i.test(e):!1}},{"./is-ios":11,"./is-ios-google-search-app":8}],10:[function(e,t,n){var r=e(`./is-ios-webview`);t.exports=function(e,t){return t=t===void 0?window.statusbar.visible:t,r(e)&&t}},{"./is-ios-webview":9}],11:[function(e,t,n){var r=e(`./is-ipados`);t.exports=function(e,t,n){t===void 0&&(t=!0),e||=window.navigator.userAgent;var i=/iPhone|iPod|iPad/i.test(e);return t?i||r(e,n):i}},{"./is-ipados":12}],12:[function(e,t,n){t.exports=function(e,t){return e||=window.navigator.userAgent,t||=window.document,/Mac|iPad/i.test(e)&&`ontouchend`in t}},{}],13:[function(e,t,n){t.exports=function(e){return e||=window.navigator.userAgent,e.indexOf(`OPR/`)!==-1||e.indexOf(`Opera/`)!==-1||e.indexOf(`OPT/`)!==-1}},{}],14:[function(e,t,n){t.exports=function(e){return e||=window.navigator.userAgent,/SamsungBrowser/i.test(e)}},{}],15:[function(e,t,n){t.exports=function(e){return e||=window.navigator.userAgent,e.indexOf(`Silk/`)!==-1}},{}],16:[function(e,t,n){var r=e(`./is-android`),i=e(`./is-ios-firefox`),a=e(`./is-ios-webview`),o=e(`./is-chrome`),s=e(`./is-samsung`),c=e(`./is-duckduckgo`);function l(e){e||=window.navigator.userAgent;var t=e.match(/CriOS\/(\d+)\./);return t?parseInt(t[1],10)<48:!1}function u(e){return e||=window.navigator.userAgent,e.indexOf(`Opera Mini`)>-1}function d(e){return e||=window.navigator.userAgent,r(e)?/Version\/[\d.]+/i.test(e)&&!u(e)&&!c(e):!1}
1function f(e){return!o(e)&&!s(e)&&/samsung/i.test(e)}t.exports=function(e){return e||=window.navigator.userAgent,!(a(e)||i(e)||d(e)||u(e)||l(e)||f(e))}},{"./is-android":3,"./is-chrome":4,"./is-duckduckgo":5,"./is-ios-firefox":7,"./is-ios-webview":9,"./is-samsung":14}],17:[function(e,t,n){t.exports=e(`./dist/is-ios-wkwebview`)},{"./dist/is-ios-wkwebview":10}],18:[function(e,t,n){t.exports=e(`./dist/is-ios`)},{"./dist/is-ios":11}],19:[function(e,t,n){t.exports=e(`./dist/supports-popups`)},{"./dist/supports-popups":16}],20:[function(e,t,n){var r=typeof Promise<`u`?Promise:null;t.exports=function(){function e(t){var n=this;if(typeof t==`function`){this._promise=new e.Promise(t);return}this._promise=new e.Promise(function(e,t){n._resolveFunction=e,n._rejectFunction=t}),t||={},this._onResolve=t.onResolve||e.defaultOnResolve,this._onReject=t.onReject||e.defaultOnReject,e.shouldCatchExceptions(t)&&this._promise.catch(function(){}),this._resetState()}return e.defaultOnResolve=function(t){return e.Promise.resolve(t)},e.defaultOnReject=function(t){return e.Promise.reject(t)},e.setPromise=function(t){e.Promise=t},e.shouldCatchExceptions=function(t){return t.hasOwnProperty(`suppressUnhandledPromiseMessage`)?!!t.suppressUnhandledPromiseMessage:!!e.suppressUnhandledPromiseMessage},e.all=function(t){return e.Promise.all(t)},e.allSettled=function(t){return e.Promise.allSettled(t)},e.race=function(t){return e.Promise.race(t)},e.reject=function(t){return e.Promise.reject(t)},e.resolve=function(t){return e.Promise.resolve(t)},e.prototype.then=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return(e=this._promise).then.apply(e,t)},e.prototype.catch=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return(e=this._promise).catch.apply(e,t)},e.prototype.resolve=function(t){var n=this;return this.isFulfilled?this:(this._setResolved(),e.Promise.resolve().then(function(){return n._onResolve(t)}).then(function(e){n._resolveFunction(e)}).catch(function(e){n._resetState(),n.reject(e)}),this)},e.prototype.reject=function(t){var n=this;return this.isFulfilled?this:(this._setRejected(),e.Promise.resolve().then(function(){return n._onReject(t)}).then(function(e){n._setResolved(),n._resolveFunction(e)}).catch(function(e){return n._rejectFunction(e)}),this)},e.prototype._resetState=function(){this.isFulfilled=!1,this.isResolved=!1,this.isRejected=!1},e.prototype._setResolved=function(){this.isFulfilled=!0,this.isResolved=!0,this.isRejected=!1},e.prototype._setRejected=function(){this.isFulfilled=!0,this.isResolved=!1,this.isRejected=!0},e.Promise=r,e}()},{}],21:[function(e,t,n){var r=e(`./lib/set-attributes`),i=e(`./lib/default-attributes`),a=e(`./lib/assign`);t.exports=function(e){e===void 0&&(e={});var t=document.createElement(`iframe`),n=(0,a.assign)({},i.defaultAttributes,e);return n.style&&typeof n.style!=`string`&&((0,a.assign)(t.style,n.style),delete n.style),(0,r.setAttributes)(t,n),t.getAttribute(`id`)||(t.id=t.name),t}},{"./lib/assign":22,"./lib/default-attributes":23,"./lib/set-attributes":24}],22:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.assign=void 0;function r(e){return[...arguments].slice(1).forEach(function(t){typeof t==`object`&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}n.assign=r},{}],23:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.defaultAttributes=void 0,n.defaultAttributes={src:`about:blank`,frameBorder:0,allowtransparency:!0,scrolling:`no`}},{}],24:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.setAttributes=void 0;function r(e,t){for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];r==null?e.removeAttribute(n):e.setAttribute(n,r)}}n.setAttributes=r},{}],25:[function(e,t,n){function r(){if(typeof crypto<`u`&&typeof crypto.randomUUID==`function`)try{return crypto.randomUUID()}catch{}if(typeof crypto<`u`&&typeof crypto.getRandomValues==`function`){var e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;for(var t=Array(256),n=0;n<256;n++)t[n]=(n<16?`0`:``)+n.toString(16);return t[e[0]]+t[e[1]]+t[e[2]]+t[e[3]]+`-`+t[e[4]]+t[e[5]]+`-`+t[e[6]]+t[e[7]]+`-`+t[e[8]]+t[e[9]]+`-`+t[e[10]]+t[e[11]]+t[e[12]]+t[e[13]]+t[e[14]]+t[e[15]]}throw Error(`@braintree/uuid: No secure random source available`)}t.exports=r},{}],26:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0});function r(e){return function(){var t=[...arguments];setTimeout(function(){try{e.apply(void 0,t)}catch(e){console.log(`Error in callback function`),console.log(e)}},1)}}n.deferred=r},{}],27:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0});function r(e){var t=!1;return function(){var n=[...arguments];t||(t=!0,e.apply(void 0,n))}}n.once=r},{}],28:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0});function r(e,t){if(!t)return e;e.then(function(e){return t(null,e)}).catch(function(e){return t(e)})}n.promiseOrCallback=r},{}],29:[function(e,t,n){var r=e(`./lib/deferred`),i=e(`./lib/once`),a=e(`./lib/promise-or-callback`);function o(e){return function(){var t=[...arguments],n;return typeof t[t.length-1]==`function`&&(n=t.pop(),n=i.once(r.deferred(n))),a.promiseOrCallback(e.apply(this,t),n)}}o.wrapPrototype=function(e,t){t===void 0&&(t={});var n=t.ignoreMethods||[],r=t.transformPrivateMethods===!0;return Object.getOwnPropertyNames(e.prototype).filter(function(t){var i,a=t!==`constructor`&&typeof e.prototype[t]==`function`,o=n.indexOf(t)===-1;return i=r?!0:t.charAt(0)!==`_`,a&&i&&o}
1).forEach(function(t){var n=e.prototype[t];e.prototype[t]=o(n)}),e},t.exports=o},{"./lib/deferred":26,"./lib/once":27,"./lib/promise-or-callback":28}],30:[function(e,n,r){(function(e,i){typeof r==`object`&&n!==void 0?i(r):typeof t==`function`&&t.amd?t([`exports`],i):(e=typeof globalThis<`u`?globalThis:e||self,i(e.loadAxo={}))})(this,(function(e){function t(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function n(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o={next:s(0),throw:s(1),return:s(2)};return typeof Symbol==`function`&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(o){if(r)throw TypeError(`Generator is already executing.`);for(;n;)try{if(r=1,i&&(a=o[0]&2?i.return:o[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,o[1])).done)return a;switch(i=0,a&&(o=[o[0]&2,a.value]),o[0]){case 0:case 1:a=o;break;case 4:return n.label++,{value:o[1],done:!1};case 5:n.label++,i=o[1],o=[0];continue;case 7:o=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>
10&&a[a.length-1])&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){n.label=o[1];break}if(o[0]===6&&n.label<a[1]){n.label=a[1],a=o;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(o);break}a[2]&&n.ops.pop(),n.trys.pop();continue}o=t.call(e,n)}catch(e){o=[6,e],i=0}finally{r=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}}var r={},i={};function a(e){var t,n=JSON.stringify(e);if(!e.forceScriptReload&&(t=i[n],t))return t;var r=document.createElement(`script`),a=e.dataAttributes||{},o=e.container||document.head;return r.src=e.src,r.id=e.id||``,r.async=!0,e.type&&r.setAttribute(`type`,`${e.type}`),e.crossorigin&&r.setAttribute(`crossorigin`,`${e.crossorigin}`),Object.keys(a).forEach(function(e){r.setAttribute(`data-${e}`,`${a[e]}`)}),t=new Promise(function(t,n){r.addEventListener(`load`,function(){t(r)}),r.addEventListener(`error`,function(){n(Error(`${e.src} failed to load.`))}),r.addEventListener(`abort`,function(){n(Error(`${e.src} has aborted.`))}),o.appendChild(r)}),i[n]=t,t}a.clearCache=function(){i={}};var o=a,s=function(e){var t=document.querySelector(`link[href="${e.href}"]`);if(t)return Promise.resolve(t);t=document.createElement(`link`);var n=e.container||document.head;return t.setAttribute(`rel`,`stylesheet`),t.setAttribute(`type`,`text/css`),t.setAttribute(`href`,e.href),t.setAttribute(`id`,e.id),n.firstChild?n.insertBefore(t,n.firstChild):n.appendChild(t),Promise.resolve(t)};Object.defineProperty(r,"__esModule",{value:!0}),r.loadStylesheet=c=r.loadScript=void 0;var c=r.loadScript=o;r.loadStylesheet=s;var l=`https://www.paypalobjects.com`,u={minified:`axo.min`,unminified:`axo`},d=`fastlane`,f=`connect-boba`,p={AXO_ASSET_NAME:u,AXO_ASSET_PATH:f,LOCALE_PATH:`${f}/locales/`,CDNX_PROD:l},m={BT:`BT`,PPCP:`PPCP`};function h(){return typeof window.define==`function`&&!!window.define.amd}function g(){return h()&&typeof window.requirejs==`function`&&typeof window.requirejs.config==`function`}function _(e,r,i){return i===void 0&&(i=!0),t(this,void 0,void 0,function(){var t,a;return n(this,function(n){if(t=y(),t&&t[e.module]){if(r&&t[e.module]?.VERSION!==r)throw a=t[e.module]?.VERSION,Error(`${e.module} already loaded with version ${a} cannot load version ${r}`);return[2,!0]}if(!r)throw Error(`Attempted to load ${e.module} without specifying version`);return[2,v(e,r,i)]})})}function v(e,t,n){if(n===void 0&&(n=!0),h()){var r=n?e.amdModule.minified:e.amdModule.unminified;return new Promise(function(e,t){window.require([r],e,t)})}var i=n?e.script.minified:e.script.unminified;return c({id:`${e.id}-${t}`,src:`https://js.braintreegateway.com/web/${t}/js/${i}`})}function y(){return window==null?void 0:window.braintree}var b,x,S={Client:`client`,HostedCardFields:`hostedFields`},C=`braintree`,w=(b={},b[S.Client]=`client`,b[S.HostedCardFields]=`hosted-fields`,b),T=(x={},x[S.Client]={id:`client`,module:S.Client,amdModule:{unminified:`${C}/${w[S.Client]}`,minified:`${C}/${w[S.Client]}.min`},script:{unminified:`${w[S.Client]}.js`,minified:`${w[S.Client]}.min.js`}},x[S.HostedCardFields]={id:`hcf`,module:S.HostedCardFields,amdModule:{unminified:`${C}/${w[S.HostedCardFields]}`,minified:`${C}/${w[S.HostedCardFields]}.min`},script:{unminified:`${w[S.HostedCardFields]}.js`,minified:`${w[S.HostedCardFields]}.min.js`}},x);function E(e){return t(this,void 0,void 0,function(){var t,r,i,a;return n(this,function(n){switch(n.label){case 0:return performance.mark(`pp_axo_sdk_init_invoked`),t=e.btSdkVersion,r=e.minified,i=k(e),a=A(e),e.platform===m.BT?[4,Promise.all([_(T.hostedFields,t,r),D(i,r)])]:[3,2];case 1:return n.sent(),[3,5];case 2:return e.platform===m.PPCP?[4,Promise.all([_(T.client,t,r),_(T.hostedFields,t,r),D(i,r)])]:[3,4];case 3:return n.sent(),[3,5];case 4:throw Error(`unsupported axo platform`);case 5:return[2,{metadata:{localeUrl:a}}]}})})}function D(e,t){var n;if(t===void 0&&(t=!0),h()){g()&&requirejs.config({paths:(n={},n[d]=e,n)});var r=`${d}/${t?p.AXO_ASSET_NAME.minified:p.AXO_ASSET_NAME.unminified}`;return new Promise(function(e,t){window.require([r],e,t)})}return c({id:`axo-id`,src:e,forceScriptReload:!0})}function O(e){var t=e.assetUrl,n=e.bundleId;return n?`https://cdn-${n}.static.engineering.dev.paypalinc.com/${t}`:`${p.CDNX_PROD}/${t}`}function k(e){var t=e?.minified===!1?p.AXO_ASSET_NAME.unminified:p.AXO_ASSET_NAME.minified;return O({assetUrl:h()?p.AXO_ASSET_PATH:`${p.AXO_ASSET_PATH}/${t}.js`,bundleId:e?.metadata?.bundleIdOverride})}function A(e){return O({assetUrl:p.LOCALE_PATH,bundleId:e?.metadata?.bundleIdOverride})}e.constants=p,e.loadAxo=E}))},{}],31:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.Framebus=void 0;var r=e(`./lib`),i=typeof window<`u`&&window.Promise;n.Framebus=function(){function e(e){e===void 0&&(e={}),this.origin=e.origin||`*`,this.channel=e.channel||``,this.verifyDomain=e.verifyDomain,this.targetFrames=e.targetFrames||[],this.limitBroadcastToFramesArray=!!e.targetFrames,this.isDestroyed=!1,this.listeners=[],this.hasAdditionalChecksForOnListeners=!!(this.verifyDomain||this.limitBroadcastToFramesArray)}return e.setPromise=function(t){e.Promise=t},e.target=function(t){return new e(t)},e.prototype.addTargetFrame=function(e){this.limitBroadcastToFramesArray&&this.targetFrames.push(e)},e.prototype.include=function(e){return e==null||e.Window==null||e.constructor!==e.Window?!1:(r.childWindows.push(e),!0)},e.prototype.target=function(t){return e.target(t)},e.prototype.emit=function(e,t,n){if(this.isDestroyed)return!1;var i=this.origin;if(e=this.namespaceEvent(e),(0,r.isntString)(e)||(0,r.isntString)(i))return!1;typeof t==`function`&&(n=t,t=void 0);var a=(0,r.packagePayload)(e,i,t,n);return a?(this.limitBroadcastToFramesArray?this.targetFramesAsWindows().forEac
1h(function(e){(0,r.sendMessage)(e,a,i)}):(0,r.broadcast)(a,{origin:i,frame:window.top||window.self}),!0):!1},e.prototype.emitAsPromise=function(t,n){var r=this;return new e.Promise(function(e,i){r.emit(t,n,function(t){e(t)})||i(Error(`Listener not added for "${t}"`))})},e.prototype.on=function(e,t){if(this.isDestroyed)return!1;var n=this,i=this.origin,a=t;return e=this.namespaceEvent(e),!(0,r.subscriptionArgsInvalid)(e,a,i)&&(this.hasAdditionalChecksForOnListeners&&(a=function(){var e=[...arguments];n.passesVerifyDomainCheck(this&&this.origin)&&n.hasMatchingTargetFrame(this&&this.source)&&t.apply(void 0,e)}),this.listeners.push({eventName:e,handler:a,originalHandler:t}),r.subscribers[i]=r.subscribers[i]||{},r.subscribers[i][e]=r.subscribers[i][e]||[],r.subscribers[i][e].push(a),!0)},e.prototype.off=function(e,t){var n=t;if(this.isDestroyed)return!1;if(this.hasAdditionalChecksForOnListeners)for(var i=0;i<this.listeners.length;i++){var a=this.listeners[i];a.originalHandler===t&&(n=a.handler)}e=this.namespaceEvent(e);var o=this.origin;if((0,r.subscriptionArgsInvalid)(e,n,o))return!1;var s=r.subscribers[o]&&r.subscribers[o][e];if(!s)return!1;for(var i=0;i<s.length;i++)if(s[i]===n)return s.splice(i,1),!0;return!1},e.prototype.teardown=function(){if(!this.isDestroyed){this.isDestroyed=!0;for(var e=0;e<this.listeners.length;e++){var t=this.listeners[e];this.off(t.eventName,t.handler)}this.listeners.length=0}},e.prototype.passesVerifyDomainCheck=function(e){return!this.verifyDomain||this.checkOrigin(e)},e.prototype.targetFramesAsWindows=function(){return this.limitBroadcastToFramesArray?this.targetFrames.map(function(e){return e instanceof HTMLIFrameElement?e.contentWindow:e}).filter(function(e){return e}):[]},e.prototype.hasMatchingTargetFrame=function(e){return!this.limitBroadcastToFramesArray||!!this.targetFramesAsWindows().find(function(t){return t===e})},e.prototype.checkOrigin=function(e){var t,n=document.createElement(`a`);return n.href=location.href,t=n.protocol===`https:`?n.host.replace(/:443$/,``):n.protocol===`http:`?n.host.replace(/:80$/,``):n.host,n.protocol+`//`+t===e||!this.verifyDomain||this.verifyDomain(e)},e.prototype.namespaceEvent=function(e){return this.channel?`${this.channel}:${e}`:e},e.Promise=i,e}()},{"./lib":39}],32:[function(e,t,n){var r=e(`./lib`),i=e(`./framebus`);(0,r.attach)(),t.exports=i.Framebus},{"./framebus":31,"./lib":39}],33:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.detach=n.attach=void 0;var r=e(`./`),i=!1;function a(){i||typeof window>`u`||(i=!0,window.addEventListener(`message`,r.onMessage,!1))}n.attach=a;function o(){i=!1,window.removeEventListener(`message`,r.onMessage,!1)}n.detach=o},{"./":39}],34:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.broadcastToChildWindows=void 0;var r=e(`./`);function i(e,t,n){for(var i=r.childWindows.length-1;i>=0;i--){var a=r.childWindows[i];a.closed?r.childWindows.splice(i,1):n!==a&&(0,r.broadcast)(e,{origin:t,frame:a.top})}}n.broadcastToChildWindows=i},{"./":39}],35:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.broadcast=void 0;var r=e(`./`);function i(e,t){var n=0,a,o=t.origin,s=t.frame;try{for(s.postMessage(e,o),(0,r.hasOpener)(s)&&s.opener.top!==window.top&&i(e,{origin:o,frame:s.opener.top});a=s.frames[n];)i(e,{origin:o,frame:a}),n++}catch{}}n.broadcast=i},{"./":39}],36:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.subscribers=n.childWindows=n.prefix=void 0,n.prefix=`/*framebus*/`,n.childWindows=[],n.subscribers={}},{}],37:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.dispatch=void 0;var r=e(`./`);function i(e,t,n,i,a){if(r.subscribers[e]&&r.subscribers[e][t]){var o=[];n&&o.push(n),i&&o.push(i);for(var s=0;s<r.subscribers[e][t].length;s++)r.subscribers[e][t][s].apply(a,o)}}n.dispatch=i},{"./":39}],38:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.hasOpener=void 0;function r(e){return e.top===e&&e.opener!=null&&e.opener!==e&&e.opener.closed!==!0}n.hasOpener=r},{}],39:[function(e,t,n){var r=this&&this.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);
1(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),i=this&&this.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&r(t,e,n)};Object.defineProperty(n,"__esModule",{value:!0}),i(e(`./attach`),n),i(e(`./broadcast-to-child-windows`),n),i(e(`./broadcast`),n),i(e(`./constants`),n),i(e(`./dispatch`),n),i(e(`./has-opener`),n),i(e(`./is-not-string`),n),i(e(`./message`),n),i(e(`./package-payload`),n),i(e(`./send-message`),n),i(e(`./subscribe-replier`),n),i(e(`./subscription-args-invalid`),n),i(e(`./types`),n),i(e(`./unpack-payload`),n)},{"./attach":33,"./broadcast":35,"./broadcast-to-child-windows":34,"./constants":36,"./dispatch":37,"./has-opener":38,"./is-not-string":40,"./message":41,"./package-payload":42,"./send-message":43,"./subscribe-replier":44,"./subscription-args-invalid":45,"./types":46,"./unpack-payload":47}],40:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.isntString=void 0;function r(e){return typeof e!=`string`}n.isntString=r},{}],41:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.onMessage=void 0;var r=e(`./`);function i(e){if(!(0,r.isntString)(e.data)){var t=(0,r.unpackPayload)(e);if(t){var n=t.eventData,i=t.reply;(0,r.dispatch)(`*`,t.event,n,i,e),(0,r.dispatch)(e.origin,t.event,n,i,e),(0,r.broadcastToChildWindows)(e.data,t.origin,e.source)}}}n.onMessage=i},{"./":39}],42:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.packagePayload=void 0;var r=e(`./`);function i(e,t,n,i){var a,o={event:e,origin:t};typeof i==`function`&&(o.reply=(0,r.subscribeReplier)(i,t)),o.eventData=n;try{a=r.prefix+JSON.stringify(o)}catch(e){throw Error(`Could not stringify event: ${e.message}`)}return a}n.packagePayload=i},{"./":39}],43:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.sendMessage=void 0;function r(e,t,n){try{e.postMessage(t,n)}catch{}}n.sendMessage=r},{}],44:[function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:!0}),n.subscribeReplier=void 0;var i=e(`../framebus`),a=r(e(`@braintree/uuid`));function o(e,t){var n=(0,a.default)();function r(a,o){e(a,o),i.Framebus.target({origin:t}).off(n,r)}return i.Framebus.target({origin:t}).on(n,r),n}n.subscribeReplier=o},{"../framebus":31,"@braintree/uuid":48}],45:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.subscriptionArgsInvalid=void 0;var r=e(`./`);function i(e,t,n){return(0,r.isntString)(e)||typeof t!=`function`?!0:(0,r.isntString)(n)}n.subscriptionArgsInvalid=i},{"./":39}],46:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0})},{}],47:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.unpackPayload=void 0;var r=e(`./`);function i(e){var t;if(e.data.slice(0,r.prefix.length)!==r.prefix)return!1;try{t=JSON.parse(e.data.slice(r.prefix.length))}catch{return!1}if(t.reply){var n=e.origin,i=e.source,a=t.reply;t.reply=function(e){if(i){var t=(0,r.packagePayload)(a,n,e);t&&i.postMessage(t,n)}}}return t}n.unpackPayload=i},{"./":39}],48:[function(e,t,n){function r(){return`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,function(e){var t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)})}t.exports=r},{}],49:[function(e,t,n){var r=e(`./create-authorization-data`),i=e(`./json-clone`),a=e(`./constants`);function o(e,t){var n,o=t?i(t):{},s=r(e.authorization).attrs,c=i(e.analyticsMetadata);for(n in o.braintreeLibraryVersion=a.BRAINTREE_LIBRARY_VERSION,o._meta)o._meta.hasOwnProperty(n)&&(c[n]=o._meta[n]);return o._meta=c,s.tokenizationKey?o.tokenizationKey=s.tokenizationKey:o.authorizationFingerprint=s.authorizationFingerprint,o}function s(e){var t=e.getConfiguration(),n=r(t.authorization).attrs,i=t.gatewayConfiguration.environment===`production`,o={api_integration_type:t.analyticsMetadata.integrationType,app_id:window.location.host,c_sdk_ver:a.VERSION,component:`braintreeclientsdk`,merchant_sdk_env:i?`production`:`sandbox`,merchant_id:t.gatewayConfiguration.merchantId,event_source:`web`,platform:a.PLATFORM,platform_version:window.navigator.userAgent,session_id:t.analyticsMetadata.sessionId,client_session_id:t.analyticsMetadata.sessionId,tenant_name:`braintree`,product_name:`BT_DCC`,space_key:`SKDUYK`};return n.tokenizationKey?o.tokenization_key=n.tokenizationKey:o.auth_fingerprint=n.authorizationFingerprint,o}t.exports={addMetadata:o,addEventMetadata:s}},{"./constants":55,"./create-authorization-data":59,"./json-clone":74}],50:[function(e,t,n){var r=e(`./constants`),i=e(`./add-metadata`),a=e(`./assign`).assign;function o(e,t,n){return s(e,t,{},n)}function s(e,t,n,o){var s=Date.now();return n.flow===`vault`?n.context_type=`BA_Token`:n.flow===`checkout`&&(n.context_type=`EC_Token`),Promise.resolve(e).then(function(e){var l=e._request,u=r.ANALYTICS_URL,d=r.ANALYTICS_PREFIX+t,f
1=e.getConfiguration().gatewayConfiguration.environment===`production`,p={events:[],tracking:[]},m=i.addEventMetadata(e,p);return m.event_name=d,m.t=s,p.events=[{level:`info`,event:d,payload:a({env:f?`production`:`sandbox`,timestamp:s},n)}],p.tracking=[m],n&&typeof n==`object`&&(p.tracking=[c(m,n)]),l({url:u,method:`post`,data:p,timeout:r.ANALYTICS_REQUEST_TIMEOUT_MS},o)}).catch(function(e){o&&o(e)})}function c(e,t){var n={},i=a({},t);return Object.keys(i).forEach(function(e){r.ALLOWED_EXTRA_EVENT_FIELDS.indexOf(e)===-1&&delete i[e]}),n=a(e,i),n}t.exports={sendEvent:o,sendEventPlus:s}},{"./add-metadata":49,"./assign":52,"./constants":55}],51:[function(e,t,n){t.exports={loadScript:e(`@braintree/asset-loader/load-script`),loadFastlane:e(`@paypal/accelerated-checkout-loader`).loadAxo}},{"@braintree/asset-loader/load-script":2,"@paypal/accelerated-checkout-loader":30}],52:[function(e,t,n){var r=typeof Object.assign==`function`?Object.assign:i;function i(e){for(var t=1,n,r;t<arguments.length;t++)for(r in n=arguments[t],n)n.hasOwnProperty(r)&&(e[r]=n[r]);return e}t.exports={assign:r,_assign:i}},{}],53:[function(e,t,n){var r=e(`./braintree-error`),i=e(`./errors`),a=`3.138.0`;function o(e){var t,n,o;return e?(o=e.name,t=e.client,n=e.authorization,!t&&!n?Promise.reject(new r({type:i.INSTANTIATION_OPTION_REQUIRED.type,code:i.INSTANTIATION_OPTION_REQUIRED.code,message:`options.client is required when instantiating `+o+`.`})):!n&&t.getVersion()!==a?Promise.reject(new r({type:i.INCOMPATIBLE_VERSIONS.type,code:i.INCOMPATIBLE_VERSIONS.code,message:`Client (version `+t.getVersion()+`) and `+o+` (version `+a+`) components must be from the same SDK version.`})):Promise.resolve()):Promise.reject(new r({type:i.INVALID_USE_OF_INTERNAL_FUNCTION.type,code:i.INVALID_USE_OF_INTERNAL_FUNCTION.code,message:`Options must be passed to basicComponentVerification function.`}))}t.exports={verify:o}},{"./braintree-error":54,"./errors":62}],54:[function(e,t,n){var r=e(`./enumerate`);function i(e){if(!i.types.hasOwnProperty(e.type))throw Error(e.type+` is not a valid type.`);if(!e.code)throw Error(`Error code required.`);if(!e.message)throw Error(`Error message required.`);this.name=`BraintreeError`,this.code=e.code,this.message=e.message,this.type=e.type,this.details=e.details}i.prototype=Object.create(Error.prototype),i.prototype.constructor=i,i.types=r([`CUSTOMER`,`MERCHANT`,`NETWORK`,`INTERNAL`,`UNKNOWN`]),i.findRootError=function(e){return e instanceof i&&e.details&&e.details.originalError?i.findRootError(e.details.originalError):e},t.exports=i},{"./enumerate":61}],55:[function(e,t,n){var r=`3.138.0`,i=`web`;t.exports={ANALYTICS_PREFIX:i+`.`,ANALYTICS_REQUEST_TIMEOUT_MS:2e3,ANALYTICS_URL:`https://www.paypal.com/xoplatform/logger/api/logger`,ASSETS_URLS:{production:`https://assets.braintreegateway.com`,sandbox:`https://assets.braintreegateway.com`},CLIENT_API_URLS:{production:`https://api.braintreegateway.com:443`,sandbox:`https://api.sandbox.braintreegateway.com:443`},FRAUDNET_SOURCE:`BRAINTREE_SIGNIN`,FRAUDNET_FNCLS:`fnparams-dede7cc5-15fd-4c75-a9f4-36c430ee3a99`,FRAUDNET_URL:`https://c.paypal.com/da/r/fb.js`,BUS_CONFIGURATION_REQUEST_EVENT:`BUS_CONFIGURATION_REQUEST`,GRAPHQL_URLS:{production:`https://payments.braintree-api.com/graphql`,sandbox:`https://payments.sandbox.braintree-api.com/graphql`},INTEGRATION_TIMEOUT_MS:6e4,VERSION:r,INTEGRATION:`custom`,SOURCE:`client`,PLATFORM:i,BRAINTREE_LIBRARY_VERSION:`braintree/`+i+`/`+r,ALLOWED_EXTRA_EVENT_FIELDS:[`context_id`,`context_type`,`payment_ready_button_order`,`payment_ready_experiment_type`,`payment_ready_page_type`,`payment_ready_session_id`,`button_type`,`connectionStartTime`,`domain`,`endpoint`,`endTime`,`requestStartTime`,`startTime`]}},{}],56:[function(e,t,n){var r=e(`./braintree-error`),i=e(`./errors`);t.exports=function(e,t){t.forEach(function(t){e[t]=function(){throw new r({type:i.METHOD_CALLED_AFTER_TEARDOWN.type,code:i.METHOD_CALLED_AFTER_TEARDOWN.code,message:t+` cannot be called after teardown.`})}})}},{"./braintree-error":54,"./errors":62}],57:[function(e,t,n){var r=e(`./braintree-error`);function i(e,t){return e instanceof r?e:new r({type:t.type,code:t.code,message:t.message,details:{originalError:e}})}t.exports=i},{"./braintree-error":54}],58:[function(e,t,n){var r=e(`./constants`).ASSETS_URLS;function i(e){return r.production}t.exports={create:i}},{"./constants":55}],59:[function(e,t,n){var r=e(`../lib/vendor/polyfill`).atob,i=e(`../lib/constants`).CLIENT_API_URLS;function a(e){return/^[a-zA-Z0-9]+_[a-zA-Z0-9]+_[a-zA-Z0-9_]+$/.test(e)}function o(e){var t=e.split(`_`),n=t[0];return{merchantId:t.slice(2).join(`_`),environment:n}}function s(e){var t,n,s={attrs:{},configUrl:``};return a(e)?(n=o(e),s.environment=n.environment,s.attrs.tokenizationKey=e,s.configUrl=i[n.environment]+`/merchants/`+n.merchantId+`/client_api/v1/configuration`):(t=JSON.parse(r(e)),s.environment=t.environment,s.attrs.authorizationFingerprint=t.authorizationFingerprint,s.configUrl=t.configUrl,s.graphQL=t.graphQL),s}t.exports=s},{"../lib/constants":55,"../lib/vendor/polyfill":78}],60:[function(e,t,n){var r=e(`./braintree-error`),i=e(`./assets`),a=e(`./errors`),o=`3.138.0`;function s(e){var t=Promise.resolve();return e.client?Promise.resolve(e.client):(window.braintree&&window.braintree.client||(t=i.loadScript({src:e.assetsUrl+`/web/`+o+`/js/client.min.js`}).catch(function(e){return Promise.reject(new r({type:a.CLIENT_SCRIPT_FAILED_TO_LOAD.type,code:a.CLIENT_SCRIPT_FAILED_TO_LOAD.code,message:a.CLIENT_SCRIPT_FAILED_TO_LOAD.message,details:{originalError:e}}))}
1)),t.then(function(){return window.braintree.client.VERSION===o?window.braintree.client.create({authorization:e.authorization,debug:e.debug}):Promise.reject(new r({type:a.INCOMPATIBLE_VERSIONS.type,code:a.INCOMPATIBLE_VERSIONS.code,message:`Client (version `+window.braintree.client.VERSION+`) and `+e.name+` (version `+o+`) components must be from the same SDK version.`}))}))}t.exports={create:s}},{"./assets":51,"./braintree-error":54,"./errors":62}],61:[function(e,t,n){function r(e,t){return t??=``,e.reduce(function(e,n){return e[n]=t+n,e},{})}t.exports=r},{}],62:[function(e,t,n){var r=e(`./braintree-error`);t.exports={INVALID_USE_OF_INTERNAL_FUNCTION:{type:r.types.INTERNAL,code:`INVALID_USE_OF_INTERNAL_FUNCTION`},INSTANTIATION_OPTION_REQUIRED:{type:r.types.MERCHANT,code:`INSTANTIATION_OPTION_REQUIRED`},INCOMPATIBLE_VERSIONS:{type:r.types.MERCHANT,code:`INCOMPATIBLE_VERSIONS`},CLIENT_SCRIPT_FAILED_TO_LOAD:{type:r.types.NETWORK,code:`CLIENT_SCRIPT_FAILED_TO_LOAD`,message:`Braintree client script could not be loaded.`},METHOD_CALLED_AFTER_TEARDOWN:{type:r.types.MERCHANT,code:`METHOD_CALLED_AFTER_TEARDOWN`},INSTANTIATION_OPTION_INVALID:{type:r.types.MERCHANT,code:`INSTANTIATION_OPTION_INVALID`}}},{"./braintree-error":54}],63:[function(e,t,n){var r=e(`./strategies/popup`),i=e(`./strategies/popup-bridge`),a=e(`./strategies/modal`),o=e(`framebus`),s=e(`../shared/events`),c=e(`../shared/errors`),l=e(`../shared/constants`),u=e(`@braintree/uuid`),d=e(`@braintree/iframer`),f=e(`../../braintree-error`),p=e(`../shared/browser-detection`),m=e(`./../../assign`).assign,h=e(`../../constants`).BUS_CONFIGURATION_REQUEST_EVENT,g=[`name`,`dispatchFrameUrl`,`openFrameUrl`];function _(){}function v(e){if(!e)throw Error(`Valid configuration is required`);if(g.forEach(function(t){if(!e.hasOwnProperty(t))throw Error(`A valid frame `+t+` must be provided`)}),!/^[\w_]+$/.test(e.name))throw Error(`A valid frame name must be provided`)}function y(e){v(e),this._serviceId=u().replace(/-/g,``),this._options={name:e.name+`_`+this._serviceId,dispatchFrameUrl:e.dispatchFrameUrl,openFrameUrl:e.openFrameUrl,height:e.height,width:e.width,top:e.top,left:e.left},this.state=e.state||{},this._bus=new o({channel:this._serviceId}),this._setBusEvents()}y.prototype.initialize=function(e){var t=function(){e(),this._bus.off(s.DISPATCH_FRAME_READY,t)}.bind(this);this._bus.on(s.DISPATCH_FRAME_READY,t),this._writeDispatchFrame()},y.prototype._writeDispatchFrame=function(){var e=l.DISPATCH_FRAME_NAME+`_`+this._serviceId,t=this._options.dispatchFrameUrl;this._dispatchFrame=d({"aria-hidden":!0,name:e,title:e,src:t,class:l.DISPATCH_FRAME_CLASS,height:0,width:0,style:{position:`absolute`,left:`-9999px`}}),document.body.appendChild(this._dispatchFrame)},y.prototype._setBusEvents=function(){this._bus.on(s.DISPATCH_FRAME_REPORT,function(e,t){this._onCompleteCallback&&this._onCompleteCallback.call(null,e.err,e.payload),this._frame.close(),this._onCompleteCallback=null,t&&t()}.bind(this)),this._bus.on(h,function(e){e(this.state)}.bind(this))},y.prototype.open=function(e,t){if(e||={},this._frame=this._getFrameForEnvironment(e),this._frame.initialize(t),!(this._frame instanceof i)){if(m(this.state,e.state),this._onCompleteCallback=t,this._frame.open(),this.isFrameClosed()){this._cleanupFrame(),t&&t(new f(c.FRAME_SERVICE_FRAME_OPEN_FAILED));return}this._pollForPopupClose()}},y.prototype.redirect=function(e){this._frame&&!this.isFrameClosed()&&this._frame.redirect(e)},y.prototype.close=function(){this.isFrameClosed()||this._frame.close()},y.prototype.focus=function(){this.isFrameClosed()||this._frame.focus()},y.prototype.createHandler=function(e){return e||={},{close:function(){e.beforeClose&&e.beforeClose(),this.close()}.bind(this),focus:function(){e.beforeFocus&&e.beforeFocus(),this.focus()}.bind(this)}},y.prototype.createNoopHandler=function(){return{close:_,focus:_}},y.prototype.teardown=function(){this.close(),this._dispatchFrame.parentNode.removeChild(this._dispatchFrame),this._dispatchFrame=null,this._cleanupFrame()},y.prototype.isFrameClosed=function(){return this._frame==null||this._frame.isClosed()},y.prototype._cleanupFrame=function(){this._frame=null,clearInterval(this._popupInterval),this._popupInterval=null},y.prototype._pollForPopupClose=function(){return this._popupInterval=setInterval(function(){this.isFrameClosed()&&(this._cleanupFrame(),this._onCompleteCallback&&this._onCompleteCallback(new f(c.FRAME_SERVICE_FRAME_CLOSED)))}.bind(this),l.POPUP_POLL_INTERVAL),this._popupInterval},y.prototype._getFrameForEnvironment=function(e){var t=p.supportsPopups(),n=!!window.popupBridge,o=m({},this._options,e);return n?new i(o):t?new r(o):new a(o)},t.exports=y},{"../../braintree-error":54,"../../constants":55,"../shared/browser-detection":70,"../shared/constants":71,"../shared/errors":72,"../shared/events":73,"./../../assign":52,"./strategies/modal":65,"./strategies/popup":68,"./strategies/popup-bridge":66,"@braintree/iframer":21,"@braintree/uuid":25,framebus:32}],64:[function(e,t,n){var r=e(`./frame-service`);t.exports={create:function(e,t){var n=new r(e);n.initialize(function(){t(n)})}}},{"./frame-service":63}],65:[function(e,t,n){var r=e(`@braintree/iframer`),i=e(`../../../assign`).assign,a=e(`../../shared/browser-detection`),o={position:`fixed`,top:0,left:0,bottom:0,padding:0,margin:0,border:0,outline:`none`,zIndex:20001,background:`#FFFFFF`};function s(){}function c(e){this._closed=null,this._frame=null,this._options=e||{},this._container=this._options.container||document.body}
1c.prototype.initialize=s,c.prototype.open=function(){var e={src:this._options.openFrameUrl,name:this._options.name,scrolling:`yes`,height:`100%`,width:`100%`,style:i({},o),title:`Lightbox Frame`};a.isIos()?(a.isIosWKWebview()&&(this._lockScrolling(),e.style={}),this._el=document.createElement(`div`),i(this._el.style,o,{height:`100%`,width:`100%`,overflow:`auto`,"-webkit-overflow-scrolling":`touch`}),this._frame=r(e),this._el.appendChild(this._frame)):this._el=this._frame=r(e),this._closed=!1,this._container.appendChild(this._el)},c.prototype.focus=s,c.prototype.close=function(){this._container.removeChild(this._el),this._frame=null,this._closed=!0,a.isIosWKWebview()&&this._unlockScrolling()},c.prototype.isClosed=function(){return!!this._closed},c.prototype.redirect=function(e){this._frame.src=e},c.prototype._unlockScrolling=function(){document.body.style.overflow=this._savedBodyProperties.overflowStyle,document.body.style.position=this._savedBodyProperties.positionStyle,window.scrollTo(this._savedBodyProperties.left,this._savedBodyProperties.top),delete this._savedBodyProperties},c.prototype._lockScrolling=function(){var e=document.documentElement;this._savedBodyProperties={left:(window.pageXOffset||e.scrollLeft)-(e.clientLeft||0),top:(window.pageYOffset||e.scrollTop)-(e.clientTop||0),overflowStyle:document.body.style.overflow,positionStyle:document.body.style.position},document.body.style.overflow=`hidden`,document.body.style.position=`fixed`,window.scrollTo(0,0)},t.exports=c},{"../../../assign":52,"../../shared/browser-detection":70,"@braintree/iframer":21}],66:[function(e,t,n){var r=e(`../../../braintree-error`),i=e(`../../shared/errors`);function a(){}function o(e){this._closed=null,this._options=e}o.prototype.initialize=function(e){var t=this;window.popupBridge.onComplete=function(n,a){var o=!a&&!n;if(t._closed=!0,n||o){e(new r(i.FRAME_SERVICE_FRAME_CLOSED));return}e(null,a)}},o.prototype.open=function(e){var t;e||={},t=e.openFrameUrl||this._options.openFrameUrl,this._closed=!1,window.popupBridge.open(t)},o.prototype.focus=a,o.prototype.close=a,o.prototype.isClosed=function(){return!!this._closed},o.prototype.redirect=function(e){this.open({openFrameUrl:e})},t.exports=o},{"../../../braintree-error":54,"../../shared/errors":72}],67:[function(e,t,n){var r=e(`../../../shared/constants`),i=e(`./position`);function a(e,t,n){return t===void 0?i[e](n):t}t.exports=function(e){var t=e.height||r.DEFAULT_POPUP_HEIGHT,n=e.width||r.DEFAULT_POPUP_WIDTH,i=a(`top`,e.top,t),o=a(`left`,e.left,n);return[r.POPUP_BASE_OPTIONS,`height=`+t,`width=`+n,`top=`+i,`left=`+o].join(`,`)}},{"../../../shared/constants":71,"./position":69}],68:[function(e,t,n){var r=e(`./compose-options`);function i(){}function a(e){this._frame=null,this._options=e||{}}a.prototype.initialize=i,a.prototype.open=function(){this._frame=window.open(this._options.openFrameUrl,this._options.name,r(this._options))},a.prototype.focus=function(){this._frame.focus()},a.prototype.close=function(){this._frame.closed||this._frame.close()},a.prototype.isClosed=function(){return!this._frame||!!this._frame.closed},a.prototype.redirect=function(e){this._frame.location.href=e},t.exports=a},{"./compose-options":67}],69:[function(e,t,n){function r(e){return a(window.outerHeight||document.documentElement.clientHeight,e,window.screenY==null?window.screenTop:window.screenY)}function i(e){return a(window.outerWidth||document.documentElement.clientWidth,e,window.screenX==null?window.screenLeft:window.screenX)}function a(e,t,n){return(e-t)/2+n}t.exports={top:r,left:i,center:a}},{}],70:[function(e,t,n){t.exports={isIos:e(`@braintree/browser-detection/is-ios`),isIosWKWebview:e(`@braintree/browser-detection/is-ios-wkwebview`),supportsPopups:e(`@braintree/browser-detection/supports-popups`)}},{"@braintree/browser-detection/is-ios":18,"@braintree/browser-detection/is-ios-wkwebview":17,"@braintree/browser-detection/supports-popups":19}],71:[function(e,t,n){t.exports={DISPATCH_FRAME_NAME:`dispatch`,DISPATCH_FRAME_CLASS:`braintree-dispatch-frame`,POPUP_BASE_OPTIONS:`resizable,scrollbars`,DEFAULT_POPUP_WIDTH:450,DEFAULT_POPUP_HEIGHT:535,POPUP_POLL_INTERVAL:100,POPUP_CLOSE_TIMEOUT:100}},{}],72:[function(e,t,n){var r=e(`../../braintree-error`);t.exports={FRAME_SERVICE_FRAME_CLOSED:{type:r.types.INTERNAL,code:`FRAME_SERVICE_FRAME_CLOSED`,message:`Frame closed before tokenization could occur.`},FRAME_SERVICE_FRAME_OPEN_FAILED:{type:r.types.INTERNAL,code:`FRAME_SERVICE_FRAME_OPEN_FAILED`,message:`Frame failed to open.`}}},{"../../braintree-error":54}],73:[function(e,t,n){t.exports=e(`../../enumerate`)([`DISPATCH_FRAME_READY`,`DISPATCH_FRAME_REPORT`],`frameService:`)},{"../../enumerate":61}],74:[function(e,t,n){t.exports=function(e){return JSON.parse(JSON.stringify(e))}},{}],75:[function(e,t,n){t.exports=function(e){return Object.keys(e).filter(function(t){return typeof e[t]==`function`})}},{}],76:[function(e,t,n){function r(e){for(var t in e)if(e.hasOwnProperty(t))return!0;return!1}function i(e){return e&&typeof e==`object`&&typeof e.length==`number`&&Object.prototype.toString.call(e)===`[object Array]`||!1}function a(e){return e||=window.location.href,/\?/.test(e)}function o(e){var t,n;return e||=window.location.href,a(e)?(t=e.split(`?`)[1]||``,t=t.replace(/#.*$/,``).split(`&`),n=t.reduce(function(e,t){var n=t.split(`=`),r=decodeURIComponent(n[0]);return e[r]=decodeURIComponent(n[1]),e},{}),n):{}}function s(e,t){var n,r,a,o=[];
1for(a in e)e.hasOwnProperty(a)&&(r=e[a],n=t?i(e)?t+`[]`:t+`[`+a+`]`:a,typeof r==`object`?o.push(s(r,n)):o.push(encodeURIComponent(n)+`=`+encodeURIComponent(r)));return o.join(`&`)}function c(e,t){return e||=``,typeof t==`object`&&t&&r(t)&&(e+=e.indexOf(`?`)===-1?`?`:``,e+=e.indexOf(`=`)===-1?``:`&`,e+=s(t)),e}t.exports={parse:o,stringify:s,queryify:c,hasQueryParams:a}},{}],77:[function(e,t,n){function r(e){return e?``:`.min`}t.exports=r},{}],78:[function(e,t,n){var r=typeof atob==`function`?atob:i;function i(e){var t,n,r,i,a,o,s,c,l=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})([=]{1,2})?$/,u=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`,d=``;if(!l.test(e))throw Error(`Non base64 encoded input passed to window.atob polyfill`);c=0;do i=u.indexOf(e.charAt(c++)),a=u.indexOf(e.charAt(c++)),o=u.indexOf(e.charAt(c++)),s=u.indexOf(e.charAt(c++)),t=(i&63)<<2|a>>4&3,n=(a&15)<<4|o>>2&15,r=(o&3)<<6|s&63,d+=String.fromCharCode(t)+(n?String.fromCharCode(n):``)+(r?String.fromCharCode(r):``);while(c<e.length);return d}t.exports={atob:function(e){return r.call(window,e)},_atob:i}},{}],79:[function(e,t,n){var r=e(`../lib/braintree-error`);t.exports={PAYPAL_NOT_ENABLED:{type:r.types.MERCHANT,code:`PAYPAL_NOT_ENABLED`,message:`PayPal is not enabled for this merchant.`},PAYPAL_SANDBOX_ACCOUNT_NOT_LINKED:{type:r.types.MERCHANT,code:`PAYPAL_SANDBOX_ACCOUNT_NOT_LINKED`,message:`A linked PayPal Sandbox account is required to use PayPal Checkout in Sandbox. See https://developer.paypal.com/braintree/docs/guides/paypal/testing-go-live#linked-paypal-testing for details on linking your PayPal sandbox with Braintree.`},PAYPAL_ACCOUNT_TOKENIZATION_FAILED:{type:r.types.NETWORK,code:`PAYPAL_ACCOUNT_TOKENIZATION_FAILED`,message:`Could not tokenize user's PayPal account.`},PAYPAL_FLOW_FAILED:{type:r.types.NETWORK,code:`PAYPAL_FLOW_FAILED`,message:`Could not initialize PayPal flow.`},PAYPAL_FLOW_OPTION_REQUIRED:{type:r.types.MERCHANT,code:`PAYPAL_FLOW_OPTION_REQUIRED`,message:`PayPal flow property is invalid or missing.`},PAYPAL_START_VAULT_INITIATED_CHECKOUT_PARAM_REQUIRED:{type:r.types.MERCHANT,code:`PAYPAL_START_VAULT_INITIATED_CHECKOUT_PARAM_REQUIRED`},PAYPAL_START_VAULT_INITIATED_CHECKOUT_SETUP_FAILED:{type:r.types.NETWORK,code:`PAYPAL_START_VAULT_INITIATED_CHECKOUT_SETUP_FAILED`,message:`Something went wrong when setting up the checkout workflow.`},PAYPAL_START_VAULT_INITIATED_CHECKOUT_POPUP_OPEN_FAILED:{type:r.types.MERCHANT,code:`PAYPAL_START_VAULT_INITIATED_CHECKOUT_POPUP_OPEN_FAILED`,message:`PayPal popup failed to open, make sure to initiate the vault checkout in response to a user action.`},PAYPAL_START_VAULT_INITIATED_CHECKOUT_CANCELED:{type:r.types.CUSTOMER,code:`PAYPAL_START_VAULT_INITIATED_CHECKOUT_CANCELED`,message:`Customer closed PayPal popup before authorizing.`},PAYPAL_START_VAULT_INITIATED_CHECKOUT_IN_PROGRESS:{type:r.types.MERCHANT,code:`PAYPAL_START_VAULT_INITIATED_CHECKOUT_IN_PROGRESS`,message:`Vault initiated checkout already in progress.`},PAYPAL_INVALID_PAYMENT_OPTION:{type:r.types.MERCHANT,code:`PAYPAL_INVALID_PAYMENT_OPTION`,message:`PayPal payment options are invalid.`},PAYPAL_MISSING_REQUIRED_OPTION:{type:r.types.MERCHANT,code:`PAYPAL_MISSING_REQUIRED_OPTION`,message:`Missing required option.`}}},{"../lib/braintree-error":54}],80:[function(e,t,n){var r=e(`../lib/basic-component-verification`),i=e(`@braintree/wrap-promise`),a=e(`./paypal-checkout`),o=`3.138.0`;function s(e){return r.verify({name:`PayPal Checkout`,client:e.client,authorization:e.authorization}).then(function(){return new a(e)._initialize(e)})}function c(){return!0}t.exports={create:i(s),isSupported:c,VERSION:o}},{"../lib/basic-component-verification":53,"./paypal-checkout":81,"@braintree/wrap-promise":29}],81:[function(e,t,n){var r=e(`../lib/analytics`),i=e(`../lib/assign`).assign,a=e(`../lib/create-deferred-client`),o=e(`../lib/create-assets-url`),s=e(`@braintree/extended-promise`),c=e(`@braintree/wrap-promise`),l=e(`../lib/braintree-error`),u=e(`../lib/convert-to-braintree-error`),d=e(`./errors`),f=e(`../paypal/shared/constants`),p=e(`../lib/frame-service/external`),m=e(`../lib/create-authorization-data`),h=e(`../lib/methods`),g=e(`../lib/use-min`),_=e(`../lib/convert-methods-to-error`),v=e(`../lib/querystring`),y=`3.138.0`,b=e(`../lib/constants`).INTEGRATION_TIMEOUT_MS,x=[`amount`,`currency`,`vaultInitiatedCheckoutPaymentMethodToken`],S=`https://www.{ENV}paypal.com/smart/buttons/preload`;s.suppressUnhandledPromiseMessage=!0;function C(e){this._merchantAccountId=e.merchantAccountId,this._autoSetDataUserIdToken=!!e.autoSetDataUserIdToken}C.prototype._initialize=function(e){var t;return e.client?(t=e.client.getConfiguration(),this._authorizationInformation={fingerprint:t.authorizationFingerprint,environment:t.gatewayConfiguration.environment}):(t=m(e.authorization),this._authorizationInformation={fingerprint:t.attrs.authorizationFingerprint,environment:t.environment}),this._clientPromise=a.create({authorization:e.authorization,client:e.client,debug:e.debug,assetsUrl:o.create(e.authorization),name:`PayPal Checkout`}).then(function(e){return this._configuration=e.getConfiguration(),this._merchantAccountId||(this._configuration.gatewayConfiguration.paypalEnabled?this._configuration.gatewayConfiguration.paypal.environmentNoNetwork===!0&&(this._setupError=ne
1w l(d.PAYPAL_SANDBOX_ACCOUNT_NOT_LINKED)):this._setupError=new l(d.PAYPAL_NOT_ENABLED)),this._setupError?Promise.reject(this._setupError):(r.sendEvent(e,`paypal-checkout.initialized`),this._frameServicePromise=this._setupFrameService(e),e)}.bind(this)),e.client?this._clientPromise.then(function(){return this}.bind(this)):Promise.resolve(this)},C.prototype._setupFrameService=function(e){var t=new s,n=e.getConfiguration(),i=setTimeout(function(){r.sendEvent(e,`paypal-checkout.frame-service.timed-out`),t.reject(new l(d.PAYPAL_START_VAULT_INITIATED_CHECKOUT_SETUP_FAILED))},b);return this._assetsUrl=n.gatewayConfiguration.paypal.assetsUrl+`/web/`+y,this._isDebug=n.isDebug,this._loadingFrameUrl=this._assetsUrl+`/html/paypal-landing-frame`+g(this._isDebug)+`.html`,p.create({name:`braintreepaypallanding`,dispatchFrameUrl:this._assetsUrl+`/html/dispatch-frame`+g(this._isDebug)+`.html`,openFrameUrl:this._loadingFrameUrl},function(e){this._frameService=e,clearTimeout(i),t.resolve()}.bind(this)),t},C.prototype.createPayment=function(e){var t=this;return!e||!f.FLOW_ENDPOINTS.hasOwnProperty(e.flow)?Promise.reject(new l(d.PAYPAL_FLOW_OPTION_REQUIRED)):(r.sendEvent(this._clientPromise,`paypal-checkout.createPayment`),this._createPaymentResource(e).then(function(n){var r,i;return e.flow===`checkout`?(i=v.parse(n.paymentResource.redirectUrl),r=i.token):r=n.agreementSetup.tokenId,t._contextId=r,r}))},C.prototype._createPaymentResource=function(e,t){var n=this,i=`paypal_hermes/`+f.FLOW_ENDPOINTS[e.flow];return this._flow=e.flow,delete this.intentFromCreatePayment,t||={},e.offerCredit===!0&&r.sendEvent(this._clientPromise,`paypal-checkout.credit.offered`),this._clientPromise.then(function(r){return r.request({endpoint:i,method:`post`,data:n._formatPaymentResourceData(e,t)}).then(function(t){return n.intentFromCreatePayment=e.intent,t})}).catch(function(e){var t;return n._setupError?Promise.reject(n._setupError):(t=e.details&&e.details.httpStatus,t===422?Promise.reject(new l({type:d.PAYPAL_INVALID_PAYMENT_OPTION.type,code:d.PAYPAL_INVALID_PAYMENT_OPTION.code,message:d.PAYPAL_INVALID_PAYMENT_OPTION.message,details:{originalError:e}})):Promise.reject(u(e,{type:d.PAYPAL_FLOW_FAILED.type,code:d.PAYPAL_FLOW_FAILED.code,message:d.PAYPAL_FLOW_FAILED.message})))})},C.prototype.updatePayment=function(e){var t=this,n=`paypal_hermes/patch_payment_resource`;return!e||this._hasMissingOption(e,f.REQUIRED_OPTIONS)?(r.sendEventPlus(t._clientPromise,`paypal-checkout.updatePayment.missing-options`,{flow:t._flow,context_id:t._contextId}),Promise.reject(new l(d.PAYPAL_MISSING_REQUIRED_OPTION))):this._verifyConsistentCurrency(e)?(r.sendEventPlus(this._clientPromise,`paypal-checkout.updatePayment`,{flow:t._flow,context_id:t._contextId}),this._clientPromise.then(function(r){return r.request({endpoint:n,method:`post`,data:t._formatUpdatePaymentData(e)})}).catch(function(e){return(e.details&&e.details.httpStatus)===422?(r.sendEventPlus(t._clientPromise,`paypal-checkout.updatePayment.invalid`,{flow:t._flow,context_id:t._contextId}),Promise.reject(new l({type:d.PAYPAL_INVALID_PAYMENT_OPTION.type,code:d.PAYPAL_INVALID_PAYMENT_OPTION.code,message:d.PAYPAL_INVALID_PAYMENT_OPTION.message,details:{originalError:e}}))):(r.sendEventPlus(t._clientPromise,`paypal-checkout.updatePayment.`+d.PAYPAL_FLOW_FAILED.code,{flow:t._flow,context_id:t._contextId}),Promise.reject(u(e,{type:d.PAYPAL_FLOW_FAILED.type,code:d.PAYPAL_FLOW_FAILED.code,message:d.PAYPAL_FLOW_FAILED.message})))})):(r.sendEventPlus(t._clientPromise,`paypal-checkout.updatePayment.inconsistent-currencies`,{flow:t._flow,context_id:t._contextId}),Promise.reject(new l({type:d.PAYPAL_INVALID_PAYMENT_OPTION.type,code:d.PAYPAL_INVALID_PAYMENT_OPTION.code,message:d.PAYPAL_INVALID_PAYMENT_OPTION.message,details:{originalError:Error(`One or more shipping option currencies differ from checkout currency.`)}})))},C.prototype.startVaultInitiatedCheckout=function(e){var t,n=this;return this._vaultInitiatedCheckoutInProgress?(r.sendEventPlus(this._clientPromise,`paypal-checkout.startVaultInitiatedCheckout.error.already-in-progress`,{flow:n._flow,context_id:n._contextId}),Promise.reject(new l(d.PAYPAL_START_VAULT_INITIATED_CHECKOUT_IN_PROGRESS))
1):(x.forEach(function(n){e.hasOwnProperty(n)||(t=n)}),t?Promise.reject(new l({type:d.PAYPAL_START_VAULT_INITIATED_CHECKOUT_PARAM_REQUIRED.type,code:d.PAYPAL_START_VAULT_INITIATED_CHECKOUT_PARAM_REQUIRED.code,message:`Required param `+t+` is missing.`})):(this._vaultInitiatedCheckoutInProgress=!0,this._addModalBackdrop(e),e=i({},e,{flow:`checkout`}),r.sendEventPlus(this._clientPromise,`paypal-checkout.startVaultInitiatedCheckout.started`,{flow:n._flow,context_id:n._contextId}),this._waitForVaultInitiatedCheckoutDependencies().then(function(){var t=new s,r=n._createPaymentResource(e,{returnUrl:n._constructVaultCheckoutUrl(`redirect-frame`),cancelUrl:n._constructVaultCheckoutUrl(`cancel-frame`)}).then(function(e){var r=e.paymentResource.redirectUrl;return n._frameService.redirect(r),t});return n._frameService.open({},n._createFrameServiceCallback(t)),r}).catch(function(e){return n._vaultInitiatedCheckoutInProgress=!1,n._removeModalBackdrop(),e.code===`FRAME_SERVICE_FRAME_CLOSED`?(r.sendEventPlus(n._clientPromise,`paypal-checkout.startVaultInitiatedCheckout.canceled.by-customer`,{flow:n._flow,context_id:n._contextId}),Promise.reject(new l(d.PAYPAL_START_VAULT_INITIATED_CHECKOUT_CANCELED))):(n._frameService&&n._frameService.close(),e.code&&e.code.indexOf(`FRAME_SERVICE_FRAME_OPEN_FAILED`)>-1?(r.sendEventPlus(n._clientPromise,`paypal-checkout.startVaultInitiatedCheckout.failed.popup-not-opened`,{flow:n._flow,context_id:n._contextId}),Promise.reject(new l({code:d.PAYPAL_START_VAULT_INITIATED_CHECKOUT_POPUP_OPEN_FAILED.code,type:d.PAYPAL_START_VAULT_INITIATED_CHECKOUT_POPUP_OPEN_FAILED.type,message:d.PAYPAL_START_VAULT_INITIATED_CHECKOUT_POPUP_OPEN_FAILED.message,details:{originalError:e}}))):Promise.reject(e))}).then(function(e){return n._frameService.close(),n._vaultInitiatedCheckoutInProgress=!1,n._removeModalBackdrop(),r.sendEventPlus(n._clientPromise,`paypal-checkout.startVaultInitiatedCheckout.succeeded`,{flow:n._flow,context_id:n._contextId}),Promise.resolve(e)})))},C.prototype._addModalBackdrop=function(e){e.optOutOfModalBackdrop||(this._modalBackdrop||(this._modalBackdrop=document.createElement(`div`),this._modalBackdrop.setAttribute(`data-braintree-paypal-vault-initiated-checkout-modal`,!0),this._modalBackdrop.style.position=`fixed`,this._modalBackdrop.style.top=0,this._modalBackdrop.style.bottom=0,this._modalBackdrop.style.left=0,this._modalBackdrop.style.right=0,this._modalBackdrop.style.zIndex=9999,this._modalBackdrop.style.background=`black`,this._modalBackdrop.style.opacity=`0.7`,this._modalBackdrop.addEventListener(`click`,function(){this.focusVaultInitiatedCheckoutWindow()}.bind(this))),document.body.appendChild(this._modalBackdrop))},C.prototype._removeModalBackdrop=function(){this._modalBackdrop&&this._modalBackdrop.parentNode&&this._modalBackdrop.parentNode.removeChild(this._modalBackdrop)},C.prototype.closeVaultInitiatedCheckoutWindow=function(){return this._vaultInitiatedCheckoutInProgress&&r.sendEventPlus(this._clientPromise,`paypal-checkout.startVaultInitiatedCheckout.canceled.by-merchant`,{flow:this._flow,context_id:this._contextId}),this._waitForVaultInitiatedCheckoutDependencies().then(function(){this._frameService.close()}.bind(this))},C.prototype.focusVaultInitiatedCheckoutWindow=function(){return this._waitForVaultInitiatedCheckoutDependencies().then(function(){this._frameService.focus()}.bind(this))},C.prototype._createFrameServiceCallback=function(e){var t=this;return function(n,r){n?e.reject(n):r&&(t._frameService.redirect(t._loadingFrameUrl),t.tokenizePayment({paymentToken:r.token,payerID:r.PayerID,paymentID:r.paymentId,orderID:r.orderId}).then(function(t){e.resolve(t)}).catch(function(t){e.reject(t)}))}},C.prototype._waitForVaultInitiatedCheckoutDependencies=function(){var e=this;return this._clientPromise.then(function(){return e._frameServicePromise})},C.prototype._constructVaultCheckoutUrl=function(e){var t=this._frameService._serviceId;return this._assetsUrl+`/html/`+e+g(this._isDebug)+`.html?channel=`+t},C.prototype.tokenizePayment=function(e){var t=this,n=!0,i,a={flow:this._flow,intent:e.intent||this.intentFromCreatePayment},o={ecToken:e.paymentToken,billingToken:e.billingToken,payerId:e.payerID,paymentId:e.paymentID,orderId:e.orderID,shippingOptionsId:e.shippingOptionsId};return e.hasOwnProperty(`vault`)&&(n=e.vault),a.vault=n,r.sendEventPlus(this._clientPromise,`paypal-checkout.tokenization.started`,{flow:t._flow,context_id:t._contextId}),this._clientPromise.then(function(e){return e.request({endpoint:`payment_methods/paypal_accounts`,method:`post`,data:t._formatTokenizeData(a,o)})}).then(function(e){return i=t._formatTokenizePayload(e),r.sendEventPlus(t._clientPromise,`paypal-checkout.tokenization.success`,{flow:t._flow,context_id:t._contextId}),i.creditFinancingOffered&&r.sendEventPlus(t._clientPromise,`paypal-checkout.credit.accepted`,{flow:t._flow,context_id:t._contextId}),i}).catch(function(e){return t._setupError?Promise.reject(t._setupError):(r.sendEventPlus(t._clientPromise,`paypal-checkout.tokenization.failed`,{flow:t._flow,context_id:t._contextId}),Promise.reject(u(e,{type:d.PAYPAL_ACCOUNT_TOKENIZATION_FAILED.type,code:d.PAYPAL_ACCOUNT_TOKENIZATION_FAILED.code,message:d.PAYPAL_ACCOUNT_TOKENIZATION_FAILED.message})))})},C.prototype.getClientId=function(){return this._clientPromise.then(function(e){return e.getConfiguration().gatewayConfiguration.paypal.clientId})},C.prototype.loadPayPalSDK=function(e){var t,n,r=new s,a=e&&e.dataAttributes||{},o=a[`user-id-token`]||a[`data-user-id-token`];return this._configuration&&(a[`client-metadata-id`]=a[`client-metadata-id`]?a[`client-metadata-id`]:this._configuration.analyticsMetadata.sessionId,a[`data-sdk-integration-source`]=f.BT_INTEGRATION_SOURCE),o||=this._authorizationInformation.fingerprint&&this._authorizationInformation.fingerprint.split(`?`)[0],this._paypalScript=document.createElement(`script`),e=i({},{components:`buttons`},e),delete e.dataAttributes,e.vault?e.intent=e.intent||`tokenize`:(e.intent=e.intent||`authorize`,e.currency=e.currency||`USD`),n=f.ENVIRONMENT[e.env]||`https://www.paypal.com/sdk/js?`,delete e.env,this._paypalScript.onload=function(){r.resolve()}
1,Object.keys(a).forEach(function(e){this._paypalScript.setAttribute(`data-`+e.replace(/^data\-/,``),a[e])}.bind(this)),t=e[`client-id`]?Promise.resolve(e[`client-id`]):this.getClientId(),t.then(function(t){e[`client-id`]=t,this._autoSetDataUserIdToken&&o&&(this._paypalScript.setAttribute(`data-user-id-token`,o),this._attachPreloadPixel({id:t,userIdToken:o,amount:a.amount,currency:e.currency,merchantId:e[`merchant-id`]})),this._paypalScript.src=v.queryify(n,e),document.head.insertBefore(this._paypalScript,document.head.firstElementChild)}.bind(this)),r.then(function(){return this}.bind(this))},C.prototype._attachPreloadPixel=function(e){var t,n=e.id,r=e.userIdToken,i=this._authorizationInformation.environment===`production`?``:`sandbox.`,a=S.replace(`{ENV}`,i),o={"client-id":n,"user-id-token":r};e.amount&&(o.amount=e.amount),e.currency&&(o.currency=e.currency),e.merchantId&&(o[`merchant-id`]=e.merchantId),t=new XMLHttpRequest,t.open(`GET`,v.queryify(a,o)),t.send()},C.prototype._formatPaymentResourceData=function(e,t){var n=this,r=this._configuration.gatewayConfiguration,i={returnUrl:t.returnUrl||`https://www.paypal.com/checkoutnow/error`,cancelUrl:t.cancelUrl||`https://www.paypal.com/checkoutnow/error`,offerPaypalCredit:e.offerCredit===!0,merchantAccountId:this._merchantAccountId,experienceProfile:{brandName:e.displayName||r.paypal.displayName,localeCode:e.locale,noShipping:(!e.enableShippingAddress).toString(),addressOverride:e.shippingAddressEditable===!1,landingPageType:e.landingPageType},shippingOptions:e.shippingOptions,payer_email:e.userAuthenticationEmail};return e.hasOwnProperty(`returnUrl`)&&(i.returnUrl=e.returnUrl),e.hasOwnProperty(`cancelUrl`)&&(i.cancelUrl=e.cancelUrl),e.hasOwnProperty(`appSwitchPreference`)&&(i.appSwitchPreference=e.appSwitchPreference),e.hasOwnProperty(`shippingCallbackUrl`)&&(i.shippingCallbackUrl=e.shippingCallbackUrl),e.hasOwnProperty(`paymentReadySessionId`)&&(i.paymentReadySessionId=e.paymentReadySessionId),e.hasOwnProperty(`amountBreakdown`)&&(i.amountBreakdown=e.amountBreakdown),e.planType&&(i.planType=e.planType),e.planMetadata&&(i.planMetadata=this._formatPlanMetadata(e.planMetadata)),n._formatPaymentResourceCheckoutData(i,e),n._formatPaymentResourceVaultData(i,e),this._riskCorrelationId=e.riskCorrelationId,e.riskCorrelationId&&(i.correlationId=this._riskCorrelationId),i},C.prototype._formatPaymentResourceVaultData=function(e,t){t.flow!==`checkout`&&(e.shippingAddress=t.shippingAddressOverride,t.billingAgreementDescription&&(e.description=t.billingAgreementDescription),t.hasOwnProperty(`userAction`)&&(e.experienceProfile.userAction=t.userAction))},C.prototype._formatPaymentResourceCheckoutData=function(e,t){var n,r=t.intent;if(t.flow===`checkout`){for(n in e.amount=t.amount,e.currencyIsoCode=t.currency,e.requestBillingAgreement=t.requestBillingAgreement,t.hasOwnProperty(`userAction`)&&(e.experienceProfile.userAction=t.userAction),r&&(r===`capture`&&(r=`sale`),e.intent=r),t.hasOwnProperty(`lineItems`)&&(e.lineItems=t.lineItems),t.hasOwnProperty(`vaultInitiatedCheckoutPaymentMethodToken`)&&(e.vaultInitiatedCheckoutPaymentMethodToken=t.vaultInitiatedCheckoutPaymentMethodToken),t.hasOwnProperty(`shippingOptions`)&&(e.shippingOptions=t.shippingOptions),t.shippingAddressOverride)t.shippingAddressOverride.hasOwnProperty(n)&&(e[n]=t.shippingAddressOverride[n]);t.contactPreference&&(e.contactPreference=t.contactPreference),t.hasOwnProperty(`billingAgreementDetails`)&&(e.billingAgreementDetails=t.billingAgreementDetails)}},C.prototype._verifyConsistentCurrency=function(e){return e.currency&&e.hasOwnProperty(`shippingOptions`)&&Array.isArray(e.shippingOptions)?e.shippingOptions.every(function(t){return t.amount&&t.amount.currency&&e.currency.toLowerCase()===t.amount.currency.toLowerCase()}):!0},C.prototype._hasMissingOption=function(e,t){var n,r;if(t||=[],!e.hasOwnProperty(`amount`)&&!e.hasOwnProperty(`lineItems`))return!0;for(n=0;n<t.length;n++)if(r=t[n],!e.hasOwnProperty(r))return!0;return!1},C.prototype._formatPlanMetadata=function(e){var t,n,r,i,a=[`currencyIsoCode`,`name`,`oneTimeFeeAmount`,`productDescription`,`productPrice`,`productQuantity`,`shippingAmount`,`taxAmount`,`totalAmount`],o=[`billingFrequency`,`billingFrequencyUnit`,`numberOfExecutions`,`sequence`,`startDate`,`trial`,`pricingScheme`],s={billingCycles:[]};if(e.hasOwnProperty(`billingCycles`))for(s.billingCycles=[],t=0;t<e.billingCycles.length;t++){for(r=e.billingCycles[t],i={},n=0;n<o.length;n++)i[o[n]]=r[o[n]];s.billingCycles.push(i)}for(t=0;t<a.length;t++)s[a[t]]=e[a[t]];return s},C.prototype._formatUpdatePaymentData=function(e){var t=this,n={merchantAccountId:this._merchantAccountId,paymentId:e.paymentId||e.orderId,currencyIsoCode:e.currency};return e.hasOwnProperty(`amount`)&&(n.amount=e.amount),e.hasOwnProperty(`lineItems`)&&(n.lineItems=e.lineItems),e.hasOwnProperty(`shippingOptions`)&&(n.shippingOptions=e.shippingOptions),e.hasOwnProperty(`amountBreakdown`)&&(n.amountBreakdown=e.amountBreakdown),e.hasOwnProperty(`shippingAddress`)&&(r.sendEventPlus(t._clientPromise,`paypal-checkout.updatePayment.shippingAddress.provided.by-the-merchant`,{flow:t._flow,context_id:t._contextId}),n.line1=e.shippingAddress.line1,e.shippingAddress.hasOwnProperty(`line2`)&&(n.line2=e.shippingAddress.line2),n.city=e.shippingAddress.city,n.state=e.shippingAddress.state,n.postalCode=e.shippingAddress.postalCode,n.countryCode=e.shippingAddress.countryCode,e.shippingAddress.hasOwnProperty(`phone`)&&(n.phone=e.shippingAddress.phone),e.shippingAddress.hasOwnProperty(`recipientName`)&&(n.recipientName=e.shippingAddress.recipientName)),n},C.prototype._formatTokenizeData=function(e,t){var n=this._configuration,r=n.gatewayConfiguration,i=n.authorizationType===`TOKENIZATION_KEY`,a=e.flow===`vault`||e.flow==null&&!t.paymentId,o={paypalAccount:{correlationId:this._riskCorrelationId||t.billingToken||t.ecToken,options:{validate:a&&!i&&e.vault}}};return a?o.paypalAccount.billingAgreementToken=t.billingToken:(o.paypalAccount.paymentToken=t.paymentId||t.orderId,o.paypalAccount.payerId=t.payerId,o.paypalAccount.unilateral=r.paypal.unvettedMerchant,e.intent&&(o.paypalAccount.intent=e.intent)),this._merchantAccountId&&(o.merchantAccountId=this._merchantAccountId),o},C.prototype._formatTokenizePayload=function(e){var t,n={};
1return e.paypalAccounts&&(n=e.paypalAccounts[0]),t={nonce:n.nonce,details:{},type:n.type},n.details&&n.details.payerInfo&&(t.details=n.details.payerInfo),n.details&&n.details.creditFinancingOffered&&(t.creditFinancingOffered=n.details.creditFinancingOffered),n.details&&n.details.shippingOptionId&&(t.shippingOptionId=n.details.shippingOptionId),n.details&&n.details.cobrandedCardLabel&&(t.cobrandedCardLabel=n.details.cobrandedCardLabel),t},C.prototype.teardown=function(){var e=this;return _(this,h(C.prototype)),this._paypalScript&&this._paypalScript.parentNode&&this._paypalScript.parentNode.removeChild(this._paypalScript),this._frameServicePromise.catch(function(){}).then(function(){return e._frameService?e._frameService.teardown():Promise.resolve()})},t.exports=c.wrapPrototype(C)},{"../lib/analytics":50,"../lib/assign":52,"../lib/braintree-error":54,"../lib/constants":55,"../lib/convert-methods-to-error":56,"../lib/convert-to-braintree-error":57,"../lib/create-assets-url":58,"../lib/create-authorization-data":59,"../lib/create-deferred-client":60,"../lib/frame-service/external":64,"../lib/methods":75,"../lib/querystring":76,"../lib/use-min":77,"../paypal/shared/constants":82,"./errors":79,"@braintree/extended-promise":20,"@braintree/wrap-promise":29}],82:[function(e,t,n){t.exports={LANDING_FRAME_NAME:`braintreepaypallanding`,FLOW_ENDPOINTS:{checkout:`create_payment_resource`,vault:`setup_billing_agreement`},REQUIRED_OPTIONS:[`paymentId`,`currency`],ENVIRONMENT:{stage:`https://www.msmaster.qa.paypal.com/sdk/js?`,sandbox:`https://www.sandbox.paypal.com/sdk/js?`,teBraintree:`https://www.braintree.stage.paypal.com/sdk/js?`},BT_INTEGRATION_SOURCE:`BRAINTREE_WEB_SDK`}},{}]},{},[80])(80)})})),l=t(i(),1),u=t(c(),1),d=t(r(),1);function f(){let e=document.getElementById(`checkout-loading-overlay`);e&&(e.dataset.visible=`true`,e.setAttribute(`aria-hidden`,`false`))}function p(e=``){return new Promise(t=>{let n=document.getElementById(`paypal-phone-prompt`),r=document.getElementById(`paypal-phone-input`),i=document.getElementById(`paypal-phone-submit`),a=document.getElementById(`paypal-phone-cancel`),o=document.getElementById(`paypal-phone-error`);if(!n||!r||!i||!a){t(null);return}function s(){n.style.display=`none`,n.hidden=!0,i.removeEventListener(`click`,c),a.removeEventListener(`click`,l),n.removeEventListener(`click`,u),r.removeEventListener(`keydown`,d)}function c(){let e=(r.value||``).trim();if(!e){o&&(o.hidden=!1),r.focus();return}o&&(o.hidden=!0),s(),t(e)}function l(){s(),t(null)}function u(e){e.target===n&&l()}function d(e){e.key===`Enter`?(e.preventDefault(),c()):e.key===`Escape`&&l()}r.value=e||``,o&&(o.hidden=!0),n.hidden=!1,n.style.display=`flex`,i.addEventListener(`click`,c),a.addEventListener(`click`,l),n.addEventListener(`click`,u),r.addEventListener(`keydown`,d),setTimeout(()=>r.focus(),0)})}var m=async function(){let e=document.getElementById(`paypal-config`);if(!e){o(`paypal`,!1);return}let t=JSON.parse(e.innerHTML),n=t.totalAmount,r=t.clientTokenUrl,i=document.getElementById(`paypal-button`),c=document.getElementById(`paypal-form`),m=document.getElementById(`paypal_payment_method_nonce`),h=document.getElementById(`paypal_device_data`),g=document.getElementById(`paypal_billing_address`);if(!i||!c){o(`paypal`,!1);return}let _;try{_=(await(await fetch(r)).json()).clientToken}catch(e){console.error(`Error fetching client token:`,e),o(`paypal`,!1);return}l.default.create({authorization:_},function(e,t){if(e){console.error(`Error creating Braintree client:`,e),o(`paypal`,!1);return}let r=``;d.default.create({client:t},function(e,t){if(e){console.error(`Error creating data collector:`,e);return}r=t.deviceData}),u.default.create({client:t},function(e,t){if(e){console.error(`Error creating PayPal Checkout instance:`,e),o(`paypal`,!1);return}t.loadPayPalSDK({currency:`USD`,intent:`authorize`}).then(function(){if(!window.paypal||!window.paypal.Buttons){console.error(`PayPal SDK failed to load`),o(`paypal`,!1);return}c.style.display=`inline-block`;let e=document.getElementById(`payment-button-skeletons`);e&&(e.style.display=`none`),o(`paypal`,!0),window.paypal.Buttons({fundingSource:window.paypal.FUNDING.PAYPAL,style:{layout:`horizontal`,color:`gold`,shape:`rect`,label:`paypal`,tagline:!1,height:48},createOrder:function(){let e=document.getElementById(`cart-terms-checkbox`);return e&&!e.checked?(alert(s(`js.billing.accept_terms`)),Promise.reject(Error(`Terms not accepted`))):t.createPayment({flow:`checkout`,amount:n,currency:`USD`,intent:`authorize`,enableShippingAddress:!0,shippingAddressEditable:!0})},onApprove:function(e){return t.tokenizePayment(e).then(function(e){let t=e.details||{},n=t.shippingAddress||{},i=t.billingAddress||{},o=e=>i[e]||n[e]||``,s=o(`countryCode`)||`US`,l=a(s,`US`),u=[o(`line1`),o(`line2`)].filter(e=>e.length>0),d={givenName:t.firstName||``,familyName:t.lastName||``,phoneNumber:t.phone||``,emailAddress:t.email||``,addressLines:u,locality:o(`city`),administrativeArea:o(`state`),postalCode:o(`postalCode`),countryCode:s,countryName:l};function _(){m.value=e.nonce,h.value=r,g.value=JSON.stringify(d),f(),c.submit()}setTimeout(()=>{p(d.phoneNumber).then(e=>{e!==null&&(d.phoneNumber=e,_())})},0)})},onCancel:function(){console.log(`User canceled PayPal payment`)},onError:function(e){console.error(`PayPal Checkout error:`,e)}}).render(`#paypal-button`).catch(function(e){console.error(`Error rendering PayPal button:`,e),o(`paypal`,!1)})}).catch(function(e){console.error(`Error loading PayPal SDK:`,e),o(`paypal`,!1)})})})};document.addEventListener(`readystatechange`,function(){document.readyState===`complete`&&m()}); 2//# sourceMappingURL=paypal-0pnR_x-x.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.