Duo Chat: trim the prompt before it's sent out
In order to better work with the slash commands, it makes sense to trim the prompts before they are sent out of the Duo Chat.
The current way of doing it in Web UI is in gitlab!147380 (merged). However, considering the number of environments Duo Chat is supposed to work in, we have to move the logic down to the shared component.