package ca.canadapost.module.login.forgotusername;

import android.os.Bundle;
import android.view.View;
import androidx.fragment.app.f;
import androidx.fragment.app.k;
import androidx.fragment.app.p0;
import androidx.lifecycle.c1;
import androidx.lifecycle.d1;
import androidx.lifecycle.e1;
import androidx.lifecycle.l;
import androidx.lifecycle.z0;
import androidx.navigation.fragment.NavHostFragment;
import ca.canadapost.core.data.auth.model.UsernamePasswordRecoveryResponse;
import kotlin.Metadata;
import kotlin.jvm.internal.t;
import kotlin.jvm.internal.v;
import ld.j;
import ld.m;
import ld.n;
import rm.o;
import rm.q;

@Metadata(d1 = {"\u00008\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0007\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001B\u0007¢\u0006\u0004\b\u001e\u0010\u001fJ\u001a\u0010\b\u001a\u00020\u00072\u0006\u0010\u0004\u001a\u00020\u00032\b\u0010\u0006\u001a\u0004\u0018\u00010\u0005H\u0016J\u0010\u0010\n\u001a\u00020\u00072\u0006\u0010\t\u001a\u00020\u0002H\u0016R\"\u0010\u0012\u001a\u00020\u000b8\u0004@\u0004X\u0085.¢\u0006\u0012\n\u0004\b\f\u0010\r\u001a\u0004\b\u000e\u0010\u000f\"\u0004\b\u0010\u0010\u0011R\u001b\u0010\u0018\u001a\u00020\u00138BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b\u0014\u0010\u0015\u001a\u0004\b\u0016\u0010\u0017R\u001b\u0010\u001d\u001a\u00020\u00198VX\u0096\u0084\u0002¢\u0006\f\n\u0004\b\u001a\u0010\u0015\u001a\u0004\b\u001b\u0010\u001c¨\u0006 "}, d2 = {"Lca/canadapost/module/login/forgotusername/ForgotUsernameOtpFragment;", "Lxd/a;", "Lca/canadapost/core/data/auth/model/UsernamePasswordRecoveryResponse;", "Landroid/view/View;", "view", "Landroid/os/Bundle;", "savedInstanceState", "Lrm/n0;", "onViewCreated", "response", "Q", "Lsd/b;", "v", "Lsd/b;", "N", "()Lsd/b;", "setForgotUsernameOtpViewModelFactory", "(Lsd/b;)V", "forgotUsernameOtpViewModelFactory", "Lld/n;", "w", "Lrm/o;", "O", "()Lld/n;", "sharedViewModel", "Lsd/a;", "x", "P", "()Lsd/a;", "viewModel", "<init>", "()V", "login_productionRelease"}, k = 1, mv = {1, 9, 0})
/* loaded from: classes4.dex */
public final class ForgotUsernameOtpFragment extends xd.a<UsernamePasswordRecoveryResponse> {

    /* renamed from: v, reason: collision with root package name and from kotlin metadata */
    protected sd.b forgotUsernameOtpViewModelFactory;

    /* renamed from: w, reason: collision with root package name and from kotlin metadata */
    private final o sharedViewModel;

    /* renamed from: x, reason: collision with root package name and from kotlin metadata */
    private final o viewModel;

    /* loaded from: classes4.dex */
    static final class a extends v implements dn.a {
        a() {
            super(0);
        }

        @Override // dn.a
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final e1 invoke() {
            return NavHostFragment.INSTANCE.a(ForgotUsernameOtpFragment.this).y(j.N);
        }
    }

    /* loaded from: classes4.dex */
    public static final class b extends v implements dn.a {

        /* renamed from: p, reason: collision with root package name */
        final /* synthetic */ dn.a f10025p;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public b(dn.a aVar) {
            super(0);
            this.f10025p = aVar;
        }

        @Override // dn.a
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final d1 invoke() {
            d1 viewModelStore = ((e1) this.f10025p.invoke()).getViewModelStore();
            t.f(viewModelStore, "ownerProducer().viewModelStore");
            return viewModelStore;
        }
    }

    /* loaded from: classes4.dex */
    public static final class c extends v implements dn.a {

        /* renamed from: p, reason: collision with root package name */
        final /* synthetic */ dn.a f10026p;

        /* renamed from: q, reason: collision with root package name */
        final /* synthetic */ f f10027q;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public c(dn.a aVar, f fVar) {
            super(0);
            this.f10026p = aVar;
            this.f10027q = fVar;
        }

        @Override // dn.a
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final c1.c invoke() {
            Object invoke = this.f10026p.invoke();
            l lVar = invoke instanceof l ? (l) invoke : null;
            c1.c defaultViewModelProviderFactory = lVar != null ? lVar.getDefaultViewModelProviderFactory() : null;
            if (defaultViewModelProviderFactory == null) {
                defaultViewModelProviderFactory = this.f10027q.getDefaultViewModelProviderFactory();
            }
            t.f(defaultViewModelProviderFactory, "(ownerProducer() as? Has…tViewModelProviderFactory");
            return defaultViewModelProviderFactory;
        }
    }

    /* loaded from: classes4.dex */
    public static final class d extends v implements dn.a {

        /* renamed from: p, reason: collision with root package name */
        final /* synthetic */ f f10028p;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public d(f fVar) {
            super(0);
            this.f10028p = fVar;
        }

        @Override // dn.a
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final f invoke() {
            return this.f10028p;
        }
    }

    /* loaded from: classes4.dex */
    public static final class e extends v implements dn.a {

        /* renamed from: p, reason: collision with root package name */
        final /* synthetic */ dn.a f10029p;

        /* renamed from: q, reason: collision with root package name */
        final /* synthetic */ ForgotUsernameOtpFragment f10030q;

        /* loaded from: classes4.dex */
        public static final class a implements c1.c {

            /* renamed from: b, reason: collision with root package name */
            final /* synthetic */ ForgotUsernameOtpFragment f10031b;

            public a(ForgotUsernameOtpFragment forgotUsernameOtpFragment) {
                this.f10031b = forgotUsernameOtpFragment;
            }

            @Override // androidx.lifecycle.c1.c
            public z0 a(Class modelClass) {
                String str;
                t.g(modelClass, "modelClass");
                sd.b N = this.f10031b.N();
                Bundle arguments = this.f10031b.getArguments();
                if (arguments == null || (str = arguments.getString("VerificationMethod")) == null) {
                    str = "";
                }
                t.d(str);
                sd.a a10 = N.a(str, this.f10031b.O());
                t.e(a10, "null cannot be cast to non-null type U of ca.canadapost.core.common.utils.KotlinExtensionsKt.viewModels.<no name provided>.invoke.<no name provided>.create");
                return a10;
            }
        }

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public e(dn.a aVar, ForgotUsernameOtpFragment forgotUsernameOtpFragment) {
            super(0);
            this.f10029p = aVar;
            this.f10030q = forgotUsernameOtpFragment;
        }

        @Override // dn.a
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final z0 invoke() {
            return new c1((e1) this.f10029p.invoke(), new a(this.f10030q)).a(sd.a.class);
        }
    }

    public ForgotUsernameOtpFragment() {
        o a10;
        a aVar = new a();
        this.sharedViewModel = p0.a(this, kotlin.jvm.internal.p0.b(n.class), new b(aVar), new c(aVar, this));
        a10 = q.a(new e(new d(this), this));
        this.viewModel = a10;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final n O() {
        return (n) this.sharedViewModel.getValue();
    }

    protected final sd.b N() {
        sd.b bVar = this.forgotUsernameOtpViewModelFactory;
        if (bVar != null) {
            return bVar;
        }
        t.y("forgotUsernameOtpViewModelFactory");
        return null;
    }

    @Override // xd.a
    /* renamed from: P, reason: merged with bridge method [inline-methods] */
    public sd.a J() {
        return (sd.a) this.viewModel.getValue();
    }

    @Override // xd.a
    /* renamed from: Q, reason: merged with bridge method [inline-methods] */
    public void K(UsernamePasswordRecoveryResponse response) {
        t.g(response, "response");
        O().T().q(response.getUsername());
        C();
        x4.d.a(this).V(j.f27912b, false);
    }

    @Override // xd.a, u8.b, androidx.fragment.app.f
    public void onViewCreated(View view, Bundle bundle) {
        t.g(view, "view");
        super.onViewCreated(view, bundle);
        k activity = getActivity();
        if (activity == null) {
            return;
        }
        activity.setTitle(getString(m.f27974c));
    }
}
