1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[81192],{1192:(e,t,i)=>{i.r(t),i.d(t,{default:()=>l});class l extends window.PluginBaseClass{static #e=this.options={elements:null,filterPanelItemSelector:".filter-panel-item",filterToggleSelector:".filter-panel-item-toggle",filterDropdownSelector:".filter-panel-item-dropdown",disableEmptyFilter:null,hideEmptyFilter:null};init(){this._filterPanels=this.el.querySelectorAll(this.options.filterPanelItemSelector),this._filterPanels.length&&(this._toggleFilterPanel(),this.options.disableEmptyFilter&&(this._observeFilterState(),this._registerEvents()))}_registerEvents(){let e=document.querySelector(".cms-element-product-listing-wrapper");if(!e)return;let t=window.PluginManager.getPluginInstanceFromElement(e,"Listing");t?.$emitter&&t.$emitter.subscribe("Listing/afterRenderResponse",()=>{this._filterPanels=this.el.querySelectorAll(this.options.filterPanelItemSelector),this.options.hideEmptyFilter?this._toggleFilterPanel():this._disableInactiveFilterOptions()})}_observeFilterState(){let e=null;(e=new MutationObserver(()=>{this._observerTick||(this._observerTick=!0,requestAnimationFrame(()=>{this._observerTick=!1,this.options.hideEmptyFilter?this._toggleFilterPanel():this._disableInactiveFilterOptions(),e&&(e.disconnect(),e=null)}))})).observe(this.el,{subtree:!0,attributes:!0,attributeFilter:["disabled"]}),this.options.hideEmptyFilter?this._toggleFilterPanel():this._disableInactiveFilterOptions()}_toggleFilterPanel(){let e=this._filterPanels,t=0;e.forEach(e=>{let i=this.options.elements;if(""===i||t<parseInt(i,10)){let t=e.querySelector(this.options.filterToggleSelector),i=e.querySelector(this.options.filterDropdownSelector);if(!t||!i)return;this.options.disableEmptyFilter&&this.options.hideEmptyFilter&&t.classList.contains("disabled")?(t.setAttribute("aria-expanded","false"),i.classList.remove("show")):(t.setAttribute("aria-expanded","true"),i.classList.add("show"))}t++}),this.$emitter.publish("onOpenFilterPanel")}_disableInactiveFilterOptions(){let e=this.el.querySelectorAll(this.options.filterPanelItemSelector);e?.length&&e.forEach(e=>{let t=e.querySelector(this.options.filterToggleSelector);if(!t||!(t.classList.contains("disabled")||t.hasAttribute("disabled")||"true"===t.getAttribute("aria-disabled")))return;let i=e.classList.contains("filter-multi-select")?e:null;if(!i)return;let l=window.PluginManager.getPluginInstancesFromElement(i),s=l.get("FilterMultiSelect")||l.get("FilterPropertySelect");if(!s)return;let r=s.options.checkboxSelector||".filter-multi-select-checkbox";i.querySelectorAll(r).forEach(e=>{e.checked||"function"!=typeof s.disableOption||s.disableOption(e)})})}}}}]);
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.