package mapped;

import java.security.Principal;
import java.security.cert.Certificate;
import javax.net.ssl.SSLPeerUnverifiedException;
import javax.net.ssl.SSLSession;
import javax.net.ssl.SSLSessionContext;
import javax.security.cert.X509Certificate;
import net.runelite.mapping.ObfuscatedName;
import net.runelite.mapping.ObfuscatedSignature;

@ObfuscatedName("am")
class class17 implements SSLSession {
   @ObfuscatedName("ah")
   public static String field77;
   // $FF: synthetic field
   @ObfuscatedSignature(
      descriptor = "Lax;"
   )
   final class12 this$1;

   @ObfuscatedSignature(
      descriptor = "(Lax;)V"
   )
   class17(class12 var1) {
      this.this$1 = var1;
   }

   public long getLastAccessedTime() {
      throw new UnsupportedOperationException();
   }

   public String getCipherSuite() {
      throw new UnsupportedOperationException();
   }

   public long getCreationTime() {
      throw new UnsupportedOperationException();
   }

   public byte[] getId() {
      throw new UnsupportedOperationException();
   }

   public int getPacketBufferSize() {
      throw new UnsupportedOperationException();
   }

   public String getPeerHost() {
      throw new UnsupportedOperationException();
   }

   public String getProtocol() {
      throw new UnsupportedOperationException();
   }

   public void putValue(String var1, Object var2) {
      throw new UnsupportedOperationException();
   }

   public Object getValue(String var1) {
      throw new UnsupportedOperationException();
   }

   public String[] getValueNames() {
      throw new UnsupportedOperationException();
   }

   public void invalidate() {
      throw new UnsupportedOperationException();
   }

   public boolean isValid() {
      throw new UnsupportedOperationException();
   }

   public Certificate[] getLocalCertificates() {
      throw new UnsupportedOperationException();
   }

   public void removeValue(String var1) {
      throw new UnsupportedOperationException();
   }

   public Principal getLocalPrincipal() {
      throw new UnsupportedOperationException();
   }

   public Certificate[] getPeerCertificates() throws SSLPeerUnverifiedException {
      return this.this$1.field52;
   }

   public X509Certificate[] getPeerCertificateChain() throws SSLPeerUnverifiedException {
      return null;
   }

   public int getPeerPort() {
      return 0;
   }

   public SSLSessionContext getSessionContext() {
      throw new UnsupportedOperationException();
   }

   public int getApplicationBufferSize() {
      return 0;
   }

   public Principal getPeerPrincipal() throws SSLPeerUnverifiedException {
      return null;
   }

   @ObfuscatedName("ao")
   @ObfuscatedSignature(
      descriptor = "(BI)C",
      garbageValue = "-1889470685"
   )
   public static char method262_base(byte var0) {
      int var1 = var0 & 255;
      if(var1 == 0) {
         throw new IllegalArgumentException("" + Integer.toString(var1, 16));
      } else {
         if(var1 >= 128 && var1 < 160) {
            char var2 = class396.cp1252AsciiExtension[var1 - 128];
            if(var2 == 0) {
               var2 = '?';
            }

            var1 = var2;
         }

         return (char)var1;
      }
   }

   @ObfuscatedName("bs")
   @ObfuscatedSignature(
      descriptor = "(ILdt;ZB)I",
      garbageValue = "-81"
   )
   static int method248(int var0, Script var1, boolean var2) {
      if(var0 == 6809) {
         int var3 = Interpreter.Interpreter_intStack[--DbTableType.Interpreter_intStackSize];
         ObjectComposition var4 = WorldMapSection2.method4515(var3);
         Interpreter.Interpreter_stringStack[++class127.Interpreter_stringStackSize - 1] = var4 != null?var4.name:"";
         return 1;
      } else {
         return 2;
      }
   }

   @ObfuscatedName("ho")
   @ObfuscatedSignature(
      descriptor = "(I)V",
      garbageValue = "-1059264411"
   )
   static void method263_base() {
      Client.packetWriter.clearBuffer_base();
      Client.packetWriter.packetBuffer.offset = 0;
      Client.packetWriter.serverPacket = null;
      Client.packetWriter.field1414 = null;
      Client.packetWriter.field1409 = null;
      Client.packetWriter.field1416 = null;
      Client.packetWriter.serverPacketLength = 0;
      Client.packetWriter.field1412 = 0;
      Client.rebootTimer = 0;
      class160.method3434_base();
      Client.minimapState = 0;
      Client.destinationX = 0;

      int var0;
      for(var0 = 0; var0 < 2048; ++var0) {
         Client.players[var0] = null;
         Client.cachedPlayersChanged(var0);
      }

      class229.localPlayer = null;

      for(var0 = 0; var0 < Client.npcs.length; ++var0) {
         NPC var1 = Client.npcs[var0];
         if(var1 != null) {
            var1.targetIndex = -1;
            var1.interactingChanged(-1);
            var1.false0 = false;
         }
      }

      class59.method1185_base();
      WorldMapSection2.updateGameState_base(30);

      for(var0 = 0; var0 < 100; ++var0) {
         Client.validRootWidgets[var0] = true;
      }

      if(Client.packetWriter != null && Client.packetWriter.isaacCipher != null) {
         PacketBufferNode var2 = class113.method2919(ClientPacket.WINDOW_STATUS, Client.packetWriter.isaacCipher);
         var2.packetBuffer.writeByte_base(ApproximateRouteStrategy.getWindowedMode_base());
         var2.packetBuffer.writeShort_base(Language.canvasWidth);
         var2.packetBuffer.writeShort_base(class47.canvasHeight);
         Client.packetWriter.method2867(var2);
      }

   }

   @ObfuscatedName("lo")
   @ObfuscatedSignature(
      descriptor = "(Lnn;IIIIIII)V",
      garbageValue = "-1558777613"
   )
   static final void method245(Widget var0, int var1, int var2, int var3, int var4, int var5, int var6) {
      if(Client.field569) {
         Client.alternativeScrollbarWidth = 32;
      } else {
         Client.alternativeScrollbarWidth = 0;
      }

      Client.field569 = false;
      int var7;
      if(MouseHandler.MouseHandler_currentButton == 1 || !class19.mouseCam && MouseHandler.MouseHandler_currentButton == 4) {
         if(var5 >= var1 && var5 < var1 + 16 && var6 >= var2 && var6 < var2 + 16) {
            var0.scrollY -= 4;
            class159.method3423(var0);
         } else if(var5 >= var1 && var5 < var1 + 16 && var6 >= var3 + var2 - 16 && var6 < var3 + var2) {
            var0.scrollY += 4;
            class159.method3423(var0);
         } else if(var5 >= var1 - Client.alternativeScrollbarWidth && var5 < Client.alternativeScrollbarWidth + var1 + 16 && var6 >= var2 + 16 && var6 < var3 + var2 - 16) {
            var7 = var3 * (var3 - 32) / var4;
            if(var7 < 8) {
               var7 = 8;
            }

            int var8 = var6 - var2 - 16 - var7 / 2;
            int var9 = var3 - 32 - var7;
            var0.scrollY = var8 * (var4 - var3) / var9;
            class159.method3423(var0);
            Client.field569 = true;
         }
      }

      if(Client.mouseWheelRotation != 0) {
         var7 = var0.width;
         if(var5 >= var1 - var7 && var6 >= var2 && var5 < var1 + 16 && var6 <= var3 + var2) {
            var0.scrollY += Client.mouseWheelRotation * 45;
            class159.method3423(var0);
         }
      }

   }
}
