<?php $__env->startPush('css'); ?>
    <style>
        .fileholder {
            min-height: 194px !important;
        }
        .fileholder-files-view-wrp.accept-single-file .fileholder-single-file-view,.fileholder-files-view-wrp.fileholder-perview-single .fileholder-single-file-view{
            height: 150px !important;
        }
    </style>
<?php $__env->stopPush(); ?>

<?php $__env->startSection('page-title'); ?>
    <?php echo $__env->make('admin.components.page-title',['title' => __($page_title)], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('breadcrumb'); ?>
    <?php echo $__env->make('admin.components.breadcrumb',['breadcrumbs' => [
        [
            'name'  => __("Dashboard"),
            'url'   => setRoute("admin.dashboard"),
        ]
    ], 'active' => __("Admin Care")], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
<div class="table-area">
    <div class="table-responsive">
        <table class="custom-table role">
            <thead>
                <tr>
                    <th></th>
                    <th>
                        <table class="custom-table head-role">
                            <thead>
                                <tr>
                                    <th><?php echo e(__("Section Name")); ?></th>
                                    <th><?php echo e(__("Permission Area")); ?></th>
                                </tr>
                            </thead>
                        </table>
                    </th>
                </tr>
            </thead>
            <tbody>
                <?php $__currentLoopData = $permissions ?? []; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $permission_key => $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <?php
                        $filtered_sections = collect($item['sections'] ?? [])->filter(function ($section) use ($assign_permissions) {
                            return collect($section['routes'])->pluck('route')
                                ->intersect(collect($assign_permissions->hasPermissions)->pluck('route'))
                                ->isNotEmpty();
                        });
                    ?>
                    <?php if($filtered_sections->isNotEmpty()): ?>
                        <tr class="role-table-row">
                            <td><?php echo e($item['title'] ?? ''); ?></td>
                            <td class="custom-data">
                                <table class="custom-table role">
                                    <tbody>
                                        <?php $__currentLoopData = $filtered_sections; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $section_key => $sections): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <tr>
                                                <?php
                                                    $section_routes = collect($sections['routes'])->pluck('route')->all();
                                                    $has_all_permissions = collect($section_routes)->diff(
                                                        collect($assign_permissions->hasPermissions)->pluck('route')
                                                    )->isEmpty();
                                                ?>
                                                <td>
                                                    <div class="ps-2">
                                                        <label><?php echo e($sections['title']); ?></label>
                                                    </div>
                                                </td>
                                                <td>
                                                    <div class="custom-check-group-wrapper">
                                                        <?php $__currentLoopData = $sections['routes'] ?? []; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $route_key => $routes): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                            <?php
                                                                $isChecked = $assign_permissions->hasPermissions->contains('route', $routes['route']);
                                                            ?>
                                                            <?php if($isChecked): ?>
                                                                <div class="ps-2">
                                                                    <label class="badge badge--base"><?php echo e($routes['title']); ?></label>
                                                                </div>
                                                            <?php endif; ?>
                                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                    </div>
                                                </td>
                                            </tr>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </tbody>
                                </table>
                            </td>
                        </tr>
                    <?php endif; ?>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </tbody>
        </table>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('admin.layouts.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH D:\xampp\htdocs\cc_projects_files\salonhub_v1.2.0\salonhub\resources\views/admin/sections/admin-care/role/assign-permission.blade.php ENDPATH**/ ?>