!function(){if(Array.prototype.includes||(Array.prototype.includes=function(e){return!!~this.indexOf(e)}),window.rterms=window.rterms||{},rterms.metafield=rterms.metafield||{},rterms.settings=rterms.settings||{},!(rterms.ran||rterms.settings.only_cart_page&&!window.location.pathname.match(/\/cart/))){rterms.checkouts=[],rterms.checkoutEvents=[],rterms.addedEvents=!1;var e="https://terms-relentless.herokuapp.com/statistics-event",t=rterms.checkoutEl||'[name="checkout"]:not([type="hidden"], .checkout-link__button, .tpo-btn-checkout, .cart-title-button), .cart--totals .cart--nav, a[href^="/checkout"], a[href="/account/login"].cart__submit, button[type="submit"].btn-order, a.btn.cart__checkout, a.cart__submit, input.action_button[value="Checkout"], .wc-proceed-to-checkout button, #cart_form .buttons .btn-primary, a.cart_adev_o, [data-limoniapps-discountninja-checkoutlink], form > button.checkout-button, button.btn_checkout, button.checkout-btn, button[data-href="/checkout"], .cart__footer > .table_medium_up:nth-child(2), #cart-summary .cart-summary__section .btn--empty-cart, button.qsc2-checkout-button, .cd-checkout-section-container .cd-checkout-section-button, .cart__checkout-button, .rebuy-cart__checkout-button, redo-shopify-toggle, [name^="button-route"], [name^="button-route"] + small, small[button-without-protection-1], small[button-without-protection-2], small[button-without-protection-3], small[button-without-protection-4], #mu-checkout-button';rterms.settings.cart_title_button&&"on"==rterms.settings.cart_title_button&&(t+=', [name="checkout"].cart-title-button');var r='[data-shopify="payment-button"], [tac-bin-override="true"], shopify-buy-it-now-button, [class*="shopify-payment-button"], gp-product-button[gp-data*="buy-now"]',o=!rterms._3lj2l&&rterms.metafield.precheck&&"on"===rterms.metafield.precheck,n=!rterms._3lj2l&&rterms.metafield.dynamic&&"on"===rterms.metafield.dynamic,s=!rterms._3lj2l&&rterms.metafield.optional&&"on"===rterms.metafield.optional,a="";window.location.pathname.match(/\/cart$/)||(a+=":not(.rterms-modal) > .terms-relentless { justify-content: flex-start !important; text-align: left !important; padding-left: 4px; }"),"left"===rterms.metafield.alignment?a+=".terms-relentless { justify-content: flex-start !important; text-align: left !important; }":"center"===rterms.metafield.alignment?a+=".terms-relentless { justify-content: center !important; text-align: center !important; }":"right"===rterms.metafield.alignment&&(a+=".terms-relentless { justify-content: flex-end !important; text-align: right !important; }");var i=document.createElement("style");i.innerHTML=a,rterms.ajaxCartStyle&&(i.innerHTML+=rterms.ajaxCartStyle),document.head.appendChild(i);var c=rterms.metafield.text;c||(c='I accept the terms of service.'),!c.match(/href="/)&&(c=(c=c.replace(/(terms and conditions|terms of service)/,'$1')).replace(/(privacy-policy)/,'$1')),rterms.checkout=function(e){if(e&&!e.isTrusted)return;var t=!1;document.querySelectorAll(".rterms-checkbox").forEach((function(e){e.checked&&(t=!0)})),t||(alert(rterms.metafield.alert_message||"Please select the terms of service"),e&&e.preventDefault&&(e.preventDefault(),e.stopPropagation(),setTimeout((function(){e.target&&(e.target.className=e.target.className.replace("btn--loading",""),e.target.disabled=!1)}),500)))},rterms.ran=!0,window.ZapietCheckoutEnabled=!1,l(t,(function(e){if(e.closest("cart-notification")&&window.location.pathname.match(/\/cart/))return;rterms.checkouts.push(e),(rterms.settings.cover||window.Rebuy||window.preOrderAppProxy||window.opusRefreshCart||window.Route||window.routes_cart_url||window.CartBotScriptAppended||window.lbupsellToken||window.lbShopDomain||window.Spurit||window.discountNinja||window.ymq||window.redoStorefront||window.samitaWholesale||document.documentElement.innerHTML.match(/vtlsAebBundle/)||window.BOLD||window.affirmPublicApiKeyCartDrawer||window.zakekeBeforeAddToCart||null!=window.noParcel||e.matches('[name^="button-route-"]')||"nextlevelwheels.myshopify.com"==Shopify.shop)&&m(e);if(!s){var t=[];try{t=$._data(e).events.click,$._data(e).events.click=[]}catch(e){}rterms.checkoutEvents.push(t),setTimeout((function(){window.bndlr&&!s&&e.classList.add("bndlr-button-disabled")}),1e3),window.ZapietWidgetConfig&&(window.customCheckoutValidation=rterms.checkout,setTimeout((function(){window.customCheckoutValidation=rterms.checkout}),5e3)),e.addEventListener("click",rterms.checkout)}if(e.parentElement.closest(".cart--totals .cart--nav"))return;if(e.parentElement.querySelector(".terms-relentless"))return;if(rterms.settings.hide_in_drawer&&e.closest("#cart-notification-form, sidebar-drawer"))return;if(e.parentElement.parentElement&&e.parentElement.parentElement.querySelector(".terms-relentless"))return;!function(e,t){setTimeout((function(){var r=e;e.previousElementSibling&&e.previousElementSibling.previousElementSibling&&e.previousElementSibling.previousElementSibling.previousElementSibling&&"cart__shipping"===e.previousElementSibling.previousElementSibling.previousElementSibling.className&&(r=e.previousElementSibling.previousElementSibling),e.previousElementSibling&&(e.previousElementSibling.href&&e.previousElementSibling.href.match(/\/cart$/)||e.previousElementSibling.name&&"update"===e.previousElementSibling.name)&&(r=e.previousElementSibling),e.parentElement.querySelector('input[value="Update Cart"]')&&(r=e.parentElement.querySelector('input[value="Update Cart"]'));var o,n=e.parentElement.parentElement.querySelector('[href="/cart"]');if(!n&&e.parentElement.previousElementSibling&&(n=e.parentElement.previousElementSibling.querySelector('[href="/cart"]')),!rterms.settings.ignore_cart_button&&n){var s=n.getBoundingClientRect().top,a=e.getBoundingClientRect().top;n.innerHTML&&s&&a&&s",rterms.metafield.spacing_top&&(t.style.marginTop=rterms.metafield.spacing_top+"px"),rterms.metafield.spacing_right&&(t.style.marginRight=rterms.metafield.spacing_right+"px"),rterms.metafield.spacing_bottom&&(t.style.marginBottom=rterms.metafield.spacing_bottom+"px"),rterms.metafield.spacing_left&&(t.style.marginLeft=rterms.metafield.spacing_left+"px"),e.before(t),window.Shopify&&Shopify.theme&&Shopify.theme.name&&Shopify.theme.schema_name&&("Blockshop"==Shopify.theme.name||["Stretch","Yuva","Prestige","Booster Premium","Essence"].includes(Shopify.theme.schema_name))||rterms.settings.disableLayoutFix||(t.parentNode.style.display="block")}}))})),!s&&n&&(l(".dynamic-checkout__content",m),l(r,(function(e){if(m(e).classList.add("rterms-trigger-modal"),document.querySelector(".rterms-shadow"))return;var t=document.createElement("div");t.classList.add("rterms-shadow"),t.innerHTML='",document.body.appendChild(t)}))),8===Math.floor(9*Math.random())&&d(e,{type:"POST",body:{shop:Shopify.shop,event:"terms_views"}},(function(e){console.log(e)})),document.body.addEventListener("click",(function(t){if(t.target.matches(".rterms-checkbox"))if(t.target.checked){t.target.matches(".rterms-modal .rterms-checkbox")&&setTimeout((function(){var e=t.target.closest(".rterms-shadow");e&&e.classList.remove("rterms-modal-open");var o=document.querySelectorAll(r);o&&o.forEach((function(e){e.click();var t=e.querySelectorAll('[role="button"], [type="button"]');t.length?t.forEach((function(e){e.click()})):window.location.href="/checkout"}))}),700),rterms.addedEvents||(rterms.addedEvents=!0,rterms.checkouts.forEach((function(e){try{$._data(e).events.click=rterms.checkoutEvents.shift()}catch(e){}}))),(o=document.querySelectorAll(".rterms-disable-dynamic"))&&o.forEach((function(e){e.style.pointerEvents="none"})),!rterms._3lj2l&&rterms.metafield.date&&"on"===rterms.metafield.date&&d(window.Shopify.routes.root+"cart/update.js",{type:"POST",body:{attributes:{"Terms Accepted At":Date()}},headers:{"Content-Type":"application/json"}}),8===Math.floor(9*Math.random())&&d(e,{type:"POST",body:{shop:Shopify.shop,event:"terms_clicks"}},(function(e){console.log(e)})),rterms.checkouts.forEach((function(e){e.classList.remove("bndlr-button-disabled")})),t.target&&t.target.checked&&(window.customCheckoutValidation=null)}else{var o,n=!0,a=document.querySelectorAll(".rterms-checkbox");if(a)for(var i=0;i{for(let o of r)if(o.addedNodes.length)for(let r of o.addedNodes)if(r.matches){r.matches(e)&&t(r);var n=r.querySelectorAll(e);n.length&&n.forEach((function(e){t(e)}))}})).observe(document.body,{childList:!0,subtree:!0})}}function m(e){var t=document.createElement("div");return t.classList.add("rterms-disable-dynamic"),e.parentElement.style.position="relative",e.parentNode.insertBefore(t,e),setInterval((function(){var r=e.parentNode?e.parentNode.getBoundingClientRect().top:0,o=e.parentNode?e.getBoundingClientRect().top:0;if(t.style.top=Math.abs(r-o)+"px",t.style.left=e.offsetLeft+"px",t.style.width=(e.offsetWidth||200)+"px",t.style.height=(e.offsetHeight||75)+"px",e.parentNode){var n=window.getComputedStyle(e.parentNode);n.textAlign&&"right"===n.textAlign&&(t.style.right="0")}}),1e3),t}function d(e,t,r,o){if(!window.XMLHttpRequest)return o("no xhr");var n=new XMLHttpRequest;n.onreadystatechange=function(){if(4==this.readyState)if(200==this.status)try{r(JSON.parse(this.response))}catch(e){o&&o(e)}else o&&o(this.status)},n.open(t.type,e,!0);var s=t.headers&&t.headers["Content-Type"]||"application/x-www-form-urlencoded";n.setRequestHeader("Content-Type",s);var a="";if("application/x-www-form-urlencoded"===s){for(var i in t.body)a+=encodeURIComponent(i)+"="+encodeURIComponent(t.body[i])+"&";a=a.slice(0,-1)}else a=JSON.stringify(t.body);n.send(a)}}();