1"use strict";(self.webpackChunk_mvps_genesis_quickstart_theme=self.webpackChunk_mvps_genesis_quickstart_theme||[]).push([[1680],{1680:(e,t,s)=>{s.d(t,{Facets:()=>n});var i=s(1559);class n{#e;containerElement;showMoreElements;showMoreOptions;constructor(e){let{appliedFacetElements:t=".js-facets__applied-label",showMore:s={countAttribute:"data-facet-show-count",defaultCount:5,elements:".g-facet-set__list-show-more",lessTextAttribute:"data-facet-show-less-text",linkElementSelector:".g-facet-set__list-show-more-link",moreTextAttribute:"data-facet-show-more-text"}}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.#e=new i.A(this),this.containerElement=this.#e.isElement("containerElement",e),this.appliedFacetElements=this.#e.isElementList("appliedFacetElements",t),this.showMoreOptions=this.#e.isObject("showMore",s),this.#e.isString("showMore.countAttribute",this.showMoreOptions.countAttribute),this.#e.isInt("showMore.defaultCount",this.showMoreOptions.defaultCount),this.#e.isString("showMore.lessTextAttribute",this.showMoreOptions.lessTextAttribute),this.#e.isString("showMore.linkElementSelector",this.showMoreOptions.linkElementSelector),this.#e.isString("showMore.moreTextAttribute",this.showMoreOptions.moreTextAttribute),this.showMoreElements=this.#e.isElementList("showMore.elements",this.showMoreOptions.elements,{container:this.containerElement,required:!1}),this.bindEvents()}bindEvents(){this.bindFacetSetAccordions(),this.bindShowMoreEvents(),this.bindRangeSliders(),this.bindMediaQueryEvents(),this.bindAppliedFacetEvents()}bindFacetSetAccordions(){const e=this.containerElement.getElementsByClassName("g-facet-set");if(!e.length)return;const t="g-facet-set--collapsed";for(const s of e){const e=s.querySelector(".g-facet-set__list"),i=s.querySelector(".g-facet-set__label");if(!e||!i)return;i.addEventListener("click",(e=>{e.preventDefault(),s.classList.contains(t)?(s.classList.remove(t),i.setAttribute("aria-expanded","true")):(s.classList.add(t),i.setAttribute("aria-expanded","false"))}))}}bindShowMoreEvents(){if(!this.showMoreElements||!this.showMoreElements.length)return;const e="is-show-less";for(const t of this.showMoreElements){const s=t.querySelector(this.showMoreOptions.linkElementSelector),i=t.closest(".g-facet-set__list");if(!s||!i)return;const n=i.querySelectorAll(`.g-facet-set__list-item:not(${this.showMoreOptions.element})`);if(!n.length)return;let o=parseInt(t.getAttribute(this.showMoreOptions.countAttribute),10);o&&!isNaN(o)||(o=this.showMoreOptions.defaultCount);const r=s.getAttribute(this.showMoreOptions.moreTextAttribute)||"Show More",a=s.getAttribute(this.showMoreOptions.lessTextAttribute)||"Show Less";for(let e=0,t=n.length;e<t;e++)e>=o&&n[e].classList.add("u-hidden");s.addEventListener("click",(t=>{t.preventDefault();let i=!1;s.classList.contains(e)?s.classList.remove(e):(s.classList.add(e),i=!0);for(let e=0,t=n.length;e<t;e++){const t=n[e];e>=o&&!i?t.classList.add("u-hidden"):t.classList.remove("u-hidden")}s.textContent=i?a:r})),t.classList.remove("u-hidden")}}bindRangeSliders(){new MutationObserver(((e,t)=>{if("function"==typeof window.MMFacet_RangeSlider_Initialize){t.disconnect();let e=0;const s=this.containerElement.querySelectorAll("[data-mm-facet-rangeslider-name]");window.addEventListener("resize",(()=>{e&&window.cancelAnimationFrame(e),e=window.requestAnimationFrame((()=>{s.length&&window.MMFacet_RangeSlider_Initialize()}))}),!1)}})).observe(document,{childList:!0,subtree:!0})}bindMediaQueryEvents(){const e=window.matchMedia("(min-width: 60rem)");this.mediaChanged(e.matches),e.addEventListener("change",(e=>this.mediaChanged(e.matches)))}mediaChanged(e){if(e){if(window.MicroModal&&this.containerElement.classList.contains("is-open")){const e=this.containerElement.querySelector("[data-micromodal-close]");e&&e.click()}this.containerElement.setAttribute("aria-hidden","false")}else this.containerElement.setAttribute("aria-hidden","true")}bindAppliedFacetEvents(){for(const e of this.appliedFacetElements)e.addEventListener("click",(()=>this.clearAppliedFacet(e)))}clearAppliedFacet(e){const t=e.form;if(!t||"function"!=typeof window.MMProdList_UpdateQuery)return;const s=t.querySelector(`[name="${e.getAttribute("data-facet-code")}"]`);if(!s)return;if("SELECT"===s.nodeName)return s.value="",void window.MMProdList_UpdateQuery(s);const i=t.querySelector(`[name="${e.getAttribute("data-facet-code")}"][value="${e.getAttribute("data-facet-value")}"]`);i&&(i.checked=!1,window.MMProdList_UpdateQuery(i))}}}}]); 2//# sourceMappingURL=1680.0d9f1074bdcb6b34c1cf.chunk.js.map
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.