package com.l7tech.gateway.api.impl;

import com.l7tech.gateway.api.Accessor;
import com.l7tech.gateway.api.PolicyImportResult;
import com.sun.ws.management.client.exceptions.FaultException;
import jakarta.xml.bind.JAXBException;
import jakarta.xml.soap.SOAPException;
import java.io.IOException;
import java.util.List;
import java.util.Map;
import javax.xml.datatype.DatatypeConfigurationException;

class s implements i<PolicyImportResult> {
   final String val$identifier;
   final Map val$properties;
   final List val$instructions;
   final String val$export;
   final d this$0;
   private static final String[] a;

   s(d var1, String var2, Map var3, List var4, String var5) {
      this.this$0 = var1;
      this.val$identifier = var2;
      this.val$properties = var3;
      this.val$instructions = var4;
      this.val$export = var5;
   }

   public PolicyImportResult invoke() throws DatatypeConfigurationException, FaultException, JAXBException, SOAPException, IOException, Accessor.AccessorException {
      // $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:
      // 00: aload 0
      // 01: getfield com/l7tech/gateway/api/impl/s.this$0 Lcom/l7tech/gateway/api/impl/d;
      // 04: invokevirtual com/l7tech/gateway/api/impl/d.f ()Lcom/sun/ws/management/client/ResourceFactory;
      // 07: aload 0
      // 08: getfield com/l7tech/gateway/api/impl/s.this$0 Lcom/l7tech/gateway/api/impl/d;
      // 0b: invokevirtual com/l7tech/gateway/api/impl/d.a ()Ljava/lang/String;
      // 0e: aload 0
      // 0f: getfield com/l7tech/gateway/api/impl/s.this$0 Lcom/l7tech/gateway/api/impl/d;
      // 12: invokevirtual com/l7tech/gateway/api/impl/d.b ()Ljava/lang/String;
      // 15: aload 0
      // 16: getfield com/l7tech/gateway/api/impl/s.this$0 Lcom/l7tech/gateway/api/impl/d;
      // 19: invokevirtual com/l7tech/gateway/api/impl/d.c ()I
      // 1c: i2l
      // 1d: getstatic com/l7tech/gateway/api/impl/s.a [Ljava/lang/String;
      // 20: astore 4
      // 22: aload 4
      // 24: bipush 1
      // 25: aaload
      // 26: aload 0
      // 27: getfield com/l7tech/gateway/api/impl/s.val$identifier Ljava/lang/String;
      // 2a: invokestatic java/util/Collections.singletonMap (Ljava/lang/Object;Ljava/lang/Object;)Ljava/util/Map;
      // 2d: invokevirtual com/sun/ws/management/client/ResourceFactory.find (Ljava/lang/String;Ljava/lang/String;JLjava/util/Map;)[Lcom/sun/ws/management/client/Resource;
      // 30: bipush 0
      // 31: aaload
      // 32: astore 1
      // 33: new com/l7tech/gateway/api/impl/PolicyImportContext
      // 36: dup
      // 37: invokespecial com/l7tech/gateway/api/impl/PolicyImportContext.<init> ()V
      // 3a: astore 2
      // 3b: aload 2
      // 3c: aload 0
      // 3d: getfield com/l7tech/gateway/api/impl/s.val$properties Ljava/util/Map;
      // 40: invokevirtual com/l7tech/gateway/api/impl/PolicyImportContext.setProperties (Ljava/util/Map;)V
      // 43: aload 2
      // 44: invokestatic com/l7tech/gateway/api/ManagedObjectFactory.createResource ()Lcom/l7tech/gateway/api/Resource;
      // 47: invokevirtual com/l7tech/gateway/api/impl/PolicyImportContext.setResource (Lcom/l7tech/gateway/api/Resource;)V
      // 4a: aload 0
      // 4b: getfield com/l7tech/gateway/api/impl/s.val$instructions Ljava/util/List;
      // 4e: ifnull 6d
      // 51: aload 0
      // 52: getfield com/l7tech/gateway/api/impl/s.val$instructions Ljava/util/List;
      // 55: invokeinterface java/util/List.isEmpty ()Z 1
      // 5a: ifne 6d
      // 5d: goto 61
      // 60: athrow
      // 61: aload 2
      // 62: aload 0
      // 63: getfield com/l7tech/gateway/api/impl/s.val$instructions Ljava/util/List;
      // 66: invokevirtual com/l7tech/gateway/api/impl/PolicyImportContext.setPolicyReferenceInstructions (Ljava/util/List;)V
      // 69: goto 6d
      // 6c: athrow
      // 6d: aload 2
      // 6e: invokevirtual com/l7tech/gateway/api/impl/PolicyImportContext.getResource ()Lcom/l7tech/gateway/api/Resource;
      // 71: getstatic com/l7tech/gateway/api/impl/s.a [Ljava/lang/String;
      // 74: astore 4
      // 76: aload 4
      // 78: bipush 2
      // 79: aaload
      // 7a: invokevirtual com/l7tech/gateway/api/Resource.setType (Ljava/lang/String;)V
      // 7d: aload 2
      // 7e: invokevirtual com/l7tech/gateway/api/impl/PolicyImportContext.getResource ()Lcom/l7tech/gateway/api/Resource;
      // 81: aload 0
      // 82: getfield com/l7tech/gateway/api/impl/s.val$export Ljava/lang/String;
      // 85: invokevirtual com/l7tech/gateway/api/Resource.setContent (Ljava/lang/String;)V
      // 88: aload 1
      // 89: aload 0
      // 8a: getfield com/l7tech/gateway/api/impl/s.this$0 Lcom/l7tech/gateway/api/impl/d;
      // 8d: aload 4
      // 8f: bipush 0
      // 90: aaload
      // 91: invokevirtual com/l7tech/gateway/api/impl/d.a (Ljava/lang/String;)Ljava/lang/String;
      // 94: aload 2
      // 95: invokestatic com/l7tech/gateway/api/ManagedObjectFactory.write (Lcom/l7tech/gateway/api/ManagedObject;)Lorg/w3c/dom/Document;
      // 98: invokeinterface com/sun/ws/management/client/Resource.invoke (Ljava/lang/String;Lorg/w3c/dom/Document;)Lcom/sun/ws/management/client/ResourceState; 3
      // 9d: astore 3
      // 9e: aload 3
      // 9f: invokeinterface com/sun/ws/management/client/ResourceState.getDocument ()Lorg/w3c/dom/Document; 1
      // a4: ldc com/l7tech/gateway/api/PolicyImportResult
      // a6: invokestatic com/l7tech/gateway/api/ManagedObjectFactory.read (Lorg/w3c/dom/Document;Ljava/lang/Class;)Lcom/l7tech/gateway/api/ManagedObject;
      // a9: checkcast com/l7tech/gateway/api/PolicyImportResult
      // ac: areturn
      // try (29 -> 43): 44 javax/xml/datatype/DatatypeConfigurationException
      // try (39 -> 49): 50 javax/xml/datatype/DatatypeConfigurationException
   }

   static {
      String[] var5 = new String[3];
      int var3 = 0;
      String var2 = "cn=>7_\fEo$2<\u0002Cg\fZl!8&R9Rs\"#1";
      int var4 = "cn=>7_\fEo$2<\u0002Cg\fZl!8&R9Rs\"#1".length();
      char var1 = '\f';
      int var0 = -1;

      while (true) {
         String var10002 = a(a(var2.substring(++var0, var0 + var1)));
         byte var10001 = -1;
         var5[var3++] = var10002;
         if ((var0 += var1) >= var4) {
            a = var5;
            return;
         }

         var1 = var2.charAt(var0);
      }
   }

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

      return var10000;
   }

   private static String a(char[] var0) {
      int var10002 = var0.length;
      char[] var10001 = var0;
      int var10000 = var10002;

      for (int var1 = 0; var10000 > var1; var1++) {
         var10001[var1] = (char)(var10001[var1] ^ switch (var1 % 7) {
            case 0 -> 42;
            case 1 -> 3;
            case 2 -> 77;
            case 3 -> 81;
            case 4 -> 69;
            case 5 -> 43;
            default -> 92;
         });
      }

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