package com.l7tech.policy.wsp;

import com.l7tech.policy.assertion.xmlsec.RequireWssEncryptedElement;
import com.l7tech.policy.assertion.xmlsec.XmlSecurityAssertionBase;
import com.l7tech.util.SoapConstants;
import org.w3c.dom.Element;

class d extends AssertionMapping {
   private final af d;
   private static final String[] e;

   d(XmlSecurityAssertionBase var1, String var2) {
      this(var1, var2, null);
   }

   d(XmlSecurityAssertionBase var1, String var2, String var3) {
      super(var1, var2, var3);
      String[] var4 = e;
      this.d = new af(var4[10], SoapConstants.SECURITY_NAMESPACE, var4[8]);
      if (!(var1 instanceof RequireWssEncryptedElement)) {
         throw new IllegalArgumentException(var4[5]);
      }
   }

   @Override
   public TypedReference thaw(Element param1, WspVisitor param2) throws InvalidPolicyStreamException {
      // $VF: Couldn't be decompiled
      // Please report this to the Vineflower issue tracker, at https://github.com/Vineflower/vineflower/issues with a copy of the class file (if you have the rights to distribute it!)
      // java.lang.RuntimeException: parsing failure!
      //   at org.jetbrains.java.decompiler.modules.decompiler.decompose.DomHelper.parseGraph(DomHelper.java:211)
      //   at org.jetbrains.java.decompiler.main.rels.MethodProcessor.codeToJava(MethodProcessor.java:174)
      //
      // Bytecode:
      // 000: aload 1
      // 001: invokeinterface org/w3c/dom/Element.getLocalName ()Ljava/lang/String; 1
      // 006: getstatic com/l7tech/policy/wsp/d.e [Ljava/lang/String;
      // 009: bipush 1
      // 00a: aaload
      // 00b: invokevirtual java/lang/String.equals (Ljava/lang/Object;)Z
      // 00e: ifeq 029
      // 011: getstatic com/l7tech/policy/wsp/d.e [Ljava/lang/String;
      // 014: bipush 4
      // 015: aaload
      // 016: aload 1
      // 017: invokeinterface org/w3c/dom/Element.getNamespaceURI ()Ljava/lang/String; 1
      // 01c: invokevirtual java/lang/String.equals (Ljava/lang/Object;)Z
      // 01f: ifeq 034
      // 022: goto 029
      // 025: invokestatic com/l7tech/policy/wsp/d.a (Lcom/l7tech/policy/wsp/InvalidPolicyStreamException;)Lcom/l7tech/policy/wsp/InvalidPolicyStreamException;
      // 028: athrow
      // 029: aload 0
      // 02a: aload 1
      // 02b: aload 2
      // 02c: invokespecial com/l7tech/policy/wsp/AssertionMapping.thaw (Lorg/w3c/dom/Element;Lcom/l7tech/policy/wsp/WspVisitor;)Lcom/l7tech/policy/wsp/TypedReference;
      // 02f: areturn
      // 030: invokestatic com/l7tech/policy/wsp/d.a (Lcom/l7tech/policy/wsp/InvalidPolicyStreamException;)Lcom/l7tech/policy/wsp/InvalidPolicyStreamException;
      // 033: athrow
      // 034: aload 1
      // 035: invokestatic com/l7tech/policy/wsp/y.a (Lorg/w3c/dom/Element;)V
      // 038: new com/l7tech/policy/assertion/xmlsec/RequireWssEncryptedElement
      // 03b: dup
      // 03c: invokespecial com/l7tech/policy/assertion/xmlsec/RequireWssEncryptedElement.<init> ()V
      // 03f: astore 3
      // 040: new com/l7tech/policy/wsp/TypedReference
      // 043: dup
      // 044: ldc com/l7tech/policy/assertion/xmlsec/RequireWssEncryptedElement
      // 046: aload 3
      // 047: invokespecial com/l7tech/policy/wsp/TypedReference.<init> (Ljava/lang/Class;Ljava/lang/Object;)V
      // 04a: astore 4
      // 04c: aload 1
      // 04d: aconst_null
      // 04e: checkcast java/lang/String
      // 051: getstatic com/l7tech/policy/wsp/d.e [Ljava/lang/String;
      // 054: astore 10
      // 056: aload 10
      // 058: bipush 6
      // 05a: aaload
      // 05b: invokestatic com/l7tech/util/DomUtils.findFirstChildElementByName (Lorg/w3c/dom/Node;Ljava/lang/String;Ljava/lang/String;)Lorg/w3c/dom/Element;
      // 05e: astore 5
      // 060: aload 5
      // 062: ifnull 095
      // 065: new com/l7tech/policy/wsp/BeanTypeMapping
      // 068: dup
      // 069: ldc com/l7tech/policy/assertion/xmlsec/XmlSecurityRecipientContext
      // 06b: aload 10
      // 06d: bipush 2
      // 06e: aaload
      // 06f: invokespecial com/l7tech/policy/wsp/BeanTypeMapping.<init> (Ljava/lang/Class;Ljava/lang/String;)V
      // 072: aload 5
      // 074: aload 2
      // 075: invokevirtual com/l7tech/policy/wsp/BeanTypeMapping.thaw (Lorg/w3c/dom/Element;Lcom/l7tech/policy/wsp/WspVisitor;)Lcom/l7tech/policy/wsp/TypedReference;
      // 078: astore 6
      // 07a: aload 6
      // 07c: getfield com/l7tech/policy/wsp/TypedReference.target Ljava/lang/Object;
      // 07f: instanceof com/l7tech/policy/assertion/xmlsec/XmlSecurityRecipientContext
      // 082: ifeq 095
      // 085: aload 6
      // 087: getfield com/l7tech/policy/wsp/TypedReference.target Ljava/lang/Object;
      // 08a: checkcast com/l7tech/policy/assertion/xmlsec/XmlSecurityRecipientContext
      // 08d: astore 7
      // 08f: aload 3
      // 090: aload 7
      // 092: invokevirtual com/l7tech/policy/assertion/xmlsec/RequireWssEncryptedElement.setRecipientContext (Lcom/l7tech/policy/assertion/xmlsec/XmlSecurityRecipientContext;)V
      // 095: aload 1
      // 096: aconst_null
      // 097: checkcast java/lang/String
      // 09a: getstatic com/l7tech/policy/wsp/d.e [Ljava/lang/String;
      // 09d: astore 10
      // 09f: aload 10
      // 0a1: bipush 7
      // 0a3: aaload
      // 0a4: invokestatic com/l7tech/util/DomUtils.findFirstChildElementByName (Lorg/w3c/dom/Node;Ljava/lang/String;Ljava/lang/String;)Lorg/w3c/dom/Element;
      // 0a7: astore 6
      // 0a9: aload 0
      // 0aa: getfield com/l7tech/policy/wsp/d.d Lcom/l7tech/policy/wsp/af;
      // 0ad: aload 6
      // 0af: aload 2
      // 0b0: invokevirtual com/l7tech/policy/wsp/af.thaw (Lorg/w3c/dom/Element;Lcom/l7tech/policy/wsp/WspVisitor;)Lcom/l7tech/policy/wsp/TypedReference;
      // 0b3: astore 7
      // 0b5: aload 7
      // 0b7: ifnull 0cc
      // 0ba: aload 7
      // 0bc: getfield com/l7tech/policy/wsp/TypedReference.target Ljava/lang/Object;
      // 0bf: instanceof com/l7tech/xml/xpath/XpathExpression
      // 0c2: ifne 0dd
      // 0c5: goto 0cc
      // 0c8: invokestatic com/l7tech/policy/wsp/d.a (Lcom/l7tech/policy/wsp/InvalidPolicyStreamException;)Lcom/l7tech/policy/wsp/InvalidPolicyStreamException;
      // 0cb: athrow
      // 0cc: new com/l7tech/policy/wsp/InvalidPolicyStreamException
      // 0cf: dup
      // 0d0: getstatic com/l7tech/policy/wsp/d.e [Ljava/lang/String;
      // 0d3: bipush 0
      // 0d4: aaload
      // 0d5: invokespecial com/l7tech/policy/wsp/InvalidPolicyStreamException.<init> (Ljava/lang/String;)V
      // 0d8: athrow
      // 0d9: invokestatic com/l7tech/policy/wsp/d.a (Lcom/l7tech/policy/wsp/InvalidPolicyStreamException;)Lcom/l7tech/policy/wsp/InvalidPolicyStreamException;
      // 0dc: athrow
      // 0dd: aload 3
      // 0de: aload 7
      // 0e0: getfield com/l7tech/policy/wsp/TypedReference.target Ljava/lang/Object;
      // 0e3: checkcast com/l7tech/xml/xpath/XpathExpression
      // 0e6: invokevirtual com/l7tech/policy/assertion/xmlsec/RequireWssEncryptedElement.setXpathExpression (Lcom/l7tech/xml/xpath/XpathExpression;)V
      // 0e9: aload 1
      // 0ea: aconst_null
      // 0eb: checkcast java/lang/String
      // 0ee: getstatic com/l7tech/policy/wsp/d.e [Ljava/lang/String;
      // 0f1: astore 10
      // 0f3: aload 10
      // 0f5: bipush 9
      // 0f7: aaload
      // 0f8: invokestatic com/l7tech/util/DomUtils.findFirstChildElementByName (Lorg/w3c/dom/Node;Ljava/lang/String;Ljava/lang/String;)Lorg/w3c/dom/Element;
      // 0fb: astore 8
      // 0fd: aload 8
      // 0ff: ifnull 130
      // 102: aload 8
      // 104: aload 10
      // 106: bipush 3
      // 107: aaload
      // 108: invokeinterface org/w3c/dom/Element.getAttribute (Ljava/lang/String;)Ljava/lang/String; 2
      // 10d: astore 9
      // 10f: aload 9
      // 111: ifnull 130
      // 114: aload 9
      // 116: invokevirtual java/lang/String.length ()I
      // 119: ifle 130
      // 11c: goto 123
      // 11f: invokestatic com/l7tech/policy/wsp/d.a (Lcom/l7tech/policy/wsp/InvalidPolicyStreamException;)Lcom/l7tech/policy/wsp/InvalidPolicyStreamException;
      // 122: athrow
      // 123: aload 3
      // 124: aload 9
      // 126: invokevirtual com/l7tech/policy/assertion/xmlsec/RequireWssEncryptedElement.setXEncAlgorithm (Ljava/lang/String;)V
      // 129: goto 130
      // 12c: invokestatic com/l7tech/policy/wsp/d.a (Lcom/l7tech/policy/wsp/InvalidPolicyStreamException;)Lcom/l7tech/policy/wsp/InvalidPolicyStreamException;
      // 12f: athrow
      // 130: aload 4
      // 132: areturn
      // try (0 -> 14): 15 com/l7tech/policy/wsp/InvalidPolicyStreamException
      // try (7 -> 22): 22 com/l7tech/policy/wsp/InvalidPolicyStreamException
      // try (86 -> 92): 93 com/l7tech/policy/wsp/InvalidPolicyStreamException
      // try (88 -> 102): 102 com/l7tech/policy/wsp/InvalidPolicyStreamException
      // try (127 -> 132): 133 com/l7tech/policy/wsp/InvalidPolicyStreamException
      // try (129 -> 138): 139 com/l7tech/policy/wsp/InvalidPolicyStreamException
   }

   private static InvalidPolicyStreamException a(InvalidPolicyStreamException var0) {
      return var0;
   }

   static {
      String[] var5 = new String[11];
      int var3 = 0;
      String var2 = "Nl\u0019Ii\t_bwLWhJ^{f\u001e\u0005uYPykL@uYChp\u001fLbG\u0011kq\u0003H-j^ce\u0005AhGEdb\u0000LyP\u001e@f\u001fVlNT]b\u001eQ~\u000fNl\u0002CdMTcw\u0005Da@Et\u001bun\u0000vhJD\u007fj\u0018\\_LRds\u0005@c]rbm\u0018@u]\u0003XQ%#ew\u0018U7\u0006\u001ezt\u001b\u000baHHhq[QhJY#`\u0003H\"^B\"s\u0003IdJH'Nb\u0002\u0005bG]t#\u0001D}\tchr\u0019L\u007fLf~p)Kn[H}w\tAHET`f\u0002Q\u001bun\u0000vhJD\u007fj\u0018\\_LRds\u0005@c]rbm\u0018@u]\f@f\u001fVlNT]b\u001eQ~\u0004zp\u001f@";
      int var4 = "Nl\u0019Ii\t_bwLWhJ^{f\u001e\u0005uYPykL@uYChp\u001fLbG\u0011kq\u0003H-j^ce\u0005AhGEdb\u0000LyP\u001e@f\u001fVlNT]b\u001eQ~\u000fNl\u0002CdMTcw\u0005Da@Et\u001bun\u0000vhJD\u007fj\u0018\\_LRds\u0005@c]rbm\u0018@u]\u0003XQ%#ew\u0018U7\u0006\u001ezt\u001b\u000baHHhq[QhJY#`\u0003H\"^B\"s\u0003IdJH'Nb\u0002\u0005bG]t#\u0001D}\tchr\u0019L\u007fLf~p)Kn[H}w\tAHET`f\u0002Q\u001bun\u0000vhJD\u007fj\u0018\\_LRds\u0005@c]rbm\u0018@u]\f@f\u001fVlNT]b\u001eQ~\u0004zp\u001f@"
         .length();
      char var1 = 'D';
      int var7 = -1;

      label24:
      while (true) {
         byte var10000 = 89;
         String var10001 = var2.substring(++var7, var7 + var1);
         byte var10002 = -1;

         while (true) {
            String var8 = e(var10000, e(var10001));
            switch (var10002) {
               case 0:
                  var5[var3++] = var8;
                  if ((var7 += var1) >= var4) {
                     e = var5;
                     return;
                  }

                  var1 = var2.charAt(var7);
                  break;
               default:
                  var5[var3++] = var8;
                  if ((var7 += var1) < var4) {
                     var1 = var2.charAt(var7);
                     continue label24;
                  }

                  var2 = "\u00130T\u0015 \u001f\u001a:1\f\u001f9@\t3\u0011\u000b\u0002=A\u000e!";
                  var4 = "\u00130T\u0015 \u001f\u001a:1\f\u001f9@\t3\u0011\u000b\u0002=A\u000e!".length();
                  var1 = '\t';
                  var7 = -1;
            }

            var10000 = 6;
            var10001 = var2.substring(++var7, var7 + var1);
            var10002 = 0;
         }
      }
   }

   private static char[] e(String var0) {
      char[] var10000 = var0.toCharArray();
      if (var10000.length < 2) {
         var10000[0] = (char)(var10000[0] ^ 104);
      }

      return var10000;
   }

   private static String e(int var0, char[] var1) {
      int var10003 = var1.length;
      int var10002 = var0;
      char[] var10001 = var1;
      int var10000 = var10003;

      for (int var2 = 0; var10000 > var2; var2++) {
         var10001[var2] = (char)(var10001[var2] ^ var10002 ^ switch (var2 % 7) {
            case 0 -> 84;
            case 1 -> 90;
            case 2 -> 53;
            case 3 -> 124;
            case 4 -> 84;
            case 5 -> 112;
            default -> 104;
         });
      }

      return new String(var10001).intern();
   }
}
