1const trackProductViewed=()=>{if(!Shopify||!Shopify.analytics)return;const productDataScript=document.querySelector("#track-product-view-data"),productData=JSON.parse(productDataScript.textContent).item;productData.availability=getProductAvailability(productData.stockData.stock,productData.stockData.firstAvailableDate),productData.price.amount=getFormattedPrice(productData.price.amount),productData.price.compareAmount=getFormattedPrice(productData.price.compareAmount),window.Shopify?.analytics?.publish?.("swyft_product_viewed",productData)},getProductAvailability=(inventory,firstAvailable)=>{const firstAvailableDate=new Date(firstAvailable),dateToday=new Date;firstAvailableDate.setHours(0,0,0,0),dateToday.setHours(0,0,0,0);let availability=0;if(inventory>0){const diffDays=Math.round((firstAvailableDate-dateToday)/864e5);availability=Math.max(0,diffDays)}else firstAvailableDate.getTime()===dateToday.getTime()&&(availability=99);return availability},getFormattedPrice=subunits=>(subunits/100).toFixed(2);document.addEventListener("DOMContentLoaded",trackProductViewed); 2//# sourceMappingURL=/cdn/shop/t/11/assets/track-product-view.js.map?v=51575154911256778971791283272
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.