class n extends HTMLElement{constructor(){super(...arguments),this.unhidePopout=()=>{const t=new Promise(e=>{window?.addEventListener("scroll",()=>{e()},{once:!0})});Promise.any([t,i(2e3)]).then(()=>{this.container?.setAttribute("aria-hidden","false")})},this.toggle=()=>{if(!this.container||!this.toggleButton)return;const t=this.toggleButton.getAttribute("aria-expanded")==="true",e=t?"false":"true";this.toggleButton.setAttribute("aria-expanded",e),this.container.classList.toggle("expanded",!t),this.getSlotElements("collapsable").forEach(s=>{t?s.setAttribute("inert","true"):s.removeAttribute("inert")})}}connectedCallback(){this.container=this.getSlotElement("container"),this.toggleButton=this.getSlotElement("toggle-popout"),this.init()}init(){this.container?.addEventListener("click",this.toggle),this.unhidePopout()}getSlotElement(t){return this.querySelector(`[data-slot="${t}"]`)}getSlotElements(t){return Array.from(this.querySelectorAll(`[data-slot="${t}"]`))}}const i=o=>new Promise(t=>{window.setTimeout(t,o)});customElements.get("photos-qr-popout")||customElements.define("photos-qr-popout",n);