Boy, was she trashed!

A completely hammered Manhattan lawyer who got locked out of her Chelsea apartment yesterday nearly lost her arm when she jumped down the garbage chute to get back inside.

The hare-brained bid began when attorney Maggie Baumer came home from a long night on the town at around 6 a.m., only to find herself stuck without the keys to her first-floor apartment on West 21st Street.

A source in the building said the buzzed Baumer had given her keys to a friend.

Instead of calling the pal, Baumer rang every bell until someone let her into the building, according to her super.

But she got a little too creative with her plan to get into the apartment.

Baumer figured that sliding down the trash chute would get her to the building’s basement. From there, sources said, she planned to go through the cellar and enter the building’s garden, where she would be able to open a window in her own apartment and climb inside.

She entered the chute with her hands in front of her — and her arm got caught in the compactor, triggering a motion detector, authorities said.

A piston crushed her arm, cutting almost all the way through, according to an FDNY source. “It was barely hanging,” the source said.

At least 17 firefighters responded to the grisly scene, shutting off the power and giving her morphine to cope with the pain, authorities said.

It took about an hour to pull her out, authorities added. She was rushed to Bellevue Hospital, where she underwent surgery.

Baumer has lived in the building for four years. She is a Tufts grad who works as a lawyer for Goldstein and Lee.