1"use strict";(globalThis.webpackChunk=globalThis.webpackChunk||[]).push([[498],{2604:(e,t,i)=>{i.r(t),i.d(t,{init:()=>g});var r=i(5152),s=i(414),o=i(1669),n=i.n(o),l=i(3776),a=i(9472),p=i.n(a),u=n()('link[rel="https://api.w.org/"]').attr("href"),h=new(p()),c=n()("html, body"),d=n()(".site-container"),f=[];function g(){document.querySelectorAll(".c-brand-explorer").forEach(function(e){return f.push(new $(e))})}var $=function(){return(0,s.A)(function e(t){if((0,r.A)(this,e),this.$el=n()(t),this.$generalGroup=this.$el.find(".c-brand-group--general"),this.$generalGroupTitle=this.$generalGroup.find(".c-section-header__heading"),this.$generalGroupItems=this.$generalGroup.find(".c-brand-group__item"),this.$categoryFilter=this.$el.find(".c-brand-explorer__filter-select"),this.$input=this.$el.find(".c-brand-explorer__filter-col-input input"),this.$allButtons=this.$el.find(".js-brand-explorer-all"),this.$bottomAllButton=this.$el.find(".c-brand-explorer__all-button"),this.$closeButton=this.$el.find(".c-brand-explorer__close-button"),this.isPopup=this.$el.hasClass("c-brand-explorer--popup"),this.areBrandGroupsLoaded=!1,this.isPopup&&(this.$el.parents(".c-brand-explorer-promo").find(".c-brand-explorer-promo__link").on("click",function(e){e.preventDefault(),this.setVisible(!0)}.bind(this)),this.$popupWrapper=n()('<div class="c-brand-explorer--popup-wrapper">').appendTo(n()("body")),this.$el.appendTo(this.$popupWrapper),this.$closeButton.on("click",function(e){e.preventDefault(),this.setVisible(!1)}.bind(this)),n()(window).on("keydown",this.onKeyDown.bind(this))),this.$categoryFilter.on("change",function(e){var t=n()(e.target),i=t.val();if(this.clearInput(),""!==i){var r=n().parseJSON(i);this.setFilter(r,t.find("option:selected").text().trim())}else this.setFilter("*")}.bind(this)),this.$input.on("keydown cut paste",function(e){this.clearCategoryFilter(),setTimeout(function(){var t=n()(e.target).val();this.setFilter(t)}.bind(this))}.bind(this)),this.$input.on("keyup",function(e){13===e.keyCode&&(this.$input.blur(),this.scrollToResults())}.bind(this)),this.$allButtons.on("click",function(e){e.preventDefault(),this.clearInput(),this.clearCategoryFilter(),this.setFilter("*"),this.scrollToResults()}.bind(this)),!this.isPopup){var i=h.query(!0);i.hasOwnProperty("filter")?this.setInput(i.filter):i.hasOwnProperty("group")&&this.setCategoryFilter(i.group)}},[{key:"scrollToResults",value:function(){var e=this.$el.find(".js-brand-explorer-group-anchor").offset().top;c.animate({scrollTop:e},"slow")}},{key:"setVisible",value:function(e){var t,i;e?(this.previousScroll=(t=n()("html").scrollTop(),i=n()("body").scrollTop(),t||i),this.$popupWrapper.fadeIn(250,"easeOutQuad",function(){this.$popupWrapper.css("position","absolute"),d.hide(),c.scrollTop(0)}.bind(this)),this.areBrandGroupsLoaded||(this.areBrandGroupsLoaded=!0,n().ajax({type:"GET",url:u+"hormel_foods/v1/brandgroups"}).done(function(e,t,i){this.$bottomAllButton.before(e),this.$el.find(".c-brand-explorer__loader").remove(),(0,l.refresh)(),this.$generalGroup=this.$el.find(".c-brand-group--general"),this.$generalGroupTitle=this.$generalGroup.find(".c-section-header__heading"),this.$generalGroupItems=this.$generalGroup.find(".c-brand-group__item")}.bind(this)))):(d.show(),c.scrollTop(this.previousScroll),this.$popupWrapper.css("position","fixed"),this.$popupWrapper.fadeOut(250,"easeInQuad"))}},{key:"setGroupName",value:function(e){e||(e="All Brands"),this.$generalGroupTitle.text(e)}},{key:"setFilter",value:function(e,t){this.isPopup||"undefined"==typeof history||"function"!=typeof history.replaceState||(e?t?(h.setQuery("group",t),h.removeQuery("filter")):"*"===e?(h.setQuery("group","all"),h.removeQuery("filter")):(h.setQuery("filter",e),h.removeQuery("group")):(h.removeQuery("filter"),h.removeQuery("group")),history.replaceState("","",h.toString())),"*"===e||""===e?(this.setGroupName("All Brands"),this.$bottomAllButton.hide(),this.$generalGroupItems.show()):"string"==typeof e?(this.setGroupName("Search Results"),this.$bottomAllButton.css("display","inline-block"),e=(e=e.toLowerCase()).replace(/[^à áäâèéëêìÃïîòóöôùúüûñça-zA-Z0-9]/gi,""),this.$generalGroupItems.each(function(){var t=n()(this);-1!==t.data("brand-slug").indexOf(e)?t.show():t.hide()})):(this.setGroupName(t),this.$bottomAllButton.css("display","inline-block"),this.$generalGroupItems.each(function(){var t=n()(this),i=parseInt(t.data("brand-id"));-1!==n().inArray(i,e)?t.show():t.hide()})),this.$generalGroupItems.is(":visible")?this.$generalGroup.removeClass("c-brand-group--is-empty"):this.$generalGroup.addClass("c-brand-group--is-empty")}},{key:"clearInput",value:function(){this.$input.val("")}},{key:"setInput",value:function(e){this.$input.val(e),this.$input.trigger("keydown")}},{key:"clearCategoryFilter",value:function(){this.$categoryFilter.val("")}},{key:"setCategoryFilter",value:function(e){var t=this.$categoryFilter.find('option:contains("'+e+'")');t.length?(this.$categoryFilter.val(t.val()),this.$categoryFilter.trigger("change")):"all"===e&&(this.clearCategoryFilter(),this.setFilter("*"))}}
1,{key:"onKeyDown",value:function(e){27===e.keyCode&&this.setVisible(!1)}}])}()}}]);
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.