Sources
Thomas Aquinas, Summa theologiae III, q. 27, a. 2
Corpus: «quocumque modo ante animationem beata virgo sanctificata fuisset, nunquam incurrisset maculam originalis culpae, et ita non indiguisset redemptione et salute quae est per Christum». “in whatever way the blessed Virgin had been sanctified before animation, she would never have incurred the stain of original sin, and so would not have needed the redemption and salvation which is by Christ”. Ad 2: «beata virgo contraxit quidem originale peccatum, sed ab eo mundata fuit antequam ex utero nasceretur». “the blessed Virgin did indeed contract original sin, but was cleansed from it before she was born from the womb”.
About 1272-1273. Edition: Leonine, vol. 11; text at corpusthomisticum.org. Our translation.