package zf;

import android.util.SparseIntArray;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.databinding.n;
import ca.canadapost.core.common.customView.CpcTextInput;
import ca.canadapost.core.common.ui.CpcFragmentContainerView;
import cg.a;

/* loaded from: classes4.dex */
public class n3 extends m3 implements a.InterfaceC0282a {
    private static final n.i V = null;
    private static final SparseIntArray W;
    private final CpcFragmentContainerView L;
    private final TextView M;
    private final TextView N;
    private final View.OnClickListener O;
    private final View.OnClickListener P;
    private final View.OnClickListener Q;
    private final View.OnClickListener R;
    private final View.OnClickListener S;
    private androidx.databinding.g T;
    private long U;

    /* 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(n3.this.H);
            jg.l4 l4Var = n3.this.K;
            if (l4Var != null) {
                androidx.lifecycle.f0 Y = l4Var.Y();
                if (Y != null) {
                    Y.q(a10);
                }
            }
        }
    }

    static {
        SparseIntArray sparseIntArray = new SparseIntArray();
        W = sparseIntArray;
        sparseIntArray.put(yf.d.D0, 11);
        sparseIntArray.put(yf.d.C0, 12);
    }

    public n3(androidx.databinding.e eVar, View view) {
        this(eVar, view, androidx.databinding.n.E(eVar, view, 13, V, W));
    }

    private boolean U(androidx.lifecycle.f0 f0Var, int i10) {
        if (i10 != yf.a.f52370a) {
            return false;
        }
        synchronized (this) {
            this.U |= 2;
        }
        return true;
    }

    private boolean V(androidx.lifecycle.f0 f0Var, int i10) {
        if (i10 != yf.a.f52370a) {
            return false;
        }
        synchronized (this) {
            this.U |= 4;
        }
        return true;
    }

    private boolean W(androidx.lifecycle.f0 f0Var, int i10) {
        if (i10 != yf.a.f52370a) {
            return false;
        }
        synchronized (this) {
            this.U |= 1;
        }
        return true;
    }

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

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

    @Override // androidx.databinding.n
    public boolean Q(int i10, Object obj) {
        if (yf.a.f52373d != i10) {
            return false;
        }
        X((jg.l4) obj);
        return true;
    }

    public void X(jg.l4 l4Var) {
        this.K = l4Var;
        synchronized (this) {
            this.U |= 8;
        }
        f(yf.a.f52373d);
        super.J();
    }

    @Override // cg.a.InterfaceC0282a
    public final void a(int i10, View view) {
        if (i10 == 1) {
            jg.l4 l4Var = this.K;
            if (l4Var != null) {
                l4Var.S();
                return;
            }
            return;
        }
        if (i10 == 2) {
            jg.l4 l4Var2 = this.K;
            if (l4Var2 != null) {
                l4Var2.T();
                return;
            }
            return;
        }
        if (i10 == 3) {
            jg.l4 l4Var3 = this.K;
            if (l4Var3 != null) {
                l4Var3.m0();
                return;
            }
            return;
        }
        if (i10 == 4) {
            jg.l4 l4Var4 = this.K;
            if (l4Var4 != null) {
                l4Var4.k0();
                return;
            }
            return;
        }
        if (i10 != 5) {
            return;
        }
        jg.l4 l4Var5 = this.K;
        if (l4Var5 != null) {
            l4Var5.l0();
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:17:0x0041  */
    /* JADX WARN: Removed duplicated region for block: B:36:0x00b0  */
    /* JADX WARN: Removed duplicated region for block: B:43:0x00d0  */
    /* JADX WARN: Removed duplicated region for block: B:69:0x00c8  */
    /* JADX WARN: Removed duplicated region for block: B:73:0x00a5  */
    @Override // androidx.databinding.n
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    protected void n() {
        long j10;
        boolean z10;
        Boolean bool;
        String str;
        androidx.lifecycle.f0 f0Var;
        String str2;
        String str3;
        String str4;
        long j11;
        boolean z11;
        androidx.lifecycle.f0 f0Var2;
        long j12;
        long j13;
        synchronized (this) {
            j10 = this.U;
            this.U = 0L;
        }
        jg.l4 l4Var = this.K;
        String str5 = null;
        if ((31 & j10) != 0) {
            if ((j10 & 25) != 0) {
                androidx.lifecycle.f0 e02 = l4Var != null ? l4Var.e0() : null;
                S(0, e02);
                if (e02 != null) {
                    bool = (Boolean) e02.f();
                    j11 = j10 & 24;
                    if (j11 == 0) {
                        r15 = l4Var != null ? l4Var.V() : false;
                        if (j11 != 0) {
                            if (r15) {
                                j12 = j10 | 64 | 256;
                                j13 = 1024;
                            } else {
                                j12 = j10 | 32 | 128;
                                j13 = 512;
                            }
                            j10 = j12 | j13;
                        }
                        boolean z12 = !r15;
                        str4 = this.H.getResources().getString(r15 ? yf.h.f52557b2 : yf.h.f52577f2);
                        str2 = r15 ? this.I.getResources().getString(yf.h.f52562c2) : this.I.getResources().getString(yf.h.U0);
                        str3 = this.D.getResources().getString(r15 ? yf.h.f52552a2 : yf.h.Y1);
                        z11 = r15;
                        r15 = z12;
                    } else {
                        z11 = false;
                        str2 = null;
                        str3 = null;
                        str4 = null;
                    }
                    if ((j10 & 26) == 0) {
                        f0Var2 = l4Var != null ? l4Var.Y() : null;
                        S(1, f0Var2);
                        if (f0Var2 != null) {
                        }
                    } else {
                        f0Var2 = null;
                    }
                    if ((j10 & 28) != 0) {
                        androidx.lifecycle.f0 Z = l4Var != null ? l4Var.Z() : null;
                        S(2, Z);
                        if (Z != null) {
                            str5 = (String) Z.f();
                        }
                    }
                    f0Var = f0Var2;
                    z10 = r15;
                    str = str5;
                    r15 = z11;
                }
            }
            bool = null;
            j11 = j10 & 24;
            if (j11 == 0) {
            }
            if ((j10 & 26) == 0) {
            }
            if ((j10 & 28) != 0) {
            }
            f0Var = f0Var2;
            z10 = r15;
            str = str5;
            r15 = z11;
        } else {
            z10 = false;
            bool = null;
            str = null;
            f0Var = null;
            str2 = null;
            str3 = null;
            str4 = null;
        }
        if ((j10 & 16) != 0) {
            this.A.setOnClickListener(this.R);
            w8.d0.p(this.C, this.Q);
            w8.d0.p(this.E, this.S);
            ca.canadapost.core.common.customView.u.e(this.H, this.T);
            this.I.setOnClickListener(this.P);
            this.J.setOnClickListener(this.O);
        }
        if ((24 & j10) != 0) {
            b4.a.a(this.B, r15);
            b4.a.a(this.D, r15);
            b4.e.e(this.D, str3);
            u7.g.k(this.M, Boolean.valueOf(z10));
            this.H.setHelperText(str4);
            b4.e.e(this.I, str2);
            u7.g.k(this.J, Boolean.valueOf(r15));
        }
        if ((25 & j10) != 0) {
            u7.g.k(this.N, bool);
        }
        if ((28 & j10) != 0) {
            ca.canadapost.core.common.customView.u.d(this.H, str);
        }
        if ((j10 & 26) != 0) {
            ca.canadapost.core.common.customView.u.b(this.H, f0Var);
        }
    }

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

    private n3(androidx.databinding.e eVar, View view, Object[] objArr) {
        super(eVar, view, 3, (Button) objArr[9], (CheckBox) objArr[3], (ImageButton) objArr[4], (CheckBox) objArr[5], (ImageButton) objArr[6], (LinearLayout) objArr[12], (LinearLayout) objArr[11], (CpcTextInput) objArr[2], (Button) objArr[8], (TextView) objArr[10]);
        this.T = new a();
        this.U = -1L;
        this.A.setTag(null);
        this.B.setTag(null);
        this.C.setTag(null);
        this.D.setTag(null);
        this.E.setTag(null);
        CpcFragmentContainerView cpcFragmentContainerView = (CpcFragmentContainerView) objArr[0];
        this.L = cpcFragmentContainerView;
        cpcFragmentContainerView.setTag(null);
        TextView textView = (TextView) objArr[1];
        this.M = textView;
        textView.setTag(null);
        TextView textView2 = (TextView) objArr[7];
        this.N = textView2;
        textView2.setTag(null);
        this.H.setTag(null);
        this.I.setTag(null);
        this.J.setTag(null);
        P(view);
        this.O = new cg.a(this, 5);
        this.P = new cg.a(this, 3);
        this.Q = new cg.a(this, 1);
        this.R = new cg.a(this, 4);
        this.S = new cg.a(this, 2);
        B();
    }
}
