@php /** @var \Illuminate\Support\Collection $channels */ $ch = $channel ?? null; $pct = fn ($v) => number_format((float) $v, 1).'%'; @endphp
{{ __('LINE') }} · {{ __('Insights') }}

{{ __('Channel') }} {{ __('insights') }}

{{ __('Push quota, followers, delivery and audience demographics — read live from LINE.') }}@if ($date) · {{ $date }}@endif

@if ($channels->count() > 1)
@endif
@if ($channels->isEmpty())
L

{{ __('Connect a LINE channel first.') }}

{{ __('Connect a channel') }}
@else @if ($error)
{{ __('Could not reach LINE') }}: {{ $error }}
@endif {{-- Quota + followers KPI --}}
{{ __('Push quota') }}
{{ $quota === null ? __('Unlimited') : number_format($quota) }}
{{ __('this period') }}
{{ __('Used') }}
{{ $used === null ? '—' : number_format($used) }}
{{ $remaining !== null ? number_format($remaining).' '.__('remaining') : __('of quota') }}
{{ __('Followers') }}
{{ $followers ? number_format($followers['followers'] ?? 0) : '—' }}
{{ $followers ? number_format($followers['targetedReaches'] ?? 0).' '.__('reachable') : __('no data yet') }}
{{ __('Blocks') }}
{{ $followers ? number_format($followers['blocks'] ?? 0) : '—' }}
{{ __('blocked the OA') }}
{{-- Delivery breakdown --}} @if ($delivery)
{{ __('Messages delivered') }}
@foreach (['broadcast' => __('Broadcast'), 'targeting' => __('Narrowcast'), 'autoResponse' => __('Auto-reply'), 'welcomeResponse' => __('Welcome'), 'chat' => __('Chat'), 'apiBroadcast' => __('API broadcast'), 'apiPush' => __('API push'), 'apiMulticast' => __('API multicast'), 'apiNarrowcast' => __('API narrowcast'), 'apiReply' => __('API reply')] as $k => $label) @if (isset($delivery[$k]))
{{ $label }}
{{ number_format($delivery[$k]) }}
@endif @endforeach
@endif {{-- Demographics --}} @if ($demographic)
@php $blocks = [ 'genders' => [__('Gender'), 'gender'], 'ages' => [__('Age'), 'age'], 'areas' => [__('Area'), 'area'], 'appTypes'=> [__('Platform'), 'appType'], ]; @endphp @foreach ($blocks as $key => [$title, $field]) @if (! empty($demographic[$key]))
{{ $title }}
@foreach (collect($demographic[$key])->sortByDesc('percentage')->take(8) as $row)
{{ ucfirst((string) ($row[$field] ?? 'unknown')) }} {{ $pct($row['percentage'] ?? 0) }}
@endforeach
@endif @endforeach
@elseif (! $error)
{{ __('Demographic insights need at least 20 followers and appear a day after activity.') }}
@endif @endif