/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.identity.mapping.FederatedAttributeMapping
 *  com.l7tech.identity.mapping.IdentityMapping
 *  com.l7tech.identity.mapping.InternalAttributeMapping
 *  com.l7tech.identity.mapping.LdapAttributeMapping
 */
package com.l7tech.server.identity.mapping;

import com.l7tech.identity.mapping.FederatedAttributeMapping;
import com.l7tech.identity.mapping.IdentityMapping;
import com.l7tech.identity.mapping.InternalAttributeMapping;
import com.l7tech.identity.mapping.LdapAttributeMapping;
import com.l7tech.server.identity.mapping.AttributeExtractor;
import com.l7tech.server.identity.mapping.FederatedAttributeExtractor;
import com.l7tech.server.identity.mapping.InternalAttributeExtractor;
import com.l7tech.server.identity.mapping.LdapAttributeExtractor;

public final class ExtractorFactory {
    private static final String a = ExtractorFactory.a(81, ExtractorFactory.a("yT\u007fd\u0018d$[^tc\r*i_Me1\r'=UG1%\u00036i"));

    public static AttributeExtractor getExtractor(IdentityMapping identityMapping) {
        if (identityMapping instanceof LdapAttributeMapping) {
            LdapAttributeMapping ldapAttributeMapping = (LdapAttributeMapping)identityMapping;
            return new LdapAttributeExtractor(ldapAttributeMapping);
        }
        if (identityMapping instanceof InternalAttributeMapping) {
            InternalAttributeMapping internalAttributeMapping = (InternalAttributeMapping)identityMapping;
            return new InternalAttributeExtractor(internalAttributeMapping);
        }
        if (identityMapping instanceof FederatedAttributeMapping) {
            FederatedAttributeMapping federatedAttributeMapping = (FederatedAttributeMapping)identityMapping;
            return new FederatedAttributeExtractor(federatedAttributeMapping);
        }
        throw new IllegalArgumentException(a + identityMapping.getClass().getName());
    }

    private static char[] a(String string) {
        char[] cArray = string.toCharArray();
        if (cArray.length < 2) {
            cArray = cArray;
            cArray[0] = (char)(cArray[0] ^ 0x18);
        }
        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 -> 107;
                    case 1 -> 100;
                    case 2 -> 64;
                    case 3 -> 18;
                    case 4 -> 61;
                    case 5 -> 21;
                    default -> 24;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

