<div class="environment-card <?php echo e(!$environment->active ? 'opacity-60' : ''); ?>">
    <div class="flex min-w-0">
        <div class="w-12 h-12 shrink-0 border rounded flex items-center justify-center">
            <img src="<?php echo e($environment->type->image_url ?? asset('images/placeholder.png')); ?>"
                alt="<?php echo e($environment->type->name); ?>" class="w-8 h-8">
        </div>
        <div class="flex flex-col ml-4 min-w-0">
            <div class="flex items-center gap-2">
                <h3 class="text-lg font-bold truncate"><?php echo e($environment->name); ?></h3>
                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(!$environment->active): ?>
                    <span class="inline-flex items-center rounded-full bg-gray-100 px-2 py-0.5 text-[10px] font-semibold text-gray-600">
                        Inactivo
                    </span>
                <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
            </div>
            <p class="text-gray-500 text-sm truncate" title="<?php echo e($environment->domain); ?>">
                <a href="<?php echo e($environment->domain); ?>" target="_blank" class="hover:text-3ip underline decoration-dotted">
                    <?php echo e($environment->domain); ?>

                </a>
            </p>
            <div class="flex flex-wrap items-center gap-2 mt-1 text-xs text-gray-600">
                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($environment->env): ?>
                    <span class="inline-flex items-center rounded-full bg-gray-100 px-2 py-0.5">
                        <?php echo e(\App\Models\Environments\Environment::ENVIRONMENTS[$environment->env] ?? $environment->env); ?>

                    </span>
                <?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 if($environment->version): ?>
                    <span class="inline-flex items-center rounded-full bg-gray-100 px-2 py-0.5">
                        Moodle <?php echo e($environment->version); ?>

                    </span>
                <?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 if($environment->lastversion): ?>
                    <span class="inline-flex items-center rounded-full bg-red-100 px-2 py-0.5 text-red-700">
                        Core: actualización mayor disponible
                    </span>
                <?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 if($environment->lastminor && !$environment->lastversion): ?>
                    <span class="inline-flex items-center rounded-full bg-amber-100 px-2 py-0.5 text-amber-700">
                        Core: actualización menor disponible
                    </span>
                <?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 if(isset($environment->outdated_plugins_count) && $environment->outdated_plugins_count > 0): ?>
                    <span class="inline-flex items-center rounded-full bg-amber-100 px-2 py-0.5 text-amber-700">
                        Plugins con actualizaciones
                    </span>
                <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
            </div>
        </div>
    </div>
    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($showClient): ?>
        <div class="font-bold truncate" title="<?php echo e($environment->client->name); ?>">
            <?php echo e($environment->client->name); ?>

        </div>
    <?php else: ?>
        <div></div>
    <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
    <div class="flex flex-col justify-start min-w-0">
        <h3 class="text-lg text-gray-500">Productos</h3>
        <div class="flex items-center mt-2">
            <?php
                $environmentProducts = $environment->licenseToken
                    ? $environment->licenseToken->products->whereNotNull('image')->unique('id')
                    : collect();
            ?>
            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($environmentProducts->count() > 0): ?>
                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__currentLoopData = $environmentProducts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <div class="relative group"
                        style="z-index: <?php echo e($environmentProducts->count() - $index); ?>; margin-left: <?php echo e($index > 0 ? '-5px' : '0'); ?>;">
                        <img src="<?php echo e($product->image_url ?? asset('images/placeholder.png')); ?>"
                            alt="<?php echo e($product->name); ?>"
                            class="w-8 h-8 bg-white rounded-full object-contain border-2 border-gray-200 hover:border-3ip transition-all cursor-pointer"
                            title="<?php echo e($product->name); ?>">
                    </div>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
            <?php else: ?>
                <p class="text-gray-500 text-sm">No hay productos asociados</p>
            <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
        </div>
    </div>
    <div class="flex font-bold min-w-0">
        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($environment->licenseToken): ?>
            <button
                x-data="{ copied: false }"
                @click="navigator.clipboard.writeText('<?php echo e($environment->licenseToken->token); ?>').then(() => { copied = true; setTimeout(() => copied = false, 2000); })"
                class="border rounded-lg p-2 border-gray-200 flex items-center hover:bg-gray-50 transition-colors w-full justify-center">
                <img src="<?php echo e(asset('vendor/blade-untitledui-icons/copy.svg')); ?>" alt="Token"
                    class="w-4 h-4 shrink-0" x-cloak x-show="!copied">
                <span class="ml-2 truncate max-w-[120px]" title="<?php echo e($environment->licenseToken->token); ?>">
                    <span x-show="!copied"><?php echo e(Str::limit($environment->licenseToken->token, 10, '...')); ?></span>
                    <span x-cloak x-show="copied" class="text-3ip">¡Copiado!</span>
                </span>
            </button>
        <?php else: ?>
            <a href="<?php echo e(route('license_tokens.associate-license', [$client, $environment])); ?>"
                class="border rounded-lg p-2 border-gray-200 flex items-center w-full justify-center">
                <img src="<?php echo e(asset('vendor/blade-untitledui-icons/check-done-02.svg')); ?>"
                    alt="Asociar licencia" class="w-4 h-4 shrink-0">
                <span class="ml-2 truncate">Asociar licencia</span>
            </a>
        <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
    </div>
    <div class="flex items-center justify-end gap-2 shrink-0">
        <?php if (isset($component)) { $__componentOriginaldf8083d4a852c446488d8d384bbc7cbe = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginaldf8083d4a852c446488d8d384bbc7cbe = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.dropdown','data' => ['align' => 'right','width' => '48']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('dropdown'); ?>
<?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(['align' => 'right','width' => '48']); ?>
             <?php $__env->slot('trigger', null, []); ?> 
                <button
                    class="border rounded-lg p-2 border-gray-200 flex items-center hover:bg-gray-50 transition-colors">
                    <img src="<?php echo e(asset('vendor/blade-untitledui-icons/settings.svg')); ?>" alt="Configurar entorno"
                        class="w-4 h-4">
                </button>
             <?php $__env->endSlot(); ?>

             <?php $__env->slot('content', null, []); ?> 
                <?php if (isset($component)) { $__componentOriginal68cb1971a2b92c9735f83359058f7108 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal68cb1971a2b92c9735f83359058f7108 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.dropdown-link','data' => ['class' => 'flex items-center','href' => route('environments.edit', $environment),'wire:navigate' => true]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('dropdown-link'); ?>
<?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(['class' => 'flex items-center','href' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute(route('environments.edit', $environment)),'wire:navigate' => true]); ?>
                    <img src="<?php echo e(asset('vendor/blade-untitledui-icons/settings.svg')); ?>" alt="Configurar entorno" class="w-4 h-4">
                    <span class="ml-2 font-bold">Configurar</span>
                 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal68cb1971a2b92c9735f83359058f7108)): ?>
<?php $attributes = $__attributesOriginal68cb1971a2b92c9735f83359058f7108; ?>
<?php unset($__attributesOriginal68cb1971a2b92c9735f83359058f7108); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal68cb1971a2b92c9735f83359058f7108)): ?>
<?php $component = $__componentOriginal68cb1971a2b92c9735f83359058f7108; ?>
<?php unset($__componentOriginal68cb1971a2b92c9735f83359058f7108); ?>
<?php endif; ?>

                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($environment->licenseToken): ?>
                    <button wire:click="openDisassociateModal" class="w-full text-start">
                        <?php if (isset($component)) { $__componentOriginal68cb1971a2b92c9735f83359058f7108 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal68cb1971a2b92c9735f83359058f7108 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.dropdown-link','data' => ['class' => 'flex items-center']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('dropdown-link'); ?>
<?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(['class' => 'flex items-center']); ?>
                            <img src="<?php echo e(asset('vendor/blade-untitledui-icons/trash.svg')); ?>" alt="Desasociar entorno" class="w-4 h-4">
                            <span class="ml-2 font-bold">Desasociar entorno</span>
                         <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal68cb1971a2b92c9735f83359058f7108)): ?>
<?php $attributes = $__attributesOriginal68cb1971a2b92c9735f83359058f7108; ?>
<?php unset($__attributesOriginal68cb1971a2b92c9735f83359058f7108); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal68cb1971a2b92c9735f83359058f7108)): ?>
<?php $component = $__componentOriginal68cb1971a2b92c9735f83359058f7108; ?>
<?php unset($__componentOriginal68cb1971a2b92c9735f83359058f7108); ?>
<?php endif; ?>
                    </button>
                <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
             <?php $__env->endSlot(); ?>
         <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginaldf8083d4a852c446488d8d384bbc7cbe)): ?>
<?php $attributes = $__attributesOriginaldf8083d4a852c446488d8d384bbc7cbe; ?>
<?php unset($__attributesOriginaldf8083d4a852c446488d8d384bbc7cbe); ?>
<?php endif; ?>
<?php if (isset($__componentOriginaldf8083d4a852c446488d8d384bbc7cbe)): ?>
<?php $component = $__componentOriginaldf8083d4a852c446488d8d384bbc7cbe; ?>
<?php unset($__componentOriginaldf8083d4a852c446488d8d384bbc7cbe); ?>
<?php endif; ?>
        <a class="border rounded-lg p-2 border-gray-200 flex items-center" href="<?php echo e($environment->domain); ?>" target="_blank">
            <img src="<?php echo e(asset('vendor/blade-untitledui-icons/globe.svg')); ?>" alt="Abrir entorno"
                class="w-4 h-4">
        </a>
        <a href="<?php echo e(route('environments.plugins.index', $environment)); ?>"
           class="border rounded-lg p-2 border-gray-200 flex items-center hover:bg-gray-50 transition-colors text-xs font-semibold text-gray-700">
            <img src="<?php echo e(asset('vendor/blade-untitledui-icons/puzzle-piece-02.svg')); ?>" alt="Ver plugins"
                 class="w-4 h-4 mr-1">
            Ver plugins
        </a>
    </div>
</div><?php /**PATH /var/www/html/resources/views/livewire/environments/components/environment-card.blade.php ENDPATH**/ ?>