@if (hasPermission('tardy_menu') && isModuleActive('Tardy'))
    <li class="sidebar-menu-item {{ set_active(['admin/special-attendance/*']) }}">
        <a href="javascript:void(0)"
            class="parent-item-content has-arrow {{ menu_active_by_route(['tardy-rules.*', 'tardy-records.*', 'tardy-request.*']) }}">
            <i class="las la-user-clock"></i>
            <span>
                {{ _trans('common.Time Compliance') }}
            </span>
            @if (config('app.style') == 'demo')
                <span class="badge text-bg-warning">{{ _trans('common.Pro') }}</span>
            @endif
        </a>
        <ul
            class="child-menu-list {{ set_active(['admin/special-attendance*', 'admin/special-attendance/create', 'admin/special-attendance/edit', 'admin/special-attendance/types', 'admin/special-attendance/types/*', 'admin/special-attendance/tardy-records/*', 'admin/special-attendance/tardy-request*']) }}">
            @if (hasPermission('tardy_rule_read'))
                <li class="nav-item {{ menu_active_by_route('tardy-groups.*') }}">
                    <a href="{{ route('tardy-groups.index') }}"
                        class="{{ set_active('admin/special-attendance/tardy-groups*') }}">
                        <span>{{ _trans('common.Groups') }}</span>
                    </a>
                </li>
            @endif
            @if (hasPermission('tardy_rule_read'))
                <li class="nav-item {{ menu_active_by_route('tardy-rules.*') }}">
                    <a href="{{ route('tardy-rules.index') }}"
                        class="{{ set_active('admin/special-attendance/tardy-rules*') }}">
                        <span>{{ _trans('common.Rules') }}</span>
                    </a>
                </li>
            @endif
            @if (hasPermission('tardy_rule_assign_read'))
                <li class="nav-item {{ menu_active_by_route('tardy-rule-assigns.*') }}">
                    <a href="{{ route('tardy-rule-assigns.index') }}"
                        class="{{ set_active('admin/special-attendance/tardy-rule-assigns*') }}">
                        <span>{{ _trans('common.Assign') }}</span>
                    </a>
                </li>
            @endif
            @if (hasPermission('tardy_record_read'))
                <li class="nav-item {{ menu_active_by_route(['tardy-records.*']) }}">
                    <a href="{{ route('tardy-records.index') }}"
                        class="{{ set_active('admin/special-attendance/tardy-records*') }}">
                        <span>{{ _trans('common.Records') }}</span>
                    </a>
                </li>
            @endif
            @if (hasPermission('tardy_request_read'))
                <li class="nav-item {{ menu_active_by_route(['tardy-request.*']) }}">
                    <a href="{{ route('tardy-request.index') }}"
                        class="{{ set_active('admin/special-attendance/tardy-request*') }}">
                        <span>{{ _trans('common.Appeals') }}</span>
                    </a>
                </li>
            @endif
        </ul>
    </li>
@endif


@if (hasPermission('attendance_setting_menu') ||
        hasPermission('attendance_read') ||
        hasPermission('break_menu') ||
        hasPermission('generate_qr_code'))
    <li class="sidebar-menu-item">
        <a href="javascript:void(0)"
            class="parent-item-content has-arrow {{ menu_active_by_route(['weekendSetup.*', 'holidaySetup.*', 'dutySchedule.*', 'duty.calendar.*', 'ipConfig.index', 'company.settings.location', 'company.settings.locationCreate', 'leave-reports.employee-wise-attendance-report', 'leave-reports.attendance-report', 'break.*', 'meals.index', 'attendance.index', 'attendance.absents', 'leave-reports.employee-wise-meal-report', 'leave-reports.employee-wise-break-report', 'meals.search', 'hrm.qr.index']) }}">
            <i class="las la-calendar-check"></i>
            <span class="on-half-expanded">
                {{ _trans('attendance.Attendance') }}
            </span>
        </a>
        <ul
            class="child-menu-list {{ set_active(['hrm/ip-whitelist', 'hrm/weekend*', 'hrm/holiday*', 'hrm/duty*', 'admin/duty*', 'hrm/attendance*', 'hrm/location*', 'admin/breaks*', 'hrm/leave/reports/employee-wise-attendance-report', 'hrm/leave/reports/attendance-report', 'hrm/leave/reports/employee-wise-meal-report', 'hrm/leave/reports/employee-wise-break-report', 'admin/breaks/meals/search', 'hrm/qr-code']) }}">
            @if (hasPermission('attendance_read'))
                <li class="nav-item {{ menu_active_by_route(['attendance.index', 'attendance.absents']) }}">
                    <a href="{{ route('attendance.index') }}" class=" {{ set_active(route('attendance.index')) }}">
                        <span>{{ _trans('attendance.Attendance') }}</span>
                    </a>
                </li>
            @endif
            @if (hasPermission('attendance_read') && env('FACE_SCAN'))
                <li class="nav-item {{ menu_active_by_route('attendance.face') }}">
                    <a href="{{ route('attendance.face') }}" target="_blank"
                        class=" {{ set_active(route('attendance.face')) }}">
                        <span>{{ _trans('attendance.Face Attendance') }}</span>
                    </a>
                </li>
            @endif
            @if (isModuleActive('QrBasedAttendance') && hasPermission('generate_qr_code') && settings('attendance_method') == 'QR')
                @include('qrbasedattendance::partials.sidebar.menu')
            @endif

            @if (hasPermission('break_menu') && isModuleActive('Break') && hasFeature('break'))
                @include('break::sidebar.break_sidebar')
            @endif

            @if (hasPermission('attendance_setting_menu'))
                <li
                    class="sidebar-menu-item {{ set_active(['admin/special-attendance/duty-calendar/*', 'hrm/weekend/*', 'hrm/holiday/*', 'hrm/duty/*', 'admin/duty*', 'hrm/ip-whitelist', 'hrm/location']) }}">
                    <a href="javascript:void(0)"
                        class="parent-item-content has-arrow {{ menu_active_by_route(['duty.calendar.*', 'dutySchedule.*', 'weekendSetup.*', 'holidaySetup.*', 'duty.calendar.*', 'ipConfig.index', 'company.settings.location', 'company.settings.locationCreate']) }}">
                        <span>
                            {{ _trans('common.Settings') }}
                        </span>
                    </a>
                    <ul
                        class="child-menu-list {{ set_active(['hrm/weekend/*', 'hrm/holiday/*', 'hrm/duty*', 'admin/duty*', 'hrm/ip-whitelist', 'hrm/location', 'hrm/location/create']) }}">
                        @if (hasPermission('weekend_read'))
                            <li class="nav-item {{ menu_active_by_route(['weekendSetup.index']) }}">
                                <a href="{{ route('weekendSetup.index') }}"
                                    class="{{ set_active([route('weekendSetup.index')]) }}">
                                    <span>{{ _trans('attendance.Weekend Setup') }}</span>
                                </a>
                            </li>
                        @endif

                        @if (hasPermission('holiday_read'))
                            <li
                                class="nav-item {{ menu_active_by_route(['holidaySetup.index', 'holidaySetup.create', 'holidaySetup.show']) }}">
                                <a href="{{ route('holidaySetup.index') }}"
                                    class="{{ menu_active_by_route(['holidaySetup.index', 'holidaySetup.create', 'holidaySetup.show']) }}">
                                    <span>{{ _trans('attendance.Holiday Setup') }}</span>
                                </a>
                            </li>
                        @endif

                        @if (hasPermission('schedule_read'))
                            <li
                                class="nav-item {{ menu_active_by_route(['dutySchedule.index', 'dutySchedule.create', 'dutySchedule.show']) }}">
                                <a href="{{ route('dutySchedule.index') }}">
                                    <span>{{ _trans('attendance.Duty Schedule') }}</span>
                                </a>
                            </li>
                        @endif

                        @if (hasPermission('duty_calendar_read'))
                            <li class="nav-item {{ menu_active_by_route('duty.calendar.*') }}">
                                <a href="{{ route('duty.calendar.index') }}"
                                    class=" {{ set_active('admin/special-attendance/duty-calendar') }}">
                                    <span>{{ _trans('common.Duty Calendar') }}</span>
                                </a>
                            </li>
                        @endif

                        @if (isModuleActive('IpBasedAttendance') && hasPermission('ip_read'))
                            @include('ipbasedattendance::partials.sidebar.menu')
                        @endif

                        @if (isModuleActive('AreaBasedAttendance') && hasPermission('location_read'))
                            @include('areabasedattendance::partials.sidebar.menu')
                        @endif
                    </ul>
                </li>
            @endif
        </ul>
    </li>
@endif
