content: package androidx.appcompat.widget;
  
  import android.content.Context;
  import android.content.res.ColorStateList;
  import android.graphics.PorterDuff;
  import android.graphics.drawable.Drawable;
  import android.os.Build;
  import android.text.Editable;
  import android.text.method.KeyListener;
  import android.util.AttributeSet;
  import android.view.ActionMode;
  import android.view.DragEvent;
  import android.view.View;
  import android.view.inputmethod.EditorInfo;
  import android.view.inputmethod.InputConnection;
  import android.view.textclassifier.TextClassifier;
  import android.widget.EditText;
  import androidx.appcompat.R;
  import androidx.core.view.ContentInfoCompat;
  import androidx.core.view.OnReceiveContentViewBehavior;
  import androidx.core.view.TintableBackgroundView;
  import androidx.core.view.ViewCompat;
  import androidx.core.view.inputmethod.EditorInfoCompat;
  import androidx.core.view.inputmethod.InputConnectionCompat;
  import androidx.core.widget.TextViewCompat;
  import androidx.core.widget.TextViewOnReceiveContentListener;
  import androidx.core.widget.TintableCompoundDrawablesView;
  
  public class AppCompatEditText extends EditText implements TintableBackgroundView, OnReceiveContentViewBehavior, EmojiCompatConfigurationView, TintableCompoundDrawablesView {
      private final AppCompatEmojiEditTextHelper mAppCompatEmojiEditTextHelper;
      private final AppCompatBackgroundHelper mBackgroundTintHelper;
      private final TextViewOnReceiveContentListener mDefaultOnReceiveContentListener;
      private final AppCompatTextClassifierHelper mTextClassifierHelper;
      private final AppCompatTextHelper mTextHelper;
  
      public AppCompatEditText(Context context) {
          this(context, (AttributeSet) null);
      }
  
      public AppCompatEditText(Context context, AttributeSet attrs) {
          this(context, attrs, R.attr.editTextStyle);
      }
  
      public AppCompatEditText(Context context, AttributeSet attrs, int defStyleAttr) {
          super(TintContextWrapper.wrap(context), attrs, defStyleAttr);
          ThemeUtils.checkAppCompatTheme(this, getContext());
          AppCompatBackgroundHelper appCompatBackgroundHelper = new AppCompatBackgroundHelper(this);
          this.mBackgroundTintHelper = appCompatBackgroundHelper;
          appCompatBackgroundHelper.loadFromAttributes(attrs, defStyleAttr);
          AppCompatTextHelper appCompatTextHelper = new AppCompatTextHelper(this);
          this.mTextHelper = appCompatTextHelper;
          appCompatTextHelper.loadFromAttributes(attrs, defStyleAttr);
          appCompatTextHelper.applyCompoundDrawablesTints();
          this.mTextClassifierHelper = new AppCompatTextClassifierHelper(this);
          this.mDefaultOnReceiveContentListener = new TextViewOnReceiveContentListener();
          AppCompatEmojiEditTextHelper appCompatEmojiEditTextHelper = new AppCompatEmojiEditTextHelper(this);
          this.mAppCompatEmojiEditTextHelper = appCompatEmojiEditTextHelper;
          appCompatEmojiEditTextHelper.loadFromAttributes(attrs, defStyleAttr);
          initEmojiKeyListener(appCompatEmojiEditTextHelper);
      }
  
      /* access modifiers changed from: protected */
      public void drawableStateChanged() {
          super.drawableStateChanged();
          AppCompatBackgroundHelper appCompatBackgroundHelper = this.mBackgroundTintHelper;
          if (appCompatBackgroundHelper != null) {
              appCompatBackgroundHelper.applySupportBackgroundTint();
          }
          AppCompatTextHelper appCompatTextHelper = this.mTextHelper;
          if (appCompatTextHelper != null) {
              appCompatTextHelper.applyCompoundDrawablesTints();
          }
      }
  
      public ActionMode.Callback getCustomSelectionActionModeCallback() {
          return TextViewCompat.unwrapCustomSelectionActionModeCallback(super.getCustomSelectionActionModeCallback());
      }
  
      public ColorStateList getSupportBackgroundTintList() {
          AppCompatBackgroundHelper appCompatBackgroundHelper = this.mBackgroundTintHelper;
          if (appCompatBackgroundHelper != null) {
              return appCompatBackgroundHelper.getSupportBackgroundTintList();
          }
          return null;
      }
  
      public PorterDuff.Mode getSupportBackgroundTintMode() {
          AppCompatBackgroundHelper appCompatBackgroundHelper = this.mBackgroundTintHelper;
          if (appCompatBackgroundHelper != null) {
              return appCompatBackgroundHelper.getSupportBackgroundTintMode();
          }
          return null;
      }
  
      public ColorStateList getSupportCompoundDrawablesTintList() {
          return this.mTextHelper.getCompoundDrawableTintList();
      }
  
      public PorterDuff.Mode getSupportCompoundDrawablesTintMode() {
          return this.mTextHelper.getCompoundDrawableTintMode();
      }
  
      public Editable getText() {
          return Build.VERSION.SDK_INT >= 28 ? super.getText() : super.getEditableText();
      }
  
      /* JADX WARNING: Code restructure failed: missing block: B:2:0x0006, code lost:
          r0 = r2.mTextClassifierHelper;
       */
      /* Code decompiled incorrectly, please refer to instructions dump. */
      public android.view.textclassifier.TextClassifier getTextClassifier() {
          /*
              r2 = this;
              int r0 = android.os.Build.VERSION.SDK_INT
              r1 = 28
              if (r0 >= r1) goto L_0x0010
              androidx.appcompat.widget.AppCompatTextClassifierHelper r0 = r2.mTextClassifierHelper
              if (r0 != 0) goto L_0x000b
              goto L_0x0010
          L_0x000b:
              android.view.textclassifier.TextClassifier r0 = r0.getTextClassifier()
              return r0
          L_0x0010:
              android.view.textclassifier.TextClassifier r0 = super.getTextClassifier()
              return r0
          */
          throw new UnsupportedOperationException("Method not decompiled: androidx.appcompat.widget.AppCompatEditText.getTextClassifier():android.view.textclassifier.TextClassifier");
      }
  
      /* access modifiers changed from: package-private */
      public void initEmojiKeyListener(AppCompatEmojiEditTextHelper appCompatEmojiEditTextHelper) {
          KeyListener keyListener = getKeyListener();
          if (appCompatEmojiEditTextHelper.isEmojiCapableKeyListener(keyListener)) {
              boolean isFocusable = super.isFocusable();
              boolean isClickable = super.isClickable();
              boolean isLongClickable = super.isLongClickable();
              int inputType = super.getInputType();
              KeyListener keyListener2 = appCompatEmojiEditTextHelper.getKeyListener(keyListener);
              if (keyListener2 != keyListener) {
                  super.setKeyListener(keyListener2);
                  super.setRawInputType(inputType);
                  super.setFocusable(isFocusable);
                  super.setClickable(isClickable);
                  super.setLongClickable(isLongClickable);
              }
          }
      }
  
      public boolean isEmojiCompatEnabled() {
          return this.mAppCompatEmojiEditTextHelper.isEnabled();
      }
  
      public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
          String[] onReceiveContentMimeTypes;
          InputConnection onCreateInputConnection = super.onCreateInputConnection(outAttrs);
          this.mTextHelper.populateSurroundingTextIfNeeded(this, onCreateInputConnection, outAttrs);
          InputConnection onCreateInputConnection2 = AppCompatHintHelper.onCreateInputConnection(onCreateInputConnection, outAttrs, this);
          if (!(onCreateInputConnection2 == null || Build.VERSION.SDK_INT > 30 || (onReceiveContentMimeTypes = ViewCompat.getOnReceiveContentMimeTypes(this)) == null)) {
              EditorInfoCompat.setContentMimeTypes(outAttrs, onReceiveContentMimeTypes);
              onCreateInputConnection2 = InputConnectionCompat.createWrapper((View) this, onCreateInputConnection2, outAttrs);
          }
          return this.mAppCompatEmojiEditTextHelper.onCreateInputConnection(onCreateInputConnection2, outAttrs);
      }
  
      public boolean onDragEvent(DragEvent event) {
          if (AppCompatReceiveContentHelper.maybeHandleDragEventViaPerformReceiveContent(this, event)) {
              return true;
          }
          return super.onDragEvent(event);
      }
  
      public ContentInfoCompat onReceiveContent(ContentInfoCompat payload) {
          return this.mDefaultOnReceiveContentListener.onReceiveContent(this, payload);
      }
  
      public boolean onTextContextMenuItem(int id) {
          if (AppCompatReceiveContentHelper.maybeHandleMenuActionViaPerformReceiveContent(this, id)) {
              return true;
          }
          return super.onTextContextMenuItem(id);
      }
  
      public void setBackgroundDrawable(Drawable background) {
          super.setBackgroundDrawable(background);
          AppCompatBackgroundHelper appCompatBackgroundHelper = this.mBackgroundTintHelper;
          if (appCompatBackgroundHelper != null) {
              appCompatBackgroundHelper.onSetBackgroundDrawable(background);
          }
      }
  
      public void setBackgroundResource(int resId) {
          super.setBackgroundResource(resId);
          AppCompatBackgroundHelper appCompatBackgroundHelper = this.mBackgroundTintHelper;
          if (appCompatBackgroundHelper != null) {
              appCompatBackgroundHelper.onSetBackgroundResource(resId);
          }
      }
  
      public void setCompoundDrawables(Drawable left, Drawable top, Drawable right, Drawable bottom) {
          super.setCompoundDrawables(left, top, right, bottom);
          AppCompatTextHelper appCompatTextHelper = this.mTextHelper;
          if (appCompatTextHelper != null) {
              appCompatTextHelper.onSetCompoundDrawables();
          }
      }
  
      public void setCompoundDrawablesRelative(Drawable start, Drawable top, Drawable end, Drawable bottom) {
          super.setCompoundDrawablesRelative(start, top, end, bottom);
          AppCompatTextHelper appCompatTextHelper = this.mTextHelper;
          if (appCompatTextHelper != null) {
              appCompatTextHelper.onSetCompoundDrawables();
          }
      }
  
      public void setCustomSelectionActionModeCallback(ActionMode.Callback actionModeCallback) {
          super.setCustomSelectionActionModeCallback(TextViewCompat.wrapCustomSelectionActionModeCallback(this, actionModeCallback));
      }
  
      public void setEmojiCompatEnabled(boolean enabled) {
          this.mAppCompatEmojiEditTextHelper.setEnabled(enabled);
      }
  
      public void setKeyListener(KeyListener keyListener) {
          super.setKeyListener(this.mAppCompatEmojiEditTextHelper.getKeyListener(keyListener));
      }
  
      public void setSupportBackgroundTintList(ColorStateList tint) {
          AppCompatBackgroundHelper appCompatBackgroundHelper = this.mBackgroundTintHelper;
          if (appCompatBackgroundHelper != null) {
              appCompatBackgroundHelper.setSupportBackgroundTintList(tint);
          }
      }
  
      public void setSupportBackgroundTintMode(PorterDuff.Mode tintMode) {
          AppCompatBackgroundHelper appCompatBackgroundHelper = this.mBackgroundTintHelper;
          if (appCompatBackgroundHelper != null) {
              appCompatBackgroundHelper.setSupportBackgroundTintMode(tintMode);
          }
      }
  
      public void setSupportCompoundDrawablesTintList(ColorStateList tintList) {
          this.mTextHelper.setCompoundDrawableTintList(tintList);
          this.mTextHelper.applyCompoundDrawablesTints();
      }
  
      public void setSupportCompoundDrawablesTintMode(PorterDuff.Mode tintMode) {
          this.mTextHelper.setCompoundDrawableTintMode(tintMode);
          this.mTextHelper.applyCompoundDrawablesTints();
      }
  
      public void setTextAppearance(Context context, int resId) {
          super.setTextAppearance(context, resId);
          AppCompatTextHelper appCompatTextHelper = this.mTextHelper;
          if (appCompatTextHelper != null) {
              appCompatTextHelper.onSetTextAppearance(context, resId);
          }
      }
  
      public void setTextClassifier(TextClassifier textClassifier) {
          AppCompatTextClassifierHelper appCompatTextClassifierHelper;
          if (Build.VERSION.SDK_INT >= 28 || (appCompatTextClassifierHelper = this.mTextClassifierHelper) == null) {
              super.setTextClassifier(textClassifier);
          } else {
              appCompatTextClassifierHelper.setTextClassifier(textClassifier);
          }
      }
  }
  