1import{a as w,b as L,d as O,e as A,f as S}from"./chunk-WZEJEAQT.js";import"./chunk-Q2L2METW.js";import"./chunk-DIPFGUEX.js";import{w as y}from"./chunk-IOHXACAF.js";import"./chunk-H7D5JEIJ.js";import{Fa as c,K as d,L as I,M as h,Q as N,Z as _,la as j,x as b}from"./chunk-2THTJ2V7.js";import{c as p,g as v,k as T}from"./chunk-XVZXOWV7.js";import"./chunk-5PJ4363Y.js";import{Aa as C,Ba as P,Ea as g,Fa as E,R as n,Ra as R,bc as U,v as m}from"./chunk-VDJNVHIP.js";import{a as u}from"./chunk-NAIKXHWT.js";var k={backend:{occ:{endpoints:{userRegister:"users",userForgotPassword:"forgottenpasswordtokens",userRestoreToken:"passwordRestoreToken",userResetPassword:"resetpassword",userUpdateLoginId:"users/${userId}/login",userUpdatePassword:"users/${userId}/password",titles:"titles"}}}},l={"Content-Type":"application/json"},H={"Content-Type":"application/x-www-form-urlencoded"},M=(()=>{class i{constructor(e,t,o){this.http=e,this.occEndpoints=t,this.converter=o,this.logger=E(N),this.captchaConfig=E(y,{optional:!0}),this.injector=E(R,{optional:!0})}update(e,t){let o=this.occEndpoints.isConfigured("userUpdateProfile")?"userUpdateProfile":"user",r=this.occEndpoints.buildUrl(o,{urlParams:{userId:e}});return t=this.converter.convert(t,L),this.http.patch(r,t).pipe(n(s=>{throw c(s,this.logger)}))}register(e){let t=this.occEndpoints.buildUrl("userRegister"),o=new p(u({},l));return o=h.createHeader(d,!0,o),o=this.appendCaptchaToken(o),e=this.converter.convert(e,O),this.http.post(t,e,{headers:o}).pipe(n(r=>{throw c(r,this.logger)}),this.converter.pipeable(w))}registerGuest(e,t){let o=this.occEndpoints.buildUrl("userRegister"),r=new p(u({},H));r=h.createHeader(d,!0,r),r=this.appendCaptchaToken(r);let s=new v().set("guid",e).set("password",t);return this.http.post(o,s,{headers:r}).pipe(n(a=>{throw c(a,this.logger)}),this.converter.pipeable(w))}requestForgotPasswordEmail(e){let t=this.occEndpoints.buildUrl("userRestoreToken"),o={loginId:e},r=new p(l);return r=h.createHeader(d,!0,r),this.http.post(t,o,{headers:r}).pipe(n(s=>{throw c(s,this.logger)}))}resetPassword(e,t){let o=this.occEndpoints.buildUrl("userResetPassword"),r=new p(u({},l));return r=h.createHeader(d,!0,r),this.http.post(o,{token:e,newPassword:t},{headers:r}).pipe(n(s=>{throw c(s,this.logger)}))}updateEmail(e,t,o){let r=this.occEndpoints.buildUrl("userUpdateLoginId",{urlParams:{userId:e}}),s={newLoginId:o,password:t},a=new p(l);return this.http.post(r,s,{headers:a}).pipe(n(f=>{throw c(f,this.logger)}))}updatePassword(e,t,o){let r=this.occEndpoints.buildUrl("userUpdatePassword",{urlParams:{userId:e}}),s={oldPassword:t,newPassword:o},a=new p(l);return this.http.post(r,s,{headers:a}).pipe(n(f=>{throw c(f,this.logger)}))}close(e){let t=this.occEndpoints.isConfigured("userCloseAccount")?"userCloseAccount":"user",o=this.occEndpoints.buildUrl(t,{urlParams:{userId:e}});return this.http.delete(o).pipe(n(r=>{throw c(r,this.logger)}))}loadTitles(){let e=this.occEndpoints.buildUrl("titles");return this.http.get(e).pipe(n(t=>{throw c(t,this.logger)}),m(t=>t.titles??[]),this.converter.pipeableMany(A))}appendCaptchaToken(e){if(this.injector&&this.captchaConfig?.captchaRenderer){let t=this.injector.get(this.captchaConfig.captchaRenderer),o=t.getCaptchaConfig().subscribe(r=>r.enabled);if(t?.getToken()&&o)return e.append(I,t.getToken())}return e}static{this.\u0275fac=function(t){return new(t||i)(g(T),g(_),g(j))}}static{this.\u0275prov=C({token:i,factory:i.\u0275fac})}}return i})(),B=(()=>{class i{static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275mod=U({type:i})}static{this.\u0275inj=P({providers:[b(k),{provide:S,useClass:M}]})}}return i})();export{M as OccUserProfileAdapter,B as UserProfileOccModule,k as defaultOccUserProfileConfig};
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.