A framework to account for structural damage, functional efficiency and reparation costs within the optimal design of countermeasures: Application to snow avalanche risk mitigation