1import{c as f,d as M,e as h}from"./chunk-VDZA5YSA.js";import{b as C}from"./chunk-YTUPXUHF.js";import"./chunk-NVKXDWWT.js";import"./chunk-OIRFSLWN.js";import{i as x}from"./chunk-ACJ3NLO5.js";import"./chunk-GPVZISOV.js";import"./chunk-FQ4W3A5M.js";import{a as F}from"./chunk-45WCVJBT.js";import"./chunk-74CDSVWG.js";import{R as z,T as N,U as m,ea as w,f as j,fa as H,ka as T,q as O,r as b}from"./chunk-SEQCRKB6.js";import{C as g,Db as L,E,R,Tb as U,U as s,V as I,Y as i,ma as y,n as c,o as S,s as u,u as A}from"./chunk-HBLARLGW.js";var p=(()=>{let t=class t{constructor(){this.http=i(L),this.routes=i(m),this.validations=i(T),this.languageService=i(z),this.logoutService=i(f)}authorize(r,e,a){let D=JSON.stringify({queryString:e});return this.http.post(this.authorizeUrl(r),D,{observe:"response"}).pipe(R(n=>this.extractLanguage(n)),u(n=>w.fromJsonApiResponse(n)),E(n=>this.handleOAuth2ErrorOrDefaultHandling(n,a)))}authorizeUrl(r){return O(["public","authentication","oauth2","authorization-servers",r,"authorize"])}handleOAuth2ErrorOrDefaultHandling(r,e){return this.setLanguage(r.error.meta.uiLocale),this.validations.getServerValidationErrorsWithCodes(r,["OAUTH2_AUTHORIZATION_SERVER_REAUTHENTICATION_REQUIRED"]).length>0?this.logoutService.logout(e).pipe(A(()=>g)):this.defaultErrorHandling(r)}defaultErrorHandling(r){return r.status===403?(this.routes.error.noAccess.navigate(),g):r.status===404?(this.routes.error.notFound.navigate(),S(()=>r)):c(H.fromErrorResponse(r))}extractLanguage(r){let e=r.body.data.attributes.uiLocale;this.setLanguage(e)}setLanguage(r){j.isNotBlank(r)&&this.languageService.isSupportedLanguage(r)&&(this.languageService.language=r)}};t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=s({token:t,factory:t.\u0275fac});let o=t;return o})();var l=(()=>{let t=class t{constructor(){this.authUiService=i(C),this.authAccessService=i(p)}authorize(r,e,a){return this.authUiService.access(()=>this.authAccessService.authorize(r,e,a))}};t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=s({token:t,factory:t.\u0275fac});let o=t;return o})();var d=(()=>{let t=class t{constructor(){this.oauth2AuthUiService=i(l),this.routes=i(m)}canActivate(r){return this.performAccess(r)}performAccess(r){let e=b(r.queryParams),a=r.paramMap.get("asId");return a?this.oauth2AuthUiService.authorize(a,e,window.location.href).pipe(u(()=>!1)):(this.routes.error.notFound.navigate(),c(!1))}};t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=s({token:t,factory:t.\u0275fac});let o=t;return o})();var V=[N,{path:":asId/authorize",canActivate:[o=>i(d).canActivate(o)],resolve:{logoutConfig:o=>i(h).resolve(o)},pathMatch:"full",runGuardsAndResolvers:"always",component:F}],Lt=(()=>{let t=class t{};t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=y({type:t}),t.\u0275inj=I({providers:[l,p,d,f,h,h.PROVIDER,M],imports:[U.forChild(V),x]});let o=t;return o})();export{Lt as OAuth2AuthorizationAccessModule};
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.