'use strict';

var searchInput = document.querySelector('[data-search-input]');

var typeTimer = void 0;

var checkTouchedBar = function checkTouchedBar(search) {
    //console.log(search.value.length);
    if (search.value == null || search.value == "" || search.value.length <= 0) {
        search.classList.remove('touched');
    } else if (search.value != null || search.value !== "") {
        search.classList.add('touched');
    } else {
        search.classList.remove('touched');
    }
};

checkTouchedBar(searchInput);

searchInput.addEventListener('keydown', function (search) {
    clearTimeout(typeTimer);
    typeTimer = setTimeout(function () {
        checkTouchedBar(searchInput);
    }, 300);
});