Past perfect with until
I have an issue with the use of the past perfect tense with “until” (and sometimes “before”). Can you please tell me which of these sentences is correct and why?
She hadn’t realized that she was addicted to nicotine until she smoked ten cigarettes a day. (i.e.: Before she smoked that many cigarettes, she didn’t have that knowledge about herself - not realizing/knowing was earlier.)
She didn’t realize that she was addicted to nicotine until she had smoked ten cigarettes a day. (i.e.: First she smoked that many cigarettes, and then she realized.)