(globalThis.webpackChunk=globalThis.webpackChunk||[]).push([[7812],{757812(__unused_webpack_module,__webpack_exports__,__webpack_require__){(function(){if(!this.ST)return()=>{};with(this.ST)with(this.RH)with(this.G)return function(){"use strict";__webpack_require__.d(__webpack_exports__,{T:()=>b});var t=__webpack_require__(515863);__webpack_require__.n(t);var e=__webpack_require__(67659);var a=__webpack_require__(833081);var n=__webpack_require__(367464);var i=__webpack_require__(301619);var r=__webpack_require__(503223);var c=__webpack_require__(954817);var l=__webpack_require__(33745);var o=__webpack_require__(308571);var s=__webpack_require__(507014);var d=__webpack_require__(694733);var g=__webpack_require__(449839);var u=__webpack_require__(415316);var y=__webpack_require__(489542);var v=__webpack_require__(772112);var f=__webpack_require__(440869);var p=__webpack_require__(555574);var m=__webpack_require__(521630);var E=__webpack_require__(739506);var w=__webpack_require__(172093);var _=__webpack_require__(642718);let b=b=>{let S=(0,t.c)(51);let{isOnboarding:h}=b;let k=h===undefined?!1:h;let{trackEvent:B}=(0,e.useContext)(s.O2);let A=(0,o.P)();let T=(0,a.wA)();let{setIsBackupAndSyncFeatureEnabled:R,error:C}=(0,d.e)();let I=(0,a.d4)(E.$lR);let M=(0,a.d4)(E.IiS);let J=(0,a.d4)(y.Qz);let L=(0,a.d4)(E.R0A);let P=(0,a.d4)(y.Qy);let x=(0,a.d4)(v.JU);let D=k?L:J;let F;S[0]!==D||S[1]!==x||S[2]!==B?(F=t=>{B({category:g.FZ.Settings,event:g.gP.SettingsUpdated,properties:{settings_group:"backup_and_sync",settings_type:"main",old_value:D,new_value:t,was_notifications_on:x}})},S[0]=D,S[1]=x,S[2]=B,S[3]=F):F=S[3];let N=F;let O;let W;S[4]!==T||S[5]!==J||S[6]!==I||S[7]!==k||S[8]!==L||S[9]!==M||S[10]!==R?(O=()=>{if(k){M===!1&&L===!0&&T((0,w.tW)());return}I===!1&&J&&(async()=>{try{await R(n.f.main,!1),await R(n.f.accountSyncing,!1),await R(n.f.contactSyncing,!1)}catch(t){console.error("Failed to disable backup and sync features:",t)}})()},W=[k,I,M,J,L,R,T],S[4]=T,S[5]=J,S[6]=I,S[7]=k,S[8]=L,S[9]=M,S[10]=R,S[11]=O,S[12]=W):(O=S[11],W=S[12]),(0,e.useEffect)(O,W);let Y;S[13]!==T||S[14]!==D||S[15]!==J||S[16]!==I||S[17]!==k||S[18]!==M||S[19]!==R||S[20]!==N?(Y=async()=>{if(k){if(D){N(!1),T((0,w.tW)());return}if(N(!0),M===!1){T((0,f.toY)({name:_.Md,enableBackupAndSync:async()=>{T((0,w.yy)()),T((0,w.B2)())}}));return}T((0,w.B2)());return}if(J){N(!1),await R(n.f.main,!1),await R(n.f.accountSyncing,!1),await R(n.f.contactSyncing,!1);return}if(N(!0),I===!1){T((0,f.toY)({name:_.Md,enableBackupAndSync:async()=>{await T((0,f.K9g)(!0)),await R(n.f.main,!0),await R(n.f.accountSyncing,!0),await R(n.f.contactSyncing,!0)}}));return}await R(n.f.main,!0),await R(n.f.accountSyncing,!0),await R(n.f.contactSyncing,!0)},S[13]=T,S[14]=D,S[15]=J,S[16]=I,S[17]=k,S[18]=M,S[19]=R,S[20]=N,S[21]=Y):Y=S[21];let $=Y;let z=!k&&P;let Q;S[22]!==A?(Q=A("backupAndSyncEnable"),S[22]=A,S[23]=Q):Q=S[23];let U;S[24]!==Q?(U=e.createElement(l.E,{variant:i.J3.BodyMd,fontWeight:i.IT.Medium},Q),S[24]=Q,S[25]=U):U=S[25];let V;S[26]!==D||S[27]!==$||S[28]!==z?(V=z?e.createElement(c.a,{paddingLeft:5,paddingRight:5},e.createElement(m.A,{size:36})):e.createElement("div",{className:"privacy-settings__setting__toggle","data-testid":"backup-and-sync-toggle-container"},e.createElement(p.A,{value:D,onToggle:$,dataTestId:"backup-and-sync-toggle-button"})),S[26]=D,S[27]=$,S[28]=z,S[29]=V):V=S[29];let j;S[30]!==U||S[31]!==V?(j=e.createElement(c.a,{flexDirection:r.uV.Row,justifyContent:r.TE.Between,alignItems:r.RE.Start,marginBottom:1},U,V),S[30]=U,S[31]=V,S[32]=j):j=S[32];let G;S[33]!==A?(G=A("backupAndSyncPrivacyLink"),S[33]=A,S[34]=G):G=S[34];let H;S[35]!==G?(H=e.createElement(l.E,{asChild:!0,variant:i.J3.BodyMd,key:"privacy-link",color:i.r7.InfoDefault},e.createElement("a",{href:u.A.PROFILE_PRIVACY,target:"_blank",rel:"noopener noreferrer"},G)),S[35]=G,S[36]=H):H=S[36];let K;S[37]!==A||S[38]!==H?(K=A("backupAndSyncEnableDescription",[H]),S[37]=A,S[38]=H,S[39]=K):K=S[39];let Z;S[40]!==K?(Z=e.createElement(l.E,{variant:i.J3.BodyMd,color:i.r7.TextAlternative,asChild:!0},e.createElement("div",null,K)),S[40]=K,S[41]=Z):Z=S[41];let q;S[42]!==C||S[43]!==A?(q=C&&e.createElement(c.a,{marginTop:4,paddingBottom:4},e.createElement(l.E,{color:i.r7.ErrorDefault,variant:i.J3.BodySm},A("notificationsSettingsBoxError"))),S[42]=C,S[43]=A,S[44]=q):q=S[44];let X;S[45]!==Z||S[46]!==q?(X=e.createElement("div",{className:"privacy-settings__setting__description"},Z,q),S[45]=Z,S[46]=q,S[47]=X):X=S[47];let tt;return S[48]!==X||S[49]!==j?(tt=e.createElement(c.a,{marginTop:4,marginBottom:4,paddingLeft:4,paddingRight:4,className:"privacy-settings__setting__wrapper",id:"backup-and-sync-toggle","data-testid":"backup-and-sync-container"},j,X),S[48]=X,S[49]=j,S[50]=tt):tt=S[50],tt}}}).call(__webpack_require__._LM_("$root$",{__webpack_require__,__webpack_exports__}))()}}]);