。
She was at a loss as to what to do.
Literal
She [topic-は] what [object-を] do is-good [whether-のか] way-darkened was.
途方に暮れる ('grow dim with respect to one's path') is the idiom for being completely at a loss. Here it pairs with a different embedded question: 何をしてよいのか literally 'whether (it'd be) good to do what,' i.e. 'what (one) should do.' The pattern V-て + よい (or いい) marks 'OK to do,' so the wh-question whether-clause asks for the right course of action. Compared with 何をすべきか (more prescriptive 'should'), 何をしてよいのか has a slightly softer 'what would be alright to do' tone — useful when the speaker isn't sure what's expected of them.