package u7;

import android.util.SparseIntArray;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.databinding.n;
import ca.canadapost.core.data.flex.model.FlexLocation;

/* loaded from: classes.dex */
public class j1 extends i1 {
    private static final n.i H = null;
    private static final SparseIntArray I = null;
    private final LinearLayout B;
    private final TextView C;
    private final TextView D;
    private final TextView E;
    private final TextView F;
    private long G;

    public j1(androidx.databinding.e eVar, View view) {
        this(eVar, view, androidx.databinding.n.E(eVar, view, 5, H, I));
    }

    private boolean V(androidx.lifecycle.f0 f0Var, int i10) {
        if (i10 != h7.a.f20944a) {
            return false;
        }
        synchronized (this) {
            this.G |= 1;
        }
        return true;
    }

    private boolean W(androidx.lifecycle.a0 a0Var, int i10) {
        if (i10 != h7.a.f20944a) {
            return false;
        }
        synchronized (this) {
            this.G |= 2;
        }
        return true;
    }

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

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

    @Override // androidx.databinding.n
    public boolean Q(int i10, Object obj) {
        if (h7.a.f20948e != i10) {
            return false;
        }
        U((a8.b) obj);
        return true;
    }

    @Override // u7.i1
    public void U(a8.b bVar) {
        this.A = bVar;
        synchronized (this) {
            this.G |= 4;
        }
        f(h7.a.f20948e);
        super.J();
    }

    @Override // androidx.databinding.n
    protected void n() {
        long j10;
        String str;
        String str2;
        String str3;
        int i10;
        int i11;
        String str4;
        int i12;
        int i13;
        synchronized (this) {
            j10 = this.G;
            this.G = 0L;
        }
        a8.b bVar = this.A;
        String str5 = null;
        if ((15 & j10) != 0) {
            long j11 = j10 & 13;
            if (j11 != 0) {
                androidx.lifecycle.f0 R = bVar != null ? bVar.R() : null;
                S(0, R);
                FlexLocation.FlexLocationItem.Address address = R != null ? (FlexLocation.FlexLocationItem.Address) R.f() : null;
                if (address != null) {
                    str3 = address.getAddressLine3();
                    str4 = address.getAddressLine2();
                    str2 = address.getAddressLine1();
                } else {
                    str2 = null;
                    str3 = null;
                    str4 = null;
                }
                int length = str3 != null ? str3.length() : 0;
                int length2 = str4 != null ? str4.length() : 0;
                int length3 = str2 != null ? str2.length() : 0;
                boolean z10 = length > 0;
                boolean z11 = length2 > 0;
                boolean z12 = length3 > 0;
                if (j11 != 0) {
                    j10 |= z10 ? 512L : 256L;
                }
                if ((j10 & 13) != 0) {
                    j10 |= z11 ? 32L : 16L;
                }
                if ((j10 & 13) != 0) {
                    j10 |= z12 ? 128L : 64L;
                }
                int i14 = z10 ? 0 : 8;
                i13 = z11 ? 0 : 8;
                i12 = z12 ? 0 : 8;
                r12 = i14;
            } else {
                str2 = null;
                str3 = null;
                str4 = null;
                i12 = 0;
                i13 = 0;
            }
            if ((j10 & 14) != 0) {
                androidx.lifecycle.a0 V = bVar != null ? bVar.V() : null;
                S(1, V);
                if (V != null) {
                    str5 = (String) V.f();
                }
            }
            i11 = r12;
            str = str4;
            r12 = i12;
            i10 = i13;
        } else {
            str = null;
            str2 = null;
            str3 = null;
            i10 = 0;
            i11 = 0;
        }
        if ((14 & j10) != 0) {
            b4.e.e(this.C, str5);
        }
        if ((j10 & 13) != 0) {
            b4.e.e(this.D, str2);
            this.D.setVisibility(r12);
            b4.e.e(this.E, str);
            this.E.setVisibility(i10);
            b4.e.e(this.F, str3);
            this.F.setVisibility(i11);
        }
    }

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

    private j1(androidx.databinding.e eVar, View view, Object[] objArr) {
        super(eVar, view, 2);
        this.G = -1L;
        LinearLayout linearLayout = (LinearLayout) objArr[0];
        this.B = linearLayout;
        linearLayout.setTag(null);
        TextView textView = (TextView) objArr[1];
        this.C = textView;
        textView.setTag(null);
        TextView textView2 = (TextView) objArr[2];
        this.D = textView2;
        textView2.setTag(null);
        TextView textView3 = (TextView) objArr[3];
        this.E = textView3;
        textView3.setTag(null);
        TextView textView4 = (TextView) objArr[4];
        this.F = textView4;
        textView4.setTag(null);
        P(view);
        B();
    }
}
