tweb/public/53.40d79ab9d14e8d83cf01.chu...

2 lines
12 KiB
JavaScript
Raw Permalink Normal View History

2023-03-01 13:58:47 +01:00
"use strict";(this.webpackChunktweb=this.webpackChunktweb||[]).push([[53,63,709,392,810,641,776],{9638:(e,t,n)=>{n.d(t,{Z:()=>p});var a=n(3910),o=n(2738),r=n(4541),i=n(2325),s=n(3512),d=n(4494),l=n(279);let c,u=!1;function p(e){u||(c||(c=s.Z.managers.apiManager.getConfig().then((e=>e.suggested_lang_code!==i.ZP.lastRequestedLangCode?Promise.all([e,i.ZP.getStrings(e.suggested_lang_code,["Login.ContinueOnLanguage"]),i.ZP.getCacheLangPack()]):[])))).then((([t,n])=>{if(!t)return;const c=[];n.forEach((e=>{const t=i.ZP.strings.get(e.key);t&&(c.push(t),i.ZP.strings.set(e.key,e))}));const p="Login.ContinueOnLanguage",h=(0,d.Z)("btn-primary btn-secondary btn-primary-transparent primary",{text:p});h.lastElementChild.classList.remove("i18n"),(0,r.Z)({text:[i.ZP.format(p,!0)]}).then((()=>{window.requestAnimationFrame((()=>{e.append(h)}))})),s.Z.addEventListener("language_change",(()=>{h.remove()}),{once:!0}),c.forEach((e=>{i.ZP.strings.set(e.key,e)})),(0,o.fc)(h,(e=>{(0,a.Z)(e),u=!0,h.disabled=!0,(0,l.y)(h),i.ZP.getLangPack(t.suggested_lang_code)}))}))}},6392:(e,t,n)=>{n.r(t),n.d(t,{default:()=>L});var a=n(4755),o=n(4874),r=n(810),i=n(3083),s=n(4489),d=n(2325),l=n(144),c=n(5565),u=n(3512),p=n(1447),h=n(2521),g=n(2738);let m,y,v,f,_=null,Z=null,E=null;const b=()=>{setTimeout((()=>{null==v||v.remove(),null==f||f.remove()}),300)},S=new o.Z("page-authCode",!0,(()=>{S.pageEl.querySelector(".input-wrapper").append(y.container);const e=S.pageEl.querySelector(".phone-edit");(0,g.fc)(e,(()=>r.default.mount()))}),(e=>{if(_=e,Z){m.value="";const e=document.createEvent("HTMLEvents");e.initEvent("input",!1,!0),m.dispatchEvent(e)}else Z=S.pageEl.getElementsByClassName("phone")[0],E=S.pageEl.getElementsByClassName("sent-type")[0];const t=_.type.length;let o,r;y||(y=new s.Z({label:"Code",name:(0,l.a)(),length:t,onFill:e=>{(e=>{m.setAttribute("disabled","true");const t={phone_number:_.phone_number,phone_code_hash:_.phone_code_hash,phone_code:e};u.Z.managers.apiManager.invokeApi("auth.signIn",t,{ignoreErrors:!0}).then((e=>{switch(e._){case"auth.authorization":u.Z.managers.apiManager.setUser(e.user),n.e(781).then(n.bind(n,5436)).then((e=>{e.default.mount()})),b();break;case"auth.authorizationSignUpRequired":n.e(813).then(n.bind(n,8339)).then((e=>{e.default.mount({phone_number:_.phone_number,phone_code_hash:_.phone_code_hash})})),b()}})).catch((e=>{return t=void 0,a=void 0,r=function*(){let t=!1;switch(e.type){case"SESSION_PASSWORD_NEEDED":t=!0,e.handled=!0,yield(yield n.e(442).then(n.bind(n,9437))).default.mount(),setTimeout((()=>{m.value=""}),300);break;case"PHONE_CODE_EXPIRED":m.classList.add("error"),(0,c.Z)(y.label,(0,d.ag)("PHONE_CODE_EXPIRED"));break;case"PHONE_CODE_EMPTY":case"PHONE_CODE_INVALID":m.classList.add("error"),(0,c.Z)(y.label,(0,d.ag)("PHONE_CODE_INVALID"));break;default:y.label.innerText=e.type}t||y.select(),m.removeAttribute("disabled")},new((o=void 0)||(o=Promise))((function(e,n){function i(e){try{d(r.next(e))}catch(e){n(e)}}function s(e){try{d(r.throw(e))}catch(e){n(e)}}function d(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(i,s)}d((r=r.apply(t,a||[])).next())}));var t,a,o,r}))})(e)}}),m=y.input),y.options.length=t,Z.innerText=_.phone_number;const g=_.type;switch(g._){case"auth.sentCodeTypeSms":o="Login.Code.SentSms";break;case"auth.sentCodeTypeApp":o="Login.Code.SentInApp";break;case"auth.sentCodeTypeCall":o="Login.Code.SentCall";break;case"auth.sentCodeTypeFragmentSms":o="PhoneNumber.Code.Fragment.Info";const e=document.createElement("a");(0,h.Z)(e),e.href=g.url,r=[e];break;default:o="Login.Code.SentUnknown",r=[g._]}return(0,c.Z)(E,(0,d.ag)(o,r)),u.Z.managers.appStateManager.pushToState("authState",{_:"authStateAuthCode",sentCode:e}),(()=>{const e=S.pageEl.querySelector(".auth-image"),t=a.Z.isMobile?100:166;if("auth.sentCodeTypeFragmentSms"===_.type._){e.firstElementChild&&(null==v||v.remove(),v=void 0,e.replaceChildren());const n=document.createElement("div");return n.classList.add("media-sticker-wrapper"),e.append(n),p.Z.loadAnimationAsAsset({container:n,loop:!0,autoplay:!0,width:t,h
2023-03-03 16:47:48 +01:00
//# sourceMappingURL=53.40d79ab9d14e8d83cf01.chunk.js.map