<html><head><base href="/"><title>WaffleAuth Documentation</title>
    <style>
        body {
            font-family: 'Segoe UI', Arial, sans-serif;
            line-height: 1.6;
            max-width: 1000px;
            margin: 0 auto;
            padding: 20px;
            color: #333;
            background: #f5f5f5;
            font-size: 16px;
        }

        .container {
            background: white;
            padding: 10px 15px;
            border-radius: 8px;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }

        h1,
        h2,
        h3 {
            color: #2c3e50;
            margin-top: 2em;
            margin-bottom: 1em;
        }

        .code-block {
            margin: 0px;
            padding: 0px;
            background: #f6f8fa;
            color: #24292e;
            padding: 10px;
            border-radius: 5px;
            border-left: 4px solid #3498db;
            font-family: 'Consolas', monospace;
            overflow-x: auto;
            white-space: pre;
            line-height: 1.4;
        }

        /* Syntax highlighting */
        .keyword {
            color: #d73a49;
        }

        .string {
            color: #032f62;
        }

        .comment {
            color: #6a737d;
        }

        .type {
            color: #6f42c1;
        }

        .function {
            color: #005cc5;
        }

        .number {
            color: #005cc5;
        }

        .boolean {
            color: #d73a49;
        }

        .method {
            margin: 0;
            padding: 15px;
            background: #fff;
            border-radius: 8px;
            border: 1px solid #e1e4e8;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
        }

        .method p {
            margin: 0;
            padding: 0;
        }

        .parameter {
            margin: 0;
            padding: 10px;
            text-align: left;
        }

        .method ul {
            margin: 0;
            padding-left: 10px;
            text-align: left;
        }

        .code-block span {
            display: inline;
        }

        .step ul,
        .note ul {
            margin: 0;
            padding-left: 10px;
            text-align: left;
        }

        .note {
            margin: 0;
            padding: 15px;
            background: #fff3cd;
            border-left: 4px solid #ffc107;
            text-align: left;
        }

        .step {
            margin: 0;
            padding: 15px;
            background: #e7f5ff;
            border-left: 4px solid #339af0;
            text-align: left;
        }

        table {
            width: 100%;
            border-collapse: collapse;
            margin: 25px 0;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
        }

        th,
        td {
            padding: 15px;
            text-align: left;
            border: 1px solid #e1e4e8;
            vertical-align: top;
        }

        th {
            background: #f8f9fa;
            font-weight: 600;
        }

        td {
            background: white;
        }

        code {
            font-family: 'Consolas', monospace;
            background: #f6f8fa;
            padding: 2px 5px;
            border-radius: 3px;
        }

        .download-btn {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 16px;
            background: #ffffff;
            color: #2c3e50;
            text-decoration: none;
            border-radius: 8px;
            margin: 20px 0;
            font-weight: 500;
            transition: background 0.2s ease;
            max-width: 320px;
            border: 1px solid #e1e4e8;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        }

        .download-btn:hover {
            background: #f8f9fa;
        }

        .download-icon {
            width: 24px;
            height: 24px;
            background: #5865f2;
            border-radius: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .download-icon svg {
            width: 16px;
            height: 16px;
            fill: white;
        }

        .download-text {
            display: flex;
            flex-direction: column;
        }

        .download-filename {
            font-size: 16px;
            margin-bottom: 4px;
            color: #2c3e50;
        }

        .download-size {
            font-size: 12px;
            color: #6c757d;
        }

        /* Dark mode styles */
        body.dark-mode {
            background: #1a1a1a;
            color: #e1e1e1;
        }

        body.dark-mode .container {
            background: #2d2d2d;
        }

        body.dark-mode h1,
        body.dark-mode h2,
        body.dark-mode h3 {
            color: #ffffff;
        }

        body.dark-mode .code-block {
            margin: 0px;
            padding: 0px;
            background: #363636;
            color: #e1e1e1;
            border-left-color: #0066cc;
        }

        /* Dark mode syntax highlighting */
        body.dark-mode .keyword {
            color: #ff7b72;
        }

        body.dark-mode .string {
            color: #a5d6ff;
        }

        body.dark-mode .comment {
            color: #8b949e;
        }

        body.dark-mode .type {
            color: #d2a8ff;
        }

        body.dark-mode .function {
            color: #79c0ff;
        }

        body.dark-mode .number {
            color: #79c0ff;
        }

        body.dark-mode .boolean {
            color: #ff7b72;
        }

        body.dark-mode .method {
            background: #2d2d2d;
            border-color: #404040;
        }

        body.dark-mode .note {
            background: #2d2d2d;
            border-left-color: #ffc107;
            color: #e1e1e1;
        }

        body.dark-mode .step {
            background: #2d2d2d;
            border-left-color: #339af0;
            color: #e1e1e1;
        }

        body.dark-mode table th {
            background: #363636;
            color: #ffffff;
            border-color: #404040;
        }

        body.dark-mode table td {
            background: #2d2d2d;
            border-color: #404040;
            color: #e1e1e1;
        }

        body.dark-mode code {
            background: #363636;
            color: #e1e1e1;
        }

        body.dark-mode .download-btn {
            background: #2d2d2d;
            border-color: #404040;
            color: #e1e1e1;
        }

        body.dark-mode .download-btn:hover {
            background: #363636;
        }

        body.dark-mode .download-filename {
            color: #e1e1e1;
        }

        body.dark-mode .download-size {
            color: #999;
        }

        body.dark-mode .theme-toggle {
            background: #2d2d2d;
            border-color: #404040;
        }

        body.dark-mode .theme-toggle svg {
            fill: #ffffff;
        }

        body.dark-mode a {
            color: #58a6ff;
        }

        body.dark-mode ::-webkit-scrollbar {
            background-color: #1a1a1a;
        }

        body.dark-mode ::-webkit-scrollbar-thumb {
            background-color: #404040;
        }

        body.dark-mode ::-webkit-scrollbar-track {
            background-color: #2d2d2d;
        }

        body.dark-mode ul,
        body.dark-mode ol {
            color: #e1e1e1;
        }

        body.dark-mode strong {
            color: #ffffff;
        }

        /* Theme toggle button */
        .theme-toggle {
            position: fixed;
            top: 20px;
            right: 20px;
            padding: 10px;
            border-radius: 50%;
            width: 40px;
            height: 40px;
            background: #ffffff;
            border: 2px solid #e1e4e8;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
        }

        .method .code-block {
            white-space: pre-wrap;
        }
    </style>
</head>

<body>
    <div class="container">
        <h1>WaffleAuth Documentation</h1>

        <div class="note">
            <h3>Prerequisites</h3>
            <p>To use WaffleAuth effectively, you need to install the following packages via NuGet:</p>
            <ul>
                <li><strong>Discord Rich Presence:</strong> Adds functionality for displaying status information through Discord.</li>
                <li><strong>Newtonsoft.Json:</strong> Required for JSON parsing and serialization tasks.</li>
            </ul>
        </div>

        <h2>Getting Started</h2>
        <p>WaffleAuth is a license authentication system that provides functionality for generating and validating license keys.</p>

        <a href="https://auth.waffledev.com/WaffleAuth.dll" class="download-btn" download>
            <div class="download-text">
                <span class="download-filename">WaffleAuth.dll</span>
                <span class="download-size">Library File</span>
            </div>
            <div class="download-icon">
                <svg viewBox="0 0 24 24">
                    <path d="M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z" />
                </svg>
            </div>
        </a>

        <a href="https://auth.waffledev.com/WaffleHWID.exe" class="download-btn" download>
            <div class="download-text">
                <span class="download-filename">WaffleHWID.exe</span>
                <span class="download-size">HWID Generator</span>
            </div>
            <div class="download-icon">
                <svg viewBox="0 0 24 24">
                    <path d="M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z" />
                </svg>
            </div>
        </a>

        <div class="note">
            <strong>Important:</strong> Before using WaffleAuth, you need to configure your own Firebase/Firestore credentials and endpoints.
        </div>

        <h2>Initial Setup</h2>
        <p>Initialize WaffleAuth with the following configuration methods:</p>

        <div class="method">
            <h3>Required Configuration Methods</h3>
            <div class="code-block">
                <span class="type">WaffleAuthFuncs</span>.<span class="function">SetURL</span>(<span class="string">"YOUR_FIRESTORE_URL"</span>);
                <span class="type">WaffleAuthFuncs</span>.<span class="function">SetAPIKey</span>(<span class="string">"YOUR_API_KEY"</span>);
                <span class="type">WaffleAuthFuncs</span>.<span class="function">SetEndPoint</span>(<span class="string">"YOUR_ENDPOINT_URL"</span>);
                <span class="type">WaffleAuthFuncs</span>.<span class="function">SetInitials</span>(<span class="string">"LA"</span>);
                <span class="type">WaffleAuthFuncs</span>.<span class="function">MessageBoxes</span>(<span class="boolean">true</span>);
            </div>
        </div>

        <table>
            <tr>
                <th>Method</th>
                <th>Description</th>
                <th>Parameter Type</th>
            </tr>
            <tr>
                <td><code>SetURL()</code></td>
                <td>Sets the Firestore database URL</td>
                <td>string</td>
            </tr>
            <tr>
                <td><code>SetAPIKey()</code></td>
                <td>Sets the API key for authentication</td>
                <td>string</td>
            </tr>
            <tr>
                <td><code>SetEndPoint()</code></td>
                <td>Sets the endpoint URL for queries</td>
                <td>string</td>
            </tr>
            <tr>
                <td><code>SetInitials()</code></td>
                <td>Sets the initials for key generation</td>
                <td>string</td>
            </tr>
            <tr>
                <td><code>MessageBoxes()</code></td>
                <td>Enables/disables message boxes</td>
                <td>bool</td>
            </tr>
            <tr>
                <td><code>Initialize()</code></td>
                <td>Loads saved keys and validates them</td>
                <td>bool</td>
            </tr>
        </table>

        <div class="method">
            <h3>Initialize and Load Saved Keys</h3>
            <p>After setting up the configuration, initialize WaffleAuth to load and validate any saved keys:</p>
            <div class="code-block">
                <span class="type">bool</span> isValid = <span class="keyword">await</span> <span class="type">WaffleAuthFuncs</span>.<span class="function">Initialize</span>();
                <span class="keyword">if</span> (isValid) {
                    <span class="comment">// What you want to happen when the key is valid</span>
                } <span class="keyword">else</span> {
                    <span class="keyword">return</span>;
                }
            </div>

            <div class="parameter">
                <p>Returns:</p>
                <ul>
                    <li><code>bool</code>: True if saved keys are valid, false otherwise</li>
                </ul>
            </div>
        </div>

        <div class="method">
            <h3>Generate and Validate License Keys</h3>
            <p>WaffleAuth now requires you to generate keys with specific parameters. This includes duration for standard keys and additional settings for earning keys.</p>
            <div class="code-block">
                <span class="type">string</span> generatedKey = <span class="keyword">await</span> <span class="type">WaffleAuthFuncs</span>.<span class="function">GenerateKeyAsync</span>(<span class="number">10</span>);
                <span class="type">string</span> adLinkKey = <span class="keyword">await</span> <span class="type">WaffleAuthFuncs</span>.<span class="function">GenerateEarningKeyAsync</span>(<span class="string">"https://youtube.com"</span>, <span class="number">1</span>, <span class="number">60</span>);
            </div>
            <div class="parameter">
                <ul>
                    <li>The first integer for <code>GenerateKeyAsync()</code> specifies the duration of the key in hours.</li>
                    <li>For <code>GenerateEarningKeyAsync()</code>, the first integer is the number of seconds you need to stay on the site, and the second integer is how many hours the key lasts.</li>
                </ul>
            </div>
        </div>

        <div class="method">
            <h3>Validate License Key</h3>
            <p>To check if a license key is valid:</p>
            <div class="code-block">
                <span class="type">bool</span> isKeyValid = <span class="keyword">await</span> <span class="type">WaffleAuthFuncs</span>.<span class="function">CheckKey</span>(keyString);
            </div>
        </div>

        <h2>Example Implementation</h2>
        <div class="code-block">
            <span class="keyword">using</span> WaffleAuth;

            <span class="keyword">public partial class</span> <span class="type">Form1</span>: <span class="type">Form</span> {
                <span class="keyword">public</span> <span class="function">Form1</span>() {
                    <span class="comment">// Initialize WaffleAuth with your credentials</span>
                    <span class="type">WaffleAuthFuncs</span>.<span class="function">SetURL</span>(<span class="string">"YOUR_FIRESTORE_URL"</span>);
                    <span class="type">WaffleAuthFuncs</span>.<span class="function">SetAPIKey</span>(<span class="string">"YOUR_API_KEY"</span>);
                    <span class="type">WaffleAuthFuncs</span>.<span class="function">SetEndPoint</span>(<span class="string">"YOUR_ENDPOINT_URL"</span>);
                    <span class="type">WaffleAuthFuncs</span>.<span class="function">SetInitials</span>(<span class="string">"LA"</span>);
                    <span class="type">WaffleAuthFuncs</span>.<span class="function">MessageBoxes</span>(<span class="boolean">true</span>);
                    <span class="type">bool</span> isValid = <span class="keyword">await</span> <span class="type">WaffleAuthFuncs</span>.<span class="function">Initialize</span>();

                    <span class="keyword">if</span>(!isValid) {
                        <span class="type">Application</span>.<span class="function">Exit</span>();
                    }
                    <span class="function">InitializeComponent</span>();
                }

                <span class="keyword">private async void</span> <span class="function">ValidateKey_Click</span>(<span class="type">object</span> sender, <span class="type">EventArgs</span> e) {
                    <span class="type">bool</span> isKeyValid = <span class="keyword">await</span> <span class="type">WaffleAuthFuncs</span>.<span class="function">CheckKey</span>(licenseKey);
                    <span class="keyword">if</span>(!isKeyValid) {
                        <span class="type">Application</span>.<span class="function">Exit</span>();
                    }
                }
            }
        </div>

        <div class="note">
            <h3>Security Note</h3>
            <p>Always keep your API keys and credentials secure and never expose them in client-side code or public repositories.</p>
        </div>
    </div>

    <button class="theme-toggle" aria-label="Toggle dark mode">
        <svg viewBox="0 0 24 24">
            <path d="M20 8.69V4h-4.69L12 0.69L8.69 4H4v4.69L0.69 12L4 15.31V20h4.69L12 23.31L15.31 20H20v-4.69L23.31 12L20 8.69zM12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6s6 2.69 6 6S15.31 18 12 18z" />
        </svg>
    </button>

    <script>
        const themeToggle = document.querySelector('.theme-toggle');
        const body = document.body;
        const savedTheme = localStorage.getItem('theme');
        if (savedTheme === 'dark') {
            body.classList.add('dark-mode');
        }
        themeToggle.addEventListener('click', () => {
            body.classList.toggle('dark-mode');
            localStorage.setItem('theme', body.classList.contains('dark-mode') ? 'dark' : 'light');
        });
    </script>
</body>

</html>