1import{an as Ce,ar as On,aq as ke,b7 as et,r as j,_ as cr,j as e,d$ as $r,bG as Gr,ab as xn,c3 as Xt,bK as qr,b6 as lr,m as de,h as E,s as Ne,G as w,bB as Kr,B as be,T as gn,a2 as At,e as ae,a3 as H,a0 as Jr,ag as He,bO as Et,aj as kt,ah as Xr,a9 as Qr,b as nt,C as Zr,H as ea,dR as ta,b0 as ur,cB as na,dK as ra,a4 as dr,aa as Ue,e0 as Nn,bb as ln,bm as aa,a$ as sa,bd as Qe,e1 as In,S as oa}from"./WarningIcon-hckcyQCq.js";import{w as Tt,m as ia,e as ca,I as la,M as ua,N as da,O as pa,P as ma,b as Dn,R as fa,a as Qt,y as Bn,C as Zt,E as qe,x as Mn,T as ha,U as xa,V as ga,W as ya,X as wa,H as va,Y as Sa,i as ba,Z as Ca,$ as St,a0 as en,d as Wn,F as Ln,s as tn,a1 as nn,z as ja,a2 as Pa,t as Ea,l as ka,a3 as Ra,a4 as Aa,a5 as Ta,a6 as Fa,a7 as _a,a8 as Oa,f as Na,p as pr,a9 as Ia,D as Da}from"./GeneralContextContainer-zt2OJ0S4.js";import{c as rn,p as mr,d as Ba}from"./index-B9gCgMkH.js";import{i as Ma,f as Wa,e as La}from"./index-CJjNKsev.js";import{E as Ot,i as Nt,g as rt,R as ue,D as Ie,y as Ha,F as It,l as yn,u as wn,a as Ua,j as fr}from"./requests-7_F0Kb4N.js";import{G as Ya}from"./styles-B0SXNCXR.js";import{l as za}from"./logRocketIdentifyUser-D32esiPg.js";import{C as Va,E as at,G as $a,L as Ga}from"./styles-8HppEEHz.js";import{D as un,a7 as qa,k as vn,a8 as hr,a9 as dn,s as Ka,u as st,
1E as xr,aa as Ja,J as Ze,ab as Xa}from"./requests-x_wO27is.js";import{j as ot,u as Qa,k as an}from"./AuthenticatedContextContainer-BxmrmD5b.js";import{a5 as Za,a6 as gr,u as Ve,l as es,p as pn,n as mn,w as ts,g as yr,e as Sn,b as wr,d as ns,c as sn,Q as rs,R as as,f as ss,a7 as vr,E as Hn,a8 as Sr,P as os,h as is,a9 as cs}from"./requests-BUmDM_iB.js";import{g as Ye,C as Ft,m as ls,n as Un,o as bt,i as us,p as br,e as fn,G as ds,P as ps,u as Cr,q as Yn,v as ms,w as fs,x as hs,y as xs,z as gs}from"./sessionStorageManager-DPF_TOnV.js";import{v as Dt,f as ys,C as ws,a as vs,z as zn,A as Vn,D as Ss,G as bs,H as Cs,I as js,K as Ps,L as Es,O as ks,M as Rs,Q as As,T as Ts,y as Fs}from"./ChooseYourOwnBuilder-BdANBOZb.js";import{A as ye,C as $n,v as _s,a as Os,g as Ns,m as Is,b as Ds}from"./styles-DRE56j0a.js";import{u as tt}from"./useGetAllLDFlagsWithOverrides-B58XlggG.js";import{E as Bs}from"./ErrorOutline-C2GT_Sny.js";import{l as Gn}from"./v4-Dsldo4Er.js";import{T as Ms}from"./index-BdppFSbu.js";import{u as Ws}from"./requests-kt1wNqsV.js";import{D as Ls,L as hn}from"./ErrorBox-Dm4Oaiwj.js";import{a as _t}from"./Logo-Dm0ayIhd.js";import{F as jr}from"./TextField-DK37cmqm.js";import{R as Pr,a as Er}from"./RadioGroup-t-AL6beV.js";import{F as bn}from"./FormControlLabel-Gyo7sKej.js";import{A as Cn,a as jn}from"./Alert-DIicuoHF.js";import{u as Pn}from"./index-BgmqBYKm.js";import{h as Rt}from"./handleApiError-CyEkRw4x.js";import{j as kr,u as Hs}from"./useGetRegions-Dy_hr1lv.js";import{S as Us}from"./SelectField-DOknUuio.js";import{r as Ys,u as Ke}from"./useSetFieldValue-CJpB8Ffw.js";import{D as ze}from"./Divider-TBF0Revw.js";import{S as zs}from"./Switch-DnSa5az2.js";import{B as Vs,a as $s}from"./Banner-qU-bRwAh.js";import{B as Gs}from"./index-BxRAvEUf.js";var qs=864e5;function Ks(t,a){Ce(2,arguments);var n=Tt(t),o=Tt(a),l=n.getTime()-On(n),c=o.getTime()-On(o);return Math.round((l-c)/qs)}function Js(t,a){Ce(2,arguments);var n=ke(t),o=ke(a),l=n.getFullYear()-o.getFullYear(),c=n.getMonth()-o.getMonth();return l*12+c}function qn(t,a){var n=t.getFullYear()-a.getFullYear()||t.getMonth()-a.getMonth()||t.getDate()-a.getDate()||t.getHours()-a.getHours()||t.getMinutes()-a.getMinutes()||t.getSeconds()-a.getSeconds()||t.getMilliseconds()-a.getMilliseconds();return n<0?-1:n>0?1:n}function Rr(t,a){Ce(2,arguments);var n=ke(t),o=ke(a),l=qn(n,o),c=Math.abs(Ks(n,o));n.setDate(n.getDate()-l*c);var r=+(qn(n,o)===-l),i=l*(c-r);return i===0?0:i}function Bt(t,a){return Ce(2,arguments),ke(t).getTime()-ke(a).getTime()}var Xs={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(a){return a<0?Math.ceil(a):Math.floor(a)}},Qs="trunc";function it(t){return Xs[Qs]}function Zs(t,a,n){Ce(2,arguments);var o=Bt(t,a)/ia;return it()(o)}function eo(t,a,n){Ce(2,arguments);var o=Bt(t,a)/ca;return it()(o)}function Ar(t,a){Ce(2,arguments);var n=ke(t),o=ke(a),l=rn(n,o),c=Math.abs(Js(n,o)),r;if(c<1)r=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-l*c);var i=rn(n,o)===-l;Ma(ke(t))&&c===1&&rn(t,o)===1&&(i=!1),r=l*(c-Number(i))}return r===0?0:r}function to(t,a,n){Ce(2,arguments);var o=Ar(t,a)/3;return it()(o)}function no(t,a,n){Ce(2,arguments);var o=Bt(t,a)/1e3;return it()(o)}function ro(t,a,n){Ce(2,arguments);var o=Rr(t,a)/7;return it()(o)}function ao(t){Ce(1,arguments);var a=ke(t),n=a.getDay();return n}const so=({orderPayload:t,currentFlow:a})=>{var n,o,l;return a!=="upgrade"?a:un(t==null?void 0:t.packageId)?"cyo_upgrade":!un(t==null?void 0:t.packageId)&&((n=t==null?void 0:t.services)!=null&&n.length)&&((l=(o=t==null?void 0:t.services)==null?void 0:o.filter(c=>!et(c)))!=null&&l.length)?"addon_upgrade":"package_upgrade"},oo=(t,a)=>{const{t:n}=Ot(),[o,l]=a;return j.useEffect(()=>{const c=Ye(t==null?void 0:t.renewalPackageId);l(n(c==null?void 0:c.displayName))},[t,l,n]),o},io=(t,a)=>{const[n,o]=t,l=j.useRef(!1),c=j.useMemo(()=>(a==null?void 0:a.map(r=>r==null?void 0:r.packageId))||[],[a]);j.useEffect(()=>{if(!n||!a)return;const r=[];return n.forEach(i=>{if(c.includes(i.id)){const u=a.find(S=>S.packageId===i.id);
1if((u==null?void 0:u.status)!=="available"){r.push(i);return}if(!qa(i)){r.push(i);return}const m=Za(i,u),s="discount"in i&&"discountedYearlyPrice"in i.discount&&(i==null?void 0:i.discount.discountedYearlyPrice),v="discount"in m&&"discountedYearlyPrice"in m.discount&&(m==null?void 0:m.discount.discountedYearlyPrice);s!==v&&(l.current=!0,r.push(m))}else r.push(i)}),l.current&&o(r),()=>{l.current=!1}},[n,a,c,o])},co=cr(e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z"})),lo=cr(e.jsx("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"})),on=({field:t,...a})=>{const{errors:n,handleBlur:o,handleChange:l,touched:c,values:r}=Nt(),{classes:{customLabelStyle:i}}=gr(),{t:u}=rt();return e.jsx(la,{autoComplete:t,customClass:i,"data-testid":t,errorId:`${t}__error`,errorText:c[t]?u(n[t]):"",fullWidth:!0,id:u(`${t}_label`),InputLabelProps:{style:{fontWeight:600}},label:u(`${t}_label`),name:t,onBlur:o,onChange:l,value:r[t],...a})},Kn=t=>{const{errors:a,handleBlur:n,handleChange:o,touched:l,values:c}=Nt(),{customLabel:r,field:i,options:u,...m}=t,{t:s}=rt(),{classes:{customLabelStyle:v,customSelectStyle:S,customListStyle:I}}=gr();return!!(u!=null&&u.length)&&e.jsx(Us,{autoComplete:i,customClasses:{customLabelClass:v,customListClass:I,customSelectClass:S},"data-testid":i,errorText:l[i]?s(a[i]):"",fullWidth:!0,id:i,label:s(`${r||i}_label`),menuMaxHeight:350,name:i,onBlur:n,onChange:o,options:u,value:c[i],...m})};var uo={dayOfMonth:"d",fullDate:"PP",fullDateWithWeekday:"PPPP",fullDateTime:"PP p",fullDateTime12h:"PP hh:mm aaa",fullDateTime24h:"PP HH:mm",fullTime:"p",fullTime12h:"hh:mm aaa",fullTime24h:"HH:mm",hours12h:"hh",hours24h:"HH",keyboardDate:"P",keyboardDateTime:"P p",keyboardDateTime12h:"P hh:mm aaa",keyboardDateTime24h:"P HH:mm",minutes:"mm",month:"LLLL",monthAndDate:"MMMM d",monthAndYear:"LLLL yyyy",monthShort:"MMM",weekday:"EEEE",weekdayShort:"EEE",normalDate:"d MMMM",normalDateWithWeekday:"EEE, MMM d",seconds:"ss",shortDate:"MMM d",year:"yyyy"},po=function(){function t(a){var n=this,o=a===void 0?{}:a,l=o.locale,c=o.formats;this.lib="date-fns",this.is12HourCycleInCurrentLocale=function(){return n.locale?/a/.test(n.locale.formatLong.time()):!0},this.getFormatHelperText=function(r){var i=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,u=n.locale||$r;return r.match(i).map(function(m){var s=m[0];if(s==="p"||s==="P"){var v=ua[s];return v(m,u.formatLong,{})}return m}).join("").replace(/(aaa|aa|a)/g,"(a|p)m").toLocaleLowerCase()},this.parseISO=function(r){return mr(r)},this.toISO=function(r){return Wa(r,{format:"extended"})},this.getCurrentLocaleCode=function(){var r;return((r=n.locale)===null||r===void 0?void 0:r.code)||"en-US"},this.addSeconds=function(r,i){return da(r,i)},this.addMinutes=function(r,i){return pa(r,i)},this.addHours=function(r,i){return ma(r,i)},this.addDays=function(r,i){return Dn(r,i)},this.addWeeks=function(r,i){return fa(r,i)},this.addMonths=function(r,i){return Qt(r,i)},this.addYears=function(r,i){return Bn(r,i)},this.isValid=function(r){return Gr(n.date(r))},this.getDiff=function(r,i,u){switch(u){case"years":return Ba(r,n.date(i));case"quarters":return to(r,n.date(i));case"months":return Ar(r,n.date(i));case"weeks":return ro(r,n.date(i));case"days":return Rr(r,n.date(i));case"hours":return Zs(r,n.date(i));case"minutes":return eo(r,n.date(i));case"seconds":return no(r,n.date(i));default:return Bt(r,n.date(i))}},this.isAfter=function(r,i){return Zt(r,i)},this.isBefore=function(r,i){return qe(r,i)},this.startOfDay=function(r){return Tt(r)},this.endOfDay=function(r){return Mn(r)},this.getHours=function(r){return ha(r)},this.setHours=function(r,i){return xa(r,i)},this.setMinutes=function(r,i){return ga(r,i)},this.getSeconds=function(r){return ya(r)},this.setSeconds=function(r,i){return wa(r,i)},this.isSameDay=function(r,i){return va(r,i)},this.isSameMonth=function(r,i){return Sa(r,i)},this.isSameYear=function(r,i){return ba(r,i)},this.isSameHour=function(r,i){return Ca(r,i)},this.startOfYear=function(r){return St(r)},this.endOfYear=function(r){return en(r)},this.startOfMonth=function(r){return Wn(r)},this.endOfMonth=function(r){return Ln(r)},this.startOfWeek=function(r){return tn(r,{locale:n.locale})},this.endOfWeek=function(r){return nn(r,{locale:n.locale})},this.getYear=function(r){return ja(r)},this.setYear=function(r,i){return Pa(r,i)},this.date=function(r){return typeof r>"u"?new Date:r===null?null:new Date(r)},this.toJsDate=function(r){return r},this.parse=function(r,i){return r===""?null:Ea(r,i,new Date,{locale:n.locale})},this.format=function(r,i){return n.formatByString(r,n.formats[i])},this.formatByString=function(r,i){return xn(r,i,{locale:n.locale})},this.isEqual=function(r,i){return r===null&&i===null?!0:ka(r,i)},this.isNull=function(r){return r===null},this.isAfterDay=function(r,i){return Zt(r,Mn(i))},this.isBeforeDay=function(r,i){return qe(r,Tt(i))},this.isBeforeYear=function(r,i){return qe(r,St(i))},this.isAfterYear=function(r,i){return Zt(r,en(i))},this.isWithinRange=function(r,i){var u=i[0],m=i[1];return Ra(r,{start:u,end:m})},this.formatNumber=function(r){return r},this.getMinutes=function(r){return Aa(r)},this.getDate=function(r){return Ta(r)},this.setDate=function(r,i){return Fa(r,i)},this.getMonth=function(r){return _a(r)},this.getDaysInMonth=function(r){return Oa(r)},this.setMonth=function(r,i){return Na(r,i)},this.getMeridiemText=function(r){return r==="am"?"AM":"PM"},this.getNextMonth=function(r){return Qt(r,1)},this.getPreviousMonth=function(r){return Qt(r,-1)},this.getMonthArray=function(r){for(var i=St(r),u=[i];u.length<12;){var m=u[u.length-1];u.push(n.getNextMonth(m))}return u},this.mergeDateAndTime=function(r,i){return n.setSeconds(n.setMinutes(n.setHours(r,n.getHours(i)),n.getMinutes(i)),n.getSeconds(i))},this.getWeekdays=function(){var r=new Date;return La({start:tn(r,{locale:n.locale}),end:nn(r,{locale:n.locale})}).map(function(i){return n.formatByString(i,"EEEEEE")})},this.getWeekArray=function(r){for(var i=tn(Wn(r),{locale:n.locale}),u=nn(Ln(r),{locale:n.locale}),m=0,s=i,v=[],S=null;qe(s,u);){var I=Math.floor(m/7);v[I]=v[I]||[];var P=ao(s);S!==P&&(S=P,v[I].push(s),m+=1),s=Dn(s,1)}return v},this.getYearRange=function(r,i){for(var u=St(r),m=en(i),s=[],v=u;qe(v,m);)s.push(v),v=Bn(v,1);return s},this.locale=l,this.formats=Object.assign({},uo,c)}return t}();const Jn=(t,a)=>{const{alacarteValuesHook:n,purchaseFlowHook:o,selectedPackageHook:l,selectedPackageIdHook:c}=Ve();j.useEffect(()=>{if(!t)return;const[,r]=n,[,i]=o,[,u]=c,[,m]=l;i("purchase");for(const s in a)a[s]==="alacarteValues"&&r(vn),a[s]==="packageId"&&u(null),a[s]==="package"&&m(null)},[t,a,n,o,l,c])},mo="acct_kcUf3bMBXJLU6wu1eUOxpOOt",fo="acct_2Gken2lEad7gxFIo0sjb8M9j",Tr="flow_L1KyhzbriKPrmcItsksd7hwX",ho="flow_U7jjDwjRIt6V63VspUHdlk50",Fr="flow_ROxtorcWIUvoOVmHlWPU9iXA",xo="flow_nAsXDLcRIT5z1Bfsphepgh40",go="ESS_P3_20OFF",yo="PREM_P3_20OFF";var T=(t=>(t.ADDONS="ADDONS",t.CYO="CYO",t.OVERVIEW="OVERVIEW",t.PAYMENT="PAYMENT",t.RENEWALS="RENEWALS",t.REVIEW="REVIEW",t.TRANSACTION="TRANSACTION",t.UPGRADES="UPGRADES",t))(T||{}),_e=(t=>(t.CheckoutStepActioned="Checkout Step Actioned",t.TurnOffAutoRenewFeedback="Turn Off Auto Renew Feedback Form Event",t.CancelFreeTrialFeedback="Cancel Free Trial Feedback Form Event",t.CancellationFlowEngaged="Cancellation Flow Engaged",t))(_e||{}),ct=(t=>(t.Viewed="viewed",t.Submitted="submitted",t))(ct||{}),lt=(t=>(t.Package="packageSelection",t.Payment="payment",t.PaymentOptions="paymentOptions",t))(lt||{}),ut=(t=>(t.BillingPageRewrite="3",t))(ut||{}),dt=(t=>(t.BillingPageRewrite="billingPageRewrite",t))(dt||{});function wo(t,a,n){const o={step:lt.Package,action:ct.Viewed,versionId:ut.BillingPageRewrite,versionName:dt.BillingPageRewrite,type:t,email:a,userId:n.toString()};analytics.track(_e.CheckoutStepActioned,o)}function vo(t,a,n){const o={step:lt.Package,action:ct.Submitted,versionId:ut.BillingPageRewrite,versionName:dt.BillingPageRewrite,type:t,email:a,userId:n.toString()};analytics.track(_e.CheckoutStepActioned,o)}function So(t,a){const n={step:lt.Payment,action:ct.Viewed,versionId:ut.BillingPageRewrite,versionName:dt.BillingPageRewrite,email:t,userId:a.toString()};analytics.track(_e.CheckoutStepActioned,n)}function bo(t,a){const n={step:lt.Payment,action:ct.Submitted,versionId:ut.BillingPageRewrite,versionName:dt.BillingPageRewrite,email:t,userId:a.toString()};analytics.track(_e.CheckoutStepActioned,n)}const _r=({email:t,userId:a,turnOffReason:n,turnOffFreeText:o,stopUsingOFWReason:l,stopUsingOFWOtherFreeText:c})=>{analytics.track(_e.TurnOffAutoRenewFeedback,{email:t,userId:a.toString(),turnOffReason:n,turnOffFreeText:o,stopUsingOFWReason:l,stopUsingOFWOtherFreeText:c})}
1,Or=({email:t,userId:a,cancelReason:n,cancelReasonFreeText:o})=>{analytics.track(_e.CancelFreeTrialFeedback,{email:t,userId:a.toString(),cancelReason:n,cancelReasonFreeText:o})},Co=({userId:t,email:a,packageId:n,flowSession:o,appliedCoupon:l,entranceType:c})=>{analytics.track(_e.CancellationFlowEngaged,{email:a,user_id:String(t),current_package_code:n,existing_offer:l,session_id:o==null?void 0:o.id,flow_name:o==null?void 0:o.flow.name,flow_id:o==null?void 0:o.flow.id,step:o==null?void 0:o.steps.map((r,i)=>({position:i,id:r.step.id,completed_at:r.completed_at,started_at:r.started_at,title:r.step.title,type:r.step.type})),entrance_type:c,exit_type:o==null?void 0:o.status,offer:(o==null?void 0:o.offers_presented.length)>0?o.offers_presented.map(r=>({name:r.name,amount_off:Number(r.details.amount_off)})).reduce(r=>r):{},offer_accepted:(o==null?void 0:o.offer_accepted)!==null})};function Nr(t){const a=Ys(t);analytics.identify(a)}const jo=t=>{if(et(t))return!0;const a=[t==null?void 0:t.city,t==null?void 0:t.country,t==null?void 0:t.line1,t==null?void 0:t.postalCode,t==null?void 0:t.state];return!!(a!=null&&a.some(n=>!n))};var cn={exports:{}},Xn;function Po(){return Xn||(Xn=1,function(t,a){(function(n,o){t.exports=o()})(self,function(){return function(){var n={542:function(r,i,u){var m=u(601),s=u.n(m),v=u(609),S=u.n(v)()(s());S.push([r.id,"body{overflow:hidden !important}.prosperstack-content{font-family:-apple-system,system-ui,Verdana,sans-serif;margin:0}#prosperstack-overlay,.prosperstack-iframe{opacity:0;position:fixed;top:0;left:0;z-index:2147483647;transition:opacity .2s;border:0}#prosperstack-overlay.in,.prosperstack-iframe.in{opacity:1}#prosperstack-overlay,.prosperstack-iframe.full-screen{height:100%;width:100%}#prosperstack-overlay.modal.in{opacity:.5}.prosperstack-iframe.modal{left:50%;top:50%;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);height:100%;border-radius:.25rem;box-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);min-width:60%;max-height:80%;max-width:800px}@media(max-width: 900px){.prosperstack-iframe.modal{min-width:80%}}@media(max-width: 800px){.prosperstack-iframe.modal{min-width:100%;border-radius:0}}@media(max-width: 700px){.prosperstack-iframe.modal{min-height:100%;max-height:100%}}#prosperstack-overlay{background-color:#fff}.prosperstack-error{background-color:#fff;width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;font-size:1.5rem}.prosperstack-error .prosperstack-error-message{border:1px solid pink;border-radius:.5rem;padding:1rem;font-size:1rem;line-height:1.5rem;color:#eb5757;font-weight:bold;max-width:26rem;margin-bottom:1rem;text-align:center}.prosperstack-error a{font-size:1rem;color:#156de4;text-decoration:none}.prosperstack-error a:hover{text-decoration:underline}.prosperstack-spinner{width:100%;height:100%;display:flex;align-items:center;justify-content:center}.prosperstack-spinner .bounce1,.prosperstack-spinner .bounce2,.prosperstack-spinner .bounce3{width:10px;height:10px;background-color:#333;margin-right:6px;opacity:.5;border-radius:100%;display:inline-block;-webkit-animation:prosperstack-bounce-delay 1.4s infinite ease-in-out both;animation:prosperstack-bounce-delay 1.4s infinite ease-in-out both}.prosperstack-spinner .bounce1{-webkit-animation-delay:-0.32s;animation-delay:-0.32s}.prosperstack-spinner .bounce2{-webkit-animation-delay:-0.16s;animation-delay:-0.16s}@-webkit-keyframes prosperstack-bounce-delay{0%,80%,100%{-webkit-transform:scale(0);transform:scale(0)}40%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes prosperstack-bounce-delay{0%,80%,100%{-webkit-transform:scale(0);transform:scale(0)}40%{-webkit-transform:scale(1);transform:scale(1)}}",""]),i.Z=S},609:function(r){r.exports=function(i){var u=[];return u.toString=function(){return this.map(function(m){var s="",v=m[5]!==void 0;return m[4]&&(s+="@supports (".concat(m[4],") {")),m[2]&&(s+="@media ".concat(m[2]," {")),v&&(s+="@layer".concat(m[5].length>0?" ".concat(m[5]):""," {")),s+=i(m),v&&(s+="}"),m[2]&&(s+="}"),m[4]&&(s+="}"),s}).join("")},u.i=function(m,s,v,S,I){typeof m=="string"&&(m=[[null,m,void 0]]);var P={};if(v)for(var Z=0;Z<this.length;Z++){var $=this[Z][0];$!=null&&(P[$]=!0)}for(var O=0;O<m.length;O++){var g=[].concat(m[O]);v&&P[g[0]]||(I!==void 0&&(g[5]===void 0||(g[1]="@layer".concat(g[5].length>0?" ".concat(g[5]):""," {").concat(g[1],"}")),g[5]=I),s&&(g[2]&&(g[1]="@media ".concat(g[2]," {").concat(g[1],"}")),g[2]=s),S&&(g[4]?(g[1]="@supports (".concat(g[4],") {").concat(g[1],"}"),g[4]=S):g[4]="".concat(S)),u.push(g))}},u}}
vendor: 4,279 bytes, line 1
1,601:function(r){r.exports=function(i){return i[1]}},139:function(r,i,u){r.exports=function(){function m(p){return typeof p=="function"}var s=Array.isArray?Array.isArray:function(p){return Object.prototype.toString.call(p)==="[object Array]"},v=0,S=void 0,I=void 0,P=function(p,d){D[v]=p,D[v+1]=d,(v+=2)===2&&(I?I(x):ee())},Z=typeof window<"u"?window:void 0,$=Z||{},O=$.MutationObserver||$.WebKitMutationObserver,g=typeof self>"u"&&typeof Xt<"u"&&{}.toString.call(Xt)==="[object process]",X=typeof Uint8ClampedArray<"u"&&typeof importScripts<"u"&&typeof MessageChannel<"u";function se(){var p=setTimeout;return function(){return p(x,1)}}var D=new Array(1e3);function x(){for(var p=0;p<v;p+=2)(0,D[p])(D[p+1]),D[p]=void 0,D[p+1]=void 0;v=0}var C,b,U,A,ee=void 0;function F(p,d){var f=this,y=new this.constructor(M);y[ne]===void 0&&ce(y);var h=f._state;if(h){var R=arguments[h-1];P(function(){return K(h,y,R,f._result)})}else fe(f,y,p,d);return y}function te(p){if(p&&typeof p=="object"&&p.constructor===this)return p;var d=new this(M);return Q(d,p),d}ee=g?function(){return Xt.nextTick(x)}:O?(b=0,U=new O(x),A=document.createTextNode(""),U.observe(A,{characterData:!0}),function(){A.data=b=++b%2}):X?((C=new MessageChannel).port1.onmessage=x,function(){return C.port2.postMessage(0)}):Z===void 0?function(){try{var p=Function("return this")().require("vertx");return(S=p.runOnLoop||p.runOnContext)!==void 0?function(){S(x)}:se()}catch{return se()}}():se();var ne=Math.random().toString(36).substring(2);function M(){}var k=void 0;function Y(p,d,f){d.constructor===p.constructor&&f===F&&d.constructor.resolve===te?function(y,h){h._state===1?G(y,h._result):h._state===2?N(y,h._result):fe(h,void 0,function(R){return Q(y,R)},function(R){return N(y,R)})}(p,d):f===void 0?G(p,d):m(f)?function(y,h,R){P(function(q){var V=!1,W=function(J,_,oe,ve){try{J.call(_,oe,ve)}catch(je){return je}}(R,h,function(J){V||(V=!0,h!==J?Q(q,J):G(q,J))},function(J){V||(V=!0,N(q,J))},q._label);!V&&W&&(V=!0,N(q,W))},y)}(p,d,f):G(p,d)}function Q(p,d){if(p===d)N(p,new TypeError("You cannot resolve a promise with itself"));else if(h=typeof(y=d),y===null||h!=="object"&&h!=="function")G(p,d);else{var f=void 0;try{f=d.then}catch(R){return void N(p,R)}Y(p,d,f)}var y,h}function ie(p){p._onerror&&p._onerror(p._result),z(p)}function G(p,d){p._state===k&&(p._result=d,p._state=1,p._subscribers.length!==0&&P(z,p))}function N(p,d){p._state===k&&(p._state=2,p._result=d,P(ie,p))}function fe(p,d,f,y){var h=p._subscribers,R=h.length;p._onerror=null,h[R]=d,h[R+1]=f,h[R+2]=y,R===0&&p._state&&P(z,p)}function z(p){var d=p._subscribers,f=p._state;if(d.length!==0){for(var y=void 0,h=void 0,R=p._result,q=0;q<d.length;q+=3)y=d[q],h=d[q+f],y?K(f,y,h,R):h(R);p._subscribers.length=0}}function K(p,d,f,y){var h=m(f),R=void 0,q=void 0,V=!0;if(h){try{R=f(y)}catch(W){V=!1,q=W}if(d===R)return void N(d,new TypeError("A promises callback cannot return that same promise."))}else R=y;d._state!==k||(h&&V?Q(d,R):V===!1?N(d,q):p===1?G(d,R):p===2&&N(d,R))}var we=0;function ce(p){p[ne]=we++,p._state=void 0,p._result=void 0,p._subscribers=[]}var pe=function(){function p(d,f){this._instanceConstructor=d,this.promise=new d(M),this.promise[ne]||ce(this.promise),s(f)?(this.length=f.length,this._remaining=f.length,this._result=new Array(this.length),this.length===0?G(this.promise,this._result):(this.length=this.length||0,this._enumerate(f),this._remaining===0&&G(this.promise,this._result))):N(this.promise,new Error("Array Methods must be provided an Array"))}return p.prototype._enumerate=function(d){for(var f=0;this._state===k&&f<d.length;f++)this._eachEntry(d[f],f)},p.prototype._eachEntry=function(d,f){var y=this._instanceConstructor,h=y.resolve;if(h===te){var R=void 0,q=void 0,V=!1;try{R=d.then}catch(J){V=!0,q=J}if(R===F&&d._state!==k)this._settledAt(d._state,f,d._result);else if(typeof R!="function")this._remaining--,this._result[f]=d;else if(y===re){var W=new y(M);V?N(W,q):Y(W,d,R),this._willSettleAt(W,f)}else this._willSettleAt(new y(function(J){return J(d)}),f)}else this._willSettleAt(h(d),f)},p.prototype._settledAt=function(d,f,y){var h=this.promise;h._state===k&&(this._remaining--,d===2?N(h,y):this._result[f]=y),this._remaining===0&&G(h,this._result)},p.prototype._willSettleAt=function(d,f){var y=this;
1fe(d,void 0,function(h){return y._settledAt(1,f,h)},function(h){return y._settledAt(2,f,h)})},p}(),re=function(){function p(d){this[ne]=we++,this._result=this._state=void 0,this._subscribers=[],M!==d&&(typeof d!="function"&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof p?function(f,y){try{y(function(h){Q(f,h)},function(h){N(f,h)})}catch(h){N(f,h)}}(this,d):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return p.prototype.catch=function(d){return this.then(null,d)},p.prototype.finally=function(d){var f=this,y=f.constructor;return m(d)?f.then(function(h){return y.resolve(d()).then(function(){return h})},function(h){return y.resolve(d()).then(function(){throw h})}):f.then(d,d)},p}();return re.prototype.then=F,re.all=function(p){return new pe(this,p).promise},re.race=function(p){var d=this;return s(p)?new d(function(f,y){for(var h=p.length,R=0;R<h;R++)d.resolve(p[R]).then(f,y)}):new d(function(f,y){return y(new TypeError("You must pass an array to race."))})},re.resolve=te,re.reject=function(p){var d=new this(M);return N(d,p),d},re._setScheduler=function(p){I=p},re._setAsap=function(p){P=p},re._asap=P,re.polyfill=function(){var p=void 0;if(u.g!==void 0)p=u.g;else if(typeof self<"u")p=self;else try{p=Function("return this")()}catch{throw new Error("polyfill failed because global object is unavailable in this environment")}var d=p.Promise;if(d){var f=null;try{f=Object.prototype.toString.call(d.resolve())}catch{}if(f==="[object Promise]"&&!d.cast)return}p.Promise=re},re.Promise=re,re}()}},o={};function l(r){var i=o[r];if(i!==void 0)return i.exports;var u=o[r]={id:r,exports:{}};return n[r].call(u.exports,u,u.exports,l),u.exports}l.n=function(r){var i=r&&r.__esModule?function(){return r.default}:function(){return r};return l.d(i,{a:i}),i},l.d=function(r,i){for(var u in i)l.o(i,u)&&!l.o(r,u)&&Object.defineProperty(r,u,{enumerable:!0,get:i[u]})},l.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),l.o=function(r,i){return Object.prototype.hasOwnProperty.call(r,i)},l.r=function(r){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})};var c={};return function(){l.r(c),l.d(c,{_appendStyles:function(){return S},_showLoadingIndicator:function(){return P},_showOverlay:function(){return I},default:function(){return D},flow:function(){return Z},init:function(){return g}});var r=l(542);function i(){var x;return window.__PROSPERSTACK_DEBUG_API_HOST__?window.__PROSPERSTACK_DEBUG_API_HOST__:!((x=window.ProsperStack)===null||x===void 0)&&x.debugApiHost?window.ProsperStack.debugApiHost:"https://api.prosperstack.com"}var u=l(139).Promise,m=function(x,C,b,U){return new(b||(b=u))(function(A,ee){function F(M){try{ne(U.next(M))}catch(k){ee(k)}}function te(M){try{ne(U.throw(M))}catch(k){ee(k)}}function ne(M){var k;M.done?A(M.value):(k=M.value,k instanceof b?k:new b(function(Y){Y(k)})).then(F,te)}ne((U=U.apply(x,[])).next())})},s=function(x,C){var b,U,A,ee,F={label:0,sent:function(){if(1&A[0])throw A[1];return A[1]},trys:[],ops:[]};return ee={next:te(0),throw:te(1),return:te(2)},typeof Symbol=="function"&&(ee[Symbol.iterator]=function(){return this}),ee;function te(ne){return function(M){return function(k){if(b)throw new TypeError("Generator is already executing.");for(;ee&&(ee=0,k[0]&&(F=0)),F;)try{if(b=1,U&&(A=2&k[0]?U.return:k[0]?U.throw||((A=U.return)&&A.call(U),0):U.next)&&!(A=A.call(U,k[1])).done)return A;switch(U=0,A&&(k=[2&k[0],A.value]),k[0]){case 0:case 1:A=k;break;case 4:return F.label++,{value:k[1],done:!1};case 5:F.label++,U=k[1],k=[0];continue;case 7:k=F.ops.pop(),F.trys.pop();continue;default:if(!((A=(A=F.trys).length>0&&A[A.length-1])||k[0]!==6&&k[0]!==2)){F=0;continue}if(k[0]===3&&(!A||k[1]>A[0]&&k[1]<A[3])){F.label=k[1];break}if(k[0]===6&&F.label<A[1]){F.label=A[1],A=k;break}if(A&&F.label<A[2]){F.label=A[2],F.ops.push(k);break}A[2]&&F.ops.pop(),F.trys.pop();continue}k=C.call(x,F)}catch(Y){k=[6,Y],U=0}finally{b=A=0}if(5&k[0])throw k[1];return{value:k[0]?k[1]:void 0,done:!0}}([ne,M])}}},v="An unknown error occurred. Please try again later.";function S(){var x=document.createElement("style");return x.setAttribute("id","prosperstack-style"),x.innerHTML=r.Z,document.head.appendChild(x),x}function I(x){var C=document.createElement("div");return C.setAttribute("id","prosperstack-overlay"),x==="modal"&&C.classList.add("modal"),document.body.appendChild(C),C}function P(x){var C=document.createElement("div");C.classList.add("prosperstack-spinner");var b=document.createElement("div");b.classList.add("bounce1");var U=document.createElement("div");U.classList.add("bounce2");var A=document.createElement("div");return A.classList.add("bounce3"),C.appendChild(b),C.appendChild(U),C.appendChild(A),x.appendChild(C),x.classList.add("in"),C}function Z(x,C){if(C===void 0&&(C={}),window.Promise&&!C.onCompleted)return new window.Promise(function(b){$(x,C).then(function(U){return b(U)})});$(x,C).then(function(b){C.onCompleted&&C.onCompleted(b)})}function $(x,C){return m(this,void 0,void 0,function(){var b=this;return s(this,function(U){return[2,new u(function(A){return m(b,void 0,void 0,function(){var ee,F,te,ne,M,k,Y,Q,ie,G,N,fe,z,K,we,ce,pe,re,p,d,f;return s(this,function(y){switch(y.label){case 0:if(ee=S(),F=I(C.displayMode),te=C.disableLoadingIndicator?void 0:P(F),ne=function(h){h.message&&console.error(h.message),document.body.removeChild(F),function(R,q,V){var W,J=R.message||v,_=document.createElement("iframe");_.classList.add("prosperstack-iframe","in"),_.classList.add(q==="modal"?"modal":"full-screen"),document.body.appendChild(_);var oe=_.contentDocument||((W=_.contentWindow)===null||W===void 0?void 0:W.document);if(!oe)throw new Error("Unable to get iframe document");oe.body.classList.add("prosperstack-content");var ve=oe.createElement("div");ve.classList.add("prosperstack-error");var je=oe.createElement("div");je.classList.add("prosperstack-error-message"),je.innerText="Error: "+J,ve.appendChild(je);var De=oe.createElement("div"),me=oe.createElement("a");me.setAttribute("href","#"),me.innerText="Close",me.addEventListener("click",function($e){$e.preventDefault(),document.body.removeChild(_),V()}),De.appendChild(me),ve.appendChild(De);var Re=oe.createElement("style");Re.setAttribute("id","prosperstack-error-style"),Re.innerHTML=r.Z,oe.head.appendChild(Re),oe.body.appendChild(ve)}(h,C.displayMode||"full_screen",function(){document.head.removeChild(ee)}),C.onError&&(h instanceof Error?C.onError(h):C.onError(new Error("An unknown error occurred.")))},M=window.__PROSPERSTACK_PREVIEW_MODE__||!1,k=new URLSearchParams({embedded:"true"}),M&&k.append("previewMode","true"),C.testMode&&k.append("testMode","true"),C.skipOffers)try{for(Y=function(h){var R=typeof Symbol=="function"&&Symbol.iterator,q=R&&h[R],V=0;if(q)return q.call(h);if(h&&typeof h.length=="number")return{next:function(){return h&&V>=h.length&&(h=void 0),{value:h&&h[V++],done:!h}}};throw new TypeError(R?"Object is not iterable.":"Symbol.iterator is not defined.")}(C.skipOffers),Q=Y.next();!Q.done;Q=Y.next())ie=Q.value,k.append("skipOffers",ie)}catch(h){d={error:h}}finally{try{Q&&!Q.done&&(f=Y.return)&&f.call(Y)}finally{if(d)throw d.error}}if(k.append("displayMode",C.displayMode==="modal"?"modal":"full_screen"),G="",N="",x.payload)try{fe=JSON.parse(x.payload),N=fe.clientId}catch{return ne(new Error("payload must be a valid JSON string.")),[2]}else x.clientId&&(N=x.clientId);return!N&&window.ProsperStack.clientId&&(N=window.ProsperStack.clientId),N?!C.sign||x.payload?[3,2]:(z=JSON.stringify(x),[4,C.sign(z)]):(ne(new Error("clientId is required.")),[2]);case 1:K=y.sent(),x={payload:z,signature:K}
1,y.label=2;case 2:return y.trys.push([2,4,,5]),[4,O(x,C.testMode||M||!1)];case 3:return we=y.sent(),G=we+"?".concat(k),[3,5];case 4:return ce=y.sent(),ne(ce),[2];case 5:return(pe=document.createElement("iframe")).classList.add("prosperstack-iframe"),pe.classList.add(C.displayMode==="modal"?"modal":"full-screen"),pe.setAttribute("src",G),document.body.appendChild(pe),re=function(h){if(h.origin===function(){var R;return window.__PROSPERSTACK_DEBUG_APP_HOST__?window.__PROSPERSTACK_DEBUG_APP_HOST__:!((R=window.ProsperStack)===null||R===void 0)&&R.debugAppHost?window.ProsperStack.debugAppHost:"https://app.prosperstack.com"}())switch(h.data.message){case"loaded":pe.classList.add("in"),F.classList.add("in"),te&&F.removeChild(te),C.onStarted&&C.onStarted();break;case"complete":A(h.data.payload),(h.data.close===void 0||h.data.close)&&(p(),C.onClosed&&C.onClosed());break;case"closed":p(),C.onClosed&&C.onClosed();break;case"loading":pe.classList.remove("in"),te&&F.appendChild(te)}},window.addEventListener("message",re),p=function(){document.body.removeChild(F),pe.classList.remove("in"),window.setTimeout(function(){window.removeEventListener("message",re),document.head.removeChild(ee),document.body.removeChild(pe)},300)},[2]}})})})]})})}function O(x,C){return m(this,void 0,void 0,function(){var b,U,A,ee,F,te,ne;return s(this,function(M){switch(M.label){case 0:return b=typeof x.payload=="string"?x.payload:JSON.stringify(x),U=new URLSearchParams,C&&U.append("testMode","true"),[4,fetch("".concat(i(),"/flow?").concat(U),{method:"POST",headers:{"content-type":"application/json","x-prosperstack-signature":x.signature||"","x-prosperstack-version":"2.3.18"},body:b})];case 1:if((A=M.sent()).ok)return[3,6];if(A.status===503)throw new Error("The service is undergoing scheduled maintenance. Please try again later.");if(A.status===504)throw new Error("The service is currently unavailable. Please try again later.");ee=v,M.label=2;case 2:return M.trys.push([2,4,,5]),[4,A.json()];case 3:return F=M.sent(),ee=F.error,[3,5];case 4:return M.sent(),[3,5];case 5:throw new Error(ee);case 6:if(!(te=A.headers.get("Location")))throw new Error("Unable to create flow session.");return[4,A.json()];case 7:return ne=M.sent(),x.signature&&!ne.signatureRequired&&(ne.signatureVerified?console.warn(`The supplied signature was valid. 2 3However, signatures are not required by your flow configuration. 4 5Do not rely on signatures for authentication!`):console.error(`The supplied signature was not valid! 6 7This will not prevent your flow from functioning because signatures are not required by your flow configuration. 8 9Do not rely on signatures for authentication!`)),[2,te]}})})}function g(x){window.ProsperStack.clientId=x.clientId,window.ProsperStack.debugAppHost=x.debugAppHost,window.ProsperStack.debugApiHost=x.debugApiHost}window.ProsperStack=window.ProsperStack||{};var X=!1,se=function(){X=!0,window.__PROSPERSTACK_DEBUG_APP_HOST__&&!window.ProsperStack.debugAppHost&&(window.ProsperStack.debugAppHost=window.__PROSPERSTACK_DEBUG_APP_HOST__),window.__PROSPERSTACK_DEBUG_API_HOST__&&!window.ProsperStack.debugApiHost&&(window.ProsperStack.debugApiHost=window.__PROSPERSTACK_DEBUG_API_HOST__)};window.addEventListener("DOMContentLoaded",function(){return se}),document.readyState!=="complete"||X||se();var D=Z}(),c}()})}(cn)),cn.exports}var Eo=Po();const ko=qr(Eo),Qn=(t,a,n,o,l,c,r,i,u,m)=>{const s=lr()?mo:fo,v=r&&r/12;return ko({clientId:s,flowId:t,subscription:{mrr:v},subscriber:{internalId:String(a),name:n,email:o,properties:{isfreetrial:l,removing_payment_method:c,can_display_offer:i,co_parent_active:u,is_essentials:m}}})},Zn=(t,a,n)=>{t.flow.id===Tr&&_r({userId:String(a),email:n,turnOffReason:t.cancel_reason.reason_code||"other",turnOffFreeText:t.cancel_reason.text,stopUsingOFWReason:t.answers.length>1?t.answers[1].value[0].reason_code:"other",stopUsingOFWOtherFreeText:t.answers.length>1?t.answers[1].value[0].text:""}),t.flow.id===Fr&&Or({userId:String(a),email:n,cancelReason:t.cancel_reason.reasonCode||"other",cancelReasonFreeText:t.cancel_reason.text})},Ct={[dn]:go,[hr]:yo},er=(t,a)=>{let n;switch(t.amount_off){case"15":n=Ct[a];break;case"20":n=Ct[a];break;case"25":n=Ct[a];break;case"30":n=Ct[a];break}return n},Ro=de()({packageName:{fontWeight:600},cancelledTrial:{color:"#B31010"}}),Ao=t=>{var I;const{t:a}=ue(),{billingData:n,billingState:o}=ot(),l=o==="loaded"?n:null,{currentSub:c,headerClass:r,sectionClass:i,packageName:u,isFreeTrial:m,isSubActive:s}=t,{classes:v}=Ro(),S=[];return c!=null&&c.expensePayments&&S.push(`${c!=null&&c.expensePayments.unlimitedPayments?"Unlimited Expense Payments":!(c!=null&&c.expensePayments.unlimitedPayments)&&(c!=null&&c.expensePayments.enabled)?"8 Free Expense Payments":null}`),c!=null&&c.myfiles&&(c==null?void 0:c.myfiles.totalSpaceGig)!==0&&S.push(`${c!=null&&c.myfiles.unlimitedStorage?" Unlimited MyFiles Storage":` ${c==null?void 0:c.myfiles.totalSpaceFormatted} MyFiles Storage`}`),(I=c==null?void 0:c.tonemeter)!=null&&I.active&&S.push(" ToneMeterâ¢"),e.jsxs(e.Fragment,{children:[e.jsx(E,{className:r,children:a("Current Plan")}),e.jsxs(E,{display:"flex",children:[e.jsx(E,{className:v.packageName,children:u?`${a(u)}`:`${a("No current package")}`})," ",l.hasMilitaryDiscount?e.jsxs(E,{children:["(",a("Military family discount"),")"]}):l.hasFeeWaiver?e.jsxs(E,{children:[" (",a("Fee waiver"),")"]}):null]}),m&&!l.autoRenew&&s&&!l.coParentPayingForYou&&e.jsx(E,{className:v.cancelledTrial,children:"Your free trial has been cancelled"}),u==="Choose Your Own"&&!m?e.jsx(E,{className:i,component:"span",children:S&&`${a(S.toString())}`}):null]})},Ir=t=>{const{t:a}=ue(),{name:n,address:o,headerClass:l,sectionClass:c}=t;return e.jsxs(e.Fragment,{children:[e.jsx(E,{className:l,children:a("Billing")}),e.jsx(E,{"data-private":!0,className:c,children:n}),e.jsx(E,{"data-private":!0,className:c,children:o==null?void 0:o.line1}),(o==null?void 0:o.line2)&&e.jsx(E,{"data-private":!0,className:c,children:o.line2}),e.jsxs(E,{"data-private":!0,className:c,children:[o==null?void 0:o.city,", ",o==null?void 0:o.state," ",o==null?void 0:o.postalCode]}),e.jsx(E,{"data-private":!0,className:c,children:o==null?void 0:o.country})]})},To=de()(t=>({toggle:{display:"flex",margin:"0",padding:"0"},selectedToggleOption:{alignItems:"center",background:t.palette.white.main,border:`1px solid ${t.palette.gray.light}`,borderRadius:"20px",cursor:"pointer",display:"flex",height:"22px",justifyContent:"center",position:"relative",transition:"all 0.1s linear",width:"70px",zIndex:"2","&:first-of-type":{left:"8px"},"&:nth-of-type(2)":{right:"8px"},"& input":{display:"none"},"& label":{color:t.palette.primary.main,cursor:"pointer",fontFamily:t.typography.fontFamily,fontSize:"10px",fontWeight:"600"}},toggleOption:{alignItems:"center",background:t.palette.gray.light,border:`1px solid ${t.palette.gray.light}`,borderRadius:"20px",cursor:"pointer",display:"flex",height:"22px",justifyContent:"center",position:"relative",transition:"all 0.1s linear",width:"70px",zIndex:"1","&:first-of-type":{left:"8px"},"&:nth-of-type(2)":{right:"8px"},"& input":{display:"none"},"& label":{color:t.palette.hintText.main,cursor:"pointer",fontFamily:t.typography.fontFamily,fontSize:"10px",fontWeight:"600"}}}));Ne(Kr)(({theme:t})=>({left:"3px !important",maxWidth:"206px","& h5":{fontSize:"12px",fontWeight:700,lineHeight:"15px",margin:"0"},"& p":{fontSize:"12px",fontWeight:400,lineHeight:"15px"},"& .MuiTooltip-tooltip":{background:t.palette.gray.dark,border:"0",borderRadius:"0",color:t.palette.white.main,padding:"12px",fontFamily:t.typography.fontFamily},"& .MuiTooltip-arrow":{color:t.palette.gray.dark,width:"16px","&::before":{border:"0"}}}));const Je=Ne(w)(()=>({display:"flex",width:"100%",justifyContent:"space-between","& button":{padding:"0px 12px"}})),jt=Ne(E)(()=>({padding:"10px 0 10px 10px"})),Xe=Ne(E)(()=>({padding:"10px 10px 10px 0px"})),Fo=de()(t=>({root:{maxWidth:"500px",display:"flex",flexDirection:"column",fontFamily:"Open Sans",fontSize:"12px",fontWeight:400},container:{padding:"8px",margin:"4px 8px 8px 24px",borderRadius:"4px",border:`1px solid ${t.palette.shade6.main}`,[t.breakpoints.down("sm")]:{margin:"0px -8px"}},topContainer:{padding:"8px",margin:"16px 8px 0px 16px",[t.breakpoints.down("sm")]:{margin:"unset"}},bottomContainer:{padding:"8px",margin:"8px 0 0 24px",[t.breakpoints.down("sm")]:{margin:"unset",marginLeft:"-8px"}},heading:{color:t.palette.gray.main},text:{color:t.palette.gray.dark},link:{color:t.palette.ofwBlue.main,fontWeight:400,textTransform:"none",fontSize:"12px","&:hover":{color:t.palette.ofwBlue.main,backgroundColor:t.palette.white.main}},backButton:{color:t.palette.ofwBlue.main,cursor:"pointer",fontSize:"14px",fontWeight:600,textTransform:"none",justifyContent:"flex-start",width:"fit-content","&:hover":{color:t.palette.ofwBlue.main,backgroundColor:t.palette.white.main}},backButtonContainer:{alignItems:"center",display:"flex",width:"50%","@media (max-width: 600px)":{justifyContent:"center"},"& svg":{fill:t.palette.ofwBlue.main,cursor:"pointer"}},errorMessage:{color:t.palette.error.main},submitButton:{width:"100%",color:t.palette.white.main,backgroundColor:t.palette.ofwBlue.main}})),_o=t=>{const{t:a}=ue(),{history:n,getDetails:o,headerClass:l,linkClass:c}=t;return e.jsxs(e.Fragment,{children:[e.jsx(w,{className:l,children:a("Billing History")}),!!(n!=null&&n.length)&&(n==null?void 0:n.map(r=>e.jsxs(Je,{container:!0,spacing:0,alignItems:"center",children:[e.jsx(w,{item:!0,xs:7,children:r.dateFormatted?xn(mr(r==null?void 0:r.dateFormatted),"LLL dd, yyyy"):""}),e.jsxs(w,{item:!0,xs:3,children:[r.refunded?`(${r.paymentAmountFormatted})`:r.paymentAmountFormatted," ",r.refunded?`${a("refunded")}`:r.voided?`${a("voided")}`:null]}),e.jsx(Xe,{children:e.jsx(be,{onClick:()=>o(r.paymentId),className:c,size:"medium",disableRipple:!0,children:a("View")})})]},r.transactionId)))]})},Oo=t=>{const{t:a}=ue(),{isSubActive:n,isAutoRenew:o,renewalPrice:l,renewalDate:c,headerClass:r,sectionClass:i,renewalPlan:u,isPaidByCo:m,renewalCouponAmountFormatted:s}=t;return e.jsxs(e.Fragment,{children:[e.jsx(E,{className:r,children:a("Auto Renew")}),e.jsx(E,{className:i,component:"span",maxWidth:"480px",display:"inline-block",children:m?e.jsx(e.Fragment,{children:a("Your Co-Parent is currently paying for your subscription. To take over these payments please click on transfer subscription")}):o&&n?e.jsxs(e.Fragment,{children:[a("You currently have auto renew turned ON. Your renewal plan is {{renewalPlan}}. You will be charged {{amount}}",{renewalPlan:u,amount:l})," ",s&&`(${s} ${a("discount applied")})`," ",a("on {{renewalDate}}",{renewalDate:c})]}):e.jsx(e.Fragment,{children:a("You currently have auto renew turned OFF. You will need to manually renew your subscription before your renewal date or turn on auto renew.")})})]})},Dr=de()({root:{margin:0,padding:"8px 8px 8px 24px",textAlign:"inherit"},closeButton:{position:"absolute",right:"4px",top:"4px",color:"#5E5F61"}
9,continueButton:{backgroundColor:H[100],color:"#FFF"},cancelButton:{color:H[100],borderColor:H[100]}}),No=t=>{const{children:a,onClose:n,...o}=t,{classes:l}=Dr();return e.jsxs(Ia,{className:l.root,...o,children:[e.jsx(gn,{variant:"h6",children:a}),n?e.jsx(Jr,{"aria-label":"close",className:l.closeButton,onClick:n,size:"large",children:e.jsx(Va,{})}):null]})},Io=t=>{const{t:a}=ue(),{isSpanish:n}=pr(),{open:o,handleClose:l,subPrice:c,renewDate:r,updateAutoRenew:i}=t,{classes:u}=Dr();return e.jsx("div",{children:e.jsxs(Ie,{onClose:l,"aria-labelledby":"customized-dialog-title",open:o,children:[e.jsx(No,{id:"customized-dialog-title",onClose:l,children:a("Turn on Auto Renew")}),e.jsx(Ha,{className:u.root,dividers:!0,children:e.jsxs(gn,{gutterBottom:!0,children:[a("By turning on Auto Renew, your subscription will automatically renew and you will be billed {{amount}}, plus applicable taxes, every year, on {{renewDate}}, until you turn it off. By clicking Turn on, you agree to our ",{amount:c,renewDate:r}),e.jsxs(At,{href:_t("termsAndConditions",n).href,target:"_blank",rel:"noreferrer",children:["Â ",a("Terms & Conditions")]})," and ",e.jsx(At,{href:_t("privacyPolicy",n).href,target:"_blank",rel:"noreferrer",children:a("Privacy Policy")})]})}),e.jsxs(Ls,{children:[e.jsx(ae,{className:u.cancelButton,autoFocus:!0,variant:"outlined",onClick:l,color:"primary",children:a("Cancel")}),e.jsx(ae,{className:u.continueButton,autoFocus:!0,variant:"contained",onClick:i,color:"primary",children:a("Turn on")})]})]})})},Br=de()({bodyText:{fontWeight:400,fontSize:"14px",paddingBottom:"16px"},buttonBox:{display:"flex",flexDirection:"column"},cancelButton:{color:H[100],borderColor:H[100],flex:2,fontFamily:"Open Sans",textDecoration:"none",textTransform:"capitalize"},cancelReasonRadioGroup:{padding:"15px 0","& label":{textAlign:"left",width:"100%"}},continueButton:{backgroundColor:H[100],color:"#FFF",fontFamily:"Open Sans",marginBottom:"12px",textDecoration:"none",textTransform:"capitalize"},feedbackForm:{textAlign:"left"},formLabel:{color:"#000 !important",fontWeight:600,fontSize:"18px",textAlign:"center"},heading:{fontWeight:600,fontSize:"18px",paddingBottom:"8px"},otherCancelReason:{display:"flex"},otherTextField:{marginBottom:"15px","&:after":{borderBottom:`2px solid ${H[100]}`}},radioChecked:{"&.Mui-checked":{color:H[100]}},radioRoot:{padding:"5px 9px"},requiredText:{color:"#5E5F61",display:"flex",fontSize:"0.75rem",justifyContent:"center",marginTop:"10px"},root:{display:"flex",flexDirection:"column",fontFamily:"Open Sans",textAlign:"center",width:"350px",padding:"1rem"},selectInput:{"&:after":{borderBottom:`2px solid ${H[100]}`}},stopReasonSelect:{margin:"15px 0"},submitButton:{backgroundColor:H[100],color:"#FFF",marginBottom:"5px",textDecoration:"none",textTransform:"capitalize","&:disabled":{backgroundColor:"#D5D5D5"}},turnOffReasonLabel:{fontSize:"15px"}}),Do=t=>{const{classes:a}=Br();return e.jsx(Er,{disableRipple:!0,classes:{root:a.radioRoot,checked:a.radioChecked},...t})},tr={payManually:"Decided to pay manually",stopUsingOFW:"Planning to stop using OurFamilyWizard",other:"Other"},nr={missingFeatures:"Missing features",customerService:"Customer service experience",difficultToUse:"Difficult to use",noLongerCourtOrdered:"No longer court ordered to use it",expensive:"Too expensive",coparent:"My coparent didn't use it",children:"Child(ren) no longer minor(s)",other:"Other reason"},Bo=t=>{const{classes:a}=Br(),{email:n,open:o,onClose:l,isPayingForCoparent:c,turnOffAutoRenew:r,userId:i}=t,[u,m]=j.useState("CONFIRMATION"),[s,v]=j.useState(null),[S,I]=j.useState(""),[P,Z]=j.useState(null),[$,O]=j.useState(null),g=b=>{const U=b.target.value==="other",A=b.target.value==="stopUsingOFW";U||I(null),A||(Z(null),O(null)),v(b.target.value)},X=b=>{b.target.value==="other"||O(null),Z(b.target.value)},se=!s||s==="other"&&!(S!=null&&S.trim())||s==="stopUsingOFW"&&!P||s==="stopUsingOFW"&&P==="other"&&!($!=null&&$.trim()),D=()=>{r(),_r({userId:i.toString(),email:n,turnOffReason:s,turnOffFreeText:S,stopUsingOFWReason:P,stopUsingOFWOtherFreeText:$}),x()},x=()=>{l(),C()},C=()=>{m("CONFIRMATION"),v(null),I(null),Z(null),O(null)};return e.jsx(Ie,{onClose:x,open:o,children:e.jsxs(E,{className:a.root,children:[u==="CONFIRMATION"&&e.jsxs(e.Fragment,{children:[e.jsx(E,{paddingTop:"8px",children:e.jsx(at,{color:"error",fontSize:"large"})}),e.jsx(E,{className:a.heading,children:"Are you sure you want to turn off Auto Renew?"}),e.jsxs(E,{className:a.bodyText,children:["You ",c?"and your co-parent":null," will need to manually renew your subscription before the renewal date to prevent interruption of your service."]}),e.jsx(ae,{className:a.continueButton,disableElevation:!0,disableRipple:!0,variant:"contained",onClick:()=>m("FEEDBACK_FORM"),children:"Turn off"}),e.jsx(ae,{className:a.cancelButton,disableElevation:!0,disableRipple:!0,variant:"outlined",onClick:x,children:"Cancel"})]}),u==="FEEDBACK_FORM"&&e.jsx(It,{onSubmit:D,initialValues:{turnOffReason:s,turnOffFreeText:S,stopReason:P,stopReasonFreeText:$},children:()=>e.jsxs(yn,{className:a.feedbackForm,children:[e.jsxs(He,{component:"fieldset",children:[e.jsx(jr,{classes:{root:a.formLabel},component:"legend",children:"Why are you turning off Auto Renew?"}),e.jsx("span",{className:a.requiredText,children:"Please complete all fields"}),e.jsx(Pr,{className:a.cancelReasonRadioGroup,"aria-label":"Cancel reason",name:"cancelReason",value:s,onChange:g,children:Object.keys(tr).map(b=>e.jsx(bn,{value:b,classes:{label:a.turnOffReasonLabel},control:e.jsx(Do,{}),label:tr[b]},b))})]}),s==="other"&&e.jsxs(He,{className:a.otherCancelReason,children:[e.jsx(Et,{id:"otherCancelReason",children:"Tell us why you're turning off auto renew"}),e.jsx(kt,{className:a.otherTextField,id:"otherCancelReason",inputProps:{"aria-label":"Other"},value:S,onChange:b=>I(b.target.value),"aria-describedby":"otherCancelReason"})]}),s==="stopUsingOFW"&&e.jsxs(He,{className:a.stopReasonSelect,children:[e.jsx(Et,{children:"What is the primary reason you're planning to stop using OurFamilyWizard?"}),e.jsx(Xr,{labelId:"stopReason",id:"stopReason",value:P,onChange:X,inputProps:{"aria-label":"Primary stop reason"},input:e.jsx(kt,{className:a.selectInput}),children:Object.keys(nr).map(b=>e.jsx(Qr,{value:b,children:nr[b]},b))}),P==="other"&&e.jsxs(He,{children:[e.jsx(Et,{id:"otherStopReason",children:"Tell us why you're planning to stop using OFW"}),e.jsx(kt,{className:a.otherTextField,id:"otherStopReason",inputProps:{"aria-label":"Other"},value:$,onChange:b=>O(b.target.value),"aria-describedby":"otherStopReason"})]})]}),e.jsxs(E,{className:a.buttonBox,children:[e.jsx(ae,{className:a.submitButton,disableElevation:!0,disableRipple:!0,variant:"contained",type:"submit",disabled:se,children:"Turn off auto renew"}),e.jsx(ae,{className:a.cancelButton,disableElevation:!0,disableRipple:!0,variant:"outlined",onClick:x,children:"Cancel"})]})]})})]})})},Mo=de()({root:{display:"flex",textAlign:"center",flexDirection:"column",width:"325px",padding:"12px"},heading:{fontWeight:600,fontSize:"18px",paddingBottom:"8px"},body:{fontWeight:400,fontSize:"14px",paddingBottom:"8px"}
9,continueButton:{backgroundColor:H[100],color:"#FFF",marginBottom:"12px",textDecoration:"none"},cancelButton:{color:H[100],borderColor:H[100],textDecoration:"none"}}),Wo=t=>{const{t:a}=nt(),{open:n,handleClose:o,confirmTransfer:l}=t,{classes:c}=Mo();return e.jsx("div",{children:e.jsx(Ie,{onClose:o,"aria-labelledby":"customized-dialog-title",open:n,children:e.jsxs(E,{className:c.root,children:[e.jsx(E,{paddingTop:"8px",children:e.jsx(at,{color:"error",fontSize:"large"})}),e.jsx(E,{className:c.heading,children:a("Are you sure you want to transfer your subscription?")}),e.jsx(E,{className:c.body,children:a("In doing so, you are transferring all future subscription payments to your account.")}),e.jsx(ae,{className:c.continueButton,disableElevation:!0,disableRipple:!0,variant:"contained",onClick:l,children:a("Transfer my subscription")}),e.jsx(ae,{className:c.cancelButton,disableElevation:!0,disableRipple:!0,variant:"outlined",onClick:o,children:a("Cancel")})]})})})},Lo=de()({root:{display:"flex",textAlign:"center",flexDirection:"column",width:"325px",padding:"12px"},heading:{fontWeight:600,fontSize:"18px",paddingBottom:"8px"},body:{fontWeight:400,fontSize:"14px",paddingBottom:"8px"},continueButton:{backgroundColor:H[100],color:"#FFF",marginBottom:"12px",textDecoration:"none"},cancelButton:{color:H[100],borderColor:H[100],textDecoration:"none"}}),Ho=t=>{const{t:a,joinT:n}=wn(["billing","join"]),{open:o,handleClose:l,confirmCancel:c}=t,{classes:r}=Lo();return e.jsx("div",{children:e.jsx(Ie,{onClose:l,"aria-labelledby":"customized-dialog-title",open:o,children:e.jsxs(E,{className:r.root,children:[e.jsx(E,{paddingTop:"8px",children:e.jsx(at,{color:"error",fontSize:"large"})}),e.jsx(E,{className:r.heading,children:a("Are you sure you want to stop paying for your co-parent?")}),e.jsx(ae,{className:r.continueButton,disableElevation:!0,disableRipple:!0,variant:"contained",onClick:c,children:n("yes")}),e.jsx(ae,{className:r.cancelButton,disableElevation:!0,disableRipple:!0,variant:"outlined",onClick:l,children:a("Cancel")})]})})})},Uo=de()({root:{display:"flex",textAlign:"center",flexDirection:"column",width:"325px",padding:"12px"},heading:{fontWeight:600,fontSize:"18px",paddingBottom:"8px"},body:{fontWeight:400,fontSize:"14px",paddingBottom:"8px"},continueButton:{backgroundColor:H[100],color:"#FFF",marginBottom:"12px",textDecoration:"none"},cancelButton:{color:H[100],borderColor:H[100],textDecoration:"none"}}),Yo=t=>{const{open:a,handleClose:n,addPayment:o,isACH:l}=t,{t:c}=nt(),{classes:r}=Uo();return e.jsx("div",{children:e.jsx(Ie,{onClose:n,"aria-labelledby":"customized-dialog-title",open:a,children:e.jsxs(E,{className:r.root,children:[e.jsx(E,{paddingTop:"8px",children:e.jsx(at,{color:"error",fontSize:"large"})}),e.jsx(E,{className:r.heading,children:c(l?"ACH transfers (checking/savings) are no longer being supported for subscription payments. Please update your form of payment to continue":"You need to add a form of payment before performing that action. Would you like to add a new form of payment now?")}),e.jsxs(ae,{className:r.continueButton,disableElevation:!0,disableRipple:!0,variant:"contained",onClick:o,children:[c(l?"Update":"Add")," ",c("payment method")]}),e.jsx(ae,{className:r.cancelButton,disableElevation:!0,disableRipple:!0,variant:"outlined",onClick:n,children:c("Cancel")})]})})})},zo=de()({wrapper:{alignItems:"center",display:"flex",justifyContent:"center",padding:"1rem 0"},svg:{color:H[100]}}),En=()=>{const{classes:t}=zo();return e.jsx("div",{className:t.wrapper,children:e.jsx(Zr,{classes:{svg:t.svg}})})},Mr=de()({bodyText:{fontWeight:400,fontSize:"14px",paddingBottom:"16px"},buttonBox:{display:"flex",flexDirection:"column"},cancelButton:{color:H[100],borderColor:H[100],flex:2,fontFamily:"Open Sans",textDecoration:"none",textTransform:"capitalize"},cancelReasonRadioGroup:{padding:"15px 0","& label":{textAlign:"left",width:"100%"}},continueButton:{backgroundColor:H[100],color:"#FFF",fontFamily:"Open Sans",marginBottom:"12px",textDecoration:"none",textTransform:"capitalize"},feedbackForm:{textAlign:"left"},formLabel:{color:"#000 !important",fontWeight:600,fontSize:"18px",textAlign:"center"},heading:{fontWeight:600,fontSize:"18px",paddingBottom:"8px"},otherCancelReason:{display:"flex"},otherTextField:{marginBottom:"15px","&:after":{borderBottom:`2px solid ${H[100]}`}},radioChecked:{"&.Mui-checked":{color:H[100]}},radioRoot:{padding:"5px 9px"},requiredText:{color:"#5E5F61",display:"flex",fontSize:"0.75rem",justifyContent:"center",marginTop:"10px"},root:{display:"flex",flexDirection:"column",fontFamily:"Open Sans",textAlign:"center",width:"420px",padding:"1rem"},selectInput:{"&:after":{borderBottom:`2px solid ${H[100]}`}},stopReasonSelect:{margin:"15px 0"}
9,submitButton:{backgroundColor:H[100],color:"#FFF",marginBottom:"5px",textDecoration:"none",textTransform:"capitalize","&:disabled":{backgroundColor:"#D5D5D5"}},turnOffReasonLabel:{fontSize:"15px"}}),Vo=t=>{const{classes:a}=Mr();return e.jsx(Er,{disableRipple:!0,classes:{root:a.radioRoot,checked:a.radioChecked},...t})},rr={differentApp:"Preferred a different app for co-parenting needs",expensive:"Too expensive",wrongFeatures:"Didn't have the right features",other:"Other reason"},$o=t=>{const{classes:a}=Mr(),{email:n,open:o,onClose:l,turnOffAutoRenew:c,userId:r,payingForCoParent:i}=t,[u,m]=j.useState("CONFIRMATION"),[s,v]=j.useState(null),[S,I]=j.useState(""),P=X=>{X.target.value==="other"||X.target.value==="differentApp"||I(null),v(X.target.value)},Z=!s||s==="other"&&!(s!=null&&s.trim()),$=()=>{c(),Or({userId:r.toString(),email:n,cancelReason:s,cancelReasonFreeText:S}),O()},O=()=>{l(),g()},g=()=>{m("CONFIRMATION"),v(null),I(null)};return e.jsx(Ie,{onClose:O,open:o,children:e.jsxs(E,{className:a.root,children:[u==="CONFIRMATION"&&e.jsxs(e.Fragment,{children:[e.jsx(E,{paddingTop:"8px",children:e.jsx(at,{color:"error",fontSize:"large"})}),e.jsxs(E,{className:a.heading,children:["Are you sure you want to cancel the free trial ",i&&"for both you and your co-parent","?"]}),e.jsxs(E,{className:a.bodyText,children:["Once your trial expires, ",i&&"both you and your co-parent ","you will need to manually purchase a subscription to prevent interruption of service."]}),e.jsx(ae,{className:a.continueButton,disableElevation:!0,disableRipple:!0,variant:"contained",onClick:()=>m("FEEDBACK_FORM"),children:"Cancel My Free Trial"}),e.jsx(ae,{className:a.cancelButton,disableElevation:!0,disableRipple:!0,variant:"outlined",onClick:O,children:"Keep My Free Trial Active"})]}),u==="FEEDBACK_FORM"&&e.jsx(It,{onSubmit:$,initialValues:{cancelReason:s,cancelReasonFreeText:S},children:()=>e.jsxs(yn,{className:a.feedbackForm,children:[e.jsxs(He,{component:"fieldset",children:[e.jsx(jr,{classes:{root:a.formLabel},component:"legend",children:"Why are you cancelling the free trial?"}),e.jsx(Pr,{className:a.cancelReasonRadioGroup,"aria-label":"Cancel reason",name:"cancelReason",value:s,onChange:P,children:Object.keys(rr).map(X=>e.jsx(bn,{value:X,classes:{label:a.turnOffReasonLabel},control:e.jsx(Vo,{}),label:rr[X]},X))})]}),(s==="other"||s==="differentApp")&&e.jsxs(He,{className:a.otherCancelReason,children:[e.jsx(Et,{id:"otherCancelReason",children:s==="differentApp"?"Which co-parenting app?":"Tell us why you're cancelling the free trial"}),e.jsx(kt,{className:a.otherTextField,id:"otherCancelReason",inputProps:{"aria-label":"Other"},value:S,onChange:X=>I(X.target.value),"aria-describedby":"otherCancelReason"})]}),e.jsxs(E,{className:a.buttonBox,children:[e.jsx(ae,{className:a.submitButton,disableElevation:!0,disableRipple:!0,variant:"contained",type:"submit",disabled:Z,children:"Finish Cancelling"}),e.jsx(ae,{className:a.cancelButton,disableElevation:!0,disableRipple:!0,variant:"outlined",onClick:O,children:"Keep My Free Trial Active"})]})]})})]})})},Go=({open:t,handleClose:a,updateAddress:n})=>{const{t:o}=nt();return e.jsx(Cn,{open:t,onClose:a,title:o("Billing address needed"),icon:Pn,variant:jn.error,alignedButtonFullWidth:!0,buttonFullWidth:!1,primaryAction:{onClick:n,buttonText:o("Add")},secondaryAction:{onClick:a,buttonText:o("Cancel")}})},qo=({onClose:t,open:a,handleSetBillingViewState:n})=>{const{t:o}=nt();return e.jsx(Cn,{buttonFullWidth:!0,icon:Pn,isDismissible:!0,onClose:t,open:a,primaryAction:{buttonText:"Continue",onClick:()=>n()},secondaryAction:{buttonText:"Cancel",onClick:t},title:o("Please re-enter your payment information to proceed with updating your subscription preferences"),variant:jn.error})},Ko=()=>{const{t}=rt(),{setFieldValue:a,values:n}=Nt(),o=kr({country:n[ye.country]}),l=es(),[,c]=l,r=j.useRef(null),{country:i,city:u,postalCode:m,region:s,street:v}=Hs(r);Ke({field:ye.city,value:u,setFieldValue:a}),Ke({field:ye.country,value:i,setFieldValue:a}),Ke({field:ye.postalCode,value:m,setFieldValue:a}),Ke({field:ye.region,value:s,setFieldValue:a}),Ke({field:ye.streetAddress1,value:v,setFieldValue:a});const S=async P=>{P&&(a(ye.country,P),a(ye.region,""))},I=P=>["US","CA"].includes(P)?`_${P}`:"";return e.jsxs(e.Fragment,{children:[e.jsx(w,{item:!0,xs:12,children:e.jsx(on,{inputRef:r,field:ye.streetAddress1,required:!0})}),e.jsxs(w,{container:!0,spacing:2,children:[e.jsx(w,{item:!0,xs:6,children:e.jsx(on,{field:ye.city,required:!0})}
9),e.jsx(w,{item:!0,xs:6,children:!et(o)&&e.jsx(Kn,{customLabel:`region${I(n[ye.country])}`,field:ye.region,options:o,required:!0})})]}),e.jsxs(w,{container:!0,spacing:2,children:[e.jsx(w,{item:!0,xs:6,children:e.jsx(on,{field:ye.postalCode,required:!0})}),e.jsx(w,{item:!0,xs:6,children:!et(c)&&e.jsx(Kn,{field:ye.country,onChange:P=>S(P.target.value),options:c,placeholder:t("countryPlaceholder"),required:!0})})]})]})},Jo=({disableSaveBtn:t,onCancel:a})=>{const{t:n}=rt();return e.jsxs(w,{container:!0,spacing:2,children:[e.jsx(w,{item:!0,xs:6,children:e.jsx($n,{fullWidth:!0,variant:"outlined",onClick:a,children:n("cancelBtn")})}),e.jsx(w,{item:!0,xs:6,children:e.jsx($n,{type:"submit",fullWidth:!0,disabled:t,children:n("saveBtn")})})]})},Xo=({dismiss:t,Cta:a,currentAddress:n})=>{const{errors:o,isSubmitting:l,values:c,handleSubmit:r}=Nt(),i=kr({country:c.country}),u=i&&i.length>0,m=!c.line1||!c.city||!c.postalCode||!c.country||u&&!c.region,s=!pn(c,n),v=S=>{S.preventDefault(),S.stopPropagation(),r(S)};return e.jsxs(yn,{onSubmit:v,children:[e.jsx(Ko,{}),e.jsx(a,{onCancel:t,disableSaveBtn:l||!et(o)||m||!s})]})},Qo=({apiProps:t,currentAddress:a,dismiss:n,refetch:o,Cta:l=Jo})=>{const{showMessage:c}=Ua(),{t:r}=rt(),{mutateAsync:i}=Ka({init:{headers:{[ea.AUTH]:`Bearer ${t.apiToken}`}}}),u=async({values:m,setSubmitting:s})=>{if(pn(m,a))return s(!1);s(!0);const v={address:m,parent:{userId:t.userId},sections:["ADDRESS"]};i({data:v}).then(S=>{pn(S==null?void 0:S.address,m)?(c({message:r("updateAddressToastSuccess")}),o&&o(),n(),s(!1)):c({message:r("genericErrorMessage")})}).catch(S=>{Rt({apiError:S,handlers:{defaultErrorHandler:()=>{c({message:r("updateAddressToastFailure")}),s(!1)}}})})};return e.jsxs(e.Fragment,{children:[e.jsx(ta,{styles:{"*":{"&.pac-container":{zIndex:100001}}}}),e.jsx(It,{initialValues:{...Os,...a},validationSchema:_s,onSubmit:(m,{setSubmitting:s})=>u({values:m,setSubmitting:s}),children:e.jsx(Xo,{dismiss:n,Cta:l,currentAddress:a})})]})},Zo=({open:t,handleClose:a,address:n,refreshAddress:o})=>{const l=st(),{t:c}=wn("billing"),r=j.useMemo(()=>({city:n.city,country:n.country,line1:n.line1,line2:n.line2,postalCode:n.postalCode,region:n.state}),[n]);return e.jsx(Da,{open:t,onClose:a,headerProps:{title:c("Edit address")},children:e.jsx(ur,{padding:3,children:e.jsx(Qo,{apiProps:{userId:l.userId,apiToken:na("auth")},currentAddress:r,dismiss:a,refetch:o,Cta:ei})})})},ei=({disableSaveBtn:t,onCancel:a})=>{const{t:n}=wn("billing");return e.jsxs(ur,{direction:"row",spacing:2,children:[e.jsx(be,{fullWidth:!0,variant:"outlined",onClick:a,children:n("Cancel")}),e.jsx(be,{type:"submit",variant:"contained",fullWidth:!0,disabled:t,children:n("Save")})]})},ti=({billingDetails:t})=>t.feeWaiverRenewalEligible,Pt=()=>e.jsx(w,{item:!0,xs:12,children:e.jsx(ze,{})}),ni=t=>t.every(a=>a),Ee=({render:t,conditions:a})=>ni(a)?t:null,ri=Ne(zs,{shouldForwardProp:t=>t!=="showDisabled"})(({showDisabled:t})=>({root:{margin:"0px 0 0 0px"},switchBase:{padding:2},input:{left:0,width:"300% !important"},"& .MuiSwitch-track":{opacity:t?"0.12 !important":"unset"},"& .MuiSwitch-switchBase":{"&.Mui-checked":{color:t?"rgb(158, 216, 242) !important":"primary"}}})),ai=t=>e.jsx(ri,{...t}),si=ra` 100% { 11 box-shadow: 0 0 0 0px rgba(0, 0, 0, 0.2); 12 } 13100% { 14 box-shadow: 0 0 0 20px rgba(0, 0, 0, 0); 15 } 16`,oi=Ne(mn)(()=>({"&.pulse":{animation:`2s ${si} infinite`,"@media (prefers-reduced-motion)":{animation:"unset"}}})),Wr="alert-with-pulse",ii=()=>{const t=document.getElementById(Wr);t.classList.contains("pulse")||(t.classList.add("pulse"),setTimeout(()=>{t.classList.remove("pulse")},4e3))},ar=({message:t})=>e.jsx(oi,{severity:"warning",id:Wr,children:t}),ci={billingAndPayment:null,changePaymentFromReview:()=>{},submitPayment:()=>{},goBackToPackageStep:()=>{},renewalOrUpgrade:"renewal",displayNames:null,renewalDate:null,isPayingForCoParent:!1,paymentError:null,billingDetails:null,setBillingViewState:()=>{},refreshUserData:async()=>{},registrationInfo:null,subscriptionDetails:null},Lr=j.createContext(ci),Hr=()=>j.useContext(Lr),li=({children:t,value:a})=>e.jsx(Lr.Provider,{value:a,children:t}),ui=de()(t=>({root:{display:"flex",flexDirection:"column",fontFamily:"Open Sans",fontSize:"12px",fontWeight:400,paddingTop:"15px",margin:"auto",[t.breakpoints.up(350)]:{width:"85%"},[t.breakpoints.down(350)]:{width:"100%"}
16,"@media (max-width: 897px)":{maxWidth:"100%"}},container:{padding:"0",borderRadius:"4px",border:`1px solid ${t.neutral.scale300}`,width:"100%","@media (max-width: 600px)":{marginLeft:0}},overviewItem:{padding:"10px 0 10px 10px"},overviewItemLink:{padding:"10px 10px 0 0"},sectionHeader:{color:t.neutral.scale600,marginBottom:"4px"},sectionText:{color:t.palette.gray.dark},packageName:{fontWeight:600},link:{color:H[100],fontWeight:600,textTransform:"none",fontSize:"14px",padding:"0","&:hover":{color:H[100],backgroundColor:"#FFF"}},secondaryLink:{color:H[100],fontWeight:400,textTransform:"none",fontSize:"12px","&:hover":{color:H[100],backgroundColor:"#FFF"}},expired:{color:t.palette.error.light,display:"inline-flex",alignItems:"center"},formLabel:{color:t.neutral.scale600,fontWeight:400},paymentModuleContainer:{padding:10}})),di=({open:t,onClose:a})=>{const{t:n}=ue();return e.jsx(Cn,{buttonFullWidth:!0,icon:Pn,onClose:a,open:t,primaryAction:{onClick:()=>window.location.href=`${dr()}/ofw/myaccount/myprofile.form`,buttonText:n("updateEmail")},secondaryAction:{onClick:a,buttonText:n("Cancel")},subtext:n("autoRenewEmailNeededSubtext"),title:n(""),variant:jn.error})},pi=t=>{var gt,yt;const{js4756EditAddressInBilling:a}=tt(["js4756EditAddressInBilling"]),n=Ws({}),{availableCouponsHook:o,billingData:l,billingState:c,isUpdatePaymentMethod:r,setBillingData:i,IS_SPANISH_USER:u,refreshPaymentInfo:m}=ot(),s=c==="loaded"?l:null,v=Ue.useRef(null),S=s==null?void 0:s.autoRenew,{setQueryParam:I}=ts(),{setBillingViewState:P,registrationInfo:Z,subscriptionDetails:$}=Hr(),O=$,{paymentMethods:g,signupCoParentorAcceptOffer:X,addPaymentWithAutoRenew:se,viewTransactionDetails:D,availableUpgrades:x,isFreeTrial:C,removeCurrentPackageFromRenewals:b,isFreeTrialExpired:U,legacyAddonsAvailable:A,selectAddonUpgrade:ee,setPaymentError:F,packageLocale:te,renewalPackageName:ne,isActiveMobileSubscription:M,isMobileSubscription:k,isInAppleBillingRetry:Y}=t,{email:Q,firstName:ie,lastName:G,userId:N}=st(),[fe]=o,{classes:z}=ui(),{t:K}=ue(),{t:we}=Ot(),[ce,pe]=j.useState(!0),[re,p]=j.useState(null),[d,f]=j.useState(null);j.useEffect(()=>{async function xe(){pe(!0);const Le=await ls();p(Le),F(null),pe(!1)}xe()},[F]),j.useEffect(()=>{Dt(),Nr({subExpirationDate:O==null?void 0:O.expirationDate,email:Q,packageId:s==null?void 0:s.currentPackageId,userId:String(N),firstName:ie,lastName:G})},[O==null?void 0:O.expirationDate,Q,s==null?void 0:s.currentPackageId,N,ie,G]);const{dateFormattedShortMonth:y,isAfterNow:h}=Nn({dateString:O==null?void 0:O.expirationDate,stringFormat:"YYYY-MM-DD"}),{dateFormattedShortMonth:R,isAfterNow:q}=Nn({dateString:O==null?void 0:O.coparentExpirationDate,stringFormat:"YYYY-MM-DD"}),V=O!=null&&O.coparentExpirationDate?R:"Not signed up",W=j.useMemo(()=>Ye(s==null?void 0:s.currentPackageId),[s]),J=s==null?void 0:s.currentSubAdmin,_=j.useMemo(()=>J?"Admin subscription":we(W==null?void 0:W.displayName),[W,J,we]),oe=s==null?void 0:s.payingForCoParent,ve=`${ie} ${G}`,je=(s==null?void 0:s.autoRenewEligible)??!1,De=M||!je,me=async()=>{const xe=await bt({subscriptionId:s==null?void 0:s.currentSubscriptionId,fields:s!=null&&s.payingForCoParent?["autorenew","payfor"]:["autorenew"],autoRenew:!1,payingForCoParent:s!=null&&s.payingForCoParent?!1:null});i(xe),f(null)},Re=async()=>{const xe=await bt({subscriptionId:s==null?void 0:s.currentSubscriptionId,fields:["autorenew"],autoRenew:!0});i(xe),f(null)},$e=async xe=>{var wt,Oe;if(xe.preventDefault(),!je)return f("VALID_EMAIL_NEEDED");if(M){ii();return}if(!S&&r)return v.current="OVERVIEW",f("UPDATE_PAYMENT_METHOD");if(S&&(r||u)){me();return}const Le=lr();if(C&&S){const Te=await Qn(Le?Fr:xo,N,ve,Q,C,!1,s==null?void 0:s.renewalSubscriptionPrice,!0,!1,!1);if(Te.status==="saved"){const Ge=Gn.get(Te,"flowSession.offer_accepted.details"),Pe=await er(Ge,s.currentPackageId);await Un(N,Pe),setTimeout(()=>{X(s,!0)},2e3)}Te.status==="canceled"&&(Zn(Te.flowSession,N,Q),me());return}if(S&&(((wt=g==null?void 0:g.payment)==null?void 0:wt.type)==="Checking"||((Oe=g==null?void 0:g.payment)==null?void 0:Oe.type)==="Savings")){me();return}if(S){const vt=Le?Tr:ho,Te=[dn,hr].includes(s==null?void 0:s.currentPackageId),Ge=(s==null?void 0:s.currentPackageId)===dn,Pe=await Qn(vt,N,ve,Q,C,!1,s==null?void 0:s.renewalSubscriptionPrice,Te&&!(s!=null&&s.payingForCoParent),s==null?void 0:s.coParentHasCurrentSub,Ge);if(Co({userId:N,email:Q,packageId:s.currentPackageId,flowSession:Pe.flowSession,appliedCoupon:(fe==null?void 0:fe.length)>0?fe[0].description:null,entranceType:"Turn off auto renew"}),Pe.status==="saved"){const $t=Gn.get(Pe,"flowSession.offer_accepted.details"),Gt=await er($t,s.currentPackageId);await Un(N,Gt),setTimeout(()=>{X(s,!0)},2e3)}Pe.status==="canceled"&&(Zn(Pe.flowSession,N,Q),me());return}if(!S&&(!(g!=null&&g.payment)||(g==null?void 0:g.payment.type)==="Checking"||(g==null?void 0:g.payment.type)==="Savings")){f("PAYMENT_NEEDED");return}if(!S&&h&&(g!=null&&g.payment)){f("ON");return}},Wt=async()=>{const xe=await bt({subscriptionId:s==null?void 0:s.currentSubscriptionId,fields:["paidby"],paidByCoParent:!1});i(xe),f(null)},Be=async()=>{const xe=await bt({subscriptionId:s==null?void 0:s.currentSubscriptionId,fields:["payfor"],payingForCoParent:!1});i(xe),f(null)},Me=()=>{window.location.href=`${dr()}
16/ofw/myaccount/myprofile.form`},Lt=()=>{if(Fe||mt)return f("PAYMENT_NEEDED");if(r)return v.current="OVERVIEW",f("UPDATE_PAYMENT_METHOD");X(s)},pt=ti({billingDetails:s});if(ce)return e.jsx(En,{});const Se=C&&!U,Ht=h&&!Se&&(s==null?void 0:s.coParentPayingForYou),le=y===null||!h&&!S&&!Se,Fe=((gt=g==null?void 0:g.payment)==null?void 0:gt.type)==="Checking"||((yt=g==null?void 0:g.payment)==null?void 0:yt.type)==="Savings",mt=!(g!=null&&g.payment),Ut=(V==="Not signed up"||!q)&&!C&&!J,ft=te==="en_GB"?"£":"$",Ae=xe=>{if(jo(g==null?void 0:g.address)){f("ADDRESS_NEEDED");return}else xe()},Yt=()=>x!=null&&x.length?P(T.UPGRADES):A?ee("upgrade"):void 0,zt=()=>{f(mt?"PAYMENT_NEEDED":"TRANSFER")},he=()=>{Fe?f("PAYMENT_NEEDED"):P(T.RENEWALS)},We=()=>{Fe?f("PAYMENT_NEEDED"):P(T.RENEWALS)},ht=()=>{if(Fe)return f("PAYMENT_NEEDED");if(r)return v.current="RENEWALS",f("UPDATE_PAYMENT_METHOD");b(s==null?void 0:s.currentPackageId)},xt=()=>{if(!a)return Me();f("EDIT_ADDRESS")},Vt=()=>(n.mutate(),m());return e.jsxs("div",{className:z.root,children:[e.jsxs(w,{className:z.container,container:!0,children:[e.jsxs(Je,{children:[e.jsx(jt,{children:e.jsx(Ao,{currentSub:O,isFreeTrial:C,isSubActive:h,packageName:C?`${s==null?void 0:s.currentPackageName} free trial`:_,subPrice:s!=null&&s.currentCouponAmount?`${ft}${yr((s==null?void 0:s.currentSubscriptionPrice)-s.currentCouponAmount)}`:s==null?void 0:s.currentSubscriptionPriceFormatted,headerClass:z.sectionHeader,sectionClass:z.sectionText})}),e.jsx(Xe,{children:e.jsx(Ee,{conditions:[(x==null?void 0:x.length)>0||A,!C,!M,!Y,!(s!=null&&s.hasPartialPayment)],render:e.jsx(be,{onClick:()=>Ae(Yt),size:"medium",disableRipple:!0,children:K("Upgrade")})})})]}),e.jsx(Pt,{}),e.jsxs(Je,{children:[e.jsxs(jt,{children:[e.jsx(E,{className:z.sectionHeader,children:C?"Free Trial Expiration Date":K("Subscription Renewal Date")}),e.jsx(E,{className:z.sectionText,children:(()=>{switch(!0){case y===null:return`${K("No Active Sub")}`;case pt:return e.jsx(E,{marginTop:"8px",children:K("No active subscription")});case!h:return e.jsxs(E,{className:z.expired,children:[e.jsx(Bs,{fontSize:"small"})," ",K("Expired")]});default:return`${y} ${C&&(s!=null&&s.coParentPayingForYou)?`(To be paid for by your co-parent on ${y}) `:""}`}})()})]}),e.jsx(Xe,{children:(()=>{switch(!0){case M:return null;case Y:return null;case Ht:return e.jsx(Ms,{title:K("Your co-parent is currently paying for your subscription. To pay for your own subscription at your upcoming renewal, click âTransfer Subscriptionâ."),children:e.jsx(be,{size:"medium",disableRipple:!0,onClick:()=>Ae(zt),children:K("Transfer Subscription")})});case pt:return e.jsxs(E,{display:"flex",flexDirection:"column",alignItems:"end",children:[e.jsx(be,{size:"medium",disableRipple:!0,onClick:()=>Ae(We),children:K("Purchase")}),e.jsx(gn,{variant:"labelXxsRegular",paddingRight:"12px",marginTop:"8px",children:e.jsx(fr,{i18nKey:"feewaiverReapplyButton",components:{button:e.jsx(ln,{embedded:!0,size:"small",href:aa(sa.AUTHENTICATED_FEEWAIVER)})}})})]});case le:return e.jsx(be,{size:"medium",disableRipple:!0,onClick:()=>Ae(he),children:K("Purchase")});case!h:return e.jsx(be,{size:"medium",disableRipple:!0,onClick:()=>Ae(We),children:K("Renew")});case!Se:return e.jsx(be,{size:"medium",disableRipple:!0,onClick:()=>Ae(ht),children:K("Change")});default:return e.jsx(e.Fragment,{})}})()})]}),y!==null&&e.jsxs(w,{className:z.overviewItem,item:!0,xs:12,children:[e.jsx(E,{className:z.sectionHeader,children:K("Co-parent's Subscription Renewal Date")}),e.jsxs(E,{className:z.sectionText,children:[Ut&&!M?e.jsxs(E,{display:"flex",alignItems:"center",children:[V==="Not signed up"?K("Not signed up"):V,s!=null&&s.hasPartialPayment?null:e.jsx(ae,{className:z.secondaryLink,size:"small",disableRipple:!0,onClick:Lt,children:K("Pay for co-parent")})]}):V,(s==null?void 0:s.payingForCoParent)&&e.jsxs(e.Fragment,{children:["(",C?`To be paid by you on ${V}`:K("Paid by you"),")",!C&&e.jsx(ae,{className:z.secondaryLink,size:"small",disableRipple:!0,onClick:()=>f("COPARENT"),children:K("Stop paying for Co-parent")})]})]})]}
16),e.jsx(Ee,{conditions:[h,!(s!=null&&s.renewalSubAdmin),!["expired","none"].includes(Z==null?void 0:Z.subscriptionStatus)],render:e.jsxs(e.Fragment,{children:[e.jsx(Pt,{}),e.jsxs(Je,{children:[e.jsx(jt,{children:e.jsx(Oo,{isAutoRenew:S,isPaidByCo:s==null?void 0:s.coParentPayingForYou,isSubActive:h,renewalPrice:s!=null&&s.payingForCoParent?`${te==="en_GB"?"£":"$"}${(s==null?void 0:s.renewalSubscriptionPrice)*2}.00`:s==null?void 0:s.renewalSubscriptionPriceFormatted,renewalPlan:ne,renewalDate:y,headerClass:z.sectionHeader,sectionClass:z.sectionText,renewalCouponAmountFormatted:s==null?void 0:s.renewalCouponAmountFormatted})}),e.jsx(Ee,{conditions:[!(s!=null&&s.coParentPayingForYou),!(s!=null&&s.hasPartialPayment)],render:e.jsx(Xe,{children:e.jsx(bn,{className:z.formLabel,label:C?S?"ON":"OFF":null,control:e.jsx(ai,{name:"autoRenew",size:"small",checked:S,showDisabled:De,onChange:$e}),labelPlacement:"top"})})})]})]})}),e.jsx(Ee,{conditions:[!M],render:e.jsxs(e.Fragment,{children:[e.jsx(Pt,{}),e.jsx(w,{className:z.paymentModuleContainer,item:!0,xs:12,children:e.jsx(Ft,{children:e.jsx(Sn,{displayMode:"DISPLAY_STORED_METHOD"})})})]})}),e.jsx(Pt,{}),e.jsxs(Je,{children:[e.jsx(jt,{children:e.jsx(Ir,{name:g==null?void 0:g.name,address:g==null?void 0:g.address,headerClass:z.sectionHeader,sectionClass:z.sectionText})}),e.jsx(Xe,{children:e.jsx(be,{size:"medium",disableRipple:!0,onClick:xt,children:K("Change")})})]})]}),e.jsx(Ee,{conditions:[!C,!k],render:e.jsx(w,{className:z.container,container:!0,alignItems:"center",style:{padding:"10px",marginTop:"15px"},children:e.jsx(_o,{history:re,getDetails:D,headerClass:z.sectionHeader,linkClass:z.link})})}),e.jsx(Io,{renewDate:y,subPrice:s==null?void 0:s.renewalSubscriptionPriceFormatted,handleClose:()=>f(null),open:d==="ON",updateAutoRenew:Re}),e.jsx(Bo,{turnOffAutoRenew:me,open:d==="TURN_OFF",onClose:()=>f(null),isPayingForCoparent:oe,email:Q,userId:N}),e.jsx($o,{turnOffAutoRenew:me,open:d==="CANCEL_FREE_TRIAL",onClose:()=>f(null),email:Q,userId:N,payingForCoParent:s==null?void 0:s.payingForCoParent}),e.jsx(Wo,{confirmTransfer:Wt,open:d==="TRANSFER",handleClose:()=>f(null)}),e.jsx(Ho,{confirmCancel:Be,open:d==="COPARENT",handleClose:()=>f(null)}),e.jsx(Yo,{isACH:Fe,addPayment:se,open:d==="PAYMENT_NEEDED",handleClose:()=>f(null)}),e.jsx(Go,{open:d==="ADDRESS_NEEDED",handleClose:()=>f(null),updateAddress:xt}),e.jsx(Zo,{open:d==="EDIT_ADDRESS",handleClose:()=>f(null),address:g==null?void 0:g.address,refreshAddress:Vt}),e.jsx(qo,{onClose:()=>{f(null),v.current=null},open:d==="UPDATE_PAYMENT_METHOD",handleSetBillingViewState:()=>{I("redirectTo",v.current),P(T.PAYMENT)}}),e.jsx(di,{onClose:()=>f(null),open:d==="VALID_EMAIL_NEEDED"})]})},mi=de()({headerClass:{color:"#5E5F61"},textClass:{color:"#37373A"},boldText:{color:"#37373A",fontWeight:700,fontSize:"16px"},promotionalClass:{fontSize:"14px",color:"#878787"}}),fi=({flow:t,displayNames:a,pack:n,pricing:o,renewalPrice:l})=>{var m;const{t:c}=ue(),{t:r}=Ot(),{classes:i}=mi(),u=us(n==null?void 0:n.id);return o?e.jsxs(e.Fragment,{children:[e.jsx(w,{item:!0,xs:12,children:e.jsx(E,{className:i.headerClass,children:c("Order Summary")})}),e.jsxs(w,{item:!0,sm:10,xs:9,children:[e.jsx(E,{children:c(`orderSummaryPackageLine_${t}`,{package:r(n==null?void 0:n.displayName)})}),t!=="payForCoparent"&&e.jsx(E,{className:i.textClass,children:c(`billingFrequency_${(n==null?void 0:n.subDurationInYears)||1}`,{amount:l})}),(a==null?void 0:a.length)>0&&e.jsx(E,{className:i.textClass,children:a.toString()})]}),e.jsx(w,{item:!0,sm:2,xs:3,children:(m=o==null?void 0:o.totals)==null?void 0:m.selectedPackageTotalFormatted}),!!o&&(o==null?void 0:o.couponDetail)!==null&&e.jsxs(e.Fragment,{children:[e.jsx(w,{item:!0,sm:10,xs:9,children:e.jsx(E,{className:i.promotionalClass,children:c("Promotional Discount")})}),e.jsxs(w,{className:i.promotionalClass,item:!0,sm:2,xs:3,children:["-",o==null?void 0:o.couponDetail.discountFormatted]})]}),u?null:!!o&&e.jsxs(e.Fragment,{children:[e.jsx(w,{item:!0,sm:10,xs:9,children:c("Tax")}),e.jsx(w,{item:!0,sm:2,xs:3,children:(o==null?void 0:o.totals.taxAmountFormatted)===null?br({pack:n,price:0}):o==null?void 0:o.totals.taxAmountFormatted})]}),e.jsx(w,{item:!0,xs:12,children:e.jsx(ze,{})}),e.jsx(w,{className:i.boldText,item:!0,sm:10,xs:9,children:c("Total")}),e.jsx(w,{className:i.boldText,item:!0,sm:2,xs:3,children:o==null?void 0:o.totals.totalFormatted}),!!o&&(o==null?void 0:o.couponDetail)!==null&&e.jsxs(e.Fragment,{children:[e.jsx(w,{item:!0,xs:12,children:e.jsx(ze,{})}),e.jsx(w,{item:!0,xs:10,children:e.jsx(E,{className:i.promotionalClass,children:c("Annual bill after 12 month promotional period")})}),e.jsx(w,{className:i.promotionalClass,item:!0,xs:2,children:l})]})]}):e.jsx(hn,{})},hi=({isPayingForCoParent:t,renewalOrUpgrade:a,subscriptionStatus:n})=>t?"coparent":a==="upgrade"||n==="expired"||n==="none"?"immediate":"scheduled",xi=({order:t,renewalOrUpgrade:a})=>({upgrade:a==="upgrade",order:t,payment:{pricingLocale:void 0}}),gi=()=>{var p;const{billingAndPayment:t,billingDetails:a,displayNames:n,goBackToPackageStep:o,isPayingForCoParent:l,refreshUserData:c,registrationInfo:r,renewalDate:i,renewalOrUpgrade:u,setBillingViewState:m,subscriptionDetail
16s:s}=Hr(),S=tt("grow1242BraintreeErrorV2")?rs:as,{t:I}=ue(),{isSpanish:P}=pr(),{email:Z,userId:$}=st(),{authToken:O}=xr(),{handleThreeDSecureMismatch:g,setPaymentInfo:X,resetPaymentModule:se}=wr(),{isPayloadComputed:D,orderPayload:x,selectedPackageHook:C}=Ve(),[b]=C,U=r==null?void 0:r.subscriptionStatus,{mutateAsync:A,isPending:ee}=ns({init:{uParams:{userId:$},...sn({auth:O})},mutationOptions:{onError:d=>{Rt({apiError:d,handlers:{threeDSecureMismatchHandler:g,defaultErrorHandler:()=>{X({paymentErrorMessage:String(d.message),isSubmitting:!1})}}})},onSuccess:()=>{m(T.OVERVIEW),c()}}}),{mutateAsync:F,isPending:te}=S({init:{uParams:{userId:$},...sn({auth:O})},mutationOptions:{onError:d=>{Rt({apiError:d,handlers:{threeDSecureMismatchHandler:g,defaultErrorHandler:()=>{X({paymentErrorMessage:String(d.message),isSubmitting:!1})}}})},onSuccess:()=>{m(T.OVERVIEW),c()}}}),{mutateAsync:ne,isPending:M}=Ja({init:{uParams:{userId:$},...sn({auth:O})},mutationOptions:{onError:d=>{Rt({apiError:d,handlers:{threeDSecureMismatchHandler:g,defaultErrorHandler:()=>{X({paymentErrorMessage:String(d.message),isSubmitting:!1})}}})},onSuccess:()=>{m(T.OVERVIEW),c()}}}),[k]=j.useState(""),[Y,Q]=fn(null),[ie,G]=fn(!1),{classes:N}=Fo(),fe=j.useMemo(()=>{var f,y;return((f=Y==null?void 0:Y.totals)==null?void 0:f.selectedPackageTotal)>((y=Y==null?void 0:Y.totals)==null?void 0:y.subTotalAfterDiscount)?"couponRenewal":l?"payForCoparent":u},[l,Y,u]);if(j.useEffect(()=>{Dt()},[]),j.useEffect(()=>{So(Z,$)},[Z,$]),j.useEffect(()=>{var h;if(G(!0),!(x!=null&&x.packageId)||!D||so({currentFlow:u,orderPayload:x})==="package_upgrade"&&(x==null?void 0:x.packageId)===(a==null?void 0:a.currentPackageId))return;const f={userId:$,address:{...t.address,region:(h=t.address)==null?void 0:h.state},orderDetail:x,payForCoparent:!1,paymentCodes:[k]};async function y(){return u==="upgrade"?ds(f).then(R=>{Qe(R)?console.error(R):Q(R)}):ps(f).then(R=>{Qe(R)?console.error(R):Q(R)}),G(!1)}y()},[x,D,u,b,Q,t,k,G,$,a==null?void 0:a.currentPackageId]),ie)return e.jsx(En,{});const z=()=>{se(),o()},K=u==="renewal"&&i&&U==="current"&&!l?`${I("Pay when subscription ends")} (${i})`:`${I("Place Your Order")}`,we=Ze(b)?a==null?void 0:a.renewalSubscriptionPriceFormatted:br({pack:b,hideDecimalIfRound:!0}),ce={dueToday:Y==null?void 0:Y.totals.totalFormatted,afterToday:u==="upgrade"?we:(p=Y==null?void 0:Y.totals)==null?void 0:p.selectedPackageTotalFormatted},pe=d=>{switch(hi({isPayingForCoParent:l,renewalOrUpgrade:u,subscriptionStatus:r==null?void 0:r.subscriptionStatus})){case"coparent":return A({data:d});case"immediate":return F({data:d});case"scheduled":return ne({data:d})}},re=()=>{const d=new Date().toISOString();if(u==="renewal")return{paymentType:"RENEWAL",recurringPaymentStartDate:In(s==null?void 0:s.expirationDate)||d};if(u==="upgrade")return{paymentType:"UPGRADE",recurringPaymentStartDate:In(s==null?void 0:s.expirationDate)||d,recurringAmount:yr(Ze(b)?a==null?void 0:a.renewalSubscriptionPrice:b==null?void 0:b.totalPrice)}};return e.jsxs("div",{className:N.root,children:[e.jsxs(w,{container:!0,className:N.topContainer,children:[e.jsx(w,{item:!0,xs:12,children:e.jsxs(E,{className:N.backButtonContainer,children:[e.jsx(lo,{onClick:()=>z()}),e.jsx(ae,{disableRipple:!0,onClick:()=>z(),className:N.backButton,children:I("Back")})]})}),e.jsx(w,{item:!0,xs:12,children:e.jsx(E,{fontSize:"16px",fontWeight:600,children:I("Review Subscription Changes")}
16)})]}),e.jsxs(w,{container:!0,spacing:1,className:N.container,children:[e.jsx(w,{item:!0,xs:10,children:e.jsx(Ir,{name:t&&t.name,address:t&&t.address,headerClass:N.heading,sectionClass:N.text})}),e.jsx(w,{item:!0,xs:12,children:e.jsx(ze,{})}),e.jsx(w,{item:!0,xs:12,children:e.jsx(Ft,{children:e.jsx(Sn,{pricing:Y})})})]}),e.jsx(w,{container:!0,spacing:1,className:N.container,children:e.jsx(fi,{displayNames:n,renewalOrUpgrade:u,pack:b,pricing:Y,renewalPrice:ce.afterToday,flow:fe})}),e.jsxs(w,{className:N.bottomContainer,container:!0,spacing:1,children:[e.jsx(ss,{actionText:K,conditionalPaymentPayloadOverrides:l?{applepay:{payment:{storePaymentOnFile:!1}}}:null,isDisabled:ie||Y===null,isSubmitting:ee||te||M,paymentPayloadOverrides:xi({order:x,renewalOrUpgrade:u}),pricingData:Y,submitPayment:pe,...re()}),e.jsx(w,{item:!0,xs:12,children:e.jsxs(E,{fontSize:"10px",children:[I(`disclaimer_${fe}`,{todayAmount:ce==null?void 0:ce.dueToday,buttonText:K,frequency:I(`frequency_${(b==null?void 0:b.subDurationInYears)||1}`),planAmount:ce==null?void 0:ce.afterToday}),"Â ",e.jsxs(fr,{t:I,i18nKey:"disclaimer_legal",children:[e.jsx(At,{href:_t("termsAndConditions",P).href,target:"_blank",rel:"noreferrer"}),e.jsx(At,{href:_t("privacyPolicy",P).href,target:"_blank",rel:"noreferrer"}),{buttonText:K}]})]})})]})]})},Mt=()=>e.jsx("svg",{width:"8",height:"15",viewBox:"0 0 8 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M6.75709 0.60937C6.59722 0.614133 6.44548 0.680951 6.33402 0.795668L0.18017 6.94951C-0.0600566 7.18984 -0.0600566 7.57938 0.18017 7.81971L6.33402 13.9736C6.48837 14.1343 6.71757 14.1991 6.93322 14.1429C7.14888 14.0866 7.31729 13.9182 7.37351 13.7026C7.42973 13.4869 7.36497 13.2577 7.20421 13.1034L1.48546 7.38461L7.20421 1.66586C7.38621 1.48894 7.44094 1.21843 7.34201 0.984683C7.24309 0.75093
161 7.01081 0.601887 6.75709 0.60937Z",fill:H[100]})}),yi=de()({link:{padding:0,minWidth:0,color:H[100],fontWeight:600,textTransform:"none",fontSize:"12px","&:hover":{color:H[100],backgroundColor:"#FFF"}},backArrow:{paddingLeft:"16px"}});function wi({setBillingViewState:t,pack:a}){const{alacarteValuesHook:n}=Ve(),[o,l]=n,{t:c}=ue(),{classes:r}=yi(),{classes:i}=ys(),u=tt("grow1029CyoMigration");j.useEffect(()=>{Dt()},[]),j.useEffect(()=>{l(vn)},[l]);const m=s=>{l(s),t(T.REVIEW)};return e.jsxs("div",{className:i.wrapper,children:[e.jsxs(w,{className:r.backArrow,container:!0,direction:"row",justifyContent:"flex-start",alignItems:"center",children:[e.jsx(Mt,{}),e.jsx(ae,{className:r.link,size:"small",disableRipple:!0,onClick:()=>t(T.RENEWALS),children:c("Back")})]}),u?e.jsx(ws,{alacarteValues:o,handleFormSubmit:m,linkToUpgradePackage:e.jsx(ln,{onClick:()=>t(T.RENEWALS),embedded:!0}),pack:a}):e.jsx(vs,{alacarteValues:o,handleFormSubmit:m,linkToUpgradePackage:e.jsx(ln,{onClick:()=>t(T.RENEWALS),embedded:!0}),pack:a})]})}const vi=t=>{const{t:a}=ue(),{paymentDetails:n,subHeader:o}=t,{IS_UK_USER:l}=ot(),c=l;return e.jsxs(e.Fragment,{children:[e.jsx(w,{item:!0,xs:12,className:o,children:a("Payment Details")}),e.jsxs(w,{item:!0,xs:6,children:[e.jsxs("strong",{children:[a("Transaction ID"),": "]}),n.transactionId]}),e.jsxs(w,{item:!0,xs:6,children:[e.jsxs("strong",{children:[a("Subtotal"),": "]}),n.subTotalFormatted]}),e.jsxs(w,{item:!0,xs:6,children:[e.jsxs("strong",{children:[a("Payment Method"),": "]}),n.paymentMethod]}),e.jsxs(w,{item:!0,xs:6,children:[e.jsxs("strong",{children:[a("Tax"),": "]}),n.taxFormatted]}),(n==null?void 0:n.couponDetail)&&e.jsxs(w,{item:!0,xs:6,children:[e.jsxs("strong",{children:[a("Discount"),":"]})," (",n==null?void 0:n.couponDetail.discountFormatted,")"]}),e.jsxs(w,{item:!0,xs:12,children:[e.jsxs("strong",{children:[a("Total"),": "]}),n.totalFormatted," ",c&&`(includes VAT of ${n.taxFormatted})`]})]})},sr=t=>{const{t:a}=ue(),{subDetails:n}=t;return e.jsxs(e.Fragment,{children:[e.jsxs(w,{item:!0,xs:12,children:[n!=null&&n.coparent?a("Co-Parent Subscription"):a("Subscription")," ",a("Details")]}),e.jsxs(w,{item:!0,xs:12,children:[e.jsxs("strong",{children:[a("Begin Date"),": "]}),n==null?void 0:n.beginDate.displayDate]}),e.jsxs(w,{item:!0,xs:12,children:[e.jsxs("strong",{children:[a("End Date"),": "]}),n!=null&&n.endDate?n.endDate.displayDate:"Current Subscription"]}),e.jsxs(w,{item:!0,xs:12,children:[e.jsxs("strong",{children:[a("Name"),": "]}),n==null?void 0:n.user.name]}),e.jsx(w,{item:!0,xs:12,children:e.jsxs("strong",{children:[a("Included features"),": "]})}),e.jsx(w,{item:!0,xs:12,children:n==null?void 0:n.subscriptionDescription}),e.jsx(w,{item:!0,xs:12,children:n==null?void 0:n.myfilesDescription}),(n==null?void 0:n.callsDescription)!==""?e.jsx(w,{item:!0,xs:12,children:n==null?void 0:n.callsDescription}):null,(n==null?void 0:n.tonemeterDescription)!==""?e.jsx(w,{item:!0,xs:12,children:n==null?void 0:n.tonemeterDescription}):null,(n==null?void 0:n.expenseDescription)!==""?e.jsx(w,{item:!0,xs:12,children:n==null?void 0:n.expenseDescription}):null,(n==null?void 0:n.affidavitsDescription)!==""?e.jsx(w,{item:!0,xs:12,children:n==null?void 0:n.affidavitsDescription}):null]})},Si=de()({root:{maxWidth:"500px",display:"flex",flexDirection:"column",fontFamily:"Open Sans",fontSize:"12px",fontWeight:400,"@media (max-width: 600px)":{padding:"10px"}},container:{padding:"8px",margin:"16px 8px 8px 24px","@media (max-width: 600px)":{padding:0,margin:0}},title:{fontWeight:600,fontSize:"16px",textAlign:"center",paddingBottom:"20px"},subHeader:{fontWeight:500,padding:"12px 0",fontSize:"14px"},link:{minWidth:0,color:H[100],fontWeight:600,textTransform:"none",fontSize:"12px","&:hover":{color:H[100],backgroundColor:"#FFF"}},linkWrapper:{marginLeft:"16px",paddingTop:"4px","@media (max-width: 600px)":{margin:0}}}),bi=t=>{var r;const{t:a}=ue(),{transaction:n,setBillingViewState:o}=t,{classes:l}=Si(),c=(n==null?void 0:n.orderDetails.length)===1&&(n==null?void 0:n.orderDetails[0].coparent);return e.jsxs("div",{className:l.root,children:[e.jsxs(w,{className:l.linkWrapper,container:!0,direction:"row",justifyContent:"flex-start",alignItems:"center",children:[e.jsx(Mt,{}),e.jsx(ae,{size:"small",className:l.link,disableRipple:!0,onClick:()=>o(T.OVERVIEW),children:a("Back")})]}),e.jsxs(w,{container:!0,className:l.container,children:[e.jsx(w,{item:!0,xs:12,className:l.title,children:n==null?void 0:n.status}),e.jsxs(w,{item:!0,xs:12,children:[e.jsxs("strong",{children:[a("Purchased by"),": "]}),n==null?void 0:n.purchaseUser.name]}),e.jsxs(w,{item:!0,xs:12,children:[e.jsxs("strong",{children:[a("Purchase date"),": "]}),n==null?void 0:n.purchaseDateTime.threeCharMonthTime]}),e.jsx(w,{item:!0,xs:12,children:e.jsx(ze,{})}),e.jsx(vi,{paymentDetails:n==null?void 0:n.paymentDetails[0],subHeader:l.subHeader}),e.jsx(w,{item:!0,xs:12,children:e.jsx(ze,{})}),e.jsx(w,{item:!0,xs:12,className:l.subHeader,children:a("Order Details")}),!c&&e.jsx(w,{container:!0,item:!0,xs:6,children:e.jsx(sr,{subDetails:n==null?void 0:n.orderDetails.find(i=>!i.coparent)})}),(((r=n==null?void 0:n.orderDetails)==null?void 0:r.length)>1||c)&&e.jsx(w,{container:!0,item:!0,xs:6,children:e.jsx(sr,{subDetails:n==null?void 0:n.orderDetails.find(i=>i.coparent)})})]})]})},Ci=de()(t=>({root:{display:"flex",textAlign:"center",flexDirection:"column",width:"325px",padding:"12px"},heading:{fontWeight:600,fontSize:"18px",paddingBottom:"8px"},body:{fontWeight:400,fontSize:"14px",paddingBottom:"8px"},continueButton:{backgroundColor:t.palette.ofwBlue.main,color:t.palette.white.main,marginBottom:"12px"},cancelButton:{color:t.palette.ofwBlue.main,borderColor:t.palette.ofwBlue.main}})),ji=t=>{const{open:a,handleClose:n}=t,{t:o}=nt(),{classes:l}=Ci();return e.jsx("div",{children:e.jsx(Ie,{onClose:n,"aria-labelledby":"
16customized-dialog-title",open:a,children:e.jsxs(E,{className:l.root,children:[e.jsx(E,{paddingTop:"8px",children:e.jsx(co,{color:"success",fontSize:"large"})}),e.jsx(E,{className:l.heading,children:o("Payment method updated!")}),e.jsx(E,{className:l.body,children:o("To support saving your payment method, you will see a £1 pre-authorisation in your bank account temporarily. You will not be charged for this pre-authorisation. You should see it drop from your account within X-Y business days.")}),e.jsx(ae,{className:l.continueButton,disableElevation:!0,disableRipple:!0,variant:"contained",onClick:n,children:"Continue"})]})})})},Pi="We are making improvements to our 3D secure implementation. Please re-enter your payment method to avoid interruptions in your auto renew subscription",Ei=t=>{const{handleRedirect:a}=t;return e.jsx(Vs,{message:Pi,variant:$s.info,hasIcon:!0,link:{text:"Click here",onClick:a}})},or=Ne("div")(({theme:t})=>({display:"flex",marginBottom:"20px",alignItems:"stretch",flexWrap:"wrap",justifyContent:"start","& > div":{margin:"0 5px 20px"}})),ki=({isBillingPage:t=!1,isMobile:a=!1,isTwoYear:n,setIsTwoYear:o})=>{const{t:l}=ue(),{classes:c}=To({isMobile:a,isBillingPage:t});return e.jsx("div",{className:c.toggle,children:["1year","2year"].map(r=>{const i=r==="2year"&&n||r==="1year"&&!n,u=l(r==="1year"?"1 Year":"2 Year");return e.jsxs("div",{className:i?c.selectedToggleOption:c.toggleOption,onClick:()=>o(r!=="1year"),children:[e.jsx("label",{htmlFor:r,children:u}),e.jsx("input",{id:r,type:"radio",checked:r==="1year"?!n:n,onChange:m=>o(r==="1year"?!m.target.checked:m.target.checked)})]},r)})})},Ri=de()(t=>({linkWrapper:{paddingBottom:"4px",flexDirection:"row",display:"flex"},link:{minWidth:0,color:`${t.palette.primary.main}`,fontWeight:600,textTransform:"none",fontSize:"12px",paddingLeft:"4px","&:hover":{color:`${t.palette.primary.main}`,backgroundColor:`${t.palette.white.main}`}},gridLayout:{display:"flex",marginBottom:"12px"},wrapper:{margin:"0px 16px 0px",display:"flex",flexDirection:"column","&:@media (max-width: 991px)":{margin:"10px, 0px, 0px, 0px"}}})),ir=t=>{const{t:a}=ue(),{email:n,userId:o}
16=st(),{availableCouponsHook:l}=ot(),{packageExperiments:c}=Ve(),r=vr(c),{setBillingViewState:i,selectPackage:u,setIsTwoYear:m,isTwoYear:s,renewalOrUpgrade:v,isAvailableAddons:S,selectAddonUpgrade:I,packages:P}=t,[Z]=l,$=P==null?void 0:P.filter(D=>(D==null?void 0:D.subDurationInYears)===null||(D==null?void 0:D.subDurationInYears)===1),O=P==null?void 0:P.filter(D=>(D==null?void 0:D.subDurationInYears)===null||(D==null?void 0:D.subDurationInYears)===2),g=(O==null?void 0:O.length)>0,X={1:zn($)||[],2:zn(O)||[]},{classes:se}=Ri();return j.useEffect(()=>{Dt()},[]),j.useEffect(()=>{wo(v,n,o)},[v,n,o]),e.jsxs(e.Fragment,{children:[e.jsxs(E,{className:se.wrapper,children:[e.jsxs(w,{className:se.linkWrapper,container:!0,direction:"row",justifyContent:"flex-start",alignItems:"center",children:[e.jsx(Mt,{}),e.jsx(ae,{className:se.link,size:"small",disableRipple:!0,onClick:()=>i(T.OVERVIEW),children:a("Back")})]}),v==="renewal"&&e.jsxs(e.Fragment,{children:[e.jsxs(w,{className:se.gridLayout,id:"twoYearToggle",item:!0,xs:5,children:[e.jsx("span",{children:a("Confirm Plan")}),g&&e.jsx(ki,{isBillingPage:!0,isTwoYear:s,setIsTwoYear:m})]}),e.jsxs(or,{children:[!(P!=null&&P.length)&&e.jsx(hn,{}),P&&X[s?2:1].map(D=>e.jsx(Vn,{pack:D,onSelectPackage:()=>u({pack:D,renewalOrUpgrade:v}),coupons:Z,variant:r},D==null?void 0:D.id))]})]}),v==="upgrade"&&e.jsx(e.Fragment,{children:e.jsxs(or,{children:[!(P!=null&&P.length)&&e.jsx(hn,{}),P&&P.map(D=>e.jsx(Vn,{pack:D,onSelectPackage:()=>u({pack:D,renewalOrUpgrade:v}),coupons:Z,variant:r},D==null?void 0:D.id))]})})]}),v==="upgrade"&&S&&e.jsx(ae,{className:se.link,onClick:()=>I(v),disableRipple:!0,children:a("Optional Add-ons")})]})},Ai=({alacarteValues:t,backButton:a=null,handleFormSubmit:n,options:o,currencySymbol:l="$"})=>{const{t:c}=Ot(),r=j.useCallback(i=>{if(!i)return!1;const{subscription:u,...m}=i;return Object.values(m).every(s=>s==="")},[]);return e.jsxs(Ss,{children:[e.jsx(bs,{className:"upgrade",children:c("cyaoHeader")}),e.jsx(Cs,{className:"upgrade",children:c("cyaoSubHeader")}),e.jsx(It,{enableReinitialize:!0,initialValues:t,onSubmit:n,validateOnMount:!0,validationSchema:js,children:({handleSubmit:i,isSubmitting:u,isValid:m,values:s})=>{const v=Ps({options:o});return e.jsxs(Es,{onSubmit:i,children:[v.map(S=>e.jsx(ks,{displayHeadingNumber:{display:!1,offset:0},linkToUpgradePackage:null,options:o,optionType:S,purchaseFlow:"upgrade"},S)),e.jsxs(Rs,{children:[e.jsx(As,{options:o,values:s,currencySymbol:l||"$"}),e.jsx(Ts,{isFormInvalid:!m||r(s),children:e.jsx(Gs,{id:"continueButton",theme:"primary",variant:"contained",size:"large",disabled:u,onClick:i,children:c("continueButton")})})]}),a??a]})}})]})},Ti=de()({link:{padding:0,minWidth:0,color:H[100],fontWeight:600,textTransform:"none",fontSize:"12px","&:hover":{color:H[100],backgroundColor:"#FFF"}},backArrow:{display:"flex",flexDirection:"row"},wrapper:{flexGrow:1,flexShrink:0,fontFamily:"Open Sans, - apple - system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif",margin:"1.375rem 0 2rem 0",display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center",fontSize:"16px",lineHeight:1.5,paddingLeft:"30px"}}),Fi=({options:t,upgradedPackageId:a,setView:n})=>{const{alacarteValuesHook:o,purchaseFlowHook:l}=Ve(),[c,r]=o,[,i]=l,{classes:u}=Ti(),{t:m}=ue(),s=Ye(a),v=Ns(t);j.useEffect(()=>{r({...vn,subscription:v}),i("upgrade")},[v,r,i]);const S=I=>{r(I),n(T.REVIEW)};return e.jsxs(e.Fragment,{children:[e.jsxs(w,{className:u.backArrow,container:!0,direction:"row",justifyContent:"flex-start",alignItems:"center",children:[e.jsx(Mt,{}),e.jsx(be,{className:u.link,size:"small",disableRipple:!0,onClick:()=>n(T.UPGRADES),children:m("Back")})]}),e.jsx(Ai,{options:t,alacarteValues:c,handleFormSubmit:S,currencySymbol:(s==null?void 0:s.currencySymbol)||"$"})]})},_i=()=>{const{paymentInfo:t,isUpdatePaymentMethodApiPending:a}=wr(),{showMessage:n}=Cr(),{t:o}=ue(),l=Ue.useRef(null),c=Ue.useRef(!1),r=Ue.useRef(null),i=Ue.useRef(t==null?void 0:t.paymentErrorMessage);return i.current=t==null?void 0:t.paymentErrorMessage,j.useEffect(()=>{const u=t==null?void 0:t.paymentErrorMessage;u&&u!==l.current&&n({content:e.jsx(Hn,{children:u})}),l.current=u},[t==null?void 0:t.paymentErrorMessage,n]),j.useEffect(()=>{if(a)c.current=!0,r.current=i.current;else if(c.current){c.current=!1;const u=setTimeout(()=>{const m=i.current;m?m===r.current&&n({content:e.jsx(Hn,{children:m})}):n({content:e.jsx(Sr,{children:o("paymentMethodUpdatedSuccess")})})},0);return()=>clearTimeout(u)}},[a,n,o]),null},Oi=({open:t})=>{const{showMessage:a}=Cr(),{t:n}=ue(),o=Ue.useRef(!1);return j.useEffect(()=>{t&&!o.current&&a({content:e.jsx(Sr,{children:n("purchaseCompletedSuccess")})}),o.current=t},[t,a,n]),null},Ni=new po,Ii=de()(t=>({wrapper:{flexGrow:1,flexShrink:0,fontFamily:t.typography.fontFamily,margin:"1.375rem 0 2rem 0",display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center",fontSize:"16px",lineHeight:1.5},link:{color:t.palette.primary.main,fontWeight:600,textTransform:"none",textDecoration:"underline",fontSize:"14px",padding:"0","&:hover":{color:t.palette.primary.main,backgroundColor:"inherit"}},paymentMethodModuleWrapper:{padding:"10px 5%"}})),Di=()=>{var An,Tn,Fn,_n;const{t}=ue(),{classes:a}=Ii(),n=st(),{authToken:o}=xr(),{subscriptionsData:l,subscriptionsState:c,refreshSubscriptionData:r}=Qa(),{availableCouponsHook:i,billingData:u,billingState:m,IS_SPANISH_USER:s,IS_UK_USER:v,isAutoRenewHook:S,isFreeTrialHook:I,isFromReviewPageHook:P,isLoadingHook:Z,paymentErrorHook:$,paymentInfoHook:O,paymentWithAutoRenewHook:g,refreshBillingData:X,renewalSubHook:se,snackbarOpenHook:D,subscriptionDetail
16s:x,upgradesHook:C}=ot(),[b]=O,[,U]=P,[,A]=g,[ee,F]=$,[te,ne]=D,[M,k]=S,[Y]=i,[Q,ie]=Z,[G,N]=C,[fe,z]=I,[,K]=se,{alacarteValuesHook:we,availablePackageIdsHook:[ce,pe],packageExperiments:re,pricingGroupNameHook:[,p],selectedPackageHook:d}=Ve(),[,f]=we,[,y]=d,h=tt("grow1121EventImport"),R=tt("grow1247AppleBillingRetryHandling"),q=h?"GROW-1121":vr(re),[V,W]=j.useState(()=>{const L=new URLSearchParams(window.location.search),B=L.has("upgrade"),ge=L.has("cybersourceMigration");return B?T.UPGRADES:ge?T.PAYMENT:T.OVERVIEW}),J=c==="loaded"?l:null,_=m==="loaded"?u:null,[oe,ve]=j.useState([]),[je,De]=j.useState(!1),[me,Re]=j.useState(null),[$e,Wt]=j.useState(null),[Be,Me]=j.useState(!1),[Lt,pt]=j.useState(null),[Se,Ht]=j.useState([]),[le,Fe]=j.useState(null),[mt,Ut]=j.useState(null),[ft,Ae]=j.useState(!1),[Yt,zt]=j.useState(!1),[he,We]=fn([]),[ht,xt]=j.useState(""),Vt=j.useMemo(()=>he==null?void 0:he.find(L=>Ze(L)),[he]);oo(_,[ht,xt]);const gt=j.useMemo(()=>{if(!_)return he;const L=le==null?void 0:le.subscriptionStatus;return _!=null&&_.currentPackageId&&L!=="expired"?he==null?void 0:he.filter(B=>(B==null?void 0:B.id)!==_.renewalPackageId):he},[_,he,le]);j.useEffect(()=>{const L=async()=>{const B=await Yn(String(n==null?void 0:n.userId));Fe(B),z(B.trial),Ae(B.trial&&B.subscriptionStatus==="expired"),za(n==null?void 0:n.userId,{userId:n==null?void 0:n.userId})};o&&(n!=null&&n.userId)&&L()},[o,z,n]),j.useEffect(()=>{if(!he)return;async function L(){const B=cs(G,q);ve(B);const ge=Is(G==null?void 0:G.addOnOptions);Ht(ge)}G&&L()},[q,he,G,_]),j.useEffect(()=>{const L=document.getElementsByTagName("body")[0];L&&(L.style.overflow="auto")},[]),j.useEffect(()=>{!_||!(_!=null&&_.currentPackageId)||V===T.OVERVIEW&&y(Ye(_==null?void 0:_.currentPackageId,{variant:q}))},[q,_,V,f,y]),Jn(V===T.RENEWALS,["package","alacarteValues"]),Jn(V===T.OVERVIEW,["alacarteValues"]),Fs({token:o,setPackageIds:pe,setPricingGroupName:p}),io([he,We],Y),j.useEffect(()=>{(V===T.RENEWALS||V===T.UPGRADES)&&Me(!1)},[V,Me]),j.useEffect(()=>{if(!ce)return;const L=ce.map(B=>Ye(B,{variant:q}));We(L)},[q,ce,mt,We]);const yt=J!=null&&J.expirationDate?xn(Ni.date(J==null?void 0:J.expirationDate),"LLL dd, yyyy"):"",xe=({pack:L,renewalOrUpgrade:B})=>{y(L),Re(B),Ze(L)?W(T.CYO):(Wt(null),W(T.REVIEW)),vo(B,n==null?void 0:n.email,n==null?void 0:n.userId)},Le=()=>{F(null),U(!0),W(T.PAYMENT)},wt=async L=>{ie(!0);const B={...L,signupId:n.userId};Be?fs(B).then(ge=>{if(Qe(ge)){F(an(ge)),ie(!1);return}else Oe(),Me(!1)}):me==="upgrade"||(le==null?void 0:le.subscriptionStatus)==="expired"||(le==null?void 0:le.subscriptionStatus)==="none"?hs(B).then(ge=>{if(Qe(ge)){F(an(ge)),ie(!1);return}else Oe()}):xs(B).then(ge=>{if(Qe(ge)){F(an(ge)),ie(!1);return}else Oe()})},Oe=async()=>{Be||Nr({subExpirationDate:J==null?void 0:J.expirationDate,email:n.email,packageId:_==null?void 0:_.currentPackageId,userId:String(n.userId),firstName:n.firstName,lastName:n.lastName}),W(T.OVERVIEW),bo(n.email,n.userId);const L=await ms();N(L),r(),X();const B=await Yn(String(n.userId));Ae((B==null?void 0:B.trial)&&(B==null?void 0:B.subscriptionStatus)==="expired"),Fe(B),z(B==null?void 0:B.trial),y(null),F(null),ie(!1),ne(!0)},vt=(L,B=Vt,ge)=>{f(L),y(B),W(T.REVIEW)},Te=L=>{Re(L),W(T.ADDONS)},Ge=()=>{F(null),Be?W(T.OVERVIEW):me==="renewal"?(y(null),W(T.RENEWALS)):me==="upgrade"&&!oe.length?W(T.ADDONS):W(T.UPGRADES)},Pe=async(L,B)=>{Re(B?"renewal":me);const ge=L==null?void 0:L.currentPackageId,Jt=Ye(ge,{variant:q}),zr=u?u==null?void 0:u.currentSubscriptionTerm:1;if(Ze(Jt)){const Vr=Ds(J,zr);vt(Vr,Jt)}else y(Jt),W(T.REVIEW);Me(!B)},$t=()=>{A(!0),W(T.PAYMENT)},Gt=(L,B)=>{k(L),K(B),W(T.PAYMENT)},Ur=async L=>{ie(!0);const B=await gs(L);pt(B),ie(!1),W(T.TRANSACTION)},Yr=L=>{Ut(L),W(T.RENEWALS)},kn=(le==null?void 0:le.subscriptionStatus)==="current",qt=j.useMemo(()=>!!(x!=null&&x.purchaseSource)&&x.purchaseSource!=="OFW",[x==null?void 0:x.purchaseSource]),Rn=j.useMemo(()=>qt&&kn,[qt,kn]),Kt=j.useMemo(()=>R&&!!(_!=null&&_.billingRetryStartDate),[R,_==null?void 0:_.billingRetryStartDate]);return Q||!o||!_||c!=="loaded"?e.jsx(En,{}):e.jsxs(is,{token:o,children:[e.jsxs(Ft,{children:[e.jsx(_i,{}),e.jsx(Oi,{open:te})]}
16),e.jsxs(li,{value:{goBackToPackageStep:Ge,renewalOrUpgrade:me,renewalDate:yt,billingAndPayment:b,billingDetails:_,changePaymentFromReview:Le,submitPayment:wt,displayNames:$e,paymentError:ee,isPayingForCoParent:Be,setBillingViewState:W,refreshUserData:Oe,registrationInfo:le,subscriptionDetails:J},children:[e.jsx(Ee,{conditions:[((An=b==null?void 0:b.payment)==null?void 0:An.type)==="Credit Card",!((Tn=b==null?void 0:b.payment)!=null&&Tn.expDate),!((Fn=b==null?void 0:b.payment)!=null&&Fn.last4),((_n=b==null?void 0:b.address)==null?void 0:_n.country)==="GB"],render:e.jsx(Ei,{handleRedirect:()=>W(T.PAYMENT)})}),e.jsx(Ee,{conditions:[ft],render:e.jsx(mn,{severity:"warning",children:t("Your free trial has expired. Please purchase a subscription to re-activate your account.")})}),e.jsx(Ee,{conditions:[(le==null?void 0:le.subscriptionStatus)==="expired",!Kt],render:e.jsx(mn,{severity:"warning",children:t("Your subscription has expired. Please purchase a subscription to re-activate your account.")})}),e.jsx(Ee,{conditions:[Rn],render:e.jsx(ar,{severity:"warning",message:"You signed up on another platform and cannot manage your subscription here."})}),e.jsx(Ee,{conditions:[Kt],render:e.jsx(ar,{severity:"warning",message:"There is a problem with your payment method and Apple is retrying the charge. To keep your subscription, update your payment details in Apple Settings > Subscriptions."})}),(()=>{switch(V){case T.OVERVIEW:return e.jsx(pi,{isFreeTrial:fe,updatePaymentMethod:Gt,paymentMethods:b,signupCoParentorAcceptOffer:Pe,availableUpgrades:(G==null?void 0:G.subscriptionStatus)==="UPGRADEABLE"&&(oe==null?void 0:oe.length)>0?oe:null,selectAddonUpgrade:Te,legacyAddonsAvailable:(Xa(_==null?void 0:_.currentPackageId)||un(_==null?void 0:_.currentPackageId))&&(Se==null?void 0:Se.length)>0,addPaymentWithAutoRenew:$t,viewTransactionDetails:Ur,removeCurrentPackageFromRenewals:Yr,isFreeTrialExpired:ft,setPaymentError:F,packageLocale:v?"en_GB":s?"es_US":"en_US",acceptOffer:Pe,renewalPackageName:ht,isActiveMobileSubscription:Rn,isMobileSubscription:qt,isInAppleBillingRetry:Kt});case T.PAYMENT:return e.jsx(Ft,{children:e.jsx("div",{className:a.paymentMethodModuleWrapper,children:e.jsx(Sn,{displayMode:"DISPLAY_STORED_METHOD"})})});case T.UPGRADES:return e.jsx("div",{className:a.wrapper,children:e.jsx(ir,{renewalOrUpgrade:"upgrade",isAvailableAddons:(Se==null?void 0:Se.length)>0,setBillingViewState:W,selectPackage:xe,selectAddonUpgrade:Te,isShowDiscount:Y&&M,packages:oe})});case T.RENEWALS:return e.jsx("div",{className:a.wrapper,children:e.jsx(ir,{renewalOrUpgrade:"renewal",setIsTwoYear:De,isTwoYear:je,isShowDiscount:Y&&M,setBillingViewState:W,selectPackage:xe,packages:gt})});case T.CYO:return e.jsx(wi,{pack:he.find(L=>L==null?void 0:L.buildYourOwn),setBillingViewState:W});case T.ADDONS:return e.jsx(Fi,{options:Se,setView:W,upgradedPackageId:_==null?void 0:_.currentPackageId});case T.REVIEW:return e.jsx(gi,{});case T.TRANSACTION:return e.jsx(bi,{setBillingViewState:W,transaction:Lt})}})(),e.jsx(ji,{open:Yt,handleClose:()=>zt(!1)}),e.jsx(Ya,{}),e.jsx($a,{}),e.jsx(Ga,{})]})]})},gc=()=>e.jsx(j.Suspense,{fallback:e.jsx("div",{children:e.jsx(oa,{})}),children:e.jsx(os,{children:e.jsx(Di,{})})});export{Di as B,co as C,on as J,Rr as a,Zs as b,eo as c,Ar as d,no as e,Kn as f,ao as g,Js as h,Ks as i,gc as j,ro as k};
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.