package com.google.android.gms.internal.firebase_ml; import java.util.AbstractMap; import java.util.AbstractSet; import java.util.EnumSet; import java.util.Iterator; import java.util.Locale; import java.util.Map; import java.util.Set; /* loaded from: classes2.dex */ public class zzhm extends AbstractMap implements Cloneable { final zzhd zztx; Map zzzr; /* loaded from: classes2.dex */ public enum zzc { IGNORE_CASE } public zzhm() { this(EnumSet.noneOf(zzc.class)); } /* loaded from: classes2.dex */ final class zzb extends AbstractSet> { private final zzhj zzzv; private final zzhm zzzw; zzb(zzhm zzhmVar) { this.zzzw = zzhmVar; this.zzzv = (zzhj) new zzhg(zzhmVar, zzhmVar.zztx.zzhc()).entrySet(); } @Override // java.util.AbstractCollection, java.util.Collection, java.lang.Iterable, java.util.Set public final Iterator> iterator() { return new zza(this.zzzw, this.zzzv); } @Override // java.util.AbstractCollection, java.util.Collection, java.util.Set public final int size() { return this.zzzw.zzzr.size() + this.zzzv.size(); } @Override // java.util.AbstractCollection, java.util.Collection, java.util.Set public final void clear() { this.zzzw.zzzr.clear(); this.zzzv.clear(); } } public zzhm(EnumSet enumSet) { this.zzzr = new zzgx(); this.zztx = zzhd.zza(getClass(), enumSet.contains(zzc.IGNORE_CASE)); } /* loaded from: classes2.dex */ final class zza implements Iterator> { private boolean zzzs; private final Iterator> zzzt; private final Iterator> zzzu; zza(zzhm zzhmVar, zzhj zzhjVar) { this.zzzt = (zzhi) zzhjVar.iterator(); this.zzzu = zzhmVar.zzzr.entrySet().iterator(); } @Override // java.util.Iterator public final boolean hasNext() { return this.zzzt.hasNext() || this.zzzu.hasNext(); } @Override // java.util.Iterator public final void remove() { if (this.zzzs) { this.zzzu.remove(); } this.zzzt.remove(); } @Override // java.util.Iterator public final /* synthetic */ Map.Entry next() { if (!this.zzzs) { if (this.zzzt.hasNext()) { return this.zzzt.next(); } this.zzzs = true; } return this.zzzu.next(); } } @Override // java.util.AbstractMap, java.util.Map public final Object get(Object obj) { if (!(obj instanceof String)) { return null; } String str = (String) obj; zzhl zzao = this.zztx.zzao(str); if (zzao != null) { return zzao.zzh(this); } if (this.zztx.zzhc()) { str = str.toLowerCase(Locale.US); } return this.zzzr.get(str); } @Override // java.util.AbstractMap, java.util.Map /* renamed from: zzf, reason: merged with bridge method [inline-methods] */ public final Object put(String str, Object obj) { zzhl zzao = this.zztx.zzao(str); if (zzao != null) { Object zzh = zzao.zzh(this); zzao.zzb(this, obj); return zzh; } if (this.zztx.zzhc()) { str = str.toLowerCase(Locale.US); } return this.zzzr.put(str, obj); } public zzhm zzb(String str, Object obj) { zzhl zzao = this.zztx.zzao(str); if (zzao != null) { zzao.zzb(this, obj); } else { if (this.zztx.zzhc()) { str = str.toLowerCase(Locale.US); } this.zzzr.put(str, obj); } return this; } @Override // java.util.AbstractMap, java.util.Map public final void putAll(Map map) { for (Map.Entry entry : map.entrySet()) { zzb(entry.getKey(), entry.getValue()); } } @Override // java.util.AbstractMap, java.util.Map public final Object remove(Object obj) { if (!(obj instanceof String)) { return null; } String str = (String) obj; if (this.zztx.zzao(str) != null) { throw new UnsupportedOperationException(); } if (this.zztx.zzhc()) { str = str.toLowerCase(Locale.US); } return this.zzzr.remove(str); } @Override // java.util.AbstractMap, java.util.Map public Set> entrySet() { return new zzb(this); } @Override // java.util.AbstractMap /* renamed from: zzeh, reason: merged with bridge method [inline-methods] */ public zzhm clone() { try { zzhm zzhmVar = (zzhm) super.clone(); zzhf.zza(this, zzhmVar); zzhmVar.zzzr = (Map) zzhf.clone(this.zzzr); return zzhmVar; } catch (CloneNotSupportedException e) { throw new IllegalStateException(e); } } public final zzhd zzhi() { return this.zztx; } }