using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Windows.Forms;
using System.Diagnostics;
using legionopener;
using sendweb;
using System.Net.Http;
using System.Net;

namespace L3gion_STELAR
{
    public partial class Form1 : Form
    {

        [DllImport("Gdi32.dll", EntryPoint = "CreateRoundRectRgn")]

        private static extern IntPtr CreateRoundRectRgn
   (
   int nLeftRect,     // x-coordinate of upper-left corner
   int nTopRect,      // y-coordinate of upper-left corner
   int nRightRect,    // x-coordinate of lower-right corner
   int nBottomRect,   // y-coordinate of lower-right corner
   int nWidthEllipse, // height of ellipse
   int nHeightEllipse // width of ellipse
   );


        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

            siticoneAnimateWindow1.SetAnimateWindow(this);
            siticoneShadowForm1.SetShadowForm(this);
            siticoneTextBox1.ShortcutsEnabled = false;
            siticoneTextBox2.ShortcutsEnabled = false;

            siticonePictureBox1.Hide();
            siticonePictureBox1.Show();
           
            this.FormBorderStyle = FormBorderStyle.None;
            Region = System.Drawing.Region.FromHrgn(CreateRoundRectRgn(0, 0, Width, Height, 20, 20));
            KeyAuthApp.init();


        }

        private void siticoneControlBox1_Click(object sender, EventArgs e)
        {

        }

        private void siticoneTextBox1_TextChanged(object sender, EventArgs e)
        {
            siticonePictureBox1.Show();
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            label1.Text = "Enter Valid Username/Password.*";
            label1.ForeColor = Color.FromArgb(228, 114, 0);
            siticoneTextBox1.BorderColor = Color.FromArgb(228, 114, 0);
            siticoneTextBox2.BorderColor = Color.FromArgb(228, 114, 0);

        }

        private void siticonePictureBox1_Click(object sender, EventArgs e)
        {

        }

        private void siticoneTextBox2_TextChanged(object sender, EventArgs e)
        {
            siticoneTextBox1.ShortcutsEnabled = false;

         
            siticonePictureBox1.Show();
        }
        public static api KeyAuthApp = new api(
          name: "hacker", // Application Name
          ownerid: "IuAGrf01ls", // Owner ID
          secret: "488fe5d05425b51478950aacdd04b8759da6a083256c98b3de272a84bc3b15a1", // Application Secret
          version: "1.0" // Application Version /*
                         //path: @"Your_Path_Here" // (OPTIONAL) see tutofrial here https://www.youtube.com/watch?v=I9rxt821gMk&t=1s
       );
        private async void siticoneButton1_Click(object sender, EventArgs e)
        {

            KeyAuthApp.login(siticoneTextBox1.Text, siticoneTextBox2.Text);
            if (KeyAuthApp.response.success)
            {
                Main main = new Main();
                main.Show();
                this.Hide();
            }
            else
            {
                label1.ForeColor = Color.FromArgb(198, 40, 40);
                label1.Text = "Couldn't Authenticate.";
                siticoneTextBox1.BorderColor = Color.FromArgb(198, 40, 40);
                timer1.Start();
            }

        


           

        }

        private async void siticoneButton2_Click(object sender, EventArgs e)
        {
         

            MessageBox.Show("Please Contact legion7667 on discord", "", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);

        }

        private void siticoneRoundedButton1_Click(object sender, EventArgs e)
        {
            Process.Start("https://www.youtube.com/channel/UCH33Ws09U_PoK7-Z741i9GQ");
            Process.Start("https://www.youtube.com/@daulah_0995");

            siticoneRoundedButton1.Hide();
        }

        private void siticoneTextBox2_KeyPress(object sender, KeyPressEventArgs e)
        {
          
        }

        private void siticoneTextBox2_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Control == true)
            {
                label1.Text = "Pasting/Copying is not allowed.";
            }
        }

        private void siticoneTextBox1_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Control == true)
            {
                label1.Text = "Pasting/Copying is not allowed.";
            }
        }

        private void timer2_Tick(object sender, EventArgs e)
        {
            this.Hide();
        }
    }
}
