package com.l7tech.common.http;

import java.util.List;

public class GenericHttpHeaders implements HttpHeaders {
   private final HttpHeader[] a;
   private static final String[] b;

   public GenericHttpHeaders(HttpHeader[] var1) {
      this.a = var1;
   }

   @Override
   public String getFirstValue(String param1) {
      // $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 1
      // 01: ifnonnull 10
      // 04: new java/lang/NullPointerException
      // 07: dup
      // 08: invokespecial java/lang/NullPointerException.<init> ()V
      // 0b: athrow
      // 0c: invokestatic com/l7tech/common/http/GenericHttpHeaders.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 0f: athrow
      // 10: aload 0
      // 11: getfield com/l7tech/common/http/GenericHttpHeaders.a [Lcom/l7tech/common/http/HttpHeader;
      // 14: astore 2
      // 15: aload 2
      // 16: arraylength
      // 17: istore 3
      // 18: bipush 0
      // 19: istore 4
      // 1b: iload 4
      // 1d: iload 3
      // 1e: if_icmpge 64
      // 21: aload 2
      // 22: iload 4
      // 24: aaload
      // 25: astore 5
      // 27: aload 5
      // 29: ifnull 5e
      // 2c: aload 5
      // 2e: invokeinterface com/l7tech/common/http/HttpHeader.getName ()Ljava/lang/String; 1
      // 33: ifnull 5e
      // 36: goto 3d
      // 39: invokestatic com/l7tech/common/http/GenericHttpHeaders.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 3c: athrow
      // 3d: aload 5
      // 3f: invokeinterface com/l7tech/common/http/HttpHeader.getName ()Ljava/lang/String; 1
      // 44: aload 1
      // 45: invokevirtual java/lang/String.equalsIgnoreCase (Ljava/lang/String;)Z
      // 48: ifeq 5e
      // 4b: goto 52
      // 4e: invokestatic com/l7tech/common/http/GenericHttpHeaders.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 51: athrow
      // 52: aload 5
      // 54: invokeinterface com/l7tech/common/http/HttpHeader.getFullValue ()Ljava/lang/String; 1
      // 59: areturn
      // 5a: invokestatic com/l7tech/common/http/GenericHttpHeaders.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 5d: athrow
      // 5e: iinc 4 1
      // 61: goto 1b
      // 64: aconst_null
      // 65: areturn
      // try (0 -> 6): 6 java/lang/NullPointerException
      // try (23 -> 28): 29 java/lang/NullPointerException
      // try (25 -> 36): 37 java/lang/NullPointerException
      // try (31 -> 42): 42 java/lang/NullPointerException
   }

   @Override
   public String getOnlyOneValue(String param1) throws GenericHttpException {
      // $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 1
      // 01: ifnonnull 10
      // 04: new java/lang/NullPointerException
      // 07: dup
      // 08: invokespecial java/lang/NullPointerException.<init> ()V
      // 0b: athrow
      // 0c: invokestatic com/l7tech/common/http/GenericHttpHeaders.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 0f: athrow
      // 10: aconst_null
      // 11: astore 2
      // 12: aload 0
      // 13: getfield com/l7tech/common/http/GenericHttpHeaders.a [Lcom/l7tech/common/http/HttpHeader;
      // 16: astore 3
      // 17: aload 3
      // 18: arraylength
      // 19: istore 4
      // 1b: bipush 0
      // 1c: istore 5
      // 1e: iload 5
      // 20: iload 4
      // 22: if_icmpge 87
      // 25: aload 3
      // 26: iload 5
      // 28: aaload
      // 29: astore 6
      // 2b: aload 6
      // 2d: ifnull 81
      // 30: aload 6
      // 32: invokeinterface com/l7tech/common/http/HttpHeader.getName ()Ljava/lang/String; 1
      // 37: ifnull 81
      // 3a: goto 41
      // 3d: invokestatic com/l7tech/common/http/GenericHttpHeaders.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 40: athrow
      // 41: aload 6
      // 43: invokeinterface com/l7tech/common/http/HttpHeader.getName ()Ljava/lang/String; 1
      // 48: aload 1
      // 49: invokevirtual java/lang/String.equalsIgnoreCase (Ljava/lang/String;)Z
      // 4c: ifeq 81
      // 4f: goto 56
      // 52: invokestatic com/l7tech/common/http/GenericHttpHeaders.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 55: athrow
      // 56: aload 2
      // 57: ifnull 79
      // 5a: goto 61
      // 5d: invokestatic com/l7tech/common/http/GenericHttpHeaders.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 60: athrow
      // 61: new com/l7tech/common/http/GenericHttpException
      // 64: dup
      // 65: aload 1
      // 66: getstatic com/l7tech/common/http/GenericHttpHeaders.b [Ljava/lang/String;
      // 69: bipush 0
      // 6a: aaload
      // 6b: swap
      // 6c: invokedynamic makeConcatWithConstants (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; bsm=java/lang/invoke/StringConcatFactory.makeConcatWithConstants (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite; args=[ "\u0001\u0001" ]
      // 71: invokespecial com/l7tech/common/http/GenericHttpException.<init> (Ljava/lang/String;)V
      // 74: athrow
      // 75: invokestatic com/l7tech/common/http/GenericHttpHeaders.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 78: athrow
      // 79: aload 6
      // 7b: invokeinterface com/l7tech/common/http/HttpHeader.getFullValue ()Ljava/lang/String; 1
      // 80: astore 2
      // 81: iinc 5 1
      // 84: goto 1e
      // 87: aload 2
      // 88: areturn
      // try (0 -> 6): 6 com/l7tech/common/http/GenericHttpException
      // try (25 -> 30): 31 com/l7tech/common/http/GenericHttpException
      // try (27 -> 38): 39 com/l7tech/common/http/GenericHttpException
      // try (33 -> 43): 44 com/l7tech/common/http/GenericHttpException
      // try (41 -> 56): 56 com/l7tech/common/http/GenericHttpException
   }

   @Override
   public List<String> getValues(String param1) {
      // $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 1
      // 01: ifnonnull 10
      // 04: new java/lang/NullPointerException
      // 07: dup
      // 08: invokespecial java/lang/NullPointerException.<init> ()V
      // 0b: athrow
      // 0c: invokestatic com/l7tech/common/http/GenericHttpHeaders.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 0f: athrow
      // 10: new java/util/ArrayList
      // 13: dup
      // 14: invokespecial java/util/ArrayList.<init> ()V
      // 17: astore 2
      // 18: aload 0
      // 19: getfield com/l7tech/common/http/GenericHttpHeaders.a [Lcom/l7tech/common/http/HttpHeader;
      // 1c: astore 3
      // 1d: aload 3
      // 1e: arraylength
      // 1f: istore 4
      // 21: bipush 0
      // 22: istore 5
      // 24: iload 5
      // 26: iload 4
      // 28: if_icmpge 77
      // 2b: aload 3
      // 2c: iload 5
      // 2e: aaload
      // 2f: astore 6
      // 31: aload 6
      // 33: ifnull 71
      // 36: aload 6
      // 38: invokeinterface com/l7tech/common/http/HttpHeader.getName ()Ljava/lang/String; 1
      // 3d: ifnull 71
      // 40: goto 47
      // 43: invokestatic com/l7tech/common/http/GenericHttpHeaders.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 46: athrow
      // 47: aload 6
      // 49: invokeinterface com/l7tech/common/http/HttpHeader.getName ()Ljava/lang/String; 1
      // 4e: aload 1
      // 4f: invokevirtual java/lang/String.equalsIgnoreCase (Ljava/lang/String;)Z
      // 52: ifeq 71
      // 55: goto 5c
      // 58: invokestatic com/l7tech/common/http/GenericHttpHeaders.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 5b: athrow
      // 5c: aload 2
      // 5d: aload 6
      // 5f: invokeinterface com/l7tech/common/http/HttpHeader.getFullValue ()Ljava/lang/String; 1
      // 64: invokeinterface java/util/List.add (Ljava/lang/Object;)Z 2
      // 69: pop
      // 6a: goto 71
      // 6d: invokestatic com/l7tech/common/http/GenericHttpHeaders.a (Ljava/lang/Exception;)Ljava/lang/Exception;
      // 70: athrow
      // 71: iinc 5 1
      // 74: goto 24
      // 77: aload 2
      // 78: areturn
      // try (0 -> 6): 6 java/lang/NullPointerException
      // try (27 -> 32): 33 java/lang/NullPointerException
      // try (29 -> 40): 41 java/lang/NullPointerException
      // try (35 -> 48): 49 java/lang/NullPointerException
   }

   @Override
   public HttpHeader[] toArray() {
      return this.a;
   }

   @Override
   public String toExternalForm() {
      StringBuffer var1 = new StringBuffer();

      for (HttpHeader var5 : this.a) {
         var1.append(var5.getName()).append(b[1]).append(var5.getFullValue()).append("\n");
      }

      return var1.toString();
   }

   @Override
   public String toString() {
      return this.toExternalForm();
   }

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

   static {
      String[] var5 = new String[2];
      int var3 = 0;
      String var2 = "\u007fA\u001aXK]ZW\u0014\u0000MNXSA\u0014\u0010CWCR\u0012R\u0019^\u0002Y^W\u0014>xv}\u0016ZQ\u0017HG_\f\u0012\u0002\b\u0014";
      int var4 = "\u007fA\u001aXK]ZW\u0014\u0000MNXSA\u0014\u0010CWCR\u0012R\u0019^\u0002Y^W\u0014>xv}\u0016ZQ\u0017HG_\f\u0012\u0002\b\u0014".length();
      char var1 = '+';
      int var0 = -1;

      while (true) {
         String var10002 = a(16, a(var2.substring(++var0, var0 + var1)));
         byte var10001 = -1;
         var5[var3++] = var10002;
         if ((var0 += var1) >= var4) {
            b = 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] ^ 38);
      }

      return var10000;
   }

   private static String a(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 -> 34;
            case 1 -> 36;
            case 2 -> 102;
            case 3 -> 60;
            case 4 -> 50;
            case 5 -> 61;
            default -> 38;
         });
      }

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