text: 'use strict';(function(c){const r=function(a){const m=[],g="overlay"===a.type?a.container.querySelector("#searchform input"):a.el;let h,b,k;if("overlay"===a.type){b=a.container.getElementsByClassName("search-results-wrap")[0];const n=function(){a.container.classList.toggle("search-active",0<g.value.length)},l=a.container.getElementsByClassName("close-search-box")[0];a.el.addEventListener("click",function(b){b.preventDefault();n();a.container.classList.add("tf_fd_in");g.focus();c.body[0].style.overflowY=
  "hidden";c.body[0].classList.add("searchform-slidedown")});l&&l.addEventListener("click",function(b){b.preventDefault();n();h&&k.abort();a.container.classList.remove("tf_fd_in");c.body[0].style.overflowY="visible";c.body[0].classList.remove("searchform-slidedown")})}else"dropdown"===a.type&&(a.container.classList.add("tf_rel","tf_s_dropdown"),a.container.insertAdjacentHTML("beforeend",'<div class="search-results-wrap tf_ajax_s_dropdown tf_scrollbar" style="display:none"></div>'),b=a.container.getElementsByClassName("search-results-wrap")[0],
  g.addEventListener("blur",function(a){a.relatedTarget&&null!==a.relatedTarget.closest(".search-results-wrap")||(b.style.display="none")},{passive:!0}));if(b){const c=function(q){let d=q.getAttribute("href").replace("#","");if("all"===d)d="item";else{const a=b.getElementsByClassName("result-item");for(var e=a.length-1;-1<e;e--)a[e].classList.remove("tf_fd_in"),a[e].classList.add("tf_fd_out");setTimeout(function(){for(let b=a.length-1;-1<b;b--)a[b].classList.add("tf_hide")},400)}if(e=b.querySelector("#result-link-"+
  d)){const a=document.getElementsByClassName("view-all-button")[0];a&&(a.style.display="none");e.style.display=""}const c=b.getElementsByClassName("result-"+d);setTimeout(function(){if(c[0])for(let a=c.length-1;-1<a;a--)c[a].classList.remove("tf_hide","tf_fd_out"),c[a].classList.add("tf_fd_in")},401);const f=q.closest("li");f.classList.add("active");Array.prototype.filter.call(f.parentNode.children,function(a){"LI"===f.tagName&&a!==f&&a.classList.remove("active")});"dropdown"===a.type&&g.focus()};
  b.addEventListener("click",function(a){const b=a.target;"A"===b.tagName&&b.closest(".search-option-tab")&&(a.preventDefault(),c(b))});g.autocomplete="off";const l=function(a){if(null===a)return 0;let b=0;for(;a=a.previousElementSibling;)b++;return b},p=function(a){0>a&&(a=0);const d=b.querySelectorAll(".search-option-tab li");d[a]&&c(d[a].querySelector("a"));b.style.display=""};g.addEventListener("keyup",function(c){0<this.value.length?a.container.classList.add("search-active"):(a.container.classList.remove("search-active"),
  b.style.display="none");if(48<=c.keyCode&&57>=c.keyCode||65<=c.keyCode&&90>=c.keyCode||8===c.keyCode||229===c.keyCode){let c=this.value.trim();if(c){const e=l(b.querySelector(".search-option-tab li.active"));m[c]?(b.style.display="none",b.innerHTML=m[c],p(e)):setTimeout(function(){c=g.value.trim();h&&k.abort();if(c){var d=new Headers({Accept:"application/json","X-Requested-With":"XMLHttpRequest"}),f=new FormData;f.append("action","themify_search_autocomplete");f.append("term",c);f.append("post_type",
  a.post_type?a.post_type:"");a.container.classList.add("themify-loading");h=!0;k=new AbortController;fetch(themify_vars.ajax_url,{signal:k.signal,method:"POST",headers:d,body:f}).then(function(a){return a.text()}).then(d=>{c?d&&(b.style.display="none",b.innerHTML=d,p(e),m[c]=d):b.innerHTML="";a.container.classList.remove("themify-loading");h=!1}).catch(a=>{"AbortError"!==a.name&&console.error("Uh oh, an error!",a)})}else b.innerHTML=""},100)}else b.innerHTML=""}},{passive:!0})}};c.on("themify_overlay_search_init",
  function(a){r(a)})})(Themify);
  