1var p=Object.defineProperty;var g=(o,t,e)=>t in o?p(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;var l=(o,t,e)=>g(o,typeof t!="symbol"?t+"":t,e);import{X as y,s as i,c as h}from"./index-B3F33_mG.js";var v=Object.defineProperty,C=Object.getOwnPropertyDescriptor,b=(o,t,e)=>t in o?v(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,f=(o,t,e,s)=>{for(var r=s>1?void 0:s?C(t,e):t,n=o.length-1,c;n>=0;n--)(c=o[n])&&(r=c(r)||r);return r},d=(o,t,e)=>b(o,typeof t!="symbol"?t+"":t,e);const u="xo-active",_="xo-main-collection__left",S="xo-main-collection__right",P="filter-content__grid--vertical",x="xo-main-collection__toggle-text";function D(o){return function(...t){document.startViewTransition?document.startViewTransition(()=>{o(...t)}):o(...t)}}let a=class extends y{constructor(){super(...arguments);l(this,"storageKeyMobile","currentColumnMobile");l(this,"storageKeyDesktop","currentColumnDesktop");l(this,"state",{isActive:!0,columnMobile:this.getInitialColumnMobile(),columnDesktop:this.getInitialColumnDesktop()});l(this,"handleClick",()=>{this.setState({isActive:!this.state.isActive})})}getInitialColumnMobile(){const t=i.getItem(this.storageKeyMobile);return t?Number(t):2}getInitialColumnDesktop(){const t=i.getItem(this.storageKeyDesktop);return t?Number(t):3}saveColumnToStorage(t,e){i.setItem(this.storageKeyMobile,t.toString()),i.setItem(this.storageKeyDesktop,e.toString())}mount(){this.addEventListener("click",D(this.handleClick)),window.addEventListener("beforeunload",()=>{i.removeItem(this.storageKeyMobile),i.removeItem(this.storageKeyDesktop)})}updateSidebar(){const{isActive:t}=this.state,e=document.querySelector(`.${_}`),s=document.querySelector(`.${S}`);e&&s&&(t!==!0?(e.classList.add(u),s.classList.add(u),s.style.setProperty("--lg","12"),s.style.setProperty("--md","12")):(e.classList.remove(u),s.classList.remove(u),s.style.setProperty("--lg","9"),s.style.setProperty("--md","8")))}updateButtonText(){const{isActive:t}=this.state,e=document.querySelector(`.${x}`);e&&(t===!0?e.textContent="Hide filter":e.textContent="Show filter")}updateGrid(){const{isActive:t}=this.state,{xoColumnDesktop:e}=this.props,{xoColumnMobile:s}=this.props,r=document.querySelector(`.${P}`);r&&(t===!0?(r.style.setProperty("--md",`${s}`),r.style.setProperty("--lg",`${e}`),this.saveColumnToStorage(s,e)):(r.style.setProperty("--md",`${s+1}`),r.style.setProperty("--lg",`${e+1}`),this.saveColumnToStorage(s+1,e+1)))}stateUpdate(){const{isActive:t}=this.state;this.updateSidebar(),this.updateButtonText(),this.updateGrid(),this.setProps({xoActive:t})}unmount(){this.removeEventListener("click",this.handleClick)}};d(a,"propTypes",{xoActive:"boolean",xoColumnDesktop:"number",xoColumnMobile:"number"});d(a,"observedProps",["xoActive"]);a=f([h("xo-show-hide-button")],a);const m=document.querySelector("xo-filters-content");m&&m.handleContent(o=>{const t=new DOMParser().parseFromString(o,"text/html"),e=i.getItem("currentColumnMobile"),s=i.getItem("currentColumnDesktop"),r=t.querySelector(".filter-content__grid--vertical");if(r){const n=r.style.getPropertyValue("--md"),c=r.style.getPropertyValue("--lg");e&&s?(r.style.setProperty("--md",e),r.style.setProperty("--lg",s)):(r.style.setProperty("--md",n),r.style.setProperty("--lg",c))}return t.body.innerHTML});export{a as ShowHideButton};
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.