Kufar v3.2.0版本的 MD5 值为:6a4d203db1c561c7e3bcd50d23fed59f
以下内容为反编译后的 LoginFragment.java 源代码,内容仅作参考
package by.kufar.signup.ui.login;
import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.text.Editable;
import android.text.SpannableStringBuilder;
import android.text.TextPaint;
import android.text.method.LinkMovementMethod;
import android.text.method.PasswordTransformationMethod;
import android.text.style.ClickableSpan;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
import androidx.autofill.HintConstants;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.FragmentActivity;
import androidx.graphics.result.ActivityResult;
import androidx.graphics.result.ActivityResultCallback;
import androidx.graphics.result.ActivityResultLauncher;
import androidx.graphics.result.contract.ActivityResultContracts;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider;
import by.kufar.core.android.fragment.BaseFragment;
import by.kufar.re.ui.widget.InputView;
import by.kufar.re.ui.widget.webview.WebViewActivity;
import by.kufar.sharedmodels.entity.SpanContent;
import by.kufar.signup.R$drawable;
import by.kufar.signup.R$id;
import by.kufar.signup.R$layout;
import by.kufar.signup.R$string;
import by.kufar.signup.ui.SignupActivity;
import by.kufar.signup.ui.activation.ActivationActivity;
import by.kufar.signup.ui.forgetpassword.ChangePasswordActivity;
import by.kufar.signup.ui.login.LoginVM;
import by.kufar.signup.ui.loginsms.LoginSmsActivity;
import by.kufar.signup.ui.widget.SignupAdvantagesView;
import com.applovin.sdk.AppLovinEventTypes;
import com.google.android.material.snackbar.Snackbar;
import db.i;
import fn.d;
import gn.a;
import in.f;
import in.g;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.g0;
import kotlin.jvm.internal.o0;
import kotlin.reflect.KProperty;
import kotlinx.coroutines.q0;
@Metadata(d1 = {"\u0000¶\u0001\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010\u0002\n\u0002\b\t\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u0003\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0012\n\u0002\u0018\u0002\n\u0002\b\n\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0013\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\b\u0018\u0000 \u0091\u00012\u00020\u0001:\u0002\u0092\u0001B\t¢\u0006\u0006\b\u008f\u0001\u0010\u0090\u0001J\u0010\u0010\u0005\u001a\u00020\u00042\u0006\u0010\u0003\u001a\u00020\u0002H\u0002J\b\u0010\u0006\u001a\u00020\u0004H\u0002J\b\u0010\u0007\u001a\u00020\u0004H\u0002J\b\u0010\b\u001a\u00020\u0004H\u0002J\b\u0010\t\u001a\u00020\u0004H\u0002J\b\u0010\n\u001a\u00020\u0004H\u0002J\b\u0010\u000b\u001a\u00020\u0004H\u0002J\b\u0010\f\u001a\u00020\u0004H\u0002J\b\u0010\r\u001a\u00020\u0004H\u0002J\n\u0010\u000f\u001a\u0004\u0018\u00010\u000eH\u0002J\u0010\u0010\u0012\u001a\u00020\u00042\u0006\u0010\u0011\u001a\u00020\u0010H\u0002J\b\u0010\u0013\u001a\u00020\u0004H\u0002J\u0010\u0010\u0016\u001a\u00020\u00042\u0006\u0010\u0015\u001a\u00020\u0014H\u0002J&\u0010\u001e\u001a\u0004\u0018\u00010\u001d2\u0006\u0010\u0018\u001a\u00020\u00172\b\u0010\u001a\u001a\u0004\u0018\u00010\u00192\b\u0010\u001c\u001a\u0004\u0018\u00010\u001bH\u0016J\u0012\u0010\u001f\u001a\u00020\u00042\b\u0010\u001c\u001a\u0004\u0018\u00010\u001bH\u0016J\b\u0010 \u001a\u00020\u0004H\u0016J\b\u0010!\u001a\u00020\u0004H\u0016J\b\u0010\"\u001a\u00020\u0004H\u0016J\u001a\u0010$\u001a\u00020\u00042\u0006\u0010#\u001a\u00020\u001d2\b\u0010\u001c\u001a\u0004\u0018\u00010\u001bH\u0016J\"\u0010*\u001a\u00020\u00042\u0006\u0010&\u001a\u00020%2\u0006\u0010'\u001a\u00020%2\b\u0010)\u001a\u0004\u0018\u00010(H\u0016R\"\u0010,\u001a\u00020+8\u0006@\u0006X\u0087.¢\u0006\u0012\n\u0004\b,\u0010-\u001a\u0004\b.\u0010/\"\u0004\b0\u00101R\"\u00103\u001a\u0002028\u0006@\u0006X\u0087.¢\u0006\u0012\n\u0004\b3\u00104\u001a\u0004\b5\u00106\"\u0004\b7\u00108R\"\u0010:\u001a\u0002098\u0006@\u0006X\u0087.¢\u0006\u0012\n\u0004\b:\u0010;\u001a\u0004\b<\u0010=\"\u0004\b>\u0010?R\"\u0010A\u001a\u00020@8\u0006@\u0006X\u0087.¢\u0006\u0012\n\u0004\bA\u0010B\u001a\u0004\bC\u0010D\"\u0004\bE\u0010FR\"\u0010H\u001a\u00020G8\u0006@\u0006X\u0087.¢\u0006\u0012\n\u0004\bH\u0010I\u001a\u0004\bJ\u0010K\"\u0004\bL\u0010MR\u001b\u0010S\u001a\u00020N8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\bO\u0010P\u001a\u0004\bQ\u0010RR\u001b\u0010W\u001a\u00020\u001d8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\bT\u0010P\u001a\u0004\bU\u0010VR\u001b\u0010Z\u001a\u00020\u001d8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\bX\u0010P\u001a\u0004\bY\u0010VR\u001b\u0010]\u001a\u00020\u001d8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b[\u0010P\u001a\u0004\b\\\u0010VR\u001b\u0010`\u001a\u00020\u001d8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b^\u0010P\u001a\u0004\b_\u0010VR\u001b\u0010e\u001a\u00020a8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\bb\u0010P\u001a\u0004\bc\u0010dR\u001b\u0010h\u001a\u00020N8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\bf\u0010P\u001a\u0004\bg\u0010RR\u001b\u0010k\u001a\u00020a8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\bi\u0010P\u001a\u0004\bj\u0010dR\u001b\u0010p\u001a\u00020l8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\bm\u0010P\u001a\u0004\bn\u0010oR\u001b\u0010u\u001a\u00020q8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\br\u0010P\u001a\u0004\bs\u0010tR\u001b\u0010x\u001a\u00020\u001d8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\bv\u0010P\u001a\u0004\bw\u0010VR\u001b\u0010{\u001a\u00020l8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\by\u0010P\u001a\u0004\bz\u0010oR\u001b\u0010~\u001a\u00020\u001d8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b|\u0010P\u001a\u0004\b}\u0010VR\u001d\u0010\u0081\u0001\u001a\u00020\u001d8BX\u0082\u0084\u0002¢\u0006\r\n\u0004\b\u007f\u0010P\u001a\u0005\b\u0080\u0001\u0010VR\u001e\u0010\u0084\u0001\u001a\u00020l8BX\u0082\u0084\u0002¢\u0006\u000e\n\u0005\b\u0082\u0001\u0010P\u001a\u0005\b\u0083\u0001\u0010oR\u001e\u0010\u0086\u0001\u001a\t\u0012\u0004\u0012\u00020\u00040\u0085\u00018\u0002X\u0082\u0004¢\u0006\b\n\u0006\b\u0086\u0001\u0010\u0087\u0001R\u001a\u0010\u0089\u0001\u001a\u00030\u0088\u00018\u0002@\u0002X\u0082.¢\u0006\b\n\u0006\b\u0089\u0001\u0010\u008a\u0001R'\u0010\u008d\u0001\u001a\u0012\u0012\r\u0012\u000b \u008c\u0001*\u0004\u0018\u00010(0(0\u008b\u00018\u0002X\u0082\u0004¢\u0006\b\n\u0006\b\u008d\u0001\u0010\u008e\u0001¨\u0006\u0093\u0001"}, d2 = {"Lby/kufar/signup/ui/login/LoginFragment;", "Lby/kufar/core/android/fragment/BaseFragment;", "", "account", "", "silentLoginGoogle", "setupViewModel", "setupView", "addCredentialsFocusChangeListener", "removeCredentialsFocusChangeListener", "setupActionsButtonListeners", "setupForgetPassword", "showPassword", "hidePassword", "Lby/kufar/signup/ui/SignupActivity;", "signupActivity", "Lby/kufar/signup/ui/login/LoginVM$b;", "state", "showState", "finish", "", "error", "showError", "Landroid/view/LayoutInflater;", "inflater", "Landroid/view/ViewGroup;", "container", "Landroid/os/Bundle;", "savedInstanceState", "Landroid/view/View;", "onCreateView", "onCreate", "onResume", "onPause", "onInject", "view", "onViewCreated", "", "requestCode", "resultCode", "Landroid/content/Intent;", "data", "onActivityResult", "Landroidx/lifecycle/ViewModelProvider$Factory;", "viewModelFactory", "Landroidx/lifecycle/ViewModelProvider$Factory;", "getViewModelFactory", "()Landroidx/lifecycle/ViewModelProvider$Factory;", "setViewModelFactory", "(Landroidx/lifecycle/ViewModelProvider$Factory;)V", "Ldn/a;", "signupTracker", "Ldn/a;", "getSignupTracker", "()Ldn/a;", "setSignupTracker", "(Ldn/a;)V", "Lin/b;", "credentialsClient", "Lin/b;", "getCredentialsClient", "()Lin/b;", "setCredentialsClient", "(Lin/b;)V", "Lcb/b;", "mediator", "Lcb/b;", "getMediator", "()Lcb/b;", "setMediator", "(Lcb/b;)V", "Lin/f;", "socialLoginClient", "Lin/f;", "getSocialLoginClient", "()Lin/f;", "setSocialLoginClient", "(Lin/f;)V", "Landroid/widget/Button;", "login$delegate", "Li6/c;", "getLogin", "()Landroid/widget/Button;", AppLovinEventTypes.USER_LOGGED_IN, "loginApple$delegate", "getLoginApple", "()Landroid/view/View;", "loginApple", "loginGoogle$delegate", "getLoginGoogle", "loginGoogle", "loginMailRu$delegate", "getLoginMailRu", "loginMailRu", "loginYandex$delegate", "getLoginYandex", "loginYandex", "Lby/kufar/re/ui/widget/InputView;", "email$delegate", "getEmail", "()Lby/kufar/re/ui/widget/InputView;", "email", "help$delegate", "getHelp", "help", "password$delegate", "getPassword", HintConstants.AUTOFILL_HINT_PASSWORD, "Landroid/widget/TextView;", "forgetPassword$delegate", "getForgetPassword", "()Landroid/widget/TextView;", "forgetPassword", "Lby/kufar/signup/ui/widget/SignupAdvantagesView;", "advantages$delegate", "getAdvantages", "()Lby/kufar/signup/ui/widget/SignupAdvantagesView;", "advantages", "loginSmsContainer$delegate", "getLoginSmsContainer", "loginSmsContainer", "loginSmsText$delegate", "getLoginSmsText", "loginSmsText", "topMessage$delegate", "getTopMessage", "topMessage", "topError$delegate", "getTopError", "topError", "topErrorText$delegate", "getTopErrorText", "topErrorText", "Lkotlin/Function0;", "retryClickListener", "Lkotlin/jvm/functions/Function0;", "Lby/kufar/signup/ui/login/LoginVM;", "loginVM", "Lby/kufar/signup/ui/login/LoginVM;", "Landroidx/activity/result/ActivityResultLauncher;", "kotlin.jvm.PlatformType", "startForResult", "Landroidx/activity/result/ActivityResultLauncher;", "<init>", "()V", "Companion", "a", "feature-signup_googleRelease"}, k = 1, mv = {1, 9, 0})
public final class LoginFragment extends BaseFragment {
static final KProperty<Object>[] $$delegatedProperties = {o0.i(new g0(LoginFragment.class, AppLovinEventTypes.USER_LOGGED_IN, "getLogin()Landroid/widget/Button;", 0)), o0.i(new g0(LoginFragment.class, "loginApple", "getLoginApple()Landroid/view/View;", 0)), o0.i(new g0(LoginFragment.class, "loginGoogle", "getLoginGoogle()Landroid/view/View;", 0)), o0.i(new g0(LoginFragment.class, "loginMailRu", "getLoginMailRu()Landroid/view/View;", 0)), o0.i(new g0(LoginFragment.class, "loginYandex", "getLoginYandex()Landroid/view/View;", 0)), o0.i(new g0(LoginFragment.class, "email", "getEmail()Lby/kufar/re/ui/widget/InputView;", 0)), o0.i(new g0(LoginFragment.class, "help", "getHelp()Landroid/widget/Button;", 0)), o0.i(new g0(LoginFragment.class, HintConstants.AUTOFILL_HINT_PASSWORD, "getPassword()Lby/kufar/re/ui/widget/InputView;", 0)), o0.i(new g0(LoginFragment.class, "forgetPassword", "getForgetPassword()Landroid/widget/TextView;", 0)), o0.i(new g0(LoginFragment.class, "advantages", "getAdvantages()Lby/kufar/signup/ui/widget/SignupAdvantagesView;", 0)), o0.i(new g0(LoginFragment.class, "loginSmsContainer", "getLoginSmsContainer()Landroid/view/View;", 0)), o0.i(new g0(LoginFragment.class, "loginSmsText", "getLoginSmsText()Landroid/widget/TextView;", 0)), o0.i(new g0(LoginFragment.class, "topMessage", "getTopMessage()Landroid/view/View;", 0)), o0.i(new g0(LoginFragment.class, "topError", "getTopError()Landroid/view/View;", 0)), o0.i(new g0(LoginFragment.class, "topErrorText", "getTopErrorText()Landroid/widget/TextView;", 0))};
public static final Companion INSTANCE = new Companion(null);
private static final int GOOGLE_SMART_LOCK = 1010;
private static final int MFA_REQUEST_CODE = 1011;
public in.b credentialsClient;
private LoginVM loginVM;
public cb.b mediator;
public dn.a signupTracker;
public in.f socialLoginClient;
private final ActivityResultLauncher<Intent> startForResult;
public ViewModelProvider.Factory viewModelFactory;
private final i6.c login = bindView(R$id.f17434t);
private final i6.c loginApple = bindView(R$id.f17418d);
private final i6.c loginGoogle = bindView(R$id.f17432r);
private final i6.c loginMailRu = bindView(R$id.f17437w);
private final i6.c loginYandex = bindView(R$id.f17417c0);
private final i6.c email = bindView(R$id.f17425k);
private final i6.c help = bindView(R$id.f17433s);
private final i6.c password = bindView(R$id.f17440z);
private final i6.c forgetPassword = bindView(R$id.f17430p);
private final i6.c advantages = bindView(R$id.f17416c);
private final i6.c loginSmsContainer = bindView(R$id.f17435u);
private final i6.c loginSmsText = bindView(R$id.f17436v);
private final i6.c topMessage = bindView(R$id.f17413a0);
private final i6.c topError = bindView(R$id.Y);
private final i6.c topErrorText = bindView(R$id.Z);
private final Function0<Unit> retryClickListener = new e();
@Metadata(d1 = {"\u0000\u0016\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0002\b\u0006\b\u0086\u0003\u0018\u00002\u00020\u0001B\t\b\u0002¢\u0006\u0004\b\b\u0010\tJ\u0006\u0010\u0003\u001a\u00020\u0002R\u0014\u0010\u0005\u001a\u00020\u00048\u0002X\u0082T¢\u0006\u0006\n\u0004\b\u0005\u0010\u0006R\u0014\u0010\u0007\u001a\u00020\u00048\u0002X\u0082T¢\u0006\u0006\n\u0004\b\u0007\u0010\u0006¨\u0006\n"}, d2 = {"Lby/kufar/signup/ui/login/LoginFragment$a;", "", "Lby/kufar/signup/ui/login/LoginFragment;", "a", "", "GOOGLE_SMART_LOCK", "I", "MFA_REQUEST_CODE", "<init>", "()V", "feature-signup_googleRelease"}, k = 1, mv = {1, 9, 0})
public static final class Companion {
public Companion() {
}
public Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
public final LoginFragment a() {
return new LoginFragment();
}
}
@Metadata(d1 = {"\u0000\n\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0000\u0010\u0002\u001a\u00020\u0001*\u00020\u0000H\u008a@"}, d2 = {"Lkotlinx/coroutines/q0;", "", "<anonymous>"}, k = 3, mv = {1, 9, 0})
@l80.f(c = "by.kufar.signup.ui.login.LoginFragment$onActivityResult$1", f = "LoginFragment.kt", l = {155}, m = "invokeSuspend")
public static final class b extends l80.l implements Function2<q0, j80.d<? super Unit>, Object> {
public int f17684b;
public final int f17686d;
public final int f17687e;
public final Intent f17688f;
@Metadata(d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0001\u001a\u00020\u0000H\u008a@¢\u0006\u0004\b\u0003\u0010\u0004"}, d2 = {"Lin/f$b;", "it", "", "a", "(Lin/f$b;Lj80/d;)Ljava/lang/Object;"}, k = 3, mv = {1, 9, 0})
public static final class a<T> implements kotlinx.coroutines.flow.h {
public final LoginFragment f17689b;
public a(LoginFragment loginFragment) {
this.f17689b = loginFragment;
}
@Override
public final Object emit(f.b bVar, j80.d<? super Unit> dVar) {
LoginVM loginVM = this.f17689b.loginVM;
if (loginVM == null) {
kotlin.jvm.internal.s.B("loginVM");
loginVM = null;
}
loginVM.loginSocialNetwork(bVar);
return Unit.f82492a;
}
}
public b(int i11, int i12, Intent intent, j80.d<? super b> dVar) {
super(2, dVar);
this.f17686d = i11;
this.f17687e = i12;
this.f17688f = intent;
}
@Override
public final j80.d<Unit> create(Object obj, j80.d<?> dVar) {
return new b(this.f17686d, this.f17687e, this.f17688f, dVar);
}
@Override
public final Object invokeSuspend(Object obj) {
Object f11 = k80.c.f();
int i11 = this.f17684b;
if (i11 != 0) {
if (i11 == 1) {
d80.q.b(obj);
} else {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
} else {
d80.q.b(obj);
kotlinx.coroutines.flow.g<f.b> h11 = LoginFragment.this.getSocialLoginClient().h(this.f17686d, this.f17687e, this.f17688f);
a aVar = new a(LoginFragment.this);
this.f17684b = 1;
if (h11.collect(aVar, this) == f11) {
return f11;
}
}
return Unit.f82492a;
}
@Override
public final Object mo1invoke(q0 q0Var, j80.d<? super Unit> dVar) {
return ((b) create(q0Var, dVar)).invokeSuspend(Unit.f82492a);
}
}
@Metadata(d1 = {"\u0000\u000e\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u000e\n\u0000\u0010\u0000\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\u0003H\n¢\u0006\u0002\b\u0004"}, d2 = {"<anonymous>", "", "it", "", "invoke"}, k = 3, mv = {1, 9, 0}, xi = 48)
public static final class c extends kotlin.jvm.internal.u implements Function1<String, Unit> {
public c() {
super(1);
}
@Override
public Unit invoke(String str) {
invoke2(str);
return Unit.f82492a;
}
public final void invoke2(String it) {
kotlin.jvm.internal.s.j(it, "it");
LoginFragment.this.silentLoginGoogle(it);
}
}
@Metadata(d1 = {"\u0000\u0010\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002\u0010\u0004\u001a\u00020\u00032\u0006\u0010\u0001\u001a\u00020\u00002\u0006\u0010\u0002\u001a\u00020\u0000H\n¢\u0006\u0004\b\u0004\u0010\u0005"}, d2 = {"", "s", "s2", "", "a", "(Ljava/lang/String;Ljava/lang/String;)V"}, k = 3, mv = {1, 9, 0})
public static final class d extends kotlin.jvm.internal.u implements Function2<String, String, Unit> {
public d() {
super(2);
}
public final void a(String s11, String s22) {
kotlin.jvm.internal.s.j(s11, "s");
kotlin.jvm.internal.s.j(s22, "s2");
LoginFragment.this.getEmail().setText(s11);
LoginFragment.this.getPassword().setText(s22);
LoginVM loginVM = LoginFragment.this.loginVM;
if (loginVM == null) {
kotlin.jvm.internal.s.B("loginVM");
loginVM = null;
}
loginVM.login(s11, s22);
}
@Override
public Unit mo1invoke(String str, String str2) {
a(str, str2);
return Unit.f82492a;
}
}
@Metadata(d1 = {"\u0000\b\n\u0000\n\u0002\u0010\u0002\n\u0000\u0010\u0000\u001a\u00020\u0001H\n¢\u0006\u0002\b\u0002"}, d2 = {"<anonymous>", "", "invoke"}, k = 3, mv = {1, 9, 0}, xi = 48)
public static final class e extends kotlin.jvm.internal.u implements Function0<Unit> {
public e() {
super(0);
}
@Override
public Unit invoke() {
invoke2();
return Unit.f82492a;
}
public final void invoke2() {
LoginVM loginVM = LoginFragment.this.loginVM;
if (loginVM == null) {
kotlin.jvm.internal.s.B("loginVM");
loginVM = null;
}
loginVM.login(LoginFragment.this.getEmail().getEditText().getText().toString(), LoginFragment.this.getPassword().getEditText().getText().toString());
}
}
@Metadata(k = 3, mv = {1, 9, 0}, xi = 48)
public static final class f implements Observer, kotlin.jvm.internal.m {
public final Function1 f17693b;
public f(Function1 function) {
kotlin.jvm.internal.s.j(function, "function");
this.f17693b = function;
}
public final boolean equals(Object obj) {
if (!(obj instanceof Observer) || !(obj instanceof kotlin.jvm.internal.m)) {
return false;
}
return kotlin.jvm.internal.s.e(getFunctionDelegate(), ((kotlin.jvm.internal.m) obj).getFunctionDelegate());
}
@Override
public final d80.f<?> getFunctionDelegate() {
return this.f17693b;
}
public final int hashCode() {
return getFunctionDelegate().hashCode();
}
@Override
public final void onChanged(Object obj) {
this.f17693b.invoke(obj);
}
}
@Metadata(d1 = {"\u0000\u001d\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\u0010\u0010\u0005\u001a\u00020\u00042\u0006\u0010\u0003\u001a\u00020\u0002H\u0016J\u0010\u0010\b\u001a\u00020\u00042\u0006\u0010\u0007\u001a\u00020\u0006H\u0016¨\u0006\t"}, d2 = {"by/kufar/signup/ui/login/LoginFragment$g", "Landroid/text/style/ClickableSpan;", "Landroid/text/TextPaint;", "ds", "", "updateDrawState", "Landroid/view/View;", "widget", "onClick", "core-android_googleRelease"}, k = 1, mv = {1, 9, 0})
public static final class g extends ClickableSpan {
public final Integer f17694b;
public final boolean f17695c;
public final LoginFragment f17696d;
public g(Integer num, boolean z11, LoginFragment loginFragment) {
this.f17694b = num;
this.f17695c = z11;
this.f17696d = loginFragment;
}
@Override
public void onClick(View widget) {
kotlin.jvm.internal.s.j(widget, "widget");
this.f17696d.getSignupTracker().q();
LoginVM loginVM = this.f17696d.loginVM;
if (loginVM == null) {
kotlin.jvm.internal.s.B("loginVM");
loginVM = null;
}
loginVM.loginSms(this.f17696d.getEmail().getEditText().getText().toString());
}
@Override
public void updateDrawState(TextPaint ds2) {
kotlin.jvm.internal.s.j(ds2, "ds");
Integer num = this.f17694b;
if (num != null) {
ds2.setColor(num.intValue());
}
ds2.setUnderlineText(this.f17695c);
}
}
@Metadata(d1 = {"\u0000\u0017\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\u0012\u0010\u0005\u001a\u00020\u00042\b\u0010\u0003\u001a\u0004\u0018\u00010\u0002H\u0016¨\u0006\u0006"}, d2 = {"by/kufar/signup/ui/login/LoginFragment$h", "Lh5/a;", "Landroid/text/Editable;", "s", "", "afterTextChanged", "feature-signup_googleRelease"}, k = 1, mv = {1, 9, 0})
public static final class h extends h5.a {
public h() {
}
@Override
public void afterTextChanged(Editable s11) {
boolean z11;
if (LoginFragment.this.getTopError().getVisibility() == 0) {
z11 = true;
} else {
z11 = false;
}
if (z11) {
LoginFragment.this.getTopError().setVisibility(8);
LoginFragment.this.getTopMessage().setVisibility(8);
}
LoginVM loginVM = LoginFragment.this.loginVM;
if (loginVM == null) {
kotlin.jvm.internal.s.B("loginVM");
loginVM = null;
}
loginVM.validateCredentials(LoginFragment.this.getEmail().getEditText().getText().toString(), LoginFragment.this.getPassword().getEditText().getText().toString());
}
}
@Metadata(d1 = {"\u0000\u0014\n\u0002\u0018\u0002\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002\u0010\u0005\u001a\u00020\u00042\u001e\u0010\u0003\u001a\u001a\u0012\u0006\u0012\u0004\u0018\u00010\u0001 \u0002*\f\u0012\u0006\u0012\u0004\u0018\u00010\u0001\u0018\u00010\u00000\u0000H\n¢\u0006\u0004\b\u0005\u0010\u0006"}, d2 = {"Lby/kufar/core/android/arch/a;", "", "kotlin.jvm.PlatformType", "it", "", "a", "(Lby/kufar/core/android/arch/a;)V"}, k = 3, mv = {1, 9, 0})
public static final class i extends kotlin.jvm.internal.u implements Function1<by.kufar.core.android.arch.a<? extends String>, Unit> {
public i() {
super(1);
}
public final void a(by.kufar.core.android.arch.a<String> aVar) {
Context context;
if (aVar.getHasBeenHandled() || (context = LoginFragment.this.getContext()) == null) {
return;
}
LoginFragment.this.startForResult.launch(LoginSmsActivity.INSTANCE.a(context, aVar.a()));
}
@Override
public Unit invoke(by.kufar.core.android.arch.a<? extends String> aVar) {
a(aVar);
return Unit.f82492a;
}
}
@Metadata(d1 = {"\u0000\u0014\n\u0002\u0018\u0002\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002\u0010\u0005\u001a\u00020\u00042\u001a\u0010\u0003\u001a\u0016\u0012\u0004\u0012\u00020\u0001 \u0002*\n\u0012\u0004\u0012\u00020\u0001\u0018\u00010\u00000\u0000H\n¢\u0006\u0004\b\u0005\u0010\u0006"}, d2 = {"Lby/kufar/core/android/arch/a;", "", "kotlin.jvm.PlatformType", "it", "", "a", "(Lby/kufar/core/android/arch/a;)V"}, k = 3, mv = {1, 9, 0})
public static final class j extends kotlin.jvm.internal.u implements Function1<by.kufar.core.android.arch.a<? extends Integer>, Unit> {
public j() {
super(1);
}
public final void a(by.kufar.core.android.arch.a<Integer> aVar) {
Integer a11 = aVar.a();
if (a11 != null) {
Snackbar s11 = ek.b.s(ek.b.f75340a, LoginFragment.this.getView(), LoginFragment.this.getString(a11.intValue()), 0, null, 0, null, 56, null);
if (s11 != null) {
s11.W();
}
}
}
@Override
public Unit invoke(by.kufar.core.android.arch.a<? extends Integer> aVar) {
a(aVar);
return Unit.f82492a;
}
}
@Metadata(d1 = {"\u0000\u0014\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002\u0010\u0005\u001a\u00020\u00042\u001a\u0010\u0003\u001a\u0016\u0012\u0004\u0012\u00020\u0001 \u0002*\n\u0012\u0004\u0012\u00020\u0001\u0018\u00010\u00000\u0000H\n¢\u0006\u0004\b\u0005\u0010\u0006"}, d2 = {"Lby/kufar/core/android/arch/a;", "Lby/kufar/sharedmodels/entity/SpanContent;", "kotlin.jvm.PlatformType", "it", "", "a", "(Lby/kufar/core/android/arch/a;)V"}, k = 3, mv = {1, 9, 0})
public static final class k extends kotlin.jvm.internal.u implements Function1<by.kufar.core.android.arch.a<? extends SpanContent>, Unit> {
@Metadata(d1 = {"\u0000\u000e\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u000e\n\u0000\u0010\u0000\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\u0003H\n¢\u0006\u0002\b\u0004"}, d2 = {"<anonymous>", "", "link", "", "invoke"}, k = 3, mv = {1, 9, 0}, xi = 48)
public static final class a extends kotlin.jvm.internal.u implements Function1<String, Unit> {
public final LoginFragment f17701d;
public a(LoginFragment loginFragment) {
super(1);
this.f17701d = loginFragment;
}
@Override
public Unit invoke(String str) {
invoke2(str);
return Unit.f82492a;
}
public final void invoke2(String link) {
kotlin.jvm.internal.s.j(link, "link");
Context context = this.f17701d.getContext();
if (context != null) {
this.f17701d.startActivity(WebViewActivity.Companion.b(WebViewActivity.INSTANCE, context, "https://support.kufar.by/hc/ru", false, null, false, false, 60, null));
}
}
}
public k() {
super(1);
}
public final void a(by.kufar.core.android.arch.a<SpanContent> aVar) {
boolean z11;
int i11;
if (aVar.getHasBeenHandled()) {
return;
}
SpanContent a11 = aVar.a();
SignupActivity signupActivity = LoginFragment.this.signupActivity();
if (signupActivity != null) {
signupActivity.showContent();
}
View topError = LoginFragment.this.getTopError();
boolean z12 = true;
int i12 = 0;
if (a11 != null) {
z11 = true;
} else {
z11 = false;
}
if (z11) {
i11 = 0;
} else {
i11 = 8;
}
topError.setVisibility(i11);
View topMessage = LoginFragment.this.getTopMessage();
if (a11 == null) {
z12 = false;
}
if (!z12) {
i12 = 8;
}
topMessage.setVisibility(i12);
LoginFragment.this.getLoginSmsContainer().setVisibility(8);
LoginFragment.this.getTopErrorText().setText(o5.d.c(o5.d.f87043a, a11, true, null, new a(LoginFragment.this), 4, null));
}
@Override
public Unit invoke(by.kufar.core.android.arch.a<? extends SpanContent> aVar) {
a(aVar);
return Unit.f82492a;
}
}
@Metadata(d1 = {"\u0000\u0014\n\u0002\u0018\u0002\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002\u0010\u0005\u001a\u00020\u00042\u001a\u0010\u0003\u001a\u0016\u0012\u0004\u0012\u00020\u0001 \u0002*\n\u0012\u0004\u0012\u00020\u0001\u0018\u00010\u00000\u0000H\n¢\u0006\u0004\b\u0005\u0010\u0006"}, d2 = {"Lby/kufar/core/android/arch/a;", "", "kotlin.jvm.PlatformType", "it", "", "a", "(Lby/kufar/core/android/arch/a;)V"}, k = 3, mv = {1, 9, 0})
public static final class l extends kotlin.jvm.internal.u implements Function1<by.kufar.core.android.arch.a<? extends Boolean>, Unit> {
public l() {
super(1);
}
public final void a(by.kufar.core.android.arch.a<Boolean> aVar) {
int i11;
boolean z11;
Boolean a11 = aVar.a();
if (a11 != null) {
boolean booleanValue = a11.booleanValue();
View topMessage = LoginFragment.this.getTopMessage();
int i12 = 0;
if (booleanValue) {
i11 = 0;
} else {
i11 = 8;
}
topMessage.setVisibility(i11);
if (LoginFragment.this.getLoginSmsContainer().getVisibility() == 0) {
z11 = true;
} else {
z11 = false;
}
if (!z11 && booleanValue) {
LoginFragment.this.getSignupTracker().r();
}
View loginSmsContainer = LoginFragment.this.getLoginSmsContainer();
if (!booleanValue) {
i12 = 8;
}
loginSmsContainer.setVisibility(i12);
LoginFragment.this.getTopError().setVisibility(8);
}
}
@Override
public Unit invoke(by.kufar.core.android.arch.a<? extends Boolean> aVar) {
a(aVar);
return Unit.f82492a;
}
}
@Metadata(d1 = {"\u0000\b\n\u0000\n\u0002\u0010\u0002\n\u0000\u0010\u0000\u001a\u00020\u0001H\n¢\u0006\u0002\b\u0002"}, d2 = {"<anonymous>", "", "invoke"}, k = 3, mv = {1, 9, 0}, xi = 48)
public static final class m extends kotlin.jvm.internal.u implements Function0<Unit> {
public final Throwable f17704e;
public m(Throwable th2) {
super(0);
this.f17704e = th2;
}
@Override
public Unit invoke() {
invoke2();
return Unit.f82492a;
}
public final void invoke2() {
LoginVM loginVM = LoginFragment.this.loginVM;
if (loginVM == null) {
kotlin.jvm.internal.s.B("loginVM");
loginVM = null;
}
loginVM.loginSocialNetwork(((in.h) this.f17704e).getData());
}
}
@Metadata(d1 = {"\u0000\b\n\u0000\n\u0002\u0010\u0002\n\u0000\u0010\u0000\u001a\u00020\u0001H\n¢\u0006\u0002\b\u0002"}, d2 = {"<anonymous>", "", "invoke"}, k = 3, mv = {1, 9, 0}, xi = 48)
public static final class n extends kotlin.jvm.internal.u implements Function0<Unit> {
public n() {
super(0);
}
@Override
public Unit invoke() {
invoke2();
return Unit.f82492a;
}
public final void invoke2() {
LoginVM loginVM = LoginFragment.this.loginVM;
if (loginVM == null) {
kotlin.jvm.internal.s.B("loginVM");
loginVM = null;
}
loginVM.login(LoginFragment.this.getEmail().getEditText().getText().toString(), LoginFragment.this.getPassword().getEditText().getText().toString());
}
}
@Metadata(d1 = {"\u0000\n\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0000\u0010\u0002\u001a\u00020\u0001*\u00020\u0000H\u008a@"}, d2 = {"Lkotlinx/coroutines/q0;", "", "<anonymous>"}, k = 3, mv = {1, 9, 0})
@l80.f(c = "by.kufar.signup.ui.login.LoginFragment$silentLoginGoogle$1", f = "LoginFragment.kt", l = {165, 166}, m = "invokeSuspend")
public static final class o extends l80.l implements Function2<q0, j80.d<? super Unit>, Object> {
public int f17706b;
public final String f17708d;
@Metadata(d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0001\u001a\u00020\u0000H\u008a@¢\u0006\u0004\b\u0003\u0010\u0004"}, d2 = {"Lin/f$b;", "it", "", "a", "(Lin/f$b;Lj80/d;)Ljava/lang/Object;"}, k = 3, mv = {1, 9, 0})
public static final class a<T> implements kotlinx.coroutines.flow.h {
public final LoginFragment f17709b;
public a(LoginFragment loginFragment) {
this.f17709b = loginFragment;
}
@Override
public final Object emit(f.b bVar, j80.d<? super Unit> dVar) {
LoginVM loginVM = this.f17709b.loginVM;
if (loginVM == null) {
kotlin.jvm.internal.s.B("loginVM");
loginVM = null;
}
loginVM.loginSocialNetwork(bVar);
return Unit.f82492a;
}
}
public o(String str, j80.d<? super o> dVar) {
super(2, dVar);
this.f17708d = str;
}
@Override
public final j80.d<Unit> create(Object obj, j80.d<?> dVar) {
return new o(this.f17708d, dVar);
}
@Override
public final Object invokeSuspend(Object obj) {
Object f11 = k80.c.f();
int i11 = this.f17706b;
if (i11 != 0) {
if (i11 != 1) {
if (i11 == 2) {
d80.q.b(obj);
return Unit.f82492a;
}
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
d80.q.b(obj);
} else {
d80.q.b(obj);
Context context = LoginFragment.this.getContext();
if (context == null) {
return Unit.f82492a;
}
in.f socialLoginClient = LoginFragment.this.getSocialLoginClient();
String str = this.f17708d;
f.c cVar = f.c.f79557b;
this.f17706b = 1;
obj = socialLoginClient.i(context, str, cVar, this);
if (obj == f11) {
return f11;
}
}
a aVar = new a(LoginFragment.this);
this.f17706b = 2;
if (((kotlinx.coroutines.flow.g) obj).collect(aVar, this) == f11) {
return f11;
}
return Unit.f82492a;
}
@Override
public final Object mo1invoke(q0 q0Var, j80.d<? super Unit> dVar) {
return ((o) create(q0Var, dVar)).invokeSuspend(Unit.f82492a);
}
}
public LoginFragment() {
ActivityResultLauncher<Intent> registerForActivityResult = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), new ActivityResultCallback() {
@Override
public final void onActivityResult(Object obj) {
LoginFragment.startForResult$lambda$0(LoginFragment.this, (ActivityResult) obj);
}
});
kotlin.jvm.internal.s.i(registerForActivityResult, "registerForActivityResult(...)");
this.startForResult = registerForActivityResult;
}
private final void addCredentialsFocusChangeListener() {
getEmail().getEditText().setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public final void onFocusChange(View view, boolean z11) {
LoginFragment.addCredentialsFocusChangeListener$lambda$12(LoginFragment.this, view, z11);
}
});
getPassword().getEditText().setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public final void onFocusChange(View view, boolean z11) {
LoginFragment.addCredentialsFocusChangeListener$lambda$13(LoginFragment.this, view, z11);
}
});
}
public static final void addCredentialsFocusChangeListener$lambda$12(LoginFragment this$0, View view, boolean z11) {
kotlin.jvm.internal.s.j(this$0, "this$0");
if (!z11) {
LoginVM loginVM = this$0.loginVM;
if (loginVM == null) {
kotlin.jvm.internal.s.B("loginVM");
loginVM = null;
}
loginVM.onLoginUnfocus(this$0.getEmail().getEditText().getText().toString());
}
}
public static final void addCredentialsFocusChangeListener$lambda$13(LoginFragment this$0, View view, boolean z11) {
kotlin.jvm.internal.s.j(this$0, "this$0");
if (!z11) {
LoginVM loginVM = this$0.loginVM;
if (loginVM == null) {
kotlin.jvm.internal.s.B("loginVM");
loginVM = null;
}
loginVM.onPasswordUnfocus(this$0.getPassword().getEditText().getText().toString());
}
}
private final void finish() {
SignupActivity signupActivity = signupActivity();
if (signupActivity != null) {
signupActivity.finishWithSuccess();
}
}
private final SignupAdvantagesView getAdvantages() {
return (SignupAdvantagesView) this.advantages.getValue(this, $$delegatedProperties[9]);
}
public final InputView getEmail() {
return (InputView) this.email.getValue(this, $$delegatedProperties[5]);
}
private final TextView getForgetPassword() {
return (TextView) this.forgetPassword.getValue(this, $$delegatedProperties[8]);
}
private final Button getHelp() {
return (Button) this.help.getValue(this, $$delegatedProperties[6]);
}
private final Button getLogin() {
return (Button) this.login.getValue(this, $$delegatedProperties[0]);
}
private final View getLoginApple() {
return (View) this.loginApple.getValue(this, $$delegatedProperties[1]);
}
private final View getLoginGoogle() {
return (View) this.loginGoogle.getValue(this, $$delegatedProperties[2]);
}
private final View getLoginMailRu() {
return (View) this.loginMailRu.getValue(this, $$delegatedProperties[3]);
}
public final View getLoginSmsContainer() {
return (View) this.loginSmsContainer.getValue(this, $$delegatedProperties[10]);
}
private final TextView getLoginSmsText() {
return (TextView) this.loginSmsText.getValue(this, $$delegatedProperties[11]);
}
private final View getLoginYandex() {
return (View) this.loginYandex.getValue(this, $$delegatedProperties[4]);
}
public final InputView getPassword() {
return (InputView) this.password.getValue(this, $$delegatedProperties[7]);
}
public final View getTopError() {
return (View) this.topError.getValue(this, $$delegatedProperties[13]);
}
public final TextView getTopErrorText() {
return (TextView) this.topErrorText.getValue(this, $$delegatedProperties[14]);
}
public final View getTopMessage() {
return (View) this.topMessage.getValue(this, $$delegatedProperties[12]);
}
private final void hidePassword() {
Drawable drawable;
getPassword().setTransformationMethod(new PasswordTransformationMethod());
InputView password = getPassword();
Context context = getContext();
if (context != null) {
drawable = ContextCompat.getDrawable(context, R$drawable.f17408a);
} else {
drawable = null;
}
password.setRightIcon(drawable);
}
private final void removeCredentialsFocusChangeListener() {
getEmail().getEditText().setOnFocusChangeListener(null);
getPassword().getEditText().setOnFocusChangeListener(null);
}
private final void setupActionsButtonListeners() {
int i11;
getPassword().setOnRightIconClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
LoginFragment.setupActionsButtonListeners$lambda$14(LoginFragment.this, view);
}
});
getAdvantages().setOnCloseClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
LoginFragment.setupActionsButtonListeners$lambda$15(LoginFragment.this, view);
}
});
getHelp().setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
LoginFragment.setupActionsButtonListeners$lambda$17(LoginFragment.this, view);
}
});
getLogin().setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
LoginFragment.setupActionsButtonListeners$lambda$18(LoginFragment.this, view);
}
});
View loginGoogle = getLoginGoogle();
if (getSocialLoginClient().g(f.c.f79557b)) {
i11 = 0;
} else {
i11 = 8;
}
loginGoogle.setVisibility(i11);
getLoginGoogle().setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
LoginFragment.setupActionsButtonListeners$lambda$19(LoginFragment.this, view);
}
});
getLoginApple().setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
LoginFragment.setupActionsButtonListeners$lambda$20(LoginFragment.this, view);
}
});
getLoginMailRu().setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
LoginFragment.setupActionsButtonListeners$lambda$21(LoginFragment.this, view);
}
});
getLoginYandex().setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
LoginFragment.setupActionsButtonListeners$lambda$22(LoginFragment.this, view);
}
});
getLoginSmsText().setMovementMethod(LinkMovementMethod.getInstance());
TextView loginSmsText = getLoginSmsText();
SpannableStringBuilder append = new SpannableStringBuilder().append((CharSequence) (getString(R$string.I) + " "));
kotlin.jvm.internal.s.i(append, "append(...)");
g gVar = new g(null, true, this);
int length = append.length();
append.append((CharSequence) getString(R$string.H));
append.setSpan(gVar, length, append.length(), 17);
loginSmsText.setText(append);
}
public static final void setupActionsButtonListeners$lambda$14(LoginFragment this$0, View view) {
kotlin.jvm.internal.s.j(this$0, "this$0");
LoginVM loginVM = this$0.loginVM;
if (loginVM == null) {
kotlin.jvm.internal.s.B("loginVM");
loginVM = null;
}
loginVM.onShowPasswordClick();
}
public static final void setupActionsButtonListeners$lambda$15(LoginFragment this$0, View view) {
kotlin.jvm.internal.s.j(this$0, "this$0");
this$0.getAdvantages().setVisibility(8);
}
public static final void setupActionsButtonListeners$lambda$17(LoginFragment this$0, View view) {
kotlin.jvm.internal.s.j(this$0, "this$0");
Context context = this$0.getContext();
if (context != null) {
this$0.startActivity(WebViewActivity.Companion.b(WebViewActivity.INSTANCE, context, "https://support.kufar.by/hc/ru", false, null, false, false, 60, null));
}
}
public static final void setupActionsButtonListeners$lambda$18(LoginFragment this$0, View view) {
kotlin.jvm.internal.s.j(this$0, "this$0");
LoginVM loginVM = this$0.loginVM;
if (loginVM == null) {
kotlin.jvm.internal.s.B("loginVM");
loginVM = null;
}
loginVM.login(this$0.getEmail().getEditText().getText().toString(), this$0.getPassword().getEditText().getText().toString());
}
public static final void setupActionsButtonListeners$lambda$19(LoginFragment this$0, View view) {
kotlin.jvm.internal.s.j(this$0, "this$0");
this$0.getSocialLoginClient().j(this$0, f.c.f79557b);
}
public static final void setupActionsButtonListeners$lambda$20(LoginFragment this$0, View view) {
kotlin.jvm.internal.s.j(this$0, "this$0");
this$0.getSocialLoginClient().j(this$0, f.c.f79558c);
}
public static final void setupActionsButtonListeners$lambda$21(LoginFragment this$0, View view) {
kotlin.jvm.internal.s.j(this$0, "this$0");
this$0.getSocialLoginClient().j(this$0, f.c.f79560e);
}
public static final void setupActionsButtonListeners$lambda$22(LoginFragment this$0, View view) {
kotlin.jvm.internal.s.j(this$0, "this$0");
this$0.getSocialLoginClient().j(this$0, f.c.f79559d);
}
private final void setupForgetPassword() {
getForgetPassword().setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
LoginFragment.setupForgetPassword$lambda$26(LoginFragment.this, view);
}
});
}
public static final void setupForgetPassword$lambda$26(LoginFragment this$0, View view) {
kotlin.jvm.internal.s.j(this$0, "this$0");
Context context = this$0.getContext();
if (context != null) {
this$0.startActivity(ChangePasswordActivity.INSTANCE.a(context));
}
}
private final void setupView() {
setupActionsButtonListeners();
setupForgetPassword();
getEmail().setHint(getString(R$string.f17475t));
h hVar = new h();
getPassword().getEditText().addTextChangedListener(hVar);
getEmail().getEditText().addTextChangedListener(hVar);
getPassword().getEditText().setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public final boolean onEditorAction(TextView textView, int i11, KeyEvent keyEvent) {
boolean z11;
z11 = LoginFragment.setupView$lambda$11(LoginFragment.this, textView, i11, keyEvent);
return z11;
}
});
getTopErrorText().setMovementMethod(LinkMovementMethod.getInstance());
}
public static final boolean setupView$lambda$11(LoginFragment this$0, TextView textView, int i11, KeyEvent keyEvent) {
kotlin.jvm.internal.s.j(this$0, "this$0");
if (i11 == 6) {
LoginVM loginVM = this$0.loginVM;
if (loginVM == null) {
kotlin.jvm.internal.s.B("loginVM");
loginVM = null;
}
loginVM.login(this$0.getEmail().getEditText().getText().toString(), this$0.getPassword().getEditText().getText().toString());
return true;
}
return false;
}
private final void setupViewModel() {
LoginVM loginVM = (LoginVM) new ViewModelProvider(this, getViewModelFactory()).get(LoginVM.class);
this.loginVM = loginVM;
LoginVM loginVM2 = null;
if (loginVM == null) {
kotlin.jvm.internal.s.B("loginVM");
loginVM = null;
}
loginVM.getState().observe(getViewLifecycleOwner(), new Observer() {
@Override
public final void onChanged(Object obj) {
LoginFragment.setupViewModel$lambda$1(LoginFragment.this, (LoginVM.b) obj);
}
});
LoginVM loginVM3 = this.loginVM;
if (loginVM3 == null) {
kotlin.jvm.internal.s.B("loginVM");
loginVM3 = null;
}
loginVM3.getLoginButtonEnabled().observe(getViewLifecycleOwner(), new Observer() {
@Override
public final void onChanged(Object obj) {
LoginFragment.setupViewModel$lambda$2(LoginFragment.this, (Boolean) obj);
}
});
LoginVM loginVM4 = this.loginVM;
if (loginVM4 == null) {
kotlin.jvm.internal.s.B("loginVM");
loginVM4 = null;
}
loginVM4.getShowPassword().observe(getViewLifecycleOwner(), new Observer() {
@Override
public final void onChanged(Object obj) {
LoginFragment.setupViewModel$lambda$3(LoginFragment.this, (Boolean) obj);
}
});
LoginVM loginVM5 = this.loginVM;
if (loginVM5 == null) {
kotlin.jvm.internal.s.B("loginVM");
loginVM5 = null;
}
loginVM5.getErrorLogin().observe(getViewLifecycleOwner(), new Observer() {
@Override
public final void onChanged(Object obj) {
LoginFragment.setupViewModel$lambda$4(LoginFragment.this, (by.kufar.core.android.arch.a) obj);
}
});
LoginVM loginVM6 = this.loginVM;
if (loginVM6 == null) {
kotlin.jvm.internal.s.B("loginVM");
loginVM6 = null;
}
loginVM6.getErrorLoginInt().observe(getViewLifecycleOwner(), new Observer() {
@Override
public final void onChanged(Object obj) {
LoginFragment.setupViewModel$lambda$5(LoginFragment.this, (by.kufar.core.android.arch.a) obj);
}
});
LoginVM loginVM7 = this.loginVM;
if (loginVM7 == null) {
kotlin.jvm.internal.s.B("loginVM");
loginVM7 = null;
}
loginVM7.getErrorPassword().observe(getViewLifecycleOwner(), new Observer() {
@Override
public final void onChanged(Object obj) {
LoginFragment.setupViewModel$lambda$6(LoginFragment.this, (by.kufar.core.android.arch.a) obj);
}
});
LoginVM loginVM8 = this.loginVM;
if (loginVM8 == null) {
kotlin.jvm.internal.s.B("loginVM");
loginVM8 = null;
}
loginVM8.getErrorPasswordInt().observe(getViewLifecycleOwner(), new Observer() {
@Override
public final void onChanged(Object obj) {
LoginFragment.setupViewModel$lambda$7(LoginFragment.this, (by.kufar.core.android.arch.a) obj);
}
});
LoginVM loginVM9 = this.loginVM;
if (loginVM9 == null) {
kotlin.jvm.internal.s.B("loginVM");
loginVM9 = null;
}
loginVM9.getShowMfa().observe(getViewLifecycleOwner(), new Observer() {
@Override
public final void onChanged(Object obj) {
LoginFragment.setupViewModel$lambda$8(LoginFragment.this, (by.kufar.core.android.arch.a) obj);
}
});
LoginVM loginVM10 = this.loginVM;
if (loginVM10 == null) {
kotlin.jvm.internal.s.B("loginVM");
loginVM10 = null;
}
loginVM10.getShowLoginSms().observe(getViewLifecycleOwner(), new f(new l()));
LoginVM loginVM11 = this.loginVM;
if (loginVM11 == null) {
kotlin.jvm.internal.s.B("loginVM");
loginVM11 = null;
}
loginVM11.getOpenLoginSms().observe(getViewLifecycleOwner(), new f(new i()));
LoginVM loginVM12 = this.loginVM;
if (loginVM12 == null) {
kotlin.jvm.internal.s.B("loginVM");
loginVM12 = null;
}
loginVM12.getErrorSnack().observe(getViewLifecycleOwner(), new Observer() {
@Override
public final void onChanged(Object obj) {
LoginFragment.setupViewModel$lambda$10(LoginFragment.this, (by.kufar.core.android.arch.a) obj);
}
});
LoginVM loginVM13 = this.loginVM;
if (loginVM13 == null) {
kotlin.jvm.internal.s.B("loginVM");
loginVM13 = null;
}
loginVM13.getErrorSnackInt().observe(getViewLifecycleOwner(), new f(new j()));
LoginVM loginVM14 = this.loginVM;
if (loginVM14 == null) {
kotlin.jvm.internal.s.B("loginVM");
} else {
loginVM2 = loginVM14;
}
loginVM2.getErrorTop().observe(getViewLifecycleOwner(), new f(new k()));
}
public static final void setupViewModel$lambda$1(LoginFragment this$0, LoginVM.b bVar) {
kotlin.jvm.internal.s.j(this$0, "this$0");
kotlin.jvm.internal.s.g(bVar);
this$0.showState(bVar);
}
public static final void setupViewModel$lambda$10(LoginFragment this$0, by.kufar.core.android.arch.a aVar) {
Snackbar r11;
kotlin.jvm.internal.s.j(this$0, "this$0");
SignupActivity signupActivity = this$0.signupActivity();
if (signupActivity != null) {
signupActivity.showContent();
}
SpanContent spanContent = (SpanContent) aVar.a();
if (spanContent != null && (r11 = ek.b.r(ek.b.f75340a, this$0.getView(), spanContent, 0, null, 0, null, 56, null)) != null) {
r11.W();
}
}
public static final void setupViewModel$lambda$2(LoginFragment this$0, Boolean bool) {
kotlin.jvm.internal.s.j(this$0, "this$0");
Button login = this$0.getLogin();
kotlin.jvm.internal.s.g(bool);
login.setEnabled(bool.booleanValue());
}
public static final void setupViewModel$lambda$3(LoginFragment this$0, Boolean bool) {
kotlin.jvm.internal.s.j(this$0, "this$0");
kotlin.jvm.internal.s.g(bool);
if (bool.booleanValue()) {
this$0.showPassword();
} else {
this$0.hidePassword();
}
}
public static final void setupViewModel$lambda$4(LoginFragment this$0, by.kufar.core.android.arch.a aVar) {
kotlin.jvm.internal.s.j(this$0, "this$0");
SignupActivity signupActivity = this$0.signupActivity();
if (signupActivity != null) {
signupActivity.showContent();
}
this$0.getEmail().setError((CharSequence) aVar.a());
}
public static final void setupViewModel$lambda$5(LoginFragment this$0, by.kufar.core.android.arch.a aVar) {
kotlin.jvm.internal.s.j(this$0, "this$0");
if (aVar.getHasBeenHandled()) {
return;
}
Integer num = (Integer) aVar.a();
if (num == null) {
this$0.getEmail().setError(null);
} else {
this$0.getEmail().setError(this$0.getString(num.intValue()));
}
}
public static final void setupViewModel$lambda$6(LoginFragment this$0, by.kufar.core.android.arch.a aVar) {
kotlin.jvm.internal.s.j(this$0, "this$0");
SignupActivity signupActivity = this$0.signupActivity();
if (signupActivity != null) {
signupActivity.showContent();
}
this$0.getPassword().setError((CharSequence) aVar.a());
}
public static final void setupViewModel$lambda$7(LoginFragment this$0, by.kufar.core.android.arch.a aVar) {
kotlin.jvm.internal.s.j(this$0, "this$0");
if (aVar.getHasBeenHandled()) {
return;
}
Integer num = (Integer) aVar.a();
if (num == null) {
this$0.getPassword().setError(null);
} else {
this$0.getPassword().setError(this$0.getString(num.intValue()));
}
}
public static final void setupViewModel$lambda$8(LoginFragment this$0, by.kufar.core.android.arch.a aVar) {
a.c cVar;
kotlin.jvm.internal.s.j(this$0, "this$0");
Context context = this$0.getContext();
if (context == null || (cVar = (a.c) aVar.a()) == null) {
return;
}
this$0.startForResult.launch(this$0.getMediator().w().a(context, cVar.getToken(), cVar.getAndroidx.autofill.HintConstants.AUTOFILL_HINT_PHONE java.lang.String(), i.a.f73646b));
}
private final void showError(Throwable error) {
if (error instanceof in.h) {
SignupActivity signupActivity = signupActivity();
if (signupActivity != null) {
signupActivity.setOnRetryClickListener(new m(error));
}
SignupActivity signupActivity2 = signupActivity();
if (signupActivity2 != null) {
signupActivity2.showError(((in.h) error).getReason());
return;
}
return;
}
SignupActivity signupActivity3 = signupActivity();
if (signupActivity3 != null) {
signupActivity3.setOnRetryClickListener(new n());
}
SignupActivity signupActivity4 = signupActivity();
if (signupActivity4 != null) {
signupActivity4.showError(error);
}
}
private final void showPassword() {
Drawable drawable = null;
getPassword().setTransformationMethod(null);
InputView password = getPassword();
Context context = getContext();
if (context != null) {
drawable = ContextCompat.getDrawable(context, R$drawable.f17409b);
}
password.setRightIcon(drawable);
}
private final void showState(LoginVM.b state) {
if (state instanceof LoginVM.b.a) {
SignupActivity signupActivity = signupActivity();
if (signupActivity != null) {
signupActivity.showContent();
return;
}
return;
}
if (state instanceof LoginVM.b.C0323b) {
showError(((LoginVM.b.C0323b) state).getException());
return;
}
if (state instanceof LoginVM.b.c) {
SignupActivity signupActivity2 = signupActivity();
if (signupActivity2 != null) {
signupActivity2.showProgress();
return;
}
return;
}
if (state instanceof LoginVM.b.d) {
finish();
return;
}
if (state instanceof LoginVM.b.e) {
a6.d.f263a.h(getActivity());
SignupActivity signupActivity3 = signupActivity();
if (signupActivity3 != null) {
signupActivity3.showContent();
}
Context context = getContext();
if (context != null) {
startActivity(ActivationActivity.INSTANCE.c(context, ((LoginVM.b.e) state).getEmail()));
}
}
}
public final SignupActivity signupActivity() {
FragmentActivity activity = getActivity();
if (activity instanceof SignupActivity) {
return (SignupActivity) activity;
}
return null;
}
public final void silentLoginGoogle(String account) {
kotlinx.coroutines.l.d(getFragmentScope(), null, null, new o(account, null), 3, null);
}
public static final void startForResult$lambda$0(LoginFragment this$0, ActivityResult result) {
kotlin.jvm.internal.s.j(this$0, "this$0");
kotlin.jvm.internal.s.j(result, "result");
if (result.getResultCode() == -1) {
this$0.finish();
} else {
this$0.getSignupTracker().h();
}
}
public final in.b getCredentialsClient() {
in.b bVar = this.credentialsClient;
if (bVar != null) {
return bVar;
}
kotlin.jvm.internal.s.B("credentialsClient");
return null;
}
public final cb.b getMediator() {
cb.b bVar = this.mediator;
if (bVar != null) {
return bVar;
}
kotlin.jvm.internal.s.B("mediator");
return null;
}
public final dn.a getSignupTracker() {
dn.a aVar = this.signupTracker;
if (aVar != null) {
return aVar;
}
kotlin.jvm.internal.s.B("signupTracker");
return null;
}
public final in.f getSocialLoginClient() {
in.f fVar = this.socialLoginClient;
if (fVar != null) {
return fVar;
}
kotlin.jvm.internal.s.B("socialLoginClient");
return null;
}
public final ViewModelProvider.Factory getViewModelFactory() {
ViewModelProvider.Factory factory = this.viewModelFactory;
if (factory != null) {
return factory;
}
kotlin.jvm.internal.s.B("viewModelFactory");
return null;
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == 1011 && resultCode == -1) {
finish();
} else if (requestCode != 1010 || resultCode != -1) {
kotlinx.coroutines.l.d(getFragmentScope(), null, null, new b(requestCode, resultCode, data, null), 3, null);
} else {
getCredentialsClient().a(data);
}
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Context context = getContext();
if (context == null) {
return;
}
getSignupTracker().h();
getSocialLoginClient().f(context);
getCredentialsClient().c(g.a.f79588b, new c());
getCredentialsClient().e(new d());
FragmentActivity activity = getActivity();
if (activity == null) {
return;
}
getCredentialsClient().d(activity, 1010);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
kotlin.jvm.internal.s.j(inflater, "inflater");
return inflater.inflate(R$layout.f17450j, container, false);
}
@Override
public void onInject() {
super.onInject();
d.a a11 = fn.b.a();
Object obj = m5.a.d(this).get(fn.e.class);
if (obj != null) {
a11.a((fn.e) obj).h(this);
return;
}
throw new NullPointerException("null cannot be cast to non-null type by.kufar.signup.di.SignupFeatureDependencies");
}
@Override
public void onPause() {
super.onPause();
removeCredentialsFocusChangeListener();
SignupActivity signupActivity = signupActivity();
if (signupActivity != null) {
signupActivity.setOnRetryClickListener(null);
}
}
@Override
public void onResume() {
super.onResume();
addCredentialsFocusChangeListener();
SignupActivity signupActivity = signupActivity();
if (signupActivity != null) {
signupActivity.setOnRetryClickListener(this.retryClickListener);
}
}
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
kotlin.jvm.internal.s.j(view, "view");
super.onViewCreated(view, savedInstanceState);
setupViewModel();
setupView();
}
public final void setCredentialsClient(in.b bVar) {
kotlin.jvm.internal.s.j(bVar, "<set-?>");
this.credentialsClient = bVar;
}
public final void setMediator(cb.b bVar) {
kotlin.jvm.internal.s.j(bVar, "<set-?>");
this.mediator = bVar;
}
public final void setSignupTracker(dn.a aVar) {
kotlin.jvm.internal.s.j(aVar, "<set-?>");
this.signupTracker = aVar;
}
public final void setSocialLoginClient(in.f fVar) {
kotlin.jvm.internal.s.j(fVar, "<set-?>");
this.socialLoginClient = fVar;
}
public final void setViewModelFactory(ViewModelProvider.Factory factory) {
kotlin.jvm.internal.s.j(factory, "<set-?>");
this.viewModelFactory = factory;
}
}