1import{b as U,c as I}from"./chunk-RRA5VJWW.js";import{a as T}from"./chunk-WFHVLUJ2.js";import{a as A}from"./chunk-CPSLHYTY.js";import{y as c,z as S}from"./chunk-RGDFOD5A.js";import{o as R}from"./chunk-OSKVSHTA.js";import{a as L}from"./chunk-YSMERDFP.js";import{j as y,l as b}from"./chunk-OOS6UWBD.js";import"./chunk-X6ZOC7KG.js";import{e as v}from"./chunk-RXABICNF.js";import{Da as u,Dc as d,F as m,Gb as f,L as a,gc as h,hc as g,qa as e}from"./chunk-S7LHBY2O.js";import{a as n}from"./chunk-NCEQPEJE.js";var G=(()=>{class i{constructor(){this.ps=e(A),this.route=e(y),this.router=e(b),this.store=e(R),this.location=e(v),this.attribution=e(T),this.actions$=e(U),this.destroyRef=e(u),this.loggedIn=this.store.selectSignal(S.getLoggedIn)}ngOnInit(){this.ps.isBrowser&&(this.loggedIn()?this.router.navigateByUrl("/"):this.route.queryParams.pipe(a(1)).subscribe(t=>{let o=t.error,s=t.code,w=t.state,C=t.ref,r=Object.fromEntries(new URLSearchParams(w));if(o)this.goToLogin(r.redirect);else if(!s)this.goToLogin(r.redirect);else{localStorage.setItem("previousLogin","apple");let p=this.attribution.getLastAttribution(),l=this.attribution.getAttribution();this.store.dispatch(c.loginApple(n(n({code:s,ref:C,redirect:r.redirect},p&&{attr:p}),l&&{attrFirst:l}))),this.location.replaceState("/auth/apple-redirect"),this.actions$.pipe(I(c.loginFailure),m(D=>D.provider==="apple"),a(1),L(this.destroyRef)).subscribe(()=>{this.goToLogin(r.redirect)})}}))}goToLogin(t){t&&t!=="/login"?this.router.navigate(["/login"],{queryParams:{redirect:t},replaceUrl:!0}):this.router.navigateByUrl("/login",{replaceUrl:!0})}static{this.\u0275fac=function(o){return new(o||i)}}static{this.\u0275cmp=f({type:i,selectors:[["app-apple-redirect"]],decls:2,vars:0,template:function(o,s){o&1&&(h(0,"p"),d(1,"apple-redirect works!"),g())},encapsulation:2})}}return i})();export{G as AppleRedirectComponent};
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.