Pelosi, second in line to the presidency after the vice president, is the highest-ranking US leader to visit Ukraine since the start of the war.