1"use strict";function checkFetchStatus(e){if(200===e.status)return e.json();console.log("Looks like there was a problem. Status Code: "+e.status)}function _createForOfIteratorHelper(e,t){var r,n,o,a,i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(i)return o=!(n=!0),{s:function(){i=i.call(e)},n:function(){var e=i.next();return n=e.done,e},e:function(e){o=!0,r=e},f:function(){try{n||null==i.return||i.return()}finally{if(o)throw r}}};if(Array.isArray(e)||(i=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length)return i&&(e=i),a=0,{s:t=function(){},n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var r;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(r="Object"===(r={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}!function(){function e(e){this.element=e}function t(e){return RegExp("(^| )"+e+"( |$)")}function r(e,t,r){for(var n=0;n<e.length;n++)t.call(r,e[n])}e.prototype={add:function(){r(arguments,function(e){this.contains(e)||(this.element.className+=" "+e)},this)},remove:function(){r(arguments,function(e){this.element.className=this.element.className.replace(t(e),"")},this)},toggle:function(e){return this.contains(e)?(this.remove(e),!1):(this.add(e),!0)},contains:function(e){return t(e).test(this.element.className)},replace:function(e,t){this.remove(e),this.add(t)}},"classList"in Element.prototype||Object.defineProperty(Element.prototype,"classList",{get:function(){return new e(this)}}),window.DOMTokenList&&null==DOMTokenList.prototype.replace&&(DOMTokenList.prototype.replace=e.prototype.replace)}(),window.Element&&!Element.prototype.closest&&(Element.prototype.closest=function(e){var t,r=(this.document||this.ownerDocument).querySelectorAll(e),n=this;do{for(t=r.length;0<=--t&&r.item(t)!==n;);}while(t<0&&(n=n.parentElement));return n}),self.fetch||(self.fetch=function(s,u){return u=u||{},new Promise(function(e,t){function r(){return{ok:2==(o.status/100|0),statusText:o.statusText,status:o.status,url:o.responseURL,text:function(){return Promise.resolve(o.responseText)},json:function(){return Promise.resolve(JSON.parse(o.responseText))},blob:function(){return Promise.resolve(new Blob([o.response]))},clone:r,headers:{keys:function(){return a},entries:function(){return i},get:function(e){return c[e.toLowerCase()]},has:function(e){return e.toLowerCase()in c}}}}var n,o=new XMLHttpRequest,a=[],i=[],c={};for(n in o.open(u.method||"get",s,!0),o.onload=function(){o.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(e,t,r){a.push(t=t.toLowerCase()),i.push([t,r]),c[t]=c[t]?c[t]+","+r:r}),e(r())},o.onerror=t,o.withCredentials="include"==u.credentials,u.headers)o.setRequestHeader(n,u.headers[n]);o.send(u.body||null)})});var accordionActiveClass="is-open",accordionToggleCollection=document.querySelectorAll(".accordion .accordion-toggle"),_iterator=_createForOfIteratorHelper(accordionToggleCollection);try{for(_iterator.s();!(_step=_iterator.n()).done;){var accordionToggle=_step.value;accordionToggle.addEventListener("click",function(){this.closest(".accordion-wrap");var e,t=this.closest(".accordion"),r=this.nextElementSibling,n=r.querySelectorAll(".accordion-content"),o=0,a=_createForOfIteratorHelper(n);try{for(a.s();!(e=a.n()).done;)o=o+e.value.scrollHeight+50}catch(e){a.e(e)}finally{a.f()}t.classList.contains(accordionActiveClass)?t.classList.contains(accordionActiveClass)&&(t.classList.remove(accordionActiveClass),r.style.maxHeight=null):(t.classList.toggle(accordionActiveClass),r.style.maxHeight=r.scrollHeight+o+"px")})}}catch(e){_iterator.e(e)}finally{_iterator.f()}function _createForOfIteratorHelper(e,t){var r,n,o,a,i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(i)return o=!(n=!0),{s:function(){i=i.call(e)},n:function(){var e=i.next();return n=e.done,e},e:function(e){o=!0,r=e},f:function(){try{n||null==i.return||i.return()}finally{if(o)throw r}}};if(Array.isArray(e)||(i=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length)return i&&(e=i),a=0,{s:t=function(){},n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var r;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(r="Object"===(r={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}
1var cart={apiBaseUrl:"https://api.certus.com/Carts/api/v1",cartBaseUrl:"https://cart.safemotorist.com",unpublishedData:"false",init:function(){var e=cart.getQueryString("tp"),t=cart.readCookie("_up4tp")||"a",r=cart.getQueryString("cc"),n=cart.readCookie("_up4cc"),o=cart.getQueryString("gid")||cart.getQueryString("lgr"),a=cart.readCookie("_up4gid"),i=JSON.parse(sessionStorage.getItem("localCart"));(e&&e!==t||r&&r!==n||o&&o!==a)&&i?(console.log("Reinitializing the cart with price override..."),i={cartId:(i=i.cartId)&&i.toLowerCase(),productIds:[],pricingVariant:e?e.toLowerCase():t,groupId:o?o.toLowerCase():a,coupon:r?r.toLowerCase():n,sourceHost:"safemotorist.com"},e={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)},t="".concat(cart.apiBaseUrl,"/Carts/CartProductPricingChange/?unpublished=").concat(cart.unpublishedData),fetch(t,e).then(function(e){return 200!==e.status&&e.status<500?(console.log("API Status Code: "+e.status),e.json()):500<=e.status?void console.log("API Status Code: "+e.status):e.json()}).then(function(e){var t;e&&null!=e&&null!=(t=e.cartProducts)&&t.length?(sessionStorage.setItem("localCart",JSON.stringify(e)),e.cartId!==cart.readCookie("cartId")&&cart.setCookie("cartId",e.cartId,7),cart.updateCartItemCount(e)):e&&e.errors||(console.log("There are no items in the cart."),cart.deleteCookie("cartId"),sessionStorage.removeItem("localCart"),cart.updateCartItemCount(cart.getLocalCart())),cart.updateCartLink(),cart.initAddToCartBtns()}).catch(function(e){console.log(e)})):(cart.fetchCart(),cart.updateCartLink(),cart.initAddToCartBtns()),cart.initAddBtnEvent()},fetchCart:function(e){var t=(new Date).getTime(),t="×tamp=".concat(t),e=e||cart.getCartId(),t="".concat(cart.apiBaseUrl,"/Carts/").concat(e,"/?completeProducts=true&unpublished=").concat(cart.unpublishedData).concat(t);e?fetch(t).then(checkFetchStatus).then(function(e){var t;e&&null!=e&&null!=(t=e.cartProducts)&&t.length?(sessionStorage.setItem("localCart",JSON.stringify(e)),e.cartId!==cart.readCookie("cartId")&&cart.setCookie("cartId",e.cartId,7),cart.updateCartItemCount(e)):(console.log("There are no items in the cart."),cart.deleteCookie("cartId"),sessionStorage.removeItem("localCart"),cart.updateCartItemCount(cart.getLocalCart())),cart.updateCartLink(),cart.initAddToCartBtns()}).catch(function(e){console.error(e)}):sessionStorage.removeItem("localCart")},addToCart:function(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],r=!(2<arguments.length&&void 0!==arguments[2])||arguments[2],n=3<arguments.length?arguments[3]:void 0,o=e.productId,a=e.upsells,e=e.quantity,i="".concat(cart.apiBaseUrl,"/CartProducts/?completeProducts=true&unpublished=").concat(cart.unpublishedData),c=JSON.parse(sessionStorage.getItem("productsData")).find(function(e){return e.id===o}),s={cartId:cart.getCartId(),productId:c.id,quantity:e||1,pricingUsed:c.pricing.typePricing,couponCode:cart.readCookie("_up4cc"),sourceHost:"safemotorist.com",groupId:c.pricing.groupId||"5562f4ac-7d9d-471c-a389-11b285049cc7",selectedUpsellProductIds:a||[]},u=cart.readCookie("_up4tp")?"&tp=".concat(cart.readCookie("_up4tp")):"",l=cart.readCookie("_up4cc")?"&coupon=".concat(cart.readCookie("_up4cc")):"",d=cart.readCookie("_up4gid")?"&groupId=".concat(cart.readCookie("_up4gid")):"",e={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)};fetch(i,e).then(checkFetchStatus).then(function(e){e.cartId?(cart.setCookie("cartId",e.cartId,7),sessionStorage.setItem("localCart",JSON.stringify(e)),cart.updateCartItemCount(e),cart.updateCartLink(),cart.initAddToCartBtns(),t||cart.pushAddToCartDatalayer(s.productId),r&&(sessionStorage.setItem("viewCart",!0),window.location.href="".concat(cart.cartBaseUrl,"/cart/?cartId=").concat(e.cartId).concat(u).concat(l).concat(d))):console.error("There are no items in the cart."),n&&n()}).catch(function(e){console.log(e)})},updateCart:function(e,t){var r=e.productId,e=e.quantity,n=cart.getLocalCart(),o=n.cartProducts.find(function(e){return e.productId===r}),a="".concat(cart.apiBaseUrl,"/CartProducts/?completeProducts=true&unpublished=").concat(cart.unpublishedData),o={cart_ProductId:o.cart_ProductId,cartId:n.cartId,productId:r,quantity:e,isSelected:!1},n={method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)};fetch(a,n).then(checkFetchStatus).then(function(e){e.cartId?(sessionStorage.setItem("localCart",JSON.stringify(e)),cart.updateCartItemCount(e),cart.updateCartLink(),cart.initAddToCartBtns()):console.error("The cart was not updated."),t&&t()}).catch(function(e){console.log(e)})},removeFromCart:function(t,r){var e=cart.getLocalCart(),n=e.cartProducts.find(function(e){return e.productId===t}),e="".concat(cart.apiBaseUrl,"/CartProducts/").concat(e.cartId,"/").concat(n.cart_ProductId,"/?completeProducts=true");fetch(e,{method:"DELETE"}).then(checkFetchStatus).then(function(e){e.cartId?(sessionStorage.setItem("localCart",JSON.stringify(e)),cart.updateCartItemCount(e),cart.updateCartLink(),cart.initAddToCartBtns()):console.error("The cart was not updated."),r&&r()}).catch(function(e){console.log(e)})},pushAddToCartDatalayer:function(t){var e;sessionStorage.getItem("productsData")&&(e=JSON.parse(sessionStorage.getItem("productsData")).find(function(e){return e.id===t}),e=e,window.dataLayer.push({ecommerce:null}),window.dataLayer.push({event:"addToCart",ecommerce:{currencyCode:"USD",add:{products:[{name:e.name,id:e.id,price:e.pricing.priceAfterDiscount||e.pricing.price,category:e.productCategory.categoryName,quantity:1}]}}}),window.gtag)&>ag("event","add_to_cart",{currency:"USD",value:e.pricing.priceAfterDiscount||e.pricing.price,items:[{item_id:e.id,item_name:e.name,affiliation:"safemotorist.com",coupon:e.pricing.coupon||"",discount:e.pricing.discountAmount||0,item_category:e.productCategory.categoryName,item_category2:e.productCategory.subCategoryName,item_category3:e.productCategory.verticalName,price:e.pricing.price,quantity:1}]})},getCartId:function(){return cart.readCookie("cartId")},getLocalCart:function(){return JSON.parse(sessionStorage.getItem("localCart"))||{cartId:null,cartProducts:[]}},updateCartItemCount:function(e){var t,r=e.cartProducts.reduce(function(e,t){return e+t.quantity},0),e=document.querySelectorAll("a.view-cart .item-count"),n=_createForOfIteratorHelper(e);try{for(n.s();!(t=n.n()).done;)t.value.innerHTML=r||0}catch(e){n.e(e)}finally{n.f()}},updateCartLink:function(){var e,t=cart.readCookie("cartId"),r=document.querySelectorAll("a.view-cart"),n=_createForOfIteratorHelper(r);try{for(n.s();!(e=n.n()).done;){var o=e.value;t&&(o.href=cart.updateQueryString(o.href,"cartId",t))}}catch(e){n.e(e)}finally{n.f()}},initAddBtnEvent:function(){document.addEventListener("click",function(e){var t=e.target.closest("a[data-pid]"),r=null==t?void 0:t.dataset.pid,n=null==t?void 0:t.dataset.cart;t&&!t.classList.contains("view-cart-btn")&&sessionStorage.getItem("productsData")&&"direct"!==n&&(e.preventDefault(),e=(e=null==t?void 0:t.dataset.upsells)?e.replace(/\s/g,"").split(","):null,"add"===n?(null!=t&&t.classList.add("btn-processing"),cart.addToCart({productId:r,upsells:e,quantity:1},!1,!1)):(cart.deleteCookie("cartId"),sessionStorage.removeItem("localCart"),sessionStorage.setItem("viewCart",!0),e?(null!=t&&t.classList.add("btn-processing"),cart.addToCart({productId:r,upsells:e,quantity:1})):(cart.initAddToCartBtns(),n=cart.readCookie("_up4tp"),r=cart.readCookie("_up4cc"),e=cart.readCookie("_up4gid"),n&&(t.href=cart.updateQueryString(t.href,"tp",n)),r&&(t.href=cart.updateQueryString(t.href,"coupon",r)),e&&(t.href=cart.updateQueryString(t.href,"groupId",e)),window.location.href=t.href)))},!0)},initAddToCartBtns:function(){var o,e=document.querySelectorAll("a[data-pid]"),a=cart.readCookie("cartId"),i=cart.readCookie("_up4tp")?"&tp=".concat(cart.readCookie("_up4tp")):"",c=cart.readCookie("_up4cc")?"&coupon=".concat(cart.readCookie("_up4cc")):"",s=cart.readCookie("_up4gid")?"&groupId=".concat(cart.readCookie("_up4gid")):"",u=cart.getLocalCart(),t=_createForOfIteratorHelper(e);try{for(t.s();!(o=t.n()).done;)!function(){var e=o.value,t=e.dataset.pid,r=e.dataset.cart,n=e.lang;e.classList.remove("btn-processing"),null!=u&&u.cartProducts.some(function(e){return e.productId===t})&&a?"add"===r||1===(null==u?void 0:u.cartProducts.length)?("add"===r&&(e.innerHTML=n.includes("es-")?"Ver en carro":"View in Cart"),e.classList.add("view-cart-btn"),e.href="".concat(cart.cartBaseUrl,"/cart/?cartId=").concat(a).concat(i).c
1oncat(c).concat(s)):(e.classList.remove("view-cart-btn"),e.href="".concat(cart.cartBaseUrl,"/cart/?productId=").concat(t).concat(i).concat(c).concat(s)):("add"===r&&(e.innerHTML=n.includes("es-")?"Añadir al carro":"Add to Cart"),e.classList.remove("view-cart-btn"),e.href="".concat(cart.cartBaseUrl,"/cart/?productId=").concat(t).concat(i).concat(c).concat(s))}()}catch(e){t.e(e)}finally{t.f()}},readCookie:function(e){for(var t=encodeURI(e)+"=",r=document.cookie.split(";"),n=0;n<r.length;n++){for(var o=r[n];" "==o.charAt(0);)o=o.substring(1,o.length);if(0==o.indexOf(t))return decodeURI(o.substring(t.length,o.length))}return null},setCookie:function(e,t,r){var n="",r=(r&&((o=new Date).setTime(o.getTime()+24*r*60*60*1e3),n="; expires="+o.toGMTString()),"localhost"==location.hostname?"":";domain=."+location.hostname.split(".").reverse()[1]+"."+location.hostname.split(".").reverse()[0]),o="localhost"==location.hostname?"":";SameSite=None; Secure";document.cookie=e+"="+t+n+";path=/"+r+o},deleteCookie:function(e){var t=window.location,r="localhost"===t.hostname?"":";domain=."+t.hostname.split(".").reverse()[1]+"."+t.hostname.split(".").reverse()[0],t="localhost"===t.hostname?"":";SameSite=None; Secure";document.cookie=e+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/"+r+t},getQueryString:function(e,t){t=t||window.location.href,e=e.replace(/[\[\]]/g,"\\$&");e=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)").exec(t);
1return e?e[2]?decodeURIComponent(e[2].replace(/\+/g," ")):"":null},updateQueryString:function(e,t,r){var n=new RegExp("([?&])"+t+"=.*?(&|$)","i"),o=-1!==e.indexOf("?")?"&":"?";return e.match(n)?e.replace(n,"$1"+t+"="+r+"$2"):e+o+t+"="+r}},reInitCart=(cart.init(),function(){"true"===sessionStorage.getItem("viewCart")&&(sessionStorage.removeItem("viewCart"),cart.init())});function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _createForOfIteratorHelper(e,t){var r,n,o,a,i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(i)return o=!(n=!0),{s:function(){i=i.call(e)},n:function(){var e=i.next();return n=e.done,e},e:function(e){o=!0,r=e},f:function(){try{n||null==i.return||i.return()}finally{if(o)throw r}}};if(Array.isArray(e)||(i=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length)return i&&(e=i),a=0,{s:t=function(){},n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var r;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(r="Object"===(r={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}window.removeEventListener("pageshow",function(){return reInitCart()}),window.addEventListener("pageshow",function(){return reInitCart()});var _step,activeClass="is-active",dropdownCollection=document.querySelectorAll(".dropdown-list span.dropdown"),_iterator=_createForOfIteratorHelper(dropdownCollection);try{var _loop=function(){var r=_step.value;r.addEventListener("click",function(){if(r.classList.contains(activeClass))r.classList.contains(activeClass)&&r.classList.remove(activeClass);else{for(var e=document.querySelectorAll(".dropdown-list span.dropdown"),t=0;t<e.length;t++)e[t].classList.remove(activeClass);r.classList.toggle(activeClass)}})};for(_iterator.s();!(_step=_iterator.n()).done;)_loop()}catch(e){_iterator.e(e)}finally{_iterator.f()}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _regeneratorRuntime(){var o=_regenerator(),e=o.m(_regeneratorRuntime),t=(Object.getPrototypeOf?Object.getPrototypeOf(e):e.__proto__).constructor;function a(e){e="function"==typeof e&&e.constructor;return!!e&&(e===t||"GeneratorFunction"===(e.displayName||e.name))}var r={throw:1,return:2,break:3,continue:3};function i(e){var o,a;return function(n){o||(o={stop:function(){return a(n.a,2)},catch:function(){return n.v},abrupt:function(e,t){return a(n.a,r[e],t)},delegateYield:function(e,t,r){return o.resultName=t,a(n.d,_regeneratorValues(e),r)},finish:function(e){return a(n.f,e)}},a=function(e,t,r){n.p=o.prev,n.n=o.next;try{return e(t,r)}finally{o.next=n.n}}),o.resultName&&(o[o.resultName]=n.v,o.resultName=void 0),o.sent=n.v,o.next=n.n;try{return e.call(this,o)}finally{n.p=o.prev,n.n=o.next}}}return(_regeneratorRuntime=function(){return{wrap:function(e,t,r,n){return o.w(i(e),t,r,n&&n.reverse())},isGeneratorFunction:a,mark:o.m,awrap:function(e,t){return new _OverloadYield(e,t)},AsyncIterator:_regeneratorAsyncIterator,async:function(e,t,r,n,o){return(a(t)?_regeneratorAsyncGen:_regeneratorAsync)(i(e),t,r,n,o)},keys:_regeneratorKeys,values:_regeneratorValues}})()}function _regeneratorValues(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],r=0;if(t)return t.call(e);
1if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return{value:(e=e&&r>=e.length?void 0:e)&&e[r++],done:!e}}}}throw new TypeError(_typeof(e)+" is not iterable")}function _regeneratorKeys(e){var t,r=Object(e),n=[];for(t in r)n.unshift(t);return function e(){for(;n.length;)if((t=n.pop())in r)return e.value=t,e.done=!1,e;return e.done=!0,e}}function _regeneratorAsync(e,t,r,n,o){var a=_regeneratorAsyncGen(e,t,r,n,o);return a.next().then(function(e){return e.done?e.value:a.next()})}function _regeneratorAsyncGen(e,t,r,n,o){return new _regeneratorAsyncIterator(_regenerator().w(e,t,r,n),o||Promise)}function _regeneratorAsyncIterator(c,s){var o;this.next||(_regeneratorDefine2(_regeneratorAsyncIterator.prototype),_regeneratorDefine2(_regeneratorAsyncIterator.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),_regeneratorDefine2(this,"_invoke",function(r,e,n){function t(){return new s(function(e,t){!function t(e,r,n,o){try{var a=c[e](r),i=a.value;return i instanceof _OverloadYield?s.resolve(i.v).then(function(e){t("next",e,n,o)},function(e){t("throw",e,n,o)}):s.resolve(i).then(function(e){a.value=e,n(a)},function(e){return t("throw",e,n,o)})}catch(e){o(e)}}(r,n,e,t)})}return o=o?o.then(t,t):t()},!0)}function _regenerator(){var g,e="function"==typeof Symbol?Symbol:{},t=e.iterator||"@@iterator",r=e.toStringTag||"@@toStringTag";function n(e,t,r,n){var o,a,i,c,s,u,l,d,p,t=t&&t.prototype instanceof m?t:m,t=Object.create(t.prototype);return _regeneratorDefine2(t,"_invoke",(o=e,a=r,l=n||[],d=!1,p={p:u=0,n:0,v:g,a:f,f:f.bind(g,4),d:function(e,t){return i=e,c=0,s=g,p.n=t,y}},function(e,t,r){if(1<u)throw TypeError("Generator is already running");for(d&&1===t&&f(t,r),c=t,s=r;(v=c<2?g:s)||!d;){i||(c?c<3?(1<c&&(p.n=-1),f(c,s)):p.n=s:p.v=s);try{if(u=2,i){if(v=i[e=c?e:"next"]){if(!(v=v.call(i,s)))throw TypeError("iterator result is not an object");if(!v.done)return v;s=v.value,c<2&&(c=0)}else 1===c&&(v=i.return)&&v.call(i),c<2&&(s=TypeError("The iterator does not provide a '"+e+"' method"),c=1);i=g}else if((v=(d=p.n<0)?s:o.call(a,p))!==y)break}catch(e){i=g,c=1,s=e}finally{u=1}}return{value:v,done:d}}),!0),t;function f(e,t){for(c=e,s=t,v=0;!d&&u&&!r&&v<l.length;v++){var r,n=l[v],o=p.p,a=n[2];3<e?(r=a===t)&&(s=n[(c=n[4])?5:c=3],n[4]=n[5]=g):n[0]<=o&&((r=e<2&&o<n[1])?(c=0,p.v=t,p.n=n[1]):o<a&&(r=e<3||n[0]>t||a<t)&&(n[4]=e,n[5]=t,p.n=a,c=0))}if(r||1<e)return y;throw d=!0,t}}var y={};function m(){}function o(){}function a(){}var v=Object.getPrototypeOf,e=[][t]?v(v([][t]())):(_regeneratorDefine2(v={},t,function(){return this}),v),i=a.prototype=m.prototype=Object.create(e);function c(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,a):(e.__proto__=a,_regeneratorDefine2(e,r,"GeneratorFunction")),e.prototype=Object.create(i),e}return _regeneratorDefine2(i,"constructor",o.prototype=a),_regeneratorDefine2(a,"constructor",o),_regeneratorDefine2(a,r,o.displayName="GeneratorFunction"),_regeneratorDefine2(i),_regeneratorDefine2(i,r,"Generator"),_regeneratorDefine2(i,t,function(){return this}),_regeneratorDefine2(i,"toString",function(){return"[object Generator]"}),(_regenerator=function(){return{w:n,m:c}})()}function _regeneratorDefine2(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}(_regeneratorDefine2=function(e,t,r,n){t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:((n=function(t,r){_regeneratorDefine2(e,t,function(e){return this._invoke(t,r,e)})})("next",0),n("throw",1),n("return",2))})(e,t,r,n)}function _OverloadYield(e,t){this.v=e,this.k=t}function asyncGeneratorStep(e,t,r,n,o,a,i){try{var c=e[a](i),s=c.value}catch(e){return void r(e)}c.done?t(s):Promise.resolve(s).then(n,o)}function _asyncToGenerator(c){return function(){var e=this,i=arguments;return new Promise(function(t,r){var n=c.apply(e,i);function o(e){asyncGeneratorStep(n,t,r,o,a,"next",e)}function a(e){asyncGeneratorStep(n,t,r,o,a,"throw",e)}o(void 0)})}}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var r;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(r="Object"===(r={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}document.addEventListener("click",function(e){var t=document.querySelectorAll(".dropdown-list span.dropdown"),r=document.querySelectorAll(".dropdown-list span.submenu.level-2"),e=(e||window.event).target;if(!e.closest(".dropdown-list")){for(var n=0;n<t.length;n++)t[n].classList.remove(activeClass);for(var o=0;o<r.length;o++)r[o].classList.remove(activeClass)}e.closest(".dropdown-list")&&_toConsumableArray(e.classList).includes("level-2")&&e.classList.toggle(activeClass)},!1),document.querySelector(".copyright-year")&&(document.querySelector(".copyright-year").innerHTML=(new Date).getFullYear()),function(){var n=Date.now(),e=sessionStorage.getItem("lastApiCall")?Number(sessionStorage.getItem("lastApiCall")):null,t=function(){var e=_asyncToGenerator(_regeneratorRuntime().mark(function e(){var t,r;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch("/api/wake-up/");case 3:if((t=e.sent).ok)return e.next=7,t.text();e.next=12;break;case 7:r=e.sent,console.log("API:",r),sessionStorage.setItem("lastApiCall",n),e.next=13;break;case 12:console.error("Error:",t.status,t.statusText);case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(0),console.error("Request failed:",e.t0.message);case 18:case"end":return e.stop()}},e,null,[[0,15]])}));return function(){return e.apply(this,arguments)}}();window.location.hostname.includes("localhost")||e&&!(e+3e5<n)||t()}(),function(){for(var e=document.getElementById("nav").getElementsByTagName("a"),t=window.location.href,r=0;r<e.length;r++)e[r].href==t&&e[r].classList.add("is-active")}(),document.getElementById("nav").querySelector("ul").insertAdjacentHTML("beforebegin","<button id='menutoggle' aria-label='Menu' role='button'><div class='hamburger-box'><div class='hamburger-inner'></div></div><span>Menu</span></button>");var resizeTimer,menuToggle=document.getElementById("menutoggle"),activeClass="is-active",userCollapsed=(document.addEventListener("click",function(e){var t,r,n=e.target;if(n.closest("#menutoggle")){menuToggle.classList.toggle(activeClass);for(var o=document.querySelectorAll("#nav span.submenu, #nav a.submenu, #nav ul.submenu"),a=0;a<o.length;a++)o[a].classList.remove(activeClass);e.preventDefault()}isDesktopMenu()&&n.closest("#nav span.submenu.level-2, #nav a.submenu.level-2")?(r=!(t=n.closest("#nav span.submenu.level-2, #nav a.submenu.level-2")).classList.contains(activeClass),t.classList.toggle(activeClass,r),r?userCollapsed.delete(t):userCollapsed.add(t),e.preventDefault()):(0<menuToggle.offsetWidth&&0<menuToggle.offsetHeight||_toConsumableArray(n.classList).includes("level-2"))&&(n.closest("#nav span.submenu, #nav a.submenu")&&n.closest("#nav span.submenu, #nav a.submenu").classList.toggle(activeClass),n.closest("#nav")||menuToggle.classList.contains(activeClass)&&hideMenu())},!1),new WeakSet),isDesktopMenu=function(){return menuToggle.offsetWidth<=0&&menuToggle.offsetHeight<=0},setLevel2ActiveClass=function(e,t){e.querySelectorAll("span.submenu.level-2, a.submenu.level-2").forEach(function(e){t&&userCollapsed.has(e)||e.classList.toggle(activeClass,t)})},runOnDesktop=function(t){return function(e){isDesktopMenu()&&t(e)}},topLevelItems=document.querySelectorAll("#nav > ul > li");function hideMenu(){for(var e=document.querySelectorAll("#menutoggle, #menutoggle + ul, #nav span.submenu, #nav a.submenu, #nav ul.submenu"),t=0;t<e.length;t++)e[t].classList.remove(activeClass)}function _createForOfIteratorHelper(e,t){var r,n,o,a,i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(i)return o=!(n=!0),{s:function(){i=i.call(e)},n:function(){var e=i.next();return n=e.done,e},e:function(e){o=!0,r=e},f:function(){try{n||null==i.return||i.return()}finally{if(o)throw r}}};if(Array.isArray(e)||(i=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length)return i&&(e=i),a=0,{s:t=function(){},n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var r;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(r="Object"===(r={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}
1topLevelItems.forEach(function(e){e.querySelector("span.submenu.level-2, a.submenu.level-2")&&(e.addEventListener("mouseenter",runOnDesktop(function(){return setLevel2ActiveClass(e,!0)})),e.addEventListener("mouseleave",runOnDesktop(function(){return setLevel2ActiveClass(e,!1)})))}),window.addEventListener("resize",function(){clearTimeout(resizeTimer),resizeTimer=setTimeout(function(){menuToggle.offsetWidth<=0&&menuToggle.offsetHeight<=0&&hideMenu()},250)},!1);var pricing={init:function(){function c(o){var e=!u||null!=o&&o.testPrice?"":"&testPrice=".concat(u),t=!l||null!=o&&o.groupId?null!=o&&o.groupId?"&groupId=".concat(s):"":"&groupId=".concat(l),a=pricing.readCookie("_up4cc"),r=!d||null!=o&&o.coupon?a?"&couponcode=".concat(a):"":"&couponcode=".concat(d),n="&unpublished=".concat("false"),i="&fullSiteBuild=".concat("false"),e="".concat("https://api.certus.com/Products/api/v2/Public","/GetProductsBy/?host=").concat("safemotorist.com").concat(e).concat(t).concat(r).concat(n).concat(i);fetch(e).then(function(e){return 200!==e.status&&e.status<500?(console.log("API Status Code: "+e.status),e.json()):500<=e.status?void console.log("API Status Code: "+e.status):e.json()}).then(function(e){var t,r,n;null!=e&&e.errors?(n={testPrice:!(null==e||null==(n=e.errors)||!n.testPrice),groupId:!(null==e||null==(n=e.errors)||!n.groupId)},null!=e&&null!=(t=e.errors)&&t.testPrice&&(pricing.deleteCookie("_up4tp"),console.log("Calling API with default testPrice!")),null!=e&&null!=(t=e.errors)&&t.groupId&&(pricing.deleteCookie("_up4gid"),console.log("Calling API with default groupId!")),c(n)):(n=t=!0,r=e.some(function(e){return(null==e||null==(e=e.pricing)||null==(e=e.typePricing)?void 0:e.toLowerCase())===(null==u?void 0:u.toLowerCase())}),u&&r?pricing.setCookie("_up4tp",null==u?void 0:u.toLowerCase(),30):!u||null!=o&&o.testPrice||pricing.setCookie("_up4tp",null==u?void 0:u.toLowerCase()),r=e.some(function(e){var t;return(null==e||null==(t=e.pricing)||null==(t=t.groupId)?void 0:t.toLowerCase())===(null==l?void 0:l.toLowerCase())||(null==e||null==(t=e.pricing)||null==(t=t.groupId)?void 0:t.toLowerCase())===s.toLowerCase()}),(l||null!=o&&o.groupId)&&r?(!l||null!=o&&o.groupId?null!=o&&o.groupId&&pricing.setCookie("_up4gid",s.toLowerCase(),30):pricing.setCookie("_up4gid",null==l?void 0:l.toLowerCase(),30),t=!0):null!=o&&o.groupId||(t=!1,console.log("Calling API with default groupId!"),c({groupId:!0})),r=e.some(function(e){return"Coupon"===(null==e||null==(e=e.pricing)?void 0:e.discountSource)}),!d||!r||null!=o&&o.coupon?null!=o&&o.coupon||!a||(n=!1,console.log("Calling API with cookie coupon!"),c({coupon:!0})):(console.log("Setting cookie coupon!"),pricing.setCookie("_up4cc",null==d?void 0:d.toLowerCase(),30),n=!0),t&&n&&(pricing.displayPrice(e),pricing.storeProductData(e)))}).catch(function(e){console.error("API call failed",e)})}var s="5562f4ac-7d9d-471c-a389-11b285049cc7",u=pricing.getQueryString("tp")||pricing.readCookie("_up4tp")||null,l=pricing.getQueryString("gid")||pricing.getQueryString("lgr")||pricing.readCookie("_up4gid")||s,d=pricing.getQueryString("cc")||pricing.readCookie("_up4cc")||null,e=(pricing.setCookie("unpublished",0),sessionStorage.getItem("productsData")&&JSON.parse(sessionStorage.getItem("productsData")));e&&pricing.displayPrice(e),c()},displayPrice:function(o){var a,e=_toConsumableArray(document.getElementsByClassName("price")),t=_createForOfIteratorHelper(e);try{for(t.s();!(a=t.n()).done;)!function(){var e,t=a.value,r=t.dataset.pid,n=includeFeesInPrice(r);r&&(e=null==(e=o.find(function(e){return e.id.toLowerCase()===r.toLowerCase()}))?void 0:e.pricing)&&(n=n?e.price+e.agencyFee:e.price,n=(e=e.discountAmount?(n-e.discountAmount).toFixed(2).toString():null==n?void 0:n.toFixed(2).toString())?e.split(".")[0]:null,e=e?e.split(".")[1]?e.split(".")[1]:"00":null,t.getElementsByClassName("dollars")[0].innerHTML=n,"00"===(t.getElementsByClassName("cents")[0].innerHTML=e)?t.getElementsByClassName("cents")[0].classList.add("display-none"):t.getElementsByClassName("cents")[0].classList.remove("display-none"),t.classList.add("shown"))}()}catch(e){t.e(e)}finally{t.f()}var i,e=_toConsumableArray(document.getElementsByClassName("price-display")),r=_createForOfIteratorHelper(e);try{for(r.s();!(i=r.n()).done;)!function(){var e,t=i.value,r=t.dataset.pid,n=includeFeesInPrice(r);r&&(e=null==(e=o.find(function(e){return e.id.toLowerCase()===r.toLowerCase()}))?void 0:e.pricing)&&(n=n?e.price+e.agencyFee:e.price,e="$"+(e.discountAmount?(n-e.discountAmount).toFixed(2).toString():null==n?void 0:n.toFixed(2).toString()).replace(".00",""),t.innerHTML=e)}()}catch(e){r.e(e)}finally{r.f()}var c,e=_toConsumableArray(document.getElementsByClassName("regular-price")),n=_createForOfIteratorHelper(e);try{for(n.s();!(c=n.n()).done;)!function(){var e,t=c.value,r=t.dataset.pid,n=includeFeesInPrice(r);r&&(e=null==(e=o.find(function(e){return e.id.toLowerCase()===r.toLowerCase()}))?void 0:e.pricing)&&(n="$"+(null==(n=n?e.price+e.agencyFee:e.price)?void 0:n.toFixed(2).toString().replace(".00","")),t.innerHTML=n,t.classList.remove("display-none"),null!=(n=t.closest(".regular-price-display"))&&n.classList.remove("display-none"),e.discountAmount||t.classList.add("display-none"),e.discountAmount||null==(n=t.closest(".regular-price-display"))||n.classList.add("display-none"))}()}catch(e){n.e(e)}finally{n.f()}var s,e=_toConsumableArray(document.getElementsByClassName("savings-amount")),u=_createForOfIteratorHelper(e);try{for(u.s();!(s=u.n()).done;
1)!function(){var e,t,r=s.value,n=r.dataset.pid;n&&(e=null==(e=o.find(function(e){return e.id.toLowerCase()===n.toLowerCase()}))?void 0:e.pricing)&&(t="$"+(null==(t=e.discountAmount)?void 0:t.toFixed(2).toString().replace(".00","")),r.innerHTML=t,r.classList.remove("display-none"),r.closest(".savings-display").classList.remove("display-none"),e.discountAmount||r.classList.add("display-none"),e.discountAmount||r.closest(".savings-display").classList.add("display-none"))}()}catch(e){u.e(e)}finally{u.f()}},storeProductData:function(e){var t,r=[],n=_createForOfIteratorHelper(e);try{for(n.s();!(t=n.n()).done;){var o,a,i,c,s,u,l,d,p,f,g,y,m=t.value,v={id:m.id,name:m.name,description:m.description,productCategory:{subCategoryName:(null==(o=m.productCategory)?void 0:o.subCategoryName)||null,categoryName:(null==(a=m.productCategory)?void 0:a.categoryName)||null,verticalName:(null==(i=m.productCategory)?void 0:i.verticalName)||null},tags:m.tags?_toConsumableArray(m.tags):[],pricing:{price:null==(c=m.pricing)?void 0:c.price,discountAmount:null==(s=m.pricing)?void 0:s.discountAmount,priceAfterDiscount:0<(null==(u=m.pricing)?void 0:u.discountAmount)?Math.round(100*(m.pricing.price-m.pricing.discountAmount))/100:null==(l=m.pricing)?void 0:l.price,discountSource:null==(d=m.pricing)?void 0:d.discountSource,typePricing:null==(p=m.pricing)?void 0:p.typePricing,agencyFee:null==(f=m.pricing)?void 0:f.agencyFee,agencyFeeName:null==(g=m.pricing)?void 0:g.agencyFeeName,groupId:null==(y=m.pricing)?void 0:y.groupId,coupon:"Coupon"===m.pricing.discountSource?pricing.readCookie("_up4cc"):null},productBulkTiers:m.productBulkTiers};r.push(v)}}catch(e){n.e(e)}finally{n.f()}sessionStorage.setItem("productsData",JSON.stringify(r))},readCookie:function(e){for(var t=encodeURI(e)+"=",r=document.cookie.split(";"),n=0;n<r.length;n++){for(var o=r[n];" "==o.charAt(0);)o=o.substring(1,o.length);if(0==o.indexOf(t))return decodeURI(o.substring(t.length,o.length))}return null},setCookie:function(e,t,r){var n="",r=(r&&((o=new Date).setTime(o.getTime()+24*r*60*60*1e3),n="; expires="+o.toGMTString()),"localhost"==location.hostname?"":";domain=."+location.hostname.split(".").reverse()[1]+"."+location.hostname.split(".").reverse()[0]),o="localhost"==location.hostname?"":";SameSite=None; Secure";document.cookie=e+"="+t+n+";path=/"+r+o},deleteCookie:function(e){var t=window.location,r="localhost"===t.hostname?"":";domain=."+t.hostname.split(".").reverse()[1]+"."+t.hostname.split(".").reverse()[0],t="localhost"===t.hostname?"":";SameSite=None; Secure";document.cookie=e+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/"+r+t},getQueryString:function(e,t){t=t||window.location.href,e=e.replace(/[\[\]]/g,"\\$&");e=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)").exec(t);
1return e?e[2]?decodeURIComponent(e[2].replace(/\+/g," ")):"":null},updateQueryString:function(e,t,r){var n=new RegExp("([?&])"+t+"=.*?(&|$)","i"),o=-1!==e.indexOf("?")?"&":"?";return e.match(n)?e.replace(n,"$1"+t+"="+r+"$2"):e+o+t+"="+r}};pricing.init(),"serviceWorker"in navigator&&window.addEventListener("load",function(){navigator.serviceWorker.register("/sw.js").then(function(t){t.onupdatefound=function(){var e=t.installing;e.onstatechange=function(){switch(e.state){case"installed":navigator.serviceWorker.controller?console.log("New or updated content is available."):console.log("Content is now available offline!");break;case"redundant":console.error("The installing service worker became redundant.")}}}}).catch(function(e){console.error("Error during service worker registration:",e)})}); 2//# sourceMappingURL=main.min.js.map
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.