package p000.p001.p002.p008.p009;

import androidx.lifecycle.LiveData;
import ar.tvplayer.core.data.db.entities.ނ;
import ar.tvplayer.core.data.db.entities.ޤ;
import ar.tvplayer.core.data.repositories.ʳ;
import ar.tvplayer.core.util.CommonUtilsKt;
import java.util.concurrent.CancellationException;
import kotlin.TypeCastException;
import p025.p026.InterfaceC1327;
import p025.p026.InterfaceC1363;
import p037.p041.p042.LayoutInflaterFactory2C1494;
import p037.p099.AbstractC2245;
import p037.p099.C2229;
import p138.p139.p143.p144.C2803;
import p138.p176.p177.p242.p246.p251.C4303;
import p402.C6549;
import p402.InterfaceC6540;
import p402.p405.InterfaceC6575;
import p402.p405.p406.EnumC6586;
import p402.p405.p407.p408.AbstractC6597;
import p402.p405.p407.p408.InterfaceC6593;
import p402.p411.p412.InterfaceC6618;
import p402.p411.p413.C6635;

/* JADX INFO: renamed from: ނ.֏.֏.ހ.֏.ޞ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
@InterfaceC6540
public final class C0846 extends AbstractC2245 {

    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public final LiveData<C0847> f3429 = new C2229();

    /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
    public Long f3430;

    /* JADX INFO: renamed from: ނ, reason: contains not printable characters */
    public Long f3431;

    /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
    public Long f3432;

    /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
    public InterfaceC1363 f3433;

    /* JADX INFO: renamed from: ނ.֏.֏.ހ.֏.ޞ$֏, reason: contains not printable characters */
    public static final class C0847 {

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public final ޤ f3434;

        /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
        public final ނ f3435;

        public C0847(ޤ r1, ނ r2) {
            this.f3434 = r1;
            this.f3435 = r2;
        }

        public boolean equals(Object obj) {
            if (this == obj) {
                return true;
            }
            if (!(obj instanceof C0847)) {
                return false;
            }
            C0847 c0847 = (C0847) obj;
            return C6635.m9825(this.f3434, c0847.f3434) && C6635.m9825(this.f3435, c0847.f3435);
        }

        public int hashCode() {
            ޤ r0 = this.f3434;
            int iHashCode = (r0 != null ? r0.hashCode() : 0) * 31;
            ނ r2 = this.f3435;
            return iHashCode + (r2 != null ? r2.hashCode() : 0);
        }

        public String toString() {
            StringBuilder sbM4889 = C2803.m4889("ProgramData(program=");
            sbM4889.append(this.f3434);
            sbM4889.append(", channel=");
            sbM4889.append(this.f3435);
            sbM4889.append(")");
            return sbM4889.toString();
        }
    }

    /* JADX INFO: renamed from: ނ.֏.֏.ހ.֏.ޞ$ؠ, reason: contains not printable characters */
    @InterfaceC6593(c = "ar.tvplayer.tv.base.ui.ProgramInfoViewModel$loadProgram$1", f = "ProgramInfoFragment.kt", l = {317, 327}, m = "invokeSuspend")
    public static final class C0848 extends AbstractC6597 implements InterfaceC6618<InterfaceC1327, InterfaceC6575<? super C6549>, Object> {

        /* JADX INFO: renamed from: އ, reason: contains not printable characters */
        public InterfaceC1327 f3436;

        /* JADX INFO: renamed from: ވ, reason: contains not printable characters */
        public Object f3437;

        /* JADX INFO: renamed from: މ, reason: contains not printable characters */
        public Object f3438;

        /* JADX INFO: renamed from: ފ, reason: contains not printable characters */
        public Object f3439;

        /* JADX INFO: renamed from: ދ, reason: contains not printable characters */
        public int f3440;

        /* JADX INFO: renamed from: ލ, reason: contains not printable characters */
        public final /* synthetic */ long f3442;

        /* JADX INFO: renamed from: ގ, reason: contains not printable characters */
        public final /* synthetic */ ނ f3443;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C0848(long j, ނ r4, InterfaceC6575 interfaceC6575) {
            super(2, interfaceC6575);
            this.f3442 = j;
            this.f3443 = r4;
        }

        @Override // p402.p405.p407.p408.AbstractC6589
        /* JADX INFO: renamed from: ֏ */
        public final InterfaceC6575<C6549> mo837(Object obj, InterfaceC6575<?> interfaceC6575) {
            if (interfaceC6575 == null) {
                C6635.m9824("completion");
                throw null;
            }
            C0848 c0848 = C0846.this.new C0848(this.f3442, this.f3443, interfaceC6575);
            c0848.f3436 = (InterfaceC1327) obj;
            return c0848;
        }

        @Override // p402.p411.p412.InterfaceC6618
        /* JADX INFO: renamed from: ؠ */
        public final Object mo838(InterfaceC1327 interfaceC1327, InterfaceC6575<? super C6549> interfaceC6575) {
            return ((C0848) mo837(interfaceC1327, interfaceC6575)).mo839(C6549.f19328);
        }

        /* JADX WARN: Removed duplicated region for block: B:30:0x00a2  */
        /* JADX WARN: Removed duplicated region for block: B:41:0x00e4  */
        @Override // p402.p405.p407.p408.AbstractC6589
        /* JADX INFO: renamed from: ށ */
        /*
            Code decompiled incorrectly, please refer to instructions dump.
        */
        public final Object mo839(Object obj) {
            InterfaceC1327 interfaceC1327;
            InterfaceC1327 interfaceC13272;
            EnumC6586 enumC6586 = EnumC6586.COROUTINE_SUSPENDED;
            int i = this.f3440;
            if (i == 0) {
                C4303.m7198(obj);
                InterfaceC1327 interfaceC13273 = this.f3436;
                long j = this.f3442;
                if (j == 0) {
                    C0846.m2132(C0846.this, null, this.f3443, false, 4);
                    return C6549.f19328;
                }
                if (j == -1) {
                    ނ r2 = this.f3443;
                    Long l = r2.ޒ;
                    if (l == null) {
                        C0846.m2132(C0846.this, null, r2, false, 4);
                        return C6549.f19328;
                    }
                    ޤ r1 = ʳ.ނ.֏(l.longValue(), this.f3443.ށ());
                    if (r1 != null) {
                        C0846.m2132(C0846.this, r1, this.f3443, false, 4);
                        return C6549.f19328;
                    }
                    ʳ r22 = ʳ.ނ;
                    long jLongValue = l.longValue();
                    long j2 = this.f3443.ށ();
                    this.f3437 = interfaceC13273;
                    this.f3438 = l;
                    this.f3439 = r1;
                    this.f3440 = 1;
                    Object obj2 = r22.֏(jLongValue, j2, this);
                    if (obj2 == enumC6586) {
                        return enumC6586;
                    }
                    interfaceC13272 = interfaceC13273;
                    obj = obj2;
                    ޤ r13 = (ޤ) obj;
                    if (C4303.m7134(interfaceC13272)) {
                    }
                } else {
                    ޤ r12 = ʳ.ނ.ؠ(j, this.f3443.ށ());
                    if (r12 != null) {
                        C0846.m2132(C0846.this, r12, this.f3443, false, 4);
                        return C6549.f19328;
                    }
                    ʳ r6 = ʳ.ނ;
                    long j3 = this.f3442;
                    long j4 = this.f3443.ށ();
                    this.f3437 = interfaceC13273;
                    this.f3438 = r12;
                    this.f3440 = 2;
                    Object obj3 = r6.ؠ(j3, j4, this);
                    if (obj3 == enumC6586) {
                        return enumC6586;
                    }
                    interfaceC1327 = interfaceC13273;
                    obj = obj3;
                    ޤ r132 = (ޤ) obj;
                    if (C4303.m7134(interfaceC1327)) {
                    }
                }
            } else if (i == 1) {
                interfaceC13272 = (InterfaceC1327) this.f3437;
                C4303.m7198(obj);
                ޤ r133 = (ޤ) obj;
                if (C4303.m7134(interfaceC13272)) {
                    C0846.m2132(C0846.this, r133, this.f3443, false, 4);
                }
            } else {
                if (i != 2) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                interfaceC1327 = (InterfaceC1327) this.f3437;
                C4303.m7198(obj);
                ޤ r1322 = (ޤ) obj;
                if (C4303.m7134(interfaceC1327)) {
                    C0846.m2132(C0846.this, r1322, this.f3443, false, 4);
                }
            }
            return C6549.f19328;
        }
    }

    public C0846(Long l, ނ r4) {
        if (l == null || r4 == null) {
            return;
        }
        m2133(l.longValue(), r4, false);
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static /* synthetic */ void m2132(C0846 c0846, ޤ r1, ނ r2, boolean z, int i) {
        if ((i & 4) != 0) {
            z = true;
        }
        c0846.m2134(r1, r2, z);
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final void m2133(long j, ނ r10, boolean z) {
        if (r10 == null) {
            C6635.m9824("channel");
            throw null;
        }
        Long l = this.f3430;
        if (l != null && l.longValue() == j && j != -1) {
            Long l2 = this.f3432;
            long j2 = r10.ބ;
            if (l2 != null && l2.longValue() == j2 && !z) {
                return;
            }
        }
        this.f3430 = Long.valueOf(j);
        this.f3432 = Long.valueOf(r10.ބ);
        InterfaceC1363 interfaceC1363 = this.f3433;
        if (interfaceC1363 != null) {
            C4303.m7098(interfaceC1363, (CancellationException) null, 1, (Object) null);
        }
        this.f3433 = CommonUtilsKt.ؠ(LayoutInflaterFactory2C1494.C1505.m2925((AbstractC2245) this), new C0848(j, r10, null));
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final void m2134(ޤ r5, ނ r6, boolean z) {
        if (!z) {
            LiveData<C0847> liveData = this.f3429;
            if (liveData == null) {
                throw new TypeCastException("null cannot be cast to non-null type androidx.lifecycle.MutableLiveData<ar.tvplayer.tv.base.ui.ProgramInfoViewModel.ProgramData>");
            }
            ((C2229) liveData).mo345(new C0847(r5, r6));
            return;
        }
        if (this.f3429.m339() != null) {
            if (!(!C6635.m9825(this.f3431, r5 != null ? Long.valueOf(r5.֏) : null))) {
                return;
            }
        }
        this.f3431 = r5 != null ? Long.valueOf(r5.֏) : null;
        LiveData<C0847> liveData2 = this.f3429;
        if (liveData2 == null) {
            throw new TypeCastException("null cannot be cast to non-null type androidx.lifecycle.MutableLiveData<ar.tvplayer.tv.base.ui.ProgramInfoViewModel.ProgramData>");
        }
        ((C2229) liveData2).mo345(new C0847(r5, r6));
    }
}
