Rodent chewed wiring to oxygen sensor

2010 Scion XB wiring covering chewed by rodent. Is it necessary to replace whole upstream oxygen sensor unit or can wiring be replaced? Any solutions to rodent chewing under hood. Live in SW desert area.

The wire can be repaired with but connectors covered with heat shrink.