function mediaLibraryOrganizerAutoCompleteInit(){(function(e){e(media_library_organizer_autocomplete.fields.join(", ")).each(function(t){if(e(this).data("autocomplete")){e(this).autocomplete("destroy");e(this).removeData("autocomplete")}mediaLibraryOrganizerAutoCompleteInitInput(this,media_library_organizer_autocomplete.terms,true)})})(jQuery)}function mediaLibraryOrganizerAutoCompleteInitInput(e,t,o){(function(i){if(o&&i(e).data("autocomplete")){i(e).autocomplete("destroy");i(e).removeData("autocomplete")}if(i(e).data("autocomplete")){return}i(e).on("keydown",function(e){if(e.keyCode===i.ui.keyCode.TAB&&i(this).autocomplete("instance").menu.active){e.preventDefault()}}).autocomplete({minLength:0,source:function(e,o){o(i.ui.autocomplete.filter(t,e.term.split(/[ ,]+/).pop()))},focus:function(){return false},select:function(e,t){var o=this.value.split(/[ ,]+/);o.pop();o.push(t.item.value);o.push("");this.value=o.join(" ");return false}})})(jQuery)}jQuery(document).ready(function(e){mediaLibraryOrganizerAutoCompleteInit()});