let boot = null; export function setBootstrap(data) { boot = data; } export const getBoot = () => boot; export const site = () => boot?.site || { brand: '舆纪历史', name: '政体志', seal: '制' }; export const eras = () => boot?.eras || []; export const dynasties = () => boot?.dynasties || []; export const threads = () => boot?.threads || []; export const stats = () => boot?.stats || {}; export const eraOf = (id) => eras().find((e) => e.id === id) || null; export const eraColor = (id) => eraOf(id)?.color || '#8a6320'; export const dynastyOf = (slug) => dynasties().find((d) => d.slug === slug) || null; export function indexOf(slug) { return dynasties().findIndex((d) => d.slug === slug); }