1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4506],{5838:(e,a,t)=>{"use strict";t.d(a,{A:()=>l});var r=t(90924),n=t(49378),i=t(63017),s=t.n(i);let l=({currency:e,amountCents:a,availableBalanceCents:t,onChangeAmount:i,onCancelPurchase:l})=>{let o=Math.max(a-t,0);return(0,r.jsx)("div",{className:s().backdrop,role:"presentation",children:(0,r.jsxs)("div",{className:s().dialog,role:"dialog","aria-modal":"true","aria-labelledby":"rewards-coverage-title","aria-describedby":"rewards-coverage-body",children:[(0,r.jsx)("h2",{id:"rewards-coverage-title",className:s().title,children:"Your rewards don't quite cover that amount"}),(0,r.jsxs)("p",{id:"rewards-coverage-body",className:s().body,children:["Your combined Raise Cash and RaiseOne rewards balance is"," ",(0,n.CQ)(t,e),"â",(0,n.CQ)(o,e)," short of the"," ",(0,n.CQ)(a,e)," you selected. Would you like to adjust your amount or cancel?"]}),(0,r.jsxs)("div",{className:s().actions,children:[(0,r.jsx)("button",{type:"button",className:s().primaryButton,onClick:i,children:"Change amount"}),(0,r.jsx)("button",{type:"button",className:s().secondaryButton,onClick:l,children:"Cancel purchase"})]})]})})}},7147:(e,a,t)=>{"use strict";t.d(a,{A:()=>d});var r=t(90924),n=t(76332),i=t(66208),s=t(20840),l=t(45415),o=t.n(l);let d=({isOpen:e,onClose:a,brand:t,isRaiseOneBrand:l=!1,onCreateAccount:d,onSignIn:c})=>{let[u,m]=(0,i.useState)(!1);if((0,i.useEffect)(()=>{if(!e)return;let t=e=>{"Escape"===e.key&&a()};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e,a]),!e)return null;let h=!!(t.iconUrl&&!u),g=l?`${t.name} gift cards are exclusively available to Raise members. Sign in or create a free account to complete your purchase and access your gift card securely.`:`${t.name} requires an account to complete your purchase. Creating one takes less than a minute and keeps your transaction secure.`;return(0,r.jsx)("div",{className:o().backdrop,role:"presentation",onClick:a,children:(0,r.jsxs)("div",{className:o().dialog,role:"dialog","aria-modal":"true","aria-labelledby":"guest-checkout-title","aria-describedby":"guest-checkout-body",onClick:e=>e.stopPropagation(),children:[(0,r.jsx)("div",{className:o().headerRow,children:(0,r.jsx)("button",{type:"button",className:o().backButton,onClick:a,"aria-label":"Go back",children:(0,r.jsx)(s.F.Svgs.ArrowLeft,{size:"20"})})}),(0,r.jsx)("div",{className:o().logoWrapper,children:h?(0,r.jsx)("img",{src:t.iconUrl,alt:t.name,className:o().brandLogo,onError:()=>m(!0)}):(0,r.jsx)("div",{className:o().brandLogoFallback,"aria-hidden":"true",children:(0,r.jsx)(n.C7,{fill:"#b5b5be"})})}),(0,r.jsx)("h2",{id:"guest-checkout-title",className:o().title,children:"One more step"}),(0,r.jsx)("p",{id:"guest-checkout-body",className:o().body,children:g}),(0,r.jsx)("button",{type:"button",className:o().primaryButton,onClick:d,children:"Create account - it's quick"}),(0,r.jsxs)("p",{className:o().signInRow,children:["Already have an account?"," ",(0,r.jsx)("button",{type:"button",className:o().signInLink,onClick:c,children:"Sign In"})]})]})})}},9087:e=>{e.exports={giftToButton:"send-as-gift-dialog_giftToButton__WGbqo",giftToButtonInline:"send-as-gift-dialog_giftToButtonInline__SGGZH",modalBackdrop:"send-as-gift-dialog_modalBackdrop__sZKFV",giftDialog:"send-as-gift-dialog_giftDialog__JCOSO",inputError:"send-as-gift-dialog_inputError__ytMIE",fieldError:"send-as-gift-dialog_fieldError__Mfkn1",giftEyebrow:"send-as-gift-dialog_giftEyebrow__Qbe7k",giftPreview:"send-as-gift-dialog_giftPreview__hGLn5",animationStage:"send-as-gift-dialog_animationStage__63afs",giftAnimation:"send-as-gift-dialog_giftAnimation__MxcMP",themeSelect:"send-as-gift-dialog_themeSelect__YpMY2",closeButton:"send-as-gift-dialog_closeButton__QC5yq",deliveryToggle:"send-as-gift-dialog_deliveryToggle__woy0L",phoneField:"send-as-gift-dialog_phoneField__NxrJq",giftActions:"send-as-gift-dialog_giftActions__G9wno"}},20798:(e,a,t)=>{"use strict";t.d(a,{bZ:()=>i,fz:()=>n,ms:()=>s});var r=t(8257);let n=(e,{variant:a,step:t,reason:n,provider:i})=>{(0,r.s)(e,{variant:a,user_auth_state:"guest",...t?{step:t}:{},...n?{reason:n}:{},...i?{provider:i}:{}})},i=e=>{(0,r.s)("Guest_AddPayment_Cta_Tapped",{source:e})},s=()=>{(0,r.s)("Guest_ApplePay_Tapped")}},45415:e=>{e.exports={backdrop:"guest-checkout-dialog_backdrop__mZXe9",dialog:"guest-checkout-dialog_dialog__nWhqO",headerRow:"guest-checkout-dialog_headerRow__5DQWp",backButton:"guest-checkout-dialog_backButton__vhuM1",logoWrapper:"guest-checkout-dialog_logoWrapper__g34nI",brandLogo:"guest-checkout-dialog_brandLogo___eMlg",brandLogoFallback:"guest-checkout-dialog_brandLogoFallback__hrgRN",title:"guest-checkout-dialog_title__Gvool",body:"guest-checkout-dialog_body__9jumM",primaryButton:"guest-checkout-dialog_primaryButton__XHgfE",signInRow:"guest-checkout-dialog_signInRow__B6glf",signInLink:"guest-checkout-dialog_signInLink__HNdtE"}},50659:(e,a,t)=>{"use strict";t.d(a,{$D:()=>r,JR:()=>n,Kp:()=>s,kb:()=>i});let r={shared:{consentPrefix:'By clicking "Verify" I agree that I have read, understood, and consent to Raiseâs ',consentPrivacyLink:"GLBA Privacy Notice",consentTermsLink:"Terms of Use",back:"Back",verify:"Verify",alreadyHaveAccount:"Already have an account?",signIn:"Sign in",nameTitle:"Almost there â what should we call you?",nameBody:"We use your name on your card and receipts.",firstNameLabel:"First name",lastNameLabel:"Last name",finish:"Finish",resend:"Request New Code",resendCountdown:e=>`Request new code in ${e} second${1===e?"":"s"}`,tryAgain:"Try again",close:"Close",changeEmail:"Change email",emailMismatchTitle:"This
1numberâs linked to a different email.",emailMismatchBody:"Nothing about your account has changed.",ok:"OK",requiredField:"This field is required.",handoffFailureTitle:"Almost There",handoffFailureBody:"Your account is ready, but we could not refresh this page. Please try again.",safetyDisclaimer:"Raise will never call to ask for it."},errors:{invalidPhone:"Enter a valid phone number.",invalidEmail:"Enter a valid email address.",codeSendFailed:"We couldnât send your code. Check your number and try again.",invalidCode:"That code doesnât match. Check it and try again.",maxAttempts:"Too many attempts. Request a new code to continue.",signupFailed:"We couldnât finish setting up your account. Try again.",emailAlreadyExists:"Those details donât match. Check your phone and email, or sign in instead.",unknown:"Something went wrong on our end. Try again."},a:{title:e=>`Your ${e} Raise Cash, linked to your number`,body:"Your card goes to your email, and your Raise Cash stays here for your next purchase.",emailLabel:"Email address (for card delivery)",continueButton:"Continue to verify"},b:{identityTitle:"Where should we send your card?",identityBody:"Weâll send it right after purchase. Sign in with one tap, or use your email.",googleButton:"Continue with Google",appleButton:"Continue with Apple",continueWithEmailButton:"Continue with email",emailSeparatorLabel:"OR CONTINUE WITH EMAIL",emailLabel:"Email address",continueButton:"Continue",stepCounter:(e,a)=>`${e} of ${a} steps`,phoneTitle:e=>`Your ${e} Raise Cash, linked to your number`,phoneBody:"Itâs also your sign-in next time youâre back. Weâll text a 6-digit code to confirm itâs you.",textCodeButton:"Text the code",ssoFailedError:"We couldnât continue with that account. Try again or use email.",ssoCancelledError:"Sign-in was cancelled."}},n=(e,a)=>a??r.errors[e],i=e=>e?`We texted a code to \u2022\u2022\u2022${e}`:"We texted a code to your phone",s=e=>`Enter it below and your ${e} Raise Cash is saved for next time. Don\u2019t share this code with anyone. ${r.shared.safetyDisclaimer}`},59537:(e,a,t)=>{"use strict";t.d(a,{a:()=>C,A:()=>N});var r=t(90924),n=t(75865),i=t(24301),s=t(95330),l=t.n(s),o=t(66208),d=t(51764),c=t(38206),u=t(91521),m=t(20678),h=t(53965),g=t(49378),p=t(38928),f=t(20840);let y=({deliveryMethod:e,deliveryAddress:a,countryCode:t,countries:r})=>{if("EMAIL"===e)return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(a);let n=a.replace(/\D/g,"").length,i=r.find(e=>e.countryCode===t);return i?i.phoneLengths.includes(n):"US"===t&&10===n};var _=t(9087),v=t.n(_);let b=(0,m.h)("SendAsGiftDialog"),x=(e,a)=>{if(!a?.assetUrl)return 0;let t=e.findIndex(e=>e.animationUrl===a.assetUrl);return t>=0?t:0},C=({disabled:e,recipientName:a,onClick:t,inline:n=!1,className:i})=>(0,r.jsx)(p.$,{type:"button",variant:"secondary",size:"large",className:n?`${v().giftToButton} ${v().giftToButtonInline}${i?` ${i}`:""}`:`${v().giftToButton}${i?` ${i}`:""}`,disabled:e,onClick:t,leftIcon:(0,r.jsx)(f.F.Svgs.PresentBox,{size:"24"}),children:a?`Gift to ${a}`:"Gift to..."}),N=({amountCents:e,currency:a,brandName:t,giftThemes:s,initialGift:m,onClose:p,onConfirm:f,onCancelGift:_})=>{let[C,N]=(0,o.useState)(s??[]),[j,k]=(0,o.useState)(()=>x(s??[],m)),[E,S]=(0,o.useState)(null),[w,B]=(0,o.useState)([]),[A,I]=(0,o.useState)(m?.deliveryMethod??"SMS"),[$,D]=(0,o.useState)(m?.gifteeName??""),[R,L]=(0,o.useState)(m?.deliveryAddress??""),[U,M]=(0,o.useState)(m?.gifterName??""),[F,P]=(0,o.useState)(m?.message??""),[T,z]=(0,o.useState)(m?.phoneCountryCode??"US"),[G,V]=(0,o.useState)({recipientName:!1,deliveryAddress:!1,senderName:!1}),O=C[j],H=(0,d.mi)()||(0,h.X3)();(0,o.useEffect)(()=>{if(s&&s.length>0)return void N(s);let e=new AbortController;return c.RU.getGifting(H,{signal:e.signal}).then(e=>{let a=(0,n.rz)(e);N(a),k(x(a,m))}).catch(e=>{e instanceof Error&&"AbortError"!==e.name&&b.error("Gift themes could not be loaded",e)}),()=>e.abort()},[s,m,H]),(0,o.useEffect)(()=>{if(!O?.animationUrl)return void S(null);let e=new AbortController;return S(null),c.hZ.getGiftAnimation(O.animationUrl,{signal:e.signal}).then(S).catch(e=>{e instanceof Error&&"AbortError"!==e.name&&b.error(e)}),()=>e.abort()},[O?.animationUrl]),(0,o.useEffect)(()=>
1{if(w.length>0)return;let e=!1;return c.BR.getInternationalConfig(H).then(a=>{e||B((0,u.Mn)(a))}).catch(e=>{b.error("Gift countries could not be loaded",e)}),()=>{e=!0}},[w.length,H]);let q=$.trim().length>0&&U.trim().length>0&&y({deliveryMethod:A,deliveryAddress:R,countryCode:T,countries:w}),W={recipientName:G.recipientName&&0===$.trim().length?"Recipient name is required":"",deliveryAddress:G.deliveryAddress&&!y({deliveryMethod:A,deliveryAddress:R,countryCode:T,countries:w})?"EMAIL"===A?"Please enter a valid email address":"Please enter a valid phone number":"",senderName:G.senderName&&0===U.trim().length?"Sender name is required":""},K=w.find(e=>e.countryCode===T)??w[0],X=(0,i.X_)(K?.phoneLengths),Y="SMS"===A?(0,i.n4)(R,X):R;return(0,r.jsx)("div",{className:v().modalBackdrop,role:"presentation",onMouseDown:p,children:(0,r.jsxs)("section",{className:v().giftDialog,role:"dialog","aria-modal":"true","aria-labelledby":"gift-dialog-title",onMouseDown:e=>e.stopPropagation(),children:[(0,r.jsx)("button",{type:"button",className:v().closeButton,"aria-label":"Close gift details",onClick:p,children:"\xd7"}),(0,r.jsx)("h1",{children:"Send as Gift"}),(0,r.jsxs)("div",{className:v().giftPreview,children:[(0,r.jsx)("button",{type:"button","aria-label":"Previous gift box",disabled:0===j,onClick:()=>k(e=>Math.max(0,e-1)),children:"â"}),(0,r.jsx)("div",{className:v().animationStage,children:E?(0,r.jsx)(l(),{animationData:E,loop:!1,className:v().giftAnimation}):O?.openImageUrl?(0,r.jsx)("img",{src:O.openImageUrl,alt:O.title}):(0,r.jsx)("span",{children:"Loading gift boxâ¦"})}),(0,r.jsx)("button",{type:"button","aria-label":"Next gift box",disabled:j>=C.length-1,onClick:()=>k(e=>Math.min(C.length-1,e+1)),children:"â"})]}),C.length>0&&(0,r.jsxs)("label",{className:v().themeSelect,children:["Gift box",(0,r.jsx)("select",{value:j,onChange:e=>k(Number(e.target.value)),children:C.map((e,a)=>(0,r.jsx)("option",{value:a,children:e.title},e.id))})]}),(0,r.jsxs)("p",{className:v().giftEyebrow,children:[(0,g.CQ)(e,a)," ",t," gift card"]}),(0,r.jsx)("h2",{id:"gift-dialog-title",children:"Gift to"}),(0,r.jsxs)("div",{className:v().deliveryToggle,children:[(0,r.jsx)("button",{type:"button","aria-pressed":"EMAIL"===A,onClick:()=>{I("EMAIL"),L(""),V(e=>({...e,deliveryAddress:!1}))},children:"Email"}),(0,r.jsx)("button",{type:"button","aria-pressed":"SMS"===A,onClick:()=>{I("SMS"),L(""),V(e=>({...e,deliveryAddress:!1}))},children:"Text message"})]}),"SMS"===A?(0,r.jsxs)("div",{className:v().phoneField,children:[(0,r.jsxs)("label",{children:["Country",(0,r.jsx)("select",{value:T,onChange:e=>{z(e.target.value),L("")},children:(w.length?w:[{countryCode:"US",countryName:"United States",callingCode:"1"}]).map(e=>(0,r.jsxs)("option",{value:e.countryCode,children:[e.countryCode," (+",e.callingCode.replace("+",""),")"]},e.countryCode))})]}),(0,r.jsxs)("label",{children:["Recipient phone",(0,r.jsx)("input",{type:"tel",inputMode:"numeric",className:W.deliveryAddress?v().inputError:"",value:Y,onChange:e=>L((0,i.hR)(e.target.value,X)),onBlur:()=>V(e=>({...e,deliveryAddress:!0}))}),W.deliveryAddress&&(0,r.jsx)("span",{className:v().fieldError,children:W.deliveryAddress})]})]}):(0,r.jsxs)("label",{children:["Recipient email",(0,r.jsx)("input",{type:"email",className:W.deliveryAddress?v().inputError:"",value:R,onChange:e=>L(e.target.value),onBlur:()=>V(e=>({...e,deliveryAddress:!0}))}),W.deliveryAddress&&(0,r.jsx)("span",{className:v().fieldError,children:W.deliveryAddress})]}),(0,r.jsxs)("label",{children:["Recipient name",(0,r.jsx)("input",{className:W.recipientName?v().inputError:"",value:$,onChange:e=>D(e.target.value),onBlur:()=>V(e=>({...e,recipientName:!0}))}),W.recipientName&&(0,r.jsx)("span",{className:v().fieldError,children:W.recipientName})]}),(0,r.jsx)("h2",{children:"Gift from"}),(0,r.jsxs)("label",{children:["Sender name",(0,r.jsx)("input",{className:W.senderName?v().inputError:"",value:U,onChange:e=>M(e.target.value),onBlur:()=>V(e=>({...e,senderName:!0}))}),W.senderName&&(0,r.jsx)("span",{className:v().fieldError,children:W.senderName})]}),(0,r.jsxs)("label",{children:["Message ",(0,r.jsxs)("span",{children:["(",F.length,"/250)"]}),(0,r.jsx)("textarea",{maxLength:250,value:F,onChange:e=>P(e.target.value)})]}),(0,r.jsxs)("div",{className:v().giftActions,children:[(0,r.jsx)("button",{type:"button",onClick:_??p,children:"Cancel gift"}),(0,r.jsx)("button",{type:"button",disabled:!q,onClick:()=>{var e;let a,t;return f((a={gifteeName:(e={recipientName:$,senderName:U,deliveryMethod:A,deliveryAddress:R,giftCountryCode:T,message:F}).recipientName.trim(),gifterName:e.senderName.trim(),deliveryMethod:e.deliveryMethod,deliveryAddress:e.deliveryAddress.trim(),includeRaiseInvite:!0},(t=e.message.trim())&&(a.message=t),"SMS"===e.deliveryMethod&&(a.phoneCountryCode=e.giftCountryCode),O?.animationUrl&&(a.assetUrl=O.animationUrl),O?.openImageUrl&&(a.topImageUrl=O.openImageUrl),O?.reviewImageUrl&&(a.middleImageUrl=O.reviewImageUrl),O?.closedImageUrl&&(a.bottomImageUrl=O.closedImageUrl),a))},children:"Confirm gift â"})]})]})})}},63017:e=>{e.exports={backdrop:"rewards-coverage-dialog_backdrop__yLKbF",dialog:"rewards-coverage-dialog_dialog__BMnSI",title:"rewards-coverage-dialog_title__biNwt",body:"rewards-coverage-dialog_body__uu3CQ",actions:"rewards-coverage-dialog_actions__LcWmB",primaryButton:"rewards-coverage-dialog_primaryButton___cDv4",secondaryButton:"rewards-coverage-dialog_secondaryButton__arKHl"}},68091:(e,a,t)=>{"use strict";t.d(a,{B:()=>r});let r=e=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e.trim())},70315:(e,a,t)=>{"use strict";t.d(a,{UC:()=>i,cP:()=>n,rW:()=>s});var r=t(61122);let n=e=>{(0,r.x)().set("checkout",e)},i=()=>(0,r.x)().get("checkout")??null,s=()=>{(0,r.x)().remove("checkout")}},76074:e=>{e.exports={wrapper:"country-code-select_wrapper__jp9OY",trigger:"country-code-select_trigger__C4NGa",flag:"country-code-select_flag__LauaA",code:"country-code-select_code__K8ntW",chevron:"country-code-select_chevron__KMD8K",menu:"country-code-select_menu__H2_Lb",option:"country-code-select_option__eJq8I",optionHighlighted:"country-code-select_optionHighlighted__hniq3",optionLabel:"country-code-select_optionLabel__bM9De"}},93269:e=>{e.exports={overlay:"claim-cash-dialog_overlay__djU_B",panel:"claim-cash-dialog_panel__qwGFI",brandLogo:"claim-cash-dialog_brandLogo__NRS2I",brandLogoFallback:"claim-cash-dialog_brandLogoFallback__6XXg
1C",content:"claim-cash-dialog_content__Q3gm9",progressBarContainer:"claim-cash-dialog_progressBarContainer__wO77I",progressBarSteps:"claim-cash-dialog_progressBarSteps__df8dh",progressBarSegment:"claim-cash-dialog_progressBarSegment__lqhyB",progressBarSegmentActive:"claim-cash-dialog_progressBarSegmentActive__2tk9p",stepCounter:"claim-cash-dialog_stepCounter__nYs6k",headingGroup:"claim-cash-dialog_headingGroup__zt2hb",title:"claim-cash-dialog_title__bnlh3",subtitle:"claim-cash-dialog_subtitle__tpVKu",stepForm:"claim-cash-dialog_stepForm__xd9SD",fields:"claim-cash-dialog_fields__8Ijj_",phoneRow:"claim-cash-dialog_phoneRow__vyGEh",input:"claim-cash-dialog_input__s3oWn",error:"claim-cash-dialog_error__s1axS",footer:"claim-cash-dialog_footer__5dkPo",backAndVerify:"claim-cash-dialog_backAndVerify__JeodP",backButton:"claim-cash-dialog_backButton__8Ls2G",existingAccount:"claim-cash-dialog_existingAccount__2xEtp",resendArea:"claim-cash-dialog_resendArea__NIADA",resendButton:"claim-cash-dialog_resendButton__BAkSa",legal:"claim-cash-dialog_legal__BVEh0",legalLink:"claim-cash-dialog_legalLink__f9HuP",ssoOptions:"claim-cash-dialog_ssoOptions__byTtt",emailCollapsedButton:"claim-cash-dialog_emailCollapsedButton__Y6_96",emailOption:"claim-cash-dialog_emailOption__J1PRc",emailCollapsed:"claim-cash-dialog_emailCollapsed__QEXVH",emailCollapsedHidden:"claim-cash-dialog_emailCollapsedHidden__zFgWd",emailCollapsedInner:"claim-cash-dialog_emailCollapsedInner__oxo2I",emailExpand:"claim-cash-dialog_emailExpand__GjbCc",emailExpandOpen:"claim-cash-dialog_emailExpandOpen__a_4DR",emailExpandInner:"claim-cash-dialog_emailExpandInner__K9z6s",hatch:"claim-cash-dialog_hatch__6R19w",liveRegion:"claim-cash-dialog_liveRegion__BBTiX"}},99826:(e,a,t)=>{"use strict";t.d(a,{Uk:()=>ea,Ay:()=>es});var r=t(90924),n=t(76332),i=t(82204),s=t(66208),l=t(38928),o=t(24301),d=t(43810),c=t(78442),u=t(20840),m=t(50659),h=t(76074),g=t.n(h);let p={US:"\uD83C\uDDFA\uD83C\uDDF8",CA:"\uD83C\uDDE8\uD83C\uDDE6",GB:"\uD83C\uDDEC\uD83C\uDDE7"},f=({countries:e,selectedCountryCode:a,onSelect:t,disabled:n=!1})=>{let[i,l]=(0,s.useState)(!1),[o,d]=(0,s.useState)(0),c=(0,s.useRef)(null),m=(0,s.useRef)(null),h=(0,s.useRef)(null),f=(0,s.useId)(),y=e.find(e=>e.countryCode===a)??e[0];(0,s.useEffect)(()=>{if(!i)return;m.current?.focus();let e=e=>{h.current&&!h.current.contains(e.target)&&l(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[i]);let _=Math.max(0,e.findIndex(e=>e.countryCode===a)),v=()=>{d(_),l(!0)},b=e=>{l(!1),e&&c.current?.focus()},x=a=>{let r=e[a];r&&(t(r.countryCode),b(!0))};return(0,r.jsxs)("div",{className:g().wrapper,ref:h,children:[(0,r.jsxs)("button",{type:"button",ref:c,className:g().trigger,disabled:n,onClick:()=>i?b(!1):v(),onKeyDown:a=>{n||("ArrowDown"===a.key||"Enter"===a.key||" "===a.key?(a.preventDefault(),v()):"ArrowUp"===a.key&&(a.preventDefault(),d(e.length-1),l(!0)))},role:"combobox","aria-expanded":i,"aria-haspopup":"listbox","aria-controls":f,"aria-label":`Country code, ${y.countryName}, plus ${y.callingCode}`,children:[(0,r.jsx)("span",{"aria-hidden":"true",className:g().flag,children:p[y.countryCode]??"\uD83C\uDF0D"}),(0,r.jsxs)("span",{className:g().code,children:["+",y.callingCode]}),(0,r.jsx)("span",{className:g().chevron,"aria-hidden":"true",children:i?(0,r.jsx)(u.F.Svgs.ChevronUp,{}):(0,r.jsx)(u.F.Svgs.ChevronDown,{})})]}),i&&(0,r.jsx)("ul",{id:f,role:"listbox",className:g().menu,ref:m,tabIndex:-1,"aria-label":"Country","aria-activedescendant":`${f}-${o}`,onKeyDown:a=>{"ArrowDown"===a.key?(a.preventDefault(),d(a=>Math.min(a+1,e.length-1))):"ArrowUp"===a.key?(a.preventDefault(),d(e=>Math.max(e-1,0))):"Enter"===a.key||" "===a.key?(a.preventDefault(),x(o)):"Escape"===a.key&&(a.preventDefault(),b(!0))},children:e.map((e,t)=>(0,r.jsxs)("li",{id:`${f}-${t}`,role:"option","aria-selected":e.countryCode===a,className:`${g().option} ${t===o?g().optionHighlighted:""}`,onMouseEnter:()=>d(t),onClick:()=>x(t),children:[(0,r.jsx)("span",{"aria-hidden":"true",className:g().flag,children:p[e.countryCode]??"\uD83C\uDF0D"}),(0,r.jsxs)("span",{className:g().optionLabel,children:[e.countryCode," +",e.callingCode]}),e.countryCode===a&&(0,r.jsx)("span",{"aria-hidden":"true",children:(0,r.jsx)(u.F.Svgs.Check,{size:"16"})})]},e.countryCode))})]})};var y=t(93269),_=t.n(y);let v=({flow:e,headingId:a,expectedCashbackAmount:t,brandIconUrl:n,brandName:i})=>
1{let[h,g]=(0,s.useState)(!1),[p,y]=(0,s.useState)(!1),v=(0,s.useRef)(null);(0,s.useEffect)(()=>{v.current?.focus()},[]);let b=!!h&&!e.isPhoneValid&&m.$D.errors.invalidPhone,x=!!p&&!e.isEmailValid&&m.$D.errors.invalidEmail,C=e.errorReason?(0,m.JR)(e.errorReason,e.errorMessage):void 0,N=e.isPhoneValid&&e.isEmailValid&&!e.isBusy;return(0,r.jsxs)("form",{className:_().stepForm,onSubmit:a=>{a.preventDefault(),N&&e.handleContactContinue()},noValidate:!0,children:[(0,r.jsxs)("div",{className:_().headingGroup,children:[(0,r.jsx)(ea,{brandIconUrl:n,brandName:i}),(0,r.jsx)("h1",{id:a,className:_().title,children:m.$D.a.title(t)}),(0,r.jsx)("p",{className:_().subtitle,children:m.$D.a.body})]}),(0,r.jsxs)("div",{className:_().fields,children:[(0,r.jsxs)("div",{className:_().phoneRow,children:[(0,r.jsx)(f,{countries:e.countries,selectedCountryCode:e.selectedCountryCode,onSelect:e.setSelectedCountryCode,disabled:e.isBusy}),(0,r.jsx)(d.p,{ref:v,label:"Phone number",type:"tel",inputMode:"numeric",placeholder:"555-555-5555",className:_().input,value:(0,o.n4)(e.phone),disabled:e.isBusy,error:b,autoComplete:"tel-national",onChange:a=>{let t=(0,o.hR)(a.target.value);e.setPhone(t)},onBlur:()=>g(!0)})]}),(0,r.jsx)(d.p,{label:m.$D.a.emailLabel,type:"email",className:_().input,value:e.email,disabled:e.isBusy,error:x,onChange:a=>e.setEmail(a.target.value),onBlur:()=>y(!0)}),C&&(0,r.jsx)(c.o.Body1,{role:"alert",className:_().error,children:C})]}),(0,r.jsxs)("div",{className:_().footer,children:[(0,r.jsx)(l.$,{type:"submit",variant:"primary",size:"large",rightIcon:(0,r.jsx)(u.F.Svgs.ArrowRight,{size:"20"}),disabled:!N,children:m.$D.a.continueButton}),(0,r.jsxs)("p",{className:_().existingAccount,children:[(0,r.jsx)("span",{children:m.$D.shared.alreadyHaveAccount})," ",(0,r.jsx)("button",{type:"button",onClick:e.handleSignInTapped,children:m.$D.shared.signIn})]})]})]})};var b=t(14616),x=t(8511),C=t(87469),N=t(45162);let j={cancelled:m.$D.b.ssoCancelledError,failed:m.$D.b.ssoFailedError},k=({flow:e,headingId:a,brandIconUrl:t,brandName:n})=>{let[i,o]=(0,s.useState)(!!e.email),[h,g]=(0,s.useState)(e.isEmailValid),p=(0,s.useRef)(null),[f,y]=(0,s.useState)(e.hasUsableName);e.hasUsableName!==f&&(y(e.hasUsableName),e.hasUsableName&&o(!0)),e.isEmailValid&&!h&&g(!0),(0,s.useEffect)(()=>{i&&p.current?.focus()},[i]);let v=!!h&&!e.isEmailValid&&m.$D.errors.invalidEmail,k=e.errorReason&&"emailAlreadyExists"!==e.errorReason?(0,m.JR)(e.errorReason,e.errorMessage):void 0,E="emailAlreadyExists"===e.errorReason,S=i&&e.isEmailValid&&null===e.ssoBusyProvider;return(0,r.jsxs)("form",{className:_().stepForm,onSubmit:a=>{a.preventDefault(),S&&e.handleContinueWithEmail(e.email.trim())},noValidate:!0,children:[x.tU&&(0,r.jsx)(C.default,{src:x.Of,strategy:"afterInteractive"}),x.E5&&(0,r.jsx)(C.default,{src:x.HN,strategy:"afterInteractive"}),(0,r.jsxs)("div",{className:_().headingGroup,children:[(0,r.jsx)(ea,{brandIconUrl:t,brandName:n}),(0,r.jsx)("h1",{id:a,className:_().title,children:m.$D.b.identityTitle}),(0,r.jsx)("p",{className:_().subtitle,children:m.$D.b.identityBody})]}),(0,r.jsxs)("div",{className:_().fields,children:[E&&(0,r.jsx)(c.o.Body1,{role:"alert",className:_().error,children:(0,m.JR)("emailAlreadyExists",null)}),("cancelled"===e.ssoError||"failed"===e.ssoError)&&(0,r.jsx)(c.o.Body1,{role:"alert",className:_().error,children:j[e.ssoError]}),(0,r.jsxs)("div",{className:_().ssoOptions,children:[x.E5&&(0,r.jsx)(l.$,{variant:"primary",size:"large",disabled:null!==e.ssoBusyProvider,leftIcon:"google"===e.ssoBusyProvider?(0,r.jsx)(N.y,{}):(0,r.jsx)(u.F.Svgs.GoogleFrame,{}),onClick:()=>void e.handleProviderTapped("google"),children:m.$D.b.googleButton}),x.tU&&(0,r.jsx)(l.$,{variant:"primary",size:"large",disabled:null!==e.ssoBusyProvider,leftIcon:"apple"===e.ssoBusyProvider?(0,r.jsx)(N.y,{}):(0,r.jsx)(u.F.Svgs.Apple,{color:"#ffffff"}),onClick:()=>void e.handleProviderTapped("apple"),children:m.$D.b.appleButton}),(0,r.jsxs)("div",{className:_().emailOption,children:[(0,r.jsx)("div",{className:`${_().emailCollapsed} ${i?_().emailCollapsedHidden:""}`,"aria-hidden":i,children:(0,r.jsx)("div",{className:_().emailCollapsedInner,children:(0,r.jsx)(l.$,{variant:"tertiary",size:"large",className:_().emailCollapsedButton,tabIndex:i?-1:void 0,disabled:i,onClick:()=>o(!0),children:m.$D.b.continueWithEmailButton})})}),(0,r.jsx)("div",{className:`${_().emailExpand} ${i?_().emailExpandOpen:""}`,"aria-hidden":!i,children:(0,r.jsxs)("div",{className:_().emailExpandInner,children:[(0,r.jsx)(b.A,{label:m.$D.b.emailSeparatorLabel}),(0,r.jsx)(d.p,{ref:p,label:m.$D.b.emailLabel,type:"email",value:e.email,error:v,tabIndex:i?void 0:-1,onChange:a=>{var t;return t=a.target.value,void(e.errorReason&&e.clearError(),e.setEmail(t))}}
1),k&&(0,r.jsx)(c.o.Body1,{role:"alert",className:_().error,children:k}),(0,r.jsx)(l.$,{type:"submit",variant:"primary",size:"large",disabled:!S,tabIndex:i?void 0:-1,rightIcon:(0,r.jsx)(u.F.Svgs.ArrowRight,{color:"#ffffff"}),children:m.$D.b.continueButton})]})})]})]})]}),(0,r.jsx)("div",{className:_().footer,children:(0,r.jsxs)("p",{className:_().existingAccount,children:[(0,r.jsx)("span",{children:m.$D.shared.alreadyHaveAccount})," ",(0,r.jsx)("button",{type:"button",onClick:e.handleSignInTapped,children:m.$D.shared.signIn})]})})]})},E=({flow:e,headingId:a,brandIconUrl:t,brandName:n,onChangeEmail:i})=>{let[o,u]=(0,s.useState)(!1),[h,g]=(0,s.useState)(!1),p=(0,s.useRef)(null);(0,s.useEffect)(()=>{p.current?.focus()},[]);let f=!(!o||e.firstName.trim())&&m.$D.shared.requiredField,y=!(!h||e.lastName.trim())&&m.$D.shared.requiredField,v=e.errorReason?(0,m.JR)(e.errorReason,e.errorMessage):void 0,b="emailAlreadyExists"===e.errorReason,x=e.isNameValid&&!e.isBusy;return(0,r.jsxs)("form",{className:_().stepForm,onSubmit:a=>{if(a.preventDefault(),x){if(b)return void i();e.handleFinishName()}},noValidate:!0,children:[(0,r.jsxs)("div",{className:_().headingGroup,children:[(0,r.jsx)(ea,{brandIconUrl:t,brandName:n}),(0,r.jsx)("h1",{id:a,className:_().title,children:m.$D.shared.nameTitle}),(0,r.jsx)("p",{className:_().subtitle,children:m.$D.shared.nameBody})]}),(0,r.jsxs)("div",{className:_().fields,children:[(0,r.jsx)(d.p,{ref:p,label:m.$D.shared.firstNameLabel,value:e.firstName,disabled:e.isBusy,error:f,onChange:a=>e.setFirstName(a.target.value),onBlur:()=>u(!0)}),(0,r.jsx)(d.p,{label:m.$D.shared.lastNameLabel,value:e.lastName,disabled:e.isBusy,error:y,onChange:a=>e.setLastName(a.target.value),onBlur:()=>g(!0)}),v&&(0,r.jsx)(c.o.Body1,{role:"alert",className:_().error,children:v})]}),(0,r.jsx)("div",{className:_().footer,children:(0,r.jsx)(l.$,{type:"submit",variant:"primary",size:"large",disabled:!x,children:b?m.$D.shared.changeEmail:v?m.$D.shared.tryAgain:m.$D.shared.finish})})]})},S=({flow:e,headingId:a,expectedCashbackAmount:t,brandIconUrl:n,brandName:i})=>{let[h,g]=(0,s.useState)(!1),p=(0,s.useRef)(null);(0,s.useEffect)(()=>{p.current?.focus()},[]);let y=!!h&&!e.isPhoneValid&&m.$D.errors.invalidPhone,v=e.errorReason?(0,m.JR)(e.errorReason,e.errorMessage):void 0,b=e.isPhoneValid&&!e.isBusy;return(0,r.jsxs)("form",{className:_().stepForm,onSubmit:a=>{a.preventDefault(),b&&e.handlePhoneContinue()},noValidate:!0,children:[(0,r.jsxs)("div",{className:_().headingGroup,children:[(0,r.jsx)(ea,{brandIconUrl:n,brandName:i}),(0,r.jsx)("h1",{id:a,className:_().title,children:m.$D.b.phoneTitle(t)}),(0,r.jsx)("p",{className:_().subtitle,children:m.$D.b.phoneBody})]}),(0,r.jsxs)("div",{className:_().fields,children:[(0,r.jsxs)("div",{className:_().phoneRow,children:[(0,r.jsx)(f,{countries:e.countries,selectedCountryCode:e.selectedCountryCode,onSelect:e.setSelectedCountryCode,disabled:e.isBusy}),(0,r.jsx)(d.p,{ref:p,label:"Phone number",type:"tel",inputMode:"numeric",placeholder:"555-555-5555",className:_().input,value:(0,o.n4)(e.phone),disabled:e.isBusy,error:y,autoComplete:"tel-national",onChange:a=>{let t=(0,o.hR)(a.target.value);e.setPhone(t)},onBlur:()=>g(!0)})]}),v&&(0,r.jsx)(c.o.Body1,{role:"alert",className:_().error,children:v})]}),(0,r.jsx)("div",{className:_().footer,children:(0,r.jsxs)("div",{className:_().backAndVerify,children:[(0,r.jsx)(l.$,{variant:"secondary",size:"large",className:_().backButton,disabled:e.isBusy,onClick:e.handleBackFromPhone,children:m.$D.shared.back}),(0,r.jsx)(l.$,{type:"submit",variant:"primary",size:"large",disabled:!b,rightIcon:(0,r.jsx)(u.F.Svgs.ArrowRight,{size:"20"}),children:m.$D.b.textCodeButton})]})})]})};var w=t(62855);let B=({flow:e,headingId:a,expectedCashbackAmount:t,brandIconUrl:n,brandName:i,onBack:o})=>{let d=e.phone.replace(/\D/g,""),u=d.length>=4?d.slice(-4):"",h=e.errorReason&&"code"===e.errorField?(0,m.JR)(e.errorReason,e.errorMessage):void 0,g="maxAttempts"===e.errorReason?(0,m.JR)("maxAttempts",e.errorMessage):void 0,p=e.resendSecondsRemaining>0||e.isBusy,f=e.isCodeValid&&!e.isBusy,y=(0,s.useCallback)(()=>{f&&e.handleVerify()},[f,e]);return(0,s.useEffect)(()=>{let e=e=>{if("Enter"!==e.key||e.defaultPrevented)return;let a=e.target;a?.tagName!=="BUTTON"&&a?.tagName!=="A"&&("function"!=typeof a?.getAttribute||"button"!==a.getAttribute("role")&&"link"!==a.getAttribute("role"))&&f&&(e.preventDefault(),y())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[f,y]),(0,r.jsxs)("form",{className:_().stepForm,onSubmit:e=>{e.preventDefault(),y()},noValidate:!0,children:[(0,r.jsxs)("div",{className:_().headingGroup,children:[(0,r.jsx)(ea,{brandIconUrl:n,brandName:i}),(0,r.jsx)("h1",{id:a,className:_().title,children:(0,m.kb)(u)}),(0,r.jsx)("p",{className:_().subtitle,children:(0,m.Kp)(t)})]}),(0,r.jsxs)("div",{className:_().fields,children:[(0,r.jsx)(w.A,{value:e.code,onChange:e.setCode,onComplete:()=>{e.isBusy||e.handleVerify()},onSubmit:y,hasError:!!(h||g),disabled:e.isBusy}),(h||g)&&(0,r.jsx)(c.o.Body1,{role:"alert",className:_().error,children:h??g}),(0,r.jsx)("div",{className:_().resendArea,children:(0,r.jsx)(l.$,{variant:"text",size:"large",className:_().resendButton,disabled:p,onClick:()=>void e.requestCode({startCooldown:!0}),children:e.resendSecondsRemaining>0?m.$D.shared.resendCountdown(e.resendSecondsRemaining):m.$D.shared.resend})}),(0,r.jsxs)(c.o.Body1,{className:_().legal,children:[m.$D.shared.consentPrefix,e.legalUrls?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("a",{className:_().legalLink,href:e.legalUrls.privacyPolicyUrl,target:"_blank",rel:"noopener noreferrer",children:m.$D.shared.consentPrivacyLink})," ","and"," ",(0,r.jsx)("a",{className:_().legalLink,href:e.legalUrls.termsOfUseUrl,target:"_blank",rel:"noopener noreferrer",children:m.$D.shared.consentTermsLink}),"."]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:_().legalLink,children:m.$D.shared.consentPrivacyLink})," and"," ",(0,r.jsx)("span",{className:_().legalLink,children:m.$D.shared.consentTermsLink}),"."]})]})]},e.verificationRemountKey),(0,r.jsx)("div",{className:_().footer,children:(0,r.jsxs)("div",{className:_().backAndVerify,children:[(0,r.jsx)(l.$,{variant:"secondary",size:"large",className:_().backButton,disabled:e.isBusy,onClick:o,children:m.$D.shared.back}),(0,r.jsx)(l.$,{type:"submit",variant:"primary",size:"large",disabled:!f,children:m.$D.shared.verify})]})})]})};var A=t(20798),I=t(75865),$=t(44867),D=t(95480),R=t(42307),L=t(56846),U=t(40029),M=t(51764),F=t(38206),P=t(91521),T=t(30839),z=t(79416),G=t(20678),V=t(53965),O=t(68091);
1let H=30,q={invalidPhone:"invalid_phone",invalidEmail:"invalid_email",codeSendFailed:"code_send_failed",invalidCode:"invalid_code",maxAttempts:"max_attempts",signupFailed:"signup_failed",emailAlreadyExists:"email_already_exists",unknown:"unknown"},W={countryCode:"US",countryName:"United States",callingCode:"1",currency:"USD",phoneLengths:[10]},K=["ErrCodeMissingFirstName","ErrCodeMissingLastName","ErrCodeMissingEmail"],X=(e,a)=>{if(e instanceof T.Y){if("ErrCodeInvalidVerificationCode"===e.code)return"invalidCode";if("ErrCodeSMSMaxIncorrectAttempts"===e.code)return"maxAttempts";if("ErrCodeEmailExists"===e.code)return"emailAlreadyExists"}return a},Y=(e,a)=>{if("emailAlreadyExists"===a||!(e instanceof T.Y))return null;let t=e.document?.errors?.[0],r=t?.detail??t?.title;return"string"==typeof r&&r.trim()?r.trim():null},J=({variant:e,guestEmail:a=""})=>{let{getSessionInfo:t}=(0,$.U)(),[r,n]=(0,s.useState)([]),[i,l]=(0,s.useState)(),[o,d]=(0,s.useState)("US"),[c,u]=(0,s.useState)(""),[m,h]=(0,s.useState)(a),[g,p]=(0,s.useState)(""),[f,y]=(0,s.useState)(""),[_,v]=(0,s.useState)(""),[b,x]=(0,s.use
1State)(""),[C,N]=(0,s.useState)(null),[j,k]=(0,s.useState)(!1),[E,S]=(0,s.useState)(null),[w,B]=(0,s.useState)(null),[J,Q]=(0,s.useState)(null),[Z,ee]=(0,s.useState)(null),[ea,et]=(0,s.useState)(0),er=((e=H)=>{let[a,t]=(0,s.useState)(0);return(0,s.useEffect)(()=>{if(a<=0)return;let e=window.setInterval(()=>{t(e=>e<=1?0:e-1)},1e3);return()=>window.clearInterval(e)},[a]),{secondsRemaining:a,start:()=>t(e),reset:()=>t(0)}})(),en=(0,M.mi)()||(0,V.X3)(),ei=(0,s.useRef)((0,G.h)("useClaimCashFlow"));(0,s.useEffect)(()=>{let e=!1;return F.BR.getInternationalConfig(en).then(a=>{if(e)return;let t=(0,P.Mn)(a);t.length>0&&n(t)}).catch(e=>{ei.current.warn("Countries could not be loaded",e)}),F.BR.getDefaultsConfiguration(en).then(P.$X).then(a=>{e||l(a)}).catch(e=>{ei.current.warn("Legal URLs could not be loaded",e)}),()=>{e=!0}},[en]);let es=r.length>0?r:[W],el=es.find(e=>e.countryCode===o)??W,eo=c.replace(/\D/g,""),ed=el.phoneLengths.length>0?Math.min(...el.phoneLengths):10,ec=eo.length>=ed,eu=m.trim().toLowerCase(),em=(0,O.B)(eu),eh=6===_.length,eg=g.trim().length>0&&f.trim().length>0,ep=en?{clientId:en,riskSessionId:(0,M.yB)(),countryCode:el.countryCode,currency:(0,M.LQ)(el.countryCode),anonymousId:(0,M.Cl)()}:void 0,ef=e=>{ee(a=>a&&a.action===e?{action:e,count:a.count+1}:{action:e,count:1})},ey=e=>{Q(a=>a!==e?a:(S(null),B(null),ee(null),null))},e_=async a=>{if(!ec||j)return"error";k(!0),S(null),B(null),Q(null);try{let t=await F.KD.sendPhoneOtp({phone:(e=>{try{return(0,R.L)(e,el.countryCode).format("NATIONAL")}catch{return e}})(eo),countryCode:el.countryCode,deviceUuid:(0,M.hX)(),clientContext:ep}),{patchToken:r,debugSmsCode:n}=(0,z.P)(t);return x(r),n&&!D.Rt.isProduction&&(/^\d{6}$/.test(n)?v(n):ei.current.warn("Ignoring malformed debug SMS code")),a?.startCooldown&&er.start(),ee(null),(0,A.fz)("claim_cash_code_requested",{variant:e}),"sent"}catch(t){let a=X(t,"codeSendFailed");return S(a),B(Y(t,a)),Q("phone"),ef("requestCode"),(0,A.fz)("claim_cash_code_request_failed",{variant:e,reason:q[a]}),ei.current.error("sendPhoneOtp failed",t),"error"}finally{k(!1)}},ev=async()=>{if(!eh||j)return{kind:"error"};k(!0),S(null),B(null),Q(null);try{let a=await F.KD.verifyPhoneOtp({code:_,patchToken:b,deviceUuid:(0,M.hX)(),clientContext:ep});N(_);let t=(0,I.Sy)(a,{isGuest:!1});if(!t)throw Error("verifyPhoneOtp response had no access token");ee(null),(0,A.fz)("claim_cash_code_verified",{variant:e}),(0,A.fz)("claim_cash_signup_completed",{variant:e,reason:"existing_user"}),(0,L.cE)();let r=!!(t.email&&eu&&t.email.trim().toLowerCase()!==eu);return{kind:"signedIn",session:t,emailMismatch:r}}catch(t){if(t instanceof T.Y&&K.includes(t.code)){let a=t.document?.meta?.patch_token;return"string"==typeof a&&x(a),N(_),ee(null),(0,A.fz)("claim_cash_code_verified",{variant:e}),{kind:"profileInfoNeeded"}}let a=X(t,"invalidCode");return S(a),B(Y(t,a)),Q("maxAttempts"===a?null:"code"),ef("verifyCode"),(0,A.fz)("claim_cash_code_verification_failed",{variant:e,reason:q[a]}),ei.current.error("verifyPhoneOtp failed",t),"maxAttempts"===a&&(v(""),er.reset(),et(e=>e+1)),{kind:"error"}}finally{k(!1)}},eb=async(a={})=>{if(j)return{kind:"error",reason:"unknown"};if(!C)return ei.current.warn("completeSignup called without a verified OTP"),S("unknown"),B(null),Q(null),ef("completeSignup"),(0,A.fz)("claim_cash_signup_failed",{variant:e,reason:"missing_verified_otp"}),{kind:"error",reason:"missing_verified_otp"};let t=(a.firstName??g).trim(),r=(a.lastName??f).trim();k(!0),S(null),B(null),Q(null);try{let a=await F.KD.completeProfile({phone:eo,code:C,firstName:t,lastName:r,email:eu,patchToken:b,smsMarketingOptIn:!1,deviceUuid:(0,M.hX)(),clientContext:ep}),n=(0,I.Sy)(a,{isGuest:!1});if(!n)throw Error("completeProfile response had no access token");return ee(null),(0,A.fz)("claim_cash_signup_completed",{variant:e,reason:"new_user"}),(0,L.cE)(),(0,U.p2)(),{kind:"success",session:n}}catch(t){let a=X(t,"signupFailed");return S(a),B(Y(t,a)),Q("emailAlreadyExists"===a?"email":null),ef("completeSignup"),(0,A.fz)("claim_cash_signup_failed",{variant:e,reason:q[a]}),ei.current.error("completeProfile failed",t),{kind:"error",reason:a}}finally{k(!1)}},ex=async()=>
1{if(C)try{await t()}catch(e){ei.current.warn("Auth refresh after hatch close failed",e)}};return{variant:e,countries:es,legalUrls:i,selectedCountryCode:el.countryCode,setSelectedCountryCode:e=>{d(e),u("")},phone:c,setPhone:e=>{u(e),ey("phone")},isPhoneValid:ec,email:m,setEmail:e=>{h(e),ey("email")},isEmailValid:em,firstName:g,setFirstName:e=>{p(e),ey("firstName")},lastName:f,setLastName:e=>{y(e),ey("lastName")},isNameValid:eg,code:_,setCode:e=>{v(e),ey("code")},isCodeValid:eh,isBusy:j,errorReason:E,errorMessage:w,errorField:J,consecutiveFailures:Z?.count??0,showHatch:(Z?.count??0)>=2,hasVerifiedOtp:!!C,resendSecondsRemaining:er.secondsRemaining,verificationRemountKey:ea,requestCode:e_,verifyCode:ev,completeSignup:eb,prefillIdentity:e=>{e.firstName&&p(e.firstName),e.lastName&&y(e.lastName),e.email&&h(e.email)},refreshAuthIfVerified:ex,clearError:()=>{S(null),B(null),Q(null),ee(null)}}},Q=e=>null!==e.offsetParent||e===document.activeElement,Z=e=>Array.from(e.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')).filter(Q),ee=({isOpen:e,stepKey:a,stepHeading:t})=>{let r=(0,s.useRef)(null),n=(0,s.useRef)(null);return(0,s.useEffect)(()=>{if(!e)return;let a=r.current;if(!a)return;let t=a;for(;t.parentElement&&t.parentElement!==document.body;)t=t.parentElement;let n=Array.from(document.body.children).filter(e=>e!==t),i=n.map(e=>({node:e,hadInert:e.hasAttribute("inert"),priorAriaHidden:e.getAttribute("aria-hidden")}));return n.forEach(e=>{e.setAttribute("inert",""),e.setAttribute("aria-hidden","true")}),()=>{i.forEach(({node:e,hadInert:a,priorAriaHidden:t})=>{a||e.removeAttribute("inert"),null===t?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",t)})}},[e]),(0,s.useEffect)(()=>{if(!e)return;let a=e=>{if("Tab"!==e.key)return;let a=r.current;if(!a)return;let t=Z(a);if(0===t.length)return;let n=t[0],i=t[t.length-1];e.shiftKey&&document.activeElement===n?(e.preventDefault(),i.focus()):e.shiftKey||document.activeElement!==i||(e.preventDefault(),n.focus())};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e]),(0,s.useEffect)(()=>{if(!e)return;let a=r.current;if(!a||document.activeElement&&a.contains(document.activeElement)&&document.activeElement!==a)return;let[t]=Z(a);t?.focus()},[e,a]),(0,s.useEffect)(()=>{e&&n.current&&(n.current.textContent=t)},[e,a,t]),{dialogRef:r,liveRegionRef:n}},ea=({brandIconUrl:e,brandName:a})=>
1{let[t,i]=(0,s.useState)(!1),[l,o]=(0,s.useState)(e);e!==l&&(o(e),i(!1));let d=(0,s.useMemo)(()=>e?e.replace(/\/\d{2,3}X\d{2,3}\//,"/64X64/"):null,[e]);return d&&!t?(0,r.jsx)("img",{src:d,alt:a?`${a} logo`:"",className:_().brandLogo,width:64,height:64,onError:()=>i(!0)}):(0,r.jsx)("div",{className:_().brandLogoFallback,"aria-hidden":"true",children:(0,r.jsx)(n.C7,{fill:"var(--color-text-primary, #151519)"})})},et=({currentStep:e,totalSteps:a})=>{let t=Array.from({length:a},(e,a)=>a+1);return(0,r.jsxs)("div",{className:_().progressBarContainer,"aria-hidden":"true",children:[(0,r.jsx)("div",{className:_().progressBarSteps,children:t.map(a=>(0,r.jsx)("div",{className:`${_().progressBarSegment} ${a<=e?_().progressBarSegmentActive:""}`},a))}),(0,r.jsx)("p",{className:_().stepCounter,children:m.$D.b.stepCounter(e,a)})]})},er=({headingId:e,liveRegionRef:a,dialogRef:t,activeStep:n,progressBar:s,showHatch:o,onCloseHatch:d})=>(0,r.jsxs)(i.A,{isOpen:!0,onClose:d,closeOnOverlayClick:!1,closeOnEscape:!1,showCloseButton:!0,className:_().panel,overlayClassName:_().overlay,children:[(0,r.jsxs)("div",{ref:t,role:"dialog","aria-modal":"true","aria-labelledby":e,className:_().content,children:[s,n.content,o&&(0,r.jsx)(l.$,{variant:"text",size:"medium",className:_().hatch,onClick:d,children:m.$D.shared.close})]}),(0,r.jsx)("div",{ref:a,className:_().liveRegion,"aria-live":"polite",role:"status"})]}),en=({guestEmail:e,expectedCashbackAmount:a,brandIconUrl:t,brandName:n,onComplete:i,onSignIn:l,onCloseHatch:o})=>{let d=(({guestEmail:e,onComplete:a,onSignIn:t})=>{let r=J({variant:"a",guestEmail:e}),[n,i]=(0,s.useState)("contact"),l=(0,s.useRef)(null);(0,s.useEffect)(()=>{(0,A.fz)("claim_cash_dialog_shown",{variant:"a"})},[]),(0,s.useEffect)(()=>{l.current!==n&&(l.current=n,(0,A.fz)("claim_cash_step_viewed",{variant:"a",step:n}),"name"===n&&(0,A.fz)("claim_cash_name_step_shown",{variant:"a"}))},[n]);let o=async()=>{"sent"===await r.requestCode()&&i("verification")},d=async()=>{let e=await r.verifyCode();"signedIn"===e.kind?a({session:e.session,emailMismatch:e.emailMismatch}):"profileInfoNeeded"===e.kind&&i("name")},c=async()=>{let e=await r.completeSignup();"success"===e.kind&&a({session:e.session,emailMismatch:!1})};return{...r,step:n,handleContactContinue:o,handleVerify:d,handleFinishName:c,handleChangeEmail:()=>i("contact"),handleBackFromVerification:()=>{r.clearError(),i("contact")},handleSignInTapped:()=>{(0,A.fz)("claim_cash_abandoned",{variant:"a",step:n}),t()}}})({guestEmail:e,onComplete:i,onSignIn:l}),c=(0,s.useId)(),u="contact"===d.step?m.$D.a.title(a):"verification"===d.step?(0,m.kb)(d.phone.replace(/\D/g,"").slice(-4)):m.$D.shared.nameTitle,{dialogRef:h,liveRegionRef:g}=ee({isOpen:!0,stepKey:d.step,stepHeading:u}),p="contact"===d.step?(0,r.jsx)(v,{flow:d,headingId:c,expectedCashbackAmount:a,brandIconUrl:t,brandName:n}):"verification"===d.step?(0,r.jsx)(B,{flow:d,headingId:c,expectedCashbackAmount:a,brandIconUrl:t,brandName:n,onBack:d.handleBackFromVerification}):(0,r.jsx)(E,{flow:d,headingId:c,brandIconUrl:t,brandName:n,onChangeEmail:d.handleChangeEmail});return(0,r.jsx)(er,{headingId:c,liveRegionRef:g,dialogRef:h,activeStep:{content:p},showHatch:d.showHatch,onCloseHatch:()=>{d.refreshAuthIfVerified().finally(o)}})},ei=({guestEmail:e,expectedCashbackAmount:a,brandIconUrl:t,brandName:n,onComplete:i,onSignIn:l,onCloseHatch:o})=>{let d=(({guestEmail:e,onComplete:a,onSignIn:t})=>{let r=J({variant:"b",guestEmail:e}
1),[n,i]=(0,s.useState)("identity"),[l,o]=(0,s.useState)(!1),[d,c]=(0,s.useState)(!1),[u,m]=(0,s.useState)(null),[h,g]=(0,s.useState)(null),p=(0,s.useRef)(null),f=(0,x.Vn)({onSuccess:e=>{let a,t;m(null),r.prefillIdentity(e),o((a=e.firstName,t=e.lastName,a.trim().length>0&&t.trim().split(/\s+/).filter(Boolean).length>0)),e.email&&i("phone")},onCancelled:()=>{m(null),(0,A.fz)("claim_cash_sso_failed",{variant:"b",reason:"cancelled"}),g("cancelled")},onFailed:()=>{m(null),(0,A.fz)("claim_cash_sso_failed",{variant:"b",reason:"failed"}),g("failed")}});(0,s.useEffect)(()=>{(0,A.fz)("claim_cash_dialog_shown",{variant:"b"})},[]),(0,s.useEffect)(()=>{p.current!==n&&(p.current=n,(0,A.fz)("claim_cash_step_viewed",{variant:"b",step:n}),"name"===n&&(0,A.fz)("claim_cash_name_step_shown",{variant:"b"}))},[n]);let y={identity:1,phone:2,verification:3,name:4}[n],_=async e=>{if(!u){g(null),m(e),(0,A.fz)("claim_cash_sso_started",{variant:"b",provider:e});try{await ("google"===e?f.handleGoogle():f.handleApple())}finally{m(null)}}},v=async()=>{"sent"===await r.requestCode()&&i("verification")},b=async()=>{let e=await r.verifyCode();if("signedIn"===e.kind)return void a({session:e.session,emailMismatch:e.emailMismatch});if("profileInfoNeeded"===e.kind){if(!l)return void i("name");c(!0);try{let e=await r.completeSignup();"success"===e.kind?a({session:e.session,emailMismatch:!1}):"emailAlreadyExists"===e.reason&&i("identity")}finally{c(!1)}}},C=async()=>{let e=await r.completeSignup();"success"===e.kind&&a({session:e.session,emailMismatch:!1})};return{...r,step:n,currentStep:y,totalSteps:l?3:4,hasUsableName:l,isBusy:r.isBusy||d,ssoBusyProvider:u,ssoError:h,handleProviderTapped:_,handleContinueWithEmail:e=>{r.setEmail(e),i("phone")},handlePhoneContinue:v,handleVerify:b,handleFinishName:C,handleChangeEmail:()=>i("identity"),handleBackFromPhone:()=>{r.clearError(),i("identity")},handleBackFromVerification:()=>{r.clearError(),i("phone")},handleSignInTapped:()=>{(0,A.fz)("claim_cash_abandoned",{variant:"b",step:n}),t()}}})({guestEmail:e,onComplete:i,onSignIn:l}),c=(0,s.useId)(),u="identity"===d.step?m.$D.b.identityTitle:"phone"===d.step?m.$D.b.phoneTitle(a):"verification"===d.step?(0,m.kb)(d.phone.replace(/\D/g,"").slice(-4)):m.$D.shared.nameTitle,{dialogRef:h,liveRegionRef:g}=ee({isOpen:!0,stepKey:d.step,stepHeading:u}),p="identity"===d.step?(0,r.jsx)(k,{flow:d,headingId:c,brandIconUrl:t,brandName:n}):"phone"===d.step?(0,r.jsx)(S,{flow:d,headingId:c,expectedCashbackAmount:a,brandIconUrl:t,brandName:n}):"verification"===d.step?(0,r.jsx)(B,{flow:d,headingId:c,expectedCashbackAmount:a,brandIconUrl:t,brandName:n,onBack:d.handleBackFromVerification}):(0,r.jsx)(E,{flow:d,headingId:c,brandIconUrl:t,brandName:n,onChangeEmail:d.handleChangeEmail});return(0,r.jsx)(er,{headingId:c,liveRegionRef:g,dialogRef:h,activeStep:{content:p},progressBar:(0,r.jsx)(et,{currentStep:d.currentStep,totalSteps:d.totalSteps}),showHatch:d.showHatch,onCloseHatch:()=>{d.refreshAuthIfVerified().finally(o)}})},es=e=>"a"===e.variant?(0,r.jsx)(en,{...e}):(0,r.jsx)(ei,{...e})}}]);
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.