facetwp show hide template based on facets selected

add_action( 'wp_head', function() {
?>
<script>
(function($) {
	$(document).on('facetwp-loaded', function() {
		if ('' != FWP.buildQueryString()) {
			$('.facetwp-template').show();
		} else {
			$('.facetwp-template').hide();
		}
	 });
})(jQuery);
</script>
<?php
}, 100 );