@extends('template.layout') @push('css') @endpush @section('content')


@php // ========== VARIABLES SEGURAS ========== $vuelo = $datosVuelo['vuelo'] ?? null; $categoria = $datosVuelo['categoria'] ?? null; $imagenesGaleria = collect($datosVuelo['imagenes'] ?? [])->pluck('ruta_imagen_vuelo')->toArray(); $incluye = $datosVuelo['incluye'] ?? []; $adicionales = $adicionales ?? []; $extrasArray = is_array($adicionales) ? $adicionales : []; if (empty($imagenesGaleria)) { $imagenesGaleria = ['https://placehold.co/1200x800/2563eb/white?text=Sky+Balloons']; } $moneda = 'MXN'; $simbolo = '$'; $precioActual = (float) ($vuelo['precio_especial'] ?? ($vuelo['precio_publico'] ?? 0)); $precioOriginal = (float) ($vuelo['precio_publico'] ?? 0); $precioNino = (float) ($vuelo['precios_adicionales'][0]['precio'] ?? 1900); if (($vuelo['mostrar_precios_dolares'] ?? 0) == 1) { $moneda = 'USD'; $simbolo = 'US$'; } $tieneDescuento = $precioActual < $precioOriginal; $descuentoPorcentaje = $tieneDescuento ? round((1 - $precioActual / $precioOriginal) * 100) : 0; $locale = app()->getLocale(); $isSpanish = $locale === 'es'; $serviciosIncluidosIds = []; foreach ($incluye as $item) { $posiblesIds = [$item['id_item'] ?? null, $item['id'] ?? null, $item['servicio_id'] ?? null, $item['id_servicio'] ?? null, $item['item_id'] ?? null, $item['servicio']['id'] ?? null]; foreach ($posiblesIds as $id) { if ($id && is_numeric($id)) { $serviciosIncluidosIds[] = (int) $id; } } } $serviciosIncluidosIds = array_unique($serviciosIncluidosIds); function isServicioIncluido($servicioId, $incluidosIds) { return in_array($servicioId, $incluidosIds); } $extrasFiltrados = []; $totalOriginalExtras = 0; foreach ($extrasArray as $categoriaData) { $categoriaNombre = $categoriaData['nombre_categoria'] ?? ($isSpanish ? 'Otros servicios' : 'Other services'); $serviciosFiltrados = []; foreach ($categoriaData['servicios'] ?? [] as $servicio) { $servicioId = $servicio['id'] ?? null; $totalOriginalExtras++; if (!$servicioId || !isServicioIncluido($servicioId, $serviciosIncluidosIds)) { $serviciosFiltrados[] = $servicio; } } if (!empty($serviciosFiltrados)) { $extrasFiltrados[] = ['nombre_categoria' => $categoriaNombre, 'servicios' => $serviciosFiltrados]; } } $totalExtrasDisponibles = collect($extrasFiltrados)->sum(fn($cat) => count($cat['servicios'])); $todosIncluidos = ($totalOriginalExtras > 0 && $totalExtrasDisponibles === 0); $clipApiKey = config('clip.api_key', ''); @endphp @if ($vuelo)

{{ $vuelo['nombre_vuelo'] }}

{{ $vuelo['descripcion_corta'] }}

@if (!empty($vuelo['highlighted_text_flight_es']) && $isSpanish) {{ $vuelo['highlighted_text_flight_es'] }} @endif
@if ($tieneDescuento)
-{{ $descuentoPorcentaje }}%
{{ $simbolo }}{{ number_format($precioOriginal, 2, '.', ',') }}
@endif
{{ $simbolo }}{{ number_format($precioActual, 2, '.', ',') }}
{{ $isSpanish ? 'por adulto' : 'per adult' }}
{{ $categoria['nombre'] ?? ($isSpanish ? 'Aventura' : 'Adventure') }}
{{ \Carbon\Carbon::parse($vuelo['hora_actividad'] ?? '06:30')->format('g:i A') }}
@for ($i = 1; $i <= 5; $i++) @if ($i <= round($vuelo['raiting_global_number'] ?? 0)) @elseif($i - 0.5 <= round($vuelo['raiting_global_number'] ?? 0)) @else @endif @endfor
{{ number_format($vuelo['raiting_global_number'] ?? 0, 1) }}
1
{{ $isSpanish ? 'Vuelo' : 'Flight' }}
2
{{ $isSpanish ? 'Responsable' : 'Responsible' }}
3
{{ $isSpanish ? 'Extras' : 'Extras' }}
4
{{ $isSpanish ? 'Pago' : 'Payment' }}
5
{{ $isSpanish ? 'Pasajeros' : 'Passengers' }}
@if (!empty($vuelo['descripcion_larga']))

{{ $isSpanish ? 'Detalles del viaje' : 'Trip details' }}

{!! $vuelo['descripcion_larga'] !!}
@endif @if (!empty($incluye))

{{ $isSpanish ? '¿Qué incluye tu experiencia?' : 'What\'s included in your experience?' }}

    @foreach ($incluye as $item)
  • {{ $item['titulo_item'] ?? ($item['nombre'] ?? 'Item') }}
  • @endforeach
@endif
@else

{{ $isSpanish ? 'Vuelo no encontrado' : 'Flight not found' }}

@endif @endsection @push('js') @endpush