PageSourceSearch

https://www.groworganic.com/cdn/shop/t/324/compiled_assets/snippet-scripts.js?v=120492328635483669271790256771

js groworganic.com collected 2026-10-01 11:44:10 UTC 7,830 bytes, 2 lines download raw bytes

1(function(){var __snippets__={};(function(){for(var element=document.getElementById("snippets-script"),attribute=element?element.getAttribute("data-snippets"):"",snippets=attribute.split(",").filter(Boolean),i=0;i<snippets.length;i++)__snippets__[snippets[i]]=!0})(),(function(){if(!(!__snippets__["go-cart-tracking"]&&!Shopify.designMode))try{let goNormalizeCart2=function(cart,now=new Date().toISOString()){const origin="https://www.groworganic.com";if(!cart||!Array.isArray(cart.items))throw new Error("Missing full cart");const safeUrl=(value,product=!1)=>{if(!value)return"";try{const url=new URL(value,origin);return url.protocol!=="https:"||product&&url.origin!==origin?"":url.href}catch{return""}};let recoverable=!0;const quantities=new Map,lines=cart.items.map(item=>{const id=String(item.variant_id??item.id??""),quantity=Number(item.quantity),price=Number(item.original_price??item.price),linePrice=Number(item.original_line_price??item.line_price);if(!/^\d+$/.test(id)||!Number.isSafeInteger(Number(id))||!Number.isSafeInteger(quantity)||quantity<1)throw new Error("Invalid cart line");if(!Number.isFinite(price)||price<0||!Number.isFinite(linePrice)||linePrice<0)throw new Error("Invalid cart price");(item.selling_plan_allocation||item.parent_relationship||item.item_components?.length||Object.values(item.properties||{}).some(v=>v!==null&&String(v)!==""))&&(recoverable=!1),quantities.set(id,(quantities.get(id)||0)+quantity);const imageUrl=safeUrl(item.image||item.featured_image?.url),productUrl=safeUrl(item.url,!0),handle=productUrl&&new URL(productUrl).pathname.match(/^\/products\/([^/]+)$/)?.[1]||"";return{title:String(item.product_title||item.title||"Your garden selection"),variant_title:item.variant_title==="Default Title"?"":String(item.variant_title||""),variant_id:id,product_id:String(item.product_id||""),quantity,price:price/100,line_price:linePrice/100,product:{title:String(item.product_title||item.title||"Your garden selection"),handle,images:imageUrl?[{src:imageUrl}]:[],variant:{images:imageUrl?[{src:imageUrl}]:[]}},url:productUrl}}),itemCount=lines.reduce((sum,item)=>sum+item.quantity,0);if(Number(cart.item_count)!==itemCount)throw new Error("Incomplete cart snapshot");const recovery=lines.length&&recoverable?`${origin}/cart/${[...quantities].map(([id,qty])=>`${id}:${qty}`).join(",")}?storefront=true`:"";return{schema_version:1,source:"storefront",updated_at:now,currency:String(cart.currency||"USD"),item_count:itemCount,line_count:lines.length,recoverable:!!recovery,checkout_url:recovery,line_items:lines}};var goNormalizeCart=goNormalizeCart2;(function(){const element=document.getElementById("go-cart-tracking");if(!element||element.dataset.loaded==="true")return;element.dataset.loaded="true";const qa=!1;if(!(element.dataset.mode==="production"))return;let latest,timer,generation=0,observedSignature="",sentSignature="",sending=!1,pendingSnapshot,hooked=!1,panel;const signature=snapshot=>JSON.stringify({...snapshot,updated_at:""}),status=text=>{panel&&(panel.querySelector("[data-go-status]").textContent=text)},sendStatus=text=>{panel&&(panel.querySelector("[data-go-send-status]").textContent=text)},limited=(promise,name)=>new Promise((resolve,reject)=>{const timeout=setTimeout(()=>reject(new Error(`${name} timed out`)),1e4);Promise.resolve(promise).then(value=>{clearTimeout(timeout),resolve(value)},error=>{clearTimeout(timeout),reject(error)})}),allowed=()=>{const privacy=window.Shopify?.customerPrivacy;return!!(privacy?.analyticsProcessingAllowed()&&privacy?.marketingAllowed())},api=()=>window.klaviyo;async function send(snapshot){if(sending){qa||(pendingSnapshot=snapshot),sendStatus("A snapshot is already being sent.");return}if(!snapshot||!allowed()||!api()){sendStatus("Waiting for tracking consent or Klaviyo.");return}const sig=signature(snapshot);if(sig===sentSignature){sendStatus("Duplicate snapshot skipped.");return}sending=!0;try{if(sendStatus("Checking Klaviyo account."),await limited(api().account(),"Account check")!=="WUmWyJ")throw new Error("Wrong Klaviyo account");if(!await limited(api().isIdentified(),"Identity check")){sendStatus("Waiting for a known Klaviyo profile.");return}if(!allowed()){sendStatus("Tracking consent is unavailable.");return}if(sendStatus("Saving the complete-cart profile snapshot."),await limited(api().identify({GO_StorefrontCart:snapshot,GO_StorefrontCartHasItems:snapshot.item_count>
10,GO_StorefrontCartRecoverable:snapshot.recoverable,GO_StorefrontCartUpdatedAt:snapshot.updated_at,GO_CartCurrent:snapshot,GO_CartHasItems:snapshot.item_count>0,GO_CartRecoverable:snapshot.recoverable,GO_CartUpdatedAt:snapshot.updated_at}),"Profile snapshot"),!allowed())return;if(sendStatus("Sending the complete-cart event."),await limited(api().track("GO Cart Ready",{$event_id:crypto.randomUUID(),$value:snapshot.line_items.reduce((n,x)=>n+x.line_price,0),$currency_code:snapshot.currency,Source:"storefront",SchemaVersion:1,IsTest:qa,ItemCount:snapshot.item_count,LineCount:snapshot.line_items.length,Recoverable:snapshot.recoverable,extra:snapshot}),"Event tracking")===!1)throw new Error("Snapshot not accepted");sentSignature=sig,sendStatus(`Snapshot accepted: ${snapshot.line_items.length} lines, ${snapshot.item_count} units.`)}catch(error){sendStatus(`Snapshot not sent: ${error.message}`)}finally{sending=!1;const pending=pendingSnapshot;pendingSnapshot=void 0,pending&&signature(pending)!==sentSignature&&await send(pending)}}async function refresh(){if(!qa&&!allowed())return;const request=++generation;try{const root=window.Shopify?.routes?.root||"/",response=await fetch(`${root}cart.js`,{credentials:"same-origin",cache:"no-store",headers:{Accept:"application/json"}});if(!response.ok)throw new Error("Cart unavailable");const snapshot=goNormalizeCart2(await response.json());if(request!==generation)return;const sig=signature(snapshot);if(sig===observedSignature&&latest&&(snapshot.updated_at=latest.updated_at),observedSignature=sig,latest=snapshot,panel){panel.querySelector("pre").textContent=JSON.stringify(snapshot,null,2);const recovery=panel.querySelector("[data-go-recovery]");recovery.hidden=!snapshot.recoverable,recovery.href=snapshot.checkout_url||"#",status(`Captured ${snapshot.line_items.length} lines, ${snapshot.item_count} units. ${snapshot.recoverable?"Cart recovery available.":"Cart-only sending disabled for this cart."}`)}qa||await send(snapshot)}catch(error){status(`Capture unavailable: ${error.message}`)}}function schedule(){clearTimeout(timer),timer=setTimeout(refresh,700)}function hookTheme(){hooked||typeof subscribe=="function"&&typeof PUB_SUB_EVENTS<"u"&&PUB_SUB_EVENTS.cartUpdate&&(subscribe(PUB_SUB_EVENTS.cartUpdate,schedule),hooked=!0)}document.addEventListener("cartChange",schedule),document.addEventListener("visitorConsentCollected",schedule),window.addEventListener("klaviyoForms",event=>{event.detail?.type==="submit"&&(sentSignature="",schedule())}),window.addEventListener("pageshow",schedule),document.addEventListener("visibilitychange",()=>{document.hidden||schedule()}),typeof PerformanceObserver<"u"&&new PerformanceObserver(list=>{list.getEntries().some(entry=>{try{const url=new URL(entry.name);return url.origin===location.origin&&/\/cart\/(add|change|update|clear)(\.js)?$/.test(url.pathname)}catch{return!1}})&&schedule()}).observe({entryTypes:["resource"]}),hookTheme(),document.addEventListener("DOMContentLoaded",()=>{hookTheme(),schedule()},{once:!0}),window.addEventListener("load",()=>{hookTheme(),schedule()},{once:!0}),!window.Shopify?.customerPrivacy&&window.Shopify?.loadFeatures&&window.Shopify.loadFeatures([{name:"consent-tracking-api",version:"0.1"}],error=>{error||schedule()}),schedule()})()}catch(e){console.error(e)}})()})();
2//# sourceMappingURL=/cdn/shop/t/324/compiled_assets/snippet-scripts.js.map?v=120492328635483669271790256771

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.