The person whose mental condition is the subject of the hearing must be represented by counsel and, if the person is financially unable to obtain representation, the court shall appoint counsel for the person. The person must be afforded an opportunity to testify, to present evidence, to subpoena witnesses on their behalf, and to confront and cross-examine witnesses who appear at the hearing. The burden is upon the People to prove the person competent by a preponderance of the evidence.