exOf(query.toLowerCase()) !== -1
              return resultContains || endonymContains
            })
          : []
        )
      }

      function inputValueTemplate (result) {
        return result && result.name
      }

      function suggestionTemplate (result) {
        return result && '<strong>' + result.name + '</strong>' +
          ' (<span lang=' + result.endonymLang + '>' + result.endonym + '</span>)'
      }

      element = document.querySelector('#tt-customTemplates')
      id = 'autocom