Loading
function(e,t,n){n.d(t,{L:()=>P});var l=n(627968),a=n(64700),r=n(284009),i=n.n(r),s=n(935462),u=n(546605),o=n(742810),d=n(364995),c=n(463376),A=n(558620),m=n(427675),E=n(584160),N=n(480642),S=n(722847),T=n(242874),I=n(75825),p=n(237412),h=n(897904),f=n(45938),y=n(937008),C=n(834252),R=n(166532),_=n(615310),v=n(906234),g=n(652215),x=n(788868),O=n(818348),j=n(575650);function P(e){let{renderHeader:t,handleClose:n}=e,{selectedSkuId:r,purchaseState:P,paymentSourceId:k}=(0,S.t4)(e=>({selectedSkuId:e.selectedSkuId,purchaseState:e.purchaseState,paymentSourceId:e.paymentSourceId})),{purchaseType:M,isDisplayingWowMomentConfirmation:w}=(0,C.P5)(),{isPremium:L,isPremiumGroupPurchase:U,isEligibleForTrial:G,isEligibleForDiscount:F}=(0,c.i)(),D=(0,A.A)(),B=(0,m.S3)(),H=(0,_.bB)(),{checkoutPaymentSources:b,storeCountry:W}=(0,d.t)(),V=a.useMemo(()=>{if(null==k)return null;let e=b.find(e=>e.id===k);return e?.relocationCountry??null},[b,k]),{isGift:K,selectedGiftStyle:Z,giftRecipient:$}=(0,y.Pv)(),Y=(0,u.vg)("PaymentModalHeader"),q=B?.productLine===g.EZt.COLLECTIBLES,z=B?.productLine===g.EZt.SOCIAL_LAYER_GAME_ITEM,X=K&&(0,f.Ik)($)&&H===R.pn.CONFIRM&&null!=Z&&!q&&!z,J=null!=t&&null!=H,Q=[R.pn.SKU_SELECT,R.pn.SELECT_FREE_SKU],ee=null!=H&&!Q.includes(H)&&null!=r,et=(0,o.D7)({location:"PaymentModalHeader"}),en=(0,v.G)(D?.id??"")&&!G;return a.useMemo(()=>{if(null==H)return;if(et&&E.M.includes(H)){let e=(0,E.u)({step:H,skuId:r??(null!=B?B.id:null),showTrialBadge:G,showPromoBadge:F||en,storeCountryFromCheckoutContext:W,isStoreCountryEnabled:Y,relocationCountry:V});return(0,l.jsx)(N.s3,{...e})}let e=null;return X?e=(0,l.jsxs)("div",{className:j.kL,children:[(0,l.jsx)("div",{"aria-hidden":!0,style:{display:"contents"},children:(0,l.jsx)(I.A,{defaultAnimationState:T.oA.LOOP,giftStyle:Z,className:j.qq})}),(0,l.jsx)(s.s_,{onClick:n,className:j.b,"data-migration-pending":!0})]}):J?e=t(D??null,n,H):M===O.VV.ONE_TIME?e=(0,l.jsx)(h.fs,{step:H,onClose:n}):ee&&(i()(r in x.WN,`invalid sku id: ${r}`),e=(0,l.jsx)(p.A,{currentStep:H??void 0,purchaseState:P,premiumType:x.WN[r],onClose:n,showTrialBadge:G,showDiscountBadge:F,isGift:K,giftRecipient:$,isEligibleForTrial:G,enablePremiumBrandRefresh:L,isDisplayingWowMomentConfirmation:w,isPremiumGroupPurchase:U})),e},[et,Y,W,V,Z,n,P,t,D,B,r,H,G,F,en,X,ee,J,M,K,$,L,w,U])}}