var isFF = true;
var addRule =(function(style){
var sheet = document.head.appendChild(style).sheet;
return function(selector,css){
if(isFF){
if(sheet.cssRules.length > 0){
sheet.deleteRule(0);
}
try{
sheet.insertRule(selector + "{" + css + "}",0);
}catch(ex){
isFF = false;
}
}
};
})(document.createElement("style"));
function FixRangeElements(){
var rangeInputs = document.querySelectorAll('input[type="range"]');
var rangeFilledColor = window.getComputedStyle(document.documentElement).getPropertyValue('--ctlBackHiliteCol');
var rangeBGColor = window.getComputedStyle(document.documentElement).getPropertyValue('--ctlBorderCol');
rangeInputs.forEach(function(rangeInput){
rangeInput.addEventListener('input',function(){
var filledPer =(this.value - this.min)* 100 /(this.max - this.min);
this.style.background = `linear-gradient(to right, ${rangeFilledColor} calc(${filledPer}% - 1px), #1685FF 1px, ${rangeBGColor} 1px, ${rangeBGColor} calc(${100 - filledPer}% - 1px)`;
});
var inputEvent = new Event('input');
rangeInput.dispatchEvent(inputEvent);
});
}
