u in p?I(p,u,enumerable:!0,configurable:!0,writable:!0,value:d):p[u]=d;var a=(p,u,d)=>A(p,typeof u!=”symbol”?u+””:u,d);(function()(?
u in p?I(p,u,enumerable:!0,configurable:!0,writable:!0,value:d):p[u]=d;var a=(p,u,d)=>A(p,typeof u!=”symbol”?u+””:u,d);(function()(?i.hypothesisId===t.id),s=new URL(window.location.toString());if(t.type===”theme”)if(!(t.themeId===themeId))if(this.log(“Theme id ‘%s’ is not hypothesis theme ID ‘%s'”,t.themeId,themeId),e&&e.themeId!==t.themeId&&(e.themeId===themeIdreturn!1else if(t.affix!==template.suffixredirect(t)if(this.log(“Redirecting to hypothesis ‘%s'”,t.id),t.isControl)return;const e=new URL(window.location.toString());if(t.redirectPath)const s=RegExp(“^(/w2-w2)/”).exec(e.pathname);if(s&&s.length>1)const i=s[1];e.pathname=`$i$t.redirectPath`else e.pathname=t.redirectPathelse t.type===”theme”?(e.searchParams.set(“_ab”,”0″),e.searchParams.set(“_fd”,”0″),e.searchParams.set(“_sc”,”1″),e.searchParams.set(“preview_theme_id”,t.themeId.toString())):t.type!==”urlRedirect”&&e.searchParams.set(“view”,t.affix);this.queueRedirect(e)buildBaseVisitor()const t=this.getDeviceType(),e=this.getUTMValue(“utm_source”)??””,s=this.getUTMValue(“utm_medium”)??””,i=this.getUTMValue(“utm_campaign”)??””,o=this.getUTMValue(“utm_content”)??””,n=window.document.referrer;returnshopifyAnalyticsId:this.shopifyAnalyticsId,device:t!==”tablet”?t:”mobile”,utmSource:e,utmMedium:s,utmCampaign:i,utmContent:o,referrer:ncheckForThemePreview()testsForUrl(t)async filterTestsByAudience(t,e,s)async isTargetAudience(t,e,s)visitorCreatedDuringTestActive(t)let e=””;for(const s of t)getHypothesis(t)return this.testConfigs.filter(e=>e.hypotheses.some(s=>s.id===t)).map(e=>e.hypotheses.find(s=>s.id===t))[0]hasThemeTest(t)return t.some(e=>e.hypotheses.some(s=>s.type===”theme”))hasTestThatIsNotThemeTest(t)return t.some(e=>e.hypotheses.some(s=>s.type!==”theme”))hasThemeAndOtherTestTypes(t)return this.hasThemeTest(t)&&this.hasTestThatIsNotThemeTest(t)visitorActiveTestType()const t=this.state.essential.visitorTests.filter(e=>this.testConfigs.some(s=>s.hypotheses.some(i=>i.id==e.hypothesisId)));return t.length===0?null:t.some(e=>e.isThemeTest)?”theme”:”templateOrUrlRedirect”pickHypothesis(t)let e=Math.random();const s=t.hypotheses.reduce((o,n)=>o+n.visitorCount,0);return t.hypotheses.sort((o,n)=>o.isControl?n.isControl?0:-1:n.isControl?1:0).reduce((o,n)=>if(o!==null)return o;const r=t.hypotheses.reduce((l,T)=>l&&T.visitorCount>20,!0)?n.visitorCount/s-n.trafficPercentage:0;return et.type===1typeFromTemplate()switch(template.type)case”collection-list”:return”collectionList”;case”page”:return”landing”;case”article”:case”blog”:case”cart”:case”collection”:case”index”:case”product”:case”search”:return template.type;default:return nullqueueRedirect(t)this.saveState(),window.setTimeout(()=>window.location.assign(t),0)async syncAllEvents()const t=async()=>if(this.isSyncing)window.setTimeout(()=>void(async()=>await t())(),500);returntrythis.isSyncing=!0,await this.syncEvents(),this.syncGAEvents()finallythis.isSyncing=!1;await t()async syncEvents()!this.shopifyAnalyticsIdsyncGAEvents()this.state.analytics.gaQueue.length===0)return;const t=this.state.analytics.gaQueue.length;this.log(“Syncing %s ga events”,t);const e=()=>let s=this.state.analytics.gaQueue.splice(0,1)[0];tryfor(;s;)this.sendGtagEvent(s.testId,s.hypothesisId),s=this.state.analytics.gaQueue.splice(0,1)[0]catchs&&this.state.analytics.gaQueue.splice(0,0,s)finallythis.persistAnalyticsState();typeof window.gtag!=”function”?(this.log(“gtag not found, deferring until load”),document.addEventListener(“DOMContentLoaded”,e)):(this.log(“Calling gtag”),e())sendGtagEvent(t,e)this.log(“Sending gtag event for”,t,e);const s=exp_variant_string:`SL-$t-$e`;this.shopliftDebug&&Object.assign(s,debug_mode:!0),gtag(“event”,”experience_impression”,s)async getRemoteVisitor(t)return await this.makeJsonRequest(method:”get”,url:`$this.host/api/v0/visitors/$t`)async updateShopifyAnalyticsId(t,e)return await this.makeJsonRequest(method:”put”,url:`$this.host/api/v0/visitors/$t`,data:JSON.stringify(shop:this.shop,shopifyAnalyticsId:e))getUTMValue(t)const s=decodeURIComponent(window.location.search.substring(1)).split(“&”);for(let i=0;it&&window.document.documentElement.classList.remove(t)async getCartState()trylet t=await this.makeJsonRequest(method:”get”,url:`$window.location.origin/cart.js`);return t.note===null&&(t=await this.makeJsonRequest(method:”post”,url:`$window.location.origin/cart/update.js`,data:JSON.stringify(note:””))),tcatch(t)return this.log(“Error sending cart info”,t),nullasync makeJsonRequest(t)return(await this.makeRequest(t)).json()async makeRequest(t)this.host.includes(“ngrok-free.app”))&&c.append(“ngrok-skip-browser-warning”,”1234″);const r=await this.fetch(e,method:s,headers:c,body:o,signal:n);if(!r.ok)if(r.status==422)queueAddVisitorToTest(t,e)(this.state.essential.visitorTests.push(testId:t.id,hypothesisId:e.id,isThemeTest:e.type===”theme”,themeId:e.themeId),this.queueGAEvent(testId:t.id,hypothesisId:e.id),this.queueEvent(new S(t.id,e.id)))queueCartUpdate(t)this.queueEvent(new k(t))queuePageView(t)this.queueEvent(new b(t))queueEvent(t)this.state.analytics.queue.length>100queueGAEvent(t)this.state.analytics.gaQueue.push(t)legacyGetLocalStorageVisitor()const t=this.localStorageGet(this.legacySessionKey);if(t)tryreturn JSON.parse(t)catchreturn nullsaveState()this.persistEssentialState(),this.persistAnalyticsState()loadState()const t=essential:this.loadEssentialState(),analytics:this.loadAnalyticsState(),e=this.legacyGetLocalStorageVisitor(),s=this.legacyGetCookieVisitor(),i=[e,s].filter(o=>o!==null).sort((o,n)=>+n.storedAt-+o.storedAt)[0];return t.analytics.visitor===null&&i&&(visitorTests:t.essential.visitorTests,…t.analytics.visitor=i,this.deleteCookie(“SHOPLIFT”),this.deleteLocalStorage(this.legacySessionKey)),!t.essential.consentApproved&&t.essential.hasConsentInteraction&&this.deleteLocalStorage(this.analyticsSessionKey),tloadEssentialState()const t=this.loadLocalStorage(this.essentialSessionKey),e=this.loadCookie(this.essentialSessionKey),s=timestamp:new Date,consentApproved:!1,hasConsentInteraction:!1,debugMode:!1,visitorTests:[],isMerchant:!1;return[t,e].filter(i=>i!==null).sort((i,o)=>+o.timestamp-+i.timestamp)[0]??sloadAnalyticsState()const t=this.loadLocalStorage(this.analyticsSessionKey),e=this.loadCookie(this.analyticsSessionKey),s=timestamp:new Date,visitor:null,queue:[],gaQueue:[];return[t,e].filter(i=>i!==null).sort((i,o)=>+o.timestamp-+i.timestamp)[0]??spersistEssentialState()this.log(“Persisting essential state”),this.persistLocalStorageState(this.essentialSessionKey,this.state.essential),this.persistCookieState(this.essentialSessionKey,this.state.essential)persistAnalyticsState()this.log(“Persisting analytics state”),this.persistLocalStorageState(this.analyticsSessionKey,this.state.analytics),this.state.essential.consentApproved&&this.persistCookieState(this.analyticsSessionKey,this.state.analytics)loadLocalStorage(t)const e=this.localStorageGet(t);return e===null?null:JSON.parse(e)loadCookie(t)const e=this.getCookie(t);return e===null?null:JSON.parse(e)persistLocalStorageState(t,e)e.timestamp=new Date,this.localStorageSet(t,JSON.stringify(e))persistCookieState(t,e)e.timestamp=new Date;const s=JSON.stringify(e),i=new Date(new Date().getTime()+864e5*365).toUTCString();document.cookie=`$t=$s;domain=.$window.location.hostname;path=/;expires=$i;SameSite=Strict;`deleteCookie(t)const e=new Date(0).toUTCString();document.cookie=`$t=;domain=.$window.location.hostname;path=/;expires=$e;`deleteLocalStorage(t)window.localStorage.removeItem(t)getChannel(t)var s;return((s=[“name”:”cross-network”,”test”:(v) => new RegExp(“.*cross-network.*”, “i”).test(v.utmCampaign),“name”:”direct”,”test”:(v) => v.utmSource === “” && v.utmMedium === “”,paid.*)$”, “i”).test(v.utmMedium),tw.search.yahoo.com,wordpress.com,ted.com,cpm)$”, “i”).test(v.utmMedium),“name”:”paid-other”,”test”:(v) => new RegExp(“^(.*cp.*,daum,gulli.com,ted.com,msn.com,“name”:”referral”,”test”:(v) => new RegExp(“^(?:referral,e-mail,“name”:”affiliate”,”test”:(v) => v.utmMedium.toLowerCase() === “affiliate”,“name”:”audio”,”test”:(v) => v.utmMedium.toLowerCase() === “audio”,“name”:”sms”,”test”:(v) => v.utmSource.toLowerCase() === “sms” ,].find(i=>i.test(t)))==null?void 0:s.name)??”other”getShopifyAnalyticsId()return this.getCookie(“_shopify_y”)legacyGetCookieVisitor()const t=this.getCookie(“SHOPLIFT”);return t===null?null:JSON.parse(t)getCookie(t)const e=this.cookie.split(“; “).filter(s=>s.split(“=”).at(0)===t).at(0);return e===void 0?null:e.split(“=”).slice(1).join(“=”)monitorConsentChange()document.addEventListener(“visitorConsentCollected”,t=>void(async()=>await this.onConsentChange(t.detail.analyticsAllowed,!0))()),document.readyState===”loading”?document.addEventListener(“DOMContentLoaded”,()=>this.loadShopifyConsentApiWithRetry()):this.loadShopifyConsentApiWithRetry()loadShopifyConsentApiWithRetry()let t=0;const e=()=>this.loadShopifyConsentApi();e()loadShopifyConsentApi()if(window.Shopify)this.log("Loading Shopify features");const t=async()=>if(!window.Shopify)this.log(“Shopify object missing… suddenly?”);returnif(window.Shopify.customerPrivacy===void 0)this.log(“Shopify CustomerPrivacy api still missing, trying again in 1000ms”),e=window.setTimeout(()=>void(async()=>await t())(),1e3);returnconst s=window.Shopify.customerPrivacy.getTrackingConsent();await this.onConsentChange(window.Shopify.customerPrivacy.analyticsProcessingAllowed(),s!==”no_interaction”);let e=window.setTimeout(()=>void(async()=>await t())(),5e3);return window.Shopify.loadFeatures([name:”consent-tracking-api”,version:”0.1″],s=>(async()=>if(window.clearTimeout(e),s)this.log(“Error loading consent tracking”,s);returnawait t())()),!0return!1async onConsentChange(t,e)trycatch(s)this.log(“Error syncing on consent change”,s)isThemePreview()tryreturn isThemePreviewcatch(t)if(t instanceof ReferenceError)tryreturn themeRole!==”main”catch(e)if(e instanceof ReferenceError)return window.document.cookie.includes(“preview_theme=1”);throw eelse throw tclearThemeBar()this.log(“Setting theme bar to be cleared”),this.waitForElement(“#preview-bar-iframe”).then(t=>this.log(“Clearing theme bar”),t.remove()).catch(t=>console.error(t))waitForElement(t)return new Promise(e=>const s=document.querySelector(t);if(s)e(s);returnconst i=new MutationObserver(o=>const n=document.querySelector(t);if(n)i.disconnect(),e(n);return);i.observe(document.documentElement,childList:!0,subtree:!0))setDebug(t)this.state.essential.debugMode=t,this.saveState()log(t,…e)console.debug(`[SL] $t`,…e)debug()const t=state:this.state,storage:essential:this.loadLocalStorage(this.essentialSessionKey),analytics:this.loadLocalStorage(this.analyticsSessionKey),params:shop:this.shop,host:this.host,eventHost:this.eventHost,cssHideClass:this.cssHideClass,testConfigs:this.testConfigs,sendPageView:this.sendPageView;console.log(JSON.stringify(t))(async function())())(); )(“/”, suffix: “”, type: “index” , “main”, 138374545561, false)]]> Plug Refurbished Laptops/Tablets/Watches & Unlocked Phones `form[action*=’/$t’]:not([data-nocaptcha=’true’]) input[name=’form_type’][value=’$e’]`)).join(‘,’);function s(t,e,n=!1)tryconst o=window.sessionStorage;for(const[n,c]of Object.entries(JSON.parse(o.getItem(e))))t.elements[n]&&(t.elements[n].value=c);n&&o.removeItem(e)catchconst a=’form_key’,i=[‘recaptcha-v3-token’,’g-recaptcha-response’,’h-captcha-response’,’password’],u=()=>tryreturn window.sessionStoragecatchreturn,m=t=>t.elements[a],f=’form_type’,d=’cptcha’;function p(t)t.dataset[d]=!0const l=window,h=l.document,_=’Shopify’,y=’ce_forms’,E=’captcha’;let v=!1;((t,e)=>)()();]]> Array.from(document.getElementById(‘oke-reviews-body-template’)?.content.children)?.forEach(function(child)if(!Array.from(document.body.querySelectorAll(‘[data-oke-id=’.concat(child.getAttribute(‘data-oke-id’),’]’))).length)document.body.prepend(child)),once:true);]]> > TriplePixel :: start*/ window.TriplePixelData=TripleName:”plugtechh.myshopify.com”,ver:”2.16″,plat:”SHOPIFY”,isHeadless:false,src:’SHOPIFY_EXT’,product:id:””,name:“,price:””,variant:””,search:””,collection:””,cart:”drawer”,template:”index”,function(W,H,A,L,E,_,B,N)function O(U,T,P,H,R)if(N=window,!N[H+"sn"])("","TriplePixel",localStorage); /* < const name = ‘Subscribe’;if (!name) return;if (beacon) edgetag(“tag”, name, , , method: “beacon”, destination: window.edgetagSharedVariables.tagUrl ); else edgetag(“tag”, name, , , destination: window.edgetagSharedVariables.tagUrl );;const getUser = (form, selectors) => const user = ;if (!selectors) return user;Object.entries(selectors).forEach(([userKey, selector]) => selector.length === 0) return;const selectorArray = Array.isArray(selector) ? selector : [selector];for (const selector of selectorArray) if (!selector) continue;const inputUserValue = form.querySelector(selector);const userValue = (inputUserValue && inputUserValue.value) );return user;;const sendUserData = (userData,isBeacon) => ;const actions = [selectors: [“[type=”submit”]”, newsletterForm],length: 2,fun: (ele) => const user = getUser(ele, email: [“input[type=”email”]”, “input[name*=”email” i]:not([type=”hidden” i])”],phone: [“input[type=”tel”]”, “input[name*=”phone” i]:not([type=”hidden” i])”],firstName: “input[name*=”name” i]:not([type=”hidden” i])”,dateOfBirth: “input[name*=”birthday” i]:not([type=”hidden” i])”);sendUserData(user);sendNewsletterEvent(true);,current: 0,selectors: [“button:not([role=’combobox’])”, newsletterForm],length: 2,fun: (ele) => const user = getUser(ele, email: [“input[type=”email”]”, “input[name*=”email” i]:not([type=”hidden” i])”],phone: [“input[type=”tel”]”, “input[name*=”phone” i]:not([type=”hidden” i])”],firstName: “input[name*=”name” i]:not([type=”hidden” i])”,dateOfBirth: “input[name*=”birthday” i]:not([type=”hidden” i])”);sendUserData(user);sendNewsletterEvent(true);,current: 0,selectors: [“[type=”submit”]”, “form[action=”/account/login”]”],length: 2,fun: (ele) => const user = getUser(ele, email: [‘input[type=”email”]’, “#CustomerEmail”]);sendUserData(user);,current: 0,selectors: [“[type=”submit”]”, “form[action=”/account”]”],length: 2,fun: (ele) => let user = getUser(ele, email: [ ‘input[type=”email”]’, ‘input[name=”customer[email]”]’, ‘#RegisterForm-email’ ],phone: “input[type=”tel”]”,firstName: [ ‘#RegisterForm-FirstName’, ‘input[name=”customer[first_name]”]’,’input[name*=”first” i]:not([type=”hidden” i])’ ],lastName: [ ‘#RegisterForm-LastName’, ‘input[name=”customer[last_name]”]’,’input[name*=”last” i]:not([type=”hidden” i])’ ]);if (!user.firstName && !user.lastName) user = …user,…getUser(ele, firstName: “input[name*=”name” i]:not([type=”hidden” i])” );sendUserData(user);edgetag(“tag”, “CompleteRegistration”, , , destination: window.edgetagSharedVariables.tagUrl );,current: 0,selectors: [“[type=”submit”]”, “form[action^=”/contact”]”],length: 2,fun: (ele) => const user = getUser(ele, email: [“input[type=”email”]”, “input[name*=”email” i]:not([type=”hidden” i])”],phone: [“input[type=”tel”]”, “input[name*=”phone” i]:not([type=”hidden” i])”],firstName: [“input[name*=”first” i]:not([type=”hidden” i])”, “input[name*=”name” i]:not([type=”hidden” i])”, “input[name*=”nom” i]:not([type=”hidden” i])”],lastName: “input[id*=”last” i]:not([type=”hidden” i])”);sendUserData(user);edgetag(“tag”, “Contact”, , , destination: window.edgetagSharedVariables.tagUrl );,current: 0];const resetActions = () => for (let i = 0; i );window.addEventListener(‘FORMTORO_FORM_LOADED’, (t) => const formToroIframe = document.querySelector(`[data-formtoro-form=”$t.detail”]`);if (!formToroIframe) return;const formToroRoot = formToroIframe.shadowRoot;const formToroForm =formToroRoot?.querySelector(‘ft-form-container’);if (!formToroForm) return;formToroForm.addEventListener(‘submit’,(e) => const formData = new FormData(e.target);const email = formData.get(’email’);const user = ;if (email) user.email = email;const countryCodeEle = e.target.querySelector(‘div[class$=”phone-number”] [class*=”dropdown”]’);const countryCode = countryCodeEle?.value;const phone = formData.get(‘phone-number’)?.replace(/D/g, ”);if (phone) user.phone = phone;if (countryCode) user.phone = countryCode + phone;if (Object.keys(user).length == 0) return;sendUserData(user);sendNewsletterEvent();, capture: true );, once: true );();]]>
let storage try storage = window[type] const x = ‘__storage_test__’ storage.setItem(x, x) storage.removeItem(x) return true catch (e) // test name field too, because code might not be present // everything except Firefox e.name === ‘QuotaExceededError’ , getItem(key) if (StatusAppEmbed.storageAvailable(‘localStorage’)) return localStorage.getItem(key) return null , setItem(key, value) if (StatusAppEmbed.storageAvailable(‘localStorage’)) localStorage.setItem(key, value) } ]]> const getIsActive = () => const timeout = StatusAppEmbed.getItem(‘status-timeout’); const isInTimeout = timeout && timeout > Date.now(); return StatusAppEmbed.getItem(‘status-state’) !== ‘off’ && !isInTimeout && window.statusEnabled !== false; /** * If not found on this list, account links will just go to the for you page */ const replacements = ‘/account/logout’: ‘#status-profile’, ; const methods = /** * Replace existing account links on a page with a link to the widget */ replaceLinks: () => document.querySelectorAll(‘a[href*=”/account”]’).forEach((el) => const href = el.getAttribute(‘href’); // External links should be ignored if (href.includes(‘http’) && !href.includes(location.origin)) return; // App proxy links should be ignored const prefixes = [‘apps’, ‘a’, ‘community’, ‘tools’] const isAppProxyLink = prefixes.some((prefix) => ) if (isAppProxyLink) return; const replacementLink = replacements[href] ?? ‘#status’; el.setAttribute(‘href’, replacementLink); ); , /** * Replace links to status hashes. This is for users in fallback mode */ replaceHashes: () => document.querySelectorAll(‘a[href*=”#status”]’).forEach((el) => el.setAttribute(‘href’, ‘/account’); ); , /** * Watch the page on an interval to replace account links if they’re added after page load */ const watchAccountLinks = () => setInterval(() => const method = getIsActive() ? ‘replaceLinks’ : ‘replaceHashes’ methods[method](); , 200); ; // Replace all account links on the page with a #status link instead const method = getIsActive() ? ‘replaceLinks’ : ‘replaceHashes’ methods[method](); // Continue to replace links, in case account links are added after page load watchAccountLinks(); )() ]]>
{ checkConsentAndLoad(); }); window.Shopify?.loadFeatures?.( [{name: ‘consent-tracking-api’, version: ‘0.1’}], error => { if (error) { if(!window.Shopify?.customerPrivacy) { loadSwymShopifyScript(); } } checkConsentAndLoad(); } ); } if (document.readyState === “loading”) { document.addEventListener(“DOMContentLoaded”, initialiseConsentCheck); } else { initialiseConsentCheck(); } })(); ]]>
{ backdrop.style.opacity = “40%”; }, 25); } function hideSlideOver() { const backdrop = document.getElementById(“backdrop”); const slideOverPanel = document.getElementById(“slide-over-panel”); const slideOverFrame = document.getElementById(“order-editing-frame”); const slideOverContainer = document.getElementById(“order-editing-container”); const direction = document.documentElement.getAttribute(“dir”) || “ltr”; if (direction === ‘rtl’) slideOverPanel.style.transform = “translateX(100%)”; else slideOverPanel.style.transform = “translateX(-100%)”; backdrop.style.opacity = “0%”; setTimeout(() => { hideInset(); }, 750); const divElement = document.querySelector(‘#slide-over-container’); divElement.style.display = “none”; const shouldOpenByDefault = divElement.getAttribute(‘data-default-open’); if (shouldOpenByDefault === “true” && Shopify?.designMode) { setTimeout(openSlideOver, 10 * 1000); } } function hideInset() { const backdrop = document.getElementById(“backdrop”); const slideOverPanel = document.getElementById(“slide-over-panel”); const slideOverFrame = document.getElementById(“order-editing-frame”); const slideOverContainer = document.getElementById(“order-editing-container”); const direction = document.documentElement.getAttribute(“dir”) || “ltr”; if (direction === ‘rtl’) slideOverPanel.style.transform = “translateX(100%)”; else slideOverPanel.style.transform = “translateX(-100%)”; document.body.style.overflow = “auto”; slideOverFrame.style.top = “initial”; slideOverFrame.style.left = “initial”; slideOverFrame.style.right = “initial”; slideOverFrame.style.bottom = “initial”; slideOverContainer.style.top = “initial”; slideOverContainer.style.left = “initial”; slideOverContainer.style.right = “initial”; slideOverContainer.style.bottom = “initial”; backdrop.style.top = “initial”; backdrop.style.left = “initial”; backdrop.style.right = “initial”; backdrop.style.bottom = “initial”; } function getCart() { var cartContents = fetch(window.Shopify.routes.root + ‘cart.js’) .then(response => response.json()) .then(data => { return data }); } function trackCartChanges() { const previousCartStateKey = ‘previousCartState’; const nextRemoveItemsKey = ‘removedItemsState’; // Retrieve previous cart state from local storage const previousCartState = JSON.parse(localStorage.getItem(previousCartStateKey) || ‘[]’); // Detect removed items const removedItems = previousCartState.filter(prevItem => !initialCartState.some(currItem => currItem.id === prevItem.id) ); if (removedItems.length) { // Send data to external API console.log(“Removed items”, removedItems); localStorage.setItem(nextRemoveItemsKey, JSON.stringify(removedItems)); } // Store current cart state in local storage for future comparisons localStorage.setItem(previousCartStateKey, JSON.stringify(initialCartState)); } document.addEventListener(“DOMContentLoaded”, initializeSlideOver); ]]>