1(function(){"use strict";var FBC_COOKIE="_fbc",FBP_COOKIE="_fbp",STORE_KEY="av_meta_click_id",SYNCED_KEY="av_meta_click_id_synced",COOKIE_DAYS=90,POLL_INTERVAL_MS=2e3,POLL_LIMIT_MS=180*1e3;function readCookie(name){var match=document.cookie.match("(^|; )"+name+"=([^;]*)");return match?decodeURIComponent(match[2]):null}function writeCookie(name,value,days){var expires=new Date(Date.now()+days*864e5).toUTCString(),domain=location.hostname.replace(/^www\./,"");document.cookie=name+"="+encodeURIComponent(value)+";expires="+expires+";path=/;domain=."+domain+";SameSite=Lax"+(location.protocol==="https:"?";Secure":"")}function safeGet(key){try{return window.localStorage.getItem(key)}catch(e){return null}}function safeSet(key,value){try{window.localStorage.setItem(key,value)}catch(e){}}function buildFbc(fbclid){var domain=location.hostname.replace(/^www\./,""),subdomainIndex=domain.split(".").length-1;return"fb."+subdomainIndex+"."+Date.now()+"."+fbclid}function fbclidOf(fbc){var parts=String(fbc).split(".");return parts.length>3?parts.slice(3).join("."):null}function sameClick(a,b){if(!a||!b)return!1;var fold=function(v){return String(v).split("__DOT__").join(".")};return fold(a)===fold(b)}function marketingAllowed(){try{var cp=window.Shopify&&window.Shopify.customerPrivacy;return!cp||typeof cp.marketingAllowed!="function"?!0:cp.marketingAllowed()}catch(e){return!0}}function resolveFbc(){var urlFbclid=null;try{urlFbclid=new URLSearchParams(location.search).get("fbclid")}catch(e){}var cookieFbc=readCookie(FBC_COOKIE);if(urlFbclid&&!sameClick(fbclidOf(cookieFbc),urlFbclid)){var built=buildFbc(urlFbclid);return writeCookie(FBC_COOKIE,built,COOKIE_DAYS),built}return cookieFbc||safeGet(STORE_KEY)}function syncToKlaviyo(fbc,fbp){var klaviyo=window.klaviyo;if(!klaviyo||typeof klaviyo.identify!="function")return Promise.resolve(!1);var fingerprint=(fbc||"")+"|"+(fbp||"");return safeGet(SYNCED_KEY)===fingerprint?Promise.resolve(!0):Promise.resolve(klaviyo.isIdentified()).then(function(identified){if(!identified)return!1;var props={};return fbc&&(props.fbc=fbc),fbp&&(props.fbp=fbp),!props.fbc&&!props.fbp?!1:Promise.resolve(klaviyo.identify(props)).then(function(){return safeSet(SYNCED_KEY,fingerprint),!0})}).catch(function(){return!1})}function start(){if(!marketingAllowed())return;var fbc=resolveFbc(),fbp=readCookie(FBP_COOKIE);if(fbc&&safeSet(STORE_KEY,fbc),!fbc&&!fbp)return;var startedAt=Date.now(),timer=null;function stop(){timer&&(clearInterval(timer),timer=null)}function attempt(){var currentFbc=readCookie(FBC_COOKIE)||fbc,currentFbp=readCookie(FBP_COOKIE)||fbp;currentFbc&&safeSet(STORE_KEY,currentFbc),syncToKlaviyo(currentFbc,currentFbp).then(function(done){(done||Date.now()-startedAt>POLL_LIMIT_MS)&&stop()})}attempt(),timer=setInterval(attempt,POLL_INTERVAL_MS),document.addEventListener("visibilitychange",function(){document.visibilityState==="visible"&&!timer&&attempt()})}var started=!1;function startOnce(){started||marketingAllowed()&&(started=!0,start())}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",startOnce):startOnce(),document.addEventListener("visitorConsentCollected",startOnce)})(); 2//# sourceMappingURL=/cdn/shop/t/5/assets/av-meta-click-id.js.map?v=32629541642605026841788288932
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.