<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="csrf_token" content="{{ csrf_token() }}" />

        <title>{{ config('app.name', 'Laravel') }}</title>

        <!-- Fonts -->
        <link rel="stylesheet" href="{{asset("/css/select2.css")}}">
        <link rel="stylesheet" href="{{asset("/css/sweetalert2.css")}}">
        <link rel="stylesheet" href="{{asset("/css/datatables.min.css")}}">
        <link rel="stylesheet" href="{{asset("/css/light.css")}}" />
        <link rel="stylesheet" href="{{asset("/css/app.css")}}" />

        <!-- Scripts -->
        {{-- @vite(['resources/css/app.css', 'resources/js/app.js']) --}}
    </head>
    <body data-theme="default" data-layout="fluid" data-sidebar-position="left" data-sidebar-layout="default">
        <div class="wrapper">
            <nav id="sidebar" class="sidebar js-sidebar">
                <div class="sidebar-content js-simplebar">
                    <a class='sidebar-brand' href='index.html'>
                        <span class="sidebar-brand-text align-middle">
                            {{ config('app.name', 'Laravel') }}
                            {{-- <sup><small class="badge bg-primary text-uppercase">Pro</small></sup> --}}
                        </span>
                        <svg class="sidebar-brand-icon align-middle" width="32px" height="32px" viewBox="0 0 24 24" fill="none"
                            stroke="#FFFFFF" stroke-width="1.5" stroke-linecap="square" stroke-linejoin="miter" color="#FFFFFF"
                            style="margin-left: -3px">
                            <path d="M12 4L20 8.00004L12 12L4 8.00004L12 4Z"></path>
                            <path d="M20 12L12 16L4 12"></path>
                            <path d="M20 16L12 20L4 16"></path>
                        </svg>
                    </a>

                    <div class="sidebar-user">
                        <div class="d-flex justify-content-center">
                            <div class="flex-shrink-0">
                                <img width="32" height="32" src="{{asset("/img/app.png")}}" class="avatar img-fluid rounded me-1" alt="{{ Auth::user()->name }}" />
                            </div>
                            <div class="flex-grow-1 ps-2">
                                <a class="sidebar-user-title " href="#" data-bs-toggle="dropdown">
                                    {{ Auth::user()->name }}
                                </a>
                                {{-- <div class="dropdown-menu dropdown-menu-start">
                                    <a class='dropdown-item' href='pages-profile.html'><i class="align-middle me-1"
                                            data-feather="user"></i> Profile</a>
                                    <a class="dropdown-item" href="#"><i class="align-middle me-1" data-feather="pie-chart"></i>
                                        Analytics</a>
                                    <div class="dropdown-divider"></div>
                                    <a class='dropdown-item' href='pages-settings.html'><i class="align-middle me-1"
                                            data-feather="settings"></i> Settings &
                                        Privacy</a>
                                    <a class="dropdown-item" href="#"><i class="align-middle me-1" data-feather="help-circle"></i>
                                        Help Center</a>
                                    <div class="dropdown-divider"></div>
                                    <a class="dropdown-item" href="#">Log out</a>
                                </div> --}}

                                <div class="sidebar-user-subtitle">{{Auth::user()->email}}</div>
                            </div>
                        </div>
                    </div>

                    @if (Auth::user()->id_rol == 1)
                        <ul class="sidebar-nav">
                            <li class="sidebar-header">
                                Módulos
                            </li>
                            <li class="sidebar-item">
                                <a data-bs-target="#users" data-bs-toggle="collapse" class="sidebar-link collapsed">
                                    <i class="align-middle" data-feather="user"></i> <span class="align-middle">Usuarios</span>
                                </a>
                                <ul id="users" class="sidebar-dropdown list-unstyled collapse " data-bs-parent="#sidebar">
                                    <li class="sidebar-item">
                                        <a class='sidebar-link' href="{{ route('profile.edit') }}">
                                            Perfil
                                        </a>
                                    </li>
                                    <li class="sidebar-item">
                                        <a class='sidebar-link' href="{{ route('usuarios.index') }}">
                                            Usuarios
                                        </a>
                                    </li>
                                </ul>
                            </li>
                            <li class="sidebar-item">
                                <a class='sidebar-link' href="{{ route('clientes.index') }}">
                                    <i class="align-middle" data-feather="users"></i> <span class="align-middle">Clientes</span>
                                </a>
                            </li>
                            <li class="sidebar-item">
                                <a class='sidebar-link' href="{{ route('vendedores.index') }}">
                                    <i class="align-middle" data-feather="dollar-sign"></i> <span class="align-middle">Vendedores</span>
                                </a>
                            </li>
                            <li class="sidebar-item">
                                <a data-bs-target="#dashboards" data-bs-toggle="collapse" class="sidebar-link collapsed">
                                    <i class="align-middle" data-feather="shopping-cart"></i> <span class="align-middle">Ordene Compra</span>
                                </a>
                                <ul id="dashboards" class="sidebar-dropdown list-unstyled collapse " data-bs-parent="#sidebar">
                                    <li class="sidebar-item"><a class='sidebar-link' href='{{ route('proformas.index') }}'>Nueva Orden</a></li>
                                    <li class="sidebar-item"><a class='sidebar-link' href='{{ route('proformas.listas') }}'>
                                            Lista de Ordenes</a></li>
                                </ul>
                            </li>
                        </ul>
                    @else
                        <ul class="sidebar-nav">
                                <li class="sidebar-header">
                                    Módulos
                                </li>
                                <li class="sidebar-item">
                                            <a class='sidebar-link' href="{{ route('profile.edit') }}">
                                            <i class="align-middle" data-feather="user"></i> <span>Perfil</span>
                                            </a>
                                        </li>
                                <li class="sidebar-item">
                                    <a data-bs-target="#dashboards" data-bs-toggle="collapse" class="sidebar-link collapsed">
                                        <i class="align-middle" data-feather="shopping-cart"></i> <span class="align-middle">Ordene Compra</span>
                                    </a>
                                    <ul id="dashboards" class="sidebar-dropdown list-unstyled collapse " data-bs-parent="#sidebar">
                                        <li class="sidebar-item"><a class='sidebar-link' href='{{ route('proformas.index') }}'>Nueva Orden</a></li>
                                        <li class="sidebar-item"><a class='sidebar-link' href='{{ route('proformas.listas') }}'>
                                                Lista de Ordenes</a></li>
                                    </ul>
                                </li>
                            </ul>
                    @endif
                </div>
            </nav>

            <div class="main">
            @include('layouts.navigation')

            {{-- <!-- Page Heading -->
            @isset($header)
                <header class="bg-white shadow">
                    <div class="max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8">
                        {{ $header }}
                    </div>
                </header>
            @endisset --}}

            <!-- Page Content -->
            <main class="content">
                <div class="container-fluid p-">
                    {{ $slot }}
                </div>
            </main>
        <footer class="footer">
            <div class="container-fluid">
                <div class="row text-muted">
                    <div class="col-6 text-start">
                        <p class="mb-0">
                            <a href="javascript:void(0);" target="_blank" class="text-muted"><strong>{{ config('app.name', 'Laravel') }}</strong></a>
                            &copy;
                        </p>
                    </div>
                    {{-- <div class="col-6 text-end">
                        <ul class="list-inline">
                            <li class="list-inline-item">
                                <a class="text-muted" href="#">Support</a>
                            </li>
                            <li class="list-inline-item">
                                <a class="text-muted" href="#">Help Center</a>
                            </li>
                            <li class="list-inline-item">
                                <a class="text-muted" href="#">Privacy</a>
                            </li>
                            <li class="list-inline-item">
                                <a class="text-muted" href="#">Terms</a>
                            </li>
                        </ul>
                    </div> --}}
                </div>
            </div>
        </footer>
        </div>
        </div>

        <script>
            const language_datatable = {
                    "decimal": "",
                    "emptyTable": "No hay información",
                    "info": "Mostrando _START_ a _END_ de _TOTAL_ Entradas",
                    "infoEmpty": "Mostrando 0 a 0 de 0 Entradas",
                    "infoFiltered": "(Filtrado de _MAX_ total entradas)",
                    "infoPostFix": "",
                    "thousands": ",",
                    "lengthMenu": "Mostrar _MENU_ Entradas",
                    "loadingRecords": "Cargando...",
                    "processing": "Procesando...",
                    "search": "Buscar:",
                    "zeroRecords": "Sin resultados encontrados",
                    "paginate": {
                        "first": "Primero",
                        "last": "Ultimo",
                        "next": "Siguiente",
                        "previous": "Anterior"
                    }
                };

            const header = { 'X-CSRF-TOKEN': "{{csrf_token()}}" };
        </script>
        <script src="{{asset("/js/app.js")}}"></script>
        <script src="{{asset("/js/settings.js")}}"></script>
        <script src="{{asset("/js/jquery.js")}}"></script>
        <script src="{{asset("/js/app_config.js")}}"></script>
        <script src="{{asset("/js/select2.js")}}"></script>
        <script src="{{asset("/js/sweetalert2.js")}}"></script>
        <script src="{{asset("/js/datatables.min.js")}}"></script>
    </body>
</html>
