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.D3JsQqnf.js";import{H as g}from"./index.BpS05-Eo.js";import{A as v}from"./index.DwLG_pAX.js";import y from"./index.lVScwgMq.js";import"./RTLProvider.Bmr48mpV.js";import"./main.DrmgIV4z.js";import"./LazyFontLoader.5DGfhuFK.js";import"./PageHeader.DzbSaWOY.js";import"./NoResults.CdW-ZXlE.js";import"./BottomTabbedNavBar.juCVGsuy.js";import"./SiteNavLink.CgvBTSZT.js";import"./Block.v-v90TCf.js";import"./Table.DqiCxnM7.js";import"./isEmpty.CnTxIE1l.js";import"./SectionCallToAction.Dv_U2bt6.js";import"./TranslateFiltersContainer.DXuRIrPM.js";import"./FiltersBar.DCM5nKCa.js";import"./flatMap.CYmCgMUm.js";import"./pick.uU6gbf1j.js";import"./SelectField.B1q6eOH-.js";import"./Inliner.7-BReDbg.js";import"./FiltersPanel.CZMrAA8h.js";import"./Stuffer.D9jR5Zya.js";import"./SectionBlock.CYiEdDTE.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};
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.