PageSourceSearch

https://habitatbroome.com/wp-content/plugins/media-grid-bundle/plu…/js/frontend.min.js?ver=1.7.2

js habitatbroome.com collected 2026-10-06 11:13:15 UTC 11,112 bytes, 1 lines download raw bytes

1!function(a){"use strict";const e="mgbp"==lcmg.dike_slug?lcmg.dike_slug:"mgaf";if(void 0!==window.dike_plc&&!window.dike_plc("lcweb",e))return console.error("Media Grid Advanced Filters add-on - validate the license"),!1;var t=[],n=null;a(window).on("mg_pre_grid_init",(function(e,t){s(),i(a("#"+t+" .mgaf_range")),mgaf_filters_update(t,!0),a("#"+t+" .mgaf_wrap").fadeTo(200,1)}));const s=function(e){a(void 0===e?".mg_grid_wrap":"#"+e).each((function(){const e=a(this),t=e.width(),n=parseInt(lcmg.sect_right_margin,10);let s=e.find(".mgaf_sect").length,i=Math.round(t/s),_=parseInt(lcmg.sect_min_w,10);for(t<_&&(_=t);i-n<=_&&s>=1;)s--,i=Math.floor(t/s);e.find(".mgaf_wrap .mgf_inner").css("grid-template-columns","repeat("+s+", 1fr)")}))};a(window).on("mg_resize_grid",(function(a,e){s(e)})),a(document).on("click",".mgaf_filters_btn",(function(e){a(this).parents(".mg_filters_wrap").toggleClass("mgaf_togglable_filters_shown")})),a(document).on("click",".mgaf_foldable_sect .mgaf_fold",(function(e){var t=a(this).parents(".mgaf_sect");t.find(".mgaf_opts_wrap").is(":visible")?(t.find(".mgaf_opts_wrap").slideUp(),t.find(".fa-chevron-down").removeClass("fa-chevron-down").addClass("fa-chevron-right")):(t.find(".mgaf_opts_wrap").slideDown(),t.find(".fa-chevron-right").removeClass("fa-chevron-right").addClass("fa-chevron-down"))}));const i=function(e){e.each((function(e,s){var i=a(this),_=i.parents(".mgaf_range_wrap"),f=_.parents(".mg_grid_wrap").attr("id"),d=i.parents(".mgaf_sect").data("sect"),r=f+"-"+d;if(_.find(".noUi-target").length)return!0;noUiSlider.create(i[0],{start:[i.parents(".mgaf_sect").find("input[type=text]").first().val(),i.parents(".mgaf_sect").find("input[type=text]").last().val()],connect:!0,range:{min:i.data("min"),max:i.data("max")},step:i.data("step")}),i[0].noUiSlider.on("update",(function(a,e){var n=Math.round(a[e]);e?_.find(".mgaf_range_max").val(n):_.find(".mgaf_range_min").val(n),_.parents(".mg_grid_wrap").hasClass("mg_muurified")&&(void 0!==t[r]&&clearTimeout(t[r]),t[r]=setTimeout((function(){mgaf_filters_update(f)}),120))})),_.find("input[type=text]").on("keyup",(function(){n&&clearTimeout(n);var e=a(this);n=setTimeout((function(){var a={min:parseInt(i.data("min"),10),max:parseInt(i.data("max"),10)},t=parseInt(e.val(),10);isNaN(t)||t<a.min?t=a.min:(isNaN(t)||t>a.max)&&(t=a.max),e.val(t),i[0].noUiSlider.set([_.find(".mgaf_range_min").val(),_.find(".mgaf_range_max").val()]),mgaf_filters_update(f)}),120)}))}))};a(document).on("keypress","#poststuff input[type=text], #poststuff input[type=number]",(function(a){if(13===a.keyCode)return a.preventDefault(),!1;a.cancelBubble=!0,a.stopPropagation&&a.stopPropagation()}));var _=".mg_grid_wrap .mgaf_compact_opts_layout .mgaf_opts_wrap,.mg_mobile_mode .mgaf_list_opts_layout .mgaf_opts_wrap,.mg_mobile_mode .mgaf_blocks_opts_layout .mgaf_opts_wrap";let f;a(document).on("click",_,(function(e){var t=a(e.target);if(t.hasClass("mgaf_dd_sel")||t.hasClass("mgaf_fdd_opt")||t.parents(".mgaf_fdd_opt").length||t.hasClass("mgaf_fake_dd_search")||t.parents("li").hasClass("mgaf_fake_dd_search"))return!0;if(a(this).hasClass("mgaf_all_selected"))return!0;const n=a(_).not(this);n.removeClass("mgaf_opts_expanded"),n.find(".mgaf_fake_dd_searching i").trigger("click"),a(this).toggleClass("mgaf_opts_expanded")})),a(document).on("click","*",(function(e){var t=a(e.target);if(t.hasClass("mgaf_opts_expanded")||t.parents("div").hasClass("mgaf_opts_expanded")||t.hasClass("mgaf_fake_dd_search")||t.parents("li").hasClass("mgaf_fake_dd_search"))return!0;a(".mgaf_opts_expanded .mgaf_fake_dd_searching i").trigger("click"),a(".mgaf_opts_expanded").removeClass("mgaf_opts_expanded")})),a(document).on("click",".mgaf_opts_list li:not(.mgaf_fake_dd_search)",(function(e){var t=a(this),n=t.parents(".mgaf_opts_wrap"),s=n.find(".mgaf_fake_dd"),i=!t.parents("ul").hasClass("mgaf_multi_opt_opts"),_=t.data("val");if(t.hasClass("mgaf_disabled_opt"))return!0;if(t.hasClass("mgc_reset_filter")){if(t.hasClass("mgaf_sel_opt"))return!0;n.find(".mgaf_sel_opt").trigger("click"),t.addClass("mgaf_sel_opt")}else t.hasClass("mgaf_sel_opt")?(s.find('span[data-val="'+_+'"]').fadeTo(100,
10,(function(e){a(this).remove(),1==s.find("> span").length&&s.find(".mgaf_fake_dd_placeh").removeClass("mg_displaynone")})),n.removeClass("mgaf_all_selected"),t.removeClass("mgaf_sel_opt"),n.find(".mgaf_sel_opt").length||n.find(".mgc_reset_filter").addClass("mgaf_sel_opt")):(s.find(".mgaf_fake_dd_placeh").addClass("mg_displaynone"),i&&(s.find("span").not(".mgaf_fake_dd_placeh").remove(),n.find("ul li").removeClass("mgaf_sel_opt")),1==n.find("ul li").not(".mgaf_sel_opt").length&&n.addClass("mgaf_all_selected"),s.append('<span class="mgaf_fdd_opt" data-val="'+t.data("val")+'" style="opacity: 0;">'+t.html()+"</span>"),s.find('span[data-val="'+t.data("val")+'"]').fadeTo(100,1),n.find(".mgc_reset_filter").removeClass("mgaf_sel_opt"),t.addClass("mgaf_sel_opt"));setTimeout((function(){mgaf_filters_update(n.parents(".mg_grid_wrap").attr("id"))}),110)})),a(document).on("click",".mgaf_fake_dd span:not(.mgaf_fake_dd_placeh)",(function(e){var t=a(this),n=t.parents(".mgaf_opts_wrap"),s=t.parents(".mgaf_fake_dd"),i=a(this).data("val");t.fadeTo(100,0,(function(e){a(this).remove(),1==s.find("span").length&&s.find(".mgaf_fake_dd_placeh").removeClass("mg_displaynone"),mgaf_filters_update(n.parents(".mg_grid_wrap").attr("id"))})),n.removeClass("mgaf_all_selected"),n.find('li[data-val="'+i+'"]').removeClass("mgaf_sel_opt")})),a(document).on("keyup input",".mgaf_fake_dd_search input",(function(e){const t=a(this),n=a(this).parents("li").first(),s=a(this).parents("ul").first().find("li").not(".mgaf_fake_dd_search");f&&clearTimeout(f),f=setTimeout((function(){const e=t.val().toLowerCase().trim();e.length<2?(s.removeClass("mg_displaynone"),n.removeClass("mgaf_fake_dd_searching")):(n.addClass("mgaf_fake_dd_searching"),s.each((function(){-1!==a(this).text().toLowerCase().trim().indexOf(e)?a(this).removeClass("mg_displaynone"):a(this).addClass("mg_displaynone")})))}),400)})),a(document).on("click",".mgaf_fake_dd_searching i",(function(){a(this).parents("li").first().find("input").val("").trigger("input")})),window.mgaf_filters_update=function(e,t){var n=a("#"+e),s={},i=[];if(a("#"+e).find(".mgaf_sect").not(".mgaf_search").each((function(){var e=a(this).data("sect");if("range"==a(this).data("type")){var t={name:e,icon:a(this).find("> label i").length?'<i class="'+a(this).find("> label i").attr("class")+'"></i> ':"",def_min:parseInt(a(this).find(".mgaf_range").data("min"),10),def_max:parseInt(a(this).find(".mgaf_range").data("max"),10),min:parseInt(a(this).find(".mgaf_range_min").val(),10),max:parseInt(a(this).find(".mgaf_range_max").val(),10)};n.find(".mg_box").removeClass(e),d(t)&&(s[e]=t,i.push(t))}else{var _=[];a(this).find(".mgaf_fake_dd span").not(".mgaf_fake_dd_placeh").each((function(){_.push(a(this).data("val").replace("mgc_","")),i.push(a(this).data("val"))})),_.length&&(s[e]=_)}})),n.find(".mgaf_sumbar").length&&o(n,i),void 0!==t)return!0;r(e,s),g(n,n.data("grid-id"),s),a(window).trigger("mgaf_on_filters_update",[e])};const d=function(a){return a.min>a.def_min||a.max<a.def_max},r=function(e,t){var n={};void 0===mg_grid_filters[e]&&(mg_grid_filters[e]={}),a.each(t,(function(a,t){if(void 0===t.def_min){var s=1===t.length||"AND"==lcmg.same_sect_cond?"AND":"OR",i="mg_item_categories"==a?"mgc_":a+"_";"."+i+t,n[i]={condition:s,val:t}}else m(e,t),n[t.name]={condition:"AND",val:[""]}})),void 0!==mg_grid_filters[e].mg_pag_&&(n.mg_pag_=mg_grid_filters[e].mg_pag_),void 0!==mg_grid_filters[e].mg_search_res&&(n.mg_search_res=mg_grid_filters[e].mg_search_res),mg_grid_filters[e]=n,mg_exec_filters(e);let s=a("#"+e+" .mg_box"),i=Object.keys(n);const _=i.indexOf("mg_pag_");-1!==_&&i.splice(_,1),i.length?(a.each(i,(function(e,t){if("mg_pag_"==t)return!0;var i=n[t];if("object"!=typeof i.val||!i.val.length||void 0===i.condition)return!0;if("AND"==i.condition){var _="";a.each(i.val,(function(a,e){_+="."+t+e}))}else{_=[];a.each(i.val,(function(a,e){_.push("."+t+e)})),_=_.join(" , ")}s=s.filter(_)})),a("#"+e).find(".mgaf_sect").not('.mgaf_search, [data-type="range"]').each((function(){"multi_opt"==a(this).data("type")&&"AND"==lcmg.same_sect_cond&&a(this).find(".mgaf_opts_list > li").not(".mgaf_sel_opt, .mgaf_fake_dd_search, .mgc_reset_filter").each((function(){const t=a(this).data("val"),n=a(this).parents(".mgaf_sect").data("sect"),i="mg_item_categories"==n&&"mgc_"==t.substr(0,4)?t:t.replace("mgc",n),_=s.filter("."+i).length;_?a(this).removeClass("mgaf_disabled_opt"):a(this).addClass("mgaf_disabled_opt"),a("#"+e).find(".mg_filter_count").length&&a(this).find(".mg_filter_count").text(_)}
1))}))):(a("#"+e+" .mgaf_opts_list > li.mgaf_disabled_opt").removeClass("mgaf_disabled_opt"),a("#"+e).find(".mg_filter_count").length&&(a("#"+e+" .mg_filter_count").remove(),mg_matches_per_filter(e)))},m=function(e,t){var n=t.min,s=t.max;a("#"+e+" .mg_box:not(.mg_spacer)").each((function(){var e=a(this).data(t.name);"NaN"!=e&&(e=parseInt(e,10))>=n&&e<=s&&a(this).addClass(t.name)}))},o=function(e,t){if(t.length){var n="";a.each(t,(function(e,t){if("string"==typeof t){var s=a('li[data-val="'+t+'"]').html();n+='<span data-val="'+t+'">'+s+"</span>"}else n+='<span data-range-name="'+t.name+'">'+t.icon+t.min+" - "+t.max+"</span>"})),e.addClass("mgaf_sumbar_shown"),e.find(".mgaf_sumbar > div").html(n),e.find(".mgaf_sumbar").removeClass("mg_displaynone")}else e.removeClass("mgaf_sumbar_shown"),e.find(".mgaf_sumbar").addClass("mg_displaynone"),e.find(".mgaf_sumbar > div").empty()};a(document).on("click",".mgaf_sumbar span",(function(e){var t=a(this),n=t.parents(".mg_grid_wrap");if(void 0!==t.data("range-name")){var s=n.find('[data-sect="'+t.data("range-name")+'"]'),i=s.find(".mgaf_range");s.find(".mgaf_range_min").val(i.data("min")),s.find(".mgaf_range_max").val(i.data("max")).trigger("keyup")}else n.find('.mgaf_fdd_opt[data-val="'+t.data("val")+'"]').trigger("click")})),a(document).on("click",".mgaf_reset_filters",(function(){a(this).parents(".mgaf_sumbar").find("div span").each((function(e,t){const n=a(this);setTimeout((function(){n.click()}),50*e)}))}));const g=function(e,t,n){e.find(".mgaf_sect").each((function(){if(a(this).hasClass("mgaf_search"))return!0;var e=a(this).data("sect"),s="mg_item_categories"==e?"category":e,i="mg_item_categories"==e?"mgc_"+t:e+"_"+t;if(void 0!==n[e]){var _=n[e],f=void 0===_.def_min?_.join(","):_.min+"-"+_.max;mg_set_deeplink(s,i,f)}else mg_remove_deeplink(s,i)}))};a(window).scroll((function(){l()})),a(window).on("mg_mobile_mode_switch",(function(){l()}));const l=function(){if(!parseInt(lcmg.sticky_side_filters,10))return!1;const e=a(".mg_grid_wrap").find(".mgaf_lside_blocks, .mgaf_rside_blocks"),t=window.pageYOffset;if(!e.length)return!0;e.each((function(){const e=a(this).parents(".mg_above_grid"),n=a(this).parents(".mg_grid_wrap"),s=n.find(".mg_items_container"),i=n.offset().top;if(i>t||n.hasClass("mg_mobile_mode"))e.css("top",0);else{let a=Math.floor(t-i)+20,n=Math.floor(s.outerHeight(!0)-e.outerHeight(!0))-20;if(n<1)return!0;a>n&&(a=n),e.css("top",a)}}))}}(jQuery);

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.