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;

/* JADX INFO: renamed from: ˊˋᵱ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public class C1334 extends EditText implements InterfaceC0259 {

    /* JADX INFO: renamed from: ˈᵲᵢ, reason: contains not printable characters */
    public C1398 f5557;

    /* JADX INFO: renamed from: ˌᴵ, reason: contains not printable characters */
    public final C4132 f5558;

    /* JADX INFO: renamed from: ᵔᵖᵹᵫ, reason: contains not printable characters */
    public final ˊˊᵞᵽ f5559;

    /* JADX INFO: renamed from: ᵜᵪʾ, reason: contains not printable characters */
    public final C2938 f5560;

    /* JADX INFO: renamed from: ᵨᵼⁱ, reason: contains not printable characters */
    public final C3947 f5561;

    /* JADX INFO: renamed from: ᵯᵷʽ, reason: contains not printable characters */
    public final C0767 f5562;

    /* JADX INFO: renamed from: ᵶˇᵱ, reason: contains not printable characters */
    public C4463 f5563;

    public C1334(Context context, AttributeSet attributeSet, int i) {
        super(context, attributeSet, i);
        AbstractC2340.m6017(getContext(), this);
        C4132 c4132 = new C4132(this);
        this.f5558 = c4132;
        c4132.m9047(attributeSet, i);
        C2938 c2938 = new C2938(this);
        this.f5560 = c2938;
        c2938.m7013(attributeSet, i);
        c2938.m7012();
        ˊˊᵞᵽ r4 = new ˊˊᵞᵽ(6, false);
        r4.ᵜᵪʾ = this;
        this.f5559 = r4;
        this.f5561 = new C3947();
        C0767 c0767 = new C0767(this, 5);
        this.f5562 = c0767;
        c0767.m2770(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 keyListenerM2778 = c0767.m2778(keyListener);
        if (keyListenerM2778 == keyListener) {
            return;
        }
        super.setKeyListener(keyListenerM2778);
        super.setRawInputType(inputType);
        super.setFocusable(zIsFocusable);
        super.setClickable(zIsClickable);
        super.setLongClickable(zIsLongClickable);
    }

    private C4463 getSuperCaller() {
        if (this.f5563 == null) {
            this.f5563 = new C4463(this);
        }
        return this.f5563;
    }

    @Override // android.widget.TextView, android.view.View
    public final void drawableStateChanged() {
        super.drawableStateChanged();
        C4132 c4132 = this.f5558;
        if (c4132 != null) {
            c4132.m9036();
        }
        C2938 c2938 = this.f5560;
        if (c2938 != null) {
            c2938.m7012();
        }
    }

    @Override // android.widget.TextView
    public ActionMode.Callback getCustomSelectionActionModeCallback() {
        return ᵷᵸˁ.ʿٴˇ(super.getCustomSelectionActionModeCallback());
    }

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

    public C1398 getFontVariationSettingsManager() {
        if (this.f5557 == null) {
            this.f5557 = new C1398(this, new C3650(this, 1));
        }
        return this.f5557;
    }

    public ColorStateList getSupportBackgroundTintList() {
        C4132 c4132 = this.f5558;
        if (c4132 != null) {
            return c4132.m9055();
        }
        return null;
    }

    public PorterDuff.Mode getSupportBackgroundTintMode() {
        C4132 c4132 = this.f5558;
        if (c4132 != null) {
            return c4132.m9058();
        }
        return null;
    }

    public ColorStateList getSupportCompoundDrawablesTintList() {
        return this.f5560.m7024();
    }

    public PorterDuff.Mode getSupportCompoundDrawablesTintMode() {
        return this.f5560.m7021();
    }

    @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.f5559) == null) {
            return super.getTextClassifier();
        }
        TextClassifier textClassifier = (TextClassifier) r0.ᵔᵖᵹᵫ;
        return textClassifier == null ? ˁᵨᵦ.ᵱᵽʡᵚ((TextView) r0.ᵜᵪʾ) : textClassifier;
    }

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

    @Override // android.widget.TextView, android.view.View
    public final InputConnection onCreateInputConnection(EditorInfo editorInfo) {
        int i;
        String[] strArrM6652;
        InputConnection c3874;
        InputConnection inputConnectionOnCreateInputConnection = super.onCreateInputConnection(editorInfo);
        this.f5560.getClass();
        C2938.m7010(editorInfo, inputConnectionOnCreateInputConnection, this);
        ᵗʓ.ᵯᵷʽ(editorInfo, inputConnectionOnCreateInputConnection, this);
        if (inputConnectionOnCreateInputConnection != null && (i = Build.VERSION.SDK_INT) <= 30 && (strArrM6652 = AbstractC2746.m6652(this)) != null) {
            AbstractC4879.m10147(editorInfo, strArrM6652);
            ˈᵚᵰˎ r2 = new ˈᵚᵰˎ(0, this);
            if (i >= 25) {
                c3874 = new C0376(inputConnectionOnCreateInputConnection, r2);
            } else if (AbstractC4879.m10149(editorInfo).length != 0) {
                c3874 = new C3874(inputConnectionOnCreateInputConnection, r2);
            }
            inputConnectionOnCreateInputConnection = c3874;
        }
        return this.f5562.m2771(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 && AbstractC2746.m6652(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) {
                AbstractC3619.m8165(dragEvent, this, activity);
                return true;
            }
        }
        return super.onDragEvent(dragEvent);
    }

    @Override // android.widget.EditText, android.widget.TextView
    public final boolean onTextContextMenuItem(int i) {
        InterfaceC2718 c3615;
        int i2 = Build.VERSION.SDK_INT;
        if (i2 >= 31 || AbstractC2746.m6652(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) {
                c3615 = new C3615(primaryClip, 1);
            } else {
                C2515 c2515 = new C2515();
                c2515.f9718 = primaryClip;
                c2515.f9719 = 1;
                c3615 = c2515;
            }
            c3615.mo6234(i == 16908322 ? 0 : 1);
            AbstractC2746.m6651(this, c3615.build());
        }
        return true;
    }

    @Override // android.view.View
    public void setBackgroundDrawable(Drawable drawable) {
        super.setBackgroundDrawable(drawable);
        C4132 c4132 = this.f5558;
        if (c4132 != null) {
            c4132.m9051();
        }
    }

    @Override // android.view.View
    public void setBackgroundResource(int i) {
        super.setBackgroundResource(i);
        C4132 c4132 = this.f5558;
        if (c4132 != null) {
            c4132.m9048(i);
        }
    }

    @Override // android.widget.TextView
    public final void setCompoundDrawables(Drawable drawable, Drawable drawable2, Drawable drawable3, Drawable drawable4) {
        super.setCompoundDrawables(drawable, drawable2, drawable3, drawable4);
        C2938 c2938 = this.f5560;
        if (c2938 != null) {
            c2938.m7012();
        }
    }

    @Override // android.widget.TextView
    public final void setCompoundDrawablesRelative(Drawable drawable, Drawable drawable2, Drawable drawable3, Drawable drawable4) {
        super.setCompoundDrawablesRelative(drawable, drawable2, drawable3, drawable4);
        C2938 c2938 = this.f5560;
        if (c2938 != null) {
            c2938.m7012();
        }
    }

    @Override // android.widget.TextView
    public void setCustomSelectionActionModeCallback(ActionMode.Callback callback) {
        super.setCustomSelectionActionModeCallback(ᵷᵸˁ.ᵠˏˏ(callback, this));
    }

    public void setEmojiCompatEnabled(boolean z) {
        this.f5562.m2779(z);
    }

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

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

    public void setSupportBackgroundTintList(ColorStateList colorStateList) {
        C4132 c4132 = this.f5558;
        if (c4132 != null) {
            c4132.m9046(colorStateList);
        }
    }

    public void setSupportBackgroundTintMode(PorterDuff.Mode mode) {
        C4132 c4132 = this.f5558;
        if (c4132 != null) {
            c4132.m9045(mode);
        }
    }

    @Override // defpackage.InterfaceC0259
    public void setSupportCompoundDrawablesTintList(ColorStateList colorStateList) {
        C2938 c2938 = this.f5560;
        c2938.m7014(colorStateList);
        c2938.m7012();
    }

    @Override // defpackage.InterfaceC0259
    public void setSupportCompoundDrawablesTintMode(PorterDuff.Mode mode) {
        C2938 c2938 = this.f5560;
        c2938.m7018(mode);
        c2938.m7012();
    }

    @Override // android.widget.TextView
    public final void setTextAppearance(Context context, int i) {
        super.setTextAppearance(context, i);
        C2938 c2938 = this.f5560;
        if (c2938 != null) {
            c2938.m7023(context, i);
        }
    }

    @Override // android.widget.TextView
    public void setTextClassifier(TextClassifier textClassifier) {
        ˊˊᵞᵽ r0;
        if (Build.VERSION.SDK_INT >= 28 || (r0 = this.f5559) == 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;
        }
        C1398 fontVariationSettingsManager = getFontVariationSettingsManager();
        fontVariationSettingsManager.f5775 = typeface;
        fontVariationSettingsManager.f5778 = typeface;
        fontVariationSettingsManager.f5774.accept(typeface);
    }

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public final C2785 m3857(C2785 c2785) {
        this.f5561.getClass();
        return C3947.m8686(this, c2785);
    }
}
