import { coerceBooleanProperty , _isNumberValue } from '@angular/cdk/coercion' ; function propDecoratorFactory < T , D > ( name , fallback ) { function propDecorator ( target , propName ) { const privatePropName = `$$__${ propName }` ; if ( Object . prototype . hasOwnProperty . call ( target , privatePropName ) ) { console . warn ( `The prop "${ privatePropName }" is already exist, it will be overrided by ${ name } decorator.` ) ; } Object . defineProperty ( target , privatePropName , { configurable : true , writable : true } ) ; Object . defineProperty ( target , propName , { get ( ) { return this [ privatePropName ] ; } , set ( value ) { this [ privatePropName ] = fallback ( value ) ; } } ) ; } return propDecorator ; } export function toBoolean ( value ) { return coerceBooleanProperty ( value ) ; } export function InputBoolean ( ) { return propDecoratorFactory ( 'InputBoolean' , toBoolean ) ; } export function toNumber ( value ) ; export function toNumber < D > ( value , fallback ) ; export function toNumber ( value , fallbackValue = 0 ) { return _isNumberValue ( value ) ? Number ( value ) : fallbackValue ; } export function InputNumber ( ) { return propDecoratorFactory ( 'InputNumber' , toNumber ) ; }