
<div class="w-full" style="font-size:14px; display:flex; flex-direction:column; gap:14px;">

    
    <div class="flex flex-wrap items-center gap-1.5 text-[13px]">
        <a href="<?php echo e(route('products.show', $product)); ?>" wire:navigate
           class="inline-flex items-center gap-1.5 font-semibold" style="color:var(--text-link);">
            <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m15 18-6-6 6-6"/></svg>
            <?php echo e($product->name); ?>

        </a>
        <span style="color:var(--border-strong);">/</span>
        <a href="<?php echo e(route($ficha['rutaListado'], $product)); ?>" wire:navigate
           class="font-semibold" style="color:var(--text-link);"><?php echo e($ficha['nombre']); ?></a>
    </div>

    
    <?php if (isset($component)) { $__componentOriginal2544aeb3df80db4e8cf42f27632fe7f3 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal2544aeb3df80db4e8cf42f27632fe7f3 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.cabecera','data' => ['rotulo' => 'Versión de ' . $ficha['nombre'] . ' · ' . $product->name,'titulo' => $version->version]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('cabecera'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['rotulo' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute('Versión de ' . $ficha['nombre'] . ' · ' . $product->name),'titulo' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($version->version)]); ?>

         <?php $__env->slot('icono', null, []); ?> 
            <span style="font-family:'Plus Jakarta Sans',sans-serif; font-size:20px; font-weight:700;"><?php echo e($ficha['inicial']); ?></span>
         <?php $__env->endSlot(); ?>

         <?php $__env->slot('descripcion', null, []); ?> 
            <?php echo e($version->description ?: 'Sin descripción. Sirve para saber qué trae esta versión sin abrirla.'); ?>

         <?php $__env->endSlot(); ?>

         <?php $__env->slot('meta', null, []); ?> 
            
            <span>
                <strong class="font-semibold" style="color:var(--text-strong);"><?php echo e($archivos->count()); ?></strong>
                <?php echo e($archivos->count() === 1 ? $ficha['elemento'] : $ficha['elementos']); ?>

                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($carpetas > 1): ?>
                    en <?php echo e($carpetas); ?> carpetas
                <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
            </span>
            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($peso > 0): ?>
                <span style="color:var(--border-strong);">·</span>
                <span><?php echo e($peso >= 1024 ? number_format($peso / 1024, 1, ',', '.') . ' KB' : $peso . ' bytes'); ?></span>
            <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>

            
            <span style="color:var(--border-strong);">·</span>
            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($llega['conPlugin'] === 0): ?>
                <span class="tip" data-tip="Ningún entorno con licencia tiene el plugin instalado"
                      style="color:var(--text-subtle);">Ningún entorno la pide</span>
            <?php elseif($llega['laReciben'] > 0): ?>
                <span style="color:var(--success-500);">
                    La reciben <strong class="font-semibold"><?php echo e($llega['laReciben']); ?></strong>
                    <?php echo e($llega['laReciben'] === 1 ? 'entorno' : 'entornos'); ?>

                </span>
            <?php else: ?>
                <span class="tip font-semibold"
                      data-tip="Ningún entorno tiene el plugin en una versión que resuelva a esta. Para recibirla tendrían que actualizarlo."
                      style="color:var(--danger-500);">No la recibe nadie</span>
            <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>

            <span style="color:var(--border-strong);">·</span>
            <span><?php echo e($version->creator?->name ?? 'desconocido'); ?> · <?php echo e($version->created_at->format('d/m/Y')); ?></span>
         <?php $__env->endSlot(); ?>

         <?php $__env->slot('acciones', null, []); ?> 
            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check($ficha['permisoVersion'])): ?>
                
                <button type="button" wire:click="pedirDuplicarEstaVersion"
                        class="rounded-lg border px-3.5 py-2 text-[13px] font-semibold"
                        style="border-color:var(--border-default); background:var(--surface-page); color:var(--text-body);">
                    Duplicar como nueva
                </button>
            <?php endif; ?>
            
            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($this->puedeBorrarLaVersion()): ?>
                <?php if (isset($component)) { $__componentOriginal16cfd58c4c747d2a684655af648eda77 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal16cfd58c4c747d2a684655af648eda77 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.boton-borrar-version','data' => ['laReciben' => $llega['laReciben'],'elementos' => $archivos->count()]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('boton-borrar-version'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['la-reciben' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($llega['laReciben']),'elementos' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($archivos->count())]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal16cfd58c4c747d2a684655af648eda77)): ?>
<?php $attributes = $__attributesOriginal16cfd58c4c747d2a684655af648eda77; ?>
<?php unset($__attributesOriginal16cfd58c4c747d2a684655af648eda77); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal16cfd58c4c747d2a684655af648eda77)): ?>
<?php $component = $__componentOriginal16cfd58c4c747d2a684655af648eda77; ?>
<?php unset($__componentOriginal16cfd58c4c747d2a684655af648eda77); ?>
<?php endif; ?>
            <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check($ficha['permisoVersionEdit'])): ?>
                <a href="<?php echo e(route($ficha['rutaEditarVersion'], [$product, $version])); ?>" wire:navigate
                   class="rounded-lg px-4 py-2 text-[13px] font-semibold text-white"
                   style="background:var(--orange-500);"
                   onmouseover="this.style.background='var(--orange-600)'"
                   onmouseout="this.style.background='var(--orange-500)'">
                    Editar la versión
                </a>
            <?php endif; ?>
         <?php $__env->endSlot(); ?>
     <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal2544aeb3df80db4e8cf42f27632fe7f3)): ?>
<?php $attributes = $__attributesOriginal2544aeb3df80db4e8cf42f27632fe7f3; ?>
<?php unset($__attributesOriginal2544aeb3df80db4e8cf42f27632fe7f3); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal2544aeb3df80db4e8cf42f27632fe7f3)): ?>
<?php $component = $__componentOriginal2544aeb3df80db4e8cf42f27632fe7f3; ?>
<?php unset($__componentOriginal2544aeb3df80db4e8cf42f27632fe7f3); ?>
<?php endif; ?>

    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__currentLoopData = ['success' => 'success', 'error' => 'danger']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $clave => $color): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(session($clave)): ?>
            <div class="rounded-lg px-4 py-2.5 text-[13px]"
                 style="background:var(--<?php echo e($color); ?>-50); color:var(--<?php echo e($color); ?>-500);">
                <?php echo e(session($clave)); ?>

            </div>
        <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>

    
    <section class="overflow-hidden rounded-xl border"
             style="background:var(--surface-card); border-color:var(--border-subtle);">

        <div class="flex flex-wrap items-end justify-between gap-4 px-5 py-3.5">
            <div class="min-w-0">
                <h2 style="font-family:'Plus Jakarta Sans',sans-serif; font-size:15px; font-weight:700; color:var(--text-strong); margin:0;">
                    <?php echo e(ucfirst($ficha['elementos'])); ?>

                </h2>
                <div class="mt-0.5 text-[12.5px]" style="color:var(--text-muted);">
                    Se piden por nombre sin extensión, o todos los de la versión si no se pide ninguno.
                </div>
            </div>

            <div class="flex flex-wrap items-center gap-2">
                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check($ficha['permisoSubir'])): ?>
                    <a href="<?php echo e(route($ficha['rutaSubir'], [$product, $version])); ?>" wire:navigate
                       class="rounded-lg border px-3.5 py-2 text-[12.5px] font-semibold"
                       style="border-color:var(--border-default); background:var(--surface-page); color:var(--text-body);">
                        Subir archivos
                    </a>
                <?php endif; ?>
                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check($ficha['permisoArchivo'])): ?>
                    <a href="<?php echo e(route($ficha['rutaCrearArchivo'], [$product, $version])); ?>" wire:navigate
                       class="rounded-lg px-3.5 py-2 text-[12.5px] font-semibold text-white"
                       style="background:var(--orange-500);">
                        Escribir uno
                    </a>
                <?php endif; ?>
            </div>
        </div>

        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($archivos->isNotEmpty()): ?>
            <div class="vf-grid border-y px-5 py-1.5 text-[11px] font-semibold uppercase tracking-[0.06em]"
                 style="border-color:var(--border-subtle); background:var(--neutral-50); color:var(--text-subtle);">
                <div>Archivo</div>
                <div>Tamaño</div>
                <div>Añadido</div>
                <div></div>
            </div>
        <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>

        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__empty_1 = true; $__currentLoopData = $archivos; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $archivo): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
            <?php
                $ruta = str_contains((string) $archivo->filename, '/') ? dirname((string) $archivo->filename) . '/' : '';
                $nombre = basename((string) $archivo->filename);
            ?>
            <div class="vf-grid px-5 py-2 text-[12.5px] <?php echo e(! $loop->first ? 'border-t' : ''); ?> hover:bg-[var(--surface-alt)]"
                 style="border-color:var(--border-subtle);">

                
                <div class="min-w-0 truncate" style="font-family:ui-monospace,monospace;">
                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($ruta !== ''): ?>
                        <span style="color:var(--text-subtle);"><?php echo e($ruta); ?></span>
                    <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                    <span class="font-semibold" style="color:var(--text-strong);"><?php echo e($nombre); ?></span>
                </div>

                <div style="color:var(--text-muted);">
                    <?php $bytes = (int) $archivo->peso; ?>
                    <?php echo e($bytes >= 1024 ? number_format($bytes / 1024, 1, ',', '.') . ' KB' : $bytes . ' bytes'); ?>

                </div>

                <div style="color:var(--text-muted);">
                    <?php echo e($archivo->created_at->format('d/m/Y')); ?>

                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($archivo->creator): ?>
                        <div class="truncate text-[11.5px]" style="color:var(--text-subtle);"><?php echo e($archivo->creator->name); ?></div>
                    <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                </div>

                <div class="flex items-center justify-end gap-2.5 text-[12px] font-semibold">
                    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check($ficha['permisoVerArchivo'])): ?>
                        <a href="<?php echo e(route($ficha['rutaVerArchivo'], [$product, $version, $archivo])); ?>" wire:navigate
                           style="color:var(--text-link);">Ver</a>
                    <?php endif; ?>
                    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check($ficha['permisoEditarArchivo'])): ?>
                        <a href="<?php echo e(route($ficha['rutaEditarArchivo'], [$product, $version, $archivo])); ?>" wire:navigate
                           style="color:var(--text-link);">Editar</a>
                    <?php endif; ?>
                    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check($ficha['permisoBorrarArchivo'])): ?>
                        
                        
                        <button type="button" wire:click="abrirBorrarElemento(<?php echo e($archivo->id); ?>)"
                                style="color:var(--danger-500);">Borrar</button>
                    <?php endif; ?>
                </div>
            </div>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
            
            <div class="px-6 py-10 text-center">
                <div style="font-family:'Plus Jakarta Sans',sans-serif; font-size:15px; font-weight:700; color:var(--text-strong);">
                    Esta versión no tiene ningún archivo
                </div>
                <p class="mx-auto mt-2.5 max-w-[520px] text-[13px] leading-[1.6]" style="color:var(--text-muted);">
                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($llega['laReciben'] > 0): ?>
                        Y <strong class="font-semibold" style="color:var(--warning-500);"><?php echo e($llega['laReciben']); ?>

                        <?php echo e($llega['laReciben'] === 1 ? 'entorno la está recibiendo' : 'entornos la están recibiendo'); ?></strong>:
                        se llevan una respuesta vacía, sin ningún error que lo indique.
                    <?php else: ?>
                        Se sirve igual a quien la resuelva, con una respuesta vacía y sin ningún error.
                    <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                </p>

                <div class="mt-5 flex flex-wrap justify-center gap-2.5">
                    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check($ficha['permisoSubir'])): ?>
                        <a href="<?php echo e(route($ficha['rutaSubir'], [$product, $version])); ?>" wire:navigate
                           class="rounded-lg border px-4 py-2.5 text-[13px] font-semibold"
                           style="border-color:var(--border-default); background:var(--surface-page); color:var(--text-body);">
                            Subir archivos
                        </a>
                    <?php endif; ?>
                    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check($ficha['permisoArchivo'])): ?>
                        <a href="<?php echo e(route($ficha['rutaCrearArchivo'], [$product, $version])); ?>" wire:navigate
                           class="rounded-lg px-4 py-2.5 text-[13px] font-semibold text-white"
                           style="background:var(--orange-500);">
                            Escribir uno
                        </a>
                    <?php endif; ?>
                </div>
            </div>
        <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
    </section>
</div><?php /**PATH /var/www/html/resources/views/livewire/products/contenido/version-archivos.blade.php ENDPATH**/ ?>