1import{r as t,j as e}from"./react-vendor.B75MsAI9.js";import{D as a,r as s,s as r,t as i,u as o,p as n,v as l,x as p,z as m,I as c,H as d,J as f,K as j,O as u,P as h}from"./AuthModalContainer.CwDh3qj_.js";import{H as g}from"./index.BWnHWWO9.js";import{A as v}from"./index.QZxqS60A.js";import y from"./index.Ct5LFcYv.js";import"./RTLProvider.Dbr8G8Qw.js";import"./main.Bj0Ml4GZ.js";import"./LazyFontLoader.pvie9HdJ.js";import"./PageHeader.DyETjqw4.js";import"./NoResults.BLa53yYz.js";import"./BottomTabbedNavBar.DYM7eBY1.js";import"./SiteNavLink.DcUce1mo.js";import"./Block.DxpdHCJY.js";import"./Table.DpZC9tRb.js";import"./isEmpty.B73GR3ul.js";import"./SectionCallToAction.CXrTOKRM.js";import"./TranslateFiltersContainer.CZ5SVnps.js";import"./FiltersBar.C4fvBThS.js";import"./flatMap.BtxoME2v.js";import"./pick.Cpaa_ErP.js";import"./SelectField.CyNICQh1.js";import"./Inliner.DMPsK-K7.js";import"./FiltersPanel.CVoPsmCv.js";import"./Stuffer.AOe_ncSu.js";import"./SectionBlock.B0EqXXrm.js";const F=()=>{const{token:F}=a(),[S]=s(),T=r(),w=i(),x=o(),{appliedFilters:I,filterType:P}=n(t=>({appliedFilters:t.allFilters[t.allFilters.filterType],filterType:t.allFilters.filterType}),l),[k,B]=t.useState(()=>{const t=p.parse(S.toString());let e={};if(t.landingPage)try{e=new URL(decodeURIComponent(t.landingPage))}catch(a){e={pathname:`/${m}`,search:""}}else e={pathname:`/${m}`,search:""};return["/stories","/translate"].includes(e.pathname)?e:{pathname:`/${m}`,search:""}});return t.useEffect(()=>{const t=x("AuthModalContainer.login-successful");w(c({token:F})).then(e=>{e.user?(e.showNotification&&w(d({type:"success",content:t})),window.location.href=k.pathname+k.search,localStorage.setItem("sw-log-in-out-activity","login"+Math.random())):w(d({type:"danger",content:e.message||"Login failed"}))}).then(()=>w(f()).then(t=>(t.profile&&(t=>{var e,a;if((null==(e=null==t?void 0:t.data)?void 0:e.first_name)&&localStorage.setItem("userName",t.data.first_name),(null==(a=null==t?void 0:t.data)?void 0:a.id)&&localStorage.setItem("userId",t.data.id),window.location.pathname!==u.allBooksPath())return;const{languagePreferences:s}=t.data||{};if(s&&s.length>0){const t={language:s};w(h({filterType:P,filter:t})),T(`${window.location.pathname}?${p.stringify({...I,...t})}`.replace(`/${m}`,""),{replace:!0})}})({data:t.profile}),t))).then(t=>{k&&["/stories","/translate"].includes(k.pathname)||t.profile&&w(j({profile:t.profile}))})},[F,w,x,k,P,I,T]),k&&"/stories"===k.pathname?e.jsx(v,{}):k&&"/translate"===k.pathname?e.jsx(y,{}):e.jsx(g,{})};export{F as default}; 2//# sourceMappingURL=index.DxOyJ_Hd.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.