Electronic structure and charge transport mechanisms in polyaniline