()
| 373 | // ─── Utilities ──────────────────────────────────────────── |
| 374 | |
| 375 | function _nextColor() { |
| 376 | const used = new Set(_sections.map((s) => s.color)); |
| 377 | return SECTION_COLORS.find((c) => !used.has(c)) ?? SECTION_COLORS[_sections.length % SECTION_COLORS.length]; |
| 378 | } |
| 379 | |
| 380 | function _nextId() { |
| 381 | return `s${Date.now().toString(36)}${Math.random().toString(36).slice(2, 6)}`; |