Skip to content

Real-time dashboard for monitoring global news, markets, and geopolitical events

TypeScript

Phase 4: Migrate all panels to Svelte components

Sean Thielen-Esparza70ff42a249de
diff --git a/src/lib/components/panels/CommoditiesPanel.svelte b/src/lib/components/panels/CommoditiesPanel.svelte
new file mode 100644
index 0000000..74d31ad
--- /dev/null
+++ b/src/lib/components/panels/CommoditiesPanel.svelte
@@ -0,0 +1,58 @@
+<script lang="ts">
+ import { Panel, MarketItem } from '$lib/components/common';
+ import { commodities, vix } from '$lib/stores';
+
+ const items = $derived($commodities.items);
+ const loading = $derived($commodities.loading);
+ const error = $derived($commodities.error);
+
+ // VIX status for panel header
+ const vixStatus = $derived(() => {
+ if (!$vix) return '';
+ const level = $vix.price;
+ if (level >= 30) return 'HIGH FEAR';
+ if (level >= 20) return 'ELEVATED';
+ return 'LOW';
+ });
+
+ const vixClass = $derived(() => {
+ if (!$vix) return '';
+ const level = $vix.price;
+ if (level >= 30) return 'critical';
+ if (level >= 20) return 'elevated';
+ return 'monitoring';
+ });
+</script>
+
+<Panel
+ id="commodities"
+ title="Commodities / VIX"
+ status={vixStatus()}
+ statusClass={vixClass()}
+ {loading}
+ {error}
+>
+ {#if items.length === 0 && !loading && !error}
+ <div class="empty-state">No commodity data available</div>
+ {:else}
+ <div class="commodities-list">
+ {#each items as item (item.symbol)}
+ <MarketItem {item} currencySymbol={item.symbol === '^VIX' ? '' : '$'} />
+ {/each}
+ </div>
+ {/if}
+</Panel>
+
+<style>
+ .commodities-list {
+ display: flex;
+ flex-direction: column;
+ }
+
+ .empty-state {
+ text-align: center;
+ color: var(--text-secondary);
+ font-size: 0.7rem;
+ padding: 1rem;
+ }
+</style>
diff --git a/src/lib/components/panels/ContractsPanel.svelte b/src/lib/components/panels/ContractsPanel.svelte
new file mode 100644
index 0000000..95ed2b7
--- /dev/null
+++ b/src/lib/components/panels/ContractsPanel.svelte
@@ -0,0 +1,107 @@
+<script lang="ts">
+ import { Panel } from '$lib/components/common';
+
+ interface Contract {
+ agency: string;
+ description: string;
+ vendor: string;
+ amount: number;
+ }
+
+ interface Props {
+ contracts?: Contract[];
+ loading?: boolean;
+ error?: string | null;
+ }
+
+ let { contracts = [], loading = false, error = null }: Props = $props();
+
+ const count = $derived(contracts.length);
+
+ function formatValue(v: number): string {
+ if (v >= 1e9) return '$' + (v / 1e9).toFixed(1) + 'B';
+ if (v >= 1e6) return '$' + (v / 1e6).toFixed(1) + 'M';
+ if (v >= 1e3) return '$' + (v / 1e3).toFixed(0) + 'K';
+ return '$' + v.toFixed(0);
+ }
+</script>
+
+<Panel id="contracts" title="Gov Contracts" {count} {loading} {error}>
+ {#if contracts.length === 0 && !loading && !error}
+ <div class="empty-state">No contracts available</div>
+ {:else}
+ <div class="contracts-list">
+ {#each contracts as contract, i (contract.vendor + i)}
+ <div class="contract-item">
+ <div class="contract-agency">{contract.agency}</div>
+ <div class="contract-desc">
+ {contract.description.length > 100
+ ? contract.description.substring(0, 100) + '...'
+ : contract.description}
+ </div>
+ <div class="contract-meta">
+ <span class="contract-vendor">{contract.vendor}</span>
+ <span class="contract-value">{formatValue(contract.amount)}</span>
+ </div>
+ </div>
+ {/each}
+ </div>
+ {/if}
+</Panel>
+
+<style>
+ .contracts-list {
+ display: flex;
+ flex-direction: column;
+ }
+
+ .contract-item {
+ padding: 0.5rem 0;
+ border-bottom: 1px solid var(--border);
+ }
+
+ .contract-item:last-child {
+ border-bottom: none;
+ }
+
+ .contract-agency {
+ font-size: 0.55rem;
+ font-weight: 600;
+ color: var(--accent);
+ text-transform: uppercase;
+ letter-spacing: 0.03em;
+ margin-bottom: 0.2rem;
+ }
+
+ .contract-desc {
+ font-size: 0.65rem;
+ color: var(--text-primary);
+ line-height: 1.3;
+ margin-bottom: 0.3rem;
+ }
+
+ .contract-meta {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ }
+
+ .contract-vendor {
+ font-size: 0.55rem;
+ color: var(--text-secondary);
+ }
+
+ .contract-value {
+ font-size: 0.65rem;
+ font-weight: 600;
+ color: var(--success);
+ font-variant-numeric: tabular-nums;
+ }
+
+ .empty-state {
+ text-align: center;
+ color: var(--text-secondary);
+ font-size: 0.7rem;
+ padding: 1rem;
+ }
+</style>
diff --git a/src/lib/components/panels/CorrelationPanel.svelte b/src/lib/components/panels/CorrelationPanel.svelte
new file mode 100644
index 0000000..80d156e
--- /dev/null
+++ b/src/lib/components/panels/CorrelationPanel.svelte
@@ -0,0 +1,244 @@
+<script lang="ts">
+ import { Panel, Badge } from '$lib/components/common';
+ import { analyzeCorrelations } from '$lib/analysis/correlation';
+ import type { NewsItem } from '$lib/types';
+
+ interface Props {
+ news?: NewsItem[];
+ loading?: boolean;
+ error?: string | null;
+ }
+
+ let { news = [], loading = false, error = null }: Props = $props();
+
+ const analysis = $derived(analyzeCorrelations(news));
+
+ function getLevelVariant(level: string): 'default' | 'warning' | 'danger' | 'success' | 'info' {
+ switch (level) {
+ case 'high':
+ return 'danger';
+ case 'elevated':
+ return 'warning';
+ case 'surging':
+ return 'danger';
+ case 'rising':
+ return 'warning';
+ default:
+ return 'default';
+ }
+ }
+
+ function getMomentumClass(momentum: string): string {
+ switch (momentum) {
+ case 'surging':
+ return 'signal-strong';
+ case 'rising':
+ return 'signal-medium';
+ default:
+ return 'signal-weak';
+ }
+ }
+</script>
+
+<Panel id="correlation" title="Pattern Analysis" {loading} {error}>
+ {#if news.length === 0 && !loading && !error}
+ <div class="empty-state">Insufficient data for analysis</div>
+ {:else if analysis}
+ <div class="correlation-content">
+ {#if analysis.emergingPatterns.length > 0}
+ <div class="section">
+ <div class="section-title">Emerging Patterns</div>
+ {#each analysis.emergingPatterns.slice(0, 3) as pattern}
+ <div class="pattern-item">
+ <div class="pattern-header">
+ <span class="pattern-topic">{pattern.name}</span>
+ <Badge
+ text={pattern.level.toUpperCase()}
+ variant={getLevelVariant(pattern.level)}
+ />
+ </div>
+ <div class="pattern-sources">
+ {pattern.sources.slice(0, 3).join(' · ')} ({pattern.count} items)
+ </div>
+ </div>
+ {/each}
+ </div>
+ {/if}
+
+ {#if analysis.momentumSignals.length > 0}
+ <div class="section">
+ <div class="section-title">Momentum Signals</div>
+ {#each analysis.momentumSignals.slice(0, 3) as signal}
+ <div class="signal-item {getMomentumClass(signal.momentum)}">
+ <span class="signal-topic">{signal.name}</span>
+ <span
+ class="signal-direction"
+ class:up={signal.delta > 0}
+ class:down={signal.delta < 0}
+ >
+ {signal.delta > 0 ? '↑' : signal.delta < 0 ? '↓' : '→'}
+ {signal.current}
+ </span>
+ </div>
+ {/each}
+ </div>
+ {/if}
+
+ {#if analysis.crossSourceCorrelations.length > 0}
+ <div class="section">
+ <div class="section-title">Cross-Source Links</div>
+ {#each analysis.crossSourceCorrelations.slice(0, 3) as corr}
+ <div class="correlation-item">
+ <div class="correlation-sources">
+ {corr.sources.slice(0, 2).join(' ↔ ')}
+ </div>
+ <div class="correlation-topic">{corr.name} ({corr.sourceCount} sources)</div>
+ </div>
+ {/each}
+ </div>
+ {/if}
+
+ {#if analysis.predictiveSignals.length > 0}
+ <div class="section">
+ <div class="section-title">Predictive Signals</div>
+ {#each analysis.predictiveSignals.slice(0, 2) as signal}
+ <div class="predictive-item">
+ <div class="predictive-pattern">{signal.prediction}</div>
+ <div class="predictive-confidence">
+ Confidence: {Math.round(signal.confidence * 100)}%
+ </div>
+ </div>
+ {/each}
+ </div>
+ {/if}
+
+ {#if analysis.emergingPatterns.length === 0 && analysis.momentumSignals.length === 0}
+ <div class="empty-state">No significant patterns detected</div>
+ {/if}
+ </div>
+ {:else}
+ <div class="empty-state">No significant patterns detected</div>
+ {/if}
+</Panel>
+
+<style>
+ .correlation-content {
+ display: flex;
+ flex-direction: column;
+ gap: 0.75rem;
+ }
+
+ .section {
+ padding-bottom: 0.5rem;
+ border-bottom: 1px solid var(--border);
+ }
+
+ .section:last-child {
+ border-bottom: none;
+ padding-bottom: 0;
+ }
+
+ .section-title {
+ font-size: 0.6rem;
+ font-weight: 600;
+ color: var(--accent);
+ text-transform: uppercase;
+ letter-spacing: 0.05em;
+ margin-bottom: 0.4rem;
+ }
+
+ .pattern-item {
+ padding: 0.3rem 0;
+ }
+
+ .pattern-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-bottom: 0.2rem;
+ }
+
+ .pattern-topic {
+ font-size: 0.65rem;
+ font-weight: 500;
+ color: var(--text-primary);
+ }
+
+ .pattern-sources {
+ font-size: 0.55rem;
+ color: var(--text-muted);
+ }
+
+ .signal-item {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: 0.25rem 0.4rem;
+ margin: 0.2rem 0;
+ border-radius: 4px;
+ background: rgba(255, 255, 255, 0.02);
+ }
+
+ .signal-item.signal-strong {
+ background: rgba(255, 165, 0, 0.1);
+ border-left: 2px solid var(--warning);
+ }
+
+ .signal-item.signal-medium {
+ background: rgba(68, 255, 136, 0.05);
+ border-left: 2px solid var(--success);
+ }
+
+ .signal-topic {
+ font-size: 0.6rem;
+ color: var(--text-primary);
+ }
+
+ .signal-direction {
+ font-size: 0.6rem;
+ font-weight: 600;
+ }
+
+ .signal-direction.up {
+ color: var(--success);
+ }
+
+ .signal-direction.down {
+ color: var(--danger);
+ }
+
+ .correlation-item {
+ padding: 0.25rem 0;
+ }
+
+ .correlation-sources {
+ font-size: 0.6rem;
+ color: var(--text-secondary);
+ }
+
+ .correlation-topic {
+ font-size: 0.55rem;
+ color: var(--text-muted);
+ }
+
+ .predictive-item {
+ padding: 0.3rem 0;
+ }
+
+ .predictive-pattern {
+ font-size: 0.6rem;
+ color: var(--text-primary);
+ }
+
+ .predictive-confidence {
+ font-size: 0.55rem;
+ color: var(--text-muted);
+ }
+
+ .empty-state {
+ text-align: center;
+ color: var(--text-secondary);
+ font-size: 0.7rem;
+ padding: 1rem;
+ }
+</style>
diff --git a/src/lib/components/panels/CryptoPanel.svelte b/src/lib/components/panels/CryptoPanel.svelte
new file mode 100644
index 0000000..17fe6f4
--- /dev/null
+++ b/src/lib/components/panels/CryptoPanel.svelte
@@ -0,0 +1,105 @@
+<script lang="ts">
+ import { Panel } from '$lib/components/common';
+ import { crypto } from '$lib/stores';
+ import { formatCurrency, formatPercentChange, getChangeClass } from '$lib/utils';
+
+ const items = $derived($crypto.items);
+ const loading = $derived($crypto.loading);
+ const error = $derived($crypto.error);
+ const count = $derived(items.length);
+</script>
+
+<Panel id="whales" title="Crypto" {count} {loading} {error}>
+ {#if items.length === 0 && !loading && !error}
+ <div class="empty-state">No crypto data available</div>
+ {:else}
+ <div class="crypto-list">
+ {#each items as coin (coin.id)}
+ {@const changeClass = getChangeClass(coin.price_change_percentage_24h)}
+ <div class="crypto-item">
+ <div class="crypto-info">
+ <div class="crypto-name">{coin.name}</div>
+ <div class="crypto-symbol">{coin.symbol.toUpperCase()}</div>
+ </div>
+ <div class="crypto-data">
+ <div class="crypto-price">{formatCurrency(coin.current_price)}</div>
+ <div class="crypto-change {changeClass}">
+ {formatPercentChange(coin.price_change_percentage_24h)}
+ </div>
+ </div>
+ </div>
+ {/each}
+ </div>
+ {/if}
+</Panel>
+
+<style>
+ .crypto-list {
+ display: flex;
+ flex-direction: column;
+ }
+
+ .crypto-item {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: 0.5rem 0;
+ border-bottom: 1px solid var(--border);
+ }
+
+ .crypto-item:last-child {
+ border-bottom: none;
+ }
+
+ .crypto-info {
+ display: flex;
+ flex-direction: column;
+ gap: 0.1rem;
+ }
+
+ .crypto-name {
+ font-size: 0.7rem;
+ font-weight: 500;
+ color: var(--text-primary);
+ }
+
+ .crypto-symbol {
+ font-size: 0.55rem;
+ color: var(--text-muted);
+ }
+
+ .crypto-data {
+ display: flex;
+ flex-direction: column;
+ align-items: flex-end;
+ gap: 0.1rem;
+ }
+
+ .crypto-price {
+ font-size: 0.7rem;
+ font-weight: 500;
+ color: var(--text-primary);
+ font-variant-numeric: tabular-nums;
+ }
+
+ .crypto-change {
+ font-size: 0.6rem;
+ font-weight: 500;
+ font-variant-numeric: tabular-nums;
+ }
+
+ .crypto-change.up {
+ color: var(--success);
+ }
+
+ .crypto-change.down {
+ color: var(--danger);
+ }
+
+ .empty-state {
+ text-align: center;
+ color: var(--text-secondary);
+ font-size: 0.7rem;
+ padding: 1rem;
+ }
+</style>
diff --git a/src/lib/components/panels/HeatmapPanel.svelte b/src/lib/components/panels/HeatmapPanel.svelte
new file mode 100644
index 0000000..b4efc2a
--- /dev/null
+++ b/src/lib/components/panels/HeatmapPanel.svelte
@@ -0,0 +1,41 @@
+<script lang="ts">
+ import { Panel, HeatmapCell } from '$lib/components/common';
+ import { sectors } from '$lib/stores';
+
+ const items = $derived($sectors.items);
+ const loading = $derived($sectors.loading);
+ const error = $derived($sectors.error);
+</script>
+
+<Panel id="heatmap" title="Sector Heatmap" {loading} {error}>
+ {#if items.length === 0 && !loading && !error}
+ <div class="empty-state">No sector data available</div>
+ {:else}
+ <div class="heatmap-grid">
+ {#each items as sector (sector.symbol)}
+ <HeatmapCell {sector} />
+ {/each}
+ </div>
+ {/if}
+</Panel>
+
+<style>
+ .heatmap-grid {
+ display: grid;
+ grid-template-columns: repeat(4, 1fr);
+ gap: 0.25rem;
+ }
+
+ .empty-state {
+ text-align: center;
+ color: var(--text-secondary);
+ font-size: 0.7rem;
+ padding: 1rem;
+ }
+
+ @media (max-width: 400px) {
+ .heatmap-grid {
+ grid-template-columns: repeat(3, 1fr);
+ }
+ }
+</style>
diff --git a/src/lib/components/panels/IntelPanel.svelte b/src/lib/components/panels/IntelPanel.svelte
new file mode 100644
index 0000000..aef73ca
--- /dev/null
+++ b/src/lib/components/panels/IntelPanel.svelte
@@ -0,0 +1,145 @@
+<script lang="ts">
+ import { Panel, Badge } from '$lib/components/common';
+ import { getRelativeTime } from '$lib/utils';
+
+ interface IntelItem {
+ id: string;
+ title: string;
+ link: string;
+ source: string;
+ sourceType: 'osint' | 'govt' | 'think-tank' | 'defense' | 'regional' | 'cyber';
+ regions: string[];
+ topics: string[];
+ pubDate?: string;
+ isPriority?: boolean;
+ }
+
+ interface Props {
+ items?: IntelItem[];
+ loading?: boolean;
+ error?: string | null;
+ }
+
+ let { items = [], loading = false, error = null }: Props = $props();
+
+ const count = $derived(items.length);
+
+ function getSourceBadgeVariant(
+ type: string
+ ): 'default' | 'success' | 'warning' | 'danger' | 'info' {
+ switch (type) {
+ case 'osint':
+ return 'info';
+ case 'govt':
+ return 'warning';
+ case 'cyber':
+ return 'danger';
+ default:
+ return 'default';
+ }
+ }
+</script>
+
+<Panel id="intel" title="Intel Feed" {count} {loading} {error}>
+ {#if items.length === 0 && !loading && !error}
+ <div class="empty-state">No intel available</div>
+ {:else}
+ <div class="intel-list">
+ {#each items as item (item.id)}
+ <div class="intel-item" class:priority={item.isPriority}>
+ <div class="intel-header">
+ <span class="intel-source">{item.source}</span>
+ <div class="intel-tags">
+ <Badge text={item.sourceType.toUpperCase()} variant={getSourceBadgeVariant(item.sourceType)} />
+ {#each item.regions.slice(0, 2) as region}
+ <Badge text={region} variant="info" />
+ {/each}
+ {#each item.topics.slice(0, 2) as topic}
+ <Badge text={topic} />
+ {/each}
+ </div>
+ </div>
+ <a href={item.link} target="_blank" rel="noopener noreferrer" class="intel-title">
+ {item.title}
+ </a>
+ {#if item.pubDate}
+ <div class="intel-meta">
+ <span>{getRelativeTime(item.pubDate)}</span>
+ </div>
+ {/if}
+ </div>
+ {/each}
+ </div>
+ {/if}
+</Panel>
+
+<style>
+ .intel-list {
+ display: flex;
+ flex-direction: column;
+ }
+
+ .intel-item {
+ padding: 0.5rem 0;
+ border-bottom: 1px solid var(--border);
+ }
+
+ .intel-item:last-child {
+ border-bottom: none;
+ }
+
+ .intel-item.priority {
+ background: rgba(255, 165, 0, 0.08);
+ margin: 0 -0.5rem;
+ padding: 0.5rem;
+ border-radius: 4px;
+ border: 1px solid rgba(255, 165, 0, 0.2);
+ }
+
+ .intel-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-bottom: 0.3rem;
+ gap: 0.5rem;
+ }
+
+ .intel-source {
+ font-size: 0.55rem;
+ font-weight: 600;
+ color: var(--text-secondary);
+ text-transform: uppercase;
+ letter-spacing: 0.03em;
+ }
+
+ .intel-tags {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 0.2rem;
+ }
+
+ .intel-title {
+ display: block;
+ font-size: 0.65rem;
+ color: var(--text-primary);
+ text-decoration: none;
+ line-height: 1.35;
+ }
+
+ .intel-title:hover {
+ color: var(--accent);
+ }
+
+ .intel-meta {
+ margin-top: 0.25rem;
+ font-size: 0.55rem;
+ color: var(--text-muted);
+ }
+
+ .empty-state {
+ text-align: center;
+ color: var(--text-secondary);
+ font-size: 0.7rem;
+ padding: 1rem;
+ }
+</style>
diff --git a/src/lib/components/panels/LayoffsPanel.svelte b/src/lib/components/panels/LayoffsPanel.svelte
new file mode 100644
index 0000000..87b2635
--- /dev/null
+++ b/src/lib/components/panels/LayoffsPanel.svelte
@@ -0,0 +1,103 @@
+<script lang="ts">
+ import { Panel } from '$lib/components/common';
+ import { timeAgo } from '$lib/utils';
+
+ interface Layoff {
+ company: string;
+ count?: string | number;
+ title: string;
+ date: string;
+ }
+
+ interface Props {
+ layoffs?: Layoff[];
+ loading?: boolean;
+ error?: string | null;
+ }
+
+ let { layoffs = [], loading = false, error = null }: Props = $props();
+
+ const count = $derived(layoffs.length);
+</script>
+
+<Panel id="layoffs" title="Layoffs Tracker" {count} {loading} {error}>
+ {#if layoffs.length === 0 && !loading && !error}
+ <div class="empty-state">No recent layoffs data</div>
+ {:else}
+ <div class="layoffs-list">
+ {#each layoffs as layoff, i (layoff.company + i)}
+ <div class="layoff-item">
+ <div class="layoff-company">{layoff.company}</div>
+ {#if layoff.count}
+ <div class="layoff-count">
+ {typeof layoff.count === 'string'
+ ? parseInt(layoff.count).toLocaleString()
+ : layoff.count.toLocaleString()} jobs
+ </div>
+ {/if}
+ <div class="layoff-meta">
+ <span class="headline">{layoff.title}</span>
+ <span class="time">{timeAgo(layoff.date)}</span>
+ </div>
+ </div>
+ {/each}
+ </div>
+ {/if}
+</Panel>
+
+<style>
+ .layoffs-list {
+ display: flex;
+ flex-direction: column;
+ }
+
+ .layoff-item {
+ padding: 0.5rem 0;
+ border-bottom: 1px solid var(--border);
+ }
+
+ .layoff-item:last-child {
+ border-bottom: none;
+ }
+
+ .layoff-company {
+ font-size: 0.7rem;
+ font-weight: 600;
+ color: var(--text-primary);
+ margin-bottom: 0.15rem;
+ }
+
+ .layoff-count {
+ font-size: 0.65rem;
+ font-weight: 500;
+ color: var(--danger);
+ margin-bottom: 0.2rem;
+ }
+
+ .layoff-meta {
+ display: flex;
+ justify-content: space-between;
+ align-items: flex-start;
+ gap: 0.5rem;
+ }
+
+ .headline {
+ font-size: 0.6rem;
+ color: var(--text-secondary);
+ line-height: 1.3;
+ flex: 1;
+ }
+
+ .time {
+ font-size: 0.55rem;
+ color: var(--text-muted);
+ white-space: nowrap;
+ }
+
+ .empty-state {
+ text-align: center;
+ color: var(--text-secondary);
+ font-size: 0.7rem;
+ padding: 1rem;
+ }
+</style>
diff --git a/src/lib/components/panels/MainCharPanel.svelte b/src/lib/components/panels/MainCharPanel.svelte
new file mode 100644
index 0000000..9ba1ab2
--- /dev/null
+++ b/src/lib/components/panels/MainCharPanel.svelte
@@ -0,0 +1,97 @@
+<script lang="ts">
+ import { Panel } from '$lib/components/common';
+ import { news } from '$lib/stores';
+ import { calculateMainCharacter, type MainCharacterResults } from '$lib/analysis';
+
+ // Calculate main character from all news
+ const allNews = $derived(news.getAllItems());
+ const results: MainCharacterResults = $derived(calculateMainCharacter(allNews));
+ const topChar = $derived(results.topCharacter);
+ const rankings = $derived(results.characters);
+</script>
+
+<Panel id="mainchar" title="Main Character">
+ {#if !topChar}
+ <div class="empty-state">No data yet</div>
+ {:else}
+ <div class="main-char-display">
+ <div class="main-char-label">Today's Main Character</div>
+ <div class="main-char-name">{topChar.name}</div>
+ <div class="main-char-count">{topChar.count} mentions in headlines</div>
+
+ {#if rankings.length > 1}
+ <div class="main-char-list">
+ {#each rankings.slice(1, 8) as char, i (char.name)}
+ <div class="char-row">
+ <span class="rank">{i + 2}.</span>
+ <span class="name">{char.name}</span>
+ <span class="mentions">{char.count}</span>
+ </div>
+ {/each}
+ </div>
+ {/if}
+ </div>
+ {/if}
+</Panel>
+
+<style>
+ .main-char-display {
+ text-align: center;
+ padding: 0.5rem;
+ }
+
+ .main-char-label {
+ font-size: 0.55rem;
+ color: var(--text-muted);
+ text-transform: uppercase;
+ letter-spacing: 0.1em;
+ margin-bottom: 0.5rem;
+ }
+
+ .main-char-name {
+ font-size: 1.2rem;
+ font-weight: 700;
+ color: var(--accent);
+ margin-bottom: 0.25rem;
+ }
+
+ .main-char-count {
+ font-size: 0.65rem;
+ color: var(--text-secondary);
+ margin-bottom: 1rem;
+ }
+
+ .main-char-list {
+ border-top: 1px solid var(--border);
+ padding-top: 0.75rem;
+ }
+
+ .char-row {
+ display: flex;
+ align-items: center;
+ padding: 0.25rem 0;
+ font-size: 0.65rem;
+ }
+
+ .rank {
+ width: 1.5rem;
+ color: var(--text-muted);
+ }
+
+ .name {
+ flex: 1;
+ color: var(--text-primary);
+ }
+
+ .mentions {
+ color: var(--text-secondary);
+ font-variant-numeric: tabular-nums;
+ }
+
+ .empty-state {
+ text-align: center;
+ color: var(--text-secondary);
+ font-size: 0.7rem;
+ padding: 1rem;
+ }
+</style>
diff --git a/src/lib/components/panels/MapPanel.svelte b/src/lib/components/panels/MapPanel.svelte
new file mode 100644
index 0000000..11d4c95
--- /dev/null
+++ b/src/lib/components/panels/MapPanel.svelte
@@ -0,0 +1,718 @@
+<script lang="ts">
+ import { onMount, onDestroy } from 'svelte';
+ import { Panel } from '$lib/components/common';
+ import {
+ HOTSPOTS,
+ CONFLICT_ZONES,
+ CHOKEPOINTS,
+ CABLE_LANDINGS,
+ NUCLEAR_SITES,
+ MILITARY_BASES,
+ OCEANS,
+ SANCTIONED_COUNTRY_IDS,
+ THREAT_COLORS,
+ WEATHER_CODES
+ } from '$lib/config/map';
+ import type { CustomMonitor } from '$lib/types';
+
+ interface Props {
+ monitors?: CustomMonitor[];
+ loading?: boolean;
+ error?: string | null;
+ }
+
+ let { monitors = [], loading = false, error = null }: Props = $props();
+
+ let mapContainer: HTMLDivElement;
+ // D3 objects - initialized in initMap, null before initialization
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ let svg: any = null;
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ let mapGroup: any = null;
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ let projection: any = null;
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ let path: any = null;
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ let zoom: any = null;
+
+ const WIDTH = 800;
+ const HEIGHT = 400;
+
+ // Tooltip state
+ let tooltipContent = $state<{
+ title: string;
+ color: string;
+ lines: string[];
+ } | null>(null);
+ let tooltipPosition = $state({ left: 0, top: 0 });
+ let tooltipVisible = $state(false);
+
+ // Data cache for tooltips
+ const dataCache: Record<string, unknown> = {};
+
+ // Get local time at longitude
+ function getLocalTime(lon: number): string {
+ const now = new Date();
+ const utcHours = now.getUTCHours();
+ const utcMinutes = now.getUTCMinutes();
+ const offsetHours = Math.round(lon / 15);
+ let localHours = (utcHours + offsetHours + 24) % 24;
+ const ampm = localHours >= 12 ? 'PM' : 'AM';
+ localHours = localHours % 12 || 12;
+ return `${localHours}:${utcMinutes.toString().padStart(2, '0')} ${ampm}`;
+ }
+
+ // Fetch weather from Open-Meteo
+ async function getWeather(
+ lat: number,
+ lon: number
+ ): Promise<{ temp: number | null; wind: number | null; condition: string } | null> {
+ const key = `weather_${lat}_${lon}`;
+ if (dataCache[key]) return dataCache[key] as { temp: number | null; wind: number | null; condition: string };
+ try {
+ const res = await fetch(
+ `https://api.open-meteo.com/v1/forecast?latitude=${lat}&longitude=${lon}&current=temperature_2m,weather_code,wind_speed_10m`
+ );
+ const data = await res.json();
+ const temp = data.current?.temperature_2m;
+ const tempF = temp ? Math.round((temp * 9) / 5 + 32) : null;
+ const wind = data.current?.wind_speed_10m;
+ const code = data.current?.weather_code;
+ const result = {
+ temp: tempF,
+ wind: wind ? Math.round(wind) : null,
+ condition: WEATHER_CODES[code] || '—'
+ };
+ dataCache[key] = result;
+ return result;
+ } catch {
+ return null;
+ }
+ }
+
+ // Mobile detection
+ function isMobile(): boolean {
+ return window.innerWidth <= 768;
+ }
+
+ // Update zoom behavior based on viewport
+ function updateZoomBehavior(): void {
+ if (!svg || !zoom || !mapGroup) return;
+ if (isMobile()) {
+ svg.call(zoom);
+ } else {
+ svg.on('.zoom', null);
+ mapGroup.attr('transform', null);
+ }
+ }
+
+ // Calculate day/night terminator points
+ function calculateTerminator(): [number, number][] {
+ const now = new Date();
+ const dayOfYear = Math.floor(
+ (now.getTime() - new Date(now.getFullYear(), 0, 0).getTime()) / 86400000
+ );
+ const declination = -23.45 * Math.cos(((360 / 365) * (dayOfYear + 10) * Math.PI) / 180);
+ const hourAngle = (now.getUTCHours() + now.getUTCMinutes() / 60) * 15 - 180;
+
+ const terminatorPoints: [number, number][] = [];
+ for (let lat = -90; lat <= 90; lat += 2) {
+ const tanDec = Math.tan((declination * Math.PI) / 180);
+ const tanLat = Math.tan((lat * Math.PI) / 180);
+ let lon = -hourAngle + (Math.acos(-tanDec * tanLat) * 180) / Math.PI;
+ if (isNaN(lon)) lon = lat * declination > 0 ? -hourAngle + 180 : -hourAngle;
+ terminatorPoints.push([lon, lat]);
+ }
+ for (let lat = 90; lat >= -90; lat -= 2) {
+ const tanDec = Math.tan((declination * Math.PI) / 180);
+ const tanLat = Math.tan((lat * Math.PI) / 180);
+ let lon = -hourAngle - (Math.acos(-tanDec * tanLat) * 180) / Math.PI;
+ if (isNaN(lon)) lon = lat * declination > 0 ? -hourAngle - 180 : -hourAngle;
+ terminatorPoints.push([lon, lat]);
+ }
+ return terminatorPoints;
+ }
+
+ // Show tooltip using state (safe rendering)
+ function showTooltip(event: MouseEvent, title: string, color: string, lines: string[] = []): void {
+ if (!mapContainer) return;
+ const rect = mapContainer.getBoundingClientRect();
+ tooltipContent = { title, color, lines };
+ tooltipPosition = {
+ left: event.clientX - rect.left + 15,
+ top: event.clientY - rect.top - 10
+ };
+ tooltipVisible = true;
+ }
+
+ // Move tooltip
+ function moveTooltip(event: MouseEvent): void {
+ if (!mapContainer) return;
+ const rect = mapContainer.getBoundingClientRect();
+ tooltipPosition = {
+ left: event.clientX - rect.left + 15,
+ top: event.clientY - rect.top - 10
+ };
+ }
+
+ // Hide tooltip
+ function hideTooltip(): void {
+ tooltipVisible = false;
+ tooltipContent = null;
+ }
+
+ // Build enhanced tooltip with weather
+ async function showEnhancedTooltip(
+ event: MouseEvent,
+ _name: string,
+ lat: number,
+ lon: number,
+ desc: string,
+ color: string
+ ): Promise<void> {
+ const localTime = getLocalTime(lon);
+ const lines = [`🕐 Local: ${localTime}`];
+ showTooltip(event, desc, color, lines);
+
+ // Fetch weather asynchronously
+ const weather = await getWeather(lat, lon);
+ if (weather && tooltipVisible) {
+ tooltipContent = {
+ title: desc,
+ color,
+ lines: [
+ `🕐 Local: ${localTime}`,
+ `${weather.condition} ${weather.temp}°F, ${weather.wind}mph`
+ ]
+ };
+ }
+ }
+
+ // Initialize map
+ async function initMap(): Promise<void> {
+ const d3 = await import('d3');
+ const topojson = await import('topojson-client');
+
+ const svgEl = mapContainer.querySelector('svg');
+ if (!svgEl) return;
+
+ svg = d3.select(svgEl);
+ svg.attr('viewBox', `0 0 ${WIDTH} ${HEIGHT}`);
+
+ mapGroup = svg.append('g').attr('id', 'mapGroup');
+
+ // Setup zoom
+ zoom = d3
+ .zoom<SVGSVGElement, unknown>()
+ .scaleExtent([1, 6])
+ .on('zoom', (event) => {
+ mapGroup.attr('transform', event.transform.toString());
+ });
+
+ updateZoomBehavior();
+
+ // Setup projection
+ projection = d3
+ .geoEquirectangular()
+ .scale(130)
+ .center([0, 20])
+ .translate([WIDTH / 2, HEIGHT / 2 - 30]);
+
+ path = d3.geoPath().projection(projection);
+
+ // Load world data
+ try {
+ const response = await fetch(
+ 'https://cdn.jsdelivr.net/npm/world-atlas@2/countries-110m.json'
+ );
+ const world = await response.json();
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ const countries = topojson.feature(world, world.objects.countries as any) as unknown as GeoJSON.FeatureCollection;
+
+ // Draw countries
+ mapGroup
+ .selectAll('path.country')
+ .data(countries.features)
+ .enter()
+ .append('path')
+ .attr('class', 'country')
+ .attr('d', path as unknown as string)
+ .attr('fill', (d: GeoJSON.Feature) =>
+ SANCTIONED_COUNTRY_IDS.includes(+(d.id || 0)) ? '#2a1a1a' : '#0f3028'
+ )
+ .attr('stroke', (d: GeoJSON.Feature) =>
+ SANCTIONED_COUNTRY_IDS.includes(+(d.id || 0)) ? '#4a2020' : '#1a5040'
+ )
+ .attr('stroke-width', 0.5);
+
+ // Draw graticule
+ const graticule = d3.geoGraticule().step([30, 30]);
+ mapGroup
+ .append('path')
+ .datum(graticule)
+ .attr('d', path as unknown as string)
+ .attr('fill', 'none')
+ .attr('stroke', '#1a3830')
+ .attr('stroke-width', 0.3)
+ .attr('stroke-dasharray', '2,2');
+
+ // Draw ocean labels
+ OCEANS.forEach((o) => {
+ const [x, y] = projection([o.lon, o.lat]) || [0, 0];
+ if (x && y) {
+ mapGroup
+ .append('text')
+ .attr('x', x)
+ .attr('y', y)
+ .attr('fill', '#1a4a40')
+ .attr('font-size', '10px')
+ .attr('font-family', 'monospace')
+ .attr('text-anchor', 'middle')
+ .attr('opacity', 0.6)
+ .text(o.name);
+ }
+ });
+
+ // Draw day/night terminator
+ const terminatorPoints = calculateTerminator();
+ mapGroup
+ .append('path')
+ .datum({ type: 'Polygon', coordinates: [terminatorPoints] } as GeoJSON.Polygon)
+ .attr('d', path as unknown as string)
+ .attr('fill', 'rgba(0,0,0,0.3)')
+ .attr('stroke', 'none');
+
+ // Draw conflict zones
+ CONFLICT_ZONES.forEach((zone) => {
+ mapGroup
+ .append('path')
+ .datum({ type: 'Polygon', coordinates: [zone.coords] } as GeoJSON.Polygon)
+ .attr('d', path as unknown as string)
+ .attr('fill', zone.color)
+ .attr('fill-opacity', 0.15)
+ .attr('stroke', zone.color)
+ .attr('stroke-width', 0.5)
+ .attr('stroke-opacity', 0.4);
+ });
+
+ // Draw chokepoints
+ CHOKEPOINTS.forEach((cp) => {
+ const [x, y] = projection([cp.lon, cp.lat]) || [0, 0];
+ if (x && y) {
+ mapGroup
+ .append('rect')
+ .attr('x', x - 4)
+ .attr('y', y - 4)
+ .attr('width', 8)
+ .attr('height', 8)
+ .attr('fill', '#00aaff')
+ .attr('opacity', 0.8)
+ .attr('transform', `rotate(45,${x},${y})`);
+ mapGroup
+ .append('text')
+ .attr('x', x + 8)
+ .attr('y', y + 3)
+ .attr('fill', '#00aaff')
+ .attr('font-size', '7px')
+ .attr('font-family', 'monospace')
+ .text(cp.name);
+ mapGroup
+ .append('circle')
+ .attr('cx', x)
+ .attr('cy', y)
+ .attr('r', 10)
+ .attr('fill', 'transparent')
+ .attr('class', 'hotspot-hit')
+ .on('mouseenter', (event: MouseEvent) =>
+ showTooltip(event, `⬥ ${cp.desc}`, '#00aaff')
+ )
+ .on('mousemove', moveTooltip)
+ .on('mouseleave', hideTooltip);
+ }
+ });
+
+ // Draw cable landings
+ CABLE_LANDINGS.forEach((cl) => {
+ const [x, y] = projection([cl.lon, cl.lat]) || [0, 0];
+ if (x && y) {
+ mapGroup
+ .append('circle')
+ .attr('cx', x)
+ .attr('cy', y)
+ .attr('r', 3)
+ .attr('fill', 'none')
+ .attr('stroke', '#aa44ff')
+ .attr('stroke-width', 1.5);
+ mapGroup
+ .append('circle')
+ .attr('cx', x)
+ .attr('cy', y)
+ .attr('r', 10)
+ .attr('fill', 'transparent')
+ .attr('class', 'hotspot-hit')
+ .on('mouseenter', (event: MouseEvent) =>
+ showTooltip(event, `◎ ${cl.desc}`, '#aa44ff')
+ )
+ .on('mousemove', moveTooltip)
+ .on('mouseleave', hideTooltip);
+ }
+ });
+
+ // Draw nuclear sites
+ NUCLEAR_SITES.forEach((ns) => {
+ const [x, y] = projection([ns.lon, ns.lat]) || [0, 0];
+ if (x && y) {
+ mapGroup
+ .append('circle')
+ .attr('cx', x)
+ .attr('cy', y)
+ .attr('r', 2)
+ .attr('fill', '#ffff00');
+ mapGroup
+ .append('circle')
+ .attr('cx', x)
+ .attr('cy', y)
+ .attr('r', 5)
+ .attr('fill', 'none')
+ .attr('stroke', '#ffff00')
+ .attr('stroke-width', 1)
+ .attr('stroke-dasharray', '3,3');
+ mapGroup
+ .append('circle')
+ .attr('cx', x)
+ .attr('cy', y)
+ .attr('r', 10)
+ .attr('fill', 'transparent')
+ .attr('class', 'hotspot-hit')
+ .on('mouseenter', (event: MouseEvent) =>
+ showTooltip(event, `☢ ${ns.desc}`, '#ffff00')
+ )
+ .on('mousemove', moveTooltip)
+ .on('mouseleave', hideTooltip);
+ }
+ });
+
+ // Draw military bases
+ MILITARY_BASES.forEach((mb) => {
+ const [x, y] = projection([mb.lon, mb.lat]) || [0, 0];
+ if (x && y) {
+ const starPath = `M${x},${y - 5} L${x + 1.5},${y - 1.5} L${x + 5},${y - 1.5} L${x + 2.5},${y + 1} L${x + 3.5},${y + 5} L${x},${y + 2.5} L${x - 3.5},${y + 5} L${x - 2.5},${y + 1} L${x - 5},${y - 1.5} L${x - 1.5},${y - 1.5} Z`;
+ mapGroup.append('path').attr('d', starPath).attr('fill', '#ff00ff').attr('opacity', 0.8);
+ mapGroup
+ .append('circle')
+ .attr('cx', x)
+ .attr('cy', y)
+ .attr('r', 10)
+ .attr('fill', 'transparent')
+ .attr('class', 'hotspot-hit')
+ .on('mouseenter', (event: MouseEvent) =>
+ showTooltip(event, `★ ${mb.desc}`, '#ff00ff')
+ )
+ .on('mousemove', moveTooltip)
+ .on('mouseleave', hideTooltip);
+ }
+ });
+
+ // Draw hotspots
+ HOTSPOTS.forEach((h) => {
+ const [x, y] = projection([h.lon, h.lat]) || [0, 0];
+ if (x && y) {
+ const color = THREAT_COLORS[h.level];
+ // Pulsing circle
+ mapGroup
+ .append('circle')
+ .attr('cx', x)
+ .attr('cy', y)
+ .attr('r', 6)
+ .attr('fill', color)
+ .attr('fill-opacity', 0.3)
+ .attr('class', 'pulse');
+ // Inner dot
+ mapGroup
+ .append('circle')
+ .attr('cx', x)
+ .attr('cy', y)
+ .attr('r', 3)
+ .attr('fill', color);
+ // Label
+ mapGroup
+ .append('text')
+ .attr('x', x + 8)
+ .attr('y', y + 3)
+ .attr('fill', color)
+ .attr('font-size', '8px')
+ .attr('font-family', 'monospace')
+ .text(h.name);
+ // Hit area
+ mapGroup
+ .append('circle')
+ .attr('cx', x)
+ .attr('cy', y)
+ .attr('r', 12)
+ .attr('fill', 'transparent')
+ .attr('class', 'hotspot-hit')
+ .on('mouseenter', (event: MouseEvent) =>
+ showEnhancedTooltip(event, h.name, h.lat, h.lon, h.desc, color)
+ )
+ .on('mousemove', moveTooltip)
+ .on('mouseleave', hideTooltip);
+ }
+ });
+
+ // Draw custom monitors with locations
+ drawMonitors();
+ } catch (err) {
+ console.error('Failed to load map data:', err);
+ }
+ }
+
+ // Draw custom monitor locations
+ function drawMonitors(): void {
+ if (!mapGroup || !projection) return;
+
+ // Remove existing monitor markers
+ mapGroup.selectAll('.monitor-marker').remove();
+
+ monitors
+ .filter((m) => m.enabled && m.location)
+ .forEach((m) => {
+ if (!m.location) return;
+ const [x, y] = projection([m.location.lon, m.location.lat]) || [0, 0];
+ if (x && y) {
+ const color = m.color || '#00ffff';
+ mapGroup
+ .append('circle')
+ .attr('class', 'monitor-marker')
+ .attr('cx', x)
+ .attr('cy', y)
+ .attr('r', 5)
+ .attr('fill', color)
+ .attr('fill-opacity', 0.6)
+ .attr('stroke', color)
+ .attr('stroke-width', 2);
+ mapGroup
+ .append('text')
+ .attr('class', 'monitor-marker')
+ .attr('x', x + 8)
+ .attr('y', y + 3)
+ .attr('fill', color)
+ .attr('font-size', '8px')
+ .attr('font-family', 'monospace')
+ .text(m.name);
+ mapGroup
+ .append('circle')
+ .attr('class', 'monitor-marker')
+ .attr('cx', x)
+ .attr('cy', y)
+ .attr('r', 10)
+ .attr('fill', 'transparent')
+ .on('mouseenter', (event: MouseEvent) =>
+ showTooltip(event, `📡 ${m.name}`, color, [
+ m.location?.name || '',
+ m.keywords.join(', ')
+ ])
+ )
+ .on('mousemove', moveTooltip)
+ .on('mouseleave', hideTooltip);
+ }
+ });
+ }
+
+ // Zoom controls
+ function zoomIn(): void {
+ if (!svg || !zoom) return;
+ svg.transition().duration(300).call(zoom.scaleBy, 1.5);
+ }
+
+ function zoomOut(): void {
+ if (!svg || !zoom) return;
+ svg.transition().duration(300).call(zoom.scaleBy, 1 / 1.5);
+ }
+
+ function resetZoom(): void {
+ if (!svg || !zoom) return;
+ const d3 = (window as unknown as { d3: typeof import('d3') }).d3;
+ if (d3) {
+ svg.transition().duration(300).call(zoom.transform, d3.zoomIdentity);
+ }
+ }
+
+ // Reactively update monitors when they change
+ $effect(() => {
+ // Track monitors changes
+ const _monitorsRef = monitors;
+ if (_monitorsRef && mapGroup && projection) {
+ drawMonitors();
+ }
+ });
+
+ onMount(() => {
+ initMap();
+ window.addEventListener('resize', updateZoomBehavior);
+ });
+
+ onDestroy(() => {
+ window.removeEventListener('resize', updateZoomBehavior);
+ });
+</script>
+
+<Panel id="map" title="Global Situation" {loading} {error}>
+ <div class="map-container" bind:this={mapContainer}>
+ <svg class="map-svg"></svg>
+ {#if tooltipVisible && tooltipContent}
+ <div
+ class="map-tooltip"
+ style="left: {tooltipPosition.left}px; top: {tooltipPosition.top}px;"
+ >
+ <strong style="color: {tooltipContent.color}">{tooltipContent.title}</strong>
+ {#each tooltipContent.lines as line}
+ <br /><span class="tooltip-line">{line}</span>
+ {/each}
+ </div>
+ {/if}
+ <div class="zoom-controls">
+ <button class="zoom-btn" onclick={zoomIn} title="Zoom in">+</button>
+ <button class="zoom-btn" onclick={zoomOut} title="Zoom out">−</button>
+ <button class="zoom-btn" onclick={resetZoom} title="Reset">⟲</button>
+ </div>
+ <div class="map-legend">
+ <div class="legend-item">
+ <span class="legend-dot high"></span> High
+ </div>
+ <div class="legend-item">
+ <span class="legend-dot elevated"></span> Elevated
+ </div>
+ <div class="legend-item">
+ <span class="legend-dot low"></span> Low
+ </div>
+ </div>
+ </div>
+</Panel>
+
+<style>
+ .map-container {
+ position: relative;
+ width: 100%;
+ aspect-ratio: 2 / 1;
+ background: #0a0f0d;
+ border-radius: 4px;
+ overflow: hidden;
+ }
+
+ .map-svg {
+ width: 100%;
+ height: 100%;
+ }
+
+ .map-tooltip {
+ position: absolute;
+ background: rgba(10, 10, 10, 0.95);
+ border: 1px solid #333;
+ border-radius: 4px;
+ padding: 0.5rem;
+ font-size: 0.65rem;
+ color: #ddd;
+ max-width: 250px;
+ pointer-events: none;
+ z-index: 100;
+ }
+
+ .tooltip-line {
+ opacity: 0.7;
+ }
+
+ .zoom-controls {
+ position: absolute;
+ bottom: 0.5rem;
+ right: 0.5rem;
+ display: flex;
+ flex-direction: column;
+ gap: 0.25rem;
+ }
+
+ .zoom-btn {
+ width: 1.5rem;
+ height: 1.5rem;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ background: rgba(20, 20, 20, 0.9);
+ border: 1px solid #333;
+ border-radius: 4px;
+ color: #aaa;
+ font-size: 0.8rem;
+ cursor: pointer;
+ }
+
+ .zoom-btn:hover {
+ background: rgba(40, 40, 40, 0.9);
+ color: #fff;
+ }
+
+ .map-legend {
+ position: absolute;
+ top: 0.5rem;
+ right: 0.5rem;
+ display: flex;
+ flex-direction: column;
+ gap: 0.2rem;
+ background: rgba(10, 10, 10, 0.8);
+ padding: 0.3rem 0.5rem;
+ border-radius: 4px;
+ font-size: 0.55rem;
+ }
+
+ .legend-item {
+ display: flex;
+ align-items: center;
+ gap: 0.3rem;
+ color: #888;
+ }
+
+ .legend-dot {
+ width: 8px;
+ height: 8px;
+ border-radius: 50%;
+ }
+
+ .legend-dot.high {
+ background: #ff4444;
+ }
+
+ .legend-dot.elevated {
+ background: #ffcc00;
+ }
+
+ .legend-dot.low {
+ background: #00ff88;
+ }
+
+ /* Pulse animation for hotspots */
+ :global(.pulse) {
+ animation: pulse 2s ease-in-out infinite;
+ }
+
+ @keyframes pulse {
+ 0%,
+ 100% {
+ r: 6;
+ opacity: 0.3;
+ }
+ 50% {
+ r: 10;
+ opacity: 0.1;
+ }
+ }
+
+ :global(.hotspot-hit) {
+ cursor: pointer;
+ }
+
+ /* Hide zoom controls on mobile where touch zoom is available */
+ @media (max-width: 768px) {
+ .zoom-controls {
+ display: flex;
+ }
+ }
+</style>
diff --git a/src/lib/components/panels/MarketsPanel.svelte b/src/lib/components/panels/MarketsPanel.svelte
new file mode 100644
index 0000000..88c160c
--- /dev/null
+++ b/src/lib/components/panels/MarketsPanel.svelte
@@ -0,0 +1,35 @@
+<script lang="ts">
+ import { Panel, MarketItem } from '$lib/components/common';
+ import { indices } from '$lib/stores';
+
+ const items = $derived($indices.items);
+ const loading = $derived($indices.loading);
+ const error = $derived($indices.error);
+ const count = $derived(items.length);
+</script>
+
+<Panel id="markets" title="Markets" {count} {loading} {error}>
+ {#if items.length === 0 && !loading && !error}
+ <div class="empty-state">No market data available</div>
+ {:else}
+ <div class="markets-list">
+ {#each items as item (item.symbol)}
+ <MarketItem {item} />
+ {/each}
+ </div>
+ {/if}
+</Panel>
+
+<style>
+ .markets-list {
+ display: flex;
+ flex-direction: column;
+ }
+
+ .empty-state {
+ text-align: center;
+ color: var(--text-secondary);
+ font-size: 0.7rem;
+ padding: 1rem;
+ }
+</style>
diff --git a/src/lib/components/panels/MonitorsPanel.svelte b/src/lib/components/panels/MonitorsPanel.svelte
new file mode 100644
index 0000000..b20ff1f
--- /dev/null
+++ b/src/lib/components/panels/MonitorsPanel.svelte
@@ -0,0 +1,335 @@
+<script lang="ts">
+ import { Panel, Badge } from '$lib/components/common';
+ import { timeAgo } from '$lib/utils';
+ import type { CustomMonitor, NewsItem } from '$lib/types';
+ import type { MonitorMatch } from '$lib/stores/monitors';
+
+ interface Props {
+ monitors?: CustomMonitor[];
+ matches?: MonitorMatch[];
+ news?: NewsItem[];
+ loading?: boolean;
+ error?: string | null;
+ onCreateMonitor?: () => void;
+ onEditMonitor?: (monitor: CustomMonitor) => void;
+ onDeleteMonitor?: (id: string) => void;
+ onToggleMonitor?: (id: string) => void;
+ }
+
+ let {
+ monitors = [],
+ matches = [],
+ loading = false,
+ error = null,
+ onCreateMonitor,
+ onEditMonitor,
+ onDeleteMonitor,
+ onToggleMonitor
+ }: Props = $props();
+
+ const activeMonitors = $derived(monitors.filter((m) => m.enabled));
+ const count = $derived(matches.length);
+
+ function getMatchesForMonitor(monitorId: string): MonitorMatch[] {
+ return matches.filter((m) => m.monitor.id === monitorId).slice(0, 3);
+ }
+</script>
+
+<Panel id="monitors" title="Custom Monitors" {count} {loading} {error}>
+ <div class="monitors-content">
+ {#if monitors.length === 0 && !loading && !error}
+ <div class="empty-state">
+ <p>No monitors configured</p>
+ {#if onCreateMonitor}
+ <button class="create-btn" onclick={onCreateMonitor}>
+ + Create Monitor
+ </button>
+ {/if}
+ </div>
+ {:else}
+ <div class="monitors-header">
+ <span class="active-count">{activeMonitors.length} active</span>
+ {#if onCreateMonitor}
+ <button class="add-btn" onclick={onCreateMonitor}>+</button>
+ {/if}
+ </div>
+
+ <div class="monitors-list">
+ {#each monitors as monitor (monitor.id)}
+ <div class="monitor-item" class:disabled={!monitor.enabled}>
+ <div class="monitor-header">
+ <div class="monitor-info">
+ {#if monitor.color}
+ <span class="monitor-color" style="background: {monitor.color}"></span>
+ {/if}
+ <span class="monitor-name">{monitor.name}</span>
+ {#if monitor.matchCount > 0}
+ <Badge text={String(monitor.matchCount)} variant="info" />
+ {/if}
+ </div>
+ <div class="monitor-actions">
+ {#if onToggleMonitor}
+ <button
+ class="action-btn"
+ class:active={monitor.enabled}
+ onclick={() => onToggleMonitor?.(monitor.id)}
+ title={monitor.enabled ? 'Disable' : 'Enable'}
+ >
+ {monitor.enabled ? '●' : '○'}
+ </button>
+ {/if}
+ {#if onEditMonitor}
+ <button class="action-btn" onclick={() => onEditMonitor?.(monitor)} title="Edit">
+ ✎
+ </button>
+ {/if}
+ {#if onDeleteMonitor}
+ <button class="action-btn delete" onclick={() => onDeleteMonitor?.(monitor.id)} title="Delete">
+ ×
+ </button>
+ {/if}
+ </div>
+ </div>
+
+ <div class="monitor-keywords">
+ {#each monitor.keywords.slice(0, 5) as keyword}
+ <span class="keyword">{keyword}</span>
+ {/each}
+ {#if monitor.keywords.length > 5}
+ <span class="keyword more">+{monitor.keywords.length - 5}</span>
+ {/if}
+ </div>
+
+ {#if monitor.location}
+ <div class="monitor-location">
+ 📍 {monitor.location.name}
+ </div>
+ {/if}
+
+ {#if getMatchesForMonitor(monitor.id).length > 0}
+ <div class="monitor-matches">
+ {#each getMatchesForMonitor(monitor.id) as match}
+ <div class="match-item">
+ <a href={match.item.link} target="_blank" rel="noopener noreferrer" class="match-title">
+ {match.item.title.length > 80
+ ? match.item.title.substring(0, 80) + '...'
+ : match.item.title}
+ </a>
+ <div class="match-meta">
+ <span class="match-keyword">"{match.matchedKeywords.join(', ')}"</span>
+ <span class="match-time">{timeAgo(match.item.timestamp)}</span>
+ </div>
+ </div>
+ {/each}
+ </div>
+ {/if}
+ </div>
+ {/each}
+ </div>
+ {/if}
+ </div>
+</Panel>
+
+<style>
+ .monitors-content {
+ display: flex;
+ flex-direction: column;
+ gap: 0.5rem;
+ }
+
+ .monitors-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding-bottom: 0.4rem;
+ border-bottom: 1px solid var(--border);
+ }
+
+ .active-count {
+ font-size: 0.55rem;
+ color: var(--text-secondary);
+ }
+
+ .add-btn {
+ width: 1.2rem;
+ height: 1.2rem;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ background: rgba(255, 255, 255, 0.05);
+ border: 1px solid var(--border);
+ border-radius: 4px;
+ color: var(--text-secondary);
+ font-size: 0.8rem;
+ cursor: pointer;
+ transition: all 0.15s ease;
+ }
+
+ .add-btn:hover {
+ background: rgba(255, 255, 255, 0.1);
+ color: var(--accent);
+ }
+
+ .monitors-list {
+ display: flex;
+ flex-direction: column;
+ gap: 0.5rem;
+ }
+
+ .monitor-item {
+ padding: 0.5rem;
+ background: rgba(255, 255, 255, 0.02);
+ border: 1px solid var(--border);
+ border-radius: 4px;
+ }
+
+ .monitor-item.disabled {
+ opacity: 0.5;
+ }
+
+ .monitor-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-bottom: 0.3rem;
+ }
+
+ .monitor-info {
+ display: flex;
+ align-items: center;
+ gap: 0.3rem;
+ }
+
+ .monitor-color {
+ width: 8px;
+ height: 8px;
+ border-radius: 50%;
+ }
+
+ .monitor-name {
+ font-size: 0.65rem;
+ font-weight: 600;
+ color: var(--text-primary);
+ }
+
+ .monitor-actions {
+ display: flex;
+ gap: 0.2rem;
+ }
+
+ .action-btn {
+ width: 1rem;
+ height: 1rem;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ background: transparent;
+ border: none;
+ color: var(--text-muted);
+ font-size: 0.65rem;
+ cursor: pointer;
+ border-radius: 2px;
+ }
+
+ .action-btn:hover {
+ background: rgba(255, 255, 255, 0.1);
+ color: var(--text-primary);
+ }
+
+ .action-btn.active {
+ color: var(--success);
+ }
+
+ .action-btn.delete:hover {
+ color: var(--danger);
+ }
+
+ .monitor-keywords {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 0.2rem;
+ margin-bottom: 0.3rem;
+ }
+
+ .keyword {
+ font-size: 0.5rem;
+ padding: 0.1rem 0.3rem;
+ background: rgba(255, 255, 255, 0.05);
+ border-radius: 2px;
+ color: var(--text-secondary);
+ }
+
+ .keyword.more {
+ color: var(--text-muted);
+ }
+
+ .monitor-location {
+ font-size: 0.5rem;
+ color: var(--text-muted);
+ margin-bottom: 0.3rem;
+ }
+
+ .monitor-matches {
+ border-top: 1px solid var(--border);
+ padding-top: 0.3rem;
+ margin-top: 0.2rem;
+ }
+
+ .match-item {
+ padding: 0.2rem 0;
+ }
+
+ .match-title {
+ display: block;
+ font-size: 0.55rem;
+ color: var(--text-primary);
+ text-decoration: none;
+ line-height: 1.3;
+ }
+
+ .match-title:hover {
+ color: var(--accent);
+ }
+
+ .match-meta {
+ display: flex;
+ justify-content: space-between;
+ margin-top: 0.1rem;
+ }
+
+ .match-keyword {
+ font-size: 0.5rem;
+ color: var(--warning);
+ }
+
+ .match-time {
+ font-size: 0.5rem;
+ color: var(--text-muted);
+ }
+
+ .empty-state {
+ text-align: center;
+ padding: 1rem;
+ }
+
+ .empty-state p {
+ color: var(--text-secondary);
+ font-size: 0.7rem;
+ margin-bottom: 0.5rem;
+ }
+
+ .create-btn {
+ padding: 0.4rem 0.8rem;
+ background: rgba(255, 255, 255, 0.05);
+ border: 1px solid var(--border);
+ border-radius: 4px;
+ color: var(--text-primary);
+ font-size: 0.6rem;
+ cursor: pointer;
+ }
+
+ .create-btn:hover {
+ background: rgba(255, 255, 255, 0.1);
+ border-color: var(--accent);
+ }
+</style>
diff --git a/src/lib/components/panels/NarrativePanel.svelte b/src/lib/components/panels/NarrativePanel.svelte
new file mode 100644
index 0000000..3334505
--- /dev/null
+++ b/src/lib/components/panels/NarrativePanel.svelte
@@ -0,0 +1,290 @@
+<script lang="ts">
+ import { Panel, Badge } from '$lib/components/common';
+ import { analyzeNarratives } from '$lib/analysis/narrative';
+ import type { NewsItem } from '$lib/types';
+
+ interface Props {
+ news?: NewsItem[];
+ loading?: boolean;
+ error?: string | null;
+ }
+
+ let { news = [], loading = false, error = null }: Props = $props();
+
+ const analysis = $derived(analyzeNarratives(news));
+
+ function getStatusVariant(status: string): 'default' | 'warning' | 'danger' | 'success' | 'info' {
+ switch (status) {
+ case 'viral':
+ return 'danger';
+ case 'spreading':
+ return 'warning';
+ case 'emerging':
+ return 'info';
+ case 'crossing':
+ return 'warning';
+ default:
+ return 'default';
+ }
+ }
+
+ function getSeverityVariant(
+ severity: string
+ ): 'default' | 'warning' | 'danger' | 'success' | 'info' {
+ switch (severity) {
+ case 'high':
+ return 'danger';
+ case 'medium':
+ return 'warning';
+ default:
+ return 'default';
+ }
+ }
+</script>
+
+<Panel id="narrative" title="Narrative Tracker" {loading} {error}>
+ {#if news.length === 0 && !loading && !error}
+ <div class="empty-state">Insufficient data for narrative analysis</div>
+ {:else if analysis}
+ <div class="narrative-content">
+ {#if analysis.emergingFringe.length > 0}
+ <div class="section">
+ <div class="section-title">Emerging Fringe</div>
+ {#each analysis.emergingFringe.slice(0, 4) as narrative}
+ <div class="narrative-item">
+ <div class="narrative-header">
+ <span class="narrative-name">{narrative.name}</span>
+ <Badge
+ text={narrative.status.toUpperCase()}
+ variant={getStatusVariant(narrative.status)}
+ />
+ </div>
+ <div class="narrative-meta">
+ <span class="mention-count">{narrative.count} mentions</span>
+ </div>
+ {#if narrative.sources.length > 0}
+ <div class="narrative-sources">
+ {narrative.sources.slice(0, 3).join(' · ')}
+ </div>
+ {/if}
+ </div>
+ {/each}
+ </div>
+ {/if}
+
+ {#if analysis.fringeToMainstream.length > 0}
+ <div class="section">
+ <div class="section-title">Fringe → Mainstream Crossovers</div>
+ {#each analysis.fringeToMainstream.slice(0, 3) as crossover}
+ <div class="crossover-item">
+ <div class="crossover-narrative">{crossover.name}</div>
+ <div class="crossover-path">
+ <span class="from">Fringe ({crossover.fringeCount})</span>
+ <span class="arrow">→</span>
+ <span class="to">Mainstream ({crossover.mainstreamCount})</span>
+ </div>
+ <div class="crossover-level">
+ Crossover level: {Math.round(crossover.crossoverLevel * 100)}%
+ </div>
+ </div>
+ {/each}
+ </div>
+ {/if}
+
+ {#if analysis.narrativeWatch.length > 0}
+ <div class="section">
+ <div class="section-title">Narrative Watch</div>
+ <div class="themes-grid">
+ {#each analysis.narrativeWatch.slice(0, 6) as narrative}
+ <div class="theme-tag">
+ {narrative.name}
+ <span class="theme-count">{narrative.count}</span>
+ </div>
+ {/each}
+ </div>
+ </div>
+ {/if}
+
+ {#if analysis.disinfoSignals.length > 0}
+ <div class="section">
+ <div class="section-title">Disinfo Signals</div>
+ {#each analysis.disinfoSignals.slice(0, 3) as signal}
+ <div class="disinfo-item">
+ <div class="disinfo-header">
+ <span class="disinfo-name">{signal.name}</span>
+ <Badge
+ text={signal.severity.toUpperCase()}
+ variant={getSeverityVariant(signal.severity)}
+ />
+ </div>
+ <div class="disinfo-meta">{signal.count} mentions</div>
+ </div>
+ {/each}
+ </div>
+ {/if}
+
+ {#if analysis.emergingFringe.length === 0 && analysis.fringeToMainstream.length === 0}
+ <div class="empty-state">No significant narratives detected</div>
+ {/if}
+ </div>
+ {:else}
+ <div class="empty-state">No significant narratives detected</div>
+ {/if}
+</Panel>
+
+<style>
+ .narrative-content {
+ display: flex;
+ flex-direction: column;
+ gap: 0.75rem;
+ }
+
+ .section {
+ padding-bottom: 0.5rem;
+ border-bottom: 1px solid var(--border);
+ }
+
+ .section:last-child {
+ border-bottom: none;
+ padding-bottom: 0;
+ }
+
+ .section-title {
+ font-size: 0.6rem;
+ font-weight: 600;
+ color: var(--accent);
+ text-transform: uppercase;
+ letter-spacing: 0.05em;
+ margin-bottom: 0.4rem;
+ }
+
+ .narrative-item {
+ padding: 0.4rem 0;
+ border-bottom: 1px solid var(--border);
+ }
+
+ .narrative-item:last-child {
+ border-bottom: none;
+ }
+
+ .narrative-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-bottom: 0.2rem;
+ }
+
+ .narrative-name {
+ font-size: 0.65rem;
+ font-weight: 500;
+ color: var(--text-primary);
+ }
+
+ .narrative-meta {
+ display: flex;
+ gap: 0.5rem;
+ align-items: center;
+ margin-bottom: 0.15rem;
+ }
+
+ .mention-count {
+ font-size: 0.55rem;
+ color: var(--text-secondary);
+ }
+
+ .narrative-sources {
+ font-size: 0.5rem;
+ color: var(--text-muted);
+ }
+
+ .crossover-item {
+ padding: 0.35rem 0;
+ border-left: 2px solid var(--warning);
+ padding-left: 0.5rem;
+ margin: 0.25rem 0;
+ }
+
+ .crossover-narrative {
+ font-size: 0.6rem;
+ font-weight: 500;
+ color: var(--text-primary);
+ }
+
+ .crossover-path {
+ display: flex;
+ align-items: center;
+ gap: 0.3rem;
+ font-size: 0.55rem;
+ margin: 0.15rem 0;
+ }
+
+ .crossover-path .from {
+ color: var(--text-secondary);
+ }
+
+ .crossover-path .arrow {
+ color: var(--warning);
+ }
+
+ .crossover-path .to {
+ color: var(--success);
+ }
+
+ .crossover-level {
+ font-size: 0.5rem;
+ color: var(--text-muted);
+ }
+
+ .themes-grid {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 0.3rem;
+ }
+
+ .theme-tag {
+ display: inline-flex;
+ align-items: center;
+ gap: 0.25rem;
+ padding: 0.2rem 0.4rem;
+ background: rgba(255, 255, 255, 0.05);
+ border-radius: 4px;
+ font-size: 0.55rem;
+ color: var(--text-secondary);
+ }
+
+ .theme-count {
+ font-size: 0.5rem;
+ color: var(--text-muted);
+ background: rgba(255, 255, 255, 0.1);
+ padding: 0.1rem 0.2rem;
+ border-radius: 2px;
+ }
+
+ .disinfo-item {
+ padding: 0.3rem 0;
+ }
+
+ .disinfo-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ }
+
+ .disinfo-name {
+ font-size: 0.6rem;
+ color: var(--text-primary);
+ }
+
+ .disinfo-meta {
+ font-size: 0.5rem;
+ color: var(--text-muted);
+ margin-top: 0.1rem;
+ }
+
+ .empty-state {
+ text-align: center;
+ color: var(--text-secondary);
+ font-size: 0.7rem;
+ padding: 1rem;
+ }
+</style>
diff --git a/src/lib/components/panels/NewsPanel.svelte b/src/lib/components/panels/NewsPanel.svelte
new file mode 100644
index 0000000..020c355
--- /dev/null
+++ b/src/lib/components/panels/NewsPanel.svelte
@@ -0,0 +1,63 @@
+<script lang="ts">
+ import { Panel, NewsItem } from '$lib/components/common';
+ import type { NewsCategory } from '$lib/types';
+ import type { PanelId } from '$lib/config';
+ import {
+ politicsNews,
+ techNews,
+ financeNews,
+ govNews,
+ aiNews,
+ intelNews
+ } from '$lib/stores';
+
+ interface Props {
+ category: NewsCategory;
+ panelId: PanelId;
+ title: string;
+ }
+
+ let { category, panelId, title }: Props = $props();
+
+ // Get the appropriate derived store based on category
+ const categoryStores = {
+ politics: politicsNews,
+ tech: techNews,
+ finance: financeNews,
+ gov: govNews,
+ ai: aiNews,
+ intel: intelNews
+ };
+
+ const categoryStore = $derived(categoryStores[category]);
+ const items = $derived($categoryStore.items);
+ const loading = $derived($categoryStore.loading);
+ const error = $derived($categoryStore.error);
+ const count = $derived(items.length);
+</script>
+
+<Panel id={panelId} {title} {count} {loading} {error}>
+ {#if items.length === 0 && !loading && !error}
+ <div class="empty-state">No news available</div>
+ {:else}
+ <div class="news-list">
+ {#each items.slice(0, 15) as item (item.id)}
+ <NewsItem {item} />
+ {/each}
+ </div>
+ {/if}
+</Panel>
+
+<style>
+ .news-list {
+ display: flex;
+ flex-direction: column;
+ }
+
+ .empty-state {
+ text-align: center;
+ color: var(--text-secondary);
+ font-size: 0.7rem;
+ padding: 1rem;
+ }
+</style>
diff --git a/src/lib/components/panels/PolymarketPanel.svelte b/src/lib/components/panels/PolymarketPanel.svelte
new file mode 100644
index 0000000..fdace27
--- /dev/null
+++ b/src/lib/components/panels/PolymarketPanel.svelte
@@ -0,0 +1,103 @@
+<script lang="ts">
+ import { Panel } from '$lib/components/common';
+
+ interface Prediction {
+ id: string;
+ question: string;
+ yes: number;
+ volume: number | string;
+ url?: string;
+ }
+
+ interface Props {
+ predictions?: Prediction[];
+ loading?: boolean;
+ error?: string | null;
+ }
+
+ let { predictions = [], loading = false, error = null }: Props = $props();
+
+ const count = $derived(predictions.length);
+
+ function formatVolume(v: number | string): string {
+ if (typeof v === 'string') return '$' + v;
+ if (!v) return '$0';
+ if (v >= 1e6) return '$' + (v / 1e6).toFixed(1) + 'M';
+ if (v >= 1e3) return '$' + (v / 1e3).toFixed(0) + 'K';
+ return '$' + v.toFixed(0);
+ }
+</script>
+
+<Panel id="polymarket" title="Polymarket" {count} {loading} {error}>
+ {#if predictions.length === 0 && !loading && !error}
+ <div class="empty-state">No predictions available</div>
+ {:else}
+ <div class="predictions-list">
+ {#each predictions as pred (pred.id)}
+ <div class="prediction-item">
+ <div class="prediction-info">
+ <div class="prediction-question">{pred.question}</div>
+ <div class="prediction-volume">Vol: {formatVolume(pred.volume)}</div>
+ </div>
+ <div class="prediction-odds">
+ <span class="prediction-yes">{pred.yes}%</span>
+ </div>
+ </div>
+ {/each}
+ </div>
+ {/if}
+</Panel>
+
+<style>
+ .predictions-list {
+ display: flex;
+ flex-direction: column;
+ }
+
+ .prediction-item {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: 0.5rem 0;
+ border-bottom: 1px solid var(--border);
+ }
+
+ .prediction-item:last-child {
+ border-bottom: none;
+ }
+
+ .prediction-info {
+ flex: 1;
+ min-width: 0;
+ }
+
+ .prediction-question {
+ font-size: 0.65rem;
+ color: var(--text-primary);
+ line-height: 1.3;
+ margin-bottom: 0.2rem;
+ }
+
+ .prediction-volume {
+ font-size: 0.55rem;
+ color: var(--text-muted);
+ }
+
+ .prediction-odds {
+ margin-left: 0.5rem;
+ }
+
+ .prediction-yes {
+ font-size: 0.8rem;
+ font-weight: 700;
+ color: var(--success);
+ font-variant-numeric: tabular-nums;
+ }
+
+ .empty-state {
+ text-align: center;
+ color: var(--text-secondary);
+ font-size: 0.7rem;
+ padding: 1rem;
+ }
+</style>
diff --git a/src/lib/components/panels/PrinterPanel.svelte b/src/lib/components/panels/PrinterPanel.svelte
new file mode 100644
index 0000000..900bbfa
--- /dev/null
+++ b/src/lib/components/panels/PrinterPanel.svelte
@@ -0,0 +1,146 @@
+<script lang="ts">
+ import { Panel } from '$lib/components/common';
+
+ interface Props {
+ data?: {
+ value: number;
+ change: number;
+ changePercent: number;
+ percentOfMax: number;
+ } | null;
+ loading?: boolean;
+ error?: string | null;
+ }
+
+ let { data = null, loading = false, error = null }: Props = $props();
+
+ const isExpanding = $derived(data && data.change > 0);
+ const status = $derived(isExpanding ? 'PRINTER ON' : 'PRINTER OFF');
+ const statusClass = $derived(isExpanding ? 'critical' : 'monitoring');
+</script>
+
+<Panel id="printer" title="Money Printer" {status} {statusClass} {loading} {error}>
+ {#if !data && !loading && !error}
+ <div class="empty-state">No Fed data available</div>
+ {:else if data}
+ <div class="printer-gauge">
+ <div class="printer-label">Federal Reserve Balance Sheet</div>
+ <div class="printer-value">
+ {data.value.toFixed(2)}<span class="printer-unit">T USD</span>
+ </div>
+ <div class="printer-change" class:up={isExpanding} class:down={!isExpanding}>
+ {data.change >= 0 ? '+' : ''}{(data.change * 1000).toFixed(0)}B ({data.changePercent >= 0
+ ? '+'
+ : ''}{data.changePercent.toFixed(2)}%) WoW
+ </div>
+ <div class="printer-bar">
+ <div class="printer-fill" style="width: {Math.min(data.percentOfMax, 100)}%"></div>
+ </div>
+ <div class="printer-status">
+ <span class="printer-indicator" class:on={isExpanding} class:off={!isExpanding}></span>
+ {status}
+ </div>
+ </div>
+ {/if}
+</Panel>
+
+<style>
+ .printer-gauge {
+ text-align: center;
+ padding: 0.5rem;
+ }
+
+ .printer-label {
+ font-size: 0.55rem;
+ color: var(--text-muted);
+ text-transform: uppercase;
+ letter-spacing: 0.05em;
+ margin-bottom: 0.5rem;
+ }
+
+ .printer-value {
+ font-size: 1.5rem;
+ font-weight: 700;
+ color: var(--text-primary);
+ font-variant-numeric: tabular-nums;
+ }
+
+ .printer-unit {
+ font-size: 0.7rem;
+ font-weight: 400;
+ color: var(--text-secondary);
+ margin-left: 0.25rem;
+ }
+
+ .printer-change {
+ font-size: 0.65rem;
+ font-weight: 500;
+ margin: 0.25rem 0 0.75rem;
+ }
+
+ .printer-change.up {
+ color: var(--success);
+ }
+
+ .printer-change.down {
+ color: var(--danger);
+ }
+
+ .printer-bar {
+ height: 8px;
+ background: var(--border);
+ border-radius: 4px;
+ overflow: hidden;
+ margin-bottom: 0.75rem;
+ }
+
+ .printer-fill {
+ height: 100%;
+ background: linear-gradient(90deg, var(--success), var(--accent));
+ border-radius: 4px;
+ transition: width 0.3s ease;
+ }
+
+ .printer-status {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ gap: 0.5rem;
+ font-size: 0.7rem;
+ font-weight: 600;
+ color: var(--text-secondary);
+ }
+
+ .printer-indicator {
+ width: 8px;
+ height: 8px;
+ border-radius: 50%;
+ }
+
+ .printer-indicator.on {
+ background: var(--success);
+ box-shadow: 0 0 8px var(--success);
+ animation: pulse 1.5s ease-in-out infinite;
+ }
+
+ .printer-indicator.off {
+ background: var(--danger);
+ }
+
+ @keyframes pulse {
+ 0%,
+ 100% {
+ opacity: 1;
+ }
+ 50% {
+ opacity: 0.5;
+ }
+ }
+
+ .empty-state {
+ text-align: center;
+ color: var(--text-secondary);
+ font-size: 0.7rem;
+ padding: 1rem;
+ }
+</style>
diff --git a/src/lib/components/panels/SituationPanel.svelte b/src/lib/components/panels/SituationPanel.svelte
new file mode 100644
index 0000000..4280a65
--- /dev/null
+++ b/src/lib/components/panels/SituationPanel.svelte
@@ -0,0 +1,142 @@
+<script lang="ts">
+ import { Panel } from '$lib/components/common';
+ import { timeAgo } from '$lib/utils';
+ import type { PanelId } from '$lib/config';
+ import type { NewsItem } from '$lib/types';
+
+ interface SituationConfig {
+ title: string;
+ subtitle: string;
+ criticalKeywords?: string[];
+ }
+
+ interface Props {
+ panelId: PanelId;
+ config: SituationConfig;
+ news?: NewsItem[];
+ loading?: boolean;
+ error?: string | null;
+ }
+
+ let { panelId, config, news = [], loading = false, error = null }: Props = $props();
+
+ // Calculate threat level based on news
+ const threatLevel = $derived(() => {
+ if (news.length === 0) return { level: 'monitoring', text: 'MONITORING' };
+
+ const now = Date.now();
+ const recentNews = news.filter((n) => {
+ const hoursSince = (now - n.timestamp) / (1000 * 60 * 60);
+ return hoursSince < 24;
+ });
+
+ const criticalKeywords = config.criticalKeywords || [];
+ const hasCritical = news.some((n) =>
+ criticalKeywords.some((k) => n.title.toLowerCase().includes(k))
+ );
+
+ if (hasCritical || recentNews.length >= 3) {
+ return { level: 'critical', text: 'CRITICAL' };
+ }
+ if (recentNews.length >= 1) {
+ return { level: 'elevated', text: 'ELEVATED' };
+ }
+ return { level: 'monitoring', text: 'MONITORING' };
+ });
+</script>
+
+<Panel
+ id={panelId}
+ title={config.title}
+ status={threatLevel().text}
+ statusClass={threatLevel().level}
+ {loading}
+ {error}
+>
+ <div class="situation-content">
+ <div class="situation-header">
+ <div class="situation-title">{config.title}</div>
+ <div class="situation-subtitle">{config.subtitle}</div>
+ </div>
+
+ {#if news.length === 0 && !loading && !error}
+ <div class="empty-state">No recent news</div>
+ {:else}
+ <div class="situation-news">
+ {#each news.slice(0, 8) as item (item.id)}
+ <div class="situation-item">
+ <a href={item.link} target="_blank" rel="noopener noreferrer" class="headline">
+ {item.title}
+ </a>
+ <div class="meta">{item.source} · {timeAgo(item.timestamp)}</div>
+ </div>
+ {/each}
+ </div>
+ {/if}
+ </div>
+</Panel>
+
+<style>
+ .situation-content {
+ display: flex;
+ flex-direction: column;
+ gap: 0.5rem;
+ }
+
+ .situation-header {
+ text-align: center;
+ padding-bottom: 0.5rem;
+ border-bottom: 1px solid var(--border);
+ }
+
+ .situation-title {
+ font-size: 0.8rem;
+ font-weight: 600;
+ color: var(--text-primary);
+ }
+
+ .situation-subtitle {
+ font-size: 0.6rem;
+ color: var(--text-secondary);
+ margin-top: 0.1rem;
+ }
+
+ .situation-news {
+ display: flex;
+ flex-direction: column;
+ }
+
+ .situation-item {
+ padding: 0.4rem 0;
+ border-bottom: 1px solid var(--border);
+ }
+
+ .situation-item:last-child {
+ border-bottom: none;
+ }
+
+ .headline {
+ display: block;
+ font-size: 0.65rem;
+ color: var(--text-primary);
+ text-decoration: none;
+ line-height: 1.35;
+ }
+
+ .headline:hover {
+ color: var(--accent);
+ }
+
+ .meta {
+ font-size: 0.55rem;
+ color: var(--text-muted);
+ margin-top: 0.2rem;
+ }
+
+ .empty-state {
+ text-align: center;
+ color: var(--text-secondary);
+ font-size: 0.7rem;
+ padding: 1rem;
+ }
+</style>
diff --git a/src/lib/components/panels/WhalePanel.svelte b/src/lib/components/panels/WhalePanel.svelte
new file mode 100644
index 0000000..59dc94e
--- /dev/null
+++ b/src/lib/components/panels/WhalePanel.svelte
@@ -0,0 +1,116 @@
+<script lang="ts">
+ import { Panel } from '$lib/components/common';
+
+ interface WhaleTransaction {
+ coin: string;
+ amount: number;
+ usd: number;
+ hash: string;
+ }
+
+ interface Props {
+ whales?: WhaleTransaction[];
+ loading?: boolean;
+ error?: string | null;
+ }
+
+ let { whales = [], loading = false, error = null }: Props = $props();
+
+ const count = $derived(whales.length);
+
+ function formatAmount(amt: number): string {
+ return amt >= 1000 ? (amt / 1000).toFixed(1) + 'K' : amt.toFixed(2);
+ }
+
+ function formatUSD(usd: number): string {
+ if (usd >= 1e9) return '$' + (usd / 1e9).toFixed(1) + 'B';
+ if (usd >= 1e6) return '$' + (usd / 1e6).toFixed(1) + 'M';
+ return '$' + (usd / 1e3).toFixed(0) + 'K';
+ }
+</script>
+
+<Panel id="whales" title="Whale Watch" {count} {loading} {error}>
+ {#if whales.length === 0 && !loading && !error}
+ <div class="empty-state">No whale transactions detected</div>
+ {:else}
+ <div class="whale-list">
+ {#each whales as whale, i (whale.hash + i)}
+ <div class="whale-item">
+ <div class="whale-header">
+ <span class="whale-coin">{whale.coin}</span>
+ <span class="whale-amount">{formatAmount(whale.amount)} {whale.coin}</span>
+ </div>
+ <div class="whale-flow">
+ <span class="whale-usd">{formatUSD(whale.usd)}</span>
+ <span class="arrow">→</span>
+ <span class="whale-hash">{whale.hash}</span>
+ </div>
+ </div>
+ {/each}
+ </div>
+ {/if}
+</Panel>
+
+<style>
+ .whale-list {
+ display: flex;
+ flex-direction: column;
+ }
+
+ .whale-item {
+ padding: 0.5rem 0;
+ border-bottom: 1px solid var(--border);
+ }
+
+ .whale-item:last-child {
+ border-bottom: none;
+ }
+
+ .whale-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-bottom: 0.25rem;
+ }
+
+ .whale-coin {
+ font-size: 0.7rem;
+ font-weight: 600;
+ color: var(--accent);
+ }
+
+ .whale-amount {
+ font-size: 0.65rem;
+ color: var(--text-primary);
+ font-variant-numeric: tabular-nums;
+ }
+
+ .whale-flow {
+ display: flex;
+ align-items: center;
+ gap: 0.5rem;
+ font-size: 0.6rem;
+ }
+
+ .whale-usd {
+ color: var(--success);
+ font-weight: 500;
+ }
+
+ .arrow {
+ color: var(--text-muted);
+ }
+
+ .whale-hash {
+ color: var(--text-secondary);
+ font-family: monospace;
+ font-size: 0.55rem;
+ }
+
+ .empty-state {
+ text-align: center;
+ color: var(--text-secondary);
+ font-size: 0.7rem;
+ padding: 1rem;
+ }
+</style>
diff --git a/src/lib/components/panels/index.ts b/src/lib/components/panels/index.ts
new file mode 100644
index 0000000..355a792
--- /dev/null
+++ b/src/lib/components/panels/index.ts
@@ -0,0 +1,18 @@
+// Panel components barrel export
+export { default as NewsPanel } from './NewsPanel.svelte';
+export { default as MarketsPanel } from './MarketsPanel.svelte';
+export { default as HeatmapPanel } from './HeatmapPanel.svelte';
+export { default as CommoditiesPanel } from './CommoditiesPanel.svelte';
+export { default as CryptoPanel } from './CryptoPanel.svelte';
+export { default as MainCharPanel } from './MainCharPanel.svelte';
+export { default as PrinterPanel } from './PrinterPanel.svelte';
+export { default as PolymarketPanel } from './PolymarketPanel.svelte';
+export { default as WhalePanel } from './WhalePanel.svelte';
+export { default as ContractsPanel } from './ContractsPanel.svelte';
+export { default as LayoffsPanel } from './LayoffsPanel.svelte';
+export { default as IntelPanel } from './IntelPanel.svelte';
+export { default as SituationPanel } from './SituationPanel.svelte';
+export { default as CorrelationPanel } from './CorrelationPanel.svelte';
+export { default as NarrativePanel } from './NarrativePanel.svelte';
+export { default as MonitorsPanel } from './MonitorsPanel.svelte';
+export { default as MapPanel } from './MapPanel.svelte';
diff --git a/src/lib/config/index.ts b/src/lib/config/index.ts
index 05cb849..9ad634c 100644
--- a/src/lib/config/index.ts
+++ b/src/lib/config/index.ts
@@ -48,3 +48,24 @@ export {
type SourceTypes,
type PersonPattern
} from './analysis';
+
+// Map configuration
+export {
+ HOTSPOTS,
+ CONFLICT_ZONES,
+ CHOKEPOINTS,
+ CABLE_LANDINGS,
+ NUCLEAR_SITES,
+ MILITARY_BASES,
+ OCEANS,
+ SANCTIONED_COUNTRY_IDS,
+ THREAT_COLORS,
+ WEATHER_CODES,
+ type Hotspot,
+ type ConflictZone,
+ type Chokepoint,
+ type CableLanding,
+ type NuclearSite,
+ type MilitaryBase,
+ type Ocean
+} from './map';
diff --git a/src/lib/config/map.ts b/src/lib/config/map.ts
new file mode 100644
index 0000000..620cd1f
--- /dev/null
+++ b/src/lib/config/map.ts
@@ -0,0 +1,380 @@
+// Map configuration - hotspots, conflict zones, and strategic locations
+
+export interface Hotspot {
+ name: string;
+ lat: number;
+ lon: number;
+ level: 'high' | 'elevated' | 'low';
+ desc: string;
+}
+
+export interface ConflictZone {
+ name: string;
+ coords: [number, number][];
+ color: string;
+}
+
+export interface Chokepoint {
+ name: string;
+ lat: number;
+ lon: number;
+ desc: string;
+}
+
+export interface CableLanding {
+ name: string;
+ lat: number;
+ lon: number;
+ desc: string;
+}
+
+export interface NuclearSite {
+ name: string;
+ lat: number;
+ lon: number;
+ desc: string;
+}
+
+export interface MilitaryBase {
+ name: string;
+ lat: number;
+ lon: number;
+ desc: string;
+}
+
+export interface Ocean {
+ name: string;
+ lat: number;
+ lon: number;
+}
+
+export const THREAT_COLORS = {
+ high: '#ff4444',
+ elevated: '#ffcc00',
+ low: '#00ff88'
+} as const;
+
+export const SANCTIONED_COUNTRY_IDS = [
+ 364, // Iran
+ 408, // North Korea
+ 760, // Syria
+ 862, // Venezuela
+ 112, // Belarus
+ 643, // Russia
+ 728, // South Sudan
+ 729 // Sudan
+];
+
+export const HOTSPOTS: Hotspot[] = [
+ {
+ name: 'DC',
+ lat: 38.9,
+ lon: -77.0,
+ level: 'low',
+ desc: 'Washington DC — US political center, White House, Pentagon, Capitol'
+ },
+ {
+ name: 'Moscow',
+ lat: 55.75,
+ lon: 37.6,
+ level: 'elevated',
+ desc: 'Moscow — Kremlin, Russian military command, sanctions hub'
+ },
+ {
+ name: 'Beijing',
+ lat: 39.9,
+ lon: 116.4,
+ level: 'elevated',
+ desc: 'Beijing — CCP headquarters, US-China tensions, tech rivalry'
+ },
+ {
+ name: 'Kyiv',
+ lat: 50.45,
+ lon: 30.5,
+ level: 'high',
+ desc: 'Kyiv — Active conflict zone, Russian invasion ongoing'
+ },
+ {
+ name: 'Taipei',
+ lat: 25.03,
+ lon: 121.5,
+ level: 'elevated',
+ desc: 'Taipei — Taiwan Strait tensions, TSMC, China threat'
+ },
+ {
+ name: 'Tehran',
+ lat: 35.7,
+ lon: 51.4,
+ level: 'high',
+ desc: 'Tehran — Iran nuclear program, proxy conflicts, regional escalation'
+ },
+ {
+ name: 'Tel Aviv',
+ lat: 32.07,
+ lon: 34.78,
+ level: 'high',
+ desc: 'Tel Aviv — Israel-Gaza conflict, active military operations'
+ },
+ {
+ name: 'London',
+ lat: 51.5,
+ lon: -0.12,
+ level: 'low',
+ desc: 'London — Financial center, Five Eyes, NATO ally'
+ },
+ {
+ name: 'Brussels',
+ lat: 50.85,
+ lon: 4.35,
+ level: 'low',
+ desc: 'Brussels — EU/NATO headquarters, European policy'
+ },
+ {
+ name: 'Pyongyang',
+ lat: 39.03,
+ lon: 125.75,
+ level: 'elevated',
+ desc: 'Pyongyang — North Korea nuclear threat, missile tests'
+ },
+ {
+ name: 'Riyadh',
+ lat: 24.7,
+ lon: 46.7,
+ level: 'elevated',
+ desc: 'Riyadh — Saudi oil, OPEC+, Yemen conflict, regional power'
+ },
+ {
+ name: 'Delhi',
+ lat: 28.6,
+ lon: 77.2,
+ level: 'low',
+ desc: 'Delhi — India rising power, China border tensions'
+ },
+ {
+ name: 'Singapore',
+ lat: 1.35,
+ lon: 103.82,
+ level: 'low',
+ desc: 'Singapore — Shipping chokepoint, Asian finance hub'
+ },
+ {
+ name: 'Tokyo',
+ lat: 35.68,
+ lon: 139.76,
+ level: 'low',
+ desc: 'Tokyo — US ally, regional security, economic power'
+ },
+ {
+ name: 'Caracas',
+ lat: 10.5,
+ lon: -66.9,
+ level: 'high',
+ desc: 'Caracas — Venezuela crisis, Maduro regime, US sanctions, humanitarian emergency'
+ },
+ {
+ name: 'Nuuk',
+ lat: 64.18,
+ lon: -51.72,
+ level: 'elevated',
+ desc: 'Nuuk — Greenland, US acquisition interest, Arctic strategy, Denmark tensions'
+ }
+];
+
+export const CONFLICT_ZONES: ConflictZone[] = [
+ {
+ name: 'Ukraine',
+ coords: [
+ [30, 52],
+ [40, 52],
+ [40, 45],
+ [30, 45],
+ [30, 52]
+ ],
+ color: '#ff4444'
+ },
+ {
+ name: 'Gaza',
+ coords: [
+ [34, 32],
+ [35, 32],
+ [35, 31],
+ [34, 31],
+ [34, 32]
+ ],
+ color: '#ff4444'
+ },
+ {
+ name: 'Taiwan Strait',
+ coords: [
+ [117, 28],
+ [122, 28],
+ [122, 22],
+ [117, 22],
+ [117, 28]
+ ],
+ color: '#ffaa00'
+ },
+ {
+ name: 'Yemen',
+ coords: [
+ [42, 19],
+ [54, 19],
+ [54, 12],
+ [42, 12],
+ [42, 19]
+ ],
+ color: '#ff6644'
+ },
+ {
+ name: 'Sudan',
+ coords: [
+ [22, 23],
+ [38, 23],
+ [38, 8],
+ [22, 8],
+ [22, 23]
+ ],
+ color: '#ff6644'
+ },
+ {
+ name: 'Myanmar',
+ coords: [
+ [92, 28],
+ [101, 28],
+ [101, 10],
+ [92, 10],
+ [92, 28]
+ ],
+ color: '#ff8844'
+ }
+];
+
+export const CHOKEPOINTS: Chokepoint[] = [
+ { name: 'Suez', lat: 30.0, lon: 32.5, desc: 'Suez Canal — 12% of global trade, Europe-Asia route' },
+ {
+ name: 'Panama',
+ lat: 9.1,
+ lon: -79.7,
+ desc: 'Panama Canal — Americas transit, Pacific-Atlantic link'
+ },
+ {
+ name: 'Hormuz',
+ lat: 26.5,
+ lon: 56.5,
+ desc: 'Strait of Hormuz — 21% of global oil, Persian Gulf exit'
+ },
+ {
+ name: 'Malacca',
+ lat: 2.5,
+ lon: 101.0,
+ desc: 'Strait of Malacca — 25% of global trade, China supply line'
+ },
+ {
+ name: 'Bab el-M',
+ lat: 12.5,
+ lon: 43.3,
+ desc: 'Bab el-Mandeb — Red Sea gateway, Houthi threat zone'
+ },
+ { name: 'Gibraltar', lat: 36.0, lon: -5.5, desc: 'Strait of Gibraltar — Mediterranean access' },
+ { name: 'Bosporus', lat: 41.1, lon: 29.0, desc: 'Bosporus Strait — Black Sea access, Russia exports' }
+];
+
+export const CABLE_LANDINGS: CableLanding[] = [
+ { name: 'NYC', lat: 40.7, lon: -74.0, desc: 'New York — Transatlantic hub, 10+ cables' },
+ { name: 'Cornwall', lat: 50.1, lon: -5.5, desc: 'Cornwall UK — Europe-Americas gateway' },
+ { name: 'Marseille', lat: 43.3, lon: 5.4, desc: 'Marseille — Mediterranean hub, SEA-ME-WE' },
+ { name: 'Mumbai', lat: 19.1, lon: 72.9, desc: 'Mumbai — India gateway, 10+ cables' },
+ { name: 'Singapore', lat: 1.3, lon: 103.8, desc: 'Singapore — Asia-Pacific nexus' },
+ { name: 'Hong Kong', lat: 22.3, lon: 114.2, desc: 'Hong Kong — China connectivity hub' },
+ { name: 'Tokyo', lat: 35.5, lon: 139.8, desc: 'Tokyo — Trans-Pacific terminus' },
+ { name: 'Sydney', lat: -33.9, lon: 151.2, desc: 'Sydney — Australia/Pacific hub' },
+ { name: 'LA', lat: 33.7, lon: -118.2, desc: 'Los Angeles — Pacific gateway' },
+ { name: 'Miami', lat: 25.8, lon: -80.2, desc: 'Miami — Americas/Caribbean hub' }
+];
+
+export const NUCLEAR_SITES: NuclearSite[] = [
+ { name: 'Natanz', lat: 33.7, lon: 51.7, desc: 'Natanz — Iran uranium enrichment' },
+ { name: 'Yongbyon', lat: 39.8, lon: 125.8, desc: 'Yongbyon — North Korea nuclear complex' },
+ { name: 'Dimona', lat: 31.0, lon: 35.1, desc: 'Dimona — Israel nuclear facility' },
+ { name: 'Bushehr', lat: 28.8, lon: 50.9, desc: 'Bushehr — Iran nuclear power plant' },
+ {
+ name: 'Zaporizhzhia',
+ lat: 47.5,
+ lon: 34.6,
+ desc: 'Zaporizhzhia — Europe largest NPP, conflict zone'
+ },
+ { name: 'Chernobyl', lat: 51.4, lon: 30.1, desc: 'Chernobyl — Exclusion zone, occupied 2022' },
+ { name: 'Fukushima', lat: 37.4, lon: 141.0, desc: 'Fukushima — Decommissioning site' }
+];
+
+export const MILITARY_BASES: MilitaryBase[] = [
+ { name: 'Ramstein', lat: 49.4, lon: 7.6, desc: 'Ramstein — US Air Force, NATO hub Germany' },
+ {
+ name: 'Diego Garcia',
+ lat: -7.3,
+ lon: 72.4,
+ desc: 'Diego Garcia — US/UK Indian Ocean base'
+ },
+ {
+ name: 'Okinawa',
+ lat: 26.5,
+ lon: 127.9,
+ desc: 'Okinawa — US Forces Japan, Pacific presence'
+ },
+ { name: 'Guam', lat: 13.5, lon: 144.8, desc: 'Guam — US Pacific Command, bomber base' },
+ {
+ name: 'Djibouti',
+ lat: 11.5,
+ lon: 43.1,
+ desc: 'Djibouti — US/China/France bases, Horn of Africa'
+ },
+ { name: 'Qatar', lat: 25.1, lon: 51.3, desc: 'Al Udeid — US CENTCOM forward HQ' },
+ {
+ name: 'Kaliningrad',
+ lat: 54.7,
+ lon: 20.5,
+ desc: 'Kaliningrad — Russian Baltic exclave, missiles'
+ },
+ { name: 'Sevastopol', lat: 44.6, lon: 33.5, desc: 'Sevastopol — Russian Black Sea Fleet' },
+ {
+ name: 'Hainan',
+ lat: 18.2,
+ lon: 109.5,
+ desc: 'Hainan — Chinese submarine base, South China Sea'
+ }
+];
+
+export const OCEANS: Ocean[] = [
+ { name: 'ATLANTIC', lat: 25, lon: -40 },
+ { name: 'PACIFIC', lat: 0, lon: -150 },
+ { name: 'INDIAN', lat: -20, lon: 75 },
+ { name: 'ARCTIC', lat: 75, lon: 0 },
+ { name: 'SOUTHERN', lat: -60, lon: 0 }
+];
+
+export const WEATHER_CODES: Record<number, string> = {
+ 0: '☀️ Clear',
+ 1: '🌤️ Mostly clear',
+ 2: '⛅ Partly cloudy',
+ 3: '☁️ Overcast',
+ 45: '🌫️ Fog',
+ 48: '🌫️ Fog',
+ 51: '🌧️ Drizzle',
+ 53: '🌧️ Drizzle',
+ 55: '🌧️ Drizzle',
+ 61: '🌧️ Rain',
+ 63: '🌧️ Rain',
+ 65: '🌧️ Heavy rain',
+ 71: '🌨️ Snow',
+ 73: '🌨️ Snow',
+ 75: '🌨️ Heavy snow',
+ 77: '🌨️ Snow',
+ 80: '🌧️ Showers',
+ 81: '🌧️ Showers',
+ 82: '⛈️ Heavy showers',
+ 85: '🌨️ Snow',
+ 86: '🌨️ Snow',
+ 95: '⛈️ Thunderstorm',
+ 96: '⛈️ Thunderstorm',
+ 99: '⛈️ Thunderstorm'
+};