package jb;

import android.util.SparseIntArray;
import android.view.View;
import android.widget.Button;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import androidx.databinding.n;
import androidx.lifecycle.f0;
import ca.canadapost.core.common.customView.CpcDropdownInput;
import ca.canadapost.core.common.customView.CpcTextInput;
import ca.canadapost.core.common.ui.CpcFragmentContainerView;
import ib.x0;
import nb.a;

/* loaded from: classes4.dex */
public class r extends q implements a.InterfaceC0683a {
    private static final n.i N = null;
    private static final SparseIntArray O;
    private final CpcFragmentContainerView H;
    private final View.OnClickListener I;
    private final View.OnClickListener J;
    private final View.OnClickListener K;
    private androidx.databinding.g L;
    private long M;

    /* loaded from: classes4.dex */
    class a implements androidx.databinding.g {
        a() {
        }

        @Override // androidx.databinding.g
        public void a() {
            String a10 = ca.canadapost.core.common.customView.u.a(r.this.F);
            ib.c0 c0Var = r.this.G;
            if (c0Var != null) {
                f0 Y = c0Var.Y();
                if (Y != null) {
                    Y.q(a10);
                }
            }
        }
    }

    static {
        SparseIntArray sparseIntArray = new SparseIntArray();
        O = sparseIntArray;
        sparseIntArray.put(x0.Q, 5);
        sparseIntArray.put(x0.X, 6);
    }

    public r(androidx.databinding.e eVar, View view) {
        this(eVar, view, androidx.databinding.n.E(eVar, view, 7, N, O));
    }

    private boolean U(f0 f0Var, int i10) {
        if (i10 != ib.a.f22530a) {
            return false;
        }
        synchronized (this) {
            this.M |= 8;
        }
        return true;
    }

    private boolean V(f0 f0Var, int i10) {
        if (i10 != ib.a.f22530a) {
            return false;
        }
        synchronized (this) {
            this.M |= 4;
        }
        return true;
    }

    private boolean W(f0 f0Var, int i10) {
        if (i10 != ib.a.f22530a) {
            return false;
        }
        synchronized (this) {
            this.M |= 1;
        }
        return true;
    }

    private boolean X(f0 f0Var, int i10) {
        if (i10 != ib.a.f22530a) {
            return false;
        }
        synchronized (this) {
            this.M |= 2;
        }
        return true;
    }

    @Override // androidx.databinding.n
    public void B() {
        synchronized (this) {
            this.M = 32L;
        }
        J();
    }

    @Override // androidx.databinding.n
    protected boolean F(int i10, Object obj, int i11) {
        if (i10 == 0) {
            return W((f0) obj, i11);
        }
        if (i10 == 1) {
            return X((f0) obj, i11);
        }
        if (i10 == 2) {
            return V((f0) obj, i11);
        }
        if (i10 != 3) {
            return false;
        }
        return U((f0) obj, i11);
    }

    @Override // androidx.databinding.n
    public boolean Q(int i10, Object obj) {
        if (ib.a.f22531b != i10) {
            return false;
        }
        Y((ib.c0) obj);
        return true;
    }

    public void Y(ib.c0 c0Var) {
        this.G = c0Var;
        synchronized (this) {
            this.M |= 16;
        }
        f(ib.a.f22531b);
        super.J();
    }

    @Override // nb.a.InterfaceC0683a
    public final void a(int i10, View view) {
        if (i10 == 1) {
            ib.c0 c0Var = this.G;
            if (c0Var != null) {
                c0Var.d0(true);
                return;
            }
            return;
        }
        if (i10 == 2) {
            ib.c0 c0Var2 = this.G;
            if (c0Var2 != null) {
                c0Var2.d0(false);
                return;
            }
            return;
        }
        if (i10 != 3) {
            return;
        }
        ib.c0 c0Var3 = this.G;
        if (c0Var3 != null) {
            c0Var3.b0();
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:32:0x0077  */
    /* JADX WARN: Removed duplicated region for block: B:40:0x009b  */
    /* JADX WARN: Removed duplicated region for block: B:65:0x00c7  */
    /* JADX WARN: Removed duplicated region for block: B:68:0x0094  */
    @Override // androidx.databinding.n
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    protected void n() {
        long j10;
        f0 f0Var;
        boolean z10;
        boolean z11;
        int i10;
        boolean z12;
        f0 f0Var2;
        boolean z13;
        synchronized (this) {
            j10 = this.M;
            this.M = 0L;
        }
        ib.c0 c0Var = this.G;
        if ((63 & j10) != 0) {
            if ((j10 & 49) != 0) {
                f0Var2 = c0Var != null ? c0Var.Y() : null;
                S(0, f0Var2);
                if (f0Var2 != null) {
                }
            } else {
                f0Var2 = null;
            }
            long j11 = j10 & 50;
            if (j11 != 0) {
                f0 Z = c0Var != null ? c0Var.Z() : null;
                S(1, Z);
                boolean M = androidx.databinding.n.M(Z != null ? (Boolean) Z.f() : null);
                if (j11 != 0) {
                    j10 |= M ? 128L : 64L;
                }
                if (!M) {
                    i10 = 8;
                    if ((j10 & 52) == 0) {
                        f0 V = c0Var != null ? c0Var.V() : null;
                        S(2, V);
                        z13 = androidx.databinding.n.M(V != null ? (Boolean) V.f() : null);
                    } else {
                        z13 = false;
                    }
                    if ((j10 & 56) == 0) {
                        f0 T = c0Var != null ? c0Var.T() : null;
                        S(3, T);
                        boolean M2 = androidx.databinding.n.M(T != null ? (Boolean) T.f() : null);
                        z10 = androidx.databinding.n.M(Boolean.valueOf(!M2));
                        boolean z14 = z13;
                        f0Var = f0Var2;
                        z11 = M2;
                        z12 = z14;
                    } else {
                        z12 = z13;
                        z10 = false;
                        f0Var = f0Var2;
                        z11 = false;
                    }
                }
            }
            i10 = 0;
            if ((j10 & 52) == 0) {
            }
            if ((j10 & 56) == 0) {
            }
        } else {
            f0Var = null;
            z10 = false;
            z11 = false;
            i10 = 0;
            z12 = false;
        }
        if ((52 & j10) != 0) {
            this.B.setEnabled(z12);
        }
        if ((32 & j10) != 0) {
            this.B.setOnClickListener(this.J);
            this.D.setOnClickListener(this.K);
            this.E.setOnClickListener(this.I);
            ca.canadapost.core.common.customView.u.e(this.F, this.L);
        }
        if ((56 & j10) != 0) {
            b4.a.a(this.D, z10);
            b4.a.a(this.E, z11);
        }
        if ((j10 & 50) != 0) {
            this.F.setVisibility(i10);
        }
        if ((j10 & 49) != 0) {
            ca.canadapost.core.common.customView.u.b(this.F, f0Var);
        }
    }

    @Override // androidx.databinding.n
    public boolean z() {
        synchronized (this) {
            return this.M != 0;
        }
    }

    private r(androidx.databinding.e eVar, View view, Object[] objArr) {
        super(eVar, view, 4, (CpcDropdownInput) objArr[5], (Button) objArr[4], (RadioGroup) objArr[6], (RadioButton) objArr[3], (RadioButton) objArr[2], (CpcTextInput) objArr[1]);
        this.L = new a();
        this.M = -1L;
        CpcFragmentContainerView cpcFragmentContainerView = (CpcFragmentContainerView) objArr[0];
        this.H = cpcFragmentContainerView;
        cpcFragmentContainerView.setTag(null);
        this.B.setTag(null);
        this.D.setTag(null);
        this.E.setTag(null);
        this.F.setTag(null);
        P(view);
        this.I = new nb.a(this, 1);
        this.J = new nb.a(this, 3);
        this.K = new nb.a(this, 2);
        B();
    }
}
