American Jessica Pegula says completing an escape room with friends helped her rediscover her form and embark on a run to the US Open quarter-finals.