{$i18n.t('Usage')}

{#if loading}
{:else if !usage}
{$i18n.t('Failed to load usage')}
{:else}
{formatNumber(usage.totals.lifetime_tokens)}
{$i18n.t('Lifetime tokens')}
{formatNumber(usage.totals.peak_daily_tokens)}
{$i18n.t('Peak tokens')}
{formatDuration(usage.totals.longest_chat_seconds)}
{$i18n.t('Longest active chat')}
{usage.totals.current_streak.toLocaleString()}
{$i18n.t('Current streak')}
{usage.totals.longest_streak.toLocaleString()}
{$i18n.t('Longest streak')}

{$i18n.t('Token activity')}

{#each heatmapModes as mode} {/each}
{#each heatmapCells as entry} {#if entry}
{:else}
{/if} {/each}
{#each monthLabels as month}
{month.label}
{/each}
{#if usage.top_models.length > 0}
{#each usage.top_models.slice(0, 6) as model}
{modelName(model.model_id)}
{/each}
{/if}
{#if !hasUsage}
{$i18n.t('No usage data found')}
{:else} {usage.totals.models_used.toLocaleString()} {formatNumber(usage.insights.average_tokens_per_chat)} {usage.insights.average_messages_per_active_day.toLocaleString()} {usage.totals.user_messages.toLocaleString()} · {usage.insights.user_message_share}% {usage.totals.assistant_messages.toLocaleString()} · {usage.insights .assistant_message_share}% {usage.totals.total_chats.toLocaleString()} {#if usage.top_models.length === 0}
{$i18n.t('No model usage found')}
{:else} {#each usage.top_models as model} {model.messages.toLocaleString()} {$i18n.t('messages')} · {formatNumber(model.total_tokens)} {/each} {/if}
{#if usage.top_tools.length > 0} {#each usage.top_tools as tool} {tool.count.toLocaleString()} {$i18n.t('runs')} {/each} {/if} {/if}
{$i18n.t('Token counts are estimates and may not reflect actual API usage')}
{/if}