jQuery(function(e){e("#wpacu-search-form-assets-manager .search-field").autocomplete({source:function(a,o){var t;t=e("#wpacu-custom-post-type-choice").length>0?e("#wpacu-custom-post-type-choice").val():wpacu_autocomplete_search_obj.post_type,e.ajax({dataType:"json",url:wpacu_autocomplete_search_obj.ajax_url,cache:!1,data:{wpacu_term:a.term,wpacu_post_type:t,action:wpacu_autocomplete_search_obj.ajax_action,wpacu_security:wpacu_autocomplete_search_obj.ajax_nonce,wpacu_time:(new Date).getTime()},success:function(a){e("#wpacu-search-form-assets-manager-no-results").hide(),o(a),console.log(a)},complete:function(a,t){if("no_results"==a.responseText){var c=new Object;e("#wpacu-search-form-assets-manager-no-results").show(),o(c)}}})},select:function(a,o){e("#wpacu-search-form-assets-manager").hide(),e("#wpacu-post-chosen-loading-assets").show(),window.location.href=wpacu_autocomplete_search_obj.redirect_to.replace("=post_id_here","="+o.item.id)},close:function(e){e.target.value=""}}).data("ui-autocomplete")._renderItem=function(a,o){return e("
  • ").append("
    "+o.label+""+o.link+"
    ").appendTo(a)}});