Top-ranked Swiatek rallies past Pegula to reach San Diego final