package defpackage;

import android.app.Activity;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.ContextWrapper;
import android.content.res.ColorStateList;
import android.graphics.PorterDuff;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.text.Editable;
import android.text.method.KeyListener;
import android.text.method.NumberKeyListener;
import android.util.AttributeSet;
import android.view.ActionMode;
import android.view.DragEvent;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputConnection;
import android.view.inputmethod.InputMethodManager;
import android.view.textclassifier.TextClassifier;
import android.widget.EditText;
import android.widget.TextView;

/* renamed from: ᵥʤˑˁ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public class C3483 extends EditText implements InterfaceC4415 {

    /* renamed from: ˀᵗᵝᵭ, reason: contains not printable characters */
    public C3588 f13036;

    /* renamed from: ᵡⁱᵥ, reason: contains not printable characters */
    public C0285 f13037;

    /* renamed from: ᵢˇᵭ, reason: contains not printable characters */
    public final C2956 f13038;

    /* renamed from: ᵤᵙᵷ, reason: contains not printable characters */
    public final C2720 f13039;

    /* renamed from: ᵧᵾˀˈ, reason: contains not printable characters */
    public final C1611 f13040;

    /* renamed from: ᵾᵬ, reason: contains not printable characters */
    public final C4497 f13041;

    /* renamed from: ᵿʗᵝʽ, reason: contains not printable characters */
    public final ᵪᵨ f13042;

    public C3483(Context context, AttributeSet attributeSet, int i) {
        super(context, attributeSet, i);
        AbstractC3247.m7608(getContext(), this);
        C1611 c1611 = new C1611(this);
        this.f13040 = c1611;
        c1611.m4617(attributeSet, i);
        C2956 c2956 = new C2956(this);
        this.f13038 = c2956;
        c2956.m7246(attributeSet, i);
        c2956.m7244();
        ᵪᵨ r4 = new ᵪᵨ(6, false);
        r4.ᵢˇᵭ = this;
        this.f13042 = r4;
        this.f13041 = new C4497();
        C2720 c2720 = new C2720(this);
        this.f13039 = c2720;
        c2720.m6749(attributeSet, i);
        KeyListener keyListener = getKeyListener();
        if (keyListener instanceof NumberKeyListener) {
            return;
        }
        boolean zIsFocusable = super.isFocusable();
        boolean zIsClickable = super.isClickable();
        boolean zIsLongClickable = super.isLongClickable();
        int inputType = super.getInputType();
        KeyListener keyListenerM6738 = c2720.m6738(keyListener);
        if (keyListenerM6738 == keyListener) {
            return;
        }
        super.setKeyListener(keyListenerM6738);
        super.setRawInputType(inputType);
        super.setFocusable(zIsFocusable);
        super.setClickable(zIsClickable);
        super.setLongClickable(zIsLongClickable);
    }

    private C0285 getSuperCaller() {
        if (this.f13037 == null) {
            this.f13037 = new C0285(this);
        }
        return this.f13037;
    }

    @Override // android.widget.TextView, android.view.View
    public final void drawableStateChanged() {
        super.drawableStateChanged();
        C1611 c1611 = this.f13040;
        if (c1611 != null) {
            c1611.m4619();
        }
        C2956 c2956 = this.f13038;
        if (c2956 != null) {
            c2956.m7244();
        }
    }

    @Override // android.widget.TextView
    public ActionMode.Callback getCustomSelectionActionModeCallback() {
        return AbstractC0494.m2142(super.getCustomSelectionActionModeCallback());
    }

    @Override // android.widget.TextView
    public String getFontVariationSettings() {
        return getFontVariationSettingsManager().f13404;
    }

    public C3588 getFontVariationSettingsManager() {
        if (this.f13036 == null) {
            this.f13036 = new C3588(this, new C3494(this, 1));
        }
        return this.f13036;
    }

    public ColorStateList getSupportBackgroundTintList() {
        C1611 c1611 = this.f13040;
        if (c1611 != null) {
            return c1611.m4620();
        }
        return null;
    }

    public PorterDuff.Mode getSupportBackgroundTintMode() {
        C1611 c1611 = this.f13040;
        if (c1611 != null) {
            return c1611.m4622();
        }
        return null;
    }

    public ColorStateList getSupportCompoundDrawablesTintList() {
        return this.f13038.m7237();
    }

    public PorterDuff.Mode getSupportCompoundDrawablesTintMode() {
        return this.f13038.m7236();
    }

    @Override // android.widget.EditText, android.widget.TextView
    public Editable getText() {
        return Build.VERSION.SDK_INT >= 28 ? super.getText() : super.getEditableText();
    }

    @Override // android.widget.TextView
    public TextClassifier getTextClassifier() {
        ᵪᵨ r0;
        if (Build.VERSION.SDK_INT >= 28 || (r0 = this.f13042) == null) {
            return super.getTextClassifier();
        }
        TextClassifier textClassifier = (TextClassifier) r0.ᵿʗᵝʽ;
        return textClassifier == null ? AbstractC4618.m9803((TextView) r0.ᵢˇᵭ) : textClassifier;
    }

    @Override // android.widget.TextView
    public Typeface getTypeface() {
        return Build.VERSION.SDK_INT >= 26 ? getFontVariationSettingsManager().f13405 : super.getTypeface();
    }

    @Override // android.widget.TextView, android.view.View
    public final InputConnection onCreateInputConnection(EditorInfo editorInfo) {
        int i;
        String[] strArrM7020;
        InputConnection c0147;
        InputConnection inputConnectionOnCreateInputConnection = super.onCreateInputConnection(editorInfo);
        this.f13038.getClass();
        C2956.m7232(editorInfo, inputConnectionOnCreateInputConnection, this);
        ˉˇʨ.ᵡⁱᵥ(editorInfo, inputConnectionOnCreateInputConnection, this);
        if (inputConnectionOnCreateInputConnection != null && (i = Build.VERSION.SDK_INT) <= 30 && (strArrM7020 = AbstractC2873.m7020(this)) != null) {
            AbstractC3213.m7569(editorInfo, strArrM7020);
            ᵶﾞᴵ r2 = new ᵶﾞᴵ(0, this);
            if (i >= 25) {
                c0147 = new C1915(inputConnectionOnCreateInputConnection, r2);
            } else if (AbstractC3213.m7568(editorInfo).length != 0) {
                c0147 = new C0147(inputConnectionOnCreateInputConnection, r2);
            }
            inputConnectionOnCreateInputConnection = c0147;
        }
        return this.f13039.m6740(inputConnectionOnCreateInputConnection, editorInfo);
    }

    @Override // android.view.View
    public final void onDetachedFromWindow() {
        super.onDetachedFromWindow();
        int i = Build.VERSION.SDK_INT;
        if (i < 30 || i >= 33) {
            return;
        }
        ((InputMethodManager) getContext().getSystemService("input_method")).isActive(this);
    }

    @Override // android.widget.TextView, android.view.View
    public final boolean onDragEvent(DragEvent dragEvent) {
        Activity activity;
        int i = Build.VERSION.SDK_INT;
        if (i < 31 && i >= 24 && dragEvent.getLocalState() == null && AbstractC2873.m7020(this) != null) {
            Context context = getContext();
            while (true) {
                if (!(context instanceof ContextWrapper)) {
                    activity = null;
                    break;
                }
                if (context instanceof Activity) {
                    activity = (Activity) context;
                    break;
                }
                context = ((ContextWrapper) context).getBaseContext();
            }
            if (activity == null) {
                toString();
            } else if (dragEvent.getAction() != 1 && dragEvent.getAction() == 3) {
                AbstractC2602.m6536(dragEvent, this, activity);
                return true;
            }
        }
        return super.onDragEvent(dragEvent);
    }

    @Override // android.widget.EditText, android.widget.TextView
    public final boolean onTextContextMenuItem(int i) {
        InterfaceC1657 c2675;
        int i2 = Build.VERSION.SDK_INT;
        if (i2 >= 31 || AbstractC2873.m7020(this) == null || !(i == 16908322 || i == 16908337)) {
            return super.onTextContextMenuItem(i);
        }
        ClipboardManager clipboardManager = (ClipboardManager) getContext().getSystemService("clipboard");
        ClipData primaryClip = clipboardManager == null ? null : clipboardManager.getPrimaryClip();
        if (primaryClip != null && primaryClip.getItemCount() > 0) {
            if (i2 >= 31) {
                c2675 = new C2675(primaryClip, 1);
            } else {
                C3883 c3883 = new C3883();
                c3883.f14438 = primaryClip;
                c3883.f14436 = 1;
                c2675 = c3883;
            }
            c2675.mo4715(i == 16908322 ? 0 : 1);
            AbstractC2873.m7022(this, c2675.build());
        }
        return true;
    }

    @Override // android.view.View
    public void setBackgroundDrawable(Drawable drawable) {
        super.setBackgroundDrawable(drawable);
        C1611 c1611 = this.f13040;
        if (c1611 != null) {
            c1611.m4618();
        }
    }

    @Override // android.view.View
    public void setBackgroundResource(int i) {
        super.setBackgroundResource(i);
        C1611 c1611 = this.f13040;
        if (c1611 != null) {
            c1611.m4602(i);
        }
    }

    @Override // android.widget.TextView
    public final void setCompoundDrawables(Drawable drawable, Drawable drawable2, Drawable drawable3, Drawable drawable4) {
        super.setCompoundDrawables(drawable, drawable2, drawable3, drawable4);
        C2956 c2956 = this.f13038;
        if (c2956 != null) {
            c2956.m7244();
        }
    }

    @Override // android.widget.TextView
    public final void setCompoundDrawablesRelative(Drawable drawable, Drawable drawable2, Drawable drawable3, Drawable drawable4) {
        super.setCompoundDrawablesRelative(drawable, drawable2, drawable3, drawable4);
        C2956 c2956 = this.f13038;
        if (c2956 != null) {
            c2956.m7244();
        }
    }

    @Override // android.widget.TextView
    public void setCustomSelectionActionModeCallback(ActionMode.Callback callback) {
        super.setCustomSelectionActionModeCallback(AbstractC0494.m2149(callback, this));
    }

    public void setEmojiCompatEnabled(boolean z) {
        this.f13039.m6741(z);
    }

    @Override // android.widget.TextView
    public final boolean setFontVariationSettings(String str) {
        return getFontVariationSettingsManager().m8202(str);
    }

    @Override // android.widget.TextView
    public void setKeyListener(KeyListener keyListener) {
        super.setKeyListener(this.f13039.m6738(keyListener));
    }

    public void setSupportBackgroundTintList(ColorStateList colorStateList) {
        C1611 c1611 = this.f13040;
        if (c1611 != null) {
            c1611.m4611(colorStateList);
        }
    }

    public void setSupportBackgroundTintMode(PorterDuff.Mode mode) {
        C1611 c1611 = this.f13040;
        if (c1611 != null) {
            c1611.m4626(mode);
        }
    }

    @Override // defpackage.InterfaceC4415
    public void setSupportCompoundDrawablesTintList(ColorStateList colorStateList) {
        C2956 c2956 = this.f13038;
        c2956.m7241(colorStateList);
        c2956.m7244();
    }

    @Override // defpackage.InterfaceC4415
    public void setSupportCompoundDrawablesTintMode(PorterDuff.Mode mode) {
        C2956 c2956 = this.f13038;
        c2956.m7243(mode);
        c2956.m7244();
    }

    @Override // android.widget.TextView
    public final void setTextAppearance(Context context, int i) {
        super.setTextAppearance(context, i);
        C2956 c2956 = this.f13038;
        if (c2956 != null) {
            c2956.m7239(context, i);
        }
    }

    @Override // android.widget.TextView
    public void setTextClassifier(TextClassifier textClassifier) {
        ᵪᵨ r0;
        if (Build.VERSION.SDK_INT >= 28 || (r0 = this.f13042) == null) {
            super.setTextClassifier(textClassifier);
        } else {
            r0.ᵿʗᵝʽ = textClassifier;
        }
    }

    @Override // android.widget.TextView
    public void setTypeface(Typeface typeface) {
        if (Build.VERSION.SDK_INT < 26) {
            super.setTypeface(typeface);
            return;
        }
        C3588 fontVariationSettingsManager = getFontVariationSettingsManager();
        fontVariationSettingsManager.f13405 = typeface;
        fontVariationSettingsManager.f13408 = typeface;
        fontVariationSettingsManager.f13407.accept(typeface);
    }

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public final C1848 m7922(C1848 c1848) {
        this.f13041.getClass();
        return C4497.m9576(this, c1848);
    }
}
