text: !function(e){var c=(function(){var f=0;return function(h,g){clearTimeout(f);f=setTimeout(h,g)}})();var d=false;enterActive=true;e('input[name="s"]').on("input",function(){var f=this.value;c(function(){if(f.length<=2){e(dtGonza.area).hide();e(dtGonza.button).find("span").removeClass("fa-spinner-third").removeClass("fa-spin");return}if(!d){d=true;if(dtGonza.livesearchactive==true){e(dtGonza.button).find("span").addClass("fa-spinner-third").addClass("fa-spin");e(dtGonza.area).find("ul").addClass("process").addClass("noselect");e.ajax({type:"GET",url:dtGonza.api,data:"keyword="+f+"&nonce="+dtGonza.nonce,dataType:"json",success:function(j){if(j.error){e(dtGonza.area).hide();return}e(dtGonza.area).show();var i='<span class="icon-search-1">'+f+"</span>",k=dtGonza.more.replace("%s",i),h='<li class="ctsx"><a class="more live_search_click" data-search="searchform">'+k+"</a></li>";moreText2='<li class="ctsv"><a class="more live_search_click" data-search="form-search-resp">'+k+"</a></li>";var g=[];e.each(j,function(l,m){name="";date="";imdb="";if(m.extra["date"]!==false){date='<span class="release">('+m.extra["date"]+")</span>"}if(m.extra["imdb"]!==false){imdb='<div class="imdb"><span class="fas fa-star"></span> '+m.extra["imdb"]+"</div>"}g.push('<li id="'+l+'"><a href="'+m.url+'" class="clearfix"><div class="poster"><img src="'+m.img+'" /></div><div class="title">'+m.title+date+"</div>"+imdb+"</a></li>")});e(dtGonza.area).html("<ul>"+g.join("")+h+"</ul>")},complete:function(){d=false;enterActive=false;e(dtGonza.button).find("span").removeClass("fa-spinner-third").removeClass("fa-spin");e(dtGonza.area).find("ul").removeClass("process").removeClass("noselect")}})}}},500)});e(document).on("click",".live_search_click",function(){var f=e(this).data("search");if(f!=false){e("#"+f).submit()}});e(document).on("keypress","#search-form",function(f){if(enterActive){return f.keyCode!=13}});e(document).click(function(){var f=e(event.target);if(e(event.target).closest('input[name="s"]').length==0){e(dtGonza.area).hide()}else{e(dtGonza.area).show()}if(e(event.target).closest(".lglossary").length==0){e(".items_glossary").hide();e(".lglossary").removeClass("active")}else{e(".items_glossary").show()}});e(document).on("click",".post-request",function(){e(".post_request").show();e("#post_request_archive").html('<div class="load_event">'+dtAjax.loading+"</div>");var f=e(this).data("id");e.ajax({url:dtAjax.url,type:"POST",data:{id:f,action:"dbmovies_post_archive"},error:function(g){console.log(g)},success:function(g){e("#post_request_archive").html(g);e(".backdrop").click(function(){e(".post_request").hide()})}})});function a(h,g,f){e("#tmdb-"+h).html('<div class="itm-exists">'+dtAjax.loading+"</div>");e.ajax({url:dtAjax.url,type:"POST",data:{id:h,type:g,nonce:f,action:"dbmovies_post_requests"},error:function(i){console.log(i)},success:function(i){console.log(i);e("#tmdb-"+h).html('<div class="itm-exists">'+dtAjax.ready+"</div>")}})}function b(){var f=e("#term").val();var j=e("#page").val();var h=e("#type").val();var g=e("#nonce").val();var i=e("#action").val();e("#get_requests").find("span").addClass("fa-spinner-third").addClass("fa-spin");e.ajax({url:dtAjax.url,type:"POST",data:{type:h,term:f,page:j,nonce:g,action:i},error:function(k){console.log(k)},success:function(k){e("#get_requests").find("span").removeClass("fa-spinner-third").removeClass("fa-spin");e("#discover_results").html(k);e(".get_content_dbmovies").click(function(){var n=e(this).data("id");var m=e(this).data("type");var l=e(this).data("nonce");a(n,m,l)})}})}e("#discover_requests").keyup(function(){c(function(){b()},500);return false});e("#discover_requests").submit(function(){b();return false});e(document).on("click",".lglossary",function(){var f=e(this).data("glossary");var g=e(this).data("type");e(".lglossary").removeClass("active");e(this).addClass("active");e(".items_glossary").show();e(".items_glossary").html('<div class="onloader"></div>');e.ajax({type:"GET",url:dtGonza.glossary,data:"term="+f+"&nonce="+dtGonza.nonce+"&type="+g,dataType:"json",success:function(i){if(i.error){e(".items_glossary").hide();e(".lglossary").removeClass("active");return}e(".items_glossary").show();var h=[];e.each(i,function(j,k){imdb="";if(k.imdb!==false){imdb='<div class="rating"><i class="fas fa-star"></i> '+k.imdb+"</div>"}h.push('<div id="'+j+'" class="item"><a href="'+k.url+'"><div class="poster"><img src="'+k.img+'"/>'+imdb+'</div></a><div class="data"><h3>'+k.title+"</h3><span>"+k.year+"</span></div></div>")});e(".items_glossary").html('<div class="items animation-2">'+h.join("")+"</div>")}})});e(document).keyup(function(f){if(f.keyCode==27){e(".post_request").hide();e(".items_glossary").hide();e(".items_glossary").html(" ");e(".lglossary").removeClass("active")}if(f.keyCode==39){e("#nextpagination").trigger("click")}if(f.keyCode==37){e("#prevpagination").trigger("click")}})}(jQuery);