package ca.canadapost.module.login.biometrictnc;

import android.app.Dialog;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import androidx.appcompat.widget.Toolbar;
import androidx.fragment.app.p0;
import androidx.lifecycle.c1;
import androidx.lifecycle.d1;
import androidx.lifecycle.e1;
import androidx.lifecycle.g0;
import androidx.lifecycle.u;
import androidx.lifecycle.z0;
import dn.a;
import dn.l;
import kotlin.Metadata;
import kotlin.jvm.internal.n;
import kotlin.jvm.internal.t;
import kotlin.jvm.internal.v;
import ld.k;
import ld.m;
import rm.i;
import rm.n0;
import rm.o;
import u7.x;
import w8.d0;
import w8.y;

@Metadata(d1 = {"\u0000`\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\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\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\b\f\u0018\u0000 .2\u00020\u00012\b\u0012\u0004\u0012\u00020\u00030\u0002:\u0001/B\u0007¢\u0006\u0004\b,\u0010-J\u0010\u0010\u0007\u001a\u00020\u00062\u0006\u0010\u0005\u001a\u00020\u0004H\u0002J5\u0010\u0013\u001a\u00020\u00122\u0006\u0010\t\u001a\u00020\b2\b\u0010\u000b\u001a\u0004\u0018\u00010\n2\b\u0010\r\u001a\u0004\u0018\u00010\f2\u0006\u0010\u000f\u001a\u00020\u000e2\u0006\u0010\u0011\u001a\u00020\u0010H\u0096\u0001J$\u0010\u0014\u001a\u00020\u00122\u0006\u0010\t\u001a\u00020\b2\b\u0010\u000b\u001a\u0004\u0018\u00010\n2\b\u0010\r\u001a\u0004\u0018\u00010\fH\u0016J\n\u0010\u0016\u001a\u0004\u0018\u00010\u0015H\u0016J\b\u0010\u0018\u001a\u00020\u0017H\u0016J\b\u0010\u0019\u001a\u00020\u0006H\u0016J\u001a\u0010\u001b\u001a\u00020\u00062\u0006\u0010\u001a\u001a\u00020\u00122\b\u0010\r\u001a\u0004\u0018\u00010\fH\u0016R\"\u0010#\u001a\u00020\u001c8\u0006@\u0006X\u0087.¢\u0006\u0012\n\u0004\b\u001d\u0010\u001e\u001a\u0004\b\u001f\u0010 \"\u0004\b!\u0010\"R\u001b\u0010\u0011\u001a\u00020$8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b%\u0010&\u001a\u0004\b'\u0010(R\u0014\u0010+\u001a\u00020\u00038\u0016X\u0096\u0005¢\u0006\u0006\u001a\u0004\b)\u0010*¨\u00060"}, d2 = {"Lca/canadapost/module/login/biometrictnc/BiometricWordingTncDialogFragment;", "Lca/canadapost/core/common/ui/b;", "", "Lod/m;", "", "accepted", "Lrm/n0;", "K", "Landroid/view/LayoutInflater;", "inflater", "Landroid/view/ViewGroup;", "container", "Landroid/os/Bundle;", "savedInstanceState", "Landroidx/lifecycle/u;", "viewLifecycleOwner", "Landroidx/lifecycle/z0;", "viewModel", "Landroid/view/View;", "J", "onCreateView", "Landroidx/appcompat/widget/Toolbar;", "C", "", "B", "D", "view", "onViewCreated", "Landroidx/lifecycle/c1$c;", "q", "Landroidx/lifecycle/c1$c;", "I", "()Landroidx/lifecycle/c1$c;", "setViewModelFactory", "(Landroidx/lifecycle/c1$c;)V", "viewModelFactory", "Lnd/e;", "r", "Lrm/o;", "H", "()Lnd/e;", "G", "()Lod/m;", "binding", "<init>", "()V", "s", "a", "login_productionRelease"}, k = 1, mv = {1, 9, 0})
/* loaded from: classes4.dex */
public final class BiometricWordingTncDialogFragment extends ca.canadapost.core.common.ui.b {

    /* renamed from: q, reason: collision with root package name and from kotlin metadata */
    public c1.c viewModelFactory;

    /* renamed from: p, reason: collision with root package name */
    private final /* synthetic */ x f9955p = new x(k.f27947g);

    /* renamed from: r, reason: collision with root package name and from kotlin metadata */
    private final o viewModel = p0.a(this, kotlin.jvm.internal.p0.b(nd.e.class), new e(new d(this)), new f());

    /* loaded from: classes4.dex */
    static final class b extends v implements l {
        b() {
            super(1);
        }

        public final void a(n0 n0Var) {
            BiometricWordingTncDialogFragment.this.K(true);
        }

        @Override // dn.l
        public /* bridge */ /* synthetic */ Object invoke(Object obj) {
            a((n0) obj);
            return n0.f34904a;
        }
    }

    /* loaded from: classes4.dex */
    static final class c implements g0, n {

        /* renamed from: a, reason: collision with root package name */
        private final /* synthetic */ l f9959a;

        c(l function) {
            t.g(function, "function");
            this.f9959a = function;
        }

        @Override // kotlin.jvm.internal.n
        public final i b() {
            return this.f9959a;
        }

        @Override // androidx.lifecycle.g0
        public final /* synthetic */ void d(Object obj) {
            this.f9959a.invoke(obj);
        }

        public final boolean equals(Object obj) {
            if ((obj instanceof g0) && (obj instanceof n)) {
                return t.b(b(), ((n) obj).b());
            }
            return false;
        }

        public final int hashCode() {
            return b().hashCode();
        }
    }

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

        /* renamed from: p, reason: collision with root package name */
        final /* synthetic */ androidx.fragment.app.f f9960p;

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

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

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

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

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

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

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

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

    private final nd.e H() {
        return (nd.e) this.viewModel.getValue();
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final void K(boolean z10) {
        y.c(this, "BiometricWordingTncDialogFragment:ON_DONE", Boolean.valueOf(z10));
        Dialog dialog = getDialog();
        if (dialog != null) {
            dialog.dismiss();
        }
    }

    @Override // ca.canadapost.core.common.ui.b
    public String B() {
        String string = getString(m.f27999o0);
        t.f(string, "getString(...)");
        return string;
    }

    @Override // ca.canadapost.core.common.ui.b
    public Toolbar C() {
        u7.c appBarBinding = G().A.getAppBarBinding();
        if (appBarBinding != null) {
            return appBarBinding.B;
        }
        return null;
    }

    @Override // ca.canadapost.core.common.ui.b
    public void D() {
        K(false);
    }

    public od.m G() {
        return (od.m) this.f9955p.b();
    }

    public final c1.c I() {
        c1.c cVar = this.viewModelFactory;
        if (cVar != null) {
            return cVar;
        }
        t.y("viewModelFactory");
        return null;
    }

    public View J(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState, u viewLifecycleOwner, z0 viewModel) {
        t.g(inflater, "inflater");
        t.g(viewLifecycleOwner, "viewLifecycleOwner");
        t.g(viewModel, "viewModel");
        return this.f9955p.c(inflater, container, savedInstanceState, viewLifecycleOwner, viewModel);
    }

    @Override // androidx.fragment.app.f
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        t.g(inflater, "inflater");
        LayoutInflater from = LayoutInflater.from(getContext());
        t.f(from, "from(...)");
        u viewLifecycleOwner = getViewLifecycleOwner();
        t.f(viewLifecycleOwner, "getViewLifecycleOwner(...)");
        return J(from, null, savedInstanceState, viewLifecycleOwner, H());
    }

    @Override // ca.canadapost.core.common.ui.b, androidx.fragment.app.f
    public void onViewCreated(View view, Bundle bundle) {
        t.g(view, "view");
        super.onViewCreated(view, bundle);
        H().Q().j(getViewLifecycleOwner(), new c(new b()));
        Button tAddTrackItemLookupButton = G().B;
        t.f(tAddTrackItemLookupButton, "tAddTrackItemLookupButton");
        d0.g(tAddTrackItemLookupButton);
    }
}
