deep clone input to NOT mutate
3.0.3