package com.google.android.material.chip;

import android.R;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
import android.graphics.PorterDuff;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.InsetDrawable;
import android.graphics.drawable.RippleDrawable;
import android.text.TextPaint;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.PointerIcon;
import android.view.View;
import android.view.ViewParent;
import android.view.accessibility.AccessibilityNodeInfo;
import android.widget.CompoundButton;
import android.widget.TextView;
import androidx.annotation.AnimatorRes;
import androidx.annotation.BoolRes;
import androidx.annotation.ColorRes;
import androidx.annotation.DimenRes;
import androidx.annotation.DrawableRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.Px;
import androidx.annotation.RestrictTo;
import androidx.annotation.StringRes;
import androidx.annotation.StyleRes;
import androidx.appcompat.widget.AppCompatCheckBox;
import androidx.core.view.s1;
import com.bumptech.glide.f;
import com.google.android.material.chip.Chip;
import com.google.android.material.internal.j0;
import com.google.android.material.internal.n;
import com.google.android.material.internal.o;
import com.google.android.material.internal.q0;
import com.google.android.material.shape.g0;
import com.google.android.material.shape.s;
import f9.b;
import f9.c;
import f9.d;
import f9.e;
import q9.g;
import r9.a;
import x8.l;
import x8.m;

/* JADX INFO: loaded from: classes2.dex */
public class Chip extends AppCompatCheckBox implements d, g0, o {
    public static final int T = l.Widget_MaterialComponents_Chip_Action;
    public static final Rect U = new Rect();
    public static final int[] V = {R.attr.state_selected};
    public static final int[] W = {R.attr.state_checkable};
    public final Rect Q;
    public final RectF R;
    public final b S;

    @Nullable
    private CharSequence accessibilityClassName;

    @Nullable
    private e chipDrawable;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public boolean f22425e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public boolean f22426f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public boolean f22427g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public boolean f22428h;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    public boolean f22429i;

    @Nullable
    private InsetDrawable insetBackgroundDrawable;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public int f22430j;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public int f22431k;

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    public final c f22432l;

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public boolean f22433m;

    @Nullable
    private CompoundButton.OnCheckedChangeListener onCheckedChangeListener;

    @Nullable
    private n onCheckedChangeListenerInternal;

    @Nullable
    private View.OnClickListener onCloseIconClickListener;

    @Nullable
    private RippleDrawable ripple;

    public Chip(Context context) {
        this(context, null);
    }

    public static void a(Chip chip, CompoundButton compoundButton, boolean z10) {
        n nVar = chip.onCheckedChangeListenerInternal;
        if (nVar != null) {
            Object obj = ((j0) nVar).f22775a;
            com.google.android.material.internal.b bVar = (com.google.android.material.internal.b) obj;
            if (!z10 ? bVar.e(chip, bVar.f22696e) : bVar.a(chip)) {
                ((com.google.android.material.internal.b) obj).d();
            }
        }
        CompoundButton.OnCheckedChangeListener onCheckedChangeListener = chip.onCheckedChangeListener;
        if (onCheckedChangeListener != null) {
            onCheckedChangeListener.onCheckedChanged(compoundButton, z10);
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    @NonNull
    public RectF getCloseIconTouchBounds() {
        RectF rectF = this.R;
        rectF.setEmpty();
        if (g() && this.onCloseIconClickListener != null) {
            e eVar = this.chipDrawable;
            eVar.L(eVar.getBounds(), rectF);
        }
        return rectF;
    }

    /* JADX INFO: Access modifiers changed from: private */
    @NonNull
    public Rect getCloseIconTouchBoundsInt() {
        RectF closeIconTouchBounds = getCloseIconTouchBounds();
        int i10 = (int) closeIconTouchBounds.left;
        int i11 = (int) closeIconTouchBounds.top;
        int i12 = (int) closeIconTouchBounds.right;
        int i13 = (int) closeIconTouchBounds.bottom;
        Rect rect = this.Q;
        rect.set(i10, i11, i12, i13);
        return rect;
    }

    @Nullable
    private g getTextAppearance() {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            return eVar.getTextAppearance();
        }
        return null;
    }

    private void initMinTouchTarget(Context context, @Nullable AttributeSet attributeSet, int i10) {
        TypedArray typedArrayC = q0.c(context, attributeSet, m.Chip, i10, T, new int[0]);
        this.f22429i = typedArrayC.getBoolean(m.Chip_ensureMinTouchTargetSize, false);
        this.f22431k = (int) Math.ceil(typedArrayC.getDimension(m.Chip_chipMinTouchTargetSize, q9.c.b(context)));
        typedArrayC.recycle();
    }

    private void setCloseIconHovered(boolean z10) {
        if (this.f22427g != z10) {
            this.f22427g = z10;
            refreshDrawableState();
        }
    }

    private void setCloseIconPressed(boolean z10) {
        if (this.f22426f != z10) {
            this.f22426f = z10;
            refreshDrawableState();
        }
    }

    private void unapplyChipDrawable(@Nullable e eVar) {
        if (eVar != null) {
            eVar.setDelegate(null);
        }
    }

    private void validateAttributes(@Nullable AttributeSet attributeSet) {
        if (attributeSet == null) {
            return;
        }
        attributeSet.getAttributeValue("http://schemas.android.com/apk/res/android", "background");
        if (attributeSet.getAttributeValue("http://schemas.android.com/apk/res/android", "drawableLeft") != null) {
            throw new UnsupportedOperationException("Please set left drawable using R.attr#chipIcon.");
        }
        if (attributeSet.getAttributeValue("http://schemas.android.com/apk/res/android", "drawableStart") != null) {
            throw new UnsupportedOperationException("Please set start drawable using R.attr#chipIcon.");
        }
        if (attributeSet.getAttributeValue("http://schemas.android.com/apk/res/android", "drawableEnd") != null) {
            throw new UnsupportedOperationException("Please set end drawable using R.attr#closeIcon.");
        }
        if (attributeSet.getAttributeValue("http://schemas.android.com/apk/res/android", "drawableRight") != null) {
            throw new UnsupportedOperationException("Please set end drawable using R.attr#closeIcon.");
        }
        if (!attributeSet.getAttributeBooleanValue("http://schemas.android.com/apk/res/android", "singleLine", true) || attributeSet.getAttributeIntValue("http://schemas.android.com/apk/res/android", "lines", 1) != 1 || attributeSet.getAttributeIntValue("http://schemas.android.com/apk/res/android", "minLines", 1) != 1 || attributeSet.getAttributeIntValue("http://schemas.android.com/apk/res/android", "maxLines", 1) != 1) {
            throw new UnsupportedOperationException("Chip does not support multi-line text");
        }
        attributeSet.getAttributeIntValue("http://schemas.android.com/apk/res/android", "gravity", 8388627);
    }

    @Override // android.view.View
    public final boolean dispatchHoverEvent(MotionEvent motionEvent) {
        return !this.f22433m ? super.dispatchHoverEvent(motionEvent) : this.f22432l.k(motionEvent) || super.dispatchHoverEvent(motionEvent);
    }

    @Override // android.view.View
    public final boolean dispatchKeyEvent(KeyEvent keyEvent) {
        if (!this.f22433m) {
            return super.dispatchKeyEvent(keyEvent);
        }
        c cVar = this.f22432l;
        if (!cVar.l(keyEvent) || cVar.f36670l == Integer.MIN_VALUE) {
            return super.dispatchKeyEvent(keyEvent);
        }
        return true;
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Type inference failed for: r1v0, types: [boolean, int] */
    @Override // androidx.appcompat.widget.AppCompatCheckBox, android.widget.CompoundButton, android.widget.TextView, android.view.View
    public final void drawableStateChanged() {
        super.drawableStateChanged();
        e eVar = this.chipDrawable;
        if (eVar == null || !eVar.O()) {
            return;
        }
        e eVar2 = this.chipDrawable;
        ?? IsEnabled = isEnabled();
        int i10 = IsEnabled;
        if (this.f22428h) {
            i10 = IsEnabled + 1;
        }
        int i11 = i10;
        if (this.f22427g) {
            i11 = i10 + 1;
        }
        int i12 = i11;
        if (this.f22426f) {
            i12 = i11 + 1;
        }
        int i13 = i12;
        if (isChecked()) {
            i13 = i12 + 1;
        }
        int[] iArr = new int[i13];
        int i14 = 0;
        if (isEnabled()) {
            iArr[0] = 16842910;
            i14 = 1;
        }
        if (this.f22428h) {
            iArr[i14] = 16842908;
            i14++;
        }
        if (this.f22427g) {
            iArr[i14] = 16843623;
            i14++;
        }
        if (this.f22426f) {
            iArr[i14] = 16842919;
            i14++;
        }
        if (isChecked()) {
            iArr[i14] = 16842913;
        }
        if (eVar2.b0(iArr)) {
            invalidate();
        }
    }

    public final void f(int i10) {
        this.f22431k = i10;
        if (!this.f22429i) {
            InsetDrawable insetDrawable = this.insetBackgroundDrawable;
            if (insetDrawable == null) {
                l();
                return;
            } else {
                if (insetDrawable != null) {
                    this.insetBackgroundDrawable = null;
                    setMinWidth(0);
                    setMinHeight((int) getChipMinHeight());
                    l();
                    return;
                }
                return;
            }
        }
        int iMax = Math.max(0, i10 - ((int) this.chipDrawable.f25957e0));
        int iMax2 = Math.max(0, i10 - this.chipDrawable.getIntrinsicWidth());
        if (iMax2 <= 0 && iMax <= 0) {
            InsetDrawable insetDrawable2 = this.insetBackgroundDrawable;
            if (insetDrawable2 == null) {
                l();
                return;
            } else {
                if (insetDrawable2 != null) {
                    this.insetBackgroundDrawable = null;
                    setMinWidth(0);
                    setMinHeight((int) getChipMinHeight());
                    l();
                    return;
                }
                return;
            }
        }
        int i11 = iMax2 > 0 ? iMax2 / 2 : 0;
        int i12 = iMax > 0 ? iMax / 2 : 0;
        if (this.insetBackgroundDrawable != null) {
            Rect rect = new Rect();
            this.insetBackgroundDrawable.getPadding(rect);
            if (rect.top == i12 && rect.bottom == i12 && rect.left == i11 && rect.right == i11) {
                l();
                return;
            }
        }
        if (getMinHeight() != i10) {
            setMinHeight(i10);
        }
        if (getMinWidth() != i10) {
            setMinWidth(i10);
        }
        this.insetBackgroundDrawable = new InsetDrawable((Drawable) this.chipDrawable, i11, i12, i11, i12);
        l();
    }

    public final boolean g() {
        e eVar = this.chipDrawable;
        return (eVar == null || eVar.getCloseIcon() == null) ? false : true;
    }

    @Override // android.widget.CheckBox, android.widget.CompoundButton, android.widget.Button, android.widget.TextView, android.view.View
    @NonNull
    public CharSequence getAccessibilityClassName() {
        if (!TextUtils.isEmpty(this.accessibilityClassName)) {
            return this.accessibilityClassName;
        }
        if (!h()) {
            return isClickable() ? "android.widget.Button" : "android.view.View";
        }
        ViewParent parent = getParent();
        return ((parent instanceof ChipGroup) && ((ChipGroup) parent).f22437g.f22695d) ? "android.widget.RadioButton" : "android.widget.Button";
    }

    @Nullable
    public Drawable getBackgroundDrawable() {
        InsetDrawable insetDrawable = this.insetBackgroundDrawable;
        return insetDrawable == null ? this.chipDrawable : insetDrawable;
    }

    @Nullable
    public Drawable getCheckedIcon() {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            return eVar.getCheckedIcon();
        }
        return null;
    }

    @Nullable
    public ColorStateList getCheckedIconTint() {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            return eVar.getCheckedIconTint();
        }
        return null;
    }

    @Nullable
    public ColorStateList getChipBackgroundColor() {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            return eVar.getChipBackgroundColor();
        }
        return null;
    }

    public float getChipCornerRadius() {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            return Math.max(0.0f, eVar.N());
        }
        return 0.0f;
    }

    public Drawable getChipDrawable() {
        return this.chipDrawable;
    }

    public float getChipEndPadding() {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            return eVar.f25974v0;
        }
        return 0.0f;
    }

    @Nullable
    public Drawable getChipIcon() {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            return eVar.getChipIcon();
        }
        return null;
    }

    public float getChipIconSize() {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            return eVar.f25961i0;
        }
        return 0.0f;
    }

    @Nullable
    public ColorStateList getChipIconTint() {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            return eVar.getChipIconTint();
        }
        return null;
    }

    public float getChipMinHeight() {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            return eVar.f25957e0;
        }
        return 0.0f;
    }

    public float getChipStartPadding() {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            return eVar.f25967o0;
        }
        return 0.0f;
    }

    @Nullable
    public ColorStateList getChipStrokeColor() {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            return eVar.getChipStrokeColor();
        }
        return null;
    }

    public float getChipStrokeWidth() {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            return eVar.f25959g0;
        }
        return 0.0f;
    }

    @Deprecated
    public CharSequence getChipText() {
        return getText();
    }

    @Nullable
    public Drawable getCloseIcon() {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            return eVar.getCloseIcon();
        }
        return null;
    }

    @Nullable
    public CharSequence getCloseIconContentDescription() {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            return eVar.getCloseIconContentDescription();
        }
        return null;
    }

    public float getCloseIconEndPadding() {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            return eVar.f25973u0;
        }
        return 0.0f;
    }

    public float getCloseIconSize() {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            return eVar.f25964l0;
        }
        return 0.0f;
    }

    public float getCloseIconStartPadding() {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            return eVar.f25972t0;
        }
        return 0.0f;
    }

    @Nullable
    public ColorStateList getCloseIconTint() {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            return eVar.getCloseIconTint();
        }
        return null;
    }

    @Override // android.widget.TextView
    @Nullable
    public TextUtils.TruncateAt getEllipsize() {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            return eVar.P0;
        }
        return null;
    }

    @Override // android.widget.TextView, android.view.View
    public final void getFocusedRect(Rect rect) {
        if (this.f22433m) {
            c cVar = this.f22432l;
            if (cVar.f36670l == 1 || cVar.f36669k == 1) {
                rect.set(getCloseIconTouchBoundsInt());
                return;
            }
        }
        super.getFocusedRect(rect);
    }

    @Nullable
    public y8.g getHideMotionSpec() {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            return eVar.getHideMotionSpec();
        }
        return null;
    }

    public float getIconEndPadding() {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            return eVar.f25969q0;
        }
        return 0.0f;
    }

    public float getIconStartPadding() {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            return eVar.f25968p0;
        }
        return 0.0f;
    }

    @Nullable
    public ColorStateList getRippleColor() {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            return eVar.getRippleColor();
        }
        return null;
    }

    @NonNull
    public s getShapeAppearanceModel() {
        return this.chipDrawable.f23095b.f23068a;
    }

    @Nullable
    public y8.g getShowMotionSpec() {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            return eVar.getShowMotionSpec();
        }
        return null;
    }

    public float getTextEndPadding() {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            return eVar.f25971s0;
        }
        return 0.0f;
    }

    public float getTextStartPadding() {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            return eVar.f25970r0;
        }
        return 0.0f;
    }

    public final boolean h() {
        e eVar = this.chipDrawable;
        return eVar != null && eVar.f25965m0;
    }

    public final boolean i() {
        e eVar = this.chipDrawable;
        return eVar != null && eVar.f25963k0;
    }

    public final boolean j() {
        boolean z10 = false;
        playSoundEffect(0);
        View.OnClickListener onClickListener = this.onCloseIconClickListener;
        if (onClickListener != null) {
            onClickListener.onClick(this);
            z10 = true;
        }
        if (this.f22433m) {
            this.f22432l.u(1, 1);
        }
        return z10;
    }

    public final void k() {
        if (g() && i() && this.onCloseIconClickListener != null) {
            s1.setAccessibilityDelegate(this, this.f22432l);
            this.f22433m = true;
        } else {
            s1.setAccessibilityDelegate(this, null);
            this.f22433m = false;
        }
    }

    public final void l() {
        this.ripple = new RippleDrawable(a.sanitizeRippleDrawableColor(this.chipDrawable.getRippleColor()), getBackgroundDrawable(), null);
        e eVar = this.chipDrawable;
        if (eVar.N0) {
            eVar.N0 = false;
            eVar.i0();
            eVar.onStateChange(eVar.getState());
        }
        setBackground(this.ripple);
        m();
    }

    public final void m() {
        e eVar;
        if (TextUtils.isEmpty(getText()) || (eVar = this.chipDrawable) == null) {
            return;
        }
        int iM = (int) (eVar.M() + eVar.f25974v0 + eVar.f25971s0);
        e eVar2 = this.chipDrawable;
        int iJ = (int) (eVar2.J() + eVar2.f25967o0 + eVar2.f25970r0);
        if (this.insetBackgroundDrawable != null) {
            Rect rect = new Rect();
            this.insetBackgroundDrawable.getPadding(rect);
            iJ += rect.left;
            iM += rect.right;
        }
        setPaddingRelative(iJ, getPaddingTop(), iM, getPaddingBottom());
    }

    public final void n() {
        TextPaint paint = getPaint();
        e eVar = this.chipDrawable;
        if (eVar != null) {
            paint.drawableState = eVar.getState();
        }
        g textAppearance = getTextAppearance();
        if (textAppearance != null) {
            textAppearance.d(getContext(), paint, this.S);
        }
    }

    @Override // android.widget.TextView, android.view.View
    public final void onAttachedToWindow() {
        super.onAttachedToWindow();
        f.v(this, this.chipDrawable);
    }

    @Override // android.widget.CompoundButton, android.widget.TextView, android.view.View
    public final int[] onCreateDrawableState(int i10) {
        int[] iArrOnCreateDrawableState = super.onCreateDrawableState(i10 + 2);
        if (isChecked()) {
            View.mergeDrawableStates(iArrOnCreateDrawableState, V);
        }
        if (h()) {
            View.mergeDrawableStates(iArrOnCreateDrawableState, W);
        }
        return iArrOnCreateDrawableState;
    }

    @Override // android.widget.TextView, android.view.View
    public final void onFocusChanged(boolean z10, int i10, Rect rect) {
        super.onFocusChanged(z10, i10, rect);
        if (this.f22433m) {
            this.f22432l.onFocusChanged(z10, i10, rect);
        }
    }

    @Override // android.view.View
    public final boolean onHoverEvent(MotionEvent motionEvent) {
        int actionMasked = motionEvent.getActionMasked();
        if (actionMasked == 7) {
            setCloseIconHovered(getCloseIconTouchBounds().contains(motionEvent.getX(), motionEvent.getY()));
        } else if (actionMasked == 10) {
            setCloseIconHovered(false);
        }
        return super.onHoverEvent(motionEvent);
    }

    @Override // android.view.View
    public final void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo accessibilityNodeInfo) {
        super.onInitializeAccessibilityNodeInfo(accessibilityNodeInfo);
        accessibilityNodeInfo.setClassName(getAccessibilityClassName());
        accessibilityNodeInfo.setCheckable(h());
        accessibilityNodeInfo.setClickable(isClickable());
        if (getParent() instanceof ChipGroup) {
            ChipGroup chipGroup = (ChipGroup) getParent();
            q0.f fVar = new q0.f(accessibilityNodeInfo);
            int indexOfChip = chipGroup.f22670c ? chipGroup.getIndexOfChip(this) : -1;
            Object tag = getTag(x8.g.row_index_key);
            fVar.l(q0.d.a(tag instanceof Integer ? ((Integer) tag).intValue() : -1, 1, indexOfChip, 1, false, isChecked()));
        }
    }

    @Override // android.widget.Button, android.widget.TextView, android.view.View
    @Nullable
    @TargetApi(24)
    public PointerIcon onResolvePointerIcon(@NonNull MotionEvent motionEvent, int i10) {
        return (getCloseIconTouchBounds().contains(motionEvent.getX(), motionEvent.getY()) && isEnabled()) ? PointerIcon.getSystemIcon(getContext(), 1002) : super.onResolvePointerIcon(motionEvent, i10);
    }

    @Override // android.widget.TextView, android.view.View
    public final void onRtlPropertiesChanged(int i10) {
        super.onRtlPropertiesChanged(i10);
        if (this.f22430j != i10) {
            this.f22430j = i10;
            m();
        }
    }

    /* JADX WARN: Code restructure failed: missing block: B:8:0x001e, code lost:
    
        if (r0 != 3) goto L23;
     */
    /* JADX WARN: Removed duplicated region for block: B:30:? A[RETURN, SYNTHETIC] */
    @Override // android.widget.TextView, android.view.View
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final boolean onTouchEvent(MotionEvent motionEvent) {
        boolean z10;
        int actionMasked = motionEvent.getActionMasked();
        boolean zContains = getCloseIconTouchBounds().contains(motionEvent.getX(), motionEvent.getY());
        if (actionMasked != 0) {
            if (actionMasked == 1) {
                if (this.f22426f) {
                    j();
                    z10 = true;
                }
                setCloseIconPressed(false);
                if (z10) {
                    return true;
                }
            } else if (actionMasked == 2) {
                if (this.f22426f) {
                    if (zContains) {
                        return true;
                    }
                    setCloseIconPressed(false);
                    return true;
                }
            }
            z10 = false;
            setCloseIconPressed(false);
            if (z10) {
            }
        } else if (zContains) {
            setCloseIconPressed(true);
            return true;
        }
        return super.onTouchEvent(motionEvent);
    }

    public void setAccessibilityClassName(@Nullable CharSequence charSequence) {
        this.accessibilityClassName = charSequence;
    }

    @Override // android.view.View
    public void setBackground(Drawable drawable) {
        if (drawable == getBackgroundDrawable() || drawable == this.ripple) {
            super.setBackground(drawable);
        }
    }

    @Override // android.view.View
    public void setBackgroundColor(int i10) {
    }

    @Override // androidx.appcompat.widget.AppCompatCheckBox, android.view.View
    public void setBackgroundDrawable(Drawable drawable) {
        if (drawable == getBackgroundDrawable() || drawable == this.ripple) {
            super.setBackgroundDrawable(drawable);
        }
    }

    @Override // androidx.appcompat.widget.AppCompatCheckBox, android.view.View
    public void setBackgroundResource(int i10) {
    }

    @Override // android.view.View
    public void setBackgroundTintList(@Nullable ColorStateList colorStateList) {
    }

    @Override // android.view.View
    public void setBackgroundTintMode(@Nullable PorterDuff.Mode mode) {
    }

    public void setCheckable(boolean z10) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.S(z10);
        }
    }

    public void setCheckableResource(@BoolRes int i10) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.S(eVar.f25975w0.getResources().getBoolean(i10));
        }
    }

    @Override // android.widget.CompoundButton, android.widget.Checkable
    public void setChecked(boolean z10) {
        e eVar = this.chipDrawable;
        if (eVar == null) {
            this.f22425e = z10;
        } else if (eVar.f25965m0) {
            super.setChecked(z10);
        }
    }

    public void setCheckedIcon(@Nullable Drawable drawable) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.setCheckedIcon(drawable);
        }
    }

    @Deprecated
    public void setCheckedIconEnabled(boolean z10) {
        setCheckedIconVisible(z10);
    }

    @Deprecated
    public void setCheckedIconEnabledResource(@BoolRes int i10) {
        setCheckedIconVisible(i10);
    }

    public void setCheckedIconResource(@DrawableRes int i10) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.setCheckedIcon(f.a.getDrawable(eVar.f25975w0, i10));
        }
    }

    public void setCheckedIconTint(@Nullable ColorStateList colorStateList) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.setCheckedIconTint(colorStateList);
        }
    }

    public void setCheckedIconTintResource(@ColorRes int i10) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.setCheckedIconTint(g0.d.getColorStateList(eVar.f25975w0, i10));
        }
    }

    public void setCheckedIconVisible(boolean z10) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.T(z10);
        }
    }

    public void setChipBackgroundColor(@Nullable ColorStateList colorStateList) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.setChipBackgroundColor(colorStateList);
        }
    }

    public void setChipBackgroundColorResource(@ColorRes int i10) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.setChipBackgroundColor(g0.d.getColorStateList(eVar.f25975w0, i10));
        }
    }

    @Deprecated
    public void setChipCornerRadius(float f10) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.U(f10);
        }
    }

    @Deprecated
    public void setChipCornerRadiusResource(@DimenRes int i10) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.U(eVar.f25975w0.getResources().getDimension(i10));
        }
    }

    public void setChipDrawable(@NonNull e eVar) {
        e eVar2 = this.chipDrawable;
        if (eVar2 != eVar) {
            unapplyChipDrawable(eVar2);
            this.chipDrawable = eVar;
            eVar.Q0 = false;
            eVar.setDelegate(this);
            f(this.f22431k);
        }
    }

    public void setChipEndPadding(float f10) {
        e eVar = this.chipDrawable;
        if (eVar == null || eVar.f25974v0 == f10) {
            return;
        }
        eVar.f25974v0 = f10;
        eVar.invalidateSelf();
        eVar.P();
    }

    public void setChipEndPaddingResource(@DimenRes int i10) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            float dimension = eVar.f25975w0.getResources().getDimension(i10);
            if (eVar.f25974v0 != dimension) {
                eVar.f25974v0 = dimension;
                eVar.invalidateSelf();
                eVar.P();
            }
        }
    }

    public void setChipIcon(@Nullable Drawable drawable) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.setChipIcon(drawable);
        }
    }

    @Deprecated
    public void setChipIconEnabled(boolean z10) {
        setChipIconVisible(z10);
    }

    @Deprecated
    public void setChipIconEnabledResource(@BoolRes int i10) {
        setChipIconVisible(i10);
    }

    public void setChipIconResource(@DrawableRes int i10) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.setChipIcon(f.a.getDrawable(eVar.f25975w0, i10));
        }
    }

    public void setChipIconSize(float f10) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.V(f10);
        }
    }

    public void setChipIconSizeResource(@DimenRes int i10) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.V(eVar.f25975w0.getResources().getDimension(i10));
        }
    }

    public void setChipIconTint(@Nullable ColorStateList colorStateList) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.setChipIconTint(colorStateList);
        }
    }

    public void setChipIconTintResource(@ColorRes int i10) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.setChipIconTint(g0.d.getColorStateList(eVar.f25975w0, i10));
        }
    }

    public void setChipIconVisible(boolean z10) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.W(z10);
        }
    }

    public void setChipMinHeight(float f10) {
        e eVar = this.chipDrawable;
        if (eVar == null || eVar.f25957e0 == f10) {
            return;
        }
        eVar.f25957e0 = f10;
        eVar.invalidateSelf();
        eVar.P();
    }

    public void setChipMinHeightResource(@DimenRes int i10) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            float dimension = eVar.f25975w0.getResources().getDimension(i10);
            if (eVar.f25957e0 != dimension) {
                eVar.f25957e0 = dimension;
                eVar.invalidateSelf();
                eVar.P();
            }
        }
    }

    public void setChipStartPadding(float f10) {
        e eVar = this.chipDrawable;
        if (eVar == null || eVar.f25967o0 == f10) {
            return;
        }
        eVar.f25967o0 = f10;
        eVar.invalidateSelf();
        eVar.P();
    }

    public void setChipStartPaddingResource(@DimenRes int i10) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            float dimension = eVar.f25975w0.getResources().getDimension(i10);
            if (eVar.f25967o0 != dimension) {
                eVar.f25967o0 = dimension;
                eVar.invalidateSelf();
                eVar.P();
            }
        }
    }

    public void setChipStrokeColor(@Nullable ColorStateList colorStateList) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.setChipStrokeColor(colorStateList);
        }
    }

    public void setChipStrokeColorResource(@ColorRes int i10) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.setChipStrokeColor(g0.d.getColorStateList(eVar.f25975w0, i10));
        }
    }

    public void setChipStrokeWidth(float f10) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.X(f10);
        }
    }

    public void setChipStrokeWidthResource(@DimenRes int i10) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.X(eVar.f25975w0.getResources().getDimension(i10));
        }
    }

    @Deprecated
    public void setChipText(@Nullable CharSequence charSequence) {
        setText(charSequence);
    }

    @Deprecated
    public void setChipTextResource(@StringRes int i10) {
        setText(getResources().getString(i10));
    }

    public void setCloseIcon(@Nullable Drawable drawable) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.setCloseIcon(drawable);
        }
        k();
    }

    public void setCloseIconContentDescription(@Nullable CharSequence charSequence) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.setCloseIconContentDescription(charSequence);
        }
    }

    @Deprecated
    public void setCloseIconEnabled(boolean z10) {
        setCloseIconVisible(z10);
    }

    @Deprecated
    public void setCloseIconEnabledResource(@BoolRes int i10) {
        setCloseIconVisible(i10);
    }

    public void setCloseIconEndPadding(float f10) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.Y(f10);
        }
    }

    public void setCloseIconEndPaddingResource(@DimenRes int i10) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.Y(eVar.f25975w0.getResources().getDimension(i10));
        }
    }

    public void setCloseIconResource(@DrawableRes int i10) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.setCloseIcon(f.a.getDrawable(eVar.f25975w0, i10));
        }
        k();
    }

    public void setCloseIconSize(float f10) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.Z(f10);
        }
    }

    public void setCloseIconSizeResource(@DimenRes int i10) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.Z(eVar.f25975w0.getResources().getDimension(i10));
        }
    }

    public void setCloseIconStartPadding(float f10) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.a0(f10);
        }
    }

    public void setCloseIconStartPaddingResource(@DimenRes int i10) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.a0(eVar.f25975w0.getResources().getDimension(i10));
        }
    }

    public void setCloseIconTint(@Nullable ColorStateList colorStateList) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.setCloseIconTint(colorStateList);
        }
    }

    public void setCloseIconTintResource(@ColorRes int i10) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.setCloseIconTint(g0.d.getColorStateList(eVar.f25975w0, i10));
        }
    }

    public void setCloseIconVisible(@BoolRes int i10) {
        setCloseIconVisible(getResources().getBoolean(i10));
    }

    @Override // androidx.appcompat.widget.AppCompatCheckBox, android.widget.TextView
    public void setCompoundDrawables(@Nullable Drawable drawable, @Nullable Drawable drawable2, @Nullable Drawable drawable3, @Nullable Drawable drawable4) {
        if (drawable != null) {
            throw new UnsupportedOperationException("Please set start drawable using R.attr#chipIcon.");
        }
        if (drawable3 != null) {
            throw new UnsupportedOperationException("Please set end drawable using R.attr#closeIcon.");
        }
        super.setCompoundDrawables(drawable, drawable2, drawable3, drawable4);
    }

    @Override // androidx.appcompat.widget.AppCompatCheckBox, android.widget.TextView
    public void setCompoundDrawablesRelative(@Nullable Drawable drawable, @Nullable Drawable drawable2, @Nullable Drawable drawable3, @Nullable Drawable drawable4) {
        if (drawable != null) {
            throw new UnsupportedOperationException("Please set start drawable using R.attr#chipIcon.");
        }
        if (drawable3 != null) {
            throw new UnsupportedOperationException("Please set end drawable using R.attr#closeIcon.");
        }
        super.setCompoundDrawablesRelative(drawable, drawable2, drawable3, drawable4);
    }

    @Override // android.widget.TextView
    public void setCompoundDrawablesRelativeWithIntrinsicBounds(int i10, int i11, int i12, int i13) {
        if (i10 != 0) {
            throw new UnsupportedOperationException("Please set start drawable using R.attr#chipIcon.");
        }
        if (i12 != 0) {
            throw new UnsupportedOperationException("Please set end drawable using R.attr#closeIcon.");
        }
        super.setCompoundDrawablesRelativeWithIntrinsicBounds(i10, i11, i12, i13);
    }

    @Override // android.widget.TextView
    public void setCompoundDrawablesWithIntrinsicBounds(int i10, int i11, int i12, int i13) {
        if (i10 != 0) {
            throw new UnsupportedOperationException("Please set start drawable using R.attr#chipIcon.");
        }
        if (i12 != 0) {
            throw new UnsupportedOperationException("Please set end drawable using R.attr#closeIcon.");
        }
        super.setCompoundDrawablesWithIntrinsicBounds(i10, i11, i12, i13);
    }

    @Override // android.view.View
    public void setElevation(float f10) {
        super.setElevation(f10);
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.w(f10);
        }
    }

    @Override // android.widget.TextView
    public void setEllipsize(TextUtils.TruncateAt truncateAt) {
        if (this.chipDrawable == null) {
            return;
        }
        if (truncateAt == TextUtils.TruncateAt.MARQUEE) {
            throw new UnsupportedOperationException("Text within a chip are not allowed to scroll.");
        }
        super.setEllipsize(truncateAt);
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.setEllipsize(truncateAt);
        }
    }

    public void setEnsureMinTouchTargetSize(boolean z10) {
        this.f22429i = z10;
        f(this.f22431k);
    }

    @Override // android.widget.TextView
    public void setGravity(int i10) {
        if (i10 != 8388627) {
            return;
        }
        super.setGravity(i10);
    }

    public void setHideMotionSpec(@Nullable y8.g gVar) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.setHideMotionSpec(gVar);
        }
    }

    public void setHideMotionSpecResource(@AnimatorRes int i10) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.setHideMotionSpec(y8.g.createFromResource(eVar.f25975w0, i10));
        }
    }

    public void setIconEndPadding(float f10) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.d0(f10);
        }
    }

    public void setIconEndPaddingResource(@DimenRes int i10) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.d0(eVar.f25975w0.getResources().getDimension(i10));
        }
    }

    public void setIconStartPadding(float f10) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.e0(f10);
        }
    }

    public void setIconStartPaddingResource(@DimenRes int i10) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.e0(eVar.f25975w0.getResources().getDimension(i10));
        }
    }

    @Override // com.google.android.material.internal.o
    @RestrictTo({RestrictTo.Scope.f556b})
    public void setInternalOnCheckedChangeListener(@Nullable n nVar) {
        this.onCheckedChangeListenerInternal = nVar;
    }

    @Override // android.view.View
    public void setLayoutDirection(int i10) {
        if (this.chipDrawable == null) {
            return;
        }
        super.setLayoutDirection(i10);
    }

    @Override // android.widget.TextView
    public void setLines(int i10) {
        if (i10 > 1) {
            throw new UnsupportedOperationException("Chip does not support multi-line text");
        }
        super.setLines(i10);
    }

    @Override // android.widget.TextView
    public void setMaxLines(int i10) {
        if (i10 > 1) {
            throw new UnsupportedOperationException("Chip does not support multi-line text");
        }
        super.setMaxLines(i10);
    }

    @Override // android.widget.TextView
    public void setMaxWidth(@Px int i10) {
        super.setMaxWidth(i10);
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.R0 = i10;
        }
    }

    @Override // android.widget.TextView
    public void setMinLines(int i10) {
        if (i10 > 1) {
            throw new UnsupportedOperationException("Chip does not support multi-line text");
        }
        super.setMinLines(i10);
    }

    @Override // android.widget.CompoundButton
    public void setOnCheckedChangeListener(@Nullable CompoundButton.OnCheckedChangeListener onCheckedChangeListener) {
        this.onCheckedChangeListener = onCheckedChangeListener;
    }

    public void setOnCloseIconClickListener(View.OnClickListener onClickListener) {
        this.onCloseIconClickListener = onClickListener;
        k();
    }

    public void setRippleColor(@Nullable ColorStateList colorStateList) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.setRippleColor(colorStateList);
        }
        if (this.chipDrawable.N0) {
            return;
        }
        l();
    }

    public void setRippleColorResource(@ColorRes int i10) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.setRippleColor(g0.d.getColorStateList(eVar.f25975w0, i10));
            if (this.chipDrawable.N0) {
                return;
            }
            l();
        }
    }

    @Override // com.google.android.material.shape.g0
    public void setShapeAppearanceModel(@NonNull s sVar) {
        this.chipDrawable.setShapeAppearanceModel(sVar);
    }

    public void setShowMotionSpec(@Nullable y8.g gVar) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.setShowMotionSpec(gVar);
        }
    }

    public void setShowMotionSpecResource(@AnimatorRes int i10) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.setShowMotionSpec(y8.g.createFromResource(eVar.f25975w0, i10));
        }
    }

    @Override // android.widget.TextView
    public void setSingleLine(boolean z10) {
        if (!z10) {
            throw new UnsupportedOperationException("Chip does not support multi-line text");
        }
        super.setSingleLine(z10);
    }

    @Override // android.widget.TextView
    public void setText(CharSequence charSequence, TextView.BufferType bufferType) {
        e eVar = this.chipDrawable;
        if (eVar == null) {
            return;
        }
        if (charSequence == null) {
            charSequence = "";
        }
        super.setText(eVar.Q0 ? null : charSequence, bufferType);
        e eVar2 = this.chipDrawable;
        if (eVar2 != null) {
            eVar2.setText(charSequence);
        }
    }

    public void setTextAppearance(@Nullable g gVar) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.setTextAppearance(gVar);
        }
        n();
    }

    public void setTextAppearanceResource(@StyleRes int i10) {
        setTextAppearance(getContext(), i10);
    }

    public void setTextEndPadding(float f10) {
        e eVar = this.chipDrawable;
        if (eVar == null || eVar.f25971s0 == f10) {
            return;
        }
        eVar.f25971s0 = f10;
        eVar.invalidateSelf();
        eVar.P();
    }

    public void setTextEndPaddingResource(@DimenRes int i10) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            float dimension = eVar.f25975w0.getResources().getDimension(i10);
            if (eVar.f25971s0 != dimension) {
                eVar.f25971s0 = dimension;
                eVar.invalidateSelf();
                eVar.P();
            }
        }
    }

    @Override // android.widget.TextView
    public void setTextSize(int i10, float f10) {
        super.setTextSize(i10, f10);
        e eVar = this.chipDrawable;
        if (eVar != null) {
            float fApplyDimension = TypedValue.applyDimension(i10, f10, getResources().getDisplayMetrics());
            g textAppearance = eVar.getTextAppearance();
            if (textAppearance != null) {
                textAppearance.f32262h = fApplyDimension;
                eVar.C0.f22792a.setTextSize(fApplyDimension);
                eVar.a();
            }
        }
        n();
    }

    public void setTextStartPadding(float f10) {
        e eVar = this.chipDrawable;
        if (eVar == null || eVar.f25970r0 == f10) {
            return;
        }
        eVar.f25970r0 = f10;
        eVar.invalidateSelf();
        eVar.P();
    }

    public void setTextStartPaddingResource(@DimenRes int i10) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            float dimension = eVar.f25975w0.getResources().getDimension(i10);
            if (eVar.f25970r0 != dimension) {
                eVar.f25970r0 = dimension;
                eVar.invalidateSelf();
                eVar.P();
            }
        }
    }

    public Chip(Context context, AttributeSet attributeSet) {
        this(context, attributeSet, x8.c.chipStyle);
    }

    public void setCheckedIconVisible(@BoolRes int i10) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.T(eVar.f25975w0.getResources().getBoolean(i10));
        }
    }

    public void setChipIconVisible(@BoolRes int i10) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.W(eVar.f25975w0.getResources().getBoolean(i10));
        }
    }

    public void setCloseIconVisible(boolean z10) {
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.c0(z10);
        }
        k();
    }

    /* JADX WARN: Illegal instructions before constructor call */
    public Chip(Context context, AttributeSet attributeSet, int i10) {
        int i11 = T;
        super(x9.a.wrap(context, attributeSet, i10, i11), attributeSet, i10);
        this.Q = new Rect();
        this.R = new RectF();
        this.S = new b(this, 0);
        Context context2 = getContext();
        validateAttributes(attributeSet);
        e eVarCreateFromAttributes = e.createFromAttributes(context2, attributeSet, i10, i11);
        initMinTouchTarget(context2, attributeSet, i10);
        setChipDrawable(eVarCreateFromAttributes);
        eVarCreateFromAttributes.w(getElevation());
        TypedArray typedArrayC = q0.c(context2, attributeSet, m.Chip, i10, i11, new int[0]);
        boolean zHasValue = typedArrayC.hasValue(m.Chip_shapeAppearance);
        typedArrayC.recycle();
        this.f22432l = new c(this, this);
        k();
        if (!zHasValue) {
            setOutlineProvider(new b0.a(this, 2));
        }
        setChecked(this.f22425e);
        setText(eVarCreateFromAttributes.getText());
        setEllipsize(eVarCreateFromAttributes.P0);
        n();
        if (!this.chipDrawable.Q0) {
            setLines(1);
            setHorizontallyScrolling(true);
        }
        setGravity(8388627);
        m();
        if (this.f22429i) {
            setMinHeight(this.f22431k);
        }
        this.f22430j = getLayoutDirection();
        super.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { // from class: f9.a
            @Override // android.widget.CompoundButton.OnCheckedChangeListener
            public final void onCheckedChanged(CompoundButton compoundButton, boolean z10) {
                Chip.a(this.f25953a, compoundButton, z10);
            }
        });
    }

    @Override // android.widget.TextView
    public void setTextAppearance(Context context, int i10) {
        super.setTextAppearance(context, i10);
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.setTextAppearance(new g(eVar.f25975w0, i10));
        }
        n();
    }

    @Override // android.widget.TextView
    public void setCompoundDrawablesRelativeWithIntrinsicBounds(@Nullable Drawable drawable, @Nullable Drawable drawable2, @Nullable Drawable drawable3, @Nullable Drawable drawable4) {
        if (drawable != null) {
            throw new UnsupportedOperationException("Please set start drawable using R.attr#chipIcon.");
        }
        if (drawable3 == null) {
            super.setCompoundDrawablesRelativeWithIntrinsicBounds(drawable, drawable2, drawable3, drawable4);
            return;
        }
        throw new UnsupportedOperationException("Please set end drawable using R.attr#closeIcon.");
    }

    @Override // android.widget.TextView
    public void setCompoundDrawablesWithIntrinsicBounds(@Nullable Drawable drawable, @Nullable Drawable drawable2, @Nullable Drawable drawable3, @Nullable Drawable drawable4) {
        if (drawable != null) {
            throw new UnsupportedOperationException("Please set left drawable using R.attr#chipIcon.");
        }
        if (drawable3 == null) {
            super.setCompoundDrawablesWithIntrinsicBounds(drawable, drawable2, drawable3, drawable4);
            return;
        }
        throw new UnsupportedOperationException("Please set right drawable using R.attr#closeIcon.");
    }

    @Override // android.widget.TextView
    public void setTextAppearance(int i10) {
        super.setTextAppearance(i10);
        e eVar = this.chipDrawable;
        if (eVar != null) {
            eVar.setTextAppearance(new g(eVar.f25975w0, i10));
        }
        n();
    }
}
