PageSourceSearch

https://ozeretli.co.il/chunk-4OP57X7R.js

js ozeretli.co.il collected 2026-10-02 00:14:14 UTC 3,567 bytes, 1 lines download raw bytes

1import{e as x}from"./chunk-XPIUCE7A.js";import{b as O,d as $,l as b,m as w}from"./chunk-WZXOXFKY.js";import{a as k}from"./chunk-IDSOCJCJ.js";import{a as j}from"./chunk-5SQLPFDP.js";import{i as U}from"./chunk-5Y26HNWF.js";import{i as L}from"./chunk-V3UG5XJT.js";import{a as I}from"./chunk-JI3D2NEO.js";import{a as C}from"./chunk-NMRIN72X.js";import{F as v,I as m,M as c,R as y,ca as a,da as S,fa as h,g as f,la as P,n,o as u,qa as s,s as d,z as g}from"./chunk-VS7X6DYN.js";var A=(function(t){return t.fb="Facebook",t.vk="Vkontakte",t.ok="Odnoklassniki",t.google="Google",t.apple="AppleService",t})(A||{});var V=(()=>{let r=class r{static validateJson(i){try{return JSON.parse(i),!0}catch(e){return!1}}constructor(){this.loadingService=s(j),this.router=s(L),this.identityService=s(U),this.loginService=s(x),this.authApiClient=s(O),this.alertsService=s(k),this.window=s(I),this.appConfig=s(C),this.destroySubject$=new f,this.refreshSubject$=new f,this.refreshes$=this.refreshSubject$.asObservable()}getUserId(){return this.identityService.stateChanges.pipe(c(1),d(i=>i.user),d(i=>{if(i)return i.Id;throw new Error("User is not authenticated")}))}login(i,e,l){return this.authWindow?.close(),this.authWindow=this.openAuthWindow(i),g(this.window,"message").pipe(v(o=>o.origin===location.origin&&r.validateJson(o.data)),d(o=>JSON.parse(o.data)),c(1),h(()=>{this.authWindow?.close(),this.loadingService.isLoading$.next(!0)}),a(o=>this.handleMessage(o,e,l)),h(()=>this.loadingService.isLoading$.next(!1)),y(()=>this.loadingService.isLoading$.next(!1)),S(this.destroySubject$))}getUserInfo(){return this.getUserId().pipe(a(i=>this.authApiClient.userLoginProviders_GetLoginProviders(i)))}bindLoginProvider(i){return this.authWindow?.close(),this.authWindow=this.openAuthWindow(i),g(this.window,"message").pipe(v(e=>e.origin===location.origin&&r.validateJson(e.data)),d(e=>JSON.parse(e.data)),c(1),a(e=>e.isRegistered?u(r.LoginProviderIsBusy):n(null)),h(()=>this.authWindow?.close()),a(()=>this.getUserId()),a(e=>this.authApiClient.userLoginProviders_Add(e,i)),h(()=>this.refreshSubject$.next()),m(e=>(this.authWindow?.close(),e===r.LoginProviderIsBusy?(this.alertsService.notifyError("errors|login_provider_is_busy"),n(null)):e instanceof b&&e.problemCode===w.LoginProviderAlreadyExists?(this.alertsService.notifyError("errors|login_provider_is_busy"),n(null)):u(e))))}unbindLoginProvider(i){return this.getUserId().pipe(a(e=>this.authApiClient.userLoginProviders_Delete(e,i)),h(()=>this.refreshSubject$.next()),m(e=>e instanceof b&&e.problemCode===w.CanNotRemoveTheOnlyUserLogin?(this.alertsService.notifyError("errors|cannot_remove_only_user_login"),n(null)):u(e)))}ngOnDestroy(){this.destroySubject$.next(),this.destroySubject$.complete()}openAuthWindow(i){return this.window.open(this.appConfig.tokenEndpoint+`/externalLogin/${i}?returnUrl=`+location.origin+"/assets/html/auth-complete.html",null,"width=600,height=558")}registerUser(i,e,l,o){let W=["/register/external"],p={provider:i,sid:e};o&&Object.assign(p,{userType:o}),l&&Object.assign(p,{utm_source:l}),this.router.navigate(W,{queryParams:p})}handleMessage(i,e,l){return i.status?i.isRegistered?this.loginService.loginExternal().pipe(d(()=>null)):(this.registerUser(i.provider,i.sid,e,l),n(null)):i.error?.toUpperCase()===$.UserIsBlocked.toUpperCase()?(this.alertsService.notifyError("errors|user_is_blocked"),n(null)):u(()=>"not implemented (auth fail)")}};r.LoginProviderIsBusy={},r.\u0275fac=function(e){return new(e||r)},r.\u0275prov=P({token:r,factory:r.\u0275fac});let t=r;return t})();export{A as a,V as b};

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.