@php $funnelStages = collect([ [ 'label' => 'Visitantes únicos', 'value' => (int) ($performance['visitors'] ?? 0), 'note' => 'Pessoas atribuídas', 'tone' => 'forest', ], [ 'label' => 'Produto visualizado', 'value' => (int) ($performance['product_views'] ?? 0), 'note' => 'Participantes únicos', 'tone' => 'leaf', ], [ 'label' => 'Adicionaram ao carrinho', 'value' => (int) ($performance['adds_to_cart'] ?? 0), 'note' => 'Participantes únicos', 'tone' => 'lime', ], [ 'label' => 'Checkout iniciado', 'value' => (int) ($performance['checkout_started'] ?? 0), 'note' => 'Carrinhos únicos', 'tone' => 'gold', ], [ 'label' => 'Pedido criado', 'value' => (int) ($performance['orders'] ?? 0), 'note' => 'Pedidos distintos', 'tone' => 'copper', ], [ 'label' => 'Pagamento confirmado', 'value' => (int) ($performance['paid_orders'] ?? 0), 'note' => 'Pedidos distintos', 'tone' => 'slate', ], ]); $funnelMaximum = max(1, (int) ($funnelStages->max('value') ?? 0)); @endphp

{{ $funnelTitle }}

{{ $funnelSubtitle }}

{{ number_format((float) ($performance['paid_conversion_rate'] ?? 0), 1) }}% visita → pagamento
    @foreach ($funnelStages as $stage) @php $stageWidth = $stage['value'] > 0 ? max(8, round(($stage['value'] / $funnelMaximum) * 100, 1)) : 0; @endphp
  1. {{ str_pad((string) $loop->iteration, 2, '0', STR_PAD_LEFT) }} {{ number_format($stage['value']) }}
    {{ $stage['label'] }}
    {{ $stage['note'] }}
  2. @endforeach
Pedidos criados {{ number_format((int) ($performance['orders'] ?? 0)) }} {{ number_format((float) ($performance['order_conversion_rate'] ?? 0), 1) }}% por visitante
Pagamentos confirmados {{ number_format((int) ($performance['paid_orders'] ?? 0)) }} {{ number_format((float) ($performance['paid_conversion_rate'] ?? 0), 1) }}% por visitante
Receita líquida paga ${{ number_format((float) ($performance['net_paid_revenue'] ?? 0), 2) }} Valor recebido menos reembolsos