A Manhasset dermatologist traveled with her own cocaine stash and was seen doing lines of the narcotic at a bar and hotel room the night she was found unconscious in the foyer of a Chelsea apartment building in October 2015, according to court documents unsealed Thursday.

The actions of Kiersten Rickenbach Cerveny, 38, in the hours before she died from acute alcohol and cocaine intoxication, were described during the sentencing of the small-time drug dealer whose apartment she visited with an HBO producer on Oct. 4, 2015.

Before sentencing James Holder, 61, to five years in prison on charges he ran a drug dealing operation out of his apartment, Manhattan federal court judge Jesse Furman unsealed part of a letter from defense attorney Matthew J. Kluger. In the letter, Kluger argued that Cerveny, a mother of three, bore some responsibility for the events that led to her death. Furman kept under seal a portion of the letter dealing with what he said were aspects of the personal life of Cerveny, identified in court papers only as “Individual-1.”

“She was seen doing lines of cocaine at a bar and in a hotel room that she and her friends had secured in preparation for a night out of partying,” Kluger said in the letter. “According to one of her friends, [Cerveny] had cocaine with her and was doing lines in the bathroom of the hotel room . . . she had a bag and a vile both containing cocaine.”

Kluger said in the letter that Cerveny was seen drinking wine, vodka, beer and tequila shots.

Cerveny wound up at Holder’s apartment with Marc Henry Johnson, a former HBO producer, after the two met at a bar. Johnson pleaded guilty earlier in the case. In court Thursday, Kluger said that after Johnson and Cerveny went into a room at Holder’s apartment, he awoke at about 4:30 a.m. to discover something had gone wrong.

advertisement | advertise on newsday

Prosecutors said a video showed Johnson and Holder carrying an apparently unconscious Cerveny to the foyer of the building and leaving her there. Officials said Johnson eventually called 911.

Furman declined to rule that Cerveny was a victim, saying Holder had no intent to harm the woman and her conduct earlier in the night might have contributed to her death.

Sentencing guidelines recommended up to an eight-year term. But Furman took into account Holder’s low-level drug dealing status, his age and lack of intent to cause harm in sentencing him to five years.