1import{ResizeNotifier,prefersReducedMotion,yieldToMainThread}from"@theme/utilities";import{Component}from"@theme/component";import{getScrollContainer,getScrollTop}from"@theme/scroll-container";class JumboText extends Component{connectedCallback(){super.connectedCallback(),this.#setIntersectionObserver(),window.addEventListener("resize",this.#windowResizeListener)}disconnectedCallback(){super.disconnectedCallback(),this.#resizeObserver.disconnect(),this.#intersectionObserver?.disconnect(),window.removeEventListener("resize",this.#windowResizeListener)}#firstResize=!0;#setIntersectionObserver(){this.#intersectionObserver=new IntersectionObserver(entries=>{const entry=entries[entries.length-1];entry&&(entry.isIntersecting&&this.#firstResize&&this.#handleResize(entry.boundingClientRect.width),this.dataset.textEffect&&this.dataset.textEffect!=="none"&&!prefersReducedMotion()&&(entry.intersectionRatio>=.3?(this.classList.add("ready"),this.dataset.animationRepeat==="false"&&this.#intersectionObserver?.unobserve(entry.target),yieldToMainThread().then(()=>{this.classList.add("jumbo-text-visible")})):this.classList.remove("ready","jumbo-text-visible")))},{threshold:[0,.3]}),this.#intersectionObserver?.observe(this)}#calculateOptimalFontSize=containerWidth=>{const{widestChild:firstPassWidestChild,widestChildWidth:firstPassWidestChildWidth}=this.#findWidestChild();if(!firstPassWidestChild||!firstPassWidestChildWidth)return;const currentFontSize=parseFloat(window.getComputedStyle(firstPassWidestChild).fontSize),firstPassFontSize=Math.round(currentFontSize*containerWidth/firstPassWidestChildWidth*100)/100;this.#resizeObserver.disconnect(),this.style.fontSize=this.#clampFontSize(firstPassFontSize);const{widestChild:secondPassWidestChild,widestChildWidth:secondPassWidestChildWidth}=this.#findWidestChild();if(!secondPassWidestChild||!secondPassWidestChildWidth)return;const secondPassFontSize=Math.min(Math.floor(firstPassFontSize*containerWidth/secondPassWidestChildWidth*100)/100-.15,firstPassFontSize);secondPassFontSize!==firstPassFontSize&&(this.style.fontSize=this.#clampFontSize(secondPassFontSize)),this.classList.add("ready"),this.#resizeObserver.observe(this)};#findWidestChild=()=>{let widestChild=null,widestChildWidth=0;for(const child of this.children){if(!(child instanceof HTMLElement))continue;const{width:childWidth}=child.getBoundingClientRect();(!widestChild||childWidth>widestChildWidth)&&(widestChildWidth=childWidth,widestChild=child)}return{widestChild,widestChildWidth}};#clampFontSize=fontSize=>`${Math.min(Math.max(fontSize,1),500)}px`;#handleResize=(containerWidth=void 0)=>{if(!this.textContent?.trim()||(containerWidth===void 0&&(containerWidth=this.offsetWidth),containerWidth<=0)||(this.#firstResize||(this.classList.remove("ready"),this.style.fontSize=""),this.#calculateOptimalFontSize(containerWidth),this.#firstResize=!1,this.dataset.capText==="true"))return;const allSections=Array.from(document.querySelectorAll(".shopify-section")),lastSection=allSections[allSections.length-1];if(lastSection&&!lastSection.contains(this))return;const bottom=this.getBoundingClientRect().bottom+getScrollTop(),distanceFromBottom=getScrollContainer().scrollHeight-bottom;this.dataset.capText=(distanceFromBottom<=100).toString()};#windowResizeListener=()=>this.#handleResize();#resizeObserver=new ResizeNotifier(entries=>this.#handleResize(entries[0]?.borderBoxSize?.[0]?.inlineSize));#intersectionObserver=null}customElements.get("jumbo-text")||customElements.define("jumbo-text",JumboText); 2//# sourceMappingURL=/cdn/shop/t/145/assets/jumbo-text.js.map?v=40893161465570559361782552074
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.