American Flyer Strange Old PAS Sensor

Local time
4:47 AM
Dec 16, 2022
Hello, I have an old American Flyer ebike with this strange PAS sensor built into the crankset (see pic). It's working intermittently, so as you pedal it'll provide pedal assist just once per revolution of the pedals instead of constantly when you're pedaling. I took the whole thing apart and cleaned it, put it back together, but it does the same intermittent thing. I can't find anything remotely similar to it online for a replacement. I'm willing to replace the cranks, bottom bracket, and the sensor, but the wire coming from the controller has four pins, not three. Not sure what to do.