1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8487],{859:(e,t,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/checkout/payment",function(){return a(35384)}])},8400:(e,t,a)=>{"use strict";a.d(t,{A:()=>l});var n=a(6029);let l=e=>{let{children:t,UNSAFE_className:a=""}=e;return(0,n.jsx)("span",{className:"tw-lf-title-sm tw-mb-1 tw-whitespace-pre-line desktop:tw-lf-title-lg ".concat(a),children:t})}},15396:(e,t,a)=>{"use strict";a.d(t,{A:()=>l});var n=a(6029);let l=e=>{let{children:t}=e;return(0,n.jsx)("div",{className:"tw-flex tw-w-full tw-flex-row tw-items-center tw-justify-center tw-gap-2 desktop:tw-gap-4",children:t})}},18203:(e,t,a)=>{"use strict";a.d(t,{A:()=>d});var n=a(7234),l=a(3948),r=a(95295),s=a(58370),i=a(70703);let d=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0,[a]=(0,n.n)(r.rS),[d]=(0,l._)(r.Yy),{refreshList:o}=(0,s.mu)(),c=async(n,l,r)=>{await a({variables:{paymentMethodId:n,paymentMethodSource:l,financialPaymentId:r}}),(0,i.sx)({type:"LFPaymentMethodUpdated",data:{payment_method_action:"added",update_source:t}}),e&&await o()},m=async(e,t)=>{var a;let{data:n}=await d({variables:{paymentId:e}}),l=null==n||null==(a=n.getPayment)?void 0:a.paymentMethodId;if(!l)throw Error("[payment] Cannot retrieve new Payment to attach it.");await c(l,t,e)};return{handleAddPaymentMethod:c,handleAddNewCard:m}}},18902:(e,t,a)=>{"use strict";a.d(t,{A:()=>l});var n=a(6029);let l=e=>{let{children:t}=e;return(0,n.jsx)("span",{className:"tw-lf-body-regular-sm tw-whitespace-pre-line tw-leading-[21px] desktop:tw-lf-body-regular-md desktop:tw-leading-6",children:t})}},30872:(e,t,a)=>{"use strict";a.d(t,{A:()=>c});var n=a(6029),l=a(82203),r=a.n(l),s=a(42043),i=a(22526),d=a(56461),o=a(82882);let c=e=>{let{customStyle:t,isCheckout:a}=e,{isFrenchMarket:l,isGermanMarket:c}=(0,o.A)(),{getPath:m}=(0,d.A)(),u=(0,s.useTranslations)("Account");return c?(0,n.jsxs)("p",{className:"".concat(t," tw-text-center tw-text-xs [&>*]:tw-text-black-600"),children:[(0,n.jsxs)("span",{className:"tw-lf-caption-regular",children:[u(a?"clickingNextYouAcceptCheckout":"clickingNextYouAccept")," "]}),(0,n.jsx)(r(),{href:m(i.Q.LEGAL_CONDITIONS),legacyBehavior:!0,children:(0,n.jsxs)("a",{className:"tw-lf-link-inherit","data-testid":"RegisterByEmailForm-go-to-general-conditions",children:[u("generalConditions")," "]})}),(0,n.jsx)("span",{className:"tw-lf-caption-regular",children:u("ofCompanyName")})]}):l?(0,n.jsxs)("p",{className:"".concat(t," tw-lf-body-regular-sm [&>a]:tw-lf-link-inherit"),children:[(0,n.jsx)("span",{children:u(a?"generalConditions1Checkout":"generalConditions1")}),(0,n.jsx)(r(),{href:m(i.Q.CGU),children:u("generalConditionsCGU")}),(0,n.jsx)("span",{children:u("generalConditions2")}),(0,n.jsx)(r(),{href:m(i.Q.CGV),children:u("generalConditionsCGV")}),(0,n.jsx)("span",{children:u("generalConditions3")}),(0,n.jsx)(r(),{href:m(i.Q.PRIVACY_POLICIES),children:u("generalConditionsPolicy")}),(0,n.jsx)("span",{children:u("generalConditions4")})]}):null}},34471:(e,t,a)=>{"use strict";a.d(t,{A:()=>i});var n=a(6029),l=a(53718),r=a(90925),s=a(35133);let i=(0,a(55729).forwardRef)((e,t)=>{let{children:a,onClick:i,UNSAFE_className:d}=e,o=(0,l.Ub)(800);return(0,n.jsxs)("button",{ref:t,type:"button",onClick:i,className:"".concat(d," tw-lf-button tw-lf-button-sm tw-mt-2 tw-w-full desktop:tw-lf-button-md desktop:tw-mt-1"),children:[(0,n.jsx)("span",{className:"check-icon","aria-hidden":!0,children:(0,n.jsx)(r.A,{size:o?s.y3.sm:s.y3.md})}),a]})})},35104:(e,t,a)=>{"use strict";a.d(t,{A:()=>l});var n=a(6029);let l=e=>{let{children:t,UNSAFE_className:a}=e;return(0,n.jsx)("span",{className:"".concat(a," tw-lf-body-bold-sm tw-mb-2 desktop:tw-lf-body-bold-md"),children:t})}},35384:(e,t,a)=>{"use strict";a.r(t),a.d(t,{__N_SSG:()=>tj,default:()=>tA});var n=a(6029),l=a(55729),r=a(4378),s=a(81278),i=a(60750),d=a(42278),o=a(62338),c=a(93017),m=a(31973),u=a(76305),h=a(31072),p=a(42043),y=a(78135),x=a(8444),w=a(21347),f=a(31064),g=a(22526),b=a(70703),C=a(44535),v=a(17323),j=a(14684),A=a(77902),P=a(80071),k=a(79002),N=a.n(k);let T=e=>{let{width:t,height:a,color:l="#000",...r}=e;return(0,n.jsx)("svg",{width:t||32,height:a||32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r,children:(0,n.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.83134 3.01101C9.65471 1.98529 11.7591 1.40023 14.0002 1.40023C16.1954 1.40023 18.2596 1.9616 20.0568 2.94861L17.0515 7.84767C16.084 7.42148 14.8905 7.09946 13.9992 7.09946C12.9043 7.09946 11.8676 7.35491 10.9469 7.80964L7.83134 3.01101ZM6.73931 3.70131C5.59475 4.50968 4.59091 5.50403 3.77177 6.64037L8.61803 9.67956C8.97668 9.23344 9.38967 8.83289 9.84702 8.48792L6.73931 3.70131ZM3.07091 7.72569C2.00779 9.57334 1.39974 11.716 1.39974 14.0007C1.39974 15.4372 1.65679 16.6632 1.77387 17.0634C1.77617 17.0712 1.77832 17.0791 1.78032 17.0871C2.06536 18.2194 2.50367 19.2907 3.07189 20.2778L7.87226 17.1793C7.37761 16.2275 7.09809 15.146 7.09809 14.0006C7.09809 12.8294 7.39036 11.725 7.90601 10.7579L3.07091 7.72569ZM3.77291 21.3629C4.62839 22.5491 5.6852 23.5805 6.89323 24.4071L9.88009 19.538
11C9.39009 19.1731 8.95026 18.7446 8.57272 18.2647L3.77291 21.3629ZM7.99534 25.081C9.78056 26.0505 11.8262 26.6012 14.0002 26.6012C16.3384 26.6012 18.5279 25.9643 20.4046 24.8546L17.3029 20.061C16.3213 20.5971 15.1952 20.9018 13.9992 20.9018C12.9189 20.9018 11.8952 20.6531 10.9837 20.2096L7.99534 25.081ZM21.4815 24.1409C22.7557 23.1992 23.8462 22.023 24.6892 20.6761L19.6002 18.0332C19.2494 18.5197 18.8368 18.9585 18.3739 19.3383L21.4815 24.1409ZM25.3176 19.5468C26.1393 17.8733 26.6007 15.9909 26.6007 14.0007C26.6007 11.717 25.9932 9.57524 24.9309 7.72815L20.1265 10.8225C20.621 11.7741 20.9004 12.8554 20.9004 14.0006C20.9004 15.0422 20.6692 16.0312 20.2552 16.9178L25.3176 19.5468ZM24.2304 6.64277C23.3859 5.47069 22.345 4.44959 21.1558 3.62771L18.1671 8.49971C18.6377 8.85681 19.0611 9.2729 19.4262 9.73702L24.2304 6.64277ZM14.0002 0.108398C6.32771 0.108398 0.10791 6.3282 0.10791 14.0007C0.10791 15.5542 0.380021 16.8934 0.530467 17.4139C2.05189 23.4358 7.50472 27.893 14.0002 27.893C21.6727 27.893 27.8925 21.6732 27.8925 14.0007C27.8925 6.3282 21.6727 0.108398 14.0002 0.108398ZM13.9992 8.39128C14.7919 8.39128 16.0746 8.76551 16.9728 9.24333C17.6724 9.68163 18.2686 10.2701 18.7161 10.9634C19.2808 11.8384 19.6086 12.8802 19.6086 14.0006C19.6086 15.0468 19.3228 16.0243 18.8253 16.8614C18.4022 17.5735 17.8257 18.1843 17.1415 18.6479C16.2453 19.2552 15.1647 19.6099 13.9992 19.6099C12.9326 19.6099 11.9373 19.3128 11.0894 18.7972C10.3623 18.3551 9.74341 17.7521 9.28244 17.0378C8.71772 16.1628 8.38992 15.121 8.38992 14.0006C8.38992 12.8545 8.73299 11.7904 9.32191 10.9031C9.77433 10.2214 10.3719 9.64425 11.0701 9.21579C11.9222 8.6929 12.9245 8.39128 13.9992 8.39128Z",fill:l})})};var E=a(56461);let _=()=>{let e=(0,p.useTranslations)("CustomerLove"),{getUrl:t}=(0,E.A)();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"jsx-c84937e5878ed13f container",children:[(0,n.jsxs)("div",{className:"jsx-c84937e5878ed13f title h4b",children:[(0,n.jsx)(T,{})," ".concat(e("needHelp"))]}),(0,n.jsx)("p",{className:"jsx-c84937e5878ed13f",children:e.rich("link",{a:e=>(0,n.jsx)("a",{href:t(g.Q.SUPPORT_NEW_REQUEST_URL),target:"_blank",rel:"noreferrer","data-testid":"NeedHelp-anchor",className:"jsx-c84937e5878ed13f tw-lf-link-md",children:e})})})]}),(0,n.jsx)(N(),{id:"c84937e5878ed13f",children:".title.jsx-c84937e5878ed13f{display:flex;align-items:center;margin-bottom:var(--space-2)}.container.jsx-c84937e5878ed13f{max-width:400px}"})]})};var M=a(7746),I=a(94684),S=a(92275),L=a(92520),F=a(74363),R=a.n(F),D=a(70585),Y=a(48796),O=a(55932),H=a(83800),U=a(76277);let K=()=>{let e=(0,p.useTranslations)("Checkout"),t=(0,U.KH)(x.DxL),a=(0,U.KH)(x.sCe);return(0,n.jsx)("button",{disabled:!t,className:"tw-lf-button tw-lf-button-primary tw-lf-button-md tw-w-full","data-testid":"Pay-Cta-Disabled",onClick:t||a?()=>{y.oR.error(e("selectPaymentMethodError"))}:void 0,children:e("finishCheckout")})};var V=a(35127),W=a(7234),G=a(95295),B=a(75581),q=a(49779),Q=a(57674),z=a(5761
15),X=a(78545),Z=a(89542),$=a(67792);let J=()=>{let e=(0,s.useRouter)(),{authUser:t,customer:a}=(0,L.uM)(),{deleteCurrentShoppingCart:n}=(0,Q.UI)(),{checkoutCart:r,membershipPlan:o}=(0,i.bK)(),{totalEconomy:c}=(0,q.vO)(),{isSubscriptionAvailable:m}=(0,M.X)(L.uM),{validatedCoupon:u}=(0,B.Ph)(),{setIsOrderValidationInProgress:h,selectedPaymentType:p}=(0,H.qF)(),{handlePaymentError:y}=(0,X.A)(),{checkEligibility:x}=(0,i.hO)(),[w]=(0,W.n)(G.Bi),f=(0,l.useRef)(null),C=(0,l.useRef)(!1),v=async()=>{var l,s,i,f,C,v;try{if(!(null==r?void 0:r.id))throw Error("Cannot complete order without checkoutCart id.");let h={};m&&(h={withSubscription:!0,subscriptionPromotionCode:u.code||void 0,membershipPlan:o,paymentMetadata:{app:(0,Z.FS)(),platform:(0,Z.BE)()}});let C=await w({variables:{tokenValue:r.id,...h}});try{r.shippingAddress&&x({street:r.shippingAddress.street,city:r.shippingAddress.city,postalCode:r.shippingAddress.postcode,country:r.shippingAddress.countryCode}),m&&((null==(s=C.data)||null==(l=s.completeOrder)?void 0:l.subscriptionId)?(0,z.Zl)({subscriptionId:C.data.completeOrder.subscriptionId,email:null==t?void 0:t.email,promotionCode:u,freeTrialStartType:g.Ld.checkout,isMembershipAsAProduct:!0,freeTrialPaymentMethod:p?$.iT[p]:"unknown"}):y({code:"MAAP_SUBS_FAILED",message:"Subscription was not created during completeOrder (MAAP flow)."})),await n(),o===g.cG.MONTHLY&&(0,b.sx)({type:"LFStartMonthlySubscription",data:{subscription_id:null==(f=C.data)||null==(i=f.completeOrder)?void 0:i.subscriptionId,subscription_email:null==t?void 0:t.email,coupon_name:u.code,coupon_id:u.id}});let{pastSavingsAmount:h,newSavingsAmount:w,isFirstOrder:v,isFreeTrialStart:j}=(0,$.hN)({checkoutCart:r,customer:a,totalEconomy:c,isSubscriptionAvailable:m,selectedPaymentType:p});e.push({pathname:"/checkout/confirmation",query:{savings:(0,d.GP)(w),pastSavingsAmount:h,newSavingsAmount:w,isFirstOrder:v,"cs-free-trial-start":j}},"/checkout/confirmation")}catch(t){y({code:"POST_ORDER_SIDE_EFFECT_FAILED",message:"Order completed but a post-order side effect failed.",error:t}),e.push("/checkout/confirmation")}return!0}catch(e){h(!1),y({code:(null==e||null==(v=e.graphQLErrors)||null==(C=v[0])?void 0:C.code)==="ORDER_OUT_OF_STOCK"?"ORDER_OUT_OF_STOCK":"COMPLETE_ORDER_FAILED",message:!(null==e?void 0:e.graphQLErrors)&&(null==e?void 0:e.message)?e.message:"Cannot complete order.",shouldDisplayError:!0,error:e})}return!1};return{completeOrder:async()=>{if(C.current)return!0;if(f.current)return f.current;let e=v();f.current=e;try{let t=await e;return C.current=t,t}finally{f.current=null}}}},ee=()=>{let e=(0,p.useTranslations)("Checkout"),{isOrderValidationInProgress:t,setIsOrderValidationInProgress:a}=(0,H.qF)(),{completeOrder:l}=J(),r=async()=>{a(!0),await l()};return(0,n.jsx)(V.A,{onClick:()=>r(),isLoading:t,dataTestId:"Pay-Nothing-Cta",children:e("finishCheckout")})};var et=a(26923);let ea=()=>{let e=(0,p.useTranslations)("Checkout"),{checkoutCart:t}=(0,i.bK)(),{authUser:a}=(0,L.uM)(),{state:r,send:s,registerCompleteOrder:d}=(0,i.cO)(),{isOrderValidationInProgress:o,setIsOrderValidationInProgress:c,selectedExistingPaymentMethod:m}=(0,H.qF)(),{completeOrder:u}=J(),{handlePaymentError:h}=(0,X.A)();(0,l.useEffect)(()=>{d(()=>u())},[d,u]);let[y]=(0,W.n)(G.hu),x=async()=>{c(!0),s({type:et.$S.SUBMIT_CARD});try{var e,n;if(!(null==t?void 0:t.id)||!(null==t||null==(e=t.payment)?void 0:e.id)||!m)throw Error("Try to validate an order with incomplete data (pay with an existing Card).");let{data:l}=await y({variables:{tokenValue:t.id,cartPaymentId:t.payment.id,paymentMethodId:m.existingPaymentMethodId,paymentMethodCode:m.paymentMethodCode}});if(!(null==l||null==(n=l.createPaymentIntentForExistingPM)?void 0:n.payment))throw Error("Create Payment Intent failed with empty response.");let r=l.createPaymentIntentForExistingPM.payment.financialPaymentRedirectLink;if(r)s({type:et.$S.CREATE_PAYMENT_WITH_3DS,url3DSecure:r,paymentId:l.createPaymentIntentForExistingPM.payment.financialPaymentIntentId});else{let e={message:"[checkout] A non 3DS payment has been validated (existing card).",context:{user_id:null==a?void 0:a.uid,cart_id:t.id,cart_payment_id:t.payment.id,checkout_cart:t,selected_pm:m}};R().warn(e.message,e.context),await u()||s({type:et.$S.RESET})}}catch(e){s({type:et.$S.RESET}),c(!1),h({code:"PAY_WITH_EXISTING_CARD_FAILED",message:!(null==e?void 0:e.graphQLErrors)&&(null==e?void 0:e.message)?e.message:"Cannot create a PaymentIntent for an existing card or complete an order for a non-3DS card.",shouldDisplayError:!0,error:e,context:{selected_pm:m}})}};return((0,l.useEffect)(()=>
1{if(r.value===et.Q1.INITIAL)return void c(!1);r.value===et.Q1["3D_SECURE_SUCCEEDED"]&&s({type:et.$S.COMPLETE_ORDER})},[r]),null==t?void 0:t.id)?(0,n.jsx)(V.A,{onClick:()=>x(),isLoading:o,dataTestId:"ActionButtons-order-payment",children:e("finishCheckout")}):null},en=()=>{let e=(0,p.useTranslations)("Checkout"),{checkoutCart:t}=(0,i.bK)(),{isOrderValidationInProgress:a,setIsOrderValidationInProgress:l,selectedExistingPaymentMethod:r}=(0,H.qF)(),{completeOrder:s}=J(),{handlePaymentError:d}=(0,X.A)(),[o]=(0,W.n)(G.hu),c=async()=>{l(!0);try{var e;if(!(null==t?void 0:t.id)||!(null==t||null==(e=t.payment)?void 0:e.id)||!r)throw Error("Try to validate a free order with incomplete data.");await o({variables:{tokenValue:t.id,cartPaymentId:t.payment.id,paymentMethodId:r.existingPaymentMethodId,paymentMethodCode:r.paymentMethodCode}}),await s()}catch(e){l(!1),d({code:"PAY_WITH_EXISTING_PAYPAL_FAILED",message:!(null==e?void 0:e.graphQLErrors)&&(null==e?void 0:e.message)?e.message:"Cannot validate order (pay with existing paypal flow)",shouldDisplayError:!0,error:e,context:{selected_pm:r}})}};return(null==t?void 0:t.id)?(0,n.jsx)(V.A,{onClick:()=>c(),isLoading:a,dataTestId:"ActionButtons-order-payment",children:e("finishCheckout")}):null};var el=a(6226),er=a(18203);let es=()=>{let e=(0,p.useTranslations)("Checkout"),{authUser:t}=(0,L.uM)(),{checkoutCart:a}=(0,i.bK)(),{isOrderValidationInProgress:r,setIsOrderValidationInProgress:s,selectedNewCheckoutComCard:d}=(0,H.qF)(),{send:o,state:c,registerCompleteOrder:m}=(0,i.cO)(),{handleAddNewCard:u}=(0,er.A)(!1,"checkout"),{completeOrder:h}=J(),{isSubscriptionAvailable:y}=(0,M.X)(L.uM),{handlePaymentError:x}=(0,X.A)(),w=y||(null==d?void 0:d.shouldSaveCardForFutureUse),[f]=(0,W.n)(G.tQ),b=async e=>{if(w)try{await u(e.paymentId,g.vT.CHECKOUT)}catch(e){x({code:"ATTACH_WITH_NEW_CARD_FAILED",message:!(null==e?void 0:e.graphQLErrors)&&(null==e?void 0:e.message)?e.message:"Cannot attach a new card.",error:e,context:{selected_card_status:d}})}return h()};(0,l.useEffect)(()=>{m(b)},[m,b]);let C=async()=>{s(!0);try{var e,n;if(!(null==a?void 0:a.id)||!(null==a||null==(e=a.payment)?void 0:e.id)||!(null==d?void 0:d.paymentMethodCode))throw Error("Try to pay with a new card with corrumpted checkoutCart.");let l=await el.Hc.submitCard();if(!l.token)throw Error("No token generated for the user new card.");o({type:et.$S.SUBMIT_CARD});let{data:r}=await f({variables:{tokenValue:a.id,cartPaymentId:a.payment.id,temporaryPaymentMethodToken:l.token,paymentMethodCode:d.paymentMethodCode,saveCardForFutureUse:y||d.shouldSaveCardForFutureUse}});if(!(null==r||null==(n=r.createPaymentIntentForNewCard)?void 0:n.payment))throw Error("Create Payment Intent failed with empty response.");let s=r.createPaymentIntentForNewCard.payment.financialPaymentRedirectLink;if(s)o({type:et.$S.CREATE_PAYMENT_WITH_3DS,url3DSecure:s,paymentId:r.createPaymentIntentForNewCard.payment.financialPaymentIntentId});else{let e={message:"[checkout] A non 3DS payment has been validated (new card).",context:{user_id:null==t?void 0:t.uid,cart_id:a.id,cart_payment_id:a.payment.id,selected_card_status:d}};console.warn(e.message,e.context),R().warn(e.message,e.context),await b(c.context)||o({type:et.$S.RESET})}}catch(e){o({type:et.$S.RESET}),s(!1),x({code:"PAY_WITH_NEW_CARD_FAILED",message:!(null==e?void 0:e.graphQLErrors)&&(null==e?void 0:e.message)?e.message:"Cannot create a PaymentIntent for a new card or complete an order for a non-3DS card.",shouldDisplayError:!0,error:e,context:{selected_card_status:d}})}};return((0,l.useEffect)(()=>{if(c.value===et.Q1.INITIAL)return void s(!1);c.value===et.Q1["3D_SECURE_SUCCEEDED"]&&o({type:et.$S.COMPLETE_ORDER})},[c]),null==a?void 0:a.id)?(0,n.jsx)(V.A,{onClick:()=>C(),isLoading:r,dataTestId:"ActionButtons-order-payment",children:e("finishCheckout")}):null};var ei=a(22437),ed=a(50619);let eo=()=>{var e;let{checkoutCart:t}=(0,i.bK)(),{setIsOrderValidationInProgress:a,selectedNewPaypal:r}=(0,H.qF)(),[s,d]=(0,l.useState)(!0),o=(0,l.useRef)(""),{completeOrder:c}=J(),{handlePaymentError:m}=(0,X.A)(),[u]=(0,W.n)(G.oH);return((0,l.useEffect)(()=>{o.current!==(null==t?void 0:t.id)&&d(!1)},[o.current]),(null==t?void 0:t.id)&&(null==t||null==(e=t.payment)?void 0:e.id)&&(null==r?void 0:r.paymentMethodCode))?(0,n.jsx)(ei.A,{hideButton:s,children:(0,n.jsx)(ed.JV,{fundingSource:x.XTk[r.paypalType],onInit:()=>{d(!1)},createOrder:async()=>{var e,n,l;a(!0);let{data:s}=await u({variables:{tokenValue:t.id,cartPaymentId:null==(e=t.payment)?void 0:e.id,paymentMethodCode:r.paymentMethodCode}});if(!(null==s||null==(l=s.createPaymentIntentForNewPaypal)||null==(n=l.payment)?void 0:n.paypalOrderId))throw Error("Create Payment Intent failed with empty response.");return o.current=s.createPaymentIntentForNewPaypal.id,s.createPaymentIntentForNewPaypal.payment.paypalOrderId},onApprove:async()=>{await c()},onCancel:()=>{d(!1),a(!1)},onError:e=>{d(!1),a(!1),m({code:"PAY_WITH_NEW_PAYPAL_FAILED",message:"string"==typeof(null==e?void 0:e.stack)&&e.stack.includes("ApolloError")||"string"!=typeof(null==e?void 0:e.message)?"Cannot pay with Paypal":e.message,shouldDisplayError:!0,error:e,context:{paypal_method_type:null==r?void 0:r.paypalType}})},style:{layout:"horizontal",tagline:!1,shape:"pill",color:"gold"}},x.XTk[r.paypalType])}):null};var ec=a(82882),em=a(90744),eu=a(15565),eh=a(52093),ep=a(7029),ey=a(42396);let ex=e=>{let{type:t="check-out"}=e,{checkoutCart:a}=(0,i.bK)(),{locale:r}=(0,ec.A)(),s=(0,p.useTranslations)("Account"),o=(0,p.useTranslations)("Cart"),{handlePaymentError:c}=(0,X.A)(),{requestPayload:m}=(0,em.A)(),{isApplePayAvailable:u,isCheckingApplePayAvailability:h}=(0,eu.A)(),{url:y}=(0,ep.A)(),{monthlySubscriptionPrice:x}=(0,eh.A)(),{discountedPrice:f}=(0,B.Ph)(),{membershipPlan:b}=(0,i.bK)(),C=b===g.cG.YEARLY,{completeOrder:v}=J(),{isMember:j}=(0,L.uM)(),A=(0,l.useRef)(null),{setIsOrderValidationInProgress:P,
1selectedNewApplePay:k}=(0,H.qF)(),{isSubscriptionAvailable:T}=(0,M.X)(L.uM),[E]=(0,W.n)(G.qO),[_]=(0,W.n)(G.v6),{handleAddNewCard:I}=(0,er.A)(!1,"checkout"),S={...m((null==a?void 0:a.total)||0),...!j&&{recurringPaymentRequest:{managementURL:"".concat(y,"/pages/manage-my-subscription"),paymentDescription:"Recurring payment",regularBilling:{label:s("subscriptionRecurring"),amount:(C?f:x).toString(),paymentTiming:"recurring",...C&&{recurringPaymentStartDate:new Date((0,d.Hr)())},recurringPaymentIntervalUnit:C?"year":"month"},...C&&{billingAgreement:s("subscriptionBillingAgreement"),trialBilling:{label:o("MembershipProductCart.productName"),amount:"0.00",paymentTiming:"recurring"}}}}},F=T||(null==k?void 0:k.shouldSaveCardForFutureUse),R=async e=>{try{var t,n,l,r;if(!(null==a?void 0:a.id)||!(null==a||null==(t=a.payment)?void 0:t.id)||!(null==k?void 0:k.paymentMethodCode))throw Error("Try to pay with a new card with corrupted checkoutCart.");let{data:s}=await E({variables:{token:e.paymentData}});if(!(null==s||null==(n=s.createPspTokenFromApplePayToken)?void 0:n.token))throw Error("No token generated for the user new apple pay card.");let{data:i}=await _({variables:{tokenValue:a.id,cartPaymentId:a.payment.id,temporaryPaymentMethodToken:null==s||null==(l=s.createPspTokenFromApplePayToken)?void 0:l.token,paymentMethodCode:k.paymentMethodCode,saveCardForFutureUse:T||k.shouldSaveCardForFutureUse}});if(!(null==i||null==(r=i.createPaymentIntentForNewApplePayCard)?void 0:r.payment))throw Error("Create Payment Intent failed with empty response.");let{financialPaymentIntentId:d}=i.createPaymentIntentForNewApplePayCard.payment;return await Y(d),!0}catch(e){return P(!1),c({code:"PAY_WITH_NEW_CARD_FAILED",message:!(null==e?void 0:e.graphQLErrors)&&(null==e?void 0:e.message)?e.message:"Cannot create a PaymentIntent for a new card or complete an order for a non-3DS card.",shouldDisplayError:!0,error:e,context:{selected_apple_pay_status:k}}),!1}},{createSession:D}=(0,ey.A)({onPaymentAuthorized:R,paymentRequestPayload:S}),Y=async e=>{if(F)try{if(!e)throw Error("Payment ID is required to attach a new apple pay card.");await I(e,g.vT.CHECKOUT)}catch(e){c({code:"ATTACH_WITH_NEW_APPLE_PAY_CARD_FAILED",message:!(null==e?void 0:e.graphQLErrors)&&(null==e?void 0:e.message)?e.message:"Cannot attach a new apple pay card.",error:e,context:{selected_apple_pay_status:k}})}await v()||P(!1)},O=async()=>{if(!a)return c({code:"CREATE_NEW_APPLE_PAY_REQUEST_FAILED",message:"Cannot proceed with Apple Pay payment without a checkout cart"}),null;D()};return((0,l.useEffect)(()=>{if(A.current)return A.current.addEventListener("click",O),()=>{var e;return null==(e=A.current)?void 0:e.removeEventListener("click",O)}},[O]),h)?(0,n.jsx)(w.A,{}):u?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("apple-pay-button",{ref:A,buttonstyle:"black",type:t,locale:r,className:"jsx-bbffeec3d0fe6d4d"}),(0,n.jsx)(N(),{id:"bbffeec3d0fe6d4d",children:"apple-pay-button{--apple-pay-button-border-radius:100px;--apple-pay-button-height:44px;--apple-pay-button-width:100%}"})]}):void 0};var ew=a(23538);let ef=()=>{var e;let{checkoutCart:t}=(0,i.bK)(),{setIsOrderValidationInProgress:a,selectedNewPaypal:l}=(0,H.qF)(),{completeOrder:r}=J(),{handleAddPaymentMethod:s}=(0,er.A)(!1,"checkout"),{handlePaymentError:d}=(0,X.A)(),[o]=(0,W.n)(G.NV);return(null==t?void 0:t.id)&&(null==t||null==(e=t.payment)?void 0:e.id)&&(null==l?void 0:l.paymentMethodCode)?(0,n.jsx)(ew.A,{onStartBillingAgreement:()=>{a(!0)},onCancel:()=>{a(!1)},onError:e=>{a(!1),d({code:"AUTHORIZE_NEW_PAYPAL_BILLING_AGREEMENT_FAILED",message:"string"==typeof(null==e?void 0:e.stack)&&e.stack.includes("ApolloError")||"string"!=typeof(null==e?void 0:e.message)?"Cannot generate or authorize a Paypal Billing Agreement (MAAP flow)":e.message,shouldDisplayError:!0,error:e,context:{paypal_method_type:null==l?void 0:l.paypalType}})},onApprove:async e=>{try{var n,i;let{data:a}=await o({variables:{tokenValue:t.id,cartPaymentId:null==(n=t.payment)?void 0:n.id,paypalPaymentToken:e,paymentMethodCode:l.paymentMethodCode}});if(!(null==a||null==(i=a.createPaymentIntentForNewPaypalAgreement)?void 0:i.payment))throw Error("Create Payment Intent failed with empty response for Paypal Agreement (MAAP flow).")}catch(t){a(!1),d({code:"PAY_WITH_NEW_PAYPAL_AGREEMENT_FAILED",message:!(null==t?void 0:t.graphQLErrors)&&(null==t?void 0:t.message)?t.message:"Cannot pay with an authorize new Paypal Agreement (MAAP flow).",shouldDisplayError:!0,error:t,context:{paypal_method_id:e,paypal_method_type:null==l?void 0:l.paypalType}});return}try{await s(e,g.vT.PAYPAL)}catch(t){d({code:"ATTACH_WITH_PAYPAL_AGREEMENT_FAILED",message:!(null==t?void 0:t.graphQLErrors)&&(null==t?void 0:t.message)?t.message:"Cannot attach a new paypal agreement (MAAP flow).",error:t,context:{paypal_method_id:e,paypal_method_type:null==l?void 0:l.paypalType}})}await r()}}):null},eg=()=>{let{checkoutCart:e}=(0,i.bK)(),{selectedExistingPaymentMethod:t,selectedNewCheckoutComCard:a,selectedNewPaypal:l,selectedNewApplePay:r}=(0,H.qF)();return g.ZL.PAYMENT_SKIPPED===(null==e?void 0:e.checkoutState)?(0,n.jsx)(ee,{}):(null==t?void 0:t.paymentMethodSource)===g.vT.CHECKOUT?(0,n.jsx)(ea,{}):(null==t?void 0:t.paymentMethodSource)===g.vT.PAYPAL?(0,n.jsx)(en,{}):(null==a?void 0:a.isReady)?(0,n.jsx)(es,{}):(null==l?void 0:l.paypalType)===x.at3.PAYPAL||(null==l?void 0:l.paypalType)===x.at3.PAYPAL4X?(0,n.jsx)(eo,{}):(null==l?void 0:l.paypalType)===x.at3.PAYPAL_AGREEMENT?(0,n.jsx)(ef,{}):r?(0,n.jsx)(ex,{}):(0,n.jsx)(K,{})};var eb=a(205),eC=a(73675),ev=a(67674),ej=a(32808),eA=a(83060),eP=
1a(69205),ek=a(35133);let eN=e=>{let{text:t,image:a,icon:l}=e;return(0,n.jsxs)("div",{className:"tw-flex tw-items-center tw-gap-3",children:[l,a&&(0,n.jsx)(S.A,{alt:"",src:a.src,height:a.height,width:a.width,"aria-hidden":!0}),(0,n.jsx)("span",{className:"tw-lf-body-bold-md tw-font-bold",children:t})]})},eT=e=>{let{children:t}=e;return(0,n.jsx)("div",{className:"tw-px-6 tw-pb-6",children:t})},eE=e=>e.map(e=>{let{getPaymentMethod:t,build:a}=e,n=t();return n?a(n):null}).filter(e=>null!==e),e_=e=>{let{checkoutCart:t}=e,a=(0,p.useTranslations)("Checkout"),r=(0,p.useTranslations)("Checkout.Payment"),{authUser:s}=(0,L.uM)(),{isReady:i,isMethodEligible:d}=(0,o._)(),{isSubscriptionAvailable:c}=(0,M.X)(L.uM),{isOrderValidationInProgress:m,isFlowInitializing:u,selectedPaymentRadioId:h,newPaymentOptions:y,savedPaymentMethods:f,selectExistingPaymentMethod:b,selectNewCheckoutComOption:C,selectNewPaypalOption:v,selectNewApplePayOption:j,markFlowInitializing:A,markFlowReady:P,clearSelectedPaymentMethod:k}=(0,H.qF)(),N=c?g.iH.FORCE_SAVE:g.iH.SAVE_IF_CONSENTED,T=(0,U.KH)(x.oN_),{isApplePayAvailable:E}=(0,eu.A)(),_=(0,l.useRef)(new Map),S=(0,l.useRef)(!1);(0,l.useEffect)(()=>{var e;h&&(null==(e=_.current.get(h))||e.scrollIntoView({behavior:"smooth",block:"nearest"}))},[h]),(0,l.useEffect)(()=>{y.length&&!S.current&&A()},[y.length]);let F=(0,l.useMemo)(()=>y.filter(e=>{if(!e.publishableKey){let a={message:"[checkout] Cannot display a user Payment Option without publishableKey.",context:{user_id:null==s?void 0:s.uid,cart_id:null==t?void 0:t.id,payment_option_id:e.id,payment_option_code:e.code}};return R().warn(a.message,a.context),!1}return!0}),[y.length]),K=(0,l.useMemo)(()=>f.reduce((e,a)=>{if(a.paymentType===g.JM.Card)return e;let n=y.find(e=>e.type===a.source);return n?[...e,{paymentMethod:a,paymentMethodType:n.method,paymentMethodCode:n.code}]:(R().warn("[checkout] Cannot display a user Payment Method with no associated OMS payment option.",{user_id:null==s?void 0:s.uid,cart_id:null==t?void 0:t.id,pm_id:a.id}),e)},[]),[f.length,y.length]),V=(0,l.useMemo)(()=>(e=>{let{usablePaymentOptions:t,existingPaymentMethods:a,isPaypalReady:l,isMethodEligible:r,isApplePayABTestEnabled:s,isApplePayAvailable:i,isSubscriptionAvailable:d,selectExistingPaymentMethod:o,selectNewCheckoutComOption:c,selectNewPaypalOption:m,selectNewApplePayOption:u,tCheckout:h}=e,p=[{getPaymentMethod:()=>t.find(e=>{let{psp:t}=e;return g.Je.PAYPAL===t}),build:e=>{let{code:t,method:a}=e;return{id:t,Label:()=>(0,n.jsx)(eN,{text:h("payWithPaypal"),icon:(0,n.jsx)(ej.A,{size:ek.y3.lg})}),handleChecked:()=>m(t,{paypalType:d?x.at3.PAYPAL_AGREEMENT:x.at3.PAYPAL,paymentMethodCode:t},a),dataTestId:"CheckoutPayment-RadioLine-new-paypal-payment-".concat(t),ExpandedContent:()=>(0,n.jsxs)(eT,{children:[(0,n.jsxs)("p",{className:"tw-mb-4",children:[(0,n.jsx)(eP.A,{UNSAFE_className:"tw-mr-1 tw-mb-[-2px]",size:ek.y3.sm}),h("flowPaypalInfos")]}),(0,n.jsx)(eg,{})]})}}},{getPaymentMethod:()=>l&&r(x.y24.PAY_LATER)?t.find(e=>{let{psp:t}=e;return g.Je.PAYPAL===t}):void 0,build:e=>{let{code:t}=e;return{id:"".concat(t,"-4x"),Label:()=>(0,n.jsx)(eN,{text:h("payWithPaypal4x"),icon:(0,n.jsx)(ej.A,{size:ek.y3.lg})}),handleChecked:()=>m("".concat(t,"-4x"),{paypalType:x.at3.PAYPAL4X,paymentMethodCode:t},g.HH.PAYPAL4X),dataTestId:"CheckoutPayment-RadioLine-new-paypal-payment-".concat(t,"-4x"),ExpandedContent:()=>(0,n.jsxs)(eT,{children:[(0,n.jsxs)("p",{className:"tw-mb-4",children:[(0,n.jsx)(eP.A,{size:ek.y3.sm}),h("flowPaypalInfos")]}),(0,n.jsx)(eg,{})]})}}},{getPaymentMethod:()=>s&&i?t.find(e=>{let{method:t}=e;return g.Ks.APPLE_PAY===t}):void 0,build:e=>{let{code:t,method:a}=e;return{id:t,Label:()=>(0,n.jsx)(eN,{text:h("payWithApplePay"),icon:(0,n.jsx)(eA.A,{size:ek.y3.lg})}),handleChecked:()=>u(t,a),dataTestId:"CheckoutPayment-RadioLine-new-card-payment-".concat(t),ExpandedContent:()=>(0,n.jsx)(eT,{children:(0,n.jsx)(eg,{})})}}}];return{existing:{configs:a.map(e=>{let{paymentMethod:t,paymentMethodType:a,paymentMethodCode:l}=e;return{id:t.id,Label:()=>(0,n.jsx)("div",{className:"tw-flex tw-items-center tw-gap-3",children:(0,n.jsx)(O.A,{paymentMethod:t})}),handleChecked:()=>o(t.id,{existingPaymentMethodId:t.id,paymentMethodCode:l,paymentMethodSource:t.source},a),dataTestId:"CheckoutPayment-RadioLine-existing-payment-".concat(t.id),ExpandedContent:()=>(0,n.jsx)(eT,{children:(0,n.jsx)(eg,{})})}}),getContainerClassName:()=>"tw-border tw-border-[#dfe4f3] tw-border-px tw-border-solid tw-mt-[-1px]"},card:{configs:eE([{getPaymentMethod:()=>t.find(e=>{let{method:t}=e;return g.Ks.CARD===t}),build:e=>{let{code:t,method:a}=e;return{id:t,Label:()=>(0,n.jsx)(eN,{text:h("payWithCard"),icon:(0,n.jsx)(ev.A,{size:ek.y3.lg})}),handleChecked:()=>c(t,a),dataTestId:"CheckoutPayment-RadioLine-new-card-payment-".concat(t),ExpandedContent:()=>(0,n.jsx)(D.A,{})}}}]),getContainerClassName:()=>"tw-border tw-border-[#dfe4f3] tw-border-px tw-border-solid tw-mt-[-1px]"}
1,other:{configs:eE(p),getContainerClassName:()=>"tw-border tw-border-[#dfe4f3] tw-border-px tw-border-solid tw-mt-[-1px]"}}})({usablePaymentOptions:F,existingPaymentMethods:K,isPaypalReady:i,isMethodEligible:d,isApplePayABTestEnabled:T,isApplePayAvailable:E,isSubscriptionAvailable:c,selectExistingPaymentMethod:b,selectNewCheckoutComOption:C,selectNewPaypalOption:v,selectNewApplePayOption:j,tCheckout:a}),[F,K,i,T,E,f.length,c]);return F.length?(0,n.jsxs)(n.Fragment,{children:[u&&(0,n.jsx)(w.A,{}),(0,n.jsxs)("section",{className:"tw-w-full desktop:tw-max-w-[520px]".concat(u?" tw-hidden":""," desktop:tw-mb-8"),children:[(0,n.jsx)("h2",{className:"tw-text-md tw-lf-body-xbold-md tw-mb-2",children:a("paymentMethods")}),(0,n.jsxs)(Y.bK,{tokenValue:t.id,cartTotal:t.total,cardSaving:N,onReady:e=>{if(S.current=!0,P(),e||null!==h)return;let t=y.find(e=>{let{method:t}=e;return t===g.Ks.CARD});t&&C(t.code,t.method)},onStoredCardSelected:k,children:[(0,n.jsx)(Y.Nf,{selectedPaymentRadioId:h}),Object.entries(V).filter(e=>{let[,{configs:t}]=e;return t.length>0}).map(e=>{let[t,{configs:a,getContainerClassName:l}]=e,r=l({isChildrenExpanded:a.some(e=>{let{id:t}=e;return h===t})});return(0,n.jsx)("div",{className:"".concat(r),children:a.map((e,t)=>{let{id:l,Label:r,handleChecked:s,dataTestId:i,ExpandedContent:d,hideHeaderOnChecked:o}=e,c=h===l,u=a.length===t+1;return(0,n.jsxs)("div",{ref:e=>{e?_.current.set(l,e):_.current.delete(l)},style:{scrollMarginTop:"var(--checkout-header-height)"},children:[(!c||!o)&&(0,n.jsx)("li",{className:"tw-list-none tw-p-3",children:(0,n.jsx)(I.A,{id:l,name:"checkout-available-payment-list",value:l,checked:c,handleChecked:s,required:!0,disabled:m,isTextBoldWhenChecked:!0,isVerticallyCentered:!0,isBackgroundColoredWhenChecked:!1,dataTestId:i,children:(0,n.jsx)(r,{isChecked:c})})}),(0,n.jsx)("div",{className:c&&d?"":"tw-hidden",children:d&&(0,n.jsx)(d,{isChecked:c})}),!u&&(0,n.jsx)("div",{className:"tw-h-px tw-w-full tw-bg-blue-200"})]},l)})},t)})]})]})]}):g.ZL.PAYMENT_SKIPPED===t.checkoutState?null:(0,n.jsx)(eb.A,{backgroundColor:"var(--clr-secondary-3)",hasImageOnMobile:!0,icon:(0,n.jsx)(eC.A,{width:34,height:34,"aria-hidden":"true"}),smallBox:!0,UNSAFE_className:"tw-mb-5",children:(0,n.jsx)("p",{className:"tw-lf-body-regular-sm tw-leading-normal",children:r.rich("messageCannotFetchNewPM",{strong:e=>(0,n.jsx)("strong",{children:e}),br:()=>(0,n.jsx)("br",{})})})})};var eM=a(58370),eI=a(80179);let eS=e=>{let{checkoutCart:t}=e,a=(0,p.useTranslations)("Account"),r=(0,p.useTranslations)("Checkout"),s=(0,p.useTranslations)("Checkout.Payment"),{authUser:i}=(0,L.uM)(),{error:o}=(0,eM.mu)(),{isOrderValidationInProgress:c,selectedPaymentRadioId:m,selectExistingPaymentMethod:u,savedPaymentMethods:h,newPaymentOptions:y}=(0,H.qF)(),x=(0,l.useMemo)(()=>h.reduce((e,a)=>{let n=null==y?void 0:y.find(e=>e.type===a.source);if(n)return[...e,{paymentMethod:a,paymentMethodType:n.method,paymentMethodCode:n.code}];let l={message:"[checkout] Cannot display a user Payment Method with no associated OMS payment option.",context:{user_id:null==i?void 0:i.uid,cart_id:null==t?void 0:t.id,pm_id:a.id}};return R().warn(l.message,l.context),e},[]),[h.length]);return((0,l.useEffect)(()=>{let e=x.filter(e=>{let{paymentMethod:t}=e;return(0,d.VV)(t)});e.length&&!m&&u(e[0].paymentMethod.id,{existingPaymentMethodId:e[0].paymentMethod.id,paymentMethodSource:e[0].paymentMethod.source,paymentMethodCode:e[0].paymentMethodCode},e[0].paymentMethodType)},[x.length]),o)?(0,n.jsx)(eb.A,{backgroundColor:"var(--clr-secondary-3)",hasImageOnMobile:!0,icon:(0,n.jsx)(eC.A,{width:34,height:34,"aria-hidden":"true"}),smallBox:!0,UNSAFE_className:"tw-mb-5",children:(0,n.jsx)("p",{className:"tw-lf-body-regular-sm tw-leading-normal",children:s.rich("messageCannotFetchSavedPM",{strong:e=>(0,n.jsx)("strong",{children:e}),br:()=>(0,n.jsx)("br",{})})})}):x.length?(0,n.jsxs)("section",{className:"payment-methods-list-existing",children:[(0,n.jsx)("h2",{className:"tw-lf-body-xbold-md tw-mb-2",children:r("useSavedPaymentMethod")}),(0,n.jsx)("ul",{children:x.map(e=>{let{paymentMethod:t,paymentMethodCode:l,paymentMethodType:r}=e;return(0,n.jsx)("li",{children:(0,n.jsxs)(I.A,{id:t.id,name:"checkout-available-payment-list",value:t.id,checked:m===t.id,handleChecked:()=>{u(t.id,{existingPaymentMethodId:t.id,paymentMethodCode:l,paymentMethodSource:t.source},r)},required:!0,disabled:c||t.paymentType===g.JM.Card&&!(0,d.VV)(t),isTextBoldWhenChecked:!0,isVerticallyCentered:!0,dataTestId:"CheckoutPayment-RadioLine-existing-payment-".concat(t.id),children:[t.paymentType===g.JM.Card&&(0,n.jsx)(eI.A,{paymentMethod:t,tags:(0,d.VV)(t)?void 0:[(0,n.jsxs)("span",{className:"tw-lf-tag tw-lf-tag-md tw-lf-tag-decorative-danger",children:[a("expired")," "]},"tag-expired")]}),t.paymentType===g.JM.PaymentTokenAccount&&(0,n.jsx)("div",{className:"paypal tw-flex tw-items-center",children:(0,n.jsx)(O.A,{paymentMethod:t})})]})},t.id)})})]}):null};var eL=a(53718),eF=a(71969),eR=a(24795),eD=a(21927),eY=a(98137),eO=a(1909),eH=a(15721),eU=a(2395),eK=a(82281),eV=a.n(eK),eW=a(20821),eG=a(64528),eB=a(32988),eq=a.n(eB);let{publicRuntimeConfig:eQ}=eV()(),ez=e=>{var t,a;let{children:r,isLoading:s,onComplete:d,onSubmit:o,fullWidth:c}=e,{register:m,handleSubmit:u,formState:{errors:h},setError:x,clearErrors:w,watch:f,formState:{dirtyFields:g}}=(0,eO.mN)({mode:"onChange",criteriaMode:"all"}),[b,C]=(0,l.useState)(!1),{interpreter:v}=(0,i.cO)(),j=f("holderName",""),A=(0,p.useTranslations)("Account"),P=(0,p.useTranslations)("Global"),k=(0,p.useTranslations)("Card"),T={"expiry-date":k("invalidExpiryDate"),cvv:k("incompleteCVC"),"card-number":k("invalidCardNumber")};return(0,l.useEffect)(()=>
1{if(b&&"holderName"in g&&!h.holderName){null==d||d(!0);return}null==d||d(!1)},[g,j,h,b]),(0,l.useEffect)(()=>{let e=async e=>{e.value===et.Q1.INITIAL&&el.Hc.enableSubmitForm()};return null==v||v.onTransition(e),()=>{null==v||v.off(e)}},[v]),(0,n.jsx)(eG.A.Provider,{value:(0,l.useMemo)(()=>({clearErrors:w,errors:h,isLoading:s,register:m,setError:x}),[w,h,s,m,x]),children:(0,n.jsxs)(el.Hc,{config:{debug:!eW.A,publicKey:eQ.checkoutComPublicKey,localization:{cardNumberPlaceholder:k("cardNumber"),expiryMonthPlaceholder:k("expiryMonthPlaceholder"),expiryYearPlaceholder:k("expiryYearPlaceholder"),cvvPlaceholder:k("cardCVCPlaceholder")},cardholder:{name:j},style:{base:{fontSize:"16px",fontFamily:"sans-serif",fontWeight:eY.Wy.light,color:eY.Tj.black,letterSpacing:"initial"},invalid:{color:eY.Tj.danger},placeholder:{base:{color:eY.Tj.grey1,fontFamily:"sans-serif"}}}},cardValidationChanged:e=>C(e.isValid),frameValidationChanged:e=>{e.isValid?w(e.element):x(e.element,{type:"cardError",message:T[e.element]})},cardTokenizationFailed:e=>{R().error("Card tokenization failed",{error:e}),(0,y.oR)(P("errorOccurredTryAgain"),{progressClassName:"toast-error"})},children:[(0,n.jsx)("div",{className:"jsx-7d5945fa3ab1f9ef tw-mb-4 tw-flex tw-w-full tw-justify-center [&_label]:tw-mb-1 [&_label]:tw-font-bold",children:(0,n.jsxs)("form",{onSubmit:o&&u(o),className:"jsx-7d5945fa3ab1f9ef "+(eq()("tw-mt-2 tw-grid tw-w-full tw-max-w-[380px] tw-grid-cols-2 tw-gap-4",{"tw-max-w-initial":c})||""),children:[(0,n.jsxs)(eH.ks,{id:"name",isInvalid:!!h.holderName,UNSAFE_className:"tw-col-span-2",children:[(0,n.jsxs)(eH.JU,{children:[k("cardOwner"),"*"]}),(0,n.jsx)(eH.pd,{type:"text",placeholder:A("creditCardHolderName"),...m("holderName",{required:{value:!0,message:A("mandatoryField")}}),dataTestId:"CardForm-Input-2"}),h.holderName&&(0,n.jsx)(eH.yn,{children:h.holderName.message})]}),(0,n.jsx)("div",{className:"jsx-7d5945fa3ab1f9ef "+"tw-col-span-2 ".concat(h["card-number"]?"[&_.card-number-frame]:tw-lf-input-invalid":""," [&_.card-number-frame]:tw-lf-input"),children:(0,n.jsxs)(eH.ks,{id:"card-number",isInvalid:!!h["card-number"],children:[(0,n.jsxs)(eH.JU,{children:[k("cardNumber"),"*"]}),(0,n.jsx)(el.q3,{}),h["card-number"]&&(0,n.jsx)(eH.yn,{children:null==(t=h["card-number"])?void 0:t.message})]})}),(0,n.jsx)("div",{className:"jsx-7d5945fa3ab1f9ef "+"card-item ".concat(h["expiry-date"]?"[&_.expiry-date-frame]:tw-lf-input-invalid":""," [&_.expiry-date-frame]:tw-lf-input"),children:(0,n.jsxs)(eH.ks,{id:"expiry-date",isInvalid:!!h["expiry-date"],children:[(0,n.jsxs)(eH.JU,{children:[k("expirationDate"),"*"]}),(0,n.jsx)(el.yr,{}),h["expiry-date"]&&(0,n.jsx)(eH.yn,{children:h["expiry-date"].message})]})}),(0,n.jsx)("div",{className:"jsx-7d5945fa3ab1f9ef "+"card-item ".concat(h.cvv?"[&_.cvv-frame]:tw-lf-input-invalid":""," [&_.cvv-frame]:tw-lf-input"),children:(0,n.jsxs)(eH.ks,{id:"cvv",isInvalid:!!h.cvv,children:[(0,n.jsxs)("div",{className:"jsx-7d5945fa3ab1f9ef label-with-popover",children:[(0,n.jsxs)(eH.JU,{children:[k("cardCVC"),"*"]}),(0,n.jsx)(eU.A,{trigger:"click",className:"popover-container",content:(0,n.jsx)("div",{className:"jsx-7d5945fa3ab1f9ef popover",children:k("CVCPopOver")}),zIndex:1e4,children:(0,n.jsx)("button",{type:"button","aria-label":k("whereToFindCVC"),"data-testid":"NewCardForm-button-clear",className:"jsx-7d5945fa3ab1f9ef tw-lf-button-clear",children:(0,n.jsx)(eD.A,{width:14,height:14})})})]}),(0,n.jsx)(el.GN,{}),h.cvv&&(0,n.jsx)(eH.yn,{children:null==(a=h.cvv)?void 0:a.message})]})}),(0,n.jsx)("div",{className:"jsx-7d5945fa3ab1f9ef tw-col-span-2",children:r})]})}),(0,n.jsx)(N(),{id:"7d5945fa3ab1f9ef",children:"div.label-with-popover.jsx-7d5945fa3ab1f9ef{border:none;padding:0;height:initial;margin-bottom:var(--space-1)}.label-with-popover.jsx-7d5945fa3ab1f9ef button.jsx-7d5945fa3ab1f9ef{margin-left:var(--space-1);display:inline}.label-with-popover.jsx-7d5945fa3ab1f9ef label{display:inline}"})]})})},eX=()=>{let e=(0,p.useTranslations)("Card"),t=(0,p.useTranslations)("Global"),{isSubscriptionAvailable:a}=(0,M.X)(L.uM),{updateNewCheckoutComCard:r,selectedNewCheckoutComCard:s}=(0,H.qF)(),{checkoutCart:d}=(0,i.bK)(),[o]=(0,W.n)(G.gl);return((0,l.useEffect)(()=>{(null==d?void 0:d.id)&&o({variables:{tokenValue:d.id}})},[null==d?void 0:d.id,o]),s)?(0,n.jsx)(ez,{onComplete:e=>{r({...s,isReady:e})},fullWidth:!0,children:!a&&(0,n.jsxs)("div",{className:"tw-mb-4 tw-mt-2 tw-flex",children:[(0,n.jsx)(eF.A,{name:e("saveC
1ard"),required:!1,id:"save-card-checkbox",onChange:e=>{r({...s,shouldSaveCardForFutureUse:e.target.checked})},dataTestId:"NewCardForm-Checkbox-save-card"}),(0,n.jsxs)("div",{className:"tw-ml-3 tw-flex tw-items-center",children:[(0,n.jsx)(eR.A,{id:"save-card-checkbox",children:e("saveCardLabel")}),(0,n.jsx)(eU.A,{trigger:"click",content:(0,n.jsx)("div",{children:e("saveCardPopOver")}),zIndex:eY.fo.popover,children:(0,n.jsx)("button",{type:"button",className:"tw-lf-button-clear tw-ml-2","aria-label":t("moreInformation"),"data-testid":"NewCardForm-button-more-information",children:(0,n.jsx)(eD.A,{width:14,height:14})})})]})]})}):null},eZ=e=>{let{checkoutCart:t}=e,a=(0,p.useTranslations)("Checkout"),r=(0,p.useTranslations)("Cart"),s=(0,p.useTranslations)("Checkout.Payment"),{authUser:i}=(0,L.uM)(),d=(0,eL.Ub)(800),{isReady:c,isMethodEligible:m}=(0,o._)(),{isSubscriptionAvailable:u}=(0,M.X)(L.uM),{isOrderValidationInProgress:h,selectedPaymentRadioId:y,newPaymentOptions:w,savedPaymentMethods:f,selectNewCheckoutComOption:b,selectNewPaypalOption:C,selectNewApplePayOption:v}=(0,H.qF)(),j=(0,U.KH)(x.sWQ),A=(0,U.KH)(x.AcL),P=(0,U.KH)(x.oN_),{isApplePayAvailable:k}=(0,eu.A)(),N=(0,l.useMemo)(()=>w.filter(e=>{if(!e.publishableKey){let a={message:"[checkout] Cannot display a user Payment Option without publishableKey.",context:{user_id:null==i?void 0:i.uid,cart_id:null==t?void 0:t.id,payment_option_id:e.id,payment_option_code:e.code}};return R().warn(a.message,a.context),!1}return!0}),[w.length]),T=N.find(e=>{let{method:t}=e;return g.Ks.CARD===t}),E=N.find(e=>{let{psp:t}=e;return g.Je.PAYPAL===t}),_=P&&k&&N.find(e=>{let{method:t}=e;return g.Ks.APPLE_PAY===t}),F=c&&m(t.total/100)?N.find(e=>{let{psp:t}=e;return g.Je.PAYPAL===t}):void 0;return N.length?(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)("section",{className:"payment-methods-list-new [.payment-methods-list-existing+&]:tw-mt-6",children:[u&&j&&(0,n.jsx)("h3",{className:"tw-lf-body-bold-md tw-mb-4 desktop:tw-mb-6 ".concat(A?"tw-mt-5":""),children:r("choosePaymentMethod")}),f.length>0&&(0,n.jsx)("h2",{className:"tw-lf-body-xbold-md tw-mb-2",children:a("useNewPaymentMethod")}),(0,n.jsxs)("ul",{children:[T&&(0,n.jsxs)("li",{children:[(0,n.jsx)(I.A,{id:T.code,name:"checkout-available-payment-list",value:T.code,checked:y===T.code,handleChecked:()=>{b(T.code,T.method)},required:!0,disabled:h,isTextBoldWhenChecked:!0,isVerticallyCentered:!0,dataTestId:"CheckoutPayment-RadioLine-new-card-payment-".concat(T.code),children:(0,n.jsxs)("div",{className:"tw-flex tw-items-center tw-gap-3",children:[a(f.length>0?"addNewCreditCard":"payWithCreditCard"),!d&&(0,n.jsx)(S.A,{alt:"",src:"/images/checkout/payment-method.svg",height:20,width:108,"aria-hidden":!0})]})}),y===T.code&&(0,n.jsx)(eX,{})]}),E&&(0,n.jsxs)("li",{children:[(0,n.jsx)(I.A,{id:E.code,name:"checkout-available-payment-list",value:E.code,checked:y===E.code,handleChecked:()=>{u?C(E.code,{paypalType:x.at3.PAYPAL_AGREEMENT,paymentMethodCode:E.code},E.method):C(E.code,{paypalType:x.at3.PAYPAL,paymentMethodCode:E.code},E.method)},required:!0,disabled:h,isTextBoldWhenChecked:!0,isVerticallyCentered:!0,dataTestId:"CheckoutPayment-RadioLine-new-paypal-payment-".concat(E.code),children:(0,n.jsxs)("div",{className:"tw-flex tw-items-center tw-gap-3",children:[a("payWithPaypal"),!d&&(0,n.jsx)(S.A,{alt:"",src:"/images/checkout/paypal.svg",height:20,width:108,"aria-hidden":!0})]})}),y===E.code&&(0,n.jsx)("p",{className:"tw-my-4",children:a("paypalInfos")})]}),F&&(0,n.jsxs)("li",{children:[(0,n.jsx)(I.A,{id:"".concat(F.code,"-4x"),name:"checkout-available-payment-list",value:"".concat(F.code,"-4x"),checked:y==="".concat(F.code,"-4x"),handleChecked:()=>{C("".concat(F.code,"-4x"),{paypalType:x.at3.PAYPAL4X,paymentMethodCode:F.code},g.HH.PAYPAL4X)},required:!0,disabled:h,isTextBoldWhenChecked:!0,isVerticallyCentered:!0,dataTestId:"CheckoutPayment-RadioLine-new-paypal-payment-".concat(F.code,"-4x"),children:(0,n.jsxs)("div",{className:"tw-flex tw-items-center tw-gap-3",children:[a("payWithPaypal4x"),!d&&(0,n.jsx)(S.A,{alt:"",src:"/images/checkout/paypal.svg",height:20,width:108,"aria-hidden":!0})]})}),y==="".concat(F.code,"-4x")&&(0,n.jsx)("p",{className:"tw-my-4",children:a("paypalInfos")})]}),_&&(0,n.jsx)("li",{children:(0,n.jsx)(I.A,{id:_.code,name:"checkout-available-payment-list",value:_.code,checked:y===_.code,handleChecked:()=>{v(_.code,_.method)},required:!0,disabled:h,isTextBoldWhenChecked:!0,isVerticallyCentered:!0,dataTestId:"CheckoutPayment-RadioLine-new-card-payment-".concat(_.code),children:(0,n.jsxs)("div",{className:"tw-flex tw-items-center tw-gap-3",children:[(0,n.jsx)("p",{children:a("payWithApplePay")}),!d&&(0,n.jsx)(S.A,{alt:"",src:"/images/checkout/apple-pay.svg",height:24,width:36,"aria-hidden":!0})]})})})]})]})}):g.ZL.PAYMENT_SKIPPED===t.checkoutState?null:(0,n.jsx)(eb.A,{backgroundColor:"var(--clr-secondary-3)",hasImageOnMobile:!0,icon:(0,n.jsx)(eC.A,{width:34,he
1ight:34,"aria-hidden":"true"}),smallBox:!0,UNSAFE_className:"tw-mb-5",children:(0,n.jsx)("p",{className:"tw-lf-body-regular-sm tw-leading-normal",children:s.rich("messageCannotFetchNewPM",{strong:e=>(0,n.jsx)("strong",{children:e}),br:()=>(0,n.jsx)("br",{})})})})};var e$=a(82893);let eJ=()=>{let e=(0,p.useTranslations)("Checkout.Payment");return(0,n.jsx)(eb.A,{backgroundColor:"var(--clr-primary-3)",hasImageOnMobile:!0,icon:(0,n.jsx)(e$.A,{width:34,height:34,"aria-hidden":"true"}),smallBox:!0,UNSAFE_className:"tw-mb-5",children:(0,n.jsx)("p",{className:"tw-lf-body-regular-sm tw-leading-normal",children:e.rich("messageFreeOrder",{strong:e=>(0,n.jsx)("strong",{children:e}),br:()=>(0,n.jsx)("br",{})})})})},e0=e=>{var t;let{paymentText:a,...l}=e,r=(0,p.useTranslations)("Checkout"),s=(0,d.Yq)((0,d.Hr)()),{validatedCoupon:i}=(0,B.Ph)(),{annualSubscriptionPrice:o}=(0,eh.A)(),{selectedNewPaypal:c}=(0,H.qF)(),m=null!=(t=null==i?void 0:i.price)?t:o,u=(0,d.GP)(m);return a?(0,n.jsx)("p",{...l,children:a.replace("%DATE%",s).replace("%PRICE%",u)}):(0,n.jsx)("p",{...l,children:r.rich(c?"maapPaypalPaymentNotice":"maapCardPaymentNotice",{endOfTrialPeriodDate:s,price:u,comparedPrice:(0,d.GP)(o),barred:e=>(null==e?void 0:e[0])!==u?(0,n.jsx)("span",{className:"line-through",children:e}):null})})};var e1=a(98275),e2=a(93521),e3=a(81619),e9=a(82825);let e7=e=>{var t;let{pageContents:a,UNSAFE_className:l}=e;return a&&e1.e(null==a?void 0:a.paymentWarningMessage)?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(e3.tH,{fallbackRender:()=>null,onError:e=>{R().error("[checkout] An error occurred while rendering checkout warning message on Payment page.",{error:e})},children:(0,n.jsxs)("div",{className:"jsx-3e3e82fa0b18e5ce "+"message-warning alert-info ".concat(l||""," desktop:tw-mb-6"),children:[(null==(t=a.paymentWarningMessagePicto)?void 0:t.url)?(0,n.jsx)("div",{className:"jsx-3e3e82fa0b18e5ce alert-info-image",children:(0,n.jsx)(S.A,{src:a.paymentWarningMessagePicto.url,width:56,height:31,layout:"fixed"})}):null,(0,n.jsx)("div",{className:"jsx-3e3e82fa0b18e5ce alert-info-text",children:(0,n.jsx)(e2.RichText,{render:a.paymentWarningMessage,serializeHyperlink:e9.A})})]})}),(0,n.jsx)(N(),{id:"3e3e82fa0b18e5ce",children:".alert-info.jsx-3e3e82fa0b18e5ce{display:flex;align-items:center;margin-bottom:var(--space-6)}.alert-info-image.jsx-3e3e82fa0b18e5ce{margin-right:var(--space-3)}.alert-info.jsx-3e3e82fa0b18e5ce strong{color:var(--clr-secondary-1)}{}.alert-info-text.jsx-3e3e82fa0b18e5ce a{transition:all.3s ease;color:var(--clr-link);text-decoration:underline;line-height:1.375;cursor:pointer}.alert-info-text.jsx-3e3e82fa0b18e5ce a:hover{opacity:var(--opacity-link-hover)}"})]}):null};var e8=a(30872),e4=a(15396),e5=a(85365),e6=a(35104),te=a(8400),tt=a(18902),ta=a(91497),tn=a(77148),tl=a(34471),tr=a(79888),ts=a(30568),ti=a(13658),td=a(79582);let to=e=>{let{isOpen:t,onClose:a,dataTestId:l,subscriptionAmount:r,savingsAmount:s}=e,i=(0,tr.$)({trailingZeroDisplay:"auto"}),d=(0,p.useTranslations)("Checkout"),o=s/r*100;return(0,n.jsxs)(ti.A.SidePanel,{isOpen:t,onClose:a,children:[(0,n.jsx)(ti.A.SidePanelHeader,{onClose:()=>a(),children:(0,n.jsx)("h1",{className:"tw-lf-title-xs desktop:tw-lf-title-sm","data-testid":l,children:d("membershipSavingsSidePanelTitle")})}),(0,n.jsxs)(ti.A.SidePanelBody,{children:[(0,n.jsx)("p",{className:"tw-lf-body-regular-md tw-text-center",children:d("membershipSavingsSidePanelGaugeLeadingText")}),(0,n.jsx)("p",{className:"tw-lf-title-md tw-mt-2 tw-text-center tw-text-blue-600",children:i.formatCurrency(s)}),o>=25&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{className:"tw-lf-body-regular-md tw-mt-4 tw-text-center",children:d("membershipSavingsSidePanelProgressText")}),(0,n.jsx)("div",{className:"tw-mt-2",children:(0,n.jsx)(td.A,{previousProgress:0,currentProgress:o,height:25,isValueDisplayed:!0,withAnimation:!0,hasBackground:!0,animationDuration:1,"aria-hidden":"true"})})]}),(0,n.jsx)("p",{className:"tw-lf-body-regular-md tw-mt-8",children:d("membershipSavingsSidePanelDescription")})]}),(0,n.jsx)(ti.A.SidePanelFooter,{children:(0,n.jsx)("button",{className:"tw-lf-button tw-lf-button-primary tw-lf-button-md tw-w-full",onClick:a,children:d("membershipPlanSidePanelButtonLabel")})})]})};var tc=a(82203),tm=a.n(tc);let tu=e=>{let{isOpen:t,onClose:a,dataTestId:l}=e,r=(0,p.useTranslations)("Checkout"),{getPath:s}=(0,E.A)();return(0,n.jsxs)(ti.A.SidePanel,{isOpen:t,onClose:a,children:[(0,n.jsx)(ti.A.SidePanelHeader,{onClose:()=>a(),children:(0,n.jsx)("h1",{className:"tw-lf-title-xs desktop:tw-lf-title-sm","data-testid":l,children:r("membershipPlanSidePanelTitle")})}),(0,n.jsxs)(ti.A.SidePanelBody,{children:[(0,n.jsx)("h2",{className:"tw-lf-title-xs tw-mb-4 desktop:tw-lf-title-sm",children:r("membershipPlanSidePanelSubtitle1")}),(0,n.jsx)("p",{className:"tw-lf-body-regular-md",children:r("membershipPlanSidePanelText1")}),(0,n.jsx)(f.A,{marginVertical:"tw-my-8"}),(0,n.jsx)("h2",{className:"tw-lf-title-xs tw-mb-4 desktop:tw-lf-title-sm",children:r("membershipPlanSidePanelSubtitle2")}),(0,n.jsx)("p",{className:"tw-lf-body-regular-md",children:r("membershipPlanSidePanelText2")}),(0,n.jsx)(tm(),{href:s(g.Q.CGV),target:"_blank",className:"tw-lf-caption-regular tw-lf-link-dark tw-mt-4 tw-block tw-u
1nderline",children:r("membershipPlanSidePanelText2small")}),(0,n.jsx)(f.A,{marginVertical:"tw-my-8"}),(0,n.jsx)("h2",{className:"tw-lf-title-xs tw-mb-4 desktop:tw-lf-title-sm",children:r("membershipPlanSidePanelSubtitle3")}),(0,n.jsx)("p",{className:"tw-lf-body-regular-md",children:r("membershipPlanSidePanelText3")}),(0,n.jsxs)("ul",{className:"tw-lf-bullet-list [&_li]:tw-lf-body-regular-md",children:[(0,n.jsx)("li",{className:"tw-lf-bullet-list-item",children:r("membershipPlanSidePanelText3ListItem1")}),(0,n.jsx)("li",{className:"tw-lf-bullet-list-item",children:r("membershipPlanSidePanelText3ListItem2")}),(0,n.jsx)("li",{className:"tw-lf-bullet-list-item",children:r("membershipPlanSidePanelText3ListItem3")})]})]}),(0,n.jsx)(ti.A.SidePanelFooter,{children:(0,n.jsx)("button",{className:"tw-lf-button tw-lf-button-primary tw-lf-button-md tw-w-full",onClick:a,children:r("membershipPlanSidePanelButtonLabel")})})]})};var th=a(73287);let tp=e=>{let{savings:t}=e,{mainLinkRef:a,onGroupClick:r}=(0,th.z)(),{mainLinkRef:s,onGroupClick:o}=(0,th.z)(),c=(0,tr.$)(),m=(0,p.useTranslations)("Checkout"),{annualSubscriptionPrice:u,monthlySubscriptionPrice:h}=(0,eh.A)(),[y,x]=(0,l.useState)(!1),[w,b]=(0,l.useState)(!1),{membershipPlan:C,setMembershipPlan:v,checkoutCart:j}=(0,i.bK)(),A=(0,l.useMemo)(()=>{var e;return(null!=(e=null==j?void 0:j.items.reduce((e,t)=>e+(t.variantOriginalPrice-t.unitPrice)*t.quantity,0))?e:0)/100},[null==j?void 0:j.items]);return(0,n.jsxs)("section",{className:"tw-pb-3",children:[(0,n.jsx)(to,{isOpen:y,onClose:()=>x(!1),dataTestId:"Checkout savings informations",subscriptionAmount:u,savingsAmount:A}),(0,n.jsx)(tu,{isOpen:w,onClose:()=>b(!1),dataTestId:"Checkout guarantee informations"}),(0,n.jsxs)("div",{className:"tw-relative tw-mb-4 tw-flex tw-gap-2",children:[(0,n.jsx)("p",{className:"tw-lf-body-bold-md",children:m("membershipPlanPickerTitle")}),(0,n.jsx)("button",{type:"button",className:"tw-lf-link-icon tw-size-6 tw-p-0",onClick:()=>b(!0),children:(0,n.jsx)(ts.A,{})})]}),(0,n.jsx)("p",{className:"tw-lf-body-regular-md tw-mb-8",children:m.rich("membershipPlanPickerSavings",{savings:c.formatCurrency(t),span:e=>(0,n.jsx)("span",{className:"tw-lf-body-bold-md tw-text-blue-600",children:e})})}),(0,n.jsxs)(e4.A,{children:[(0,n.jsxs)(e5.A,{dataTestId:"Checkout monthly membership plan picker",isSelected:C===g.cG.MONTHLY,onClick:o,children:[(0,n.jsx)(e6.A,{children:m("membershipPlanPickerPlanMonthly")}),(0,n.jsxs)(te.A,{children:[c.formatCurrency(h),(0,n.jsx)("span",{className:"tw-lf-title-xs desktop:tw-lf-title-sm",children:m("membershipPlanPickerPlanMonthlyPeriod")})]}),(0,n.jsx)(tt.A,{children:m("membershipPlanPickerPlanMonthlyRenewPlan")}),(0,n.jsx)(f.A,{marginVertical:"desktop:tw-my-4 tw-my-3"}),(0,n.jsxs)(ta.A,{children:[(0,n.jsx)(tn.A,{UNSAFE_className:"tw-line-through",children:m("membershipPlanPickerPlanMonthlyArg1")}),(0,n.jsx)(tn.A,{UNSAFE_className:"tw-line-through",children:m("membershipPlanPickerPlanMonthlyArg2")}),(0,n.jsx)(tn.A,{children:m("membershipPlanPickerPlanMonthlyArg3")})]}),(0,n.jsx)(tl.A,{ref:s,onClick:()=>v(g.cG.MONTHLY),children:m(C===g.cG.MONTHLY?"membershipPlanPickerSelected":"membershipPlanPickerSelect")})]}),(0,n.jsxs)(e5.A,{dataTestId:"Checkout yearly membership plan picker",isSelected:C===g.cG.YEARLY,onClick:r,isHighlighted:!0,children:[(0,n.jsx)(e6.A,{children:m("membershipPlanPickerPlanAnnual")}),(0,n.jsx)(te.A,{children:m("membershipPlanPickerPlanAnnualPeriod")}),(0,n.jsx)(tt.A,{children:m("membershipPlanPickerPlanAnnualRenewPlan",{monthlyPrice:c.formatCurrency(u/12),price:c.formatCurrency(u)})}),(0,n.jsx)(f.A,{marginVertical:"desktop:tw-my-4 tw-my-3"}),(0,n.jsxs)(ta.A,{children:[(0,n.jsxs)(tn.A,{children:[m("membershipPlanPickerPlanAnnualArg1",{savingsPercents:Math.floor(t/u*100)}),(0,n.jsx)("button",{type:"button",className:"tw-lf-link-icon tw-ml-2 tw-inline-flex tw-size-4 tw-p-0 tw-align-baseline",onClick:()=>x(!0),children:(0,n.jsx)(ts.A,{})})]}),(0,n.jsx)(tn.A,{children:m("membershipPlanPickerPlanAnnualArg2",{trialEndDate:(0,d.Yq)((0,d.Hr)())})})]}),(0,n.jsx)(tl.A,{ref:a,onClick:()=>v(g.cG.YEARLY),children:m(C===g.cG.YEARLY?"membershipPlanPickerSelected":"membershipPlanPickerSelect")})]})]})]})};var ty=a(59659),tx=a(62230);let tw=e=>{let{pageContents:t}=e,a=(0,s.useRouter)(),r=(0,p.useTranslations)("Errors"),d=(0,p.useTranslations)("Cart"),{totalEconomy:o}=(0,q.vO)(),{isSubscriptionAvailable:c,isLoading:m}=(0,M.X)(L.uM),{error:u,checkoutCart:h,membershipPlan:k}=(0,i.bK)(),{isPaymentPageReady:N}=(0,H.qF)(),T=(0,l.useRef)(!1),E=(0,i.KH)(x.Pet),I=(0,i.KH)(x.AcL),S=(0,i.KH)(x.o6b),F=(0,i.KH)(x.sCe),R=S||F,D=(0,tx.wZ)(),Y=(0,eL.Ub)(800),O=(0,i.KH)(x.sWQ),U=Y&&!S&&O;return((0,eL.Su)(()=>null!=h,()=>
1{h&&x._sF[null==h?void 0:h.checkoutState]<x._sF[g.ZL.SHIPPING_SELECTED]&&(y.oR.warning(r("deliveryMethodNotSelected")),a.push("/checkout/delivery"))},[h]),(0,l.useEffect)(()=>{var e;if(!T.current&&(null==h||null==(e=h.shipments)?void 0:e[0])&&!m){let e=h.items.map(e=>{let{name:t,sku:a,quantity:n,unitPrice:l,productVendor:r}=e;return{name:t,id:a,quantity:n,price:l/100,brand:r}});(0,b.sx)({type:"LFAddShippingInfo",data:{currency:h.currencyCode,value:h.total/100,isMaap:c,shipping:h.shipments[0],promotionCoupon:h.promotionCoupon,products:e.map(e=>({...e,sku:e.id,price:100*e.price}))}}),T.current=!0}},[h,c]),u)?(0,n.jsx)(P.nB,{children:(0,n.jsx)(C.A,{statusCode:404})}):h&&N?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(e7,{UNSAFE_className:"mobile-only",pageContents:t}),!R&&Y&&(0,n.jsx)(j.A,{withRoundUp:E}),(0,n.jsxs)(P.nB,{children:[c&&O&&(0,n.jsx)(tp,{savings:o}),(0,n.jsx)(e7,{UNSAFE_className:"desktop-only",pageContents:t}),c&&!I&&(0,n.jsx)(e0,{className:"tw-lf-body-regular-md tw-mb-8 tw-mt-6 desktop:tw-mb-8 desktop:tw-mt-2",paymentText:O?k===g.cG.YEARLY?null==t?void 0:t.paymentTextYearly:null==t?void 0:t.paymentTextMonthly:null==t?void 0:t.paymentText}),g.ZL.PAYMENT_SKIPPED===h.checkoutState?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(eJ,{}),D&&(0,n.jsx)(eg,{})]}):R?(0,n.jsxs)("div",{className:"[&>section]:tw-mb-8",children:[!O&&(0,n.jsx)("h3",{className:"tw-lf-body-bold-md tw-mb-4 desktop:tw-hidden",children:d("choosePaymentMethod")}),(0,n.jsx)(A.A,{}),D?(0,n.jsx)(e_,{checkoutCart:h}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(eS,{checkoutCart:h}),(0,n.jsx)(eZ,{checkoutCart:h})]})]}):(0,n.jsxs)(n.Fragment,{children:[Y&&(0,n.jsxs)(P.w4,{isMembershipSummaryDisplayed:c,children:[!D&&(0,n.jsx)(eg,{}),(0,n.jsx)(e8.A,{isCheckout:!0,customStyle:"tw-mt-4 desktop:tw-block tw-hidden tw-text-center"})]}),(0,n.jsx)(A.A,{}),D?(0,n.jsx)(e_,{checkoutCart:h}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(eS,{checkoutCart:h}),(0,n.jsx)(eZ,{checkoutCart:h})]}),U&&(0,n.jsx)("div",{className:"tw-mt-4",children:(0,n.jsx)(ty.Gi,{})})]}),Y&&(0,n.jsxs)("div",{children:[R&&(0,n.jsxs)(P.w4,{isMembershipSummaryDisplayed:c,children:[!D&&(0,n.jsx)(eg,{}),F&&(0,n.jsx)(e8.A,{isCheckout:!0,customStyle:"tw-mt-4 tw-text-center"})]}),c&&I&&(0,n.jsx)(e0,{paymentText:null==t?void 0:t.paymentText,className:"tw-lf-body-regular-sm tw-my-8"}),(0,n.jsx)(f.A,{}),(0,n.jsx)(v.A,{}),(0,n.jsx)(f.A,{}),(0,n.jsx)(_,{})]}),c&&I&&(0,n.jsx)(e0,{paymentText:O?k===g.cG.YEARLY?null==t?void 0:t.paymentTextYearly:null==t?void 0:t.paymentTextMonthly:null==t?void 0:t.paymentText,className:"tw-lf-body-regular-sm tw-my-2 tw-hidden desktop:tw-block"}),!O&&c&&(null==t?void 0:t.paymentDisclaimer)&&(0,n.jsx)("p",{className:"tw-lf-body-regular-sm tw-mt-8 desktop:tw-mt-4 desktop:tw-text-left",children:t.paymentDisclaimer}),!F&&(0,n.jsx)(e8.A,{isCheckout:!0,customStyle:"tw-mt-8 desktop:tw-hidden"}),D&&!Y&&(0,n.jsx)(e8.A,{isCheckout:!0,customStyle:"tw-mt-4 desktop:tw-block tw-hidden"})]}),!Y&&(0,n.jsx)(P.w4,{isMembershipSummaryDisplayed:c,children:!D&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(eg,{}),(0,n.jsx)(e8.A,{isCheckout:!0,customStyle:"tw-mt-4 desktop:tw-block tw-hidden tw-text-center"})]})})]}):(0,n.jsx)(w.A,{})};var tf=a(91598),tg=a(14095),tb=a(22469),tC=a(19846);let tv=e=>{let{pageContents:t}=e,{isSubscriptionAvailable:a}=(0,eL.Xo)(L.uM),m=(0,tx.wZ)(),u=(0,l.useRef)(m).current?H.u0:H.Ix,p=(0,i.KH)((null==t?void 0:t.featureFlagKey)||""),y=(0,l.useMemo)(()=>(0,d.Yj)(t,p),[t,p]),w=(0,s.useRouter)(),{shoppingCart:f}=(0,Q.UI)(),[g]=(0,i.zG)(),{startCheckout:b,canStartCheckout:C,canStartOrRestartCheckout:v}=(0,tb.DC)();return((0,l.useEffect)(()=>{(0,h.A)(tf.d.ANALYTICS)&&(0,r.Tp)("checkoutCartId",g)},[g]),(0,eL.Su)(()=>f.products&&C(),()=>{b(f.products)},[f.products]),v())?(0,n.jsx)(tb.b$,{children:(0,n.jsx)(i.sw,{sendMessageToMobile:tg.p,onFlowPaymentCompleted:e=>w.push({pathname:"/checkout/processing",query:{checkoutCartId:g,"cko-payment-id":e}}),children:(0,n.jsx)(o.A,{namespace:"payment-page",options:a?{vault:!0,components:"buttons"}:{components:"buttons,funding-eligibility",enableFunding:x.y24.PAY_LATER},children:(0,n.jsx)(c.A,{children:(0,n.jsx)(eM.XB,{children:(0,n.jsx)(u,{children:(0,n.jsx)(tw,{pageContents:y})})})})})})}):(0,n.jsx)(tC.A,{})};tv.getLayout=()=>(0,P.Ay)(u.pp.PAYMENT),tv.hasAppMobileLayout=!0;var tj=!0;let tA=(0,m.A)(tv)},73287:(e,t,a)=>{"use strict";a.d(t,{z:()=>l});var n=a(55729);let l=()=>{let e=(0,n.useRef)(void 0);return{mainLinkRef:(0,n.useCallback)(t=>{e.current=t},[]),onGroupClick:(0,n.useCallback)(t=>{var a;t.target!==e.current&&(null==(a=e.current)||a.click())},[])}}},77148:(e,t,a)=>{"use strict";a.d(t,{A:()=>l});var n=a(6029);let l=e=>{let{children:t,UNSAFE_className:a}=e;return(0,n.jsx)("li",{className:"".concat(a," tw-lf-body-regular-sm tw-lf-bullet-list-item tw-mb-1 tw-flex tw-items-center tw-leading-[21px] desktop:tw-lf-body-regular-md desktop:tw-mb-3"),children:t})}},79888:(e,t,a)=>{"use strict";a.d(t,{$:()=>i});var n=a(42043),l=a(55729),r=a(42278);let s=new Map,i=function(){let{trailingZeroDisplay:e="stripIfInteger"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,n.useLocale)();return(0,l.useMemo)(()=>{let a="".concat(t,"-").concat(e),n=s.get(a);return n||(n=new r.Sw((e=>
1{let[t,a]=e.split("-");return"".concat(t,"-").concat(a?a.toUpperCase():t)})(t),{trailingZeroDisplay:e}),s.set(a,n)),n},[t])}},84461:(e,t,a)=>{"use strict";a.d(t,{e:()=>n});let n=(e,t=" ")=>{let a="";for(let n=0;n<e.length;n++)"text"in e[n]&&(a+=(a?t:"")+e[n].text);return a}},85365:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var n=a(6029),l=a(42043);a(55729);let r=e=>{let{children:t,isSelected:a=!1,isHighlighted:r=!1,onClick:s=()=>null,dataTestId:i=""}=e,d=(0,l.useTranslations)("Checkout");return(0,n.jsxs)("div",{className:"tw-w-full","data-testid":i,"aria-selected":a,children:[r?(0,n.jsx)("p",{className:"\n tw-lf-body-bold-sm\n tw-flex\n tw-h-[37px]\n tw-justify-center\n tw-rounded-t-xl\n tw-bg-yellow-600\n tw-p-2\n tw-text-center\n tw-outline\n tw-outline-yellow-600\n desktop:tw-lf-body-bold-md\n desktop:tw-h-10\n ".concat(a?" tw-outline-[2px]":"tw-outline-[1px]","\n ").concat(a?"-tw-outline-offset-[2px]":"-tw-outline-offset-[1px]","\n ").concat("","\n tw-relative\n "),children:d("membershipPlanPickerPlanAnnualMostPopular")}):null,(0,n.jsx)("div",{className:"\n tw-lf-button-clear\n tw-relative\n -tw-mt-[1px]\n tw-flex\n tw-h-fit\n tw-w-full\n tw-flex-col\n ".concat(r?"tw-rounded-b-xl":"tw-rounded-xl","\n ").concat(r?"tw-rounded-b-xl":"","\n ").concat(r?"tw-bg-gradient-to-bl tw-from-yellow-100/40 tw-to-transparent":"","\n tw-p-3\n tw-text-left\n desktop:tw-p-6\n ").concat(a?"":"[&_.check-icon]:tw-hidden","\n ").concat(a?"[&>button]:tw-lf-button-primary":"[&>button]:tw-lf-button-secondary","\n tw-outline\n ").concat(a?"tw-outline-[2px] -tw-outline-offset-[2px] tw-outline-yellow-600":"tw-outline-[1px] -tw-outline-offset-[1px] tw-outline-blue-200","\n "),onClick:s,children:t})]})}},91497:(e,t,a)=>{"use strict";a.d(t,{A:()=>l});var n=a(6029);let l=e=>{let{children:t}=e;return(0,n.jsx)("ul",{className:"tw-lf-bullet-list tw-mt-0",children:t})}},98275:(e,t,a)=>{"use strict";a.d(t,{e:()=>l});var n=a(84461);let l=(e,t)=>e?(0,n.e)(e,t):null}},e=>{e.O(0,[3930,71,9364,732,6593,636,8792],()=>e(e.s=859)),_N_E=e.O()}]); 2//# sourceMappingURL=payment-59fa51e8949dde3e.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.