1function f(t){this.listenerMap=[{},{}],t&&this.root(t),this.handle=f.prototype.handle.bind(this),this._removedListeners=[]}f.prototype.root=function(t){const e=this.listenerMap;let i;if(this.rootElement){for(i in e[1])e[1].hasOwnProperty(i)&&this.rootElement.removeEventListener(i,this.handle,!0);for(i in e[0])e[0].hasOwnProperty(i)&&this.rootElement.removeEventListener(i,this.handle,!1)}if(!t||!t.addEventListener)return this.rootElement&&delete this.rootElement,this;this.rootElement=t;for(i in e[1])e[1].hasOwnProperty(i)&&this.rootElement.addEventListener(i,this.handle,!0);for(i in e[0])e[0].hasOwnProperty(i)&&this.rootElement.addEventListener(i,this.handle,!1);return this};f.prototype.captureForType=function(t){return["blur","error","focus","load","resize","scroll"].indexOf(t)!==-1};f.prototype.on=function(t,e,i,n){let l,h,s,o;if(!t)throw new TypeError("Invalid event type: "+t);if(typeof e=="function"&&(n=i,i=e,e=null),n===void 0&&(n=this.captureForType(t)),typeof i!="function")throw new TypeError("Handler must be a type of Function");return l=this.rootElement,h=this.listenerMap[n?1:0],h[t]||(l&&l.addEventListener(t,this.handle,n),h[t]=[]),e?/^[a-z]+$/i.test(e)?(o=e,s=p):/^#[a-z0-9\-_]+$/i.test(e)?(o=e.slice(1),s=E):(o=e,s=Element.prototype.matches):(o=null,s=g.bind(this)),h[t].push({selector:e,handler:i,matcher:s,matcherParam:o}),this};f.prototype.off=function(t,e,i,n){let l,h,s,o,a;if(typeof e=="function"&&(n=i,i=e,e=null),n===void 0)return this.off(t,e,i,!0),this.off(t,e,i,!1),this;if(s=this.listenerMap[n?1:0],!t){for(a in s)s.hasOwnProperty(a)&&this.off(a,e,i);return this}if(o=s[t],!o||!o.length)return this;for(l=o.length-1;l>=0;l--)h=o[l],(!e||e===h.selector)&&(!i||i===h.handler)&&(this._removedListeners.push(h),o.splice(l,1));return o.length||(delete s[t],this.rootElement&&this.rootElement.removeEventListener(t,this.handle,n)),this};f.prototype.handle=function(t){let e,i;const n=t.type;let l,h,s,o,a=[],r;const c="ftLabsDelegateIgnore";if(t[c]===!0)return;switch(r=t.target,r.nodeType===3&&(r=r.parentNode),r.correspondingUseElement&&(r=r.correspondingUseElement),l=this.rootElement,h=t.eventPhase||(t.target!==t.currentTarget?3:2),h){case 1:a=this.listenerMap[1][n];break;case 2:this.listenerMap[0]&&this.listenerMap[0][n]&&(a=a.concat(this.listenerMap[0][n])),this.listenerMap[1]&&this.listenerMap[1][n]&&(a=a.concat(this.listenerMap[1][n]));break;case 3:a=this.listenerMap[0][n];break}let d=[];for(i=a.length;r&&i;){for(e=0;e<i&&(s=a[e],!!s);e++)r.tagName&&["button","input","select","textarea"].indexOf(r.tagName.toLowerCase())>-1&&r.hasAttribute("disabled")?d=[]:s.matcher.call(r,s.matcherParam,r)&&d.push([t,r,s]);if(r===l||(i=a.length,r=r.parentElement||r.parentNode,r instanceof HTMLDocument))break}let u;for(e=0;e<d.length;e++)if(!(this._removedListeners.indexOf(d[e][2])>-1)&&(o=this.fire.apply(this,d[e]),o===!1)){d[e][0][c]=!0,d[e][0].preventDefault(),u=!1;break}return u};f.prototype.fire=function(t,e,i){return i.handler.call(e,t,e)};function p(t,e){return t.toLowerCase()===e.tagName.toLowerCase()}function g(t,e){return this.rootElement===window?e===document||e===document.documentElement||e===window:this.rootElement===e}function E(t,e){return t===e.id}f.prototype.destroy=function(){this.off(),this.root()};function m(t,e,i={}){t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:i}))}function b(t,e,i={}){t.dispatchEvent(new CustomEvent(e,{bubbles:!1,detail:i}))}const w=class extends HTMLElement{constructor(){super(),this._hasSectionReloaded=!1,Shopify.designMode&&this.rootDelegate.on("shopify:section:select",t=>{const e=this.closest(".shopify-section");t.target===e&&t.detail.load&&(this._hasSectionReloaded=!0)})}getTemplate(t){const e=this.querySelector(t);if(!e||e.tagName!=="TEMPLATE")return"";const i=document.createElement("div");return i.appendChild(e.content.firstElementChild.cloneNode(!0)),i.innerHTML}get rootDelegate(){return this._rootDelegate=this._rootDelegate||new f(document.documentElement)}get delegate(){return this._delegate=this._delegate||new f(this)}showLoadingBar(){m(document.documentElement,"theme:loading:start")}hideLoadingBar(){m(document.documentElement,"theme:loading:end")}untilVisible(t={rootMargin:"30px 0px",threshold:0}){const e=()=>{this.classList.add("became-visible"),this.style.opacity="1"};return new Promise(i=>{window.IntersectionObserver?(this.intersectionObserver=new IntersectionObserver(n=>{n[0].isIntersecting&&(this.intersectionObserver.disconnect(),requestAnimationFrame(()=>{i(),e()}))},t),this.intersectionObserver.observe(this)):(i(),e())})}disconnectedCallback(){var t;this.delegate.destroy(),this.rootDelegate.destroy(),(t=this.intersectionObserver)==null||t.disconnect(),delete this._delegate,delete this._rootDelegate}};export{w as C,f as D,b as a,m as t};
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.