PageSourceSearch

https://www.drinktrade.com/cdn/shop/t/2106/assets/bundle.section.t…?v=153964842993851873811790173859

js drinktrade.com collected 2026-09-24 18:21:12 UTC 5,626 bytes, 2 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._posthogChunkIds=e._posthogChunkIds||{},e._posthogChunkIds[n]="01a0ceac-880b-7661-860d-e593e8692b47")}catch(e){}}();(()=>{"use strict";var e=["main#MainContent","main"],t={threshold:[0]},i="data-sticky-cta-suppressed";class s{constructor(e){this.element=e,this.showOn=e.dataset.showOn||"both",this.sectionName=e.dataset.sgSection||"Trade Sticky CTA",this.isVisible=!1,this.isWired=!1,this.thresholdArmed=!1,this.intersectingCTAs=new Set,this.observedCTAs=new Set,this.intersectionObserver=null,this.contentObserver=null,this.suppressionObserver=null,this.visibilityEventTimer=null,this.reportedVisibility=!1,this.reportedCTAs=new Set,this.handleScroll=()=>this.evaluateScrollThreshold(),this.handleResize=()=>this.evaluateScrollThreshold(),this.mediaQuery=window.matchMedia("(min-width: 768px)"),this.handleViewport=()=>this.activateCurrentPlatform(),this.mediaQuery.addEventListener("change",this.handleViewport),this.watchSuppression(),this.activateCurrentPlatform()}get currentPlatform(){return this.mediaQuery.matches?"desktop":"mobile"}get isSuppressed(){return document.body.hasAttribute(i)}isPlatformEnabled(e){return"both"===this.showOn||this.showOn===e}activateCurrentPlatform(){this.isPlatformEnabled(this.currentPlatform)&&!this.isWired&&(this.isWired=!0,this.watchScrollThreshold(),this.observeInlineCTAs(),this.watchContentChanges()),this.updateVisibility()}watchScrollThreshold(){this.evaluateScrollThreshold(),this.thresholdArmed||(document.addEventListener("scroll",this.handleScroll,{passive:!0,capture:!0}),window.addEventListener("resize",this.handleResize,{passive:!0}))}getScrollOffset(){if(window.scrollY>0)return window.scrollY;var e=this.getContentRoot();return(null==e?void 0:e.scrollTop)||0}evaluateScrollThreshold(){this.thresholdArmed||this.getScrollOffset()<.5*window.innerHeight||(this.thresholdArmed=!0,this.stopWatchingScrollThreshold(),this.updateVisibility())}stopWatchingScrollThreshold(){document.removeEventListener("scroll",this.handleScroll,{capture:!0}),window.removeEventListener("resize",this.handleResize)}getContentRoot(){var t=e.reduce((e,t)=>e||document.querySelector(t),null);return t||document.body}getInlineCTAs(){return Array.from(this.getContentRoot().querySelectorAll('[data-element-type="cta"]')).filter(e=>!e.closest("[data-trade-sticky-cta]"))}observeInlineCTAs(){this.intersectionObserver||(this.intersectionObserver=new IntersectionObserver(e=>{e.forEach(e=>{this.reportedCTAs.add(e.target),e.isIntersecting?this.intersectingCTAs.add(e.target):this.intersectingCTAs.delete(e.target)}),this.updateVisibility()},t));var e=new Set(this.getInlineCTAs());e.forEach(e=>{this.observedCTAs.has(e)||(this.intersectionObserver.observe(e),this.observedCTAs.add(e))}),this.observedCTAs.forEach(t=>{e.has(t)||(this.intersectionObserver.unobserve(t),this.observedCTAs.delete(t),this.intersectingCTAs.delete(t),this.reportedCTAs.delete(t))}),this.updateVisibility()}refreshInlineCTAs(){this.intersectionObserver&&this.observeInlineCTAs()}watchContentChanges(){var e=this.getContentRoot();this.contentObserver=new MutationObserver(()=>this.observeInlineCTAs()),this.contentObserver.observe(e,{childList:!0,subtree:!0})}watchSuppression(){this.suppressionObserver=new MutationObserver(()=>this.updateVisibility()),this.suppressionObserver.observe(document.body,{attributes:!0,attributeFilter:[i]})}updateVisibility(){var e=this.reportedCTAs.size===this.observedCTAs.size,t=this.isPlatformEnabled(this.currentPlatform)&&this.thresholdArmed&&e&&0===this.intersectingCTAs.size&&!this.isSuppressed;t!==this.isVisible&&(this.isVisible=t,this.element.classList.toggle("is-visible",this.isVisible),this.scheduleVisibilityEvent())}scheduleVisibilityEvent(){clearTimeout(this.visibilityEventTimer),this.visibilityEventTimer=setTimeout(()=>{this.visibilityEventTimer=null,this.isVisible!==this.reportedVisibility&&(this.reportedVisibility=this.isVisible,this.emitVisibilityEvent(this.isVisible))},150)}emitVisibilityEvent(e){var t={visible:e,section_name:this.sectionName};this.element.dispatchEvent(new CustomEvent("sticky-cta:visibility-changed",{detail:t,bubbles:!0})),"function"!=typeof window.tradeTrack||window.tradeTrack("Sticky CTA Visibility Changed",t)}destroy(){this.mediaQuery.removeEventListener("change",this.handleViewport),this.stopWatchingScrollThreshold(),[this.intersectionObserver,this.contentObserver,this.suppressionObserver].forEach(e
1=>null==e?void 0:e.disconnect()),this.intersectionObserver=null,this.contentObserver=null,this.suppressionObserver=null,clearTimeout(this.visibilityEventTimer),this.visibilityEventTimer=null,this.intersectingCTAs.clear(),this.observedCTAs.clear(),this.reportedCTAs.clear(),this.isWired=!1,this.isVisible=!1,this.element.classList.remove("is-visible")}}var r=new WeakMap;function n(){document.querySelectorAll("[data-trade-sticky-cta]").forEach(e=>{r.has(e)||r.set(e,new s(e))})}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",n):n(),window.Shopify&&window.Shopify.designMode&&(document.addEventListener("shopify:section:load",e=>{e.target.querySelector("[data-trade-sticky-cta]")&&n(),document.querySelectorAll("[data-trade-sticky-cta]").forEach(e=>{var t;null==(t=r.get(e))||t.refreshInlineCTAs()})}),document.addEventListener("shopify:section:unload",e=>{var t;(t=e.target.querySelector("[data-trade-sticky-cta]"))&&r.has(t)&&(r.get(t).destroy(),r.delete(t))}))})();
2//# chunkId=01a0ceac-880b-7661-860d-e593e8692b47

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.