(function(b){function g(d,a){var f=new RegExp(b.ui.autocomplete.escapeRegex(a),"i");return b.grep(d,function(c){return f.test(b("<div>").html(c.label||c.value||c).text())})}var h=b.ui.autocomplete.prototype,e=h._initSource;b.extend(h,{_initSource:function(){this.options.html&&b.isArray(this.options.source)?this.source=function(d,c){c(g(this.options.source,d.term))}:e.call(this)},_renderItem:function(d,a){return b("<li></li>").data("item.autocomplete",a).append(b("<a></a>")[this.options.html?"html":"text"](a.label)).appendTo(d)}})})(jQuery);