/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.common.io.XmlUtil
 *  com.l7tech.common.mime.ContentTypeHeader
 *  com.l7tech.gateway.common.AsyncAdminMethods$JobId
 *  com.l7tech.gateway.common.AsyncAdminMethods$JobResult
 *  com.l7tech.gateway.common.AsyncAdminMethods$JobStillActiveException
 *  com.l7tech.gateway.common.AsyncAdminMethods$UnknownJobException
 *  com.l7tech.gateway.common.admin.PolicyBundleInstallerAdmin
 *  com.l7tech.gateway.common.admin.PolicyBundleInstallerAdmin$PolicyBundleInstallerException
 *  com.l7tech.message.Message
 *  com.l7tech.objectmodel.Goid
 *  com.l7tech.objectmodel.folder.Folder
 *  com.l7tech.policy.assertion.Assertion
 *  com.l7tech.policy.assertion.AssertionMetadata
 *  com.l7tech.policy.assertion.AssertionStatus
 *  com.l7tech.policy.assertion.ExtensionInterfaceBinding
 *  com.l7tech.policy.assertion.PolicyAssertionException
 *  com.l7tech.policy.bundle.BundleInfo
 *  com.l7tech.policy.bundle.BundleMapping
 *  com.l7tech.policy.bundle.BundleMapping$Type
 *  com.l7tech.policy.bundle.PolicyBundleDryRunResult
 *  com.l7tech.policy.bundle.PolicyBundleDryRunResult$UnknownBundleIdException
 *  com.l7tech.policy.variable.NoSuchVariableException
 *  com.l7tech.util.Functions$Unary
 *  com.l7tech.util.Functions$UnaryVoidThrows
 *  jakarta.inject.Inject
 *  org.jetbrains.annotations.NotNull
 *  org.springframework.context.ApplicationContext
 */
package com.l7tech.server.policy.bundle;

import com.l7tech.common.io.XmlUtil;
import com.l7tech.common.mime.ContentTypeHeader;
import com.l7tech.gateway.common.AsyncAdminMethods;
import com.l7tech.gateway.common.admin.PolicyBundleInstallerAdmin;
import com.l7tech.message.Message;
import com.l7tech.objectmodel.Goid;
import com.l7tech.objectmodel.folder.Folder;
import com.l7tech.policy.assertion.Assertion;
import com.l7tech.policy.assertion.AssertionMetadata;
import com.l7tech.policy.assertion.AssertionStatus;
import com.l7tech.policy.assertion.ExtensionInterfaceBinding;
import com.l7tech.policy.assertion.PolicyAssertionException;
import com.l7tech.policy.bundle.BundleInfo;
import com.l7tech.policy.bundle.BundleMapping;
import com.l7tech.policy.bundle.PolicyBundleDryRunResult;
import com.l7tech.policy.variable.NoSuchVariableException;
import com.l7tech.server.StashManagerFactory;
import com.l7tech.server.message.PolicyEnforcementContext;
import com.l7tech.server.policy.assertion.AbstractServerAssertion;
import com.l7tech.server.policy.bundle.PolicyBundleInstallerServerAssertionException;
import com.l7tech.server.policy.bundle.b;
import com.l7tech.server.policy.bundle.c;
import com.l7tech.server.policy.bundle.d;
import com.l7tech.util.Functions;
import jakarta.inject.Inject;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.jetbrains.annotations.NotNull;
import org.springframework.context.ApplicationContext;
import org.w3c.dom.Document;
import org.w3c.dom.Node;

/*
 * Exception performing whole class analysis ignored.
 */
public abstract class PolicyBundleInstallerAbstractServerAssertion<AT extends Assertion>
extends AbstractServerAssertion<AT> {
    public static final String CONTEXT_VARIABLE_PREFIX = "";
    public static final String REQUEST_HTTP_PARAMETER;
    protected static final String L7;
    protected static final char COMPONENT_ID_SEPARATOR_CHAR = ';';
    protected static final String COMPONENT_ID_SEPARATOR;
    @Inject
    protected StashManagerFactory stashManagerFactory;
    protected final PolicyBundleInstallerAdmin policyBundleInstallerAdmin;
    private PolicyEnforcementContext d;
    private Map<String, BundleInfo> e;
    private boolean f;
    private static final String[] g;

    public PolicyBundleInstallerAbstractServerAssertion(AT AT, ApplicationContext applicationContext) throws PolicyAssertionException {
        Collection collection;
        block7: {
            super(AT);
            AssertionMetadata assertionMetadata = AT.meta();
            String[] stringArray = g;
            Functions.Unary unary = (Functions.Unary)assertionMetadata.get(stringArray[2]);
            try {
                if (unary == null) {
                    throw new PolicyAssertionException(AT, stringArray[28]);
                }
            }
            catch (PolicyAssertionException policyAssertionException) {
                throw PolicyBundleInstallerAbstractServerAssertion.a((Exception)((Object)policyAssertionException));
            }
            collection = (Collection)unary.call((Object)applicationContext);
            try {
                try {
                    if (collection != null && collection.size() == 1) break block7;
                }
                catch (PolicyAssertionException policyAssertionException) {
                    throw PolicyBundleInstallerAbstractServerAssertion.a((Exception)((Object)policyAssertionException));
                }
                throw new PolicyAssertionException(AT, g[14]);
            }
            catch (PolicyAssertionException policyAssertionException) {
                throw PolicyBundleInstallerAbstractServerAssertion.a((Exception)((Object)policyAssertionException));
            }
        }
        ExtensionInterfaceBinding extensionInterfaceBinding = (ExtensionInterfaceBinding)collection.iterator().next();
        this.policyBundleInstallerAdmin = (PolicyBundleInstallerAdmin)extensionInterfaceBinding.getImplementationObject();
    }

    /*
     * Exception decompiling
     */
    @Override
    public AssertionStatus checkRequest(PolicyEnforcementContext var1_1) throws IOException, PolicyAssertionException {
        /*
         * This method has failed to decompile.  When submitting a bug report, please provide this stack trace, and (if you hold appropriate legal rights) the relevant class file.
         * 
         * org.benf.cfr.reader.util.ConfusedCFRException: Tried to end blocks [2[TRYBLOCK]], but top level block is 3[SWITCH]
         *     at org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement.processEndingBlocks(Op04StructuredStatement.java:435)
         *     at org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement.buildNestedBlocks(Op04StructuredStatement.java:484)
         *     at org.benf.cfr.reader.bytecode.analysis.opgraph.Op03SimpleStatement.createInitialStructuredBlock(Op03SimpleStatement.java:736)
         *     at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisInner(CodeAnalyser.java:850)
         *     at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisOrWrapFail(CodeAnalyser.java:278)
         *     at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysis(CodeAnalyser.java:201)
         *     at org.benf.cfr.reader.entities.attributes.AttributeCode.analyse(AttributeCode.java:94)
         *     at org.benf.cfr.reader.entities.Method.analyse(Method.java:531)
         *     at org.benf.cfr.reader.entities.ClassFile.analyseMid(ClassFile.java:1055)
         *     at org.benf.cfr.reader.entities.ClassFile.analyseTop(ClassFile.java:942)
         *     at org.benf.cfr.reader.Driver.doJarVersionTypes(Driver.java:257)
         *     at org.benf.cfr.reader.Driver.doJar(Driver.java:139)
         *     at org.benf.cfr.reader.CfrDriverImpl.analyse(CfrDriverImpl.java:76)
         *     at org.benf.cfr.reader.Main.main(Main.java:54)
         */
        throw new IllegalStateException("Decompilation failed");
    }

    public void setUsesRequestHttpParams(boolean bl2) {
        this.f = bl2;
    }

    protected String getContextVariable(@NotNull String string) throws NoSuchVariableException {
        try {
            if (string == null) {
                PolicyBundleInstallerAbstractServerAssertion.b(0);
            }
        }
        catch (NoSuchVariableException noSuchVariableException) {
            throw PolicyBundleInstallerAbstractServerAssertion.a((Exception)((Object)noSuchVariableException));
        }
        try {
            if (this.f) {
                return this.getContext().getVariable(g[25] + string).toString();
            }
        }
        catch (NoSuchVariableException noSuchVariableException) {
            throw PolicyBundleInstallerAbstractServerAssertion.a((Exception)((Object)noSuchVariableException));
        }
        return this.getContext().getVariable(string).toString();
    }

    protected void customActionCallback() throws PolicyBundleInstallerAdmin.PolicyBundleInstallerException {
    }

    protected AsyncAdminMethods.JobId<PolicyBundleDryRunResult> callAdminDryRun(List<String> list, Goid goid, HashMap<String, BundleMapping> hashMap, String string) throws PolicyBundleInstallerAdmin.PolicyBundleInstallerException {
        return this.policyBundleInstallerAdmin.dryRunInstall(list, hashMap, goid, string);
    }

    protected AsyncAdminMethods.JobId<ArrayList> callAdminInstall(List<String> list, Goid goid, HashMap<String, BundleMapping> hashMap, String string) throws PolicyBundleInstallerAdmin.PolicyBundleInstallerException {
        return this.policyBundleInstallerAdmin.install(list, goid, hashMap, string, null);
    }

    protected void writeResponse(Document document) throws PolicyBundleInstallerAdmin.PolicyBundleInstallerException {
        try {
            this.writeResponse(XmlUtil.nodeToFormattedString((Node)document));
        }
        catch (IOException iOException) {
            throw new PolicyBundleInstallerAdmin.PolicyBundleInstallerException((Throwable)iOException);
        }
    }

    protected void writeResponse(String string) throws PolicyBundleInstallerAdmin.PolicyBundleInstallerException {
        try {
            Message message = this.getContext().getResponse();
            ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(string.getBytes());
            message.initialize(this.getStashManagerFactory().createStashManager(), ContentTypeHeader.XML_DEFAULT, (InputStream)byteArrayInputStream);
            message.getMimeKnob().getContentLength();
            message.getHttpResponseKnob().setStatus(200);
        }
        catch (IOException iOException) {
            throw new PolicyBundleInstallerAdmin.PolicyBundleInstallerException((Throwable)iOException);
        }
    }

    protected Map<String, BundleInfo> getAvailableComponents() {
        return this.e;
    }

    protected void setAvailableComponents(Map<String, BundleInfo> map) {
        this.e = map;
    }

    protected PolicyEnforcementContext getContext() {
        return this.d;
    }

    protected void setContext(PolicyEnforcementContext policyEnforcementContext) {
        this.d = policyEnforcementContext;
    }

    protected StashManagerFactory getStashManagerFactory() {
        return this.stashManagerFactory;
    }

    void a() throws PolicyBundleInstallerAdmin.PolicyBundleInstallerException {
        StringBuilder stringBuilder = new StringBuilder();
        for (String string : this.getAvailableComponents().keySet()) {
            stringBuilder.append(string);
            stringBuilder.append(COMPONENT_ID_SEPARATOR);
        }
        this.writeResponse(stringBuilder.toString());
    }

    void b() throws InterruptedException, PolicyBundleInstallerAdmin.PolicyBundleInstallerException, NoSuchVariableException, AsyncAdminMethods.UnknownJobException, AsyncAdminMethods.JobStillActiveException, PolicyAssertionException {
        List<String> list = this.a(Action.restman_get);
        AsyncAdminMethods.JobId<PolicyBundleDryRunResult> jobId = this.callAdminDryRun(list, this.f(), this.a(list), this.e());
        this.a(jobId, new b(this));
    }

    private void a(AsyncAdminMethods.JobId<? extends Serializable> jobId, Functions.UnaryVoidThrows<Object, Exception> unaryVoidThrows) throws InterruptedException, PolicyBundleInstallerAdmin.PolicyBundleInstallerException, AsyncAdminMethods.UnknownJobException, AsyncAdminMethods.JobStillActiveException, PolicyBundleInstallerServerAssertionException {
        while (true) {
            String string = this.policyBundleInstallerAdmin.getJobStatus(jobId);
            try {
                if (string == null) {
                    throw new PolicyBundleInstallerAdmin.PolicyBundleInstallerException(g[11] + String.valueOf(jobId));
                }
            }
            catch (PolicyBundleInstallerServerAssertionException policyBundleInstallerServerAssertionException) {
                throw PolicyBundleInstallerAbstractServerAssertion.a((Exception)((Object)policyBundleInstallerServerAssertionException));
            }
            if (!string.startsWith("a")) {
                AsyncAdminMethods.JobResult jobResult = this.policyBundleInstallerAdmin.getJobResult(jobId);
                if (jobResult.result != null) {
                    try {
                        unaryVoidThrows.call((Object)jobResult.result);
                        break;
                    }
                    catch (PolicyBundleInstallerServerAssertionException policyBundleInstallerServerAssertionException) {
                        throw policyBundleInstallerServerAssertionException;
                    }
                    catch (Exception exception) {
                        throw new PolicyBundleInstallerAdmin.PolicyBundleInstallerException((Throwable)exception);
                    }
                }
                throw new PolicyBundleInstallerAdmin.PolicyBundleInstallerException(jobResult.throwableMessage);
            }
            Thread.sleep(5000L);
        }
    }

    void c() throws InterruptedException, PolicyBundleInstallerAdmin.PolicyBundleInstallerException, NoSuchVariableException, AsyncAdminMethods.UnknownJobException, AsyncAdminMethods.JobStillActiveException, PolicyBundleDryRunResult.UnknownBundleIdException, PolicyBundleInstallerServerAssertionException {
        List<String> list = this.a(Action.wsman_dry_run);
        AsyncAdminMethods.JobId<PolicyBundleDryRunResult> jobId = this.callAdminDryRun(list, this.f(), this.a(list), this.e());
        this.a(jobId, new c(this, list));
    }

    void d() throws InterruptedException, PolicyBundleInstallerAdmin.PolicyBundleInstallerException, NoSuchVariableException, AsyncAdminMethods.UnknownJobException, AsyncAdminMethods.JobStillActiveException, PolicyBundleDryRunResult.UnknownBundleIdException, PolicyBundleInstallerServerAssertionException {
        List<String> list = this.a(Action.wsman_install);
        AsyncAdminMethods.JobId<ArrayList> jobId = this.callAdminInstall(list, this.f(), this.a(list), this.e());
        this.a(jobId, new d(this));
    }

    List<String> a(@NotNull Action action) throws NoSuchVariableException, PolicyBundleInstallerServerAssertionException {
        ArrayList<String> arrayList;
        try {
            if (action == null) {
                PolicyBundleInstallerAbstractServerAssertion.b(1);
            }
        }
        catch (NoSuchVariableException noSuchVariableException) {
            throw PolicyBundleInstallerAbstractServerAssertion.a((Exception)((Object)noSuchVariableException));
        }
        String[] stringArray = g;
        String string = this.getContextVariable(stringArray[4]);
        if (stringArray[16].equalsIgnoreCase(string)) {
            arrayList = new ArrayList<String>(this.getAvailableComponents().size());
            for (BundleInfo bundleInfo : this.getAvailableComponents().values()) {
                this.a(arrayList, action, bundleInfo);
            }
        } else {
            List<String> list = Arrays.asList(string.split(COMPONENT_ID_SEPARATOR));
            arrayList = new ArrayList(list.size());
            for (String string2 : list) {
                BundleInfo bundleInfo = this.getAvailableComponents().get(string2);
                try {
                    if (bundleInfo == null) continue;
                    this.a(arrayList, action, bundleInfo);
                }
                catch (NoSuchVariableException noSuchVariableException) {
                    throw PolicyBundleInstallerAbstractServerAssertion.a((Exception)((Object)noSuchVariableException));
                }
            }
        }
        try {
            if (arrayList.size() <= 0) {
                throw new PolicyBundleInstallerServerAssertionException(this.assertion, g[9], 404);
            }
        }
        catch (NoSuchVariableException noSuchVariableException) {
            throw PolicyBundleInstallerAbstractServerAssertion.a((Exception)((Object)noSuchVariableException));
        }
        return arrayList;
    }

    private void a(@NotNull List<String> list, @NotNull Action action, @NotNull BundleInfo bundleInfo) throws PolicyBundleInstallerServerAssertionException {
        block21: {
            block20: {
                try {
                    if (list == null) {
                        PolicyBundleInstallerAbstractServerAssertion.b(2);
                    }
                }
                catch (PolicyBundleInstallerServerAssertionException policyBundleInstallerServerAssertionException) {
                    throw PolicyBundleInstallerAbstractServerAssertion.a((Exception)((Object)policyBundleInstallerServerAssertionException));
                }
                try {
                    if (action == null) {
                        PolicyBundleInstallerAbstractServerAssertion.b(3);
                    }
                }
                catch (PolicyBundleInstallerServerAssertionException policyBundleInstallerServerAssertionException) {
                    throw PolicyBundleInstallerAbstractServerAssertion.a((Exception)((Object)policyBundleInstallerServerAssertionException));
                }
                try {
                    if (bundleInfo == null) {
                        PolicyBundleInstallerAbstractServerAssertion.b(4);
                    }
                }
                catch (PolicyBundleInstallerServerAssertionException policyBundleInstallerServerAssertionException) {
                    throw PolicyBundleInstallerAbstractServerAssertion.a((Exception)((Object)policyBundleInstallerServerAssertionException));
                }
                try {
                    block19: {
                        try {
                            try {
                                try {
                                    try {
                                        if (bundleInfo.hasActiveVersionMigrationBundleFile().booleanValue() && action == Action.restman_get) break block19;
                                    }
                                    catch (PolicyBundleInstallerServerAssertionException policyBundleInstallerServerAssertionException) {
                                        throw PolicyBundleInstallerAbstractServerAssertion.a((Exception)((Object)policyBundleInstallerServerAssertionException));
                                    }
                                    if (!bundleInfo.hasWsmanFile().booleanValue()) break block20;
                                }
                                catch (PolicyBundleInstallerServerAssertionException policyBundleInstallerServerAssertionException) {
                                    throw PolicyBundleInstallerAbstractServerAssertion.a((Exception)((Object)policyBundleInstallerServerAssertionException));
                                }
                                if (action == Action.wsman_dry_run) break block19;
                            }
                            catch (PolicyBundleInstallerServerAssertionException policyBundleInstallerServerAssertionException) {
                                throw PolicyBundleInstallerAbstractServerAssertion.a((Exception)((Object)policyBundleInstallerServerAssertionException));
                            }
                            if (action != Action.wsman_install) break block20;
                        }
                        catch (PolicyBundleInstallerServerAssertionException policyBundleInstallerServerAssertionException) {
                            throw PolicyBundleInstallerAbstractServerAssertion.a((Exception)((Object)policyBundleInstallerServerAssertionException));
                        }
                    }
                    list.add(bundleInfo.getId());
                    break block21;
                }
                catch (PolicyBundleInstallerServerAssertionException policyBundleInstallerServerAssertionException) {
                    throw PolicyBundleInstallerAbstractServerAssertion.a((Exception)((Object)policyBundleInstallerServerAssertionException));
                }
            }
            String[] stringArray = g;
            throw new PolicyBundleInstallerServerAssertionException(this.assertion, stringArray[0] + bundleInfo.getId() + stringArray[22] + String.valueOf((Object)action), 400);
        }
    }

    private String e() {
        try {
            return this.getContextVariable(g[24]);
        }
        catch (NoSuchVariableException noSuchVariableException) {
            return null;
        }
    }

    private Goid f() {
        try {
            return new Goid(this.getContextVariable(g[15]));
        }
        catch (NoSuchVariableException noSuchVariableException) {
            return Folder.ROOT_FOLDER_ID;
        }
    }

    private HashMap<String, BundleMapping> a(List<String> list) throws PolicyBundleInstallerAdmin.PolicyBundleInstallerException {
        HashMap<String, BundleMapping> hashMap = new HashMap<String, BundleMapping>();
        for (String string : list) {
            try {
                String[] stringArray = g;
                String string2 = this.getContextVariable(stringArray[26] + string + stringArray[17]);
                String string3 = this.getContextVariable(stringArray[23] + string + stringArray[13]);
                BundleMapping bundleMapping = new BundleMapping();
                bundleMapping.addMapping(BundleMapping.Type.JDBC_CONNECTION_NAME, string2, string3);
                hashMap.put(string, bundleMapping);
            }
            catch (NoSuchVariableException noSuchVariableException) {}
        }
        return hashMap;
    }

    static /* synthetic */ Assertion access$000(PolicyBundleInstallerAbstractServerAssertion policyBundleInstallerAbstractServerAssertion) {
        return policyBundleInstallerAbstractServerAssertion.assertion;
    }

    /*
     * Unable to fully structure code
     */
    static {
        block10: {
            block9: {
                var5 = new String[29];
                var3_1 = 0;
                var2_2 = "c\u0017\u0007KF\\\u0015N\fJrm\bP\u0002LO\u001aE\u0000\u001e^GA\u0019O\u0016#U]W\u0002F\u0019\t^Zt\u0011C\f\u0005IP\u0004N\u0019\u0007^\rC\u0017\u0007KF\\\u0015N\f5RMA\u0017R\u001d\u001bNLA\u0004\u000e\u0010\u001eOY\u001c\u0000A\n\u000bVLF\u0015RV>a\n\rNDW\u001eTX\fT[\u00120n\u0017\u001eu\\^\u001c\u0000\b\u000bIH_\u0015T\u001d\u0018\u001b\u000e\u0017\u0003\u0007X\u0005]\t\u0017\u0003\u000e]\u0019\u001bDG\u0003TX\u0004T]\u0012\u0012EX\u0004NE^+aX\u001cZE[\u0014\u0000\u0011\u0004H]S\u001cL\u001d\u0018\u001bHQ\u0004I\u0017\u0004\u001bDG\u0003TX\b^\tA\u0000E\u001b\u0003]@W\u0014\u000e\u0012G\u001d\u001exF\\\u0004E\u0000\u001emH@\u0019A\u001a\u0006^2n\u0017JVHF\u0013H\u0011\u0004\\\tQ\u001fM\b\u0005UL\\\u0004\u00001.\u001bO]\u0005N\u001cJ]F@PT\u0010\u0003H\t[\u001eS\f\u000bWEW\u0002\u000e\u0006A\u001b\u001eRF\\\u000fu\u0016\u0001UFE\u001e\u0000\u0012\u0005Y@VJ\u0000\u0006A\u001b\u001eRF\\\t\u000e\u0016\u000fLv\\\u0011M\u001dIu\u0016\u000fCYW\u0013T\u001d\u000e\u001bLJ\u0013E\b\u001eRF\\\\\u0000\u0015\u001fH]\u0012\u0018A\u000e\u000f\u001bLJ\u0011C\f\u0006B\t]\u001eEX/C]W\u001eS\u0011\u0005U\t{\u001eT\u001d\u0018]HQ\u0015SX(RGV\u0019N\u001fD\u000bF\u0017\u0006_L@/G\u0017\u0003_\u0003A\u0014\u0006\u0005\u000e\u0016\u000bVL\u000eA\u001c\u000exF_\u0000O\u0016\u000fU]{\u0014\nB\r\u0004_EW9N\u001e\u0005LC\u0017\u0007\u0014E\u0005\u0004E\u001b\u0002\u0014ZW\u0002V\u001d\u0018\u0014Y]\u001cI\u001b\u0013\u0014KG\u001eD\u0014\u000f\u0014y]\u001cI\u001b\u0013y\\\\\u0014L\u001d#UZF\u0011L\u0014\u000fIhP\u0003T\n\u000bX]a\u0015R\u000e\u000fIhA\u0003E\n\u001eRF\\\u000fG\u001d\u001exF_\u0000O\u0016\u000fU]{\u0014S\u001d\u0000\u0016\u0005O\tQ\u001fM\b\u000bO@P\u001cEX\u001dR]ZPA\u001b\u001eRF\\J\u0000\u0010J\u001c\bXvQ\u001fN\u0016\u000fX][\u001fNV\u0010V\u001d\u0018H@]\u001e\u007f\u0015\u0005_@T\u0019E\n\u0017R\u001d\u001bNLA\u0004\u000e\u0010\u001eOY\u001c\u0000A\n\u000bVLF\u0015RV\u0010J\u001c\bXvQ\u001fN\u0016\u000fX][\u001fNV";
                var4_3 = "c\u0017\u0007KF\\\u0015N\fJrm\bP\u0002LO\u001aE\u0000\u001e^GA\u0019O\u0016#U]W\u0002F\u0019\t^Zt\u0011C\f\u0005IP\u0004N\u0019\u0007^\rC\u0017\u0007KF\\\u0015N\f5RMA\u0017R\u001d\u001bNLA\u0004\u000e\u0010\u001eOY\u001c\u0000A\n\u000bVLF\u0015RV>a\n\rNDW\u001eTX\fT[\u00120n\u0017\u001eu\\^\u001c\u0000\b\u000bIH_\u0015T\u001d\u0018\u001b\u000e\u0017\u0003\u0007X\u0005]\t\u0017\u0003\u000e]\u0019\u001bDG\u0003TX\u0004T]\u0012\u0012EX\u0004NE^+aX\u001cZE[\u0014\u0000\u0011\u0004H]S\u001cL\u001d\u0018\u001bHQ\u0004I\u0017\u0004\u001bDG\u0003TX\b^\tA\u0000E\u001b\u0003]@W\u0014\u000e\u0012G\u001d\u001exF\\\u0004E\u0000\u001emH@\u0019A\u001a\u0006^2n\u0017JVHF\u0013H\u0011\u0004\\\tQ\u001fM\b\u0005UL\\\u0004\u00001.\u001bO]\u0005N\u001cJ]F@PT\u0010\u0003H\t[\u001eS\f\u000bWEW\u0002\u000e\u0006A\u001b\u001eRF\\\u000fu\u0016\u0001UFE\u001e\u0000\u0012\u0005Y@VJ\u0000\u0006A\u001b\u001eRF\\\t\u000e\u0016\u000fLv\\\u0011M\u001dIu\u0016\u000fCYW\u0013T\u001d\u000e\u001bLJ\u0013E\b\u001eRF\\\\\u0000\u0015\u001fH]\u0012\u0018A\u000e\u000f\u001bLJ\u0011C\f\u0006B\t]\u001eEX/C]W\u001eS\u0011\u0005U\t{\u001eT\u001d\u0018]HQ\u0015SX(RGV\u0019N\u001fD\u000bF\u0017\u0006_L@/G\u0017\u0003_\u0003A\u0014\u0006\u0005\u000e\u0016\u000bVL\u000eA\u001c\u000exF_\u0000O\u0016\u000fU]{\u0014\nB\r\u0004_EW9N\u001e\u0005LC\u0017\u0007\u0014E\u0005\u0004E\u001b\u0002\u0014ZW\u0002V\u001d\u0018\u0014Y]\u001cI\u001b\u0013\u0014KG\u001eD\u0014\u000f\u0014y]\u001cI\u001b\u0013y\\\\\u0014L\u001d#UZF\u0011L\u0014\u000fIhP\u0003T\n\u000bX]a\u0015R\u000e\u000fIhA\u0003E\n\u001eRF\\\u000fG\u001d\u001exF_\u0000O\u0016\u000fU]{\u0014S\u001d\u0000\u0016\u0005O\tQ\u001fM\b\u000bO@P\u001cEX\u001dR]ZPA\u001b\u001eRF\\J\u0000\u0010J\u001c\bXvQ\u001fN\u0016\u000fX][\u001fNV\u0010V\u001d\u0018H@]\u001e\u007f\u0015\u0005_@T\u0019E\n\u0017R\u001d\u001bNLA\u0004\u000e\u0010\u001eOY\u001c\u0000A\n\u000bVLF\u0015RV\u0010J\u001c\bXvQ\u001fN\u0016\u000fX][\u001fNV".length();
                var1_4 = 14;
                var0_5 = -1;
lbl7:
                // 2 sources

                while (true) {
                    v0 = 99;
                    v1 = ++var0_5;
                    v2 = var2_2.substring(v1, v1 + var1_4);
                    v3 = -1;
                    break block9;
                    break;
                }
lbl13:
                // 1 sources

                while (true) {
                    var5[var3_1++] = PolicyBundleInstallerAbstractServerAssertion.b(v0, PolicyBundleInstallerAbstractServerAssertion.a(v2));
                    if ((var0_5 += var1_4) < var4_3) {
                        var1_4 = var2_2.charAt(var0_5);
                        ** continue;
                    }
                    var2_2 = "\u001bO_\u0013\u001e\u0004M\u0016T{\u0007\u0002D-NW\u001b\u0001\u000fK\fEVC\u0014\u0012K\u001dPF\n\u001e\u0004\u0004XeJ\u0017\u0014\u0004[\u0011O\\C8\u0004\\\u001dRT\u0002\u0012\u000f[XfS\u0000\u0005\u0005Z\u0001\u0000_\u0016\u0002\u001e\b\u0016OFC\u0013\u000f\b\u0016U^\u000f_";
                    var4_3 = "\u001bO_\u0013\u001e\u0004M\u0016T{\u0007\u0002D-NW\u001b\u0001\u000fK\fEVC\u0014\u0012K\u001dPF\n\u001e\u0004\u0004XeJ\u0017\u0014\u0004[\u0011O\\C8\u0004\\\u001dRT\u0002\u0012\u000f[XfS\u0000\u0005\u0005Z\u0001\u0000_\u0016\u0002\u001e\b\u0016OFC\u0013\u000f\b\u0016U^\u000f_".length();
                    var1_4 = 12;
                    var0_5 = -1;
lbl22:
                    // 2 sources

                    while (true) {
                        v0 = 59;
                        v4 = ++var0_5;
                        v2 = var2_2.substring(v4, v4 + var1_4);
                        v3 = 0;
                        break block9;
                        break;
                    }
                    break;
                }
lbl28:
                // 1 sources

                while (true) {
                    var5[var3_1++] = PolicyBundleInstallerAbstractServerAssertion.b(v0, PolicyBundleInstallerAbstractServerAssertion.a(v2));
                    if ((var0_5 += var1_4) < var4_3) {
                        var1_4 = var2_2.charAt(var0_5);
                        ** continue;
                    }
                    break block10;
                    break;
                }
            }
            switch (v3) {
                default: {
                    ** continue;
                }
                ** case 0:
lbl39:
                // 1 sources

                ** continue;
            }
        }
        PolicyBundleInstallerAbstractServerAssertion.g = var5;
        PolicyBundleInstallerAbstractServerAssertion.L7 = PolicyBundleInstallerAbstractServerAssertion.g[1];
        PolicyBundleInstallerAbstractServerAssertion.REQUEST_HTTP_PARAMETER = PolicyBundleInstallerAbstractServerAssertion.g[5];
        PolicyBundleInstallerAbstractServerAssertion.COMPONENT_ID_SEPARATOR = String.valueOf(';');
    }

    /*
     * Exception decompiling
     */
    private static /* synthetic */ void b(int var0) {
        /*
         * This method has failed to decompile.  When submitting a bug report, please provide this stack trace, and (if you hold appropriate legal rights) the relevant class file.
         * 
         * org.benf.cfr.reader.util.ConfusedCFRException: Tried to end blocks [0[TRYBLOCK]], but top level block is 2[SWITCH]
         *     at org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement.processEndingBlocks(Op04StructuredStatement.java:435)
         *     at org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement.buildNestedBlocks(Op04StructuredStatement.java:484)
         *     at org.benf.cfr.reader.bytecode.analysis.opgraph.Op03SimpleStatement.createInitialStructuredBlock(Op03SimpleStatement.java:736)
         *     at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisInner(CodeAnalyser.java:850)
         *     at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisOrWrapFail(CodeAnalyser.java:278)
         *     at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysis(CodeAnalyser.java:201)
         *     at org.benf.cfr.reader.entities.attributes.AttributeCode.analyse(AttributeCode.java:94)
         *     at org.benf.cfr.reader.entities.Method.analyse(Method.java:531)
         *     at org.benf.cfr.reader.entities.ClassFile.analyseMid(ClassFile.java:1050)
         *     at org.benf.cfr.reader.entities.ClassFile.analyseTop(ClassFile.java:942)
         *     at org.benf.cfr.reader.Driver.doJarVersionTypes(Driver.java:257)
         *     at org.benf.cfr.reader.Driver.doJar(Driver.java:139)
         *     at org.benf.cfr.reader.CfrDriverImpl.analyse(CfrDriverImpl.java:76)
         *     at org.benf.cfr.reader.Main.main(Main.java:54)
         */
        throw new IllegalStateException("Decompilation failed");
    }

    private static Exception a(Exception exception) {
        return exception;
    }

    private static char[] a(String string) {
        char[] cArray = string.toCharArray();
        if (cArray.length < 2) {
            cArray = cArray;
            cArray[0] = (char)(cArray[0] ^ 0x13);
        }
        return cArray;
    }

    /*
     * Handled impossible loop by duplicating code
     * Enabled aggressive block sorting
     */
    private static String b(int n2, char[] cArray) {
        char[] cArray2;
        block11: {
            int n3;
            int n4;
            int n5;
            block10: {
                n5 = n2;
                cArray2 = cArray;
                n4 = cArray.length;
                n3 = 0;
                if (!true) break block10;
                n4 = n4;
                if (n4 <= n3) break block11;
            }
            do {
                n5 = n5;
                cArray2 = cArray2;
                int n6 = n3;
                cArray2[n6] = (char)(cArray2[n6] ^ (n5 ^ (switch (n3 % 7) {
                    case 0 -> 67;
                    case 1 -> 27;
                    case 2 -> 9;
                    case 3 -> 88;
                    case 4 -> 74;
                    case 5 -> 81;
                    default -> 19;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }

    protected static final class Action
    extends Enum<Action> {
        public static final /* enum */ Action list;
        public static final /* enum */ Action restman_get;
        public static final /* enum */ Action wsman_dry_run;
        public static final /* enum */ Action wsman_install;
        public static final /* enum */ Action custom;
        private static final /* synthetic */ Action[] $VALUES;

        public static Action[] values() {
            return (Action[])$VALUES.clone();
        }

        public static Action valueOf(String string) {
            return Enum.valueOf(Action.class, string);
        }

        private static /* synthetic */ Action[] $values() {
            return new Action[]{list, restman_get, wsman_dry_run, wsman_install, custom};
        }

        /*
         * Unable to fully structure code
         */
        static {
            block10: {
                block9: {
                    var0 = new String[5];
                    var4_1 = 0;
                    var3_2 = "1?D0\u001a\u000b}\u001c=R0\r4)Z%\u00195w1#h6\u0002\u0004\u0006 /D0\u0018\u0007";
                    var5_3 = "1?D0\u001a\u000b}\u001c=R0\r4)Z%\u00195w1#h6\u0002\u0004\u0006 /D0\u0018\u0007".length();
                    var2_4 = 11;
                    var1_5 = -1;
lbl7:
                    // 2 sources

                    while (true) {
                        v0 = 20;
                        v1 = ++var1_5;
                        v2 = var3_2.substring(v1, v1 + var2_4);
                        v3 = -1;
                        break block9;
                        break;
                    }
lbl13:
                    // 1 sources

                    while (true) {
                        var0[var4_1++] = Action.a(v0, Action.a(v2));
                        if ((var1_5 += var2_4) < var5_3) {
                            var2_4 = var3_2.charAt(var1_5);
                            ** continue;
                        }
                        var3_2 = "7+\\(\r,1B=\u0001-b51[=\u0003\u001e";
                        var5_3 = "7+\\(\r,1B=\u0001-b51[=\u0003\u001e".length();
                        var2_4 = 4;
                        var1_5 = -1;
lbl22:
                        // 2 sources

                        while (true) {
                            v0 = 12;
                            v4 = ++var1_5;
                            v2 = var3_2.substring(v4, v4 + var2_4);
                            v3 = 0;
                            break block9;
                            break;
                        }
                        break;
                    }
lbl28:
                    // 1 sources

                    while (true) {
                        var0[var4_1++] = Action.a(v0, Action.a(v2));
                        if ((var1_5 += var2_4) < var5_3) {
                            var2_4 = var3_2.charAt(var1_5);
                            ** continue;
                        }
                        break block10;
                        break;
                    }
                }
                switch (v3) {
                    default: {
                        ** continue;
                    }
                    ** case 0:
lbl39:
                    // 1 sources

                    ** continue;
                }
            }
            Action.list = new Action();
            Action.restman_get = new Action();
            Action.wsman_dry_run = new Action();
            Action.wsman_install = new Action();
            Action.custom = new Action();
            Action.$VALUES = Action.$values();
        }

        private static char[] a(String string) {
            char[] cArray = string.toCharArray();
            if (cArray.length < 2) {
                cArray = cArray;
                cArray[0] = (char)(cArray[0] ^ 7);
            }
            return cArray;
        }

        /*
         * Handled impossible loop by duplicating code
         * Enabled aggressive block sorting
         */
        private static String a(int n2, char[] cArray) {
            char[] cArray2;
            block11: {
                int n3;
                int n4;
                int n5;
                block10: {
                    n5 = n2;
                    cArray2 = cArray;
                    n4 = cArray.length;
                    n3 = 0;
                    if (!true) break block10;
                    n4 = n4;
                    if (n4 <= n3) break block11;
                }
                do {
                    n5 = n5;
                    cArray2 = cArray2;
                    int n6 = n3;
                    cArray2[n6] = (char)(cArray2[n6] ^ (n5 ^ (switch (n3 % 7) {
                        case 0 -> 87;
                        case 1 -> 78;
                        case 2 -> 35;
                        case 3 -> 80;
                        case 4 -> 99;
                        case 5 -> 126;
                        default -> 7;
                    })));
                    ++n3;
                    n4 = n4;
                } while (n4 > n3);
            }
            return new String(cArray2).intern();
        }
    }
}

