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