1(function($){$.widget("custom.catcomplete",$.ui.autocomplete,{_create:function(){this._super();this.widget().menu("option","items","> :not(.ui-autocomplete-category)")},_renderMenu:function(ul,items){var that=this,currentCategory="";$.each(items,function(index,item){var li;if(item.category!=currentCategory){ul.append("<li class='ui-autocomplete-category'>"+item.category+"</li>");currentCategory=item.category} 2li=that._renderItemData(ul,item);if(item.category){li.attr("aria-label",item.category+" : "+item.label+" "+item.id)}})}});const searchForm=document.querySelector("#property-search-form");let searchDepartment=searchForm.dataset.searchType;let type=document.getElementById("type").value;const searchParams={residential:{type:'<input type="hidden" name="show_in_residential" id="show_in_residential" value="true">',buy:{id:"#show_in_sale",input:'<input type="hidden" name="show_in_sale" id="show_in_sale" value="true">'},rent:{id:"#show_in_rental",input:'<input type="hidden" name="show_in_rental" id="show_in_rental" value="true">'}},rural:{type:'<input type="hidden" name="show_in_rural" id="show_in_rural" value="true">',buy:{id:"#show_in_sale",input:'<input type="hidden" name="show_in_sale" id="show_in_sale" value="true">'}},commercial:{type:'<input type="hidden" name="show_in_commercial" id="show_in_commercial" value="true">',buy:{id:"#show_in_sale",input:'<input type="hidden" name="show_in_sale" id="show_in_sale" value="true">'},rent:{id:"#show_in_rental",input:'<input type="hidden" name="show_in_rental" id="show_in_rental" value="true">'}},business:{type:'<input type="hidden" name="show_in_business" id="show_in_business" value="true">',buy:{id:"#show_in_sale",input:'<input type="hidden" name="show_in_sale" id="show_in_sale" value="true">'}},holiday:{type:'<input type="hidden" name="show_in_holiday" id="show_in_holiday" value="true">',rent:{id:"#show_in_rental",input:'<input type="hidden" name="show_in_rental" id="show_in_rental" value="true">'}}};$("#department,#type").change(function(){$("#type option").removeAttr("disabled");var department=$("#department").val()??searchDepartment;var type=$("#type").val();if(department==="rural"||department==="business"){$("#type option[value='rent']").attr("disabled","disabled").removeAttr("selected");$("#type option[value='buy']").attr("selected","selected");type="buy"} 3if(department==="holiday"){$("#type option[value='buy']").attr("disabled","disabled").removeAttr("selected");$("#type option[value='rent']").attr("selected","selected");type="rent"} 4$("#property-search-form input[type='hidden']").remove();$("#property-search-form").prepend(searchParams[department]?.type);$("#property-search-form").prepend(searchParams[department]?.[type]?.input);$(".advanced-search-department").hide();$("#"+department+"-search").show();$("#advanced-search-wrapper select").attr("disabled","disabled");if(this.id==="department"){$("#advanced-search-wrapper option").removeAttr("selected")} 5$("#"+department+"-search select").removeAttr("disabled");$("#advanced-search-wrapper .department-price-item").hide();$("#advanced-search-wrapper .department-price-item select").attr("disabled","disabled");$("#"+department+"-search #"+department+"-"+type+"-max").show();$("#"+department+"-search #"+department+"-"+type+"-min").show();$("#"+department+"-search #"+department+"-"+type+"-max select").removeAttr("disabled");$("#"+department+"-search #"+department+"-"+type+"-min select").removeAttr("disabled");$("#advanced-search-wrapper .department-type-item").hide();$("#advanced-search-wrapper .department-type-item select").attr("disabled","disabled");$("#"+department+"-search #"+department+"-"+type+"-type").show();$("#"+department+"-search #"+department+"-"+type+"-type select").removeAttr("disabled");$("#advanced-search-wrapper .features").hide();$("#advanced-search-wrapper .features input").attr("disabled","disabled");$("#advanced-search-wrapper #"+department+"-"+type+"-features").show();$("#advanced-search-wrapper #"+department+"-"+type+"-features input").removeAttr("disabled");$("#property-search-form select").selectpicker("refresh")});
5$("#keyword").catcomplete({appendTo:".listings-search",position:{my:"left top",at:"left bottom",collision:"flipfit"},minLength:3,source:function(request,response){$.ajax({url:pro_ajax_obj.ajax_url,method:'POST',data:{action:'suburb_property_search',_ajax_nonce:pro_ajax_obj.nonce,department:document.getElementById("department")?.value??searchDepartment,type:document.getElementById("type").value,term:request.term},success:function(data){response(data)}})},focus:function(){return!1},select:function(event,ui){if(ui.item.category==="Property"){window.location.href=ui.item.href;return} 6var terms=split(this.value);terms.pop();terms.push(ui.item.value);terms.push("");this.value=terms.join(", ");let myString=ui.item.id;let mySplitResult=myString.split("^");$("input#radius").val(mySplitResult[2]);return!1},});function split(val){return val.split(/,\s*/)} 7function extractLast(term){return split(term).pop()}})(jQuery) 8;
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.