How Do I Clamp My "X" and "Y" in This Example?

In this example, I spawn a camera at a specific location after stepping into a trigger volume. I then change the viewport to this new camera, and I use the mouse to control pitch and yaw. But I want the camera pitch and yaw to be clamped to just a few degrees up and down and about 45 degrees left and right of the center. Everything works really well, but how do I limit the range of motion for “X” and “Y” off my mouse inputs?

Thank you so much in advance.

Here’s my code: