57 lines
2.9 KiB
TypeScript
57 lines
2.9 KiB
TypeScript
// Konstanten für den SOS-Screen: Chip-Sets, Atemphasen, Emotion-Regex.
|
|
|
|
export type ChipSet = 'start' | 'help' | 'after_breathing' | 'after_game' | 'overcome_check' | 'overcome_done' | 'none';
|
|
type Chip = { label: string; action: string };
|
|
|
|
export const CHIP_SETS: Record<ChipSet, Chip[]> = {
|
|
start: [
|
|
{ label: '😤 Wütend', action: 'feel:Ich bin gerade sehr wütend.' },
|
|
{ label: '😰 Ängstlich', action: 'feel:Ich bin ängstlich und nervös.' },
|
|
{ label: '😔 Traurig', action: 'feel:Ich bin traurig.' },
|
|
{ label: '😤 Gestresst', action: 'feel:Ich bin gerade gestresst.' },
|
|
{ label: '😶 Leer', action: 'feel:Ich fühle mich innerlich leer.' },
|
|
{ label: '🤔 Etwas anderes...', action: 'need_help' },
|
|
],
|
|
help: [
|
|
{ label: '🫁 Atemübung', action: 'breathing' },
|
|
{ label: '🎮 Spiel starten', action: 'game_picker' },
|
|
],
|
|
after_breathing: [
|
|
{ label: '😌 Besser', action: 'send_text:Ich fühle mich nach der Atemübung besser.' },
|
|
{ label: '🔄 Nochmal', action: 'breathing' },
|
|
{ label: '🎮 Spiel', action: 'game_picker' },
|
|
{ label: '❤️ Überwunden', action: 'overcome' },
|
|
],
|
|
after_game: [
|
|
{ label: '😌 Ruhiger', action: 'send_text:Das Spiel hat geholfen, ich bin ruhiger.' },
|
|
{ label: '🔄 Nochmal', action: 'game_picker' },
|
|
{ label: '❤️ Überwunden', action: 'overcome' },
|
|
],
|
|
overcome_check: [
|
|
{ label: '✅ Ja, ich habe es geschafft', action: 'overcome' },
|
|
{ label: '💪 Noch nicht ganz', action: 'send_text:Der Spielimpuls ist noch da, ich brauche noch Hilfe.' },
|
|
],
|
|
overcome_done: [
|
|
{ label: '✨ Erfolg teilen', action: 'share_success' },
|
|
{ label: '⭐ Diese Session bewerten', action: 'rate_session' },
|
|
{ label: '📊 Meine Statistik', action: 'show_stats' },
|
|
{ label: '✅ Fertig', action: 'close' },
|
|
],
|
|
none: [],
|
|
};
|
|
|
|
// ── Breathing guide ──────────────────────────────────────────────────────────
|
|
export type BreathPhase = 'inhale' | 'hold' | 'exhale';
|
|
export type BreathState = 'idle' | 'countdown' | 'active';
|
|
// speakLine bewusst durchgehend null — Phase-TTS würde Lyras laufende Audio abbrechen
|
|
// (User-Wahrnehmung: "Stimme ändert sich"). Visuelles Pulsieren + Countdown reicht.
|
|
export const BREATH_PHASES: { phase: BreathPhase; duration: number; label: string; color: string; speakLine: string | null }[] = [
|
|
{ phase: 'inhale', duration: 4, label: 'Einatmen', color: '#6366f1', speakLine: null },
|
|
{ phase: 'hold', duration: 7, label: 'Halten', color: '#f97316', speakLine: null },
|
|
{ phase: 'exhale', duration: 8, label: 'Ausatmen', color: '#16a34a', speakLine: null },
|
|
];
|
|
export const TOTAL_ROUNDS = 3;
|
|
|
|
export const EMPATHY_RE = /schwer|rückfall|traurig|schlimm|hoffnungslos|verloren|scham|schuld|verzweifelt/i;
|
|
export const HAPPY_RE = /toll|super|geschafft|stark|stolz|fantastisch|prima/i;
|