!function(){"use strict";window.thebaseShop={createCookie:function(e,t,o,i){if(o){var a=new Date;"minutes"==i?a.setTime(a.getTime()+60*o*1e3):"hours"==i?a.setTime(a.getTime()+60*o*60*1e3):a.setTime(a.getTime()+24*o*60*60*1e3);var c="; expires="+a.toGMTString()}else c="";document.cookie=thebaseShopConfig.siteSlug+"-"+e+"="+t+c+"; path=/"},getCookie:function(e){var t=("; "+document.cookie).split("; "+thebaseShopConfig.siteSlug+"-"+e+"=");if(2==t.length)return t.pop().split(";").shift()},initShopToggle:function(){if(document.body.classList.contains("woocommerce")||document.body.classList.contains("archive")){var e=document.querySelectorAll(".thebase-toggle-shop-layout");if(e.length){var t=window.thebaseShop.getCookie("shopLayout");if(t&&("grid"===t||"list"===t)){var o=document.querySelector(".thebase-toggle-"+t);window.thebaseShop.toggleShop(o)}for(let t=0;t<e.length;t++)e[t].addEventListener("click",(function(o){o.preventDefault(),window.thebaseShop.toggleShop(e[t])}))}}},toggleShop:function(e){if(e.classList.contains("toggle-active")||(e.classList.add("toggle-active"),window.thebaseShop.createCookie("shopLayout",e.dataset.archiveToggle,30,"days")),"grid"===e.dataset.archiveToggle)var t=document.querySelector(".thebase-toggle-list");else t=document.querySelector(".thebase-toggle-grid");if(t.classList.remove("toggle-active"),"grid"===e.dataset.archiveToggle)var o=document.querySelector(".woo-archive-loop.products-list-view");else o=document.querySelector(".woo-archive-loop.products-grid-view");o||(o=document.querySelector(".woo-archive-loop")),o.classList.remove("products-list-view"),o.classList.remove("products-grid-view"),o.classList.add("products-"+e.dataset.archiveToggle+"-view")},initShopCatToggle:function(){var e=document.querySelectorAll(".widget_product_categories");if(e.length)for(let i=0;i<e.length;i++){var t=e[i].querySelectorAll(".cat-parent");if(t.length)for(let e=0;e<t.length;e++){var o=document.createElement("button");o.setAttribute("aria-label",thebaseConfig.screenReader.expand),o.classList.add("thebase-cat-toggle-sub"),(t[e].classList.contains("current-cat")||t[e].classList.contains("current-cat-parent"))&&(o.classList.add("toggle-active"),o.setAttribute("aria-label",thebaseConfig.screenReader.collapse),t[e].classList.add("sub-toggle-active")),t[e].appendChild(o),o.addEventListener("click",(function(e){e.preventDefault(),window.thebaseShop.toggleCatShop(e)}))}}},toggleCatShop:function(e){var t=e.srcElement;t.classList.contains("toggle-active")?t.classList.remove("toggle-active"):t.classList.add("toggle-active"),t.parentNode.classList.contains("sub-toggle-active")?t.parentNode.classList.remove("sub-toggle-active"):t.parentNode.classList.add("sub-toggle-active")},init:function(){window.thebaseShop.initShopToggle(),window.thebaseShop.initShopCatToggle()}},"loading"===document.readyState?document.addEventListener("DOMContentLoaded",window.thebaseShop.init):window.thebaseShop.init()}();
(()=>{"use strict";const t=window.wp.hooks,e=(t,e)=>{const a={id:"gla_"+t.id,quantity:e,google_business_vertical:"retail"};return t.name&&(a.name=t.name),t?.categories?.length&&(a.category=t.categories[0].name),t?.prices?.price&&(a.price=parseInt(t.prices.price,10)/10**t.prices.currency_minor_unit),a},a=(t,a=1)=>{((t,e)=>{if("function"!=typeof gtag)throw new Error("Function gtag not implemented.");window.gtag("event","add_to_cart",{send_to:"GLA",...e})})(0,{ecomm_pagetype:"cart",event_category:"ecommerce",items:[e(t,a)]})},n=t=>{var e;return glaGtagData.products[t.id]&&(t.name=glaGtagData.products[t.id].name,t.prices=(e=glaGtagData.products[t.id].price,{price:Math.round(e*10**glaGtagData.currency_minor_unit),currency_minor_unit:glaGtagData.currency_minor_unit})),t};(0,t.addAction)("experimental__woocommerce_blocks-cart-add-item","google-listings-and-ads",({product:t,quantity:e=1})=>{a(t,e)});const r=function(t){const e=t.currentTarget.dataset,r=n({id:e.product_id});a(r,e.quantity||1)},o=function(t){const e=t.target.closest("form.cart");if(!e)return;const r=e.querySelector("[name=add-to-cart]");if(!r)return;const o=e.querySelector("[name=variation_id]"),c=e.querySelector("[name=quantity]"),i=n({id:parseInt(o?o.value:r.value,10)});a(i,c?parseInt(c.value,10):1)};document.defaultView.addEventListener("DOMContentLoaded",function(){document.querySelectorAll(".add_to_cart_button:not(.product_type_variable):not(.product_type_grouped):not(.wc-block-components-product-button__button)").forEach(t=>{t.addEventListener("click",r)}),document.querySelectorAll('[data-block-name="woocommerce/product-button"] > .add_to_cart_button:not(.product_type_variable):not(.product_type_grouped)').forEach(t=>{t.addEventListener("click",r)}),document.querySelectorAll(".single_add_to_cart_button").forEach(t=>{t.addEventListener("click",o)})}),"function"==typeof jQuery&&jQuery(document).on("found_variation","form.cart",function(t,e){(t=>{t?.variation_id&&(glaGtagData.products[t.variation_id]={name:t.display_name,price:t.display_price})})(e)})})();