/**
@license
Copyright (c) 2017 Vaadin Ltd.
This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
*/
export const ProgressMixin=e=>class VaadinProgressMixin extends e{static get properties(){return{value:{type:Number,observer:"_valueChanged"},min:{type:Number,value:0,observer:"_minChanged"},max:{type:Number,value:1,observer:"_maxChanged"},indeterminate:{type:Boolean,value:!1,reflectToAttribute:!0}}}static get observers(){return["_normalizedValueChanged(value, min, max)"]}ready(){super.ready(),this.setAttribute("role","progressbar")}_normalizedValueChanged(e,a,t){const r=this._normalizeValue(e,a,t);this.style.setProperty("--vaadin-progress-value",r),this.updateStyles({"--vaadin-progress-value":String(r)})}_valueChanged(e,a){this.setAttribute("aria-valuenow",e)}_minChanged(e,a){this.setAttribute("aria-valuemin",e)}_maxChanged(e,a){this.setAttribute("aria-valuemax",e)}_normalizeValue(e,a,t){let r;return e||0==e?a>=t?r=1:(r=(e-a)/(t-a),r=Math.min(Math.max(r,0),1)):r=0,r}};