package g7;

import android.app.Application;
import android.content.Context;
import android.util.Log;
import androidx.lifecycle.a0;
import androidx.lifecycle.f0;
import com.canadapost.android.R;
import d9.f;
import g9.k;
import kn.l;
import kotlin.jvm.internal.g0;
import kotlin.jvm.internal.p0;
import kotlin.jvm.internal.t;
import l8.g;

/* loaded from: classes.dex */
public final class e extends androidx.lifecycle.b {

    /* renamed from: s, reason: collision with root package name */
    static final /* synthetic */ l[] f19044s = {p0.h(new g0(e.class, "doubleClickGuard", "getDoubleClickGuard()Z", 0))};

    /* renamed from: t, reason: collision with root package name */
    public static final int f19045t = 8;

    /* renamed from: c, reason: collision with root package name */
    private final d9.f f19046c;

    /* renamed from: d, reason: collision with root package name */
    private final g9.d f19047d;

    /* renamed from: e, reason: collision with root package name */
    private final ja.d f19048e;

    /* renamed from: f, reason: collision with root package name */
    private final k f19049f;

    /* renamed from: g, reason: collision with root package name */
    private final i9.d f19050g;

    /* renamed from: h, reason: collision with root package name */
    private final h8.a f19051h;

    /* renamed from: i, reason: collision with root package name */
    private final g f19052i;

    /* renamed from: j, reason: collision with root package name */
    private final a0 f19053j;

    /* renamed from: k, reason: collision with root package name */
    private final l8.e f19054k;

    /* renamed from: l, reason: collision with root package name */
    private final g f19055l;

    /* renamed from: m, reason: collision with root package name */
    private final a0 f19056m;

    /* renamed from: n, reason: collision with root package name */
    private final g f19057n;

    /* renamed from: o, reason: collision with root package name */
    private final a0 f19058o;

    /* renamed from: p, reason: collision with root package name */
    private final f0 f19059p;

    /* renamed from: q, reason: collision with root package name */
    private final a0 f19060q;

    /* renamed from: r, reason: collision with root package name */
    private final androidx.lifecycle.g0 f19061r;

    /* JADX WARN: Illegal instructions before constructor call */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public e(t7.c contextService, d9.f analyticsService, g9.d cpcSessionRepository, ja.d sharedPreferencesService, k registrationRepository, i9.d profileDao, h8.a maintenanceUtility) {
        super((Application) r7);
        t.g(contextService, "contextService");
        t.g(analyticsService, "analyticsService");
        t.g(cpcSessionRepository, "cpcSessionRepository");
        t.g(sharedPreferencesService, "sharedPreferencesService");
        t.g(registrationRepository, "registrationRepository");
        t.g(profileDao, "profileDao");
        t.g(maintenanceUtility, "maintenanceUtility");
        Context a10 = contextService.a();
        t.e(a10, "null cannot be cast to non-null type android.app.Application");
        this.f19046c = analyticsService;
        this.f19047d = cpcSessionRepository;
        this.f19048e = sharedPreferencesService;
        this.f19049f = registrationRepository;
        this.f19050g = profileDao;
        this.f19051h = maintenanceUtility;
        g gVar = new g();
        this.f19052i = gVar;
        this.f19053j = gVar;
        this.f19054k = new l8.e(false, 0L, 3, null);
        g gVar2 = new g();
        this.f19055l = gVar2;
        this.f19056m = gVar2;
        g gVar3 = new g();
        this.f19057n = gVar3;
        this.f19058o = gVar3;
        f0 f0Var = new f0();
        this.f19059p = f0Var;
        this.f19060q = f0Var;
        androidx.lifecycle.g0 g0Var = new androidx.lifecycle.g0() { // from class: g7.d
            @Override // androidx.lifecycle.g0
            public final void d(Object obj) {
                e.Z(e.this, ((Boolean) obj).booleanValue());
            }
        };
        this.f19061r = g0Var;
        f.a.c(analyticsService, "App Splash Screen", null, 2, null);
        if (!maintenanceUtility.d()) {
            cpcSessionRepository.i().k(g0Var);
        }
        f0Var.q(Integer.valueOf(R.string.welcome_title_mobile));
    }

    private final boolean S() {
        return this.f19054k.a(this, f19044s[0]).booleanValue();
    }

    private final boolean X() {
        return this.f19048e.getBoolean("one_to_one_duplicate_email_flow", false);
    }

    private final boolean Y() {
        return this.f19048e.getBoolean("welcome_screen_is_shown", false);
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void Z(e this$0, boolean z10) {
        t.g(this$0, "this$0");
        if (z10) {
            this$0.e0();
            this$0.f19052i.s();
        }
    }

    private final void d0() {
        this.f19049f.m("MOBILE_ANDROID_CPC", "Welcome_screen", "Consumer_Dashboard_2_mainpage");
    }

    /* JADX INFO: Access modifiers changed from: protected */
    @Override // androidx.lifecycle.z0
    public void O() {
        super.O();
        this.f19047d.i().o(this.f19061r);
    }

    public final void R() {
        Log.d("WelcomeViewModel", "checkWelcomeScreenStatus");
        if (!Y()) {
            f.a.c(this.f19046c, "Welcome_screen", null, 2, null);
        }
        if (X()) {
            this.f19050g.c();
        } else {
            if (!Y() || this.f19051h.d()) {
                return;
            }
            this.f19052i.s();
        }
    }

    public final a0 T() {
        return this.f19053j;
    }

    public final a0 U() {
        return this.f19056m;
    }

    public final a0 V() {
        return this.f19058o;
    }

    public final a0 W() {
        return this.f19060q;
    }

    public final void a0() {
        if (S()) {
            return;
        }
        e0();
        this.f19052i.s();
    }

    public final void b0() {
        if (S()) {
            return;
        }
        d0();
        this.f19057n.s();
    }

    public final void c0() {
        if (S()) {
            return;
        }
        d0();
        this.f19055l.s();
    }

    public final void e0() {
        this.f19048e.putBoolean("welcome_screen_is_shown", true);
    }
}
