PageSourceSearch

https://gazprom.kg/assets/AuthModal-BgGk2hLu.js

js gazprom.kg collected 2026-10-07 02:59:12 UTC 14,086 bytes, 1 lines download raw bytes

1import{N as f,_,c as l,o as a,b as t,x as m,d as y,u as g,v as r,z as A,K as C,a2 as v,G as w,O as S,M as B,T as k,Z as T,J as M,U as I,t as P,aj as R,w as L,e as $,f as O,r as N}from"./index-ae80RWzP.js";import{_ as V}from"./OTPInputs-DpMThxoZ.js";import U from"./left-arrow-back-0kXqCHui.js";const x={components:{OTPInputs:V,BaseLoader:f},props:{phone:String,unmaskedValue:String,recovery:Boolean},emits:["handleChangeScreen","resendCode","setOtpValue"],data(){return{timer:60,intervalId:null,canResend:!1,errorMsg:"",loading:!1}},watch:{errorMsg(){this.errorMsg&&setTimeout(()=>{this.errorMsg=""},4e3)}},methods:{async handleOtp(e){this.verifyCode(e).then(s=>{s?(this.$emit("setOtpValue",e),this.$emit("handleChangeScreen",{nextStep:"create",isRecovery:this.recovery})):this.errorMsg="Неправильный код"}).catch(s=>{console.error("Ошибка при проверке кода:",s)})},async verifyCode(e){this.loading=!0;try{return!!(await this.$axiosApi.post("gazprom-app/auth/check-otp",{contactNumber:this.unmaskedValue,code:Number(e)})).data.result}catch(s){return console.log(s),!1}finally{this.loading=!1}},startTimer(){this.timer=60,this.canResend=!1,this.intervalId=setInterval(()=>{this.timer>0?this.timer--:(this.canResend=!0,clearInterval(this.intervalId),this.errorMsg="")},1e3)},resendCode(){this.$emit("resendCode"),this.startTimer()}},mounted(){this.startTimer()}},z={class:"otp"},F={class:"title"},D={class:"subtitle"},W={key:1,class:"error-msg"},E={key:2,class:"timer"},H=["disabled"];function q(e,s,p,b,o,n){const u=V,h=f;return a(),l("div",z,[t("span",F,r(e.$t("modals.confirmCode.title")),1),t("span",D,r(e.$t("modals.confirmCode.description").replace("$__PHONE",p.phone??"")),1),m(u,{error:!!o.errorMsg,numDigits:5,onComplete:n.handleOtp},null,8,["error","onComplete"]),o.loading?(a(),y(h,{key:0,loaderWidth:"10px",color:"#1852E0"})):g("",!0),o.errorMsg?(a(),l("span",W,r(o.errorMsg),1)):g("",!0),o.timer!==0?(a(),l("span",E,r(e.$t("modals.confirmCode.resendText"))+" "+r(o.timer)+" "+r(e.$t("modals.confirmCode.seconds")),1)):g("",!0),t("button",{onClick:s[0]||(s[0]=(...c)=>n.resendCode&&n.resendCode(...c)),class:A(o.canResend?"btn":"btn-disabled"),disabled:!o.canResend},r(e.$t("modals.confirmCode.resend")),11,H)])}const j=_(x,[["render",q],["__scopeId","data-v-a4b141ec"]]),G={components:{BaseAuthInput:v},props:{msg:String,loadingPhone:Boolean},data(){return{phone:"+996 ",errorMsg:"",unmaskedValue:""}},emits:["handleChangeScreen","changePhoneValue","sendSMS"],created(){setTimeout(()=>{this.$refs.phoneInput.$refs.input.focus()},400)},watch:{msg(){this.msg&&(this.errorMsg=this.msg)}},directives:{maska:C},methods:{sendSMS(){if(this.unmaskedValue.length!==9){this.errorMsg="Некорректный номер";return}this.$emit("changePhoneValue",{phone:this.phone,unmaskedValue:this.unmaskedValue}),this.$emit("sendSMS")}}},J={class:"main-text"},K={key:0,class:"error-msg"},Z={class:"button",type:"submit"},Q={key:1};function X(e,s,p,b,o,n){const u=v,h=f,c=B("maska");return a(),l("form",{class:"form",method:"post",onSubmit:s[1]||(s[1]=S((...i)=>n.sendSMS&&n.sendSMS(...i),["prevent"]))},[t("span",J,r(e.$t("modals.register.title")),1),t("p",null,r(e.$t("modals.register.description")),1),w(m(u,{ref:"phoneInput",error:!!o.errorMsg,appendIcon:"@/assets/images/phone.svg",modelValue:o.phone,"onUpdate:modelValue":s[0]||(s[0]=i=>o.phone=i),label:e.$t("modals.register.inputs.phone")},null,8,["error","modelValue","label"]),[[c,"+996 (###)-###-###","unmaskedValue",{unmasked:!0}]]),o.errorMsg?(a(),l("span",K,r(o.errorMsg),1)):g("",!0),t("button",Z,[p.loadingPhone?(a(),y(h,{key:0,loaderWidth:"10px",color:"white"})):(a(),l("span",Q,r(e.$t("modals.register.submit")),1))])],32)}const Y=_(G,[["render",X],["__scopeId","data-v-a87e9b3e"]]),ee={components:{OTPInputs:V,Arrow:U,BaseLoader:f},props:{unmaskedValue:String,otpCode:String,phone:{type:String,required:!0},msg:{type:String,required:!1},recovery:Boolean},emits:["handleChangeScreen","changePhoneValue","sendSMS","resendCode","setOtpValue"],data(){return{step:"password",passwordRetype:"",password:"",errorMsg:"",isLoading:!1,rules:{checkBoxService:!1,checkBoxPrivacy:!1}}},methods:{...k(I,["close"]),...k(M,["storeLoggedInUser"]),...k(T,["removeChatCookie"]),async registerUser(){if(this.password.length<4||this.passwordRetype.length<4){this.errorMsg="Пароль должен быть длинне 4 цифр";return}if(this.password!==this.passwordRetype){this.errorMsg="Пароли не совпадают";return}this.isLoading=!0;const e=this.recovery?"gazprom-app/auth/passcode":"gazprom-app/auth/create",s={contactNumber:this.unmaskedValue,passCode:this.password,otpCode:this.otpCode};await this.$axiosApi[this.recovery?"put":"post"](e,s).then(({data:p})=>{p&&(this.storeLoggedInUser(p.accessToken),this.$router.push("/profile"),this.removeChatCookie(),this.close())}).catch(p=>{console.error("Ошибка:",p),this.errorMsg="Ошибка выполнения запроса"}),this.isLoading=!1},updatePassword(e){this.password=e},updatePasswordRetype(e){this.passwordRetype=e},handlePassword(){if(!this.password){this.errorMsg="Заполните поле";return}if(this.password.length<4){this.errorMsg="Пароль должен быть длинне 4 цифр";return}this.step="passwordRetype",this.errorMsg=""}}},se={key:0,class:"wrap"},oe={class:"main-text"},te={class:"error-msg"},re={class:"input-wrap"},ne={key:1,class:"wrap"},ae={class:"main-text"},ie={class:"error-msg"},le={class:"input-wrap"},de={style:{"margin-bottom":"20px"},class:"checkboxes"},pe={class:"checkbox"},ue={class:"checkbox"},he=["disabled"],ce={key:1};function me(e,s,p,b,o,n){const u=P("Arrow"),h=V,c=P("router-link"),i=f;return a(),l("div",null,[o.step==="passwordRetype"?(a(),y(u,{key:0,onClick:s[0]||(s[0]=d=>o.step="password"),class:"arrow-back"})):g("",!0),t("form",{method:"post",onSubmit:s[7]||(s[7]=S((...d)=>n.registerUser&&n.registerUser(...d),["prevent"]))},[o.step==="password"?(a(),l("div",se,[t("span",oe,r(e.$t("modals.createPassword.title")),1),t("p",null,r(e.$t("modals.createPassword.description")),1),t("span",te,r(o.errorMsg),
11),t("div",re,[m(h,{error:!!o.errorMsg,modelValue:o.password,"onUpdate:modelValue":s[1]||(s[1]=d=>o.password=d),onComplete:n.updatePassword,"digit-count":4},null,8,["error","modelValue","onComplete","digit-count"])]),t("button",{class:"button btn-next",type:"button",onClick:s[2]||(s[2]=(...d)=>n.handlePassword&&n.handlePassword(...d))},r(e.$t("modals.createPassword.submit")),1)])):g("",!0),o.step==="passwordRetype"?(a(),l("div",ne,[t("span",ae,r(e.$t("modals.retypePassword.title")),1),t("p",null,r(e.$t("modals.retypePassword.description")),1),t("span",ie,r(o.errorMsg),1),t("div",le,[m(h,{error:!!o.errorMsg,modelValue:o.passwordRetype,"onUpdate:modelValue":s[3]||(s[3]=d=>o.passwordRetype=d),onComplete:n.updatePasswordRetype,"digit-count":4},null,8,["error","modelValue","onComplete","digit-count"])]),t("div",de,[t("label",pe,[w(t("input",{type:"checkbox","onUpdate:modelValue":s[4]||(s[4]=d=>o.rules.checkBoxService=d)},null,512),[[R,o.rules.checkBoxService]]),m(c,{class:"label-link",to:"/public-oferta",target:"_blank"},{default:L(()=>[$(r(e.$t("modals.retypePassword.terms")),1)]),_:1})]),t("label",ue,[w(t("input",{type:"checkbox","onUpdate:modelValue":s[5]||(s[5]=d=>o.rules.checkBoxPrivacy=d)},null,512),[[R,o.rules.checkBoxPrivacy]]),m(c,{class:"label-link",to:"/about/company-policy",target:"_blank"},{default:L(()=>[$(r(e.$t("modals.retypePassword.policy")),1)]),_:1})])]),t("button",{disabled:!o.rules.checkBoxService||!o.rules.checkBoxPrivacy,class:A(["button",{disabled:!o.rules.checkBoxService||!o.rules.checkBoxPrivacy}]),type:"button",onClick:s[6]||(s[6]=(...d)=>n.registerUser&&n.registerUser(...d))},[o.isLoading?(a(),y(i,{key:0,loaderWidth:"10px",color:"white"})):(a(),l("span",ce,r(e.$t("modals.retypePassword.submit")),1))],10,he)])):g("",!0)],32)])}const ge=_(ee,[["render",me],["__scopeId","data-v-01bc8afe"]]),fe=O({components:{BaseAuthInput:v,BaseLoader:f},directives:{maska:C},data(){return{phone:"+996 ",unmaskedValue:"",errorMsg:"",password:"",loading:!1}},created(){setTimeout(()=>{this.$refs.phoneInput.$refs.input.focus()},400)},methods:{...k(I,["close"]),...k(M,["fetchUserProfile"]),...k(M,["storeLoggedInUser"]),...k(T,["removeChatCookie"]),async authLogin(){if(!this.unmaskedValue||!this.password){this.errorMsg=this.$t("modals.login.errors.empty");return}this.loading=!0;try{await this.$axiosApi.post("gazprom-app/auth/login",{contactNumber:"996"+this.unmaskedValue,passCode:this.password,hasBiometric:!1}).then(({data:e})=>{e&&(this.storeLoggedInUser(e.accessToken),this.$router.push("/profile"),this.removeChatCookie(),this.close())}).catch(e=>{e.response&&e.response.data&&e.response.data.message?this.errorMsg=e.response.data.message:this.errorMsg=this.$t("modals.login.errors.wrong")})}catch(e){console.log(e)}this.loading=!1}}}),ke={class:"main-text"},ye={class:"error-msg"},_e={class:"button",type:"submit"},ve={key:1},be={class:"no-accaunt"};function we(e,s,p,b,o,n){const u=v,h=f,c=B("maska");return a(),l("form",{method:"post",onSubmit:s[4]||(s[4]=S((...i)=>e.authLogin&&e.authLogin(...i),["prevent"]))},[t("span",ke,r(e.$t("modals.login.title")),1),t("span",ye,r(e.errorMsg),1),w(m(u,{ref:"phoneInput",error:!!e.errorMsg,appendIcon:"@/assets/images/phone.svg",modelValue:e.phone,"onUpdate:modelValue":s[0]||(s[0]=i=>e.phone=i),label:e.$t("modals.login.inputs.phone")},null,8,["error","modelValue","label"]),[[c,"+996 (###)-###-###","unmaskedValue",{unmasked:!0}]]),m(u,{error:!!e.errorMsg,appendIcon:"@/assets/images/password.svg",inputType:"password",modelValue:e.password,"onUpdate:modelValue":s[1]||(s[1]=i=>e.password=i),label:e.$t("modals.login.inputs.password")},null,8,["error","modelValue","label"]),t("span",{class:"forgot-password",onClick:s[2]||(s[2]=i=>e.$emit("handleChangeScreen",{nextStep:"recovery",isRecovery:!0}))},r(e.$t("modals.login.forgot")),1),t("button",_e,[e.loading?(a(),y(h,{key:0,loaderWidth:"10px",color:"white"})):(a(),l("span",ve,r(e.$t("modals.login.submit")),1))]),t("span",be,[$(r(e.$t("modals.login.noAccount"))+" ",1),t("b",{onClick:s[3]||(s[3]=i=>e.$emit("handleChangeScreen",{nextStep:"sendSMS",isRecovery:!1}))},r(e.$t("modals.login.register")),1)])],32)}const Ce=_(fe,[["render",we],["__scopeId","data-v-3fbe396d"]]),Se={name:"RecoveryForm",components:{BaseAuthInput
1:v,BaseLoader:f},data(){return{phone:"+996 ",msg:"",unmaskedValue:"",isLoading:!1}},created(){setTimeout(()=>{this.$refs.phoneInput.$refs.input.focus()},400)},directives:{maska:C},methods:{async sendPhone(){if(this.unmaskedValue.length!==9){this.msg="Некорректный номер";return}this.$emit("handleChangeScreen",{nextStep:"otp",isRecovery:!0}),this.$emit("changePhoneValue",{phone:this.phone,unmaskedValue:this.unmaskedValue}),this.isLoading=!0;try{await this.$axiosApi.post("gazprom-app/auth/recovery",{contactNumber:"996"+this.unmaskedValue,platform:"Andriod"}).then(({data:e})=>{e&&(this.$emit("handleChangeScreen","otp",!0),this.$emit("changePhoneValue",{phone:this.phone,unmaskedValue:this.unmaskedValue}),this.msg="")})}catch(e){console.log(e),this.msg="Некорректный номер"}this.isLoading=!1}}},Ve={class:"main-text"},Me={key:0,class:"error-msg"},Pe={class:"button",type:"submit"},$e={key:1};function Be(e,s,p,b,o,n){const u=v,h=f,c=B("maska");return a(),l("form",{method:"post",onSubmit:s[1]||(s[1]=S((...i)=>n.sendPhone&&n.sendPhone(...i),["prevent"]))},[t("span",Ve,r(e.$t("modals.recovery.title")),1),t("p",null,r(e.$t("modals.recovery.description")),1),w(m(u,{ref:"phoneInput",error:!!o.msg,appendIcon:"@/assets/images/phone.svg",modelValue:o.phone,"onUpdate:modelValue":s[0]||(s[0]=i=>o.phone=i),label:e.$t("modals.recovery.inputs.phone")},null,8,["error","modelValue","label"]),[[c,"+996 (###)-###-###","unmaskedValue",{unmasked:!0}]]),o.msg?(a(),l("span",Me,r(o.msg),1)):g("",!0),t("button",Pe,[o.isLoading?(a(),y(h,{key:0,loaderWidth:"10px",color:"white"})):(a(),l("span",$e,r(e.$t("modals.recovery.submit")),1))])],32)}const Ie=_(Se,[["render",Be],["__scopeId","data-v-2f70ceac"]]),Re={components:{OTP:j,SendSMS:Y,LoginForm:Ce,RegisterForm:ge,RecoveryForm:Ie,Arrow:U},directives:{maska:C},data(){return{phone:"+996 ",step:"login",otp:"",unmaskedValue:"",errorMsg:"",isRecovery:!1,smsLoading:!1}},computed:{currentComponent(){return{login:"LoginForm",sendSMS:"SendSMS",otp:"OTP",create:"RegisterForm",recovery:"RecoveryForm"}[this.step]},formattedPhone(){return"996"+this.unmaskedValue},isBackVisible(){return this.step==="otp"||this.step==="sendSMS"}},methods:{...k(I,["close"]),handleBackClick(){this.step==="otp"&&!this.isRecovery?this.step="sendSMS":this.step==="otp"&&this.isRecovery?this.step="recovery":this.step="login"},async sendPhone(){this.smsLoading=!0,this.$axiosApi.post("gazprom-app/auth/send-sms",{contactNumber:this.formattedPhone,platform:"Andriod",checkUser:!0}).then(({data:e})=>{e&&(this.step="otp",this.errorMsg="")}).catch(e=>{console.error(e),this.errorMsg=e.response.data.message}).finally(()=>{this.smsLoading=!1})},handleResendCode(){this.sendPhone()},handleChangeScreen({nextStep:e,isRecovery:s}){this.step=e,s===!0&&(this.isRecovery=!0)},setOtpValue(e){this.otp=e},setTelValue({phone:e,unmaskedValue:s}){this.phone=e,this.unmaskedValue=s}}},Le={class:"wrap"};function Ae(e,s,p,b,o,n){const u=P("Arrow");return a(),l("div",Le,[n.isBackVisible?(a(),y(u,{key:0,onClick:n.handleBackClick,class:"arrow-back"},null,8,["onClick"])):g("",!0),(a(),y(N(n.currentComponent),{onHandleChangeScreen:n.handleChangeScreen,onChangePhoneValue:n.setTelValue,onSendSMS:n.sendPhone,onResendCode:n.handleResendCode,onSetOtpValue:n.setOtpValue,phone:o.phone,unmaskedValue:n.formattedPhone,otpCode:o.otp,msg:o.errorMsg,recovery:o.isRecovery,loadingPhone:o.smsLoading},null,40,["onHandleChangeScreen","onChangePhoneValue","onSendSMS","onResendCode","onSetOtpValue","phone","unmaskedValue","otpCode","msg","recovery","loadingPhone"]))])}const Ne=_(Re,[["render",Ae],["__scopeId","data-v-fd5374c5"]]);export{Ne as default};

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.