!function(){"use strict";const{googletag:t,tacAdConfig:e}=window;t.cmd=t.cmd||[];const o=()=>{const t=window.tenupDataLayer?.environment;return"production"===t?"no":"yes"};function n(){const t=window.innerWidth,e=Object.entries({mobile:320,"mobile-w":480,tablet:650,"tablet-w":768,desktop:980,"desktop-w":1180,"desktop-max":1200,"desktop-extra-w":1600}).sort(((t,e)=>e[1]-t[1])),[o]=e.find((([,e])=>t>=e))||["mobile"];return o}function a(){const{referrer:t}=document;if(!t)return"ext";const{hostname:e}=new URL(t);return e===window.location.hostname?"int":"ext"}var i=()=>{window.adSlots=[],window.googletag=window.googletag||{cmd:[]},window.adthrive=window.adthrive||{cmd:[]},window.adthrive.cmd.push((function(){t.cmd.push((function(){e.config.forEach((e=>{const o=(t=>{const e=[];return Object.keys(t.sizes).forEach((o=>{t.sizes[o].forEach((t=>{e.includes(t)||e.push(t)}))})),e})(e);window.adSlots[e.location]=t.defineSlot(e.name,o,e.location).addService(t.pubads()),Object.keys(e.kvs||[]).forEach((t=>{window.adSlots[e.location].setTargeting(t,e.kvs[t])}))}));const i=window.tenupDataLayer?.automotive?.make.length>1,w={environment:window.tenupDataLayer?.environment,template:window.tenupDataLayer?.template,artid:`gearpatrol_${window.tenupDataLayer?.postId}`,sect:window.tenupDataLayer?.section,clc:window.tenupDataLayer?.collection,utm_source:window.tenupDataLayer?.utm_source,utm_medium:window.tenupDataLayer?.utm_medium,utm_campaign:window.tenupDataLayer?.utm_campaign,contentID:window.tenupDataLayer?.postId,mak:window.tenupDataLayer?.automotive?.make,mod:window.tenupDataLayer?.automotive?.model,yr:window.tenupDataLayer?.automotive?.year,fuel:window.tenupDataLayer?.automotive?.fuel_type,type:window.tenupDataLayer?.automotive?.body,auto_array:i,site:"gearpatrol.com",pageurl:window.location.href,is_testing:o(),viewport:n(),refer:a()};Object.keys(w).forEach((e=>{w[e]&&t.pubads().setTargeting(e,w[e])})),t.pubads().enableSingleRequest(),t.enableServices(),window.adSlotsInitialized=!0}))}))};window.googletag=window.googletag||[],window.adthrive=window.adthrive||[];const w=t=>{if(window.googletag&&window.googletag.apiReady&&window.adthrive)i();else{const e=window.setTimeout((()=>{t<=30&&w(t+1),window.clearTimeout(e)}),100)}};w(0)}();; /*! For license information please see frontend.js.LICENSE.txt */ !function(){var e={9346:function(e,t,n){n.p=window.gearpatrol.distUrl},5792:function(e){var t={utf8:{stringToBytes:function(e){return t.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(t.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],n=0;n>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&n.rotl(e,8)|4278255360&n.rotl(e,24);for(var t=0;t0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],n=0,o=0;n>>5]|=e[n]<<24-o%32;return t},wordsToBytes:function(e){for(var t=[],n=0;n<32*e.length;n+=8)t.push(e[n>>>5]>>>24-n%32&255);return t},bytesToHex:function(e){for(var t=[],n=0;n>>4).toString(16)),t.push((15&e[n]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],n=0;n>>6*(3-i)&63)):n.push("=");return n.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var n=[],o=0,r=0;o>>6-2*r);return n}};e.exports=n}()},4964:function(e){e.exports=function(){"use strict";function e(){return"undefined"!==typeof window}function t(){var e=!1;try{var t={get passive(){e=!0}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){e=!1}return e}function n(){return!!(e()&&function(){}.bind&&"classList"in document.documentElement&&Object.assign&&Object.keys&&requestAnimationFrame)}function o(e){return 9===e.nodeType}function r(e){return e&&e.document&&o(e.document)}function i(e){var t=e.document,n=t.body,o=t.documentElement;return{scrollHeight:function(){return Math.max(n.scrollHeight,o.scrollHeight,n.offsetHeight,o.offsetHeight,n.clientHeight,o.clientHeight)},height:function(){return e.innerHeight||o.clientHeight||n.clientHeight},scrollY:function(){return void 0!==e.pageYOffset?e.pageYOffset:(o||n.parentNode||n).scrollTop}}}function s(e){return{scrollHeight:function(){return Math.max(e.scrollHeight,e.offsetHeight,e.clientHeight)},height:function(){return Math.max(e.offsetHeight,e.clientHeight)},scrollY:function(){return e.scrollTop}}}function a(e){return r(e)?i(e):s(e)}function u(e,n,o){var r,i=t(),s=!1,u=a(e),c=u.scrollY(),d={};function l(){var e=Math.round(u.scrollY()),t=u.height(),r=u.scrollHeight();d.scrollY=e,d.lastScrollY=c,d.direction=e>c?"down":"up",d.distance=Math.abs(e-c),d.isOutOfBounds=e<0||e+t>r,d.top=e<=n.offset[d.direction],d.bottom=e+t>=r,d.toleranceExceeded=d.distance>n.tolerance[d.direction],o(d),c=e,s=!1}function h(){s||(s=!0,r=requestAnimationFrame(l))}var f=!!i&&{passive:!0,capture:!1};return e.addEventListener("scroll",h,f),l(),{destroy:function(){cancelAnimationFrame(r),e.removeEventListener("scroll",h,f)}}}function c(e){return e===Object(e)?e:{down:e,up:e}}function d(e,t){t=t||{},Object.assign(this,d.options,t),this.classes=Object.assign({},d.options.classes,t.classes),this.elem=e,this.tolerance=c(this.tolerance),this.offset=c(this.offset),this.initialised=!1,this.frozen=!1}return d.prototype={constructor:d,init:function(){return d.cutsTheMustard&&!this.initialised&&(this.addClass("initial"),this.initialised=!0,setTimeout((function(e){e.scrollTracker=u(e.scroller,{offset:e.offset,tolerance:e.tolerance},e.update.bind(e))}),100,this)),this},destroy:function(){this.initialised=!1,Object.keys(this.classes).forEach(this.removeClass,this),this.scrollTracker.destroy()},unpin:function(){!this.hasClass("pinned")&&this.hasClass("unpinned")||(this.addClass("unpinned"),this.removeClass("pinned"),this.onUnpin&&this.onUnpin.call(this))},pin:function(){this.hasClass("unpinned")&&(this.addClass("pinned"),this.removeClass("unpinned"),this.onPin&&this.onPin.call(this))},freeze:function(){this.frozen=!0,this.addClass("frozen")},unfreeze:function(){this.frozen=!1,this.removeClass("frozen")},top:function(){this.hasClass("top")||(this.addClass("top"),this.removeClass("notTop"),this.onTop&&this.onTop.call(this))},notTop:function(){this.hasClass("notTop")||(this.addClass("notTop"),this.removeClass("top"),this.onNotTop&&this.onNotTop.call(this))},bottom:function(){this.hasClass("bottom")||(this.addClass("bottom"),this.removeClass("notBottom"),this.onBottom&&this.onBottom.call(this))},notBottom:function(){this.hasClass("notBottom")||(this.addClass("notBottom"),this.removeClass("bottom"),this.onNotBottom&&this.onNotBottom.call(this))},shouldUnpin:function(e){return"down"===e.direction&&!e.top&&e.toleranceExceeded},shouldPin:function(e){return"up"===e.direction&&e.toleranceExceeded||e.top},addClass:function(e){this.elem.classList.add.apply(this.elem.classList,this.classes[e].split(" "))},removeClass:function(e){this.elem.classList.remove.apply(this.elem.classList,this.classes[e].split(" "))},hasClass:function(e){return this.classes[e].split(" ").every((function(e){return this.classList.contains(e)}),this.elem)},update:function(e){e.isOutOfBounds||!0!==this.frozen&&(e.top?this.top():this.notTop(),e.bottom?this.bottom():this.notBottom(),this.shouldUnpin(e)?this.unpin():this.shouldPin(e)&&this.pin())}},d.options={tolerance:{up:0,down:0},offset:0,scroller:e()?window:null,classes:{frozen:"headroom--frozen",pinned:"headroom--pinned",unpinned:"headroom--unpinned",top:"headroom--top",notTop:"headroom--not-top",bottom:"headroom--bottom",notBottom:"headroom--not-bottom",initial:"headroom"}},d.cutsTheMustard=n(),d}()},3335:function(e){function t(e){return!!e.constructor&&"function"===typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}e.exports=function(e){return null!=e&&(t(e)||function(e){return"function"===typeof e.readFloatLE&&"function"===typeof e.slice&&t(e.slice(0,0))}(e)||!!e._isBuffer)}},594:function(e,t,n){var o=NaN,r="[object Symbol]",i=/^\s+|\s+$/g,s=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt,d="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,l="object"==typeof self&&self&&self.Object===Object&&self,h=d||l||Function("return this")(),f=Object.prototype.toString,m=Math.max,p=Math.min,v=function(){return h.Date.now()};function y(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function g(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&f.call(e)==r}(e))return o;if(y(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=y(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var n=a.test(e);return n||u.test(e)?c(e.slice(2),n?2:8):s.test(e)?o:+e}e.exports=function(e,t,n){var o,r,i,s,a,u,c=0,d=!1,l=!1,h=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function f(t){var n=o,i=r;return o=r=void 0,c=t,s=e.apply(i,n)}function b(e){var n=e-u;return void 0===u||n>=t||n<0||l&&e-c>=i}function w(){var e=v();if(b(e))return E(e);a=setTimeout(w,function(e){var n=t-(e-u);return l?p(n,i-(e-c)):n}(e))}function E(e){return a=void 0,h&&o?f(e):(o=r=void 0,s)}function _(){var e=v(),n=b(e);if(o=arguments,r=this,u=e,n){if(void 0===a)return function(e){return c=e,a=setTimeout(w,t),d?f(e):s}(u);if(l)return a=setTimeout(w,t),f(u)}return void 0===a&&(a=setTimeout(w,t)),s}return t=g(t)||0,y(n)&&(d=!!n.leading,i=(l="maxWait"in n)?m(g(n.maxWait)||0,t):i,h="trailing"in n?!!n.trailing:h),_.cancel=function(){void 0!==a&&clearTimeout(a),c=0,o=u=r=a=void 0},_.flush=function(){return void 0===a?s:E(v())},_}},8357:function(e,t,n){var o="Expected a function",r=NaN,i="[object Symbol]",s=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,c=/^0o[0-7]+$/i,d=parseInt,l="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,h="object"==typeof self&&self&&self.Object===Object&&self,f=l||h||Function("return this")(),m=Object.prototype.toString,p=Math.max,v=Math.min,y=function(){return f.Date.now()};function g(e,t,n){var r,i,s,a,u,c,d=0,l=!1,h=!1,f=!0;if("function"!=typeof e)throw new TypeError(o);function m(t){var n=r,o=i;return r=i=void 0,d=t,a=e.apply(o,n)}function g(e){var n=e-c;return void 0===c||n>=t||n<0||h&&e-d>=s}function E(){var e=y();if(g(e))return _(e);u=setTimeout(E,function(e){var n=t-(e-c);return h?v(n,s-(e-d)):n}(e))}function _(e){return u=void 0,f&&r?m(e):(r=i=void 0,a)}function N(){var e=y(),n=g(e);if(r=arguments,i=this,c=e,n){if(void 0===u)return function(e){return d=e,u=setTimeout(E,t),l?m(e):a}(c);if(h)return u=setTimeout(E,t),m(c)}return void 0===u&&(u=setTimeout(E,t)),a}return t=w(t)||0,b(n)&&(l=!!n.leading,s=(h="maxWait"in n)?p(w(n.maxWait)||0,t):s,f="trailing"in n?!!n.trailing:f),N.cancel=function(){void 0!==u&&clearTimeout(u),d=0,r=c=i=u=void 0},N.flush=function(){return void 0===u?a:_(y())},N}function b(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function w(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&m.call(e)==i}(e))return r;if(b(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=b(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(s,"");var n=u.test(e);return n||c.test(e)?d(e.slice(2),n?2:8):a.test(e)?r:+e}e.exports=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new TypeError(o);return b(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),g(e,t,{leading:r,maxWait:t,trailing:i})}},8762:function(e,t,n){!function(){var t=n(9562),o=n(5792).utf8,r=n(3335),i=n(5792).bin,s=function(e,n){e.constructor==String?e=n&&"binary"===n.encoding?i.stringToBytes(e):o.stringToBytes(e):r(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||e.constructor===Uint8Array||(e=e.toString());for(var a=t.bytesToWords(e),u=8*e.length,c=1732584193,d=-271733879,l=-1732584194,h=271733878,f=0;f>>24)|4278255360&(a[f]<<24|a[f]>>>8);a[u>>>5]|=128<>>9<<4)]=u;var m=s._ff,p=s._gg,v=s._hh,y=s._ii;for(f=0;f>>0,d=d+b>>>0,l=l+w>>>0,h=h+E>>>0}return t.endian([c,d,l,h])};s._ff=function(e,t,n,o,r,i,s){var a=e+(t&n|~t&o)+(r>>>0)+s;return(a<>>32-i)+t},s._gg=function(e,t,n,o,r,i,s){var a=e+(t&o|n&~o)+(r>>>0)+s;return(a<>>32-i)+t},s._hh=function(e,t,n,o,r,i,s){var a=e+(t^n^o)+(r>>>0)+s;return(a<>>32-i)+t},s._ii=function(e,t,n,o,r,i,s){var a=e+(n^(t|~o))+(r>>>0)+s;return(a<>>32-i)+t},s._blocksize=16,s._digestsize=16,e.exports=function(e,n){if(void 0===e||null===e)throw new Error("Illegal argument "+e);var o=t.wordsToBytes(s(e,n));return n&&n.asBytes?o:n&&n.asString?i.bytesToString(o):t.bytesToHex(o)}}()},5438:function(){var e=function(){function e(e,t){for(var n=0;n-1&&!e;)e=o[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e+"../"}(),function(){var e={8495:0};n.f.j=function(t,o){var r=n.o(e,t)?e[t]:void 0;if(0!==r)if(r)o.push(r[2]);else{var i=new Promise((function(n,o){r=e[t]=[n,o]}));o.push(r[2]=i);var s=n.p+n.u(t),a=new Error;n.l(s,(function(o){if(n.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var i=o&&("load"===o.type?"missing":o.type),s=o&&o.target&&o.target.src;a.message="Loading chunk "+t+" failed.\n("+i+": "+s+")",a.name="ChunkLoadError",a.type=i,a.request=s,r[1](a)}}),"chunk-"+t,t)}};var t=function(t,o){var r,i,s=o[0],a=o[1],u=o[2],c=0;if(s.some((function(t){return 0!==e[t]}))){for(r in a)n.o(a,r)&&(n.m[r]=a[r]);if(u)u(n)}for(t&&t(o);c({...e,[t]:window.matchMedia(n)})),{});let i="";const s=()=>{const e=["small","medium","siteNavigation","large"].reverse().find((e=>r[e].matches))||"";e!==i&&(i=e,window.dispatchEvent(new CustomEvent(o.change,{detail:i})))};var a=n(4964),u=n.n(a),c=n(8357),d=n.n(c);const l=["pin","unpin","freeze","unfreeze","destroy",["pin","freeze"],["unpin","unfreeze"]],h={};l.forEach((e=>{let t=e;Array.isArray(e)&&(t=e.join("")),h[t]=()=>document.dispatchEvent(new CustomEvent(`headroom:${t}`))}));var f=!1;if("undefined"!==typeof window){var m={get passive(){f=!0}};window.addEventListener("testPassive",null,m),window.removeEventListener("testPassive",null,m)}var p="undefined"!==typeof window&&window.navigator&&window.navigator.platform&&(/iP(ad|hone|od)/.test(window.navigator.platform)||"MacIntel"===window.navigator.platform&&window.navigator.maxTouchPoints>1),v=[],y=!1,g=-1,b=void 0,w=void 0,E=void 0,_=function(e){return v.some((function(t){return!(!t.options.allowTouchMove||!t.options.allowTouchMove(e))}))},N=function(e){var t=e||window.event;return!!_(t.target)||(t.touches.length>1||(t.preventDefault&&t.preventDefault(),!1))},T=function(){void 0!==E&&(document.body.style.paddingRight=E,E=void 0),void 0!==b&&(document.body.style.overflow=b,b=void 0)},A=function(){if(void 0!==w){var e=-parseInt(document.body.style.top,10),t=-parseInt(document.body.style.left,10);document.body.style.position=w.position,document.body.style.top=w.top,document.body.style.left=w.left,window.scrollTo(t,e),w=void 0}},L=function(e,t){if(e){if(!v.some((function(t){return t.targetElement===e}))){var n={targetElement:e,options:t||{}};v=[].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t=o&&(document.body.style.top=-(t+e))}))}),300)}})):function(e){if(void 0===E){var t=!!e&&!0===e.reserveScrollBarGap,n=window.innerWidth-document.documentElement.clientWidth;if(t&&n>0){var o=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right"),10);E=document.body.style.paddingRight,document.body.style.paddingRight=o+n+"px"}}void 0===b&&(b=document.body.style.overflow,document.body.style.overflow="hidden")}(t),p&&(e.ontouchstart=function(e){1===e.targetTouches.length&&(g=e.targetTouches[0].clientY)},e.ontouchmove=function(t){1===t.targetTouches.length&&function(e,t){var n=e.targetTouches[0].clientY-g;!_(e.target)&&(t&&0===t.scrollTop&&n>0||function(e){return!!e&&e.scrollHeight-e.scrollTop<=e.clientHeight}(t)&&n<0?N(e):e.stopPropagation())}(t,e)},y||(document.addEventListener("touchmove",N,f?{passive:!1}:void 0),y=!0))}}else console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.")},M=function(e){e?(v=v.filter((function(t){return t.targetElement!==e})),p&&(e.ontouchstart=null,e.ontouchmove=null,y&&0===v.length&&(document.removeEventListener("touchmove",N,f?{passive:!1}:void 0),y=!1)),p?A():T()):console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.")};const k="Escape",x="Tab",S=["a[href]","area[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","details","summary","iframe","object","embed","[contenteditable]"].join(","),C=(e,t)=>{const n=t[0],o=t[t.length-1],{activeElement:r}=document.body.ownerDocument;e.key===x&&(e.shiftKey?r===n&&(e.preventDefault(),o.focus()):r===o&&(e.preventDefault(),n.focus()))},O=document.querySelector(".site-overlay"),I="is-open",H=()=>{O&&O.classList.add(I)},B=()=>{O&&O.classList.remove(I)},D=e=>{O&&O.addEventListener("click",e)};n(5438);var j=n(594),q=n.n(j);const $=()=>"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0;var F=n(8762),P=n.n(F);window.addEventListener("resize",s),(e=>{const t={siteHeader:document.getElementById("site-header")};if(!t.siteHeader)return;let n;(()=>{n=new(u())(t.siteHeader,{offset:250,onPin:()=>{document.body.classList.add("has-pinned-site-header")},onUnpin:()=>{document.body.classList.remove("has-pinned-site-header")}}),n.init(),l.forEach((e=>{Array.isArray(e)?document.addEventListener(`headroom:${e.join("")}`,(()=>{e.forEach((e=>n[e]()))})):document.addEventListener(`headroom:${e}`,(()=>{n[e]()}))})),(()=>{const{plugins:t}=e;if(0!==t.length)for(let e=0;et.offsetTop&&(e=!0);e?t.classList.add("has-wrapped"):t.classList.remove("has-wrapped")}}const i=d()(r,100);window.addEventListener("DOMContentLoaded",(()=>{r(o)})),window.addEventListener("resize",(()=>{i(o)}))})()})({plugins:[()=>{const t={isOpen:"is-open",hasSearchOpen:"has-search-open"},n={open:"open",close:"close"},o={searchFormHandlerDesktop:document.getElementById("search-form-handler-desktop"),searchFormHandlerMobile:document.getElementById("search-form-handler-mobile"),searchFormWrapper:document.getElementById("search-form-wrapper"),searchFormInput:document.getElementById("search-form-input"),siteHeader:document.getElementById("site-header"),siteHeaderTop:document.getElementById("site-header-top"),siteHeaderNav:document.querySelector(".site-header__navigation")};let i;if(!o.searchFormWrapper)return;const s=e=>{const{searchFormHandlerMobile:t,searchFormHandlerDesktop:r,searchFormWrapper:i}=o,{open:s,close:a}=n;switch(e){case s:t.setAttribute("aria-expanded","true"),r.setAttribute("aria-expanded","true"),i.setAttribute("aria-hidden","false");break;case a:t.setAttribute("aria-expanded","false"),r.setAttribute("aria-expanded","false"),i.setAttribute("aria-hidden","true");break;default:throw new Error(`The state parameter can only be ${n.open} or ${n.close}.`)}},a=()=>o.searchFormWrapper.classList.contains(t.isOpen),u=e=>{const{siteHeaderTop:t,siteHeaderNav:r}=o,{open:i,close:s}=n,a=[...Array.from(t.querySelectorAll(S)),...Array.from(r.querySelectorAll(S))];switch(e){case i:a.forEach((e=>{e.classList.contains("site-header__search-button--mobile")||(e.inert=!0)}));break;case s:a.forEach((e=>{e.inert=!1}));break;default:throw new Error(`The state parameter can only be ${n.open} or ${n.close}.`)}},c=()=>{const{searchFormWrapper:a,searchFormInput:c,siteHeader:d}=o,{open:l}=n,{isOpen:h,hasSearchOpen:f}=t,m=(()=>{const{searchFormWrapper:e,searchFormHandlerDesktop:t,searchFormHandlerMobile:n}=o;return[r.medium.matches?t:n,...Array.from(e.querySelectorAll(S))]})();document.dispatchEvent(new CustomEvent(e.open)),u(l),a.classList.add(h),H(),d.classList.add(f),s(l),c.focus(),d.addEventListener("keydown",(e=>(i=t=>{C(t,e)},i))(m)),L(a)},d=()=>{const{searchFormWrapper:e,siteHeader:a}=o,{close:c}=n,{isOpen:d,hasSearchOpen:l}=t;u(c),e.classList.remove(d),B(),a.classList.remove(l),s(c),(()=>{const{searchFormHandlerMobile:e,searchFormHandlerDesktop:t}=o;r.medium.matches?t.focus():e.focus()})(),a.removeEventListener("keydown",i),M(e)},l=()=>{a()?d():c()},h=e=>{e.key===k&&a()&&d()};(()=>{const{searchFormHandlerMobile:e,searchFormHandlerDesktop:t}=o;document.addEventListener("keydown",h),t.addEventListener("click",l),e.addEventListener("click",l),D(d)})()},()=>{const e=document.getElementById("site-menu");if(!e)return;const n={isOpenClassname:"is-open",hasMenuOpenClassName:"has-menu-open",siteHeaderElementDisabledClassName:"site-header__element--disabled"},i={open:"open",close:"close"},s={siteMenu:e,siteMenuPrimary:document.querySelector(".site-header__menu--primary"),siteMenuSecondary:document.querySelector(".site-header__menu--secondary"),siteHeader:document.getElementById("site-header"),siteHeaderTop:document.getElementById("site-header-top"),openMenuBtn:document.getElementById("open-menu-btn"),closeMenuBtn:document.getElementById("close-menu-btn")};let a;const u=e=>{const{openMenuBtn:t,siteMenu:n}=s,{open:o,close:r}=i;switch(e){case o:t.setAttribute("aria-expanded","true"),n.setAttribute("aria-hidden","false");break;case r:t.setAttribute("aria-expanded","false"),n.setAttribute("aria-hidden","true");break;default:throw new Error(`The state parameter can only be ${o} or ${r}.`)}},c=()=>!!document.querySelector(".site-header__mega-menu-wrapper.is-open"),l=()=>s.siteMenu.classList.contains(n.isOpenClassname),h=e=>{const{siteHeaderTop:t}=s,{open:o,close:r}=i,{siteHeaderElementDisabledClassName:a}=n,u=Array.from(t.querySelectorAll(S));switch(e){case o:u.forEach((e=>{e.inert=!0,e.classList.add(a)}));break;case r:u.forEach((e=>{e.inert=!1,e.classList.remove(a)}));break;default:throw new Error(`The state parameter can only be ${o} or ${r}.`)}},f=()=>{const{siteMenu:e,closeMenuBtn:t,siteHeader:o,siteMenuPrimary:r,siteMenuSecondary:c}=s,{open:d}=i,{isOpenClassname:l,hasMenuOpenClassName:f}=n,m=[t,...Array.from(r.querySelectorAll(":scope > li > a")),...Array.from(c.querySelectorAll(":scope > li > a"))];e.classList.add(l),o.classList.add(f),u(d),h(d),o.addEventListener("keydown",(e=>(a=t=>{C(t,e)},a))(m)),t.focus(),L(e)},m=()=>{const{siteMenu:e,openMenuBtn:t,siteHeader:o}=s,{close:r}=i,{isOpenClassname:c,hasMenuOpenClassName:d}=n;e.classList.remove(c),o.classList.remove(d),u(r),h(r),o.removeEventListener("keydown",a),t.focus(),M(e)},p=()=>{l()?m():f()},v=e=>{e.key===k&&l()&&!c()&&m()},y=()=>{c()&&document.dispatchEvent(new CustomEvent(t.close)),m()},g=d()((()=>{document.body.style.setProperty("--site-header-height",`${s.siteHeader.offsetHeight}px`)}),100),b=e=>{const{siteMenu:t}=s;if("siteNavigation"===e.detail)return l()?void m():void t.setAttribute("aria-hidden","false");"medium"!==e.detail||l()||t.setAttribute("aria-hidden","true")};(()=>{const{siteMenu:e}=s;r.medium.matches?e.setAttribute("aria-hidden","false"):e.setAttribute("aria-hidden","true")})(),(()=>{const{openMenuBtn:e,closeMenuBtn:t}=s;document.addEventListener("keydown",v),window.addEventListener("resize",g),window.addEventListener("orientationchange",g),window.addEventListener(o.change,b),e.addEventListener("click",p),t.addEventListener("click",y)})()},()=>{const n=document.getElementById("site-menu");if(!n)return;const i=n.querySelector(".site-header__menu--primary"),s=n.querySelector(".site-header__menu--secondary");if(!i&&!s)return;if(0===[...Array.from(i.querySelectorAll(":scope > li > .site-header__mega-menu-wrapper")),...Array.from(s.querySelectorAll(":scope > li > .site-header__mega-menu-wrapper"))].length)return;let a,u;const c={open:"open",close:"close"},d={subMenuClassName:"sub-menu",megaMenuClassName:"site-header__mega-menu-wrapper",megaMenuBackButtonClassName:"site-header__mega-menu-back-button",isOpenClassName:"is-open",hasMegaMenuOpenClassName:"has-mega-menu-open",megaMenuTogglerClassName:"site-header__mega-menu-toggler",visuallyHiddenClassName:"visually-hidden",wpElementButton:"wp-element-button"},l={allFirstLevelMenuItems:[...Array.from(i?.querySelectorAll(":scope > li")),...Array.from(s?.querySelectorAll(":scope > li"))].filter((e=>void 0!==e)),megaMenus:Array.from(document.querySelectorAll(`.${d.megaMenuClassName}`)),menuLinksWithMegaMenu:[...Array.from(i.querySelectorAll(":scope > li.menu-item-has-children > a")),...Array.from(s.querySelectorAll(":scope > li.menu-item-has-children > a"))],siteHeader:document.getElementById("site-header"),closeMenuBtn:document.getElementById("close-menu-btn")},h=(e,t)=>{const n=e.parentElement.querySelector(`.${d.megaMenuClassName}`),{open:o,close:r}=c;switch(t){case o:e.setAttribute("aria-expanded","true"),n.setAttribute("aria-hidden","false");break;case r:e.setAttribute("aria-expanded","false"),n.setAttribute("aria-hidden","true");break;default:throw new Error(`The state parameter can only be ${o} or ${r}.`)}},f=e=>e.classList.contains(d.isOpenClassName),m=()=>{const{megaMenuClassName:e,isOpenClassName:t}=d;return document.querySelector(`.${e}.${t}`)},p=e=>{const{allFirstLevelMenuItems:t}=l;e?r.siteNavigation.matches||t.forEach((e=>{e.querySelector("a").inert=!0})):t.forEach((e=>{e.querySelector("a").inert=!1}))},v=e=>{const{siteHeader:t}=l,{hasMegaMenuOpenClassName:n,isOpenClassName:o,megaMenuTogglerClassName:i}=d,s=e.parentElement,u=s.querySelector(`.${i}`);s.classList.remove(n),h(u,c.close),p(!1),e.inert=!0,e.classList.remove(o),t.removeEventListener("keydown",a),B(),r.siteNavigation.matches||M(e)},y=()=>{const e=m();e&&v(e)},g=e=>{const{siteHeader:t}=l,{hasMegaMenuOpenClassName:n,isOpenClassName:o,megaMenuTogglerClassName:i}=d,s=e.parentElement,f=s.querySelector(`.${i}`);s.classList.add(n),h(f,c.open),p(!0),e.inert=!1,e.classList.add(o),H(),r.siteNavigation.matches||(u=(e=>{const t=Array.from(e.querySelectorAll(S));return[l.closeMenuBtn,...t]})(e),L(e),t.addEventListener("keydown",(e=>(a=t=>{C(t,e)},a))(u)))},b=e=>{const t=m();if(t){if(t===e)return void v(e);v(t)}g(e)},w=q()((e=>{if(r.siteNavigation.matches&&!$()){if(!r.siteNavigation.matches)return;const t=e.target.querySelector(`.${d.megaMenuClassName}`);if(f(t))return;const n=m();n&&v(n),g(t),H()}}),200),E=q()((e=>{if(r.siteNavigation.matches&&!$()){const t=e.target.querySelector(`.${d.megaMenuClassName}`);v(t),B()}}),200),_=e=>{const{target:t}=e;"transform"===e.propertyName&&f(t)&&window.requestAnimationFrame((()=>(e=>{r.siteNavigation.matches||e.querySelector(`.${d.megaMenuBackButtonClassName}`).focus()})(t)))},N=e=>{const t=m();e.key===k&&t&&v(t)},T=e=>{if("siteNavigation"===e.detail){const e=m();e&&v(e)}};(()=>{const{megaMenuBackButtonClassName:n,megaMenuClassName:i,megaMenuTogglerClassName:s}=d;l.menuLinksWithMegaMenu.forEach((e=>{const t=e.parentElement,o=t.querySelector(`.${i}`),a=t.querySelector(`.${s}`),u=o.querySelector(`.${n}`);e.addEventListener("click",(e=>t=>{r.siteNavigation.matches&&!$()||(t.preventDefault(),b(e))})(o)),t.addEventListener("mouseleave",(e=>{w.cancel(),E(e)})),t.addEventListener("mouseenter",(e=>{E.cancel(),w(e)})),a.addEventListener("click",(()=>b(o))),u.addEventListener("click",(()=>v(o))),o.addEventListener("transitionend",_)})),D(y),document.addEventListener("keydown",N),document.addEventListener(e.open,y),document.addEventListener(t.close,y),window.addEventListener(o.change,T)})()},()=>{const e=()=>{if(window.tenupDataLayer.gclid)return window.tenupDataLayer.gclid;if(window.tenupDataLayer.fbclid)return window.tenupDataLayer.fbclid;if(window.tenupDataLayer.msclkid)return window.tenupDataLayer.msclkid;const e=new URL(window.location.href);return e.searchParams.has("gclid")?P()(e.searchParams.get("gclid")):e.searchParams.has("fbclid")?P()(e.searchParams.get("fbclid")):e.searchParams.has("msclkid")?P()(e.searchParams.get("msclkid")):""},t=()=>{const t=window.location.hostname;Array.from(document.querySelectorAll("#main a")).filter((e=>e.hostname!==t)).forEach((t=>{let n=null;if(["utm_source","utm_medium","utm_campaign","gclid","fbclid","msclkid"].forEach((e=>{const n=window.tenupDataLayer[e];n&&t.setAttribute(`data-${e}`,n)})),(-1!==t.href.search("/dp/")||-1!==t.href.search("/gp/"))&&(-1!==t.href.search("amazon")||-1!==t.href.search("amzn"))){n="amazon";const o=(t=>{const n=new URL(t.href),o=n.searchParams.get("ascsubtag")??"",r={ch:e(),utm_campaign:window.tenupDataLayer.utm_campaign,utm_medium:window.tenupDataLayer.utm_medium,utm_source:window.tenupDataLayer.utm_source};Object.keys(r).forEach((e=>{r[e]||delete r[e]}));let i="";return Object.keys(r).forEach((e=>{i+=`[${e}|${r[e]}`})),n.searchParams.set("ascsubtag",`${o}${i}`),t.setAttribute("href",n),t.href})(t);t.setAttribute("href",o)}if(!n){n="skimlinks";const e=(e=>{const t=new URL(e.href),n={utm_campaign:window.tenupDataLayer.utm_campaign,utm_medium:window.tenupDataLayer.utm_medium,utm_source:window.tenupDataLayer.utm_source,gclid:window.tenupDataLayer.gclid,fbclid:window.tenupDataLayer.fbclid,msclkid:window.tenupDataLayer.msclkid},o=t.searchParams.get("xcust")??"";Object.keys(n).forEach((e=>{n[e]||delete n[e]}));let r="";return Object.keys(n).forEach((e=>{r+=`[${e}|${n[e]}`})),""!==r.trim()&&t.searchParams.set("xcust",`${o}${r}`),e.setAttribute("href",t),e.href})(t);t.setAttribute("href",e)}}))};document.addEventListener("DOMContentLoaded",(()=>{t()}))}]});const R=document.querySelector(".gearpatrol-ad--top");R&&n.e(3091).then(n.bind(n,3300)).then((({setupTopAd:e})=>{e(R)}))}()}();; !function(){"use strict";const t=document.querySelectorAll(".is-entire-card-clickable .wp-block-post, .is-entire-card-clickable.wp-block-post, :where(:not(.wp-block-post)) .wp-block-gearpatrol-card");Array.from(t).filter((t=>!t.parentElement.classList.contains("wp-block-post")&&!t.parentElement.classList.contains("wp-block-gearpatrol-product"))).forEach((function(t){const e=t.querySelector(".wp-block-post-title a")||t.querySelector("h1 a, h2 a, h3 a, h4 a, h5 a, h6 a")||t.querySelector("a");if(!e)return;function o(){return{timestamp:+new Date,verticalScrollPosition:window.scrollY,horizontalScrollPosition:t.scrollLeft}}let r,s;t.style.cursor="pointer";const n=()=>{s=o()},i=t=>{r=o();const n=t.target.closest("button"),i=t.target.closest("a");if(n||i)return;if(r.timestamp-s.timestamp>200)return;if(Math.abs(r.verticalScrollPosition-s.verticalScrollPosition)>5)return;if(Math.abs(r.horizontalScrollPosition-s.horizontalScrollPosition)>5)return;const c=new MouseEvent("click",t);e.dispatchEvent(c)};t.addEventListener("mousedown",n,{passive:!0}),t.addEventListener("touchstart",n,{passive:!0}),t.addEventListener("mouseup",i,{passive:!0}),t.addEventListener("touchend",i,{passive:!0})}))}();;