Query screen lock status

I need an Apple Script way to query the status of a Mac, whether the screen is locked or not. It needs to work in Monterey. I have seen solutions using Python, which I used to use, but that no longer works in Monterey. Any solution out there?
Thanks.