1import{mediaQueryLarge,isMobileBreakpoint}from"@theme/utilities";const supportsInterpolateSize=typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("interpolate-size","allow-keywords");class AccordionCustom extends HTMLElement{get details(){const details=this.querySelector("details");if(!(details instanceof HTMLDetailsElement))throw new Error("Details element not found");return details}get summary(){const summary=this.details.querySelector("summary");if(!(summary instanceof HTMLElement))throw new Error("Summary element not found");return summary}get content(){return this.details.querySelector(".details__content")}get#disableOnMobile(){return this.dataset.disableOnMobile==="true"}get#disableOnDesktop(){return this.dataset.disableOnDesktop==="true"}get#closeWithEscape(){return this.dataset.closeWithEscape==="true"}#controller=new AbortController;#isAnimating=!1;connectedCallback(){const{signal}=this.#controller;this.#setDefaultOpenState(),this.addEventListener("keydown",this.#handleKeyDown,{signal}),this.summary.addEventListener("click",this.handleClick,{signal}),mediaQueryLarge.addEventListener("change",this.#handleMediaQueryChange,{signal}),supportsInterpolateSize||this.classList.add("accordion-custom--safari-fallback")}disconnectedCallback(){this.#controller.abort()}handleClick=event=>{const isCurrentlyOpen=this.details.open,isMobile=isMobileBreakpoint(),isDesktop=!isMobile;if(isMobile&&this.#disableOnMobile||isDesktop&&this.#disableOnDesktop){event.preventDefault();return}if(!supportsInterpolateSize&&this.content){if(event.preventDefault(),this.#isAnimating)return;isCurrentlyOpen?this.#animateClose():this.#animateOpen()}if(!!isCurrentlyOpen)return;const parent=this.parentElement;if(!parent)return;parent.querySelectorAll("accordion-custom").forEach(accordion=>{if(accordion===this)return;const details=accordion.querySelector("details");details instanceof HTMLDetailsElement&&details.open&&(!supportsInterpolateSize&&accordion instanceof AccordionCustom&&typeof accordion.closeWithAnimation=="function"?accordion.closeWithAnimation():details.open=!1)})};#animateOpen(){const content=this.content;if(!content)return;this.#isAnimating=!0,this.details.open=!0;const height=content.scrollHeight;content.style.height="0px",content.style.opacity="0",content.style.overflow="hidden",content.offsetHeight,content.style.transition="height var(--animation-speed-slow, 0.3s) var(--animation-easing, ease), opacity var(--animation-speed-slow, 0.3s) var(--animation-easing, ease)",content.style.height=`${height}px`,content.style.opacity="1";const onTransitionEnd=()=>{content.removeEventListener("transitionend",onTransitionEnd),content.style.height="",content.style.overflow="",content.style.transition="",this.#isAnimating=!1};content.addEventListener("transitionend",onTransitionEnd)}#animateClose(){const content=this.content;if(!content)return;this.#isAnimating=!0;const height=content.scrollHeight;content.style.height=`${height}px`,content.style.overflow="hidden",content.offsetHeight,content.style.transition="height var(--animation-speed-slow, 0.3s) var(--animation-easing, ease), opacity var(--animation-speed-slow, 0.3s) var(--animation-easing, ease)",content.style.height="0px",content.style.opacity="0";const onTransitionEnd=()=>{content.removeEventListener("transitionend",onTransitionEnd),this.details.open=!1,content.style.height="",content.style.overflow="",content.style.opacity="",content.style.transition="",this.#isAnimating=!1};content.addEventListener("transitionend",onTransitionEnd)}closeWithAnimation(){this.#isAnimating||!this.details.open||this.#animateClose()}#handleMediaQueryChange=()=>{};#setDefaultOpenState(){const isMobile=isMobileBreakpoint();this.details.open=isMobile&&this.hasAttribute("open-by-default-on-mobile")||!isMobile&&this.hasAttribute("open-by-default-on-desktop")}#handleKeyDown(event){event.key==="Escape"&&this.#closeWithEscape&&(event.preventDefault(),this.details.open=!1,this.summary.focus())}}customElements.get("accordion-custom")||customElements.define("accordion-custom",AccordionCustom); 2//# sourceMappingURL=/cdn/shop/t/23/assets/accordion-custom.js.map?v=146803526589405089001790875708
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.