<nav>
    <a href="/dashboard" class="title">
        <img src="/assets/img/logo.png">
        <h1>Argus Dashboard</h1>
    </a>
    <div class="username-box">
        <% if (user) {%>
            <a class="username" href="#" onclick="toggleSidenav()">
                <div style="display: flex; flex-direction: column;">
                    <span><%= user.global_name %><% if (user.discriminator && user.discriminator !== "0") {%> #<%= user.discriminator %> <%}%></span>
                    <div class="nav-money">
                        <img title="Argus Points" src="/assets/img/token.png">
                        <span><%= userDoc.points.toLocaleString('en-US').replaceAll(',', ' ') %></span>
                    </div>
                </div>
                <%- user.avatar ? `<img src="https://cdn.discordapp.com/avatars/${user.id}/${user.avatar}.png">` : `<img src="/img/nopp_icon.svg">` %>
            </a>
        <%} else {%>
            <a href="/login">Login</a>
        <%}%>
    </div>
</nav>
<%if (user) {%>
    <div class="usermenu" id="sidenav">
        <div class="top">
            <a class="username" href="#" onclick="toggleSidenav()">
                <div style="display: flex; flex-direction: column;">
                    <span><%= user.global_name %><% if (user.discriminator && user.discriminator !== "0") {%> #<%= user.discriminator %> <%}%></span>
                    <div class="nav-money">
                        <img title="Argus Points" src="/assets/img/token.png">
                        <span><%= userDoc.points.toLocaleString('en-US').replaceAll(',', ' ') %></span>
                    </div>
                </div>
                <%- user.avatar ? `<img src="https://cdn.discordapp.com/avatars/${user.id}/${user.avatar}.png">` : `<img src="/img/nopp_icon.svg">` %>
            </a>
            <a href="/dashboard" class="menuItem">
                <div class="listItem">
                    <span>Home</span>
                    <svg height="200px" width="200px" version="1.1" id="_x32_" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 512 512" xml:space="preserve" fill="#fefefe" stroke="#fefefe"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <style type="text/css"> .st0{fill:#fefefe;} </style> <g> <polygon class="st0" points="434.162,293.382 434.162,493.862 308.321,493.862 308.321,368.583 203.682,368.583 203.682,493.862 77.841,493.862 77.841,293.382 256.002,153.862 "></polygon> <polygon class="st0" points="0,242.682 256,38.93 512,242.682 482.21,285.764 256,105.722 29.79,285.764 "></polygon> <polygon class="st0" points="439.853,18.138 439.853,148.538 376.573,98.138 376.573,18.138 "></polygon> </g> </g></svg>
                </div>
            </a>
            <a href="/profile" class="menuItem">
                <div class="listItem">
                    <span>My Profile</span>
                    <svg xmlns="http://www.w3.org/2000/svg" fill="#fefefe" viewBox="0 0 24 24" stroke="#fefefe"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"></path></g></svg>
                </div>
            </a>
            <a href="/managepremium" class="menuItem">
                <div class="listItem">
                    <span>Premium</span>
                    <svg fill="#fefefe" viewBox="0 -5.47 56.254 56.254" xmlns="http://www.w3.org/2000/svg" stroke="#fefefe"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path id="diamond_premium" data-name="diamond premium" d="M494.211,354.161l1.174-1.366H482.552L469.8,367.5h12.94Zm-8.4,13.336H510.05l-6.589-7.664-5.528-6.429-8.354,9.713Zm-15.856,2.329,24.1,25.356L482.53,369.826Zm40.824,0h-2.1l-8.829,0H485.083l12.774,28.1.082.178,12.17-26.8Zm-8.94,25.322,24.057-25.32H513.337Zm24.215-27.65L513.3,352.8H500.478l12.642,14.7Z" transform="translate(-469.802 -352.795)"></path> </g></svg>
                </div>
            </a>
            <a href="/redeem" class="menuItem">
                <div class="listItem">
                    <span>Redeem Codes</span>
                    <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" stroke="#fefefe"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path opacity="0.1" d="M4 12.5V16C4 17.8856 4 18.8284 4.58579 19.4142C5.17157 20 6.11438 20 8 20H9H15H16C17.8856 20 18.8284 20 19.4142 19.4142C20 18.8284 20 17.8856 20 16V12.5C20 12.2239 19.7761 12 19.5 12H4.5C4.22386 12 4 12.2239 4 12.5Z" fill="#fefefe"></path> <path d="M3 9.5C3 9.03534 3 8.80302 3.03843 8.60982C3.19624 7.81644 3.81644 7.19624 4.60982 7.03843C4.80302 7 5.03534 7 5.5 7H12H18.5C18.9647 7 19.197 7 19.3902 7.03843C20.1836 7.19624 20.8038 7.81644 20.9616 8.60982C21 8.80302 21 9.03534 21 9.5V9.5V9.5C21 9.96466 21 10.197 20.9616 10.3902C20.8038 11.1836 20.1836 11.8038 19.3902 11.9616C19.197 12 18.9647 12 18.5 12H12H5.5C5.03534 12 4.80302 12 4.60982 11.9616C3.81644 11.8038 3.19624 11.1836 3.03843 10.3902C3 10.197 3 9.96466 3 9.5V9.5V9.5Z" stroke="#fefefe" stroke-width="2" stroke-linejoin="round"></path> <path d="M4 12V16C4 17.8856 4 18.8284 4.58579 19.4142C5.17157 20 6.11438 20 8 20H9H15H16C17.8856 20 18.8284 20 19.4142 19.4142C20 18.8284 20 17.8856 20 16V12" stroke="#fefefe" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path> <path d="M12 7V20" stroke="#fefefe" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path> <path d="M11.3753 6.21913L9.3959 3.74487C8.65125 2.81406 7.26102 2.73898 6.41813 3.58187C5.1582 4.8418 6.04662 7 7.82843 7L11 7C11.403 7 11.6271 6.53383 11.3753 6.21913Z" stroke="#fefefe" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path> <path d="M12.6247 6.21913L14.6041 3.74487C15.3488 2.81406 16.739 2.73898 17.5819 3.58187C18.8418 4.8418 17.9534 7 16.1716 7L13 7C12.597 7 12.3729 6.53383 12.6247 6.21913Z" stroke="#fefefe" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path> </g></svg>
                </div>
            </a>
            <a href="/logout" class="menuItem">
                <div class="listItem">
                    <span>Logout</span>
                    <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" stroke="#fefefe"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path d="M15 4H18C19.1046 4 20 4.89543 20 6V18C20 19.1046 19.1046 20 18 20H15M8 8L4 12M4 12L8 16M4 12L16 12" stroke="#fefefe" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"></path> </g></svg>
                </div>
            </a>
        </div>
        <div class="bottom">
            <% if (userDoc.badges.includes("admin")) {%>
                <a href="/admin">Admin Dashboard</a>
            <% }; %>
        </div>
    </div>
<%}%>
<div class="shadow" id="sidenav-shadow" onclick="toggleSidenav()"></div>