I'm rewatching and got to S6 e1 before it dawned on me. Her primary issue isn't mental illness, it's autism.
If i didn't have an autistic child myself i'm not sure it would have occured to me.
She has:
Echolalia
Obsessions with people (very common in women and girls with autism).
Self-stimming behaviours - rocking and head slapping etc
Little idea of socially appropriate boundaries, speech and behaviours.
Abnormally high sensitivity to sensory stimulus.
A rich imaginary 'second world' competing for her attention at all times.
Huge problems with any change to her routine, often leading to aggressive behaviours.
For the first few years i was watching the show i assumed she had schizophrenia but i really don't think it's that. There may well be other mental health problems on top of the autism. Obviously, fictional character and all that but i feel like the writers must have had autism in mind, even if it's not explicitly stated.