Melatonin?

Is melatonin safe to take while pregnant? I’m 37 weeks & 2 days if that matters.