(function(){
	'use strict';

	function resetHighlightColors() {
		document.querySelectorAll('.consortia-qfr-color-field input[type="color"]').forEach(function(input) {
			if (input.dataset.defaultColor && !input.disabled) {
				input.value = input.dataset.defaultColor;
				input.dispatchEvent(new Event('input', { bubbles: true }));
			}
		});
	}

	document.addEventListener('DOMContentLoaded', function() {
		var resetButton = document.getElementById('consortia-qfr-reset-colors');

		if (!resetButton) {
			return;
		}

		resetButton.addEventListener('click', resetHighlightColors);
	});
}());
