PageSourceSearch

https://www.bundabergrum.com.au/cdn/shop/t/32/assets/m-data-layer-inject.js?v=67355457222415189291790855085

js bundabergrum.com.au collected 2026-10-02 11:29:55 UTC 8,844 bytes, 2 lines download raw bytes

1window.dataLayer=window.dataLayer||[],(()=>{class DiageoDatalayerQueue{constructor(){this.queue=[],this.formatters=Object.create(null),this._sentEvents=new Set,this._pageViewSent=!1,this._pageViewGivenUp=!1,this._heldUntilPageViewEvents=new Set(["collection_viewed","search_submitted","search","view_item_list"])}applyFormatter(e){if(!e?.event)return;const formatter=this.formatters[e.event];return formatter?formatter({eventObj:e.data}):e}push(e){const key=e?.event?`${e.event}:${e.data?.timestamp}`:null;key&&this._sentEvents.has(key)||(this.queue.push(e),this.processQueue())}processQueue(){if(window.gtmId&&!window.dataLayer.some(e=>e.event=="gtm.js")&&!this._gtmTimedOut){this._gtmFallbackTimer||(this._gtmFallbackTimer=setTimeout(()=>{console.warn("[dataLayerQueue] gtm.js did not fire within timeout \u2014 flushing anyway"),this._gtmTimedOut=!0,this.flushAll()},8e3));return}if(!(window.dataLayer.some(e=>e.event=="gateway"&&["Completed","Bypass"].includes(e.gateway_status))||this.hasGatewayPassedCookie())&&!this._gatewayTimedOut){this._gatewayFallbackTimer||(this._gatewayFallbackTimer=setTimeout(()=>{console.warn("[dataLayerQueue] gateway not resolved within timeout \u2014 flushing anyway"),this._gatewayTimedOut=!0,this.flushAll()},8e3));return}if(window.dataLayer.some(e=>e.event=="page_view")){this._pageViewSent=!0,this.queue=this.queue.filter(e=>e.event!=="page_viewed"),this.flushAll();return}const pageViewEvent=this.queue.find(e=>e.event=="page_viewed");if(pageViewEvent&&!this._pageViewSent){this.sendEvent(pageViewEvent),this.flushAll();return}!this._pageViewTimedOut&&!this._pageViewFallbackTimer&&(this._pageViewFallbackTimer=setTimeout(()=>{console.warn("[dataLayerQueue] no page_view/page_viewed within timeout \u2014 flushing anyway"),this._pageViewTimedOut=!0,this._pageViewGivenUp=!0,this.flushAll()},8e3))}hasGatewayPassedCookie(){return document.cookie.split(";").some(c=>c.trim().startsWith("diageo-gateway="))}flushAll(){const toProcess=this.queue;this.queue=[],toProcess.forEach(e=>this.sendEvent(e))}sendEvent(e){if(!e?.event||e.event==="page_viewed"&&this._pageViewSent)return;if(this._heldUntilPageViewEvents.has(e.event)&&!this._pageViewSent&&!this._pageViewGivenUp){this.queue.push(e);return}let formatedEvent;try{formatedEvent=this.applyFormatter(e)}catch(err){console.error("[dataLayerQueue] formatter failed for",e.event,err);return}if(formatedEvent){if(formatedEvent.event==="view_item_list"){const listId=formatedEvent.ecommerce?.items?.[0]?.item_list_id,listKey=`view_item_list:${listId}`;if(listId!==void 0&&this._sentEvents.has(listKey))return;listId!==void 0&&this._sentEvents.add(listKey)}if(formatedEvent.event==="search"){const searchKey=`search:${formatedEvent.search_term}`;if(formatedEvent.search_term!==void 0&&this._sentEvents.has(searchKey))return;formatedEvent.search_term!==void 0&&this._sentEvents.add(searchKey)}this.queue=this.queue.filter(_e=>_e.event!==e.event),window.dataLayer.push(formatedEvent),e.event==="page_viewed"&&(this._pageViewSent=!0);const key=e?.event?`${e.event}:${e.data?.timestamp}`:null;key&&this._sentEvents.add(key)}}}const dataLayerQueue=new DiageoDatalayerQueue,originalPush=window.dataLayer.push;window.dataLayer.push=function(...args){return dataLayerQueue.processQueue(),originalPush.apply(this,args)},window.dataLayerFormatters=formattersPatch=>{formattersPatch&&typeof formattersPatch=="object"&&Object.assign(dataLayerQueue.formatters,formattersPatch)},window.dataLayerPush=ctx=>{dataLayerQueue.push({...ctx})},window.addEventListener("message",function(e){e.data?.source!=="shopify-pixel"&&e.origin==null||dataLayerQueue.push({...e.data})}),document.querySelector("cart-drawer-component")?.addEventListener("dialog:open",async()=>{const cart=await(await fetch("/cart.js")).json();cart&&window.dataLayerPush({event:"cart_drawer_viewed",data:{timestamp:new Date().toISOString(),data:{cart}}})}),document.querySelector("#ResultsList")?.addEventListener("click",event=>{const link=(event.target instanceof Element?event.target:null)?.closest("product-card a");if(!link)return;const productCard=link.closest("product-card");if(!productCard)return;const productId=productCard.dataset.productId;if(!productId||!productId)return;const collectionItemsData=localStorage.getItem("lastViewedCollectionItems"),selectedItem=((collectionItemsData2,targetId)=>{if(!collectionItemsData2||!targetId)return;let parsedData;try{parsedData=JSON.parse(collectionItemsData2)}catch{return}const items=parsedData?.items;if(!Array.isArray(items))return;const item=items.find(listItem=>String(listItem?.id)===String(targetId));if(item)return{item,currency:parsedData?.currency||void 0,value:item?.price||void 0}})(collectionItemsData,productId);
1if(!selectedItem?.item){console.warn("[dataLayer] select_item item not found",{productId});return}window.dataLayerPush({event:"collection_selected_item",data:{timestamp:new Date().toISOString(),data:{payload:{currency:selectedItem.currency,value:selectedItem.value,item:selectedItem.item}}}})});const globalEventsConfig=(()=>{const jsonNode=document.querySelector('script[type="application/json"]#DataLayerGlobalEventsConfigJSON');if(!jsonNode)return;const textContent=jsonNode.textContent?.trim();if(textContent)try{return JSON.parse(textContent)}catch(error){console.error(error);return}})();if(!globalEventsConfig){console.error("Global events config for data layer is not defined");return}if(globalEventsConfig.outboundClickEnabled){const pushOutboundClick=(link,outboundLinkType)=>{try{new URL(link.href).host!==window.location.host&&window.dataLayerPush({event:"outbound_click",data:{timestamp:new Date().toISOString(),data:{linkName:link.textContent?.trim()||void 0,linkUrl:link.href,outboundLinkType}}})}catch{}};document.addEventListener("click",function(e){const target=e.target instanceof HTMLElement?e.target:null,link=target?.closest("a[href]");if(!link)return;let outboundLinkType;target?.closest("nav")?outboundLinkType="Navigation":target?.closest("footer")?outboundLinkType="Footer":outboundLinkType="Body",pushOutboundClick(link,outboundLinkType)},!0);const footerHost=document.querySelector("#diageo-footer-wrap");footerHost?.shadowRoot&&footerHost.shadowRoot.addEventListener("click",function(e){const link=(e.target instanceof HTMLElement?e.target:null)?.closest("a[href]");link&&pushOutboundClick(link,"Footer")},!0)}if(globalEventsConfig.navigationClickEnabled&&globalEventsConfig.navigationClickSelector&&document.querySelectorAll(globalEventsConfig.navigationClickSelector).forEach(navigationLink=>{navigationLink.addEventListener("click",()=>{const target=new URL(navigationLink.href);if(target.host!=window.location.host)return;const targetPathname=target.pathname?.split("/")[1]||"index",globalValues=(()=>{const jsonNode=document.querySelector('script[type="application/json"]#DataLayerGlobalValuesJSON');if(!jsonNode)return;const textContent=jsonNode.textContent?.trim();if(textContent)try{return JSON.parse(textContent)}catch(error){console.error(error);return}})();if(!globalValues)return;let journeyTypeMap,navigationTypeMap;try{journeyTypeMap=JSON.parse(globalValues.journeyTypeMap),navigationTypeMap=JSON.parse(globalValues.navigationTypeMap)}catch(error){console.error("[dataLayer] Invalid journey/navigation type map JSON",error);return}const getTypeFromMap=(map,targetPathname2)=>{for(const pageType of Object.keys(map))if(map[pageType].split(",").includes(targetPathname2))return pageType};window.dataLayerPush({event:"navigation_click",data:{timestamp:new Date().toISOString(),data:{journeyType:getTypeFromMap(journeyTypeMap,targetPathname)||"Content",navigationType:getTypeFromMap(navigationTypeMap,targetPathname)||"Content",interactionName:navigationLink.textContent.trim()||void 0}}})})}),globalEventsConfig.scrollEnabled){let getScrollPercentage2=function(){const scrollTop=window.scrollY||window.pageYOffset,docHeight=Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight),winHeight=window.innerHeight,scrollable=docHeight-winHeight;return scrollable<=0?100:Math.round(scrollTop/scrollable*100)},handleScroll2=function(){const percentage=getScrollPercentage2();Object.keys(scrollMilestones).forEach(milestone=>{!scrollMilestones[milestone]&&percentage>=Number.parseInt(milestone)&&(scrollMilestones[milestone]=!0,window.dataLayerPush({event:"scroll",data:{timestamp:new Date().toISOString(),data:{scrollPercentage:milestone}}}))})};var getScrollPercentage=getScrollPercentage2,handleScroll=handleScroll2;const scrollMilestones={"25%":!1,"50%":!1,"75%":!1,"100%":!1};window.addEventListener("scroll",handleScroll2,{passive:!0})}})();
2//# sourceMappingURL=/cdn/shop/t/32/assets/m-data-layer-inject.js.map?v=67355457222415189291790855085

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.