package o; import android.text.InputFilter; import android.text.method.PasswordTransformationMethod; import android.text.method.TransformationMethod; import android.util.SparseArray; import android.widget.TextView; /* loaded from: classes.dex */ public final class IYy { public final HBt a; public IYy(TextView textView) { if (textView != null) { this.a = new LWm(textView); return; } throw new NullPointerException("textView cannot be null"); } /* loaded from: classes.dex */ public static class HBt { public boolean a() { return false; } void b() { } public void b(boolean z) { } public void c(boolean z) { } public InputFilter[] yd_(InputFilter[] inputFilterArr) { return inputFilterArr; } public TransformationMethod ye_(TransformationMethod transformationMethod) { return transformationMethod; } HBt() { } } /* loaded from: classes.dex */ static class LWm extends HBt { private final Sts e; LWm(TextView textView) { this.e = new Sts(textView); } private boolean d() { return !C16349neT.b(); } @Override // o.IYy.HBt void b() { if (d()) { return; } this.e.b(); } /* JADX INFO: Access modifiers changed from: package-private */ @Override // o.IYy.HBt public InputFilter[] yd_(InputFilter[] inputFilterArr) { return d() ? inputFilterArr : this.e.yd_(inputFilterArr); } /* JADX INFO: Access modifiers changed from: package-private */ @Override // o.IYy.HBt public TransformationMethod ye_(TransformationMethod transformationMethod) { return d() ? transformationMethod : this.e.ye_(transformationMethod); } /* JADX INFO: Access modifiers changed from: package-private */ @Override // o.IYy.HBt public void c(boolean z) { if (d()) { return; } this.e.c(z); } /* JADX INFO: Access modifiers changed from: package-private */ @Override // o.IYy.HBt public void b(boolean z) { if (d()) { this.e.a(z); } else { this.e.b(z); } } @Override // o.IYy.HBt public boolean a() { return this.e.a(); } } /* loaded from: classes.dex */ static class Sts extends HBt { private final TextView b; private boolean d = true; private final lHn e; Sts(TextView textView) { this.b = textView; this.e = new lHn(textView); } @Override // o.IYy.HBt void b() { this.b.setTransformationMethod(ye_(this.b.getTransformationMethod())); } private void c() { this.b.setFilters(yd_(this.b.getFilters())); } /* JADX INFO: Access modifiers changed from: package-private */ @Override // o.IYy.HBt public InputFilter[] yd_(InputFilter[] inputFilterArr) { if (!this.d) { return xY_(inputFilterArr); } return xW_(inputFilterArr); } private InputFilter[] xW_(InputFilter[] inputFilterArr) { int length = inputFilterArr.length; for (InputFilter inputFilter : inputFilterArr) { if (inputFilter == this.e) { return inputFilterArr; } } InputFilter[] inputFilterArr2 = new InputFilter[inputFilterArr.length + 1]; System.arraycopy(inputFilterArr, 0, inputFilterArr2, 0, length); inputFilterArr2[length] = this.e; return inputFilterArr2; } private InputFilter[] xY_(InputFilter[] inputFilterArr) { SparseArray xX_ = xX_(inputFilterArr); if (xX_.size() == 0) { return inputFilterArr; } int length = inputFilterArr.length; InputFilter[] inputFilterArr2 = new InputFilter[inputFilterArr.length - xX_.size()]; int i = 0; for (int i2 = 0; i2 < length; i2++) { if (xX_.indexOfKey(i2) < 0) { inputFilterArr2[i] = inputFilterArr[i2]; i++; } } return inputFilterArr2; } private SparseArray xX_(InputFilter[] inputFilterArr) { SparseArray sparseArray = new SparseArray<>(1); for (int i = 0; i < inputFilterArr.length; i++) { InputFilter inputFilter = inputFilterArr[i]; if (inputFilter instanceof lHn) { sparseArray.put(i, inputFilter); } } return sparseArray; } /* JADX INFO: Access modifiers changed from: package-private */ @Override // o.IYy.HBt public TransformationMethod ye_(TransformationMethod transformationMethod) { if (this.d) { return ya_(transformationMethod); } return xZ_(transformationMethod); } private TransformationMethod xZ_(TransformationMethod transformationMethod) { return transformationMethod instanceof C0949SbN ? ((C0949SbN) transformationMethod).b : transformationMethod; } private TransformationMethod ya_(TransformationMethod transformationMethod) { return ((transformationMethod instanceof C0949SbN) || (transformationMethod instanceof PasswordTransformationMethod)) ? transformationMethod : new C0949SbN(transformationMethod); } /* JADX INFO: Access modifiers changed from: package-private */ @Override // o.IYy.HBt public void c(boolean z) { if (z) { b(); } } /* JADX INFO: Access modifiers changed from: package-private */ @Override // o.IYy.HBt public void b(boolean z) { this.d = z; b(); c(); } void a(boolean z) { this.d = z; } @Override // o.IYy.HBt public boolean a() { return this.d; } } }