package ca.canadapost.module.epostprofile.userprofile;

import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import cc.a3;
import cc.d3;
import cc.z2;
import dn.p;
import dn.q;
import e0.f;
import ja.d;
import java.util.List;
import java.util.NoSuchElementException;
import kotlin.Metadata;
import kotlin.coroutines.jvm.internal.l;
import kotlin.jvm.internal.t;
import kotlin.jvm.internal.v;
import m2.j;
import rm.n0;
import rm.y;
import sm.u;
import tp.k;
import tp.m0;
import vm.h;
import y0.b0;
import y0.m;
import y0.p0;
import y0.q1;
import y0.s3;

@Metadata(d1 = {"\u0000(\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\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\n\b\u0007\u0018\u00002\u00020\u0001B\u0007¢\u0006\u0004\b\u0012\u0010\u0013J$\u0010\t\u001a\u00020\b2\u0006\u0010\u0003\u001a\u00020\u00022\b\u0010\u0005\u001a\u0004\u0018\u00010\u00042\b\u0010\u0007\u001a\u0004\u0018\u00010\u0006H\u0016R\"\u0010\u0011\u001a\u00020\n8\u0006@\u0006X\u0087.¢\u0006\u0012\n\u0004\b\u000b\u0010\f\u001a\u0004\b\r\u0010\u000e\"\u0004\b\u000f\u0010\u0010¨\u0006\u0014"}, d2 = {"Lca/canadapost/module/epostprofile/userprofile/ThemeSelectionFragment;", "Lu8/b;", "Landroid/view/LayoutInflater;", "inflater", "Landroid/view/ViewGroup;", "container", "Landroid/os/Bundle;", "savedInstanceState", "Landroid/view/View;", "onCreateView", "Lja/d;", "s", "Lja/d;", "G", "()Lja/d;", "setSharedPreferenceService", "(Lja/d;)V", "sharedPreferenceService", "<init>", "()V", "epostprofile_productionRelease"}, k = 1, mv = {1, 9, 0})
/* loaded from: classes4.dex */
public final class ThemeSelectionFragment extends u8.b {

    /* renamed from: s, reason: collision with root package name and from kotlin metadata */
    public d sharedPreferenceService;

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

        /* JADX INFO: Access modifiers changed from: package-private */
        /* renamed from: ca.canadapost.module.epostprofile.userprofile.ThemeSelectionFragment$a$a, reason: collision with other inner class name */
        /* loaded from: classes4.dex */
        public static final class C0250a extends v implements q {

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

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

            /* JADX INFO: Access modifiers changed from: package-private */
            /* renamed from: ca.canadapost.module.epostprofile.userprofile.ThemeSelectionFragment$a$a$a, reason: collision with other inner class name */
            /* loaded from: classes4.dex */
            public static final class C0251a extends v implements dn.a {

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

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

                /* renamed from: r, reason: collision with root package name */
                final /* synthetic */ rm.v f9043r;

                /* JADX INFO: Access modifiers changed from: package-private */
                /* renamed from: ca.canadapost.module.epostprofile.userprofile.ThemeSelectionFragment$a$a$a$a, reason: collision with other inner class name */
                /* loaded from: classes4.dex */
                public static final class C0252a extends l implements p {

                    /* renamed from: p, reason: collision with root package name */
                    int f9044p;

                    /* renamed from: q, reason: collision with root package name */
                    final /* synthetic */ rm.v f9045q;

                    /* renamed from: r, reason: collision with root package name */
                    final /* synthetic */ ThemeSelectionFragment f9046r;

                    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
                    C0252a(rm.v vVar, ThemeSelectionFragment themeSelectionFragment, vm.d dVar) {
                        super(2, dVar);
                        this.f9045q = vVar;
                        this.f9046r = themeSelectionFragment;
                    }

                    @Override // kotlin.coroutines.jvm.internal.a
                    public final vm.d create(Object obj, vm.d dVar) {
                        return new C0252a(this.f9045q, this.f9046r, dVar);
                    }

                    @Override // kotlin.coroutines.jvm.internal.a
                    public final Object invokeSuspend(Object obj) {
                        wm.d.f();
                        if (this.f9044p != 0) {
                            throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                        }
                        y.b(obj);
                        d3 d3Var = d3.f11413a;
                        rm.v vVar = this.f9045q;
                        d G = this.f9046r.G();
                        Context requireContext = this.f9046r.requireContext();
                        t.f(requireContext, "requireContext(...)");
                        d3Var.c(vVar, G, requireContext);
                        return n0.f34904a;
                    }

                    @Override // dn.p
                    public final Object invoke(m0 m0Var, vm.d dVar) {
                        return ((C0252a) create(m0Var, dVar)).invokeSuspend(n0.f34904a);
                    }
                }

                /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
                C0251a(m0 m0Var, ThemeSelectionFragment themeSelectionFragment, rm.v vVar) {
                    super(0);
                    this.f9041p = m0Var;
                    this.f9042q = themeSelectionFragment;
                    this.f9043r = vVar;
                }

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

                /* renamed from: invoke, reason: collision with other method in class */
                public final void m123invoke() {
                    k.d(this.f9041p, null, null, new C0252a(this.f9043r, this.f9042q, null), 3, null);
                    x4.d.a(this.f9042q).U();
                }
            }

            /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
            C0250a(z2 z2Var, ThemeSelectionFragment themeSelectionFragment) {
                super(3);
                this.f9039p = z2Var;
                this.f9040q = themeSelectionFragment;
            }

            public final void a(f CpcFullScreen, m mVar, int i10) {
                List n10;
                t.g(CpcFullScreen, "$this$CpcFullScreen");
                if ((i10 & 81) == 16 && mVar.v()) {
                    mVar.A();
                    return;
                }
                if (y0.p.H()) {
                    y0.p.Q(607521596, i10, -1, "ca.canadapost.module.epostprofile.userprofile.ThemeSelectionFragment.onCreateView.<anonymous>.<anonymous> (ThemeSelectionFragment.kt:54)");
                }
                n10 = u.n(new rm.v(j.b(ob.l.f31302l3, mVar, 0), z2.USE_SYSTEM_SETTINGS), new rm.v(j.b(ob.l.f31329r0, mVar, 0), z2.ALWAYS_ON), new rm.v(j.b(ob.l.f31324q0, mVar, 0), z2.ALWAYS_OFF));
                Object f10 = mVar.f();
                m.a aVar = m.f51621a;
                if (f10 == aVar.a()) {
                    b0 b0Var = new b0(p0.i(h.f40193p, mVar));
                    mVar.I(b0Var);
                    f10 = b0Var;
                }
                m0 a10 = ((b0) f10).a();
                z2 z2Var = this.f9039p;
                Object f11 = mVar.f();
                if (f11 == aVar.a()) {
                    for (Object obj : n10) {
                        if (((rm.v) obj).d() == z2Var) {
                            f11 = s3.d(obj, null, 2, null);
                            mVar.I(f11);
                        }
                    }
                    throw new NoSuchElementException("Collection contains no element matching the predicate.");
                }
                q1 q1Var = (q1) f11;
                rm.v vVar = (rm.v) q1Var.o();
                a3.a(n10, vVar, q1Var.e(), new C0251a(a10, this.f9040q, vVar), mVar, 0);
                if (y0.p.H()) {
                    y0.p.P();
                }
            }

            @Override // dn.q
            public /* bridge */ /* synthetic */ Object invoke(Object obj, Object obj2, Object obj3) {
                a((f) obj, (m) obj2, ((Number) obj3).intValue());
                return n0.f34904a;
            }
        }

        a() {
            super(2);
        }

        public final void a(m mVar, int i10) {
            if ((i10 & 11) == 2 && mVar.v()) {
                mVar.A();
                return;
            }
            if (y0.p.H()) {
                y0.p.Q(1543812173, i10, -1, "ca.canadapost.module.epostprofile.userprofile.ThemeSelectionFragment.onCreateView.<anonymous> (ThemeSelectionFragment.kt:49)");
            }
            m7.c.a(false, false, 0L, null, null, g1.c.b(mVar, 607521596, true, new C0250a(d3.f11413a.a(ThemeSelectionFragment.this.G()), ThemeSelectionFragment.this)), mVar, 196662, 28);
            if (y0.p.H()) {
                y0.p.P();
            }
        }

        @Override // dn.p
        public /* bridge */ /* synthetic */ Object invoke(Object obj, Object obj2) {
            a((m) obj, ((Number) obj2).intValue());
            return n0.f34904a;
        }
    }

    public final d G() {
        d dVar = this.sharedPreferenceService;
        if (dVar != null) {
            return dVar;
        }
        t.y("sharedPreferenceService");
        return null;
    }

    @Override // androidx.fragment.app.f
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        t.g(inflater, "inflater");
        return k7.a.a(this, g1.c.c(1543812173, true, new a()));
    }
}
