package bf;

import android.util.SparseIntArray;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import androidx.databinding.n;
import androidx.lifecycle.a0;
import androidx.lifecycle.f0;
import ca.canadapost.core.common.customView.CpcTextInput;
import ca.canadapost.core.common.ui.CpcFragmentContainerView;
import ef.a;
import w8.d0;

/* loaded from: classes4.dex */
public class t extends s implements a.InterfaceC0370a {
    private static final n.i J = null;
    private static final SparseIntArray K = null;
    private final CpcFragmentContainerView E;
    private final View.OnClickListener F;
    private final View.OnClickListener G;
    private androidx.databinding.g H;
    private long I;

    /* 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(t.this.A);
            kf.b bVar = t.this.D;
            if (bVar != null) {
                f0 S = bVar.S();
                if (S != null) {
                    S.q(a10);
                }
            }
        }
    }

    public t(androidx.databinding.e eVar, View view) {
        this(eVar, view, androidx.databinding.n.E(eVar, view, 4, J, K));
    }

    private boolean U(a0 a0Var, int i10) {
        if (i10 != af.a.f316a) {
            return false;
        }
        synchronized (this) {
            this.I |= 2;
        }
        return true;
    }

    private boolean V(f0 f0Var, int i10) {
        if (i10 != af.a.f316a) {
            return false;
        }
        synchronized (this) {
            this.I |= 1;
        }
        return true;
    }

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

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

    @Override // androidx.databinding.n
    public boolean Q(int i10, Object obj) {
        if (af.a.f317b != i10) {
            return false;
        }
        W((kf.b) obj);
        return true;
    }

    public void W(kf.b bVar) {
        this.D = bVar;
        synchronized (this) {
            this.I |= 4;
        }
        f(af.a.f317b);
        super.J();
    }

    @Override // ef.a.InterfaceC0370a
    public final void a(int i10, View view) {
        if (i10 == 1) {
            kf.b bVar = this.D;
            if (bVar != null) {
                bVar.V();
                return;
            }
            return;
        }
        if (i10 != 2) {
            return;
        }
        kf.b bVar2 = this.D;
        if (bVar2 != null) {
            bVar2.U();
        }
    }

    @Override // androidx.databinding.n
    protected void n() {
        long j10;
        f0 f0Var;
        synchronized (this) {
            j10 = this.I;
            this.I = 0L;
        }
        kf.b bVar = this.D;
        String str = null;
        if ((15 & j10) != 0) {
            if ((j10 & 13) != 0) {
                f0Var = bVar != null ? bVar.S() : null;
                S(0, f0Var);
                if (f0Var != null) {
                }
            } else {
                f0Var = null;
            }
            if ((j10 & 14) != 0) {
                a0 Q = bVar != null ? bVar.Q() : null;
                S(1, Q);
                if (Q != null) {
                    str = (String) Q.f();
                }
            }
        } else {
            f0Var = null;
        }
        if ((14 & j10) != 0) {
            ca.canadapost.core.common.customView.u.d(this.A, str);
        }
        if ((13 & j10) != 0) {
            ca.canadapost.core.common.customView.u.b(this.A, f0Var);
        }
        if ((j10 & 8) != 0) {
            ca.canadapost.core.common.customView.u.e(this.A, this.H);
            this.B.setOnClickListener(this.G);
            d0.p(this.C, this.F);
        }
    }

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

    private t(androidx.databinding.e eVar, View view, Object[] objArr) {
        super(eVar, view, 2, (CpcTextInput) objArr[1], (Button) objArr[2], (TextView) objArr[3]);
        this.H = new a();
        this.I = -1L;
        this.A.setTag(null);
        CpcFragmentContainerView cpcFragmentContainerView = (CpcFragmentContainerView) objArr[0];
        this.E = cpcFragmentContainerView;
        cpcFragmentContainerView.setTag(null);
        this.B.setTag(null);
        this.C.setTag(null);
        P(view);
        this.F = new ef.a(this, 2);
        this.G = new ef.a(this, 1);
        B();
    }
}
