1import{a as h}from"./chunk-ASTXUBF3.js";import{i as L}from"./chunk-XNTCN5LM.js";import{B as I,D as O,Da as l,Dc as q,Ec as M,G as P,Ib as A,Kc as D,Lc as B,Ma as $,Mc as S,Nb as r,Ob as b,Qc as N,Va as _,aa as s,db as g,dc as y,eb as f,ec as w,g as E,ga as R,gd as j,ha as U,hc as T,id as p,jb as C,kb as a,lb as o,ma as m,n as k,r as x,sb as v,x as F,yb as c}from"./chunk-5LGYDGR4.js";var mt=(t,n)=>{let e=s(h),i=s(p),u=s(m);return S(u)?!0:e.isAuthenticated$.pipe(x(d=>d?!0:i.createUrlTree(["authentication",e.endpoints.login],{queryParams:{returnUrl:n.url}})),O(()=>k(i.createUrlTree(["authentication",e.endpoints.login],{queryParams:{returnUrl:n.url}}))))};var xt=()=>{let t=s(p),n=s(h),e=s(m);return S(e)?!0:n.isAuthenticated$.pipe(x(i=>i?t.createUrlTree(["/"]):!0))};function H(t,n){t&1&&v(0)}function X(t,n){if(t&1&&_(0,H,1,0,"ng-container",5),t&2){c();let e=A(6);C("ngTemplateOutlet",e)}}function G(t,n){t&1&&v(0)}function Y(t,n){if(t&1&&_(0,G,1,0,"ng-container",5),t&2){c();let e=A(8);C("ngTemplateOutlet",e)}}function z(t,n){t&1&&v(0)}function J(t,n){if(t&1&&_(0,z,1,0,"ng-container",5),t&2){c();let e=A(10);C("ngTemplateOutlet",e)}}function K(t,n){t&1&&(a(0,"div",4)(1,"span",6),r(2,"\xA0"),o(),a(3,"span",7),r(4,"\xA0"),o(),a(5,"span",8),r(6,"\xA0"),o(),a(7,"button",9),r(8,"\xA0"),o()())}function Q(t,n){t&1&&(a(0,"a",10),r(1,"Continue"),o())}function W(t,n){t&1&&(a(0,"span",11),r(1,"\xA0"),o())}function Z(t,n){if(t&1&&(a(0,"h1"),r(1,"Signing in"),o(),a(2,"p"),r(3),y(4,"async"),o(),g(5,Q,2,0,"a",10)(6,W,2,0,"span",11)),t&2){let e=c();l(3),b(w(4,2,e.message$)),l(2),f(e.showContinue?5:6)}}function tt(t,n){t&1&&(a(0,"a",10),r(1,"Continue"),o())}function et(t,n){t&1&&(a(0,"span",11),r(1,"\xA0"),o())}function nt(t,n){if(t&1&&(a(0,"h1"),r(1,"Signing out"),o(),a(2,"p"),r(3),y(4,"async"),o(),g(5,tt,2,0,"a",10)(6,et,2,0,"span",11)),t&2){let e=c();l(3),b(w(4,2,e.message$)),l(2),f(e.showContinue?5:6)}}function it(t,n){t&1&&(a(0,"a",10),r(1,"Continue"),o())}function at(t,n){t&1&&(a(0,"span",11),r(1,"\xA0"),o())}function ot(t,n){if(t&1&&(a(0,"h1"),r(1,"Activating"),o(),a(2,"p"),r(3),y(4,"async"),o(),g(5,it,2,0,"a",10)(6,at,2,0,"span",11)),t&2){let e=c();l(3),b(w(4,2,e.message$)),l(2),f(e.showContinue?5:6)}}var V=(()=>{class t{constructor(){this.action=null,this.showContinue=!1,this._message$=new E(void 0),this.message$=this._message$.asObservable().pipe(I(e=>e!==void 0)),this._window=s(R).defaultView,this.platformId=s(m),this.route=s(j),this.router=s(p),this.auth=s(h),this.destroyRef=s(U)}ngOnInit(){if(!B(this.platformId))return;switch(F(5e3).pipe(L(this.destroyRef),P(1)).subscribe(()=>{this.showContinue=!0}),this.route.snapshot.paramMap.get("action")){case this.auth.endpoints.login:this.login();break;case this.auth.endpoints.login_callback:this.loginCallback();break;case this.auth.endpoints.profile:this.redirectToProfile();break;case this.auth.endpoints.activate:this.activate();break;case this.auth.endpoints.login_fail:this._message$.next(this.route.snapshot.queryParamMap.get(this.auth.queryParamNames.message));break;case this.auth.endpoints.logout:this.logout();break;case this.auth.endpoints.logout_callback:this.logoutCallback();break;case this.auth.endpoints.logged_out:this.loggedOut();break;default:throw new Error(`Invalid action '${this.action}'`)}}redirectToProfile(){this._message$.next("Redirecting to profile..."),this._window.location.replace(`${this._window.location.origin}/${this.auth.endpoints.identity_manage}`)}login(){this.action="signIn",this._message$.next("Checking credentials...");let e=this.route.snapshot.queryParamMap.get(this.auth.queryParamNames.return_url),i=e?new N({fromObject:{return_url:e}}).toString():void 0;this.auth.signIn({url_state:i,redirect_uri:this.auth.endpointURIs.login_callback})}loginCallback(){this.action="signIn",this._message$.next("Securing connection..."),this.auth.signInCallback(this._window.location.href)?.then(()=>{let i=new URLSearchParams(this._window.location.hash.substring(1)).get("state");if(!i)return this.router.navigateByUrl("/",{replaceUrl:!0});let u=i.indexOf("return_url");return u===-1?this.router.navigateByUrl("/",{replaceUrl:!0}):this.router.navigateByUrl(decodeURIComponent(i.substring(u+11))||"/",{replaceUrl:!0})})}logout(){this.action="signOut",this.auth.signOut()}logoutCallback(){this.action="signOut",this.auth.signOutCallback(this._window.location.href)}activate(){this.action="activate",this._message$.next("Activating account credentials...");
1let e=this.route.snapshot.queryParamMap.get(this.auth.queryParamNames.return_url),i=this.route.snapshot.queryParamMap.get(this.auth.queryParamNames.activation_code);i&&e&&this.auth.activate&&this.auth.activate(i,e)}loggedOut(){this.action="signOut",this._message$.next("You successfully logged out!"),this.router.navigateByUrl("/")}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=$({type:t,selectors:[["fx-auth"]],decls:11,vars:1,consts:[["signIn",""],["signOut",""],["activate",""],[1,"d-flex","align-items-center","flex-column","container","py-8"],[1,"placeholder-wave"],[4,"ngTemplateOutlet"],[1,"placeholder","w-25","bg-level-1","fs-1","dark","mb-6","d-block"],[1,"placeholder","w-75","bg-level-1","fs-4","dark","mb-4","d-block"],[1,"placeholder","w-50","bg-level-1","fs-4","dark","mb-8","d-block"],["disabled","",1,"w-25"],["routerLink","/",1,"btn","btn-primary"],[1,"d-block","placeholder","placeholder-wave","w-15","fs-2","text-primary"]],template:function(i,u){if(i&1&&(a(0,"div",3),g(1,X,1,1,"ng-container")(2,Y,1,1,"ng-container")(3,J,1,1,"ng-container")(4,K,9,0,"div",4),o(),_(5,Z,7,4,"ng-template",null,0,T)(7,nt,7,4,"ng-template",null,1,T)(9,ot,7,4,"ng-template",null,2,T)),i&2){let d;l(),f((d=u.action)==="signIn"?1:d==="signOut"?2:d==="activate"?3:4)}},dependencies:[D,q,M],encapsulation:2,changeDetection:1})}}return t})();var Ut=()=>[{path:":action",component:V}];export{mt as a,xt as b,Ut as c};
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.