(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,117317,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.useCreditAppContext=r.CreditAppContext=void 0;var d=e.r(15010);let i={dispatch:function(){},logger:console,state:{}},n=r.CreditAppContext=(0,d.createContext)(i);r.useCreditAppContext=()=>(0,d.useContext)(n)},481644,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,r.default={assignState:"assignState",clearLaunchCreditProduct:"clearLaunchCreditProduct",preloadCreditProduct:"preloadCreditProduct",updateProductState:"updateProductState",resetCreditProductIframe:"resetCreditProductIframe"}},787651,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){return{payload:e,type:i.default.updateProductState}};var d,i=(d=e.r(481644))&&d.__esModule?d:{default:d}},466955,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,r.default={root:"credit-app-root",defaultIframeTestId:"credit-app-iframe"}},551445,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,r.default={idle:"idle",iframeCleared:"iframeCleared",staticResourcesLoaded:"staticResourcesLoaded",staticResourcesErrored:"staticResourcesErrored",iframeLoaded:"iframeLoaded",iframeErrored:"iframeErrored",appInitializing:"appInitializing",appInitializeCompleted:"appInitializeCompleted",appInitializeErrored:"appInitializeErrored"}},50603,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,r.default={awaitingRedirect:"awaitingRedirect",failure:"failure",idle:"idle",processing:"processing",success:"success",resetting:"resetting"}},903902,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,t){return t.replace(/\bnonce="[^"]*"/gims,`nonce="${e}"`).replace(/\B"nonce":"[^"]*"/gims,`"nonce":"${e}"`)}},969480,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=a,r.fetchWithTimeout=void 0;var d,i=(d=e.r(903902))&&d.__esModule?d:{default:d};let n=async(e,t,r)=>{let d;return Promise.race([fetch(e,r),new Promise((e,r)=>{d=setTimeout(()=>{r(Error("Request timed out"))},t)})]).finally(()=>{d&&clearTimeout(d)})};async function a(e,t,r){let{nonce:d,token:a,euat:u}=r,l="";if(a){let e=new URLSearchParams(window.location.search).get("mock"),t=new URLSearchParams;e&&t.set("mock",e),t.set("ecToken",a),l=`?${t.toString()}`}let o={...u?{"x-paypal-internal-euat":u}:{}},s=await n(`${e}${l}`,5e3,{headers:o}),c=await s.text();return d?{content:(0,i.default)(d,c),assetBaseUri:t}:{content:c,assetBaseUri:t}}r.fetchWithTimeout=n},981715,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=n;var d,i=(d=e.r(466955))&&d.__esModule?d:{default:d};async function n(e,t){return{content:`
  <!DOCTYPE html>
  <html>
    <head>
    </head>
    <body>
      <div data-testid="${i.default.root}" id="${i.default.root}"></div>
      <script src="${e}"></script>
    </body>
  </html>
`,assetBaseUri:t}}},277455,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var d=i(e.r(969480));function i(e){return e&&e.__esModule?e:{default:e}}r.default={js:i(e.r(981715)).default,html:d.default}},406059,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,r.default={js:"js",html:"html"}},899811,(e,t,r)=>{"use strict";var d;Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,r.default={startUri:"https://www.paypalobjects.com/cap-assets/longTerm.bundle.js",type:((d=e.r(406059))&&d.__esModule?d:{default:d}).default.js,assetBaseUri:"https://www.paypalobjects.com/cap-assets/"}},93036,(e,t,r)=>{"use strict";var d;Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,r.default={startUri:"https://www.paypalobjects.com/cap-assets/deer.bundle.js",type:((d=e.r(406059))&&d.__esModule?d:{default:d}).default.js,assetBaseUri:"https://www.paypalobjects.com/cap-assets/"}},716046,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var d=n(e.r(899811)),i=n(e.r(93036));function n(e){return e&&e.__esModule?e:{default:e}}r.default={longTerm:d.default,unified:i.default}},429625,(e,t,r)=>{"use strict";var d;Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,r.default={startUri:"/crcacqportablenodeweb/js/client/longTerm.bundle.js",type:((d=e.r(406059))&&d.__esModule?d:{default:d}).default.js,assetBaseUri:"/crcacqportablenodeweb/js/client/"}},122023,(e,t,r)=>{"use strict";var d;Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,r.default={startUri:"/crcacqportablenodeweb/js/client/deer.bundle.js",type:((d=e.r(406059))&&d.__esModule?d:{default:d}).default.js,assetBaseUri:"/crcacqportablenodeweb/js/client/"}},294958,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var d=n(e.r(429625)),i=n(e.r(122023));function n(e){return e&&e.__esModule?e:{default:e}}r.default={longTerm:d.default,unified:i.default}},745358,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var d=i(e.r(716046));function i(e){return e&&e.__esModule?e:{default:e}}r.default={relative:i(e.r(294958)).default,production:d.default}},987385,(e,t,r)=>{"use strict";var d;Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,r.default={startUri:"/credit-application/co",type:((d=e.r(406059))&&d.__esModule?d:{default:d}).default.html,assetBaseUri:"/"}},967103,(e,t,r)=>{"use strict";var d;Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,r.default={startUri:"/credit-application/paypal-credit-card/xo/us",type:((d=e.r(406059))&&d.__esModule?d:{default:d}).default.html,assetBaseUri:"/"}},106524,(e,t,r)=>{"use strict";var d;Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,r.default={startUri:"/credit-application/paypal-credit/xo/gb",type:((d=e.r(406059))&&d.__esModule?d:{default:d}).default.html,assetBaseUri:"/"}},818183,(e,t,r)=>{"use strict";var d;Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,r.default={startUri:"/credit-application/paypal-credit/xo/us",type:((d=e.r(406059))&&d.__esModule?d:{default:d}).default.html,assetBaseUri:"/"}},280373,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var d=u(e.r(987385)),i=u(e.r(967103)),n=u(e.r(106524)),a=u(e.r(818183));function u(e){return e&&e.__esModule?e:{default:e}}r.default={PP_UK_PPC:n.default,PPC_US_V2:a.default,PAYPAL_CREDIT_CARD_US:i.default,CREDIT_CARD_PAYPAL_CONSUMER_REWARDS_US:d.default}},48390,(e,t,r)=>{"use strict";var d;Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,r.default={startUri:"/myaccount/debitcards/enroll/ppdcxo",type:((d=e.r(406059))&&d.__esModule?d:{default:d}).default.html,assetBaseUri:"/"}},598485,(e,t,r)=>{"use strict";var d;Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,r.default={PPDC_ACQUISITION_US:((d=e.r(48390))&&d.__esModule?d:{default:d}).default}},108140,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,r.default={gplLongTermBrandRefresh:"gpl_long_term_brand_refresh",gplShortTermBrandRefresh:"gpl_short_term_brand_refresh"}},234738,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,r.default={control:"control",treatment1:"treatment_1",treatment2:"treatment_2",treatment3:"treatment_3",treatment4:"treatment_4",treatment5:"treatment_5",treatment6:"treatment_6",treatment7:"treatment_7",treatment8:"treatment_8",treatment9:"treatment_9",treatment10:"treatment_10",treatment11:"treatment_11",treatment12:"treatment_12",treatment13:"treatment_13",treatment14:"treatment_14"}},452295,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.isCompleteCreditAppLoadInfo=function(e){return Object.values(d.CreditProductIdentifiers).every(t=>t in e&&void 0!==e[t]&&e[t])},r.isHTMLIFrameElement=function(e){return null!=e&&"object"==typeof e&&"contentWindow"in e&&"src"in e},r.isLocation=function(e){return null!=e&&"object"==typeof e&&"search"in e&&"string"==typeof e.search},r.isPayPalWindow=function(e){return null!=e&&"object"==typeof e&&"postMessage"in e&&"function"==typeof e.postMessage};var d=e.r(360630)},575221,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){let{experiments:t,origin:r}=e,{longTerm:s,unified:c}=i.default[r],f=(null==t?void 0:t[u.default.gplLongTermBrandRefresh])===l.default.treatment1,p={[d.PayLaterCreditProductIdentifiers.PAY_LATER_LONG_TERM_US]:f?c:s},_={...Object.values(d.PayLaterCreditProductIdentifiers).reduce((e,t)=>({...e,[t]:c}),{}),...p,...n.default,...a.default};if(!(0,o.isCompleteCreditAppLoadInfo)(_))throw Error("CreditAppLoadInfo is incomplete, missing data for some CPIs");return _};var d=e.r(360630),i=s(e.r(745358)),n=s(e.r(280373)),a=s(e.r(598485)),u=s(e.r(108140)),l=s(e.r(234738)),o=e.r(452295);function s(e){return e&&e.__esModule?e:{default:e}}},346112,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){let{experiments:t,host:r}=e,d=Object.entries((0,i.default)({experiments:t,origin:"relative"})).reduce((e,t)=>{let[d,i]=t;return{...e,[d]:{...i,startUri:`https://${r}${i.startUri}`,assetBaseUri:`https://${r}${i.assetBaseUri}`}}},{});if(!(0,n.isCompleteCreditAppLoadInfo)(d))throw Error("CreditAppLoadInfo is incomplete, missing data for some CPIs");return d};var d,i=(d=e.r(575221))&&d.__esModule?d:{default:d},n=e.r(452295)},543861,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){let{experiments:t}=e,r=(0,d.resolveCreditAppOrigin)();switch(r){case d.CreditAppOrigins.relative:return(0,i.default)({experiments:t,origin:"relative"});case d.CreditAppOrigins.stage:{if((0,d.getCreditAppStageOverride)()===d.StageNames.msmaster)return(0,i.default)({experiments:t,origin:"production"});let e=(0,d.resolveCreditAppHost)(r);if(e)return(0,n.default)({experiments:t,host:e});return(0,i.default)({experiments:t,origin:"production"})}case d.CreditAppOrigins.host:{let e=(0,d.resolveCreditAppHost)(r);if(e)return(0,n.default)({experiments:t,host:e});return(0,i.default)({experiments:t,origin:"production"})}default:return(0,i.default)({experiments:t,origin:"production"})}};var d=e.r(360630),i=a(e.r(575221)),n=a(e.r(346112));function a(e){return e&&e.__esModule?e:{default:e}}},396032,(e,t,r)=>{"use strict";async function d(e){return new Promise(t=>{setTimeout(t,e)})}function i(e){return()=>e}function n(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1.5,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0;return d=>Math.min(e*t**d,r)}Object.defineProperty(r,"__esModule",{value:!0}),r.Intervals=void 0,r.default=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a.linear(100),r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return[...Array(r).keys()].reduce(async(r,i)=>{let n=await r,{success:a,totalWaited:u}=n;if(a)return n;if(await e())return{attempt:i,success:!0,totalWaited:u};let l=t(i);return await d(l),{attempt:i,success:!1,totalWaited:u+l}},Promise.resolve({attempt:0,success:!1,totalWaited:0}))},r.exponentialInterval=n,r.linearInterval=i;let a=r.Intervals={linear:i,exponential:n}},734345,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=l;var d=u(e.r(277455)),i=u(e.r(543861)),n=a(e.r(396032));function a(e,t){if("function"==typeof WeakMap)var r=new WeakMap,d=new WeakMap;return(a=function(e,t){if(!t&&e&&e.__esModule)return e;var i,n,a={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return a;if(i=t?d:r){if(i.has(e))return i.get(e);i.set(e,a)}for(let t in e)"default"!==t&&({}).hasOwnProperty.call(e,t)&&((n=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(n.get||n.set)?i(a,t,n):a[t]=e[t]);return a})(e,t)}function u(e){return e&&e.__esModule?e:{default:e}}async function l(e){let{creditProductIdentifier:t,creditAppProperties:r,experiments:a}=e,u=(0,i.default)({experiments:a})[t];if(!u)throw Error("Unsupported CPI value");let{startUri:l,type:o,assetBaseUri:s}=u,c=d.default[o];if(!c)throw Error(`No loader defined for app content type ${o}`);let f=[],p={assetBaseUri:s,content:void 0};if((await (0,n.default)(async()=>{try{return p=await c(l,s,r),!0}catch(e){return f.push(e),!1}},n.Intervals.linear(0),3)).success)return p;let _=f.map(e=>e.message).join(". ");throw Error(`One or more errors occurred while attempting to get the iframe content: ${_}`)}},384314,(e,t,r)=>{"use strict";function d(){if("DD_RUM"in window&&"object"==typeof window.DD_RUM)return window.DD_RUM}Object.defineProperty(r,"__esModule",{value:!0}),r.addError=r.addAction=void 0,r.addAction=(e,t)=>{var r,i;null==(i=d())||null==(r=i.addAction)||r.call(i,e,t)},r.addError=(e,t)=>{var r,i;null==(i=d())||null==(r=i.addError)||r.call(i,e,t)}},913292,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(){let[e,t]=(0,i.useState)(!1),[r,a]=(0,i.useState)((0,d.isWindowAvailable)()?document.body.style.overflow??"":""),u=(0,i.useCallback)(()=>{(0,d.isWindowAvailable)()&&(window.innerWidth<640?document.body.style.setProperty("overflow","hidden"):document.body.style.setProperty("overflow",r))},[r]);return{isOpen:e,setAppOpened:(0,i.useCallback)(()=>{(0,d.isWindowAvailable)()&&((0,n.addAction)("chai_app_opened"),a(document.body.style.overflow??""),u(),window.addEventListener("resize",u),t(!0))},[a]),setAppClosed:(0,i.useCallback)(()=>{(0,d.isWindowAvailable)()&&((0,n.addAction)("chai_app_closed"),document.body.style.setProperty("overflow",r),a(null),window.removeEventListener("resize",u),t(!1))},[a])}};var d=e.r(360630),i=e.r(15010),n=e.r(384314)},147330,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){return{payload:e,type:i.default.resetCreditProductIframe}};var d,i=(d=e.r(481644))&&d.__esModule?d:{default:d}},952740,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,t,r,d){let{dispatch:l,logger:o}=(0,a.useCreditAppContext)();(0,i.useEffect)(()=>{var i;if(!r||!(null==(i=e.current)?void 0:i.contentWindow))return;(0,u.addAction)("chai_iframe_unload_listener_attached",{"credit.credit_product_identifier":t});let a=()=>{if(d.current){d.current=!1,null==o||o.debug(`[${t}] Redirect signal respected — skipping reset`),(0,u.addAction)("chai_iframe_redirect_signal_respected",{"credit.credit_product_identifier":t});return}null==o||o.debug(`[${t}] Iframe unload detected - triggering reset`),(0,u.addAction)("chai_iframe_unload_detected",{"credit.credit_product_identifier":t}),l((0,n.default)(t))},s=e.current.contentWindow;return s.addEventListener("beforeunload",a),()=>{s.removeEventListener("beforeunload",a),d.current&&(d.current=!1)}},[r,e.current,t,l,o])};var d,i=e.r(15010),n=(d=e.r(147330))&&d.__esModule?d:{default:d},a=e.r(117317),u=e.r(384314)},403033,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){return{payload:e,type:i.default.assignState}};var d,i=(d=e.r(481644))&&d.__esModule?d:{default:d}},94200,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){return{payload:e,type:i.default.clearLaunchCreditProduct}};var d,i=(d=e.r(481644))&&d.__esModule?d:{default:d}},232250,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){let{dispatch:t,logger:r,onAppEnded:s,state:c}=(0,l.useCreditAppContext)();return(0,i.useCallback)(i=>{var l,f,p;let{status:_,customerInteractions:v,atomicEventState:P,creditProductIdentifier:m,euat:g}=i,A=`[${e} iframe]`,y=m??e;null==r||r.debug(`${A} Integration: Credit App Ended with status ${_}`);let b=null==(l=c.productStates)?void 0:l[y],C=null==b?void 0:b.creditFlowIdentifier,h=null==b?void 0:b.creditFlowContext;(0,o.addAction)("chai_on_app_ended_called",{"credit.credit_product_identifier":m,"credit.status":_});let I=()=>{if(!s){null==r||r.error(`${A} Integration: Attempting to end the app but the onAppEnded handler is missing`),(0,o.addError)(Error("Integration: Attempting to end the app but the onAppEnded handler is missing"));return}s({...i,creditFlowIdentifier:C,creditProductIdentifier:y,euat:g})};if(_===d.CreditAppEndStatuses.authError){null==r||r.debug(`${A} Integration: Skipped clearing of launchCreditProductIdentifier so Credit App will relaunch after exiting`),I();return}if(_===d.CreditAppEndStatuses.transition&&i.transitionData){null==r||r.debug(`${A} Integration: Performing transition from ${null==(f=i.transitionData)?void 0:f.from.creditProductIdentifier} to ${null==(p=i.transitionData)?void 0:p.to.creditProductIdentifier}`,i);let{from:e,to:d}=i.transitionData;(0,o.addAction)("chai_credit_product_transition",{"credit.from.credit_product_identifier":e.creditProductIdentifier,"credit.to.credit_product_identifier":d.creditProductIdentifier}),t((0,n.default)({creditProductIdentifier:d.creditProductIdentifier,launchCreditProductIdentifier:d.creditProductIdentifier,selectedOfferId:d.offerId,productStates:{[e.creditProductIdentifier]:{mostRecentCreditAppEndStatus:e.appEndStatus},[d.creditProductIdentifier]:{offerId:d.offerId,creditFlowContext:h,creditFlowIdentifier:d.creditFlowIdentifier,offerData:d.offerData}},launchCustomerInteractions:v,launchAtomicEventState:P})),I();return}t((0,u.default)({creditProductIdentifier:y,mostRecentCreditAppEndStatus:_})),t((0,a.default)(e)),I()},[e,t,r,s,c])};var d=e.r(360630),i=e.r(15010),n=s(e.r(403033)),a=s(e.r(94200)),u=s(e.r(787651)),l=e.r(117317),o=e.r(384314);function s(e){return e&&e.__esModule?e:{default:e}}},671511,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,r.default={action:"action",auto:"auto"}},714627,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){let{dispatch:t,logger:r,onAppError:s,state:c}=(0,a.useCreditAppContext)(),{launchCreditProductIdentifier:f,launchType:p}=c;return(0,d.useCallback)(d=>{null==r||r.error(d),null==r||r.debug(`[${e} iframe] Integration: Credit App Errored with error: ${null==d?void 0:d.message}`),(0,o.addAction)("chai_on_app_error_called",{"credit.credit_product_identifier":e,"credit.launch_type":p,"error.message":d.message}),(0,o.addError)(d,{"credit.credit_product_identifier":e,"credit.launch_type":p}),t((0,n.default)({processingStatus:l.default.failure,creditProductIdentifier:e})),p!==u.default.auto&&t((0,i.default)(e)),null==s||s({creditProductIdentifier:e,error:d,launchCreditProductIdentifier:f})},[e,t,f,p,r,s])};var d=e.r(15010),i=s(e.r(94200)),n=s(e.r(787651)),a=e.r(117317),u=s(e.r(671511)),l=s(e.r(50603)),o=e.r(384314);function s(e){return e&&e.__esModule?e:{default:e}}},260890,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){let{dispatch:t,logger:r}=(0,n.useCreditAppContext)();return(0,d.useCallback)(()=>{null==r||r.debug(`[${e} iframe] Integration: Credit App Loaded`),(0,u.addAction)("chai_on_app_loaded_called",{"credit.credit_product_identifier":e}),t((0,i.default)({processingStatus:a.default.success,creditProductIdentifier:e}))},[e,t,r])};var d=e.r(15010),i=l(e.r(787651)),n=e.r(117317),a=l(e.r(50603)),u=e.r(384314);function l(e){return e&&e.__esModule?e:{default:e}}},508249,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,t){let{dispatch:r,logger:l}=(0,n.useCreditAppContext)();return(0,d.useCallback)(()=>{t.current=!0,null==l||l.debug(`[${e} iframe] Integration: Credit App Redirect Signaled`),(0,u.addAction)("chai_on_app_redirect_called",{"credit.credit_product_identifier":e}),r((0,i.default)({processingStatus:a.default.awaitingRedirect,creditProductIdentifier:e}))},[e,r,l,t])};var d=e.r(15010),i=l(e.r(787651)),n=e.r(117317),a=l(e.r(50603)),u=e.r(384314);function l(e){return e&&e.__esModule?e:{default:e}}},672010,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,t){let{productStates:r}=e;return t&&(null==r?void 0:r[t])}},432652,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,t,r){var a,u,l;let{landingUrl:o,processingStatus:s}=(0,n.default)(e,t)??{},c=null==(a=r.current)?void 0:a.contentWindow;if(!(0,i.isPayPalWindow)(c))return!1;let{landingUrl:f}=(null==(l=c.PAYPAL)||null==(u=l.checkout)?void 0:u.properties)??{};return f!==o&&s===d.default.success};var d=a(e.r(50603)),i=e.r(452295),n=a(e.r(672010));function a(e){return e&&e.__esModule?e:{default:e}}},366583,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,t){let{launchCreditProductIdentifier:r}=e;return!!t&&t===r}},266810,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){let{country:t,locale:r,nonce:d,token:i}=e;return!!t&&!!r&&!!d&&!!i}},547312,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,t){let r=(0,i.default)(e),a=(0,n.default)(e,t),u=(null==a?void 0:a.processingStatus)===d.default.processing;return r&&u};var d=a(e.r(50603)),i=a(e.r(266810)),n=a(e.r(672010));function a(e){return e&&e.__esModule?e:{default:e}}},203896,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,t,r){var a,u,l;let{offerId:o,processingStatus:s}=(0,n.default)(e,t)??{},c=null==(a=r.current)?void 0:a.contentWindow;if(!(0,i.isPayPalWindow)(c))return!1;let{selectedOfferId:f}=(null==(l=c.PAYPAL)||null==(u=l.checkout)?void 0:u.properties)??{};return!!f&&!!o&&f!==o&&s===d.default.success};var d=a(e.r(50603)),i=e.r(452295),n=a(e.r(672010));function a(e){return e&&e.__esModule?e:{default:e}}},322825,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,t){let r=(0,d.default)(e),n=(0,i.default)(e,t),a=t===e.creditProductIdentifier,{processingStatus:u}=n??{};return r&&a&&!u};var d=n(e.r(266810)),i=n(e.r(672010));function n(e){return e&&e.__esModule?e:{default:e}}},232671,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,t){let r=(0,n.default)(e),u=(0,i.default)(e,t),l=(0,a.default)(e,t),o=(null==l?void 0:l.processingStatus)===d.default.success;return r&&u&&o};var d=u(e.r(50603)),i=u(e.r(366583)),n=u(e.r(266810)),a=u(e.r(672010));function u(e){return e&&e.__esModule?e:{default:e}}},788480,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,t,r){let a=(0,i.default)(e),u=(0,n.default)(e,t);return(null==u?void 0:u.processingStatus)!==d.default.resetting&&a&&!!(null==u?void 0:u.processingStatus)&&!!r};var d=a(e.r(50603)),i=a(e.r(266810)),n=a(e.r(672010));function a(e){return e&&e.__esModule?e:{default:e}}},32416,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.CreditAppDecisionedStatuses=void 0,r.default=function(e,t){var r;let{mostRecentCreditAppEndStatus:d,creditFlowIdentifier:u,creditFlowContext:l}=(0,n.default)(e,t)??{};return!(!d||u||(null==l||null==(r=l.attributes)?void 0:r.includes(i.CreditFlowAttributes.experienceLegacy)))&&a.has(d)};var d,i=e.r(360630),n=(d=e.r(672010))&&d.__esModule?d:{default:d};let a=r.CreditAppDecisionedStatuses=new Set([i.CreditAppEndStatuses.approved,i.CreditAppEndStatuses.declined])},949425,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,t){let r=(0,n.default)(e),u=(0,a.default)(e,t),l=(0,i.default)(e,t),o=(null==u?void 0:u.processingStatus)===d.default.idle;return!l&&r&&o};var d=u(e.r(50603)),i=u(e.r(32416)),n=u(e.r(266810)),a=u(e.r(672010));function u(e){return e&&e.__esModule?e:{default:e}}},117099,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=n;var d=i(e.r(15010));function i(e,t){if("function"==typeof WeakMap)var r=new WeakMap,d=new WeakMap;return(i=function(e,t){if(!t&&e&&e.__esModule)return e;var i,n,a={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return a;if(i=t?d:r){if(i.has(e))return i.get(e);i.set(e,a)}for(let t in e)"default"!==t&&({}).hasOwnProperty.call(e,t)&&((n=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(n.get||n.set)?i(a,t,n):a[t]=e[t]);return a})(e,t)}function n(e){let{iframeRef:t,initialContent:r="<!DOCTYPE html><html><head></head><body></body></html>",isOpen:i=!0,onBundleLoad:n,onError:a,onLoad:u,style:l,title:o,className:s,"data-testid":c}=e;(0,d.useEffect)(()=>{var e,d,i;let n=(null==(e=t.current)?void 0:e.contentDocument)||((null==(i=t.current)||null==(d=i.contentWindow)?void 0:d.document)??null);n?(n.open(),n.write(r),n.close()):a("iframe window not found onMount")},[r]);let f=s?{display:i?"block":"none"}:{border:0,height:"100%",left:0,position:"fixed",top:0,width:"100%",zIndex:999,...l,display:i?"block":"none"};return d.default.createElement("iframe",{ref:t,title:o,onLoad:e=>{var r;let d=null==(r=t.current)?void 0:r.contentWindow;d?(n&&d.PAYPAL&&n(e),null==u||u(e)):a("iframe window not found onIframeLoad")},onError:e=>a(`iframe load error: ${e.type}`),style:f,className:s,"data-testid":c})}n.displayName="PortableIframeIntegration"},42179,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var d=e.r(360630),i=L(e.r(15010)),n=j(e.r(787651)),a=j(e.r(466955)),u=j(e.r(551445)),l=j(e.r(50603)),o=j(e.r(734345)),s=j(e.r(913292)),c=j(e.r(952740)),f=j(e.r(232250)),p=j(e.r(714627)),_=j(e.r(260890)),v=j(e.r(508249)),P=j(e.r(432652)),m=j(e.r(366583)),g=j(e.r(547312)),A=j(e.r(203896)),y=j(e.r(322825)),b=j(e.r(232671)),C=j(e.r(788480)),h=j(e.r(949425)),I=e.r(384314),M=j(e.r(543861)),O=L(e.r(396032)),E=e.r(117317),w=j(e.r(117099));function j(e){return e&&e.__esModule?e:{default:e}}function L(e,t){if("function"==typeof WeakMap)var r=new WeakMap,d=new WeakMap;return(L=function(e,t){if(!t&&e&&e.__esModule)return e;var i,n,a={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return a;if(i=t?d:r){if(i.has(e))return i.get(e);i.set(e,a)}for(let t in e)"default"!==t&&({}).hasOwnProperty.call(e,t)&&((n=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(n.get||n.set)?i(a,t,n):a[t]=e[t]);return a})(e,t)}function S(e){var t,r;let{creditProductIdentifier:j,className:L,...S}=e,R=(0,i.useRef)(!1),T=(0,f.default)(j),k=(0,p.default)(j),D=(0,_.default)(j),N=(0,v.default)(j,R),$=(0,i.useRef)(null),U=(0,E.useCreditAppContext)(),[x,Y]=(0,i.useState)(),[W,B]=(0,i.useState)(),[G,F]=(0,i.useState)(u.default.idle),{isOpen:z,setAppOpened:H,setAppClosed:q}=(0,s.default)(),{dispatch:J,state:K}=U,{country:V,euat:Q,experiments:Z,flow:X,locale:ee,merchantName:et,nonce:er,token:ed,productStates:ei}=K,{assetBaseUri:en}=(0,i.useMemo)(()=>(0,M.default)({experiments:Z}),[Z])[j],ea=null==ei?void 0:ei[j];(0,c.default)($,j,G!==u.default.idle&&(null==ea?void 0:ea.processingStatus)!==l.default.awaitingRedirect,R);let{creditFlowContext:eu,creditFlowIdentifier:el,landingUrl:eo,offerData:es,offerId:ec,productOfferEvaluationId:ef,selectedFundingInstrumentId:ep,transactionAmount:e_}=ea??{},ev={baseUri:en,country:V,creditFlowContext:eu,creditFlowIdentifier:el,creditProductIdentifier:j,euat:Q,flow:X,landingUrl:eo,locale:ee,merchantName:et,nonce:er,selectedFundingInstrumentId:ep,selectedOfferData:es,selectedOfferId:ec,selectedProductOfferEvaluationId:ef,token:ed,transactionAmount:e_},eP=(0,i.useMemo)(()=>ev,Object.values(ev)),em=`[${j} iframe]`,eg=U.logger||console,eA=null==(t=$.current)?void 0:t.contentWindow,{onAppLaunchRequested:ey,onAppLaunchRequestCanceled:eb}=(null==eA||null==(r=eA.PAYPAL)?void 0:r.creditApp)??{},eC=(0,y.default)(K,j),eh=(0,h.default)(K,j),eI=(0,C.default)(K,j,W),eM=(0,g.default)(K,j),eO=(0,m.default)(K,j),eE=(0,b.default)(K,j),ew=(0,A.default)(K,j,$),ej=(0,P.default)(K,j,$),eL=(0,i.useCallback)(e=>{eg.debug(`${em} Integration: preload status updated to ${e}`),(0,I.addAction)(`chai_internal_preload_status_${e}`,{"credit.chai_preload_status":e}),F(e)},[eg,F]),eS=(0,i.useCallback)(e=>{var t,r;if(!$.current||!H)throw Error("Attempted to call launchCreditApp before mounting the node returned from useCreditApp");let d=$.current.contentDocument,{onAppLaunched:i}=(null==eA||null==(t=eA.PAYPAL)?void 0:t.creditApp)??{};null==(r=d.body)||r.removeAttribute("inert"),H(),null==i||i(e)},[$.current,H]),eR=(0,i.useCallback)(e=>e.endBehavior?e.endBehavior:K.endBehavior??d.CreditAppEndBehaviors.close,[K]),eT=(0,i.useCallback)(e=>{var t,r;null==(r=(null==(t=$.current)?void 0:t.contentDocument).body)||r.setAttribute("inert",""),eR(e)===d.CreditAppEndBehaviors.keepOpen||q(),T(e)},[T,q]);(0,i.useEffect)(()=>{var e,t,r;let d=null==(r=$.current)||null==(t=r.contentWindow)||null==(e=t.PAYPAL)?void 0:e.checkout;d&&(d.signalAppEnded=eT,d.signalAppRedirect=N)},[$.current,eT,N]);let ek=(0,i.useCallback)(e=>{eL(u.default.iframeErrored),k(Error(e))},[k,eL]),eD=(0,i.useCallback)(()=>{if(!$.current)throw Error("Attempted to call setupCreditAppInterface before the iframe is mounted");let{PAYPAL:e}=eA??{};if(!e)throw Error("window.PAYPAL has not been defined in the iframe app");if(!eP.baseUri||!eP.country||!eP.locale||!eP.nonce||!eP.token)throw Error("Required properties are missing from window.PAYPAL.checkout.properties");e.checkout={signalAppEnded:eT,signalAppLoaded:D,signalAppRedirect:N,rootElementId:a.default.root,properties:eP,experiments:Z??{}}},[eP,$.current,eT,D,N]),eN=(0,i.useCallback)(async()=>{var e,t;if(!$.current)throw Error("Attempted to call initializeCreditApp before the iframe is mounted");let r=$.current.contentDocument;await (0,O.default)(async()=>{var e,t;return!!(null==eA||null==(t=eA.PAYPAL)||null==(e=t.creditApp)?void 0:e.initializeApp)},O.Intervals.linear(100),10);let{initializeApp:d}=(null==eA||null==(e=eA.PAYPAL)?void 0:e.creditApp)??{};if(!d)throw Error("There is no `initializeApp` function defined on window.PAYPAL.creditApp in the iframe app");eD(),await d(),null==(t=r.body)||t.setAttribute("inert",""),eL(u.default.appInitializeCompleted)},[$.current,eg,eD,eL]),e$=(0,i.useCallback)(async()=>{eg.debug(`${em} Integration: loading static app resources`);let{content:e}=await (0,o.default)({creditProductIdentifier:j,creditAppProperties:eP,experiments:Z});B(e),eL(u.default.staticResourcesLoaded)},[j,eP,eg,B,eL]),eU=(0,i.useCallback)(()=>{eg.debug(`${em} Integration: iframe loaded`),eL(u.default.iframeLoaded)},[W,eg,eL]),ex=(0,i.useCallback)(async()=>{try{await e$()}catch(e){eL(u.default.staticResourcesErrored),null==k||k(e)}},[e$,k,eL]);(0,i.useEffect)(()=>{eC&&(eg.debug(`${em} Integration: initiating preload`),J((0,n.default)({processingStatus:l.default.idle,creditProductIdentifier:j})))},[j,J,eC]),(0,i.useEffect)(()=>{eh&&G!==u.default.iframeCleared&&(eg.debug(`${em} Integration: clearing the iframe`),B(void 0),eL(u.default.iframeCleared))},[j,eh,G]),(0,i.useEffect)(()=>{eh&&G===u.default.iframeCleared&&(eg.debug(`${em} Integration: loading credit app`),J((0,n.default)({processingStatus:l.default.processing,creditProductIdentifier:j})),ex())},[J,eh,ex,G]),(0,i.useEffect)(()=>{ew&&(eg.debug(`${em} Integration: re-loading credit app with new offer`),J((0,n.default)({processingStatus:l.default.idle,creditProductIdentifier:j})))},[j,J,ew]),(0,i.useEffect)(()=>{ej&&(eg.debug(`${em} Integration: re-loading credit app with new offer`),J((0,n.default)({processingStatus:l.default.idle,creditProductIdentifier:j})))},[j,J,ej]),(0,i.useEffect)(()=>{let e=async()=>{try{eL(u.default.appInitializing),await eN()}catch(e){eL(u.default.appInitializeErrored),k(e)}};eM&&G===u.default.iframeLoaded&&(eg.debug(`${em} Integration: initializing credit app`),e())},[eN,eM,k,G]),(0,i.useEffect)(()=>{ey&&eO&&(eg.debug(`${em} Integration: signaling to credit app that launch is requested`),Y(!0),null==ey||ey())},[ey,eO]),(0,i.useEffect)(()=>{eb&&x&&!eO&&(eg.debug(`${em} Integration: signaling to credit app that launch request is canceled`),eb(),Y(!1))},[x,eb,eO]),(0,i.useEffect)(()=>{eE&&(eg.debug(`${em} Integration: launching credit app`),Y(!1),eS({customerInteractions:K.launchCustomerInteractions??[],atomicEventState:K.launchAtomicEventState}))},[eE,eS]),(0,i.useEffect)(()=>{(null==ea?void 0:ea.processingStatus)===l.default.resetting&&G!==u.default.idle&&(null==eg||eg.debug(`[${j}] Iframe unload detected - triggering reset`),(0,I.addAction)("chai_clearing_iframe_and_auto_launch",{"credit.processing_status":null==ea?void 0:ea.processingStatus,"credit.preload_status":G}),B(void 0),eL(u.default.idle),q())},[j,null==ea?void 0:ea.processingStatus,G,q,eL]);let eY=S["data-testid"]??a.default.defaultIframeTestId;return eI?i.default.createElement("div",{"data-testid":`${eY}-container`,style:{display:z?"block":"none"},"aria-hidden":!z},i.default.createElement(w.default,{iframeRef:$,onError:ek,initialContent:W,onLoad:eU,isOpen:z,title:"CAP",style:{position:"absolute"},"data-testid":eY,className:L})):null}S.displayName="CreditAppIframe",r.default=S},64365,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=l;var d=e.r(360630),i=u(e.r(15010)),n=e.r(117317),a=u(e.r(42179));function u(e){return e&&e.__esModule?e:{default:e}}function l(e){let{className:t}=e,{state:r}=(0,n.useCreditAppContext)(),{country:u,locale:l,nonce:o,token:s}=r;return u&&l&&o&&s?i.default.createElement(i.default.Fragment,null,Object.values(d.CreditProductIdentifiers).map(e=>i.default.createElement(a.default,{key:`iframeWrapper_${e}`,creditProductIdentifier:e,"data-testid":`credit-app-${e}`,className:t}))):null}l.displayName="CreditAppLauncher"},581735,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){let{launchCustomerInteractions:t,launchAtomicEventState:r,nonce:d,...i}=e;return i}},10149,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){return`PAYPAL.creditAppIntegration.${e}`}},779498,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){let t;if(!(0,d.isWindowAvailable)())return!1;try{if(!(t=e in window&&window[e]))return!1;let r="__storage_test__";return t.setItem(r,r),t.removeItem(r),!0}catch(e){if(!window.DOMException)return!1;return e instanceof window.DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&t&&0!==t.length||!1}};var d=e.r(360630)},720266,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){let{token:t}=e,r=(0,n.default)("sessionStorage");if(!t||!r)return;let a=(0,d.default)(e);sessionStorage.setItem((0,i.default)(t),JSON.stringify(a))};var d=a(e.r(581735)),i=a(e.r(10149)),n=a(e.r(779498));function a(e){return e&&e.__esModule?e:{default:e}}},285423,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={...i(),...e.productStates};return{...e,productStates:t}},r.defaultProductStates=i;var d=e.r(360630);function i(){return Object.fromEntries(Object.values(d.CreditProductIdentifiers).map(e=>[e,void 0]))}},542384,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){let t=(0,i.default)(),r=(0,a.default)("sessionStorage");if(!e||!r)return t;let u=sessionStorage.getItem((0,n.default)(e)),{creditProductIdentifier:l,launchCreditProductIdentifier:o,launchType:s,...c}=u?JSON.parse(u):{},f=l&&l===o?{creditProductIdentifier:l,launchCreditProductIdentifier:o,launchType:d.default.auto}:{},p={...t,...c,...f},{productStates:_}=t,{productStates:v}=p,P=v?Object.entries(v).reduce((e,t)=>{let[r,d]=t;return{...e,[r]:{...d,processingStatus:void 0}}},{}):_;return{...p,productStates:P}};var d=u(e.r(671511)),i=u(e.r(285423)),n=u(e.r(10149)),a=u(e.r(779498));function u(e){return e&&e.__esModule?e:{default:e}}},283596,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,t){let r=t.token&&e.token!==t.token,{nonce:d}=e;return{...r?(0,i.default)(t.token):e,nonce:d,...t}};var d,i=(d=e.r(542384))&&d.__esModule?d:{default:d}},118013,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,t){let{launchCreditProductIdentifier:r}=e;return t!==r?e:{...e,launchCreditProductIdentifier:void 0}}},522879,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,t){let{creditFlowContext:r,creditFlowIdentifier:d,landingUrl:n,offerId:a,offerData:u,productOfferEvaluationId:l,selectedFundingInstrumentId:o,transactionAmount:s}=e,{creditFlowContext:c,creditFlowIdentifier:f,landingUrl:p,offerId:_,offerData:v,productOfferEvaluationId:P,selectedFundingInstrumentId:m,transactionAmount:g}=t;return(0,i.default)(r,c)&&d===f&&n===p&&(0,i.default)(u,v)&&a===_&&l===P&&o===m&&(0,i.default)(s,g)};var d,i=(d=e.r(629801))&&d.__esModule?d:{default:d}},854034,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,t){let{productStates:r}=e,{creditProductIdentifier:d,...i}=t;return{...e,productStates:{...r,[d]:{...null==r?void 0:r[d],...i}}}}},991541,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,t){let{productStates:r}=e,{creditProductIdentifier:a,...u}=t,l=(null==r?void 0:r[a])??{},{processingStatus:o}=l,s=o===d.default.failure,c=(0,i.default)(u,l);return!s&&c&&o?e:(0,n.default)(e,{creditProductIdentifier:a,...null==r?void 0:r[a],...u,processingStatus:d.default.idle})};var d=a(e.r(50603)),i=a(e.r(522879)),n=a(e.r(854034));function a(e){return e&&e.__esModule?e:{default:e}}},132484,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,t){let{productStates:r}=e,d=null==r?void 0:r[t];return d?{...e,productStates:{...r,[t]:{...d,processingStatus:i.default.resetting}}}:e};var d,i=(d=e.r(50603))&&d.__esModule?d:{default:d}},962096,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var d=o(e.r(481644)),i=o(e.r(283596)),n=o(e.r(118013)),a=o(e.r(991541)),u=o(e.r(132484)),l=o(e.r(854034));function o(e){return e&&e.__esModule?e:{default:e}}r.default={[d.default.assignState]:i.default,[d.default.clearLaunchCreditProduct]:n.default,[d.default.preloadCreditProduct]:a.default,[d.default.updateProductState]:l.default,[d.default.resetCreditProductIframe]:u.default}},488379,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,t){let{payload:r,type:n}=t,a=(0,i.default[n])(e,r);return(0,d.default)(a),a};var d=n(e.r(720266)),i=n(e.r(962096));function n(e){return e&&e.__esModule?e:{default:e}}},839974,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=c;var d=l(e.r(15010)),i=u(e.r(488379)),n=u(e.r(283596)),a=u(e.r(720266));function u(e){return e&&e.__esModule?e:{default:e}}function l(e,t){if("function"==typeof WeakMap)var r=new WeakMap,d=new WeakMap;return(l=function(e,t){if(!t&&e&&e.__esModule)return e;var i,n,a={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return a;if(i=t?d:r){if(i.has(e))return i.get(e);i.set(e,a)}for(let t in e)"default"!==t&&({}).hasOwnProperty.call(e,t)&&((n=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(n.get||n.set)?i(a,t,n):a[t]=e[t]);return a})(e,t)}let{Provider:o}=e.r(117317).CreditAppContext;function s(e){let t=(0,n.default)({},e);return(0,a.default)(t),t}function c(e){let{children:t,config:r,onAppEnded:n,onAppError:a}=e,u=console,[l,c]=(0,d.useReducer)(i.default,{...r},s);return d.default.createElement(o,{value:{dispatch:c,logger:u,onAppEnded:n,onAppError:a,state:l}},t)}c.displayName="CreditAppContextProvider"},785527,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,r.default={success:"success",failure:"failure"}},305784,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(){let{dispatch:e,logger:t,state:r}=(0,a.useCreditAppContext)(),{creditProductIdentifier:s,launchCreditProductIdentifier:c,productStates:f}=r,p=`[${s} iframe]`;return(0,d.useCallback)(r=>{var d,a;let{customerInteractions:c,atomicEventState:_,creditProductIdentifier:v}=r??{},P=v??s;null==t||t.debug(`${p} Integration: launch CPI set to ${P}`),e((0,i.default)({creditProductIdentifier:P,launchCreditProductIdentifier:P,launchCustomerInteractions:c,launchAtomicEventState:_,launchType:u.default.action}));let m=P&&(null==f||null==(d=f[P])?void 0:d.processingStatus)===l.default.failure,g=P&&(null==f||null==(a=f[P])?void 0:a.processingStatus)===l.default.resetting;m&&(null==t||t.debug(`${p} Integration: retrying failed launch`),(0,o.addAction)("chai_retrying_after_failed_launch",{"credit.credit_product_identifier":P}),e((0,n.default)({creditProductIdentifier:P,processingStatus:l.default.idle}))),g&&((0,o.addAction)("chai_relaunching_after_reset",{"credit.credit_product_identifier":P}),e((0,n.default)({creditProductIdentifier:P,processingStatus:l.default.idle})))},[s,e,c,t,f])};var d=e.r(15010),i=s(e.r(403033)),n=s(e.r(787651)),a=e.r(117317),u=s(e.r(671511)),l=s(e.r(50603)),o=e.r(384314);function s(e){return e&&e.__esModule?e:{default:e}}},765862,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){return{payload:e,type:i.default.preloadCreditProduct}};var d,i=(d=e.r(481644))&&d.__esModule?d:{default:d}},478816,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(){let{dispatch:e,logger:t}=(0,a.useCreditAppContext)();return(0,d.useCallback)(r=>{let{creditFlowContext:d,creditFlowIdentifier:a,creditProductIdentifier:u,landingUrl:l,selectedFundingInstrumentId:o,selectedOfferData:s,selectedOfferId:c,selectedProductOfferEvaluationId:f,transactionAmount:p}=r;null==t||t.debug(`Integration: Selected Offer ${c}, CPI: ${u}, CFI: ${a}`),e((0,i.default)({creditProductIdentifier:u,launchCreditProductIdentifier:void 0,selectedOfferData:s,selectedOfferId:c})),void 0!==u&&e((0,n.default)({creditFlowContext:d,creditFlowIdentifier:a,landingUrl:l,offerData:s,offerId:c,productOfferEvaluationId:f,selectedFundingInstrumentId:o,transactionAmount:p,creditProductIdentifier:u}))},[e,t])};var d=e.r(15010),i=u(e.r(403033)),n=u(e.r(765862)),a=e.r(117317);function u(e){return e&&e.__esModule?e:{default:e}}},193765,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(){let e=(0,u.default)(),t=(0,a.default)(),[r,l]=(0,d.useState)();return(0,d.useEffect)(()=>{if(!r)return;let{supplyLaunchArguments:e}=r;t(null==e?void 0:e()),l(void 0)},[r]),(0,d.useCallback)(async t=>{let{creditProductIdentifier:r,offerId:d,offerData:a,creditFlowIdentifier:u}=t,{termLink:o}=a;return(0,n.addAction)("chai_launch_terms_called",{"credit.credit_product_identifier":r,"credit.landing_url":o,"credit.offer.id":d,"credit.flow_identifier":u}),e({creditProductIdentifier:r,landingUrl:o,selectedOfferId:d,selectedOfferData:a,creditFlowIdentifier:u}),l(t),{status:i.default.success}},[t,e])};var d=e.r(15010),i=l(e.r(785527)),n=e.r(384314),a=l(e.r(305784)),u=l(e.r(478816));function l(e){return e&&e.__esModule?e:{default:e}}},320336,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,t){return(null==t?void 0:t.constructor.name)!=="Error"?t:{name:t.name,message:t.message,stack:t.stack,cause:t.cause}}},594592,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,t){return new Promise((r,i)=>{if(!(0,d.isWindowAvailable)())return void i(Error("No document exists to attach script element to."));let n=document.createElement("script");n.src=e,n.nonce=t,n.addEventListener("load",()=>{n.remove(),r()}),n.addEventListener("error",e=>{let t=Error("Script failed to load",{cause:e});n.remove(),i(t)}),document.body.append(n)})};var d=e.r(360630)},799048,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(){if((0,d.isWindowAvailable)())return window};var d=e.r(360630)},118202,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(){let{dispatch:e,logger:t,state:r}=(0,a.useCreditAppContext)();return(0,d.useCallback)(d=>{let{clearPendingLaunch:a=!0,creditFlowContext:o,creditFlowIdentifier:s,creditProductIdentifier:c,landingUrl:f,offerId:p,offerData:_,productOfferEvaluationId:v,reload:P,selectedFundingInstrumentId:m,transactionAmount:g}=d;null==t||t.debug(`[${c} iframe] Integration: preloading credit app with CPI: ${c}, CFI: ${s}, Reload(forced): ${P}, ClearPendingLaunch: ${a}`),(0,l.addAction)("chai_credit_product_preload",{"credit.clear_pending_launch":a,"credit.credit_product_identifier":c,"credit.flow_identifier":s,"credit.flow_context.attributes":null==o?void 0:o.attributes,"credit.flow_context.channel":null==o?void 0:o.channel,"credit.flow_context.flow_specifier":null==o?void 0:o.flowSpecifier,"credit.flow_context.outcome":null==o?void 0:o.outcome,"credit.offer.id":p,"credit.landing_url":f,"credit.offer.evaluation_id":v,"credit.reload":P,"transaction.amount.value":g}),a&&r.launchCreditProductIdentifier&&e((0,i.default)(r.launchCreditProductIdentifier)),e((0,n.default)({creditFlowContext:o,creditFlowIdentifier:s,landingUrl:f,offerData:_,offerId:p,productOfferEvaluationId:v,selectedFundingInstrumentId:m,transactionAmount:g,...P?{processingStatus:u.default.idle}:{},creditProductIdentifier:c}))},[e,t,r])};var d=e.r(15010),i=o(e.r(94200)),n=o(e.r(765862)),a=e.r(117317),u=o(e.r(50603)),l=e.r(384314);function o(e){return e&&e.__esModule?e:{default:e}}},554204,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(){let e=(0,f.default)(),t=(0,c.default)(),r=(0,p.default)(),{logger:_,state:{nonce:v,token:P}}=(0,n.useCreditAppContext)(),[m,g]=(0,i.useState)();return(0,i.useEffect)(()=>{if(!m)return;let{creditProductIdentifier:e,modalOptions:r,supplyLaunchArguments:d}=m,{onLaunched:i}=r??{};t(null==d?void 0:d()),null==i||i({creditProductIdentifier:e}),g(void 0)},[m]),(0,i.useCallback)(async t=>{var i,n,c,f,p;let{creditProductIdentifier:m,modalOptions:A,offerData:y,offerId:b}=t,{cartTotal:C,encryptedAccountNumber:h,onCancel:I,onError:M,onOpened:O}=A??{},{learnMoreModalScript:E,merchantId:w}=y;if(e({creditProductIdentifier:m,offerId:b,offerData:y}),!v){let e=Error(`[${m} terms] Integration: loading the terms modal script requires a nonce`);return null==_||_.error(e.message),(0,u.addError)(e,{"credit.credit_product_identifier":m}),{status:a.default.failure}}if(!E){let e=Error(`[${m} terms] Integration: loading the terms modal script requires the script URL`);return null==_||_.error(e.message),(0,u.addError)(e,{"credit.credit_product_identifier":m}),{status:a.default.failure}}try{await (0,o.default)(E,v)}catch(e){return null==_||_.error(`[${m} terms] Integration: unable to load terms modal due to error: ${JSON.stringify(e,l.default,2)}`),(0,u.addError)(e,{"credit.credit_product_identifier":m}),{status:a.default.failure}}if(!(null==(n=(0,s.default)())||null==(i=n.paypal)?void 0:i.MessagesModal)){let e=Error(`[${m} terms] Integration: terms modal script loaded, but the modal object is not present in the document`);return null==_||_.error(e.message),(0,u.addError)(e,{"credit.credit_product_identifier":m}),{status:a.default.failure}}let j={account:w,amount:C,channel:d.ModalChannels.checkout,cspNonce:v,customerId:h,ecToken:P,features:d.ModalFeatures.origamiCheckout,offer:Object.values(d.PayLaterShortTermCreditProductIdentifiers).includes(m)?"PAY_LATER_SHORT_TERM":Object.values(d.PayLaterLongTermCreditProductIdentifiers).includes(m)?"PAY_LATER_LONG_TERM":void 0,onClose:e=>{let{linkName:i}=e,n=[d.ModalLinkNames.shortTermContinue,d.ModalLinkNames.longTermContinue],a=[d.ModalLinkNames.closeButton,d.ModalLinkNames.preRenderClose];if(n.includes(i)){r({creditProductIdentifier:m,selectedOfferId:b}),g(t);return}a.includes(i)&&(null==I||I({creditProductIdentifier:m}))},onError:e=>{null==M||M({creditProductIdentifier:m,error:e})},onShow:()=>{null==O||O({creditProductIdentifier:m})}},L=null==(p=(0,s.default)())||null==(f=p.paypal)||null==(c=f.MessagesModal)?void 0:c.call(f,j);return null==L||L.show(),{status:a.default.success}},[t,v,r,P])};var d=e.r(360630),i=e.r(15010),n=e.r(117317),a=_(e.r(785527)),u=e.r(384314),l=_(e.r(320336)),o=_(e.r(594592)),s=_(e.r(799048)),c=_(e.r(305784)),f=_(e.r(118202)),p=_(e.r(478816));function _(e){return e&&e.__esModule?e:{default:e}}},362812,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(){return(0,d.useCallback)(async e=>{var t;let{offerData:r}=e,{termLink:d}=r;return{status:(null==(t=(0,n.default)())?void 0:t.open(d))?i.default.success:i.default.failure}},[])};var d=e.r(15010),i=a(e.r(785527)),n=a(e.r(799048));function a(e){return e&&e.__esModule?e:{default:e}}},897250,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"CreditAppOrigins",{enumerable:!0,get:function(){return d.CreditAppOrigins}}),Object.defineProperty(r,"ExperimentNames",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(r,"LaunchTermsStatuses",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(r,"ResolvedTreatmentNames",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(r,"StageNames",{enumerable:!0,get:function(){return d.StageNames}}),Object.defineProperty(r,"UrlParamKeys",{enumerable:!0,get:function(){return d.UrlParamKeys}});var d=e.r(360630),i=u(e.r(108140)),n=u(e.r(785527)),a=u(e.r(234738));function u(e){return e&&e.__esModule?e:{default:e}}},784078,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,r.default={link:"link",appLanding:"appLanding",modal:"modal",none:"none"}},501882,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var d,i=e.r(360630),n=(d=e.r(784078))&&d.__esModule?d:{default:d};r.default={[i.CreditProductIdentifiers.PAY_LATER_US]:n.default.modal,[i.CreditProductIdentifiers.PAY_LATER_GB]:n.default.modal,[i.CreditProductIdentifiers.PAY_LATER_AU]:n.default.modal,[i.CreditProductIdentifiers.PAY_LATER_PAY_IN_1_DE]:n.default.modal,[i.CreditProductIdentifiers.PAY_LATER_PAY_IN_1_AT]:n.default.modal,[i.CreditProductIdentifiers.PAY_LATER_PAY_IN_1_GB]:n.default.modal,[i.CreditProductIdentifiers.PAY_LATER_FR]:n.default.modal,[i.CreditProductIdentifiers.PAY_LATER_SHORT_TERM_CA]:n.default.modal,[i.CreditProductIdentifiers.PAY_LATER_SHORT_TERM_IT]:n.default.modal,[i.CreditProductIdentifiers.PAY_LATER_SHORT_TERM_ES]:n.default.modal,[i.CreditProductIdentifiers.PAY_LATER_LONG_TERM_US]:n.default.modal,[i.CreditProductIdentifiers.PAY_LATER_LONG_TERM_IT]:n.default.modal,[i.CreditProductIdentifiers.PAY_LATER_LONG_TERM_ES]:n.default.modal,[i.CreditProductIdentifiers.PAY_LATER_LONG_TERM_FR]:n.default.modal,[i.CreditProductIdentifiers.PAY_LATER_LONG_TERM_AU]:n.default.modal,[i.CreditProductIdentifiers.PAY_LATER_LONG_TERM_CA]:n.default.modal,[i.CreditProductIdentifiers.PAY_LATER_LONG_TERM_AT]:n.default.modal,[i.CreditProductIdentifiers.PAY_LATER_DE]:n.default.modal,[i.CreditProductIdentifiers.PP_UK_PPC]:n.default.link,[i.CreditProductIdentifiers.PPC_US_V2]:n.default.link,[i.CreditProductIdentifiers.PAYPAL_CREDIT_CARD_US]:n.default.link,[i.CreditProductIdentifiers.CREDIT_CARD_PAYPAL_CONSUMER_REWARDS_US]:n.default.appLanding,[i.CreditProductIdentifiers.PPDC_ACQUISITION_US]:n.default.none}},48235,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(){let e=(0,l.default)(),t=(0,o.default)(),r=(0,s.default)(),c={[u.default.appLanding]:e,[u.default.link]:r,[u.default.modal]:t,[u.default.none]:null},{logger:f}=(0,i.useCreditAppContext)();return(0,d.useCallback)(async e=>{let{creditProductIdentifier:t}=e,r=`[${t} iframe]`;null==f||f.debug(`${r} Integration: launching terms for ${t}`);let d=c[n.default[t]];return d?await d(e):{status:a.default.failure}},[e,t,r,f])};var d=e.r(15010),i=e.r(117317),n=c(e.r(501882)),a=c(e.r(785527)),u=c(e.r(784078)),l=c(e.r(193765)),o=c(e.r(554204)),s=c(e.r(362812));function c(e){return e&&e.__esModule?e:{default:e}}},83933,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){let{creditProductIdentifier:t}=e,r=(0,d.default)(e,t),n=(0,i.default)(e,t);return r&&n};var d=n(e.r(366583)),i=n(e.r(547312));function n(e){return e&&e.__esModule?e:{default:e}}},463026,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(){let{state:e}=(0,d.useCreditAppContext)(),{creditProductIdentifier:t,launchCreditProductIdentifier:r}=e,s=!!t,c=(0,o.default)(e,t),f=(0,l.default)(e),p=(0,i.default)(),_=(0,n.default)();return{isCreditProduct:s,isCreditProductAutoLaunch:c,isCreditProductAwaitingLaunch:f,creditProductIdentifier:t,launchCreditProductIdentifier:r,launchCreditProductWhenReady:p,launchTermsWhenReady:_,preloadCreditProduct:(0,a.default)(),setSelectedOfferData:(0,u.default)()}};var d=e.r(117317),i=s(e.r(305784)),n=s(e.r(48235)),a=s(e.r(118202)),u=s(e.r(478816)),l=s(e.r(83933)),o=s(e.r(366583));function s(e){return e&&e.__esModule?e:{default:e}}},639346,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.getCreditAppProperties=function(){var e,t;let r=(0,a.default)();if(!(null==r||null==(t=r.PAYPAL)||null==(e=t.checkout)?void 0:e.properties))throw Error("getCreditAppProperties called but window.PAYPAL.checkout.properties is not defined.");return r.PAYPAL.checkout.properties},r.registerCreditApp=function(e){let t,r=(0,a.default)();if(!r)throw Error("Window is not available");o=null,r.PAYPAL||(r.PAYPAL={}),r.PAYPAL.creditApp={...r.PAYPAL.creditApp,initializeApp:e.initializeApp,onAppLaunched:e.onAppLaunched},(t=(0,a.default)())&&(l&&t.removeEventListener("message",l),l=t=>{let r;if(!("object"==typeof(r=t.data)&&null!==r&&"string"==typeof r.type&&Object.values(u).includes(r.type)))return;let d=s();if(t.source!==d)return void(0,n.addError)(Error("postMessage received from non-parent source"),{context:"creditAppCommunication.setupPostMessageListeners",messageType:t.data.type,eventOrigin:t.origin,securityViolation:"source_mismatch"});if(!function(e){try{let{hostname:t,protocol:r}=new URL(e),d=(0,a.default)(),i=null==d?void 0:d.location.hostname;if("localhost"===t&&"localhost"===i)return!0;if("https:"!==r)return!1;if(["www.paypal.com","paypal.com"].includes(t)||t.endsWith(".qa.paypal.com"))return!0;return!1}catch(t){return(0,n.addError)(t,{context:"creditAppCommunication.isValidOrigin",invalidOrigin:e,securityViolation:"invalid_url_format"}),!1}}(t.origin))return void(0,n.addError)(Error("postMessage received from untrusted origin"),{context:"creditAppCommunication.setupPostMessageListeners",messageType:t.data.type,eventOrigin:t.origin,securityViolation:"untrusted_origin"});o=t.origin;let i=t.data;try{switch(i.type){case u.INITIALIZE_APP:e.initializeApp();break;case u.ON_APP_LAUNCHED:e.onAppLaunched(i.payload??{});break;default:(0,n.addError)(Error("Received unhandled message type"),{context:"creditAppCommunication.messageHandler",messageType:i.type,eventOrigin:t.origin,warning:"unhandled_message_type"})}}catch(e){(0,n.addError)(e,{context:"creditAppCommunication.messageHandler",messageType:i.type,eventOrigin:t.origin})}},t.addEventListener("message",l)),c({type:u.REGISTER_CREDIT_APP})},r.signalAppEnded=function(e){var t,r;let d=(0,a.default)();if(!c({type:u.SIGNAL_APP_ENDED,payload:e})){if(!(null==d||null==(r=d.PAYPAL)||null==(t=r.checkout)?void 0:t.signalAppEnded))throw Error("signalAppEnded failed: postMessage not available and window.PAYPAL.checkout.signalAppEnded is not defined.");d.PAYPAL.checkout.signalAppEnded(e)}},r.signalAppLoaded=function(){var e,t;let r=(0,a.default)();if(!c({type:u.SIGNAL_APP_LOADED})){if(!(null==r||null==(t=r.PAYPAL)||null==(e=t.checkout)?void 0:e.signalAppLoaded))throw Error("signalAppLoaded failed: postMessage not available and window.PAYPAL.checkout.signalAppLoaded is not defined.");r.PAYPAL.checkout.signalAppLoaded()}},r.signalAppRedirect=function(){var e,t;let r=(0,a.default)();if(!c({type:u.SIGNAL_APP_REDIRECT})){if(!(null==r||null==(t=r.PAYPAL)||null==(e=t.checkout)?void 0:e.signalAppRedirect))throw Error("signalAppRedirect failed: postMessage not available and window.PAYPAL.checkout.signalAppRedirect is not defined.");r.PAYPAL.checkout.signalAppRedirect()}};var d,i,n=e.r(384314),a=(d=e.r(799048))&&d.__esModule?d:{default:d},u=((i=u||{}).SIGNAL_APP_LOADED="SIGNAL_APP_LOADED",i.SIGNAL_APP_ENDED="SIGNAL_APP_ENDED",i.SIGNAL_APP_REDIRECT="SIGNAL_APP_REDIRECT",i.REGISTER_CREDIT_APP="REGISTER_CREDIT_APP",i.INITIALIZE_APP="INITIALIZE_APP",i.ON_APP_LAUNCHED="ON_APP_LAUNCHED",i);let l=null,o=null;function s(){let e=(0,a.default)();return e&&e.parent&&e.parent!==e?e.parent:null}function c(e){let t=s(),r=(0,a.default)();if(!t)return!1;try{let d=null==r?void 0:r.document.referrer,i=o??(d?new URL(d).origin:null);if(!i)return!1;return t.postMessage(e,i),!0}catch(t){return(0,n.addError)(t,{context:"creditAppCommunication.sendToParent",messageType:e.type,fallbackAvailable:!0}),!1}}},79066,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var d={CreditAppLauncher:!0,CreditAppProvider:!0,useLaunchCreditProductWhenReady:!0,useCreditApp:!0,getCreditAppProperties:!0,registerCreditApp:!0,signalAppEnded:!0,signalAppLoaded:!0,signalAppRedirect:!0};Object.defineProperty(r,"CreditAppLauncher",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(r,"CreditAppProvider",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(r,"getCreditAppProperties",{enumerable:!0,get:function(){return o.getCreditAppProperties}}),Object.defineProperty(r,"registerCreditApp",{enumerable:!0,get:function(){return o.registerCreditApp}}),Object.defineProperty(r,"signalAppEnded",{enumerable:!0,get:function(){return o.signalAppEnded}}),Object.defineProperty(r,"signalAppLoaded",{enumerable:!0,get:function(){return o.signalAppLoaded}}),Object.defineProperty(r,"signalAppRedirect",{enumerable:!0,get:function(){return o.signalAppRedirect}}),Object.defineProperty(r,"useCreditApp",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(r,"useLaunchCreditProductWhenReady",{enumerable:!0,get:function(){return u.default}});var i=s(e.r(64365)),n=s(e.r(839974)),a=e.r(897250);Object.keys(a).forEach(function(e){"default"===e||"__esModule"===e||Object.prototype.hasOwnProperty.call(d,e)||e in r&&r[e]===a[e]||Object.defineProperty(r,e,{enumerable:!0,get:function(){return a[e]}})});var u=s(e.r(305784)),l=s(e.r(463026)),o=e.r(639346);function s(e){return e&&e.__esModule?e:{default:e}}},73914,e=>{"use strict";var t=e.i(62331),r=e.i(79066),d=e.i(15010),i=e.i(119656),n=e.i(809726);let a=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n.obs.emit(e,t,{analytics:{event_name:e,...r},metrics:{metricEventName:e,metricId:"pp.xo.ui.custom.count"}}),(0,i.loadDatadogRum)().then(t=>{let{datadogRum:d}=t;d.setGlobalContextProperty(e,r)})},u={value:void 0};e.s(["logChaiAction",0,a,"useCreditAppWithLogging",0,()=>{let{dismissAll:e}=(0,t.useToast)(),{launchCreditProductWhenReady:i,launchTermsWhenReady:n,preloadCreditProduct:l,setSelectedOfferData:o,...s}=(0,r.useCreditApp)(),c=(0,d.useCallback)(t=>{e(),a("chai_launch_credit_product_when_ready","info",{credit_product_identifier:u.value,customer_interactions:JSON.stringify(null==t?void 0:t.customerInteractions)}),i(t)},[e,i]),f=(0,d.useCallback)(e=>(a("chai_launch_terms_when_ready","info",{credit_product_identifier:e.creditProductIdentifier,modal_options:JSON.stringify(e.modalOptions),offer_data:JSON.stringify(e.offerData),offer_id:e.offerId}),n(e)),[n]),p=(0,d.useCallback)(e=>{a("chai_preload_credit_product","info",{credit_flow_context:JSON.stringify(e.creditFlowContext),credit_product_identifier:e.creditProductIdentifier,landing_url:e.landingUrl,offer_data:JSON.stringify(e.offerData),offer_id:e.offerId,product_offer_evaluation_id:e.productOfferEvaluationId,reload:e.reload}),l(e)},[l]),_=(0,d.useCallback)(e=>{a("chai_set_selected_offer_data","info",{credit_flow_context:JSON.stringify(e.creditFlowContext),credit_flow_identifier:e.creditFlowIdentifier,credit_product_identifier:e.creditProductIdentifier,landing_url:e.landingUrl,selected_funding_instrument_id:e.selectedFundingInstrumentId,selected_offer_data:JSON.stringify(e.selectedOfferData),selected_offer_id:e.selectedOfferId,selected_product_offer_eval_id:e.selectedProductOfferEvaluationId,transaction_amount:JSON.stringify(e.transactionAmount)}),u.value=e.creditProductIdentifier,o(e)},[o]);return{...s,launchCreditProductWhenReady:c,launchTermsWhenReady:f,preloadCreditProduct:p,setSelectedOfferData:_}}])},312464,e=>{"use strict";var t=e.i(900772),r=e.i(15010);e.s(["usePayLaterOnlyEnabled",0,function(){return(0,r.use)(t.FeatureFlagsContext)["pay-later-only"]??!1}])}]);

//# sourceMappingURL=1atvdhkxdo0mo.js.map