package com.ss.android.ugc.aweme.services;

import X.0Gp;
import X.0HH;
import X.5F6;
import X.5qq;
import X.5wR;
import X.66Q;
import X.66R;
import X.6IX;
import X.6Io;
import X.6Zi;
import X.6iK;
import X.6ma;
import X.6zK;
import X.6zj;
import X.6zk;
import X.77D;
import X.7AW;
import X.9Y3;
import X.C0004MDx;
import X.C0201MLm;
import X.C0202MLn;
import X.C0341MQw;
import X.C0343MQy;
import X.C0401MTe;
import X.C4220NtX;
import X.CqL;
import X.FQy;
import X.FR3;
import X.FST;
import X.FU5;
import X.FWb;
import X.I7u;
import X.I7w;
import X.ILm;
import X.ILo;
import X.ILp;
import X.IiV;
import X.M12;
import X.MDq;
import X.MEO;
import X.MF6;
import X.ML5;
import X.MR5;
import android.text.TextUtils;
import com.bytedance.covode.number.Covode;
import com.bytedance.ies.abmock.SettingsManager;
import com.google.gson.m;
import com.ss.android.ugc.aweme.global.config.settings.pojo.IESSettingsProxy;
import com.ss.android.ugc.aweme.services.settings.IAVSettingsService;
import com.ss.android.ugc.aweme.shortvideo.edit.VideoPublishEditModel;
import com.ss.android.vesdk.VEConfigCenter;
import java.util.Map;
import java.util.Objects;
import kotlin.h.b.n;

public class AVSettingsServiceImpl implements IAVSettingsService {
    public static AVSettingsServiceImpl sInstance = new AVSettingsServiceImpl();

    public boolean enableFeedbackLog() {
        return false;
    }

    public boolean getPublishProgressOptimize() {
        return false;
    }

    public String getVESDKVersion() {
        return "12.0.0.80-mt";
    }

    public boolean isEnableUseVEGetThumbs() {
        return true;
    }

    public boolean isPhotoEditEnabled() {
        return true;
    }

    public boolean needLoginBeforeRecord() {
        return false;
    }

    public boolean shareVideo2GifEditable() {
        return true;
    }

    public boolean showDuetWithReact() {
        return false;
    }

    public static AVSettingsServiceImpl getInstance() {
        return sInstance;
    }

    public String getEffectVersion() {
        return C0401MTe.LIZ;
    }

    private void asyncMonitorAwemeSetting() {
        0Gp.LIZ(AVSettingsServiceImpl$$Lambda$0.$instance);
    }

    public CqL<Boolean> bubbleGuideShown() {
        return new CqL<Boolean>() {
            static {
                Covode.recordClassIndex(104999);
            }

            public Boolean get() {
                return Boolean.valueOf(FWb.LIZIZ.LIZ().LJI().getBubbleGuideShown(false));
            }

            public void set(Boolean bool) {
                FWb.LIZIZ.LIZ().LJI().setBubbleGuideShown(bool.booleanValue());
            }
        };
    }

    public boolean delayAlbumPermission() {
        return FR3.LIZ();
    }

    public boolean enableAnswerBtnOnQa() {
        return 6Zi.LIZ();
    }

    public boolean enableLightningPrivacySetting() {
        return 5qq.LIZ((VideoPublishEditModel) null);
    }

    public boolean enableOpenStopVideoPlayerOpti() {
        return MR5.LIZ.isOpenStopVideoPlayerOpti();
    }

    public boolean enableQaSticker() {
        return 6IX.LIZ();
    }

    public boolean enableSaveUploadVideo() {
        return C0341MQw.LJII();
    }

    public boolean enableStitch() {
        return FQy.LIZ();
    }

    public boolean enableTaskDegradationOpti() {
        return MR5.LIZ.isOpenTaskDegradationOpti();
    }

    public boolean enableTitan() {
        return IiV.LIZ();
    }

    public boolean getDuetStickerAB() {
        return 6Io.LIZ();
    }

    public boolean getLongVideoPermittedValue() {
        return 66Q.LIZ();
    }

    public boolean getMvThemeRecordMode() {
        return C0004MDx.LIZ();
    }

    public boolean getShieldTemplateExp() {
        return 6zj.LIZ();
    }

    public boolean isAutomaticMusicDeteriorationExperimentEnabled() {
        return 6iK.LIZ();
    }

    public boolean isDuetAutoApplyEffectEnabled() {
        return MDq.LIZ();
    }

    public boolean isEnableGetThumbsWithEffect() {
        return 5wR.LIZ();
    }

    public boolean isEnableVideoEditActivityUploadSpeedProbe() {
        return MEO.LIZ();
    }

    public boolean isLongVideoPermitted() {
        return 6zK.LIZ();
    }

    public int recommentMusicByAIPolicy() {
        return 66R.LIZ();
    }

    public boolean showMvThemeRecordMode() {
        return C0004MDx.LIZ();
    }

    static {
        Covode.recordClassIndex(104997);
    }

    public boolean downloadEffectOrMusicAfterEnterCamera() {
        if (FU5.LIZ() > 0) {
            return true;
        }
        return false;
    }

    public boolean enableModelFileOnlyEnv() {
        return 9Y3.LIZ(9Y3.LIZ(), true, "model_file_test_env", true);
    }

    public boolean enableOpenAlbumExcludeNewUser() {
        if (5F6.LIZ() == 2) {
            return true;
        }
        return false;
    }

    public boolean enableOpenAlbumForAll() {
        if (5F6.LIZ() == 1) {
            return true;
        }
        return false;
    }

    public boolean enableUploadSyncIns() {
        return SettingsManager.LIZ().LIZ("enable_upload_sync_ins", true);
    }

    public boolean enableUploadSyncInsStory() {
        return SettingsManager.LIZ().LIZ("enable_upload_sync_ins_story", true);
    }

    public boolean enableUploadSyncTwitter() {
        return SettingsManager.LIZ().LIZ("enable_upload_sync_twitter", true);
    }

    public String getStickerArtistIconUrl() {
        String LIZ = SettingsManager.LIZ().LIZ("sticker_artist_icon_url", "");
        n.LIZIZ(LIZ, "");
        return LIZ;
    }

    public boolean isMusicFavoriteTooltipShowOnceExperimentEnabled() {
        return 9Y3.LIZ(9Y3.LIZ(), true, "music_favorite_tooltip_show_once", false);
    }

    public boolean isPrivateAvailable() {
        return SettingsManager.LIZ().LIZ("private_available", true);
    }

    public long progressBarThreshold() {
        return SettingsManager.LIZ().LIZ(" progressbar_threshold", 30000);
    }

    private boolean isInTikTokRegion() {
        77D LJJI = 6ma.LIZ.LJJI();
        if (LJJI == null || !LJJI.LIZIZ().booleanValue()) {
            return false;
        }
        return true;
    }

    public boolean enableCutSameInConsumeSide() {
        if (!C0004MDx.LIZ() || !ML5.LIZIZ() || FWb.LIZIZ.LIZ().LJJIIJ().LIZ()) {
            return false;
        }
        return true;
    }

    public String[] getSharePostEffectIds() {
        C0202MLn LIZ = C0201MLm.LIZIZ.LIZ();
        if (LIZ.LIZLLL != null) {
            return LIZ.LIZLLL;
        }
        return new String[0];
    }

    public static final /* synthetic */ Void lambda$asyncMonitorAwemeSetting$0$AVSettingsServiceImpl() {
        int i;
        try {
            C0343MQy.LIZJ.LIZ("filter", 6zk.LIZ(), "");
            C0343MQy.LIZJ.LIZ("hard_code_shot", MF6.LIZIZ(), "");
            C0343MQy.LIZJ.LIZ("hard_code_release", FST.LIZIZ(), "");
            C0343MQy mQy = C0343MQy.LIZJ;
            if (FWb.LIZIZ.LIZ().LJIILLIIL().LJIILLIIL().LIZ()) {
                i = 1;
            } else {
                i = 0;
            }
            mQy.LIZ("hard_code_water_marker", i, "");
            return null;
        } catch (Exception e) {
            0HH.LIZ(e);
            return null;
        }
    }

    public void updateServerSettings(IESSettingsProxy iESSettingsProxy) {
        if (66Q.LIZ()) {
            6zK.LIZ = !66Q.LIZ();
        }
        C0343MQy mQy = C0343MQy.LIZJ;
        C0343MQy.LIZ = true;
        mQy.LIZ();
        asyncMonitorAwemeSetting();
    }

    public void updateABTestModel(m mVar) {
        Object valueOf;
        m LJFF = mVar.LJFF("data");
        if (LJFF != null) {
            ILm iLm = C4220NtX.LJJIIZI;
            M12.LIZ(LJFF);
            iLm.LIZ.LIZ();
            VEConfigCenter instance = VEConfigCenter.getInstance();
            n.LIZIZ(instance, "");
            Map configs = instance.getConfigs();
            n.LIZIZ(configs, "");
            for (Map.Entry entry : configs.entrySet()) {
                if (entry.getValue() != null && !TextUtils.isEmpty((CharSequence) entry.getKey()) && LJFF.LIZIZ((String) entry.getKey())) {
                    Object key = entry.getKey();
                    n.LIZIZ(key, "");
                    Object value = entry.getValue();
                    n.LIZIZ(value, "");
                    ILo LIZ = iLm.LIZ((String) key, (VEConfigCenter.ValuePkt) value);
                    I7w LIZIZ = LIZ.LIZIZ();
                    if (LIZIZ != null) {
                        int i = I7u.LJ[LIZIZ.ordinal()];
                        if (i == 1) {
                            String LIZ2 = LIZ.LIZ();
                            n.LIZIZ(LIZ2, "");
                            Object LIZJ = LIZ.LIZJ();
                            Objects.requireNonNull(LIZJ, "null cannot be cast to non-null type kotlin.Boolean");
                            valueOf = Boolean.valueOf(iLm.LIZ(LJFF, LIZ2, ((Boolean) LIZJ).booleanValue()));
                        } else if (i == 2) {
                            String LIZ3 = LIZ.LIZ();
                            n.LIZIZ(LIZ3, "");
                            Object LIZJ2 = LIZ.LIZJ();
                            Objects.requireNonNull(LIZJ2, "null cannot be cast to non-null type kotlin.Int");
                            valueOf = Integer.valueOf(iLm.LIZ(LJFF, LIZ3, ((Integer) LIZJ2).intValue()));
                        } else if (i == 3) {
                            String LIZ4 = LIZ.LIZ();
                            n.LIZIZ(LIZ4, "");
                            Object LIZJ3 = LIZ.LIZJ();
                            Objects.requireNonNull(LIZJ3, "null cannot be cast to non-null type kotlin.Long");
                            valueOf = Long.valueOf(iLm.LIZ(LJFF, LIZ4, ((Long) LIZJ3).longValue()));
                        } else if (i == 4) {
                            String LIZ5 = LIZ.LIZ();
                            n.LIZIZ(LIZ5, "");
                            Object LIZJ4 = LIZ.LIZJ();
                            Objects.requireNonNull(LIZJ4, "null cannot be cast to non-null type kotlin.Float");
                            valueOf = Float.valueOf(iLm.LIZ(LJFF, LIZ5, ((Float) LIZJ4).floatValue()));
                        } else if (i == 5) {
                            String LIZ6 = LIZ.LIZ();
                            n.LIZIZ(LIZ6, "");
                            valueOf = iLm.LIZ(LJFF, LIZ6);
                        }
                        ILp iLp = iLm.LIZ;
                        I7w LIZIZ2 = LIZ.LIZIZ();
                        if (LIZIZ2 != null) {
                            int i2 = I7u.LIZLLL[LIZIZ2.ordinal()];
                            if (i2 == 1) {
                                Objects.requireNonNull(valueOf, "null cannot be cast to non-null type kotlin.Boolean");
                                iLp.LIZ(LIZ, ((Boolean) valueOf).booleanValue());
                            } else if (i2 == 2) {
                                Objects.requireNonNull(valueOf, "null cannot be cast to non-null type kotlin.Int");
                                iLp.LIZ(LIZ, ((Integer) valueOf).intValue());
                            } else if (i2 == 3) {
                                Objects.requireNonNull(valueOf, "null cannot be cast to non-null type kotlin.Long");
                                iLp.LIZ(LIZ, ((Long) valueOf).longValue());
                            } else if (i2 == 4) {
                                Objects.requireNonNull(valueOf, "null cannot be cast to non-null type kotlin.Float");
                                iLp.LIZ(LIZ, ((Float) valueOf).floatValue());
                            } else if (i2 == 5) {
                                Objects.requireNonNull(valueOf, "null cannot be cast to non-null type kotlin.String");
                                iLp.LIZ(LIZ, (String) valueOf);
                            }
                        }
                    }
                    throw new 7AW();
                }
            }
            C0343MQy mQy = C0343MQy.LIZJ;
            C0343MQy.LIZIZ = true;
            mQy.LIZ();
        }
    }

    public void setDefaultFilterForCamera(int i, int i2) {
        if (i == 0) {
            FWb.LIZIZ.LIZ().LJI().setBackCameraFilter(i2);
        } else {
            FWb.LIZIZ.LIZ().LJI().setFrontCameraFilter(i2);
        }
    }
}
