{"version":3,"names":[],"mappings":"","sources":["ui-components.js"],"sourcesContent":["(()=>{var hi=Object.create;var qt=Object.defineProperty,pi=Object.defineProperties,we=Object.getOwnPropertyDescriptor,mi=Object.getOwnPropertyDescriptors,fi=Object.getOwnPropertyNames,be=Object.getOwnPropertySymbols,gi=Object.getPrototypeOf,ke=Object.prototype.hasOwnProperty,vi=Object.prototype.propertyIsEnumerable;var _e=(r,t,e)=>t in r?qt(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,N=(r,t)=>{for(var e in t||(t={}))ke.call(t,e)&&_e(r,e,t[e]);if(be)for(var e of be(t))vi.call(t,e)&&_e(r,e,t[e]);return r},U=(r,t)=>pi(r,mi(t));var yi=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports);var bi=(r,t,e,i)=>{if(t&&typeof t==\"object\"||typeof t==\"function\")for(let s of fi(t))!ke.call(r,s)&&s!==e&&qt(r,s,{get:()=>t[s],enumerable:!(i=we(t,s))||i.enumerable});return r};var Te=(r,t,e)=>(e=r!=null?hi(gi(r)):{},bi(t||!r||!r.__esModule?qt(e,\"default\",{value:r,enumerable:!0}):e,r));var l=(r,t,e,i)=>{for(var s=i>1?void 0:i?we(t,e):t,a=r.length-1,n;a>=0;a--)(n=r[a])&&(s=(i?n(t,e,s):n(s))||s);return i&&s&&qt(t,e,s),s};var H=(r,t,e)=>new Promise((i,s)=>{var a=c=>{try{o(e.next(c))}catch(d){s(d)}},n=c=>{try{o(e.throw(c))}catch(d){s(d)}},o=c=>c.done?i(c.value):Promise.resolve(c.value).then(a,n);o((e=e.apply(r,t)).next())});var ue=yi((le,de)=>{(function(r){\"use strict\";var t=function(){},e=r.requestAnimationFrame||r.webkitRequestAnimationFrame||r.mozRequestAnimationFrame||r.msRequestAnimationFrame||function(d){return setTimeout(d,16)};function i(){var d=this;d.reads=[],d.writes=[],d.raf=e.bind(r),t(\"initialized\",d)}i.prototype={constructor:i,runTasks:function(d){t(\"run tasks\");for(var m;m=d.shift();)m()},measure:function(d,m){t(\"measure\");var f=m?d.bind(m):d;return this.reads.push(f),s(this),f},mutate:function(d,m){t(\"mutate\");var f=m?d.bind(m):d;return this.writes.push(f),s(this),f},clear:function(d){return t(\"clear\",d),n(this.reads,d)||n(this.writes,d)},extend:function(d){if(t(\"extend\",d),typeof d!=\"object\")throw new Error(\"expected object\");var m=Object.create(this);return o(m,d),m.fastdom=this,m.initialize&&m.initialize(),m},catch:null};function s(d){d.scheduled||(d.scheduled=!0,d.raf(a.bind(null,d)),t(\"flush scheduled\"))}function a(d){t(\"flush\");var m=d.writes,f=d.reads,x;try{t(\"flushing reads\",f.length),d.runTasks(f),t(\"flushing writes\",m.length),d.runTasks(m)}catch(B){x=B}if(d.scheduled=!1,(f.length||m.length)&&s(d),x)if(t(\"task errored\",x.message),d.catch)d.catch(x);else throw x}function n(d,m){var f=d.indexOf(m);return!!~f&&!!d.splice(f,1)}function o(d,m){for(var f in m)m.hasOwnProperty(f)&&(d[f]=m[f])}var c=r.fastdom=r.fastdom||new i;typeof define==\"function\"?define(function(){return c}):typeof de==\"object\"&&(de.exports=c)})(typeof window!=\"undefined\"?window:typeof le!=\"undefined\"?le:globalThis)});var Mt=globalThis,Ut=Mt.ShadowRoot&&(Mt.ShadyCSS===void 0||Mt.ShadyCSS.nativeShadow)&&\"adoptedStyleSheets\"in Document.prototype&&\"replace\"in CSSStyleSheet.prototype,Se=Symbol(),$e=new WeakMap,Nt=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==Se)throw Error(\"CSSResult is not constructable. Use `unsafeCSS` or `css` instead.\");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(Ut&&t===void 0){let i=e!==void 0&&e.length===1;i&&(t=$e.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&$e.set(e,t))}return t}toString(){return this.cssText}},Ae=r=>new Nt(typeof r==\"string\"?r:r+\"\",void 0,Se);var ie=(r,t)=>{if(Ut)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let i=document.createElement(\"style\"),s=Mt.litNonce;s!==void 0&&i.setAttribute(\"nonce\",s),i.textContent=e.cssText,r.appendChild(i)}},Rt=Ut?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e=\"\";for(let i of t.cssRules)e+=i.cssText;return Ae(e)})(r):r;var{is:_i,defineProperty:wi,getOwnPropertyDescriptor:ki,getOwnPropertyNames:Ti,getOwnPropertySymbols:$i,getPrototypeOf:Si}=Object,K=globalThis,Ee=K.trustedTypes,Ai=Ee?Ee.emptyScript:\"\",se=K.reactiveElementPolyfillSupport,vt=(r,t)=>r,yt={toAttribute(r,t){switch(t){case Boolean:r=r?Ai:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch(i){e=null}}return e}},ut=(r,t)=>!_i(r,t),xe={attribute:!0,type:String,converter:yt,reflect:!1,hasChanged:ut},Le,Ie;(Le=Symbol.metadata)!=null||(Symbol.metadata=Symbol(\"metadata\")),(Ie=K.litPropertyMetadata)!=null||(K.litPropertyMetadata=new WeakMap);var z=class extends HTMLElement{static addInitializer(t){var e;this._$Ei(),((e=this.l)!=null?e:this.l=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=xe){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){let i=Symbol(),s=this.getPropertyDescriptor(t,i,e);s!==void 0&&wi(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){var n;let{get:s,set:a}=(n=ki(this.prototype,t))!=null?n:{get(){return this[e]},set(o){this[e]=o}};return{get(){return s==null?void 0:s.call(this)},set(o){let c=s==null?void 0:s.call(this);a.call(this,o),this.requestUpdate(t,c,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){var e;return(e=this.elementProperties.get(t))!=null?e:xe}static _$Ei(){if(this.hasOwnProperty(vt(\"elementProperties\")))return;let t=Si(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(vt(\"finalized\")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(vt(\"properties\"))){let e=this.properties,i=[...Ti(e),...$i(e)];for(let s of i)this.createProperty(s,e[s])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[i,s]of e)this.elementProperties.set(i,s)}this._$Eh=new Map;for(let[e,i]of this.elementProperties){let s=this._$Eu(e,i);s!==void 0&&this._$Eh.set(s,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let i=new Set(t.flat(1/0).reverse());for(let s of i)e.unshift(Rt(s))}else t!==void 0&&e.push(Rt(t));return e}static _$Eu(t,e){let i=e.attribute;return i===!1?void 0:typeof i==\"string\"?i:typeof t==\"string\"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e,i;((e=this._$EO)!=null?e:this._$EO=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&((i=t.hostConnected)==null||i.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){var e;let t=(e=this.shadowRoot)!=null?e:this.attachShadow(this.constructor.shadowRootOptions);return ie(t,this.constructor.elementStyles),t}connectedCallback(){var t,e;(t=this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(i=>{var s;return(s=i.hostConnected)==null?void 0:s.call(i)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var i;return(i=e.hostDisconnected)==null?void 0:i.call(e)})}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EC(t,e){var a;let i=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,i);if(s!==void 0&&i.reflect===!0){let n=(((a=i.converter)==null?void 0:a.toAttribute)!==void 0?i.converter:yt).toAttribute(e,i.type);this._$Em=t,n==null?this.removeAttribute(s):this.setAttribute(s,n),this._$Em=null}}_$AK(t,e){var a;let i=this.constructor,s=i._$Eh.get(t);if(s!==void 0&&this._$Em!==s){let n=i.getPropertyOptions(s),o=typeof n.converter==\"function\"?{fromAttribute:n.converter}:((a=n.converter)==null?void 0:a.fromAttribute)!==void 0?n.converter:yt;this._$Em=s,this[s]=o.fromAttribute(e,n.type),this._$Em=null}}requestUpdate(t,e,i){var s;if(t!==void 0){if(i!=null||(i=this.constructor.getPropertyOptions(t)),!((s=i.hasChanged)!=null?s:ut)(this[t],e))return;this.P(t,e,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,i){var s;this._$AL.has(t)||this._$AL.set(t,e),i.reflect===!0&&this._$Em!==t&&((s=this._$Ej)!=null?s:this._$Ej=new Set).add(t)}_$ET(){return H(this,null,function*(){this.isUpdatePending=!0;try{yield this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&(yield t),!this.isUpdatePending})}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i,s;if(!this.isUpdatePending)return;if(!this.hasUpdated){if((i=this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this._$Ep){for(let[n,o]of this._$Ep)this[n]=o;this._$Ep=void 0}let a=this.constructor.elementProperties;if(a.size>0)for(let[n,o]of a)o.wrapped!==!0||this._$AL.has(n)||this[n]===void 0||this.P(n,this[n],o)}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(s=this._$EO)==null||s.forEach(a=>{var n;return(n=a.hostUpdate)==null?void 0:n.call(a)}),this.update(e)):this._$EU()}catch(a){throw t=!1,this._$EU(),a}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(i=>{var s;return(s=i.hostUpdated)==null?void 0:s.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EC(e,this[e]))),this._$EU()}updated(t){}firstUpdated(t){}},Ce;z.elementStyles=[],z.shadowRootOptions={mode:\"open\"},z[vt(\"elementProperties\")]=new Map,z[vt(\"finalized\")]=new Map,se==null||se({ReactiveElement:z}),((Ce=K.reactiveElementVersions)!=null?Ce:K.reactiveElementVersions=[]).push(\"2.0.4\");var _t=globalThis,Bt=_t.trustedTypes,Oe=Bt?Bt.createPolicy(\"lit-html\",{createHTML:r=>r}):void 0,ne=\"$lit$\",V=`lit$${(Math.random()+\"\").slice(9)}$`,oe=\"?\"+V,Ei=`<${oe}>`,it=document,wt=()=>it.createComment(\"\"),kt=r=>r===null||typeof r!=\"object\"&&typeof r!=\"function\",Ne=Array.isArray,Ue=r=>Ne(r)||typeof(r==null?void 0:r[Symbol.iterator])==\"function\",re=`[ \t\n\\f\\r]`,bt=/<(?:(!--|\\/[^a-zA-Z])|(\\/?[a-zA-Z][^>\\s]*)|(\\/?$))/g,Pe=/-->/g,De=/>/g,tt=RegExp(`>|${re}(?:([^\\\\s\"'>=/]+)(${re}*=${re}*(?:[^ \t\n\\f\\r\"'\\`<>=]|(\"|')|))|$)`,\"g\"),je=/'/g,He=/\"/g,Re=/^(?:script|style|textarea|title)$/i,Be=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),u=Be(1),Rs=Be(2),S=Symbol.for(\"lit-noChange\"),p=Symbol.for(\"lit-nothing\"),qe=new WeakMap,et=it.createTreeWalker(it,129);function Fe(r,t){if(!Array.isArray(r)||!r.hasOwnProperty(\"raw\"))throw Error(\"invalid template strings array\");return Oe!==void 0?Oe.createHTML(t):t}var ze=(r,t)=>{let e=r.length-1,i=[],s,a=t===2?\"\":\"\",n=bt;for(let o=0;o\"?(n=s!=null?s:bt,f=-1):m[1]===void 0?f=-2:(f=n.lastIndex-m[2].length,d=m[1],n=m[3]===void 0?tt:m[3]==='\"'?He:je):n===He||n===je?n=tt:n===Pe||n===De?n=bt:(n=tt,s=void 0);let B=n===tt&&r[o+1].startsWith(\"/>\")?\" \":\"\";a+=n===bt?c+Ei:f>=0?(i.push(d),c.slice(0,f)+ne+c.slice(f)+V+B):c+V+(f===-2?o:B)}return[Fe(r,a+(r[e]||\"\")+(t===2?\"\":\"\")),i]},Tt=class r{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let a=0,n=0,o=t.length-1,c=this.parts,[d,m]=ze(t,e);if(this.el=r.createElement(d,i),et.currentNode=this.el.content,e===2){let f=this.el.content.firstChild;f.replaceWith(...f.childNodes)}for(;(s=et.nextNode())!==null&&c.length0){s.textContent=Bt?Bt.emptyScript:\"\";for(let B=0;B2||i[0]!==\"\"||i[1]!==\"\"?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=p}_$AI(t,e=this,i,s){let a=this.strings,n=!1;if(a===void 0)t=st(this,t,e,0),n=!kt(t)||t!==this._$AH&&t!==S,n&&(this._$AH=t);else{let o=t,c,d;for(t=a[0],c=0;c{var a,n;let i=(a=e==null?void 0:e.renderBefore)!=null?a:t,s=i._$litPart$;if(s===void 0){let o=(n=e==null?void 0:e.renderBefore)!=null?n:null;i._$litPart$=s=new ht(t.insertBefore(wt(),o),o,void 0,e!=null?e:{})}return s._$AI(r),s};var Q=class extends z{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,i;let t=super.createRenderRoot();return(i=(e=this.renderOptions).renderBefore)!=null||(e.renderBefore=t.firstChild),t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=We(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return S}},Ke;Q._$litElement$=!0,Q.finalized=!0,(Ke=globalThis.litElementHydrateSupport)==null||Ke.call(globalThis,{LitElement:Q});var ce=globalThis.litElementPolyfillSupport;ce==null||ce({LitElement:Q});var Qe;((Qe=globalThis.litElementVersions)!=null?Qe:globalThis.litElementVersions=[]).push(\"4.0.4\");var b=r=>(t,e)=>{e!==void 0?e.addInitializer(()=>{customElements.define(r,t)}):customElements.define(r,t)};var xi={attribute:!0,type:String,converter:yt,reflect:!1,hasChanged:ut},Li=(r=xi,t,e)=>{let{kind:i,metadata:s}=e,a=globalThis.litPropertyMetadata.get(s);if(a===void 0&&globalThis.litPropertyMetadata.set(s,a=new Map),a.set(e.name,r),i===\"accessor\"){let{name:n}=e;return{set(o){let c=t.get.call(this);t.set.call(this,o),this.requestUpdate(n,c,r)},init(o){return o!==void 0&&this.P(n,void 0,r),o}}}if(i===\"setter\"){let{name:n}=e;return function(o){let c=this[n];t.call(this,o),this.requestUpdate(n,c,r)}}throw Error(\"Unsupported decorator location: \"+i)};function h(r){return(t,e)=>typeof e==\"object\"?Li(r,t,e):((i,s,a)=>{let n=s.hasOwnProperty(a);return s.constructor.createProperty(a,n?U(N({},i),{wrapped:!0}):i),n?Object.getOwnPropertyDescriptor(s,a):void 0})(r,t,e)}function D(r){return h(U(N({},r),{state:!0,attribute:!1}))}var C={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},W=r=>(...t)=>({_$litDirective$:r,values:t}),R=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};var $t=class extends R{constructor(t){if(super(t),this.it=p,t.type!==C.CHILD)throw Error(this.constructor.directiveName+\"() can only be used in child bindings\")}render(t){if(t===p||t==null)return this._t=void 0,this.it=t;if(t===S)return t;if(typeof t!=\"string\")throw Error(this.constructor.directiveName+\"() called with a non-string value\");if(t===this.it)return this._t;this.it=t;let e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}};$t.directiveName=\"unsafeHTML\",$t.resultType=1;var _=W($t);var y=class extends Q{connectedCallback(){this.slotMap=Array.from(this.querySelectorAll(\"[slot]\")).reduce((t,e)=>U(N({},t),{[e.getAttribute(\"slot\")]:e}),{}),super.connectedCallback()}getSlot(t){return this.slotMap&&this.slotMap[t]}createRenderRoot(){return this}};var O=class{static excludeByClass(t,e){let i=[];for(let s=0;s{typeof appInsights!=\"undefined\"&&appInsights.trackException(t)})}static trackEvent(t,e){g.deferTask(()=>{typeof appInsights!=\"undefined\"&&appInsights.trackEvent(t,e)})}};window.Logger=F;var Yt=Te(ue());var g=class r{constructor(){this.detectTouch(),this.detectKeyboard()}detectTouch(){window.addEventListener(\"touchstart\",t=>{document.getElementsByTagName(\"html\")[0].classList.add(\"user-has-touched\")})}static isTouch(){return document.documentElement.classList.contains(\"touch\")}detectKeyboard(){let t=document.getElementsByTagName(\"html\")[0],e=\"using-keyboard\";document.addEventListener(\"keydown\",()=>{Yt.default.mutate(()=>{t.classList.add(e)})}),document.addEventListener(\"mousedown\",()=>{Yt.default.mutate(()=>{t.classList.remove(e)})}),document.addEventListener(\"touchstart\",()=>{Yt.default.mutate(()=>{t.classList.remove(e)})})}static isUsingKeyboard(){return document.getElementsByTagName(\"html\")[0].classList.contains(\"using-keyboard\")}static hasUserTouched(){return document.getElementsByTagName(\"html\")[0].classList.contains(\"user-has-touched\")}static createEventForDispatch(t){let e;return typeof Event==\"function\"?e=new Event(t):(e=document.createEvent(\"Event\"),e.initEvent(t,!0,!0)),e}static createCustomEventForDispatch(t,e={}){let i;return window.CustomEvent&&typeof window.CustomEvent==\"function\"?i=new CustomEvent(t,{detail:e}):(i=document.createEvent(\"CustomEvent\"),i.initCustomEvent(t,!0,!0,e)),i}static getOffset(t){var e=t.getBoundingClientRect(),i=window.pageXOffset||document.documentElement.scrollLeft,s=window.pageYOffset||document.documentElement.scrollTop;return{top:e.top+s,left:e.left+i}}static debounce(t,e){let i=null;e=e||300;let s=function(){let a=this,n=arguments;clearTimeout(i),i=setTimeout(function(){t.apply(a,n)},e)};return s.cancel=function(){clearTimeout(i)},s}static getKeypressed(t){let e=t.key;if(e!==void 0)return e;let i=t.keyCode;if(i!==void 0)return i}static hash(t){let e=0;if(t.length)for(let i=0;i{n+=a;let c=r.easeInOutQuad(n,i,s,e);window.scrollTo(0,c),ne(),s.onerror=()=>i(),s.src=t,s.style.opacity=\"0.0001\",s.style.position=\"fixed\",s.style.pointerEvents=\"none\",s.style.top=\"0px\",s.style.left=navigator.userAgent.toLowerCase().indexOf(\"firefox\")>-1?\"0px\":\"calc(100% - 1px)\",s.style.zIndex=\"100\",document.body.appendChild(s);var a='';document.getElementsByTagName(\"head\")[0].insertAdjacentHTML(\"beforeend\",a)}})}static empty(t){for(;t.firstChild;)t.removeChild(t.firstChild)}static fadeOut(t,e){t.style.opacity=1,function i(){(t.style.opacity-=.1)<0?(t.style.display=\"none\",e()):requestAnimationFrame(i)}()}static fadeIn(t,e=\"block\",i){t.style.opacity=0,t.style.display=e||\"block\",function s(){var a=parseFloat(t.style.opacity);(a+=.1)>1?i():(t.style.opacity=a,requestAnimationFrame(s))}()}static pagination(t,e,i){let s=Math.ceil(t/e);return{currentPage:Math.ceil(i/e+1),totalPages:s}}static truncateText(t,e,i=\"...\"){let s=t.trim();if(t.length>s.length){let a=t.substr(0,e);a=a.substr(0,Math.min(a.length,a.lastIndexOf(\" \"))),s=a+i}return s}static isHidden(t){return t?t.offsetParent===null:!0}static getBrowser(){var t=navigator.userAgent,e,i=t.match(/(opera|chrome|safari|firefox|msie|trident(?=\\/))\\/?\\s*(\\d+)/i)||[];return/trident/i.test(i[1])?(e=/\\brv[ :]+(\\d+)/g.exec(t)||[],{name:\"IE\",version:e[1]||\"\"}):i[1]===\"Chrome\"&&(e=t.match(/\\bOPR|Edge\\/(\\d+)/),e!=null)?{name:\"Opera\",version:e[1]}:(i=i[2]?[i[1],i[2]]:[navigator.appName,navigator.appVersion,\"-?\"],(e=t.match(/version\\/(\\d+)/i))!=null&&i.splice(1,1,e[1]),{name:i[0],version:i[1]})}static isIOS(){return/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream}static isWholeElementInViewport(t){let e=t.offsetTop,i=t.offsetLeft,s=t.offsetWidth,a=t.offsetHeight;for(;t.offsetParent;)t=t.offsetParent,e+=t.offsetTop,i+=t.offsetLeft;return e>=window.pageYOffset&&i>=window.pageXOffset&&e+a<=window.pageYOffset+window.innerHeight&&i+s<=window.pageXOffset+window.innerWidth}static clamp(t,e,i){return t>i?i:t/g,\">\").replace(/\"/g,\""\").replace(/'/g,\"'\")}static getPageTemplate(){let t=document.body.getAttribute(\"data-page-template\");return t||null}static fetchWithTimeout(s){return H(this,arguments,function*(t,e={},i=5e3){let a=new AbortController,{signal:n}=a,o=fetch(t,U(N({},e),{signal:n})),c=setTimeout(()=>a.abort(),i);try{let d=yield o;return clearTimeout(c),d}catch(d){throw clearTimeout(c),d}})}static objectsAreTheSame(t,e){try{return JSON.stringify(t)===JSON.stringify(e)}catch(i){return F.trackException(i),!1}}static deferTask(t,e=250){requestIdleCallback(()=>{t()},{timeout:e})}static getElementIndex(t){return!t||!t.parentNode?-1:Array.prototype.slice.call(t.parentNode.children).indexOf(t)}static roundToTwoDecimals(t){return Math.round((t+Number.EPSILON)*100)/100}static searchDataLayer(t){for(let e=0;e{g.hasUserTouched()||this.handleVariantInteraction(s,!1)}),i.addEventListener(\"focus\",s=>{this.handleVariantInteraction(s,!1)}),i.addEventListener(\"click\",s=>(this.handleVariantInteraction(s,!0),!1)),i.classList.add(this.doneClass)}}handleVariantInteraction(t,e){let i=t.target,s=i.getAttribute(\"data-image\"),a=i.closest(\".js-product\"),n=a.querySelectorAll(\".js-product-variant\"),o=a.querySelector(\".js-product-variant-image\");e&&i.classList.contains(this.activeClass)&&(window.location.href=i.getAttribute(\"href\")),this.updateVariants(n),i.classList.add(this.activeClass),this.updateImage(s,o,a),t.preventDefault(),t.stopPropagation()}updateVariants(t){for(let e=0;e\n\t\t\t\n\t\t\t\"\"\n\t\t`}};var Xt=\"2.17.2\";function q(r){return r.reduce(function(s,e){var i=s.events,s=s.additionalParams;return\"index\"in e?{additionalParams:s,events:i.concat([e])}:{events:i,additionalParams:e}},{events:[],additionalParams:void 0})}var Ii=function(){try{return!!navigator.cookieEnabled}catch(r){return!1}},Ci=function(){try{return!!navigator.sendBeacon}catch(r){return!1}},Oi=function(){try{return!!XMLHttpRequest}catch(r){return!1}},Pi=function(){try{return fetch!==void 0}catch(r){return!1}},pt=function(){};function Di(){try{var r=\"__test_localStorage__\";return globalThis.localStorage.setItem(r,r),globalThis.localStorage.removeItem(r),globalThis.localStorage}catch(t){}}pt.get=function(r){var t=(t=this.store)==null?void 0:t.getItem(r);if(!t)return null;try{return JSON.parse(t)}catch(e){return null}},pt.set=function(r,t){var e;try{(e=this.store)!=null&&e.setItem(r,JSON.stringify(t))}catch(i){console.error(\"Unable to set \"+r+\" in localStorage, storage may be full.\")}},pt.remove=function(r){var t;(t=this.store)!=null&&t.removeItem(r)},pt.store=Di();var Ze=\"AlgoliaObjectQueryCache\",ji=5e3,Hi=1e3;function pe(){var r;return(r=pt.get(Ze))!=null?r:{}}function Ge(r){pt.set(Ze,qi(r))}function qi(r){return Object.keys(r).length>ji?Mi(r):r}function Mi(r){return r=Object.entries(r).sort(function(t,e){return t=t[1][1],e[1][1]-t}),r.slice(0,r.length-Hi-1).reduce(function(t,s){var i=s[0],s=s[1];return Object.assign(Object.assign({},t),((t={})[i]=s,t))},{})}function me(r,t){return r+\"_\"+t}function fe(r,t,e){var i=pe();i[me(r,t)]=[e,Date.now()],Ge(i)}function Ni(r,t){return pe()[me(r,t)]}function Ui(r,t){var e=pe();t.forEach(function(i){delete e[me(r,i)]}),Ge(e)}var At=function(r){return r===void 0},Ri=function(r){return typeof r==\"number\"},Y=function(r){return typeof r==\"function\"},Bi=function(r){return typeof(r==null?void 0:r.then)==\"function\"};function Fi(r){return function(t){for(var e=[],i=arguments.length-1;0-1?(A(\"addedToCartObjectIDsAfterSearch\",{eventName:algoliaSettings.source?`${algoliaSettings.source}: Add To Cart From Search`:\"Add To Cart From Search\",index:v.indexName,queryID:v.queryID(),objectIDs:t,objectData:e,value:i,currency:v.currency}),v.trackConvertedFiltersIfAvailable()):A(\"addedToCartObjectIDs\",{eventName:algoliaSettings.source?`${algoliaSettings.source}: Add To Cart`:\"Add To Cart\",index:v.indexName,objectIDs:t,objectData:e,value:i,currency:v.currency})}static trackConvertedFiltersIfAvailable(){let t=\"appliedFilters\";if(sessionStorage.getItem(t))try{let e=JSON.parse(sessionStorage.getItem(t));v.convertedFilters(\"Converted Filters\",e),sessionStorage.removeItem(t)}catch(e){}}static convertedObjectIDs(t,e){v.queryID()?A(\"convertedObjectIDsAfterSearch\",{eventName:t,index:v.indexName,queryID:v.queryID(),objectIDs:e}):A(\"convertedObjectIDs\",{eventName:t,index:v.indexName,objectIDs:e})}static purchasedObjectIDs(t){t.anyItemPurchasedAfterSearch?A(\"purchasedObjectIDsAfterSearch\",{eventName:\"Purchase After Search\",index:v.indexName,objectIDs:t.objectIDs,objectData:t.objectData,value:t.value,currency:t.currency}):A(\"purchasedObjectIDs\",{eventName:\"Purchase\",index:v.indexName,objectIDs:t.objectIDs,objectData:t.objectData,value:t.value,currency:t.currency})}static queryID(){return at(\"queryID\")}static objectID(){return at(\"objectID\")}static addAlgoliaQueryToURL(t,e,i){let s=v.queryID();if(!s)return t;try{let a=new URL(t,window.location.origin);return a.searchParams.set(\"queryID\",s),a.searchParams.set(\"objectID\",e),i&&a.searchParams.set(\"source\",i),a.toString()}catch(a){return t}}static updateAlgoliaFromSearchResponse(t){t&&(t!=null&&t.QueryID&&(algoliaSettings.queryID=t.QueryID),t.AbTestID&&(algoliaSettings.AbTestID=t.AbTestID,dataLayer.push({algoliaAbTestID:t.AbTestID})),t.AbTestVariantID&&(algoliaSettings.AbTestVariantID=t.AbTestVariantID,dataLayer.push({algoliaAbTestVariantID:t.AbTestVariantID})))}static isSearchPage(){return window.location.pathname.toLowerCase().indexOf(\"/search\")>-1}static cleanEventName(t){return encodeURI(t).replace(/%20/g,\" \").trim()}};v.indexName=at(\"indexName\"),v.currency=\"GBP\";var j=v;at(\"orderData\")&&(j.purchasedObjectIDs(algoliaSettings.orderData),algoliaSettings.orderData=null);document.querySelector(\"[data-algolia-product-view]\")&&!at(\"hasTrackedProductPageView\")&&(j.viewedObjectIDs([document.querySelector(\"[data-algolia-product-view]\").getAttribute(\"data-algolia-product-view\")],\"PDP: Product Viewed\"),algoliaSettings.hasTrackedProductPageView=!0);var w=class extends y{constructor(){super(...arguments);this.test=\"product-block\";this.testProductDeliveryEstimate=\"product-delivery-estimate\"}connectedCallback(){super.connectedCallback(),this.querySelector(\".c-load-content-placeholder__item\")&&this.querySelector(\".c-load-content-placeholder__item\").remove()}firstUpdated(){let e=O.excludeByClass(this.querySelectorAll(\".js-product-variant\"),\"js-product-variant-done\");e.length&&new St(e)}render(){var i;let e=(this.product.Previews&&this.product.Previews.length||this.product.ShowVariantOptionsText)&&!this.hideVariants;return!this.product.HasVariants&&this.hideSiblings&&(e=!1),u` \n\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\"${this.product.ImageAlt}\"\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t${this.product.HasHoverImage?u`\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\"\"\n\t\t\t\t\t\t\t\t\t`:null}\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t${e?u`
\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t
`:null}\n\t\t\t\t\t\t
\n\n\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t

\n\t\t\t\t\t\t\t\t${this.product.DisplayName}\n\t\t\t\t\t\t\t

\n\n\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\t${this.getSlot(\"wishlist-button\")?this.getSlot(\"wishlist-button\"):u``}\n\n\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t`}};l([h({type:String})],w.prototype,\"type\",2),l([h({type:Boolean})],w.prototype,\"standalone\",2),l([h({type:String})],w.prototype,\"info\",2),l([h({type:Boolean})],w.prototype,\"showAddButton\",2),l([h({type:String})],w.prototype,\"addButtonLoggerSource\",2),l([h({type:Boolean})],w.prototype,\"hideVariants\",2),l([h({type:Boolean})],w.prototype,\"hideSiblings\",2),l([h({converter:{fromAttribute:(e,i)=>e===\"true\",toAttribute:(e,i)=>e+\"\"}})],w.prototype,\"isLoading\",2),l([h({type:Boolean})],w.prototype,\"showAddButtonOnBasket\",2),l([h({type:String})],w.prototype,\"addButtonOnBasketTest\",2),l([h({type:Function})],w.prototype,\"addButtonOnBasketClick\",2),l([h({type:Function})],w.prototype,\"productLinkOnClick\",2),l([h({type:String})],w.prototype,\"test\",2),l([h({type:String})],w.prototype,\"testProductDisplayName\",2),l([h({type:String})],w.prototype,\"testProductDeliveryEstimate\",2),l([h({converter:{fromAttribute:e=>{let i=e;try{i=JSON.parse(e),i.Url=j.addAlgoliaQueryToURL(i.Url,i.Guid,\"Search Results\")}catch(s){i=e,console.error(`Could not JSON.parse value ${e}`)}return i},toAttribute:e=>{try{return JSON.stringify(e)}catch(i){return console.error(`Could not JSON.stringify value ${e}`),\"\"}}}})],w.prototype,\"product\",2),w=l([b(\"product-card\")],w);var L=W(class extends R{constructor(r){var t;if(super(r),r.type!==C.ATTRIBUTE||r.name!==\"class\"||((t=r.strings)==null?void 0:t.length)>2)throw Error(\"`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.\")}render(r){return\" \"+Object.keys(r).filter(t=>r[t]).join(\" \")+\" \"}update(r,[t]){var i,s;if(this.st===void 0){this.st=new Set,r.strings!==void 0&&(this.nt=new Set(r.strings.join(\" \").split(/\\s/).filter(a=>a!==\"\")));for(let a in t)t[a]&&!((i=this.nt)!=null&&i.has(a))&&this.st.add(a);return this.render(t)}let e=r.element.classList;for(let a of this.st)a in t||(e.remove(a),this.st.delete(a));for(let a in t){let n=!!t[a];n===this.st.has(a)||(s=this.nt)!=null&&s.has(a)||(n?(e.add(a),this.st.add(a)):(e.remove(a),this.st.delete(a)))}return S}});var I=class extends y{handleRatingClick(){this.onRatingClick&&this.onRatingClick()}render(){return u` \n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t${this.longText?u`Rated ${this.reviewScore}/5 from ${this.reviewCount} customer review${this.reviewCount!==1?\"s\":\"\"}`:u`(${this.reviewCount})`}\n\t\t\t
\n\t\t`}};l([h({type:Number})],I.prototype,\"reviewPercentage\",2),l([h({type:Number})],I.prototype,\"reviewCount\",2),l([h({type:String})],I.prototype,\"reviewCountTestName\",2),l([h({type:Boolean})],I.prototype,\"large\",2),l([h({type:Boolean})],I.prototype,\"alwaysLarge\",2),l([h({type:Function})],I.prototype,\"onRatingClick\",2),l([h({type:Boolean})],I.prototype,\"isClickable\",2),l([h({type:String})],I.prototype,\"reviewScore\",2),l([h({type:Boolean})],I.prototype,\"longText\",2),l([h({type:Boolean})],I.prototype,\"smallTextMobile\",2),I=l([b(\"product-rating\")],I);var E=class extends y{constructor(){super(...arguments);this.variantIsSelected=!1}connectedCallback(){super.connectedCallback(),this.classList.add(\"has-loaded\")}render(){return u`\n\n\t\t
\n\t\t\t${this.isTradeCustomer?u`\n\t\t\t\tYour trade price\n\n\t\t\t\t\t

\n\t\t\t\t\t\t${this.hasVariants&&!this.variantIsSelected?u`From`:p}\n\t\t\t\t\t\t${_(this.price.Formatted)}\n\t\t\t\t\t\tinc. VAT\n\t\t\t\t\t

\n\n\t\t\t\t\t

\n\t\t\t\t\t\tRetail ${_(this.retailPrice.Formatted)}\n\t\t\t\t\t\tWas ${_(this.originalPrice.Formatted)}\n\t\t\t\t\t\t${this.percentageSaving?u`save ${this.tradeSaving}`:p}\n\t\t\t\t\t

\n\t\t\t\t`:u`\n\t\t\t${this.hideRrp?p:u`\n\t\t\t\t\t

\n\t\t\t\t\t\tRRP £${Math.trunc(this.rrp.Price)}\n\t\t\t\t\t\t${this.percentageSaving?u`save ${this.percentageSaving}%`:p}\n\t\t\t\t\t

\n\t\t\t\t`}\n\n\t\t\t${this.showSaleWasPrice?u`\n\t\t\t\t\t

\n\t\t\t\t\t\t${this.hasVariants&&!this.variantIsSelected?u`From`:p}\n\t\t\t\t\t\t${_(this.price.Formatted)}\n\t\t\t\t\t\twas ${_(this.originalPrice.Formatted)}\n\t\t\t\t\t

\n\t\t\t\t`:u`\n\t\t\t\t\t

\n\t\t\t\t\t\t${this.hasVariants&&!this.variantIsSelected?u`From`:p}\n\t\t\t\t\t\t${_(this.price.Formatted)}\n\t\t\t\t\t

\n\t\t\t\t`}\n\t\t\t`}\n\t\t
\n\t\t`}};l([h({type:Boolean})],E.prototype,\"hideRrp\",2),l([h({type:Boolean})],E.prototype,\"isTradeCustomer\",2),l([h({type:Boolean})],E.prototype,\"showSaleWasPrice\",2),l([h({type:Object})],E.prototype,\"rrp\",2),l([h({type:Object})],E.prototype,\"retailPrice\",2),l([h({type:Object})],E.prototype,\"originalPrice\",2),l([h({type:Boolean})],E.prototype,\"hasVariants\",2),l([h({type:Object})],E.prototype,\"price\",2),l([h({type:Boolean})],E.prototype,\"variantIsSelected\",2),l([h({type:String})],E.prototype,\"percentageSaving\",2),l([h({type:String})],E.prototype,\"tradeSaving\",2),E=l([b(\"product-main-price\")],E);var T=class extends y{constructor(){super(...arguments);this.testRrp=\"product-price-rrp\";this.testRetailPrice=\"product-retail-price\";this.testWasPrice=\"product-price-was\";this.testPrice=\"price\";this.testPriceForm=\"product-price-from\"}render(){return u` \n\t\t\t
\n\t\t\t\t
\n\t\t\t\t${this.isTradeCustomer?u`\n\t\t\t\t\t\n\t\t\t\t\t\tRetail ${_(this.retailPrice)}\n\t\t\t\t\t\n\t\t\t\t\t`:this.hideRrp?null:u`\n\t\t\t\t\t\n\t\t\t\t\t\tRRP ${_(this.rrp)}\n\t\t\t\t\t\n\t\t\t\t\t`}\n\t\t\t\t\t${this.showSaleWasPrice?u`\n\t\t\t\t\tWas ${_(this.wasPrice)}\n\t\t\t\t\t`:null}\n\t\t\t\t
\n\t\t\t\t

\n\t\t\t\t${this.hasVariants?u`${this.isTradeCustomer?u`Trade from`:\"From\"}`:null}\n\t\t\t\t\t${this.isTradeCustomer&&!this.hasVariants?u`Trade`:\"\"}\n\t\t\t\t\t${_(this.price)}\n\t\t\t\t

\n\t\t\t
\n\t\t`}};l([h({type:Boolean})],T.prototype,\"hideRrp\",2),l([h({type:Boolean})],T.prototype,\"isTradeCustomer\",2),l([h({type:Boolean})],T.prototype,\"showSaleWasPrice\",2),l([h({type:String})],T.prototype,\"rrp\",2),l([h({type:String})],T.prototype,\"retailPrice\",2),l([h({type:String})],T.prototype,\"wasPrice\",2),l([h({type:Boolean})],T.prototype,\"hasVariants\",2),l([h({type:String})],T.prototype,\"price\",2),l([h({type:String})],T.prototype,\"testRrp\",2),l([h({type:String})],T.prototype,\"testRetailPrice\",2),l([h({type:String})],T.prototype,\"testWasPrice\",2),l([h({type:String})],T.prototype,\"testPrice\",2),l([h({type:String})],T.prototype,\"testPriceForm\",2),T=l([b(\"product-price\")],T);var nt=class extends y{render(){return u` \n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t`}};l([h({type:String})],nt.prototype,\"productName\",2),l([h({type:Boolean})],nt.prototype,\"shiftLeft\",2),nt=l([b(\"wishlist-button\")],nt);var Z=class{static trackListView(t,e,i){g.deferTask(()=>{dataLayer.push({ecommerce:null}),dataLayer.push({event:\"view_item_list\",ecommerce:{item_list_id:t,item_list_name:e,items:i}})})}static trackSelectItem(t,e,i){g.deferTask(()=>{dataLayer.push({ecommerce:null}),dataLayer.push({event:\"select_item\",ecommerce:{item_list_id:t,item_list_name:e,items:[i]}})})}static getItemDetails(t){return{item_id:t.getAttribute(\"data-product-id\"),item_name:t.getAttribute(\"data-product-name\"),price:parseFloat(t.getAttribute(\"data-product-price\"))}}static trackWishlistShare(t,e,i){g.deferTask(()=>{dataLayer.push({ecommerce:null}),dataLayer.push({event:\"share\",ecommerce:{method:t,content_type:e,item_id:i}})})}static addCampaignTracking(t,e,i,s){let a=new URL(t);return a.searchParams.append(\"utm_source\",e),a.searchParams.append(\"utm_medium\",i),a.searchParams.append(\"utm_campaign\",s),a.toString()}};var Et=class{constructor(t){t.getAttribute(\"data-has-tracked-list-view\")&&t.getAttribute(\"data-has-tracked-list-view\")===\"true\"||(this.listContainer=t,this.listId=this.listContainer.getAttribute(\"data-list-id\"),this.listName=this.listContainer.getAttribute(\"data-list-name\"),this.getItems().length&&(Z.trackListView(this.listId,this.listName,this.getItems()),this.trackSelectItems(),t.setAttribute(\"data-has-tracked-list-view\",\"true\")))}getItems(){let t=[],e=this.listContainer.querySelectorAll(\"[data-product-id]\");for(let i=0;i{this.trackSelectItem(i)})}}trackSelectItem(t){let e=t.closest(\"[data-product-id]\"),i=Z.getItemDetails(e);Z.trackSelectItem(this.listId,this.listName,i)}};var G=class{constructor(t,e){t&&(this.container=t,this.lastFocusableElement=e,this.init())}init(){this.keydownFunction=this.handleKeyDown.bind(this),document.addEventListener(\"keydown\",this.keydownFunction)}handleKeyDown(t){let e=this.container.querySelectorAll(\"button, a\"),i=e[0],s=this.lastFocusableElement?this.lastFocusableElement:e[e.length-1];(t.key===\"Tab\"||t.keyCode===9)&&(t.shiftKey?document.activeElement===i&&(s.focus(),t.preventDefault()):document.activeElement===s&&(i.focus(),t.preventDefault()))}removeListener(){document.removeEventListener(\"keydown\",this.keydownFunction)}};var xt=class{constructor(){this.animationTime=600;this.mobileItemWidth=220;this.state={productId:\"\"};this.elements={wrapper:null,background:null,main:null,mainInner:null,mainListWrapper:null,mainList:null,mainItem:null,mainClose:null,mainBasket:null,skipToBasket:null,mainFooter:null,mainFooterItems:null,mainFooterPrice:null,mainForm:null,productQuantity:null,productLink:null,detail:null,detailFade:null,detailInner:null,detailContainer:null,detailItem:null,detailItemSpecs:null,detailItemSpecsTitle:null,detailItemSpecsContent:null,detailItemView:null,detailClose:null,detailLoader:null};this.flags={overlayActive:!1,detailActive:!1,allowInteraction:!0,isBasketPage:document.querySelector(\".js-new-basket\")};this.instances={slideshow:null,loaderTimeout:0};this.lockoutTop=0;this.browserInfo=g.getBrowser();this.lockoutClass=\"html--atb-lockout\";if(window.addEventListener(\"orientationchange\",()=>this.orientationChange),document.addEventListener(\"keyup\",t=>{let e=g.getKeypressed(t);(e===\"Escape\"||e===\"Esc\"||e===27)&&this.closeRun(null)}),document.addEventListener(\"touchmove\",t=>{this.flags.overlayActive&&t.preventDefault()}),document.addEventListener(\"updateAddedProducts\",t=>{this.flags.overlayActive&&this.updatePrice()}),this.useHeights()){this.lockoutClass=\"html--atb-lockout-fixed-heights\";let t=g.debounce(()=>this.setHeights(),250);window.addEventListener(\"resize\",t)}document.addEventListener(\"closeProductViewer\",this.closeDetail.bind(this))}useHeights(){let t=navigator.userAgent.toLowerCase(),e=t.indexOf(\"iphone\")!==-1||t.indexOf(\"ipad\")!==-1;return this.browserInfo.name===\"Safari\"&&parseInt(this.browserInfo.version)>=15&&e}getTemplate(t,e){let i=document.getElementById(t).innerHTML;return Mustache.render(i,e)}allowAnimations(){this.elements.wrapper&&this.elements.wrapper.classList.remove(\"atb--disallow-animations\")}disallowAnimations(){this.elements.wrapper&&this.elements.wrapper.classList.add(\"atb--disallow-animations\")}getScrollWidth(){let t=document.createElement(\"div\");t.style.visibility=\"hidden\",t.style.width=\"100px\",document.body.appendChild(t);let e=t.offsetWidth;t.style.overflow=\"scroll\";let i=document.createElement(\"div\");i.style.width=\"100%\",t.appendChild(i);let s=i.offsetWidth;return t.parentNode.removeChild(t),e-s}preventDefaultEvents(t){t.preventDefault()}lockoutOn(t){this.lockoutTop=window.scrollY||window.pageYOffset,document.documentElement.classList.add(this.lockoutClass),this.useHeights()?(this.elements.wrapper.addEventListener(\"pointermove\",this.preventDefaultEvents),this.setHeights()):t&&(document.body.style.marginTop=\"-\"+this.lockoutTop+\"px\",document.body.style.marginRight=this.getScrollWidth()+\"px\")}lockoutOff(){document.documentElement.classList.remove(this.lockoutClass),this.useHeights()&&(this.elements.wrapper.removeEventListener(\"pointermove\",this.preventDefaultEvents),this.removeHeights()),document.body.style.marginTop=\"0px\",document.body.style.marginRight=\"0px\",window.scroll(0,this.lockoutTop)}kickScroll(t){t&&(t.style[\"-webkit-overflow-scrolling\"]=\"hidden\",t.insertAdjacentHTML(\"beforeend\",'
'),setTimeout(()=>{t.style[\"-webkit-overflow-scrolling\"]=\"touch\",g.removeElement(t.querySelector(\"[data-scroll-kick]\"))},100))}closeAnimation(){let t=0;this.flags.detailActive&&(this.elements.detail.classList.remove(\"c-product-viewer__detail--active\"),this.elements.main.classList.remove(\"atb__main--detail-active\"),t=this.animationTime),setTimeout(()=>{this.flags.detailActive=!1,this.elements.main.classList.remove(\"atb__main--active\");let e=this;setTimeout(()=>{e.elements.wrapper.classList.remove(\"atb--active\"),setTimeout(()=>{g.removeElement(e.elements.wrapper),e.lockoutOff(),e.flags.overlayActive=!1,e.flags.allowInteraction=!0},e.animationTime)},e.animationTime)},t)}closeRun(t){if(!(!this.flags.allowInteraction||!this.flags.overlayActive)){if(this.flags.allowInteraction=!1,this.allowAnimations(),this.mainOverlayTrapFocus.removeListener(),window.addedProducts&&window.addedProducts.length){let e=g.createCustomEventForDispatch(\"atbcloseoverlay\");document.dispatchEvent(e)}t?window.location.href=t:this.closeAnimation()}}open(t,e){let i=this;if(window.addedProducts||(window.addedProducts=[]),t.AddedProducts&&t.AddedProducts.length)for(let n=0;n{this.elements.wrapper.classList.add(\"atb--active\"),setTimeout(()=>{this.flags.overlayActive=!0,this.lockoutOn(!0),this.elements.main.classList.add(\"atb__main--active\"),setTimeout(()=>{this.kickScroll(this.elements.mainInner),this.kickScroll(this.elements.mainListWrapper),this.flags.allowInteraction=!0,this.disallowAnimations(),this.focusOnFirstItem(),this.mainOverlayTrapFocus=new G(document.querySelector(\".atb__main\"),document.querySelector(\".atb__main__footer__basket__button\")),this.updatePrice(),g.deferTask(()=>{let n=this.elements.main.querySelectorAll(\"[data-list]\");for(let o=0;o{this.closeRun(null)}),this.elements.mainClose&&this.elements.mainClose.addEventListener(\"click\",n=>{this.closeRun(null),n.preventDefault()}),this.elements.mainBasket.addEventListener(\"click\",n=>{this.closeRun(this.flags.isBasketPage?null:\"/basket/\"),n.preventDefault()}),this.elements.skipToBasket&&this.elements.skipToBasket.addEventListener(\"click\",n=>{this.closeRun(\"/basket/\"),n.preventDefault()});let a=this.elements.wrapper.querySelectorAll(\"product-card\");for(let n=0;n{let c=o.target;o.preventDefault(),this.openDetail(c),this.elementWhichOpenedDetail=c};this.elements.mainFooter.style.right=this.getScrollWidth()+\"px\",g.scopedLoop(this.elements.mainList,function(n,o,c){let d=n.querySelectorAll(\"[data-atb-main-item]\").length;n.style.width=d*c.mobileItemWidth+\"px\"},this)}focusOnFirstItem(){let t=g.isUsingKeyboard()?this.elements.skipToBasket:document.querySelector(\".atb a\");if(t)t.focus();else{let e=O.excludeByClass(this.elements.wrapper.querySelectorAll(\"a, button\"),\"c-skip\");e.length&&e[0].focus()}}setElementsForOverlay(){this.elements.wrapper=document.querySelector(\"[data-atb]\"),this.elements.background=document.querySelector(\"[data-atb-background]\"),this.elements.main=document.querySelector(\"[data-atb-main]\"),this.elements.mainInner=document.querySelector(\"[data-atb-main-inner]\"),this.elements.mainList=document.querySelectorAll(\"[data-atb-main-list]\"),this.elements.mainListWrapper=document.querySelector(\"[data-atb-main-list-wrapper]\"),this.elements.mainItem=document.querySelectorAll(\"[data-atb-main-item]\"),this.elements.mainFooter=document.querySelector(\"[data-atb-main-footer]\"),this.elements.mainFooterItems=document.querySelector(\"[data-atb-main-footer-items]\"),this.elements.mainFooterPrice=document.querySelector(\"[data-atb-main-footer-price]\"),this.elements.mainForm=document.querySelectorAll(\"[data-atb-main-form]\"),this.elements.mainClose=document.querySelector(\"[data-atb-main-close]\"),this.elements.mainBasket=document.querySelector(\"[data-atb-main-basket]\"),this.elements.skipToBasket=document.querySelector(\"[data-atb-main-skip-to-basket]\"),this.elements.productQuantity=document.querySelector(\"[data-atb-main-product-quantity]\"),this.elements.productLink=this.elements.wrapper.querySelectorAll(\".js-product-link\"),this.elements.detail=document.querySelector(\"[data-product-viewer]\"),this.elements.detailFade=document.querySelector(\"[data-product-viewer-fade]\"),this.elements.detailInner=document.querySelector(\"[data-product-viewer-inner]\"),this.elements.detailContainer=document.querySelector(\"[data-product-viewer-container]\"),this.elements.detailLoader=document.querySelector(\"[data-product-viewer-loader]\"),this.elements.wrapper&&(this.elements.wrapper.style.display=\"block\")}setHeights(){if(this.flags.overlayActive){let t=window.innerHeight;document.documentElement.style.height=t+\"px\",document.body.style.height=t-1+\"px\"}}removeHeights(){document.documentElement.style.height=\"auto\",document.body.style.height=\"auto\"}orientationChange(){this.elements.wrapper&&(this.kickScroll(this.elements.mainInner),this.kickScroll(this.elements.mainListWrapper),this.kickScroll(this.elements.detailInner))}openDetail(t){if(!this.flags.allowInteraction)return;let e=t.closest(\"[data-atb-main-item]\"),i=e.getAttribute(\"data-atb-main-item\"),s=e.querySelector(\"[data-atb-main-product-quantity-widget-value]\"),a=s?s.value:0;(i!==this.state.productId||!this.flags.detailActive)&&(this.state.productId=i,this.flags.allowInteraction=!1,this.allowAnimations(),this.elements.detailContainer.innerHTML=\"\",this.elements.detailItem=document.querySelector(\"[data-product-viewer-item]\"),this.elements.detailItemSpecs=document.querySelector(\"[data-product-viewer-item-specs]\"),this.elements.detailItemSpecsTitle=document.querySelector(\"[data-product-viewer-item-specs-title]\"),this.elements.detailItemSpecsContent=document.querySelector(\"[data-product-viewer-item-specs-content]\"),this.elements.detailItemView=document.querySelector(\"[data-product-viewer-item-view]\"),this.elements.detailItemView&&this.elements.detailItemView.addEventListener(\"click\",n=>{let o=this.elements.detailItemView.getAttribute(\"href\");this.closeRun(o),n.preventDefault()}),this.flags.detailActive?(this.flags.allowInteraction=!0,this.kickScroll(this.elements.mainInner),this.kickScroll(this.elements.mainListWrapper),this.kickScroll(this.elements.detailInner),this.disallowAnimations()):(this.elements.main.classList.add(\"atb__main--detail-active\"),this.elements.detail.classList.remove(\"c-product-viewer__detail--hidden\"),this.elements.detail.classList.add(\"c-product-viewer__detail--active\"),setTimeout(()=>{this.flags.detailActive=!0,this.flags.allowInteraction=!0,this.kickScroll(this.elements.mainInner),this.kickScroll(this.elements.mainListWrapper),this.kickScroll(this.elements.detailInner),this.disallowAnimations(),this.mainOverlayTrapFocus.removeListener()},this.animationTime)))}closeDetail(){!this.flags.allowInteraction||!this.flags.detailActive||(this.flags.allowInteraction=!1,this.allowAnimations(),this.mainOverlayTrapFocus=new G(document.querySelector(\".atb__main\"),document.querySelector(\".atb__main__footer__basket__button\")),this.elementWhichOpenedDetail.focus(),this.elements.main.classList.remove(\"atb__main--detail-active\"),this.elements.detail.classList.remove(\"c-product-viewer__detail--active\"),setTimeout(()=>{this.flags.detailActive=!1,this.flags.allowInteraction=!0,this.kickScroll(this.elements.mainInner),this.kickScroll(this.elements.mainListWrapper),this.disallowAnimations(),this.elements.detailContainer.innerHTML=\"\",this.elements.detailItem=null,this.elements.detail.classList.add(\"c-product-viewer__detail--hidden\")},this.animationTime))}updatePrice(){let t=0,e=0;for(let s=0;s1?(this.instances.slideshow=new Splide(\"[data-product-viewer-item-slideshow-container]\",{type:\"loop\",perPage:1,perMove:1,speed:500,interval:5e3,pagination:!0,arrows:!0,keyboard:\"focused\",arrowPath:\"M1.14 39.85a1.12 1.12 0 01-.72-.26 1.17 1.17 0 01-.16-1.63l14.72-18.11L.24 1.78A1.15 1.15 0 01.6.19a1.14 1.14 0 011.44.16l15.94 19.5L2.04 39.43a1.15 1.15 0 01-.9.42z\",classes:{prev:\"c-carousel__button c-carousel__button--left js-carousel-button-left\",next:\"c-carousel__button c-carousel__button--right js-carousel-button-right\",pagination:\"c-carousel__pagination\",page:\"c-carousel__pagination-page\"}}),this.instances.slideshow.on(\"mounted\",()=>{setTimeout(()=>{let t=document.querySelector(\"[data-product-viewer-item-slideshow-container]\");t.removeAttribute(\"tabindex\");let e=t.querySelectorAll(\".splide__slide\");for(var i=0;ithis.handleButtonClick(t))}handleButtonClick(t){let e=this;if(!this.validateForm(t.target)){matchMedia(\"(min-width: 980px)\").matches&&setTimeout(function(){document.activeElement.blur()},500);return}this.disableButton(t.target),this.submitForm(t.target).then(function(s){s.Success?(e.trackAddToBasket(s.AddedProducts),r.updateBasketCounts(s.BasketTotalItemQuantity),popups.allow=!0,popups.close(),si.default.mutate(()=>{e.addToBasketOverlay.open(s,SiteStore.loadContent.customersAlsoBought)})):e.handleError()}),t.preventDefault()}validateForm(t){let e=t.closest(\"form\");return $(e).valid()}disableButton(t){this.buttonText=t.innerHTML,t.classList.add(this.disabledClass),t.setAttribute(\"disabled\",\"disabled\"),t.textContent=this.addingMessage}enableButton(t){t.classList.remove(this.disabledClass),t.removeAttribute(\"disabled\"),t.innerHTML=this.buttonText}submitForm(t){let e=this,i=t.closest(\"form\"),s=g.serialize(i);return j.queryID()&&(s+=\"&queryId=\"+j.queryID()),fetch(this.ajaxUrl,{method:\"POST\",credentials:\"same-origin\",headers:{\"Content-Type\":\"application/x-www-form-urlencoded\",\"Cache-Control\":\"no-cache\"},body:s}).then(function(a){if(e.enableButton(t),a.ok)return a.json();throw new Error(a)})}handleError(){popups.loader(!0),popups.allow=!0,popups.close(),popups.fadeClick=!0,popups.confirm(this.errorTitle,this.errorMessage,\"\",!0)}trackAddToBasket(t){g.deferTask(()=>{let e=0,i=[],s=[],a=[];for(let n=0;n{if(!t&&t!==0)return;let e=document.querySelector(\"#navBasketCount\");e&&(e.textContent=t);let i=document.getElementById(\"navMobileBasketCount\");i&&(i.textContent=t),document.querySelector(\".js-basket-total-link\").setAttribute(\"aria-label\",`${t} item${parseInt(t)!==1?\"s\":\"\"} in shopping basket`),document.querySelector(\"#navBasketLink\").classList.add(\"c-header__utils__item--basket-populated\")})}};var{I:ln}=Ve;var Gt=r=>r.strings===void 0;var Is={},ri=(r,t=Is)=>r._$AH=t;var ai=W(class extends R{constructor(r){if(super(r),r.type!==C.PROPERTY&&r.type!==C.ATTRIBUTE&&r.type!==C.BOOLEAN_ATTRIBUTE)throw Error(\"The `live` directive is not allowed on child or event bindings\");if(!Gt(r))throw Error(\"`live` bindings can only contain a single expression\")}render(r){return r}update(r,[t]){if(t===S||t===p)return t;let e=r.element,i=r.name;if(r.type===C.PROPERTY){if(t===e[i])return S}else if(r.type===C.BOOLEAN_ATTRIBUTE){if(!!t===e.hasAttribute(i))return S}else if(r.type===C.ATTRIBUTE&&e.getAttribute(i)===t+\"\")return S;return ri(r),t}});var It=(r,t)=>{var i;let e=r._$AN;if(e===void 0)return!1;for(let s of e)(i=s._$AO)==null||i.call(s,t,!1),It(s,t);return!0},Jt=r=>{let t,e;do{if((t=r._$AM)===void 0)break;e=t._$AN,e.delete(r),r=t}while((e==null?void 0:e.size)===0)},ni=r=>{for(let t;t=r._$AM;r=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(r))break;e.add(r),Ps(t)}};function Cs(r){this._$AN!==void 0?(Jt(this),this._$AM=r,ni(this)):this._$AM=r}function Os(r,t=!1,e=0){let i=this._$AH,s=this._$AN;if(s!==void 0&&s.size!==0)if(t)if(Array.isArray(i))for(let a=e;a{var t,e;r.type==C.CHILD&&((t=r._$AP)!=null||(r._$AP=Os),(e=r._$AQ)!=null||(r._$AQ=Cs))},te=class extends R{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,i){super._$AT(t,e,i),ni(this),this.isConnected=t._$AU}_$AO(t,e=!0){var i,s;t!==this.isConnected&&(this.isConnected=t,t?(i=this.reconnected)==null||i.call(this):(s=this.disconnected)==null||s.call(this)),e&&(It(this,t),Jt(this))}setValue(t){if(Gt(this._$Ct))this._$Ct._$AI(t,this);else{let e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}};var oi=()=>new ye,ye=class{},ve=new WeakMap,ci=W(class extends te{render(r){return p}update(r,[t]){var i;let e=t!==this.Y;return e&&this.Y!==void 0&&this.rt(void 0),(e||this.lt!==this.ct)&&(this.Y=t,this.ht=(i=r.options)==null?void 0:i.host,this.rt(this.ct=r.element)),p}rt(r){var t;if(typeof this.Y==\"function\"){let e=(t=this.ht)!=null?t:globalThis,i=ve.get(e);i===void 0&&(i=new WeakMap,ve.set(e,i)),i.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),i.set(this.Y,r),r!==void 0&&this.Y.call(this.ht,r)}else this.Y.value=r}get lt(){var r,t,e;return typeof this.Y==\"function\"?(t=ve.get((r=this.ht)!=null?r:globalThis))==null?void 0:t.get(this.Y):(e=this.Y)==null?void 0:e.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var k=class extends y{constructor(){super(...arguments);this.quantity=0;this.isSaving=!1;this.lastQuantity=0;this.quantityDifference=0;this.errorMessage=\"\";this.ajaxUrl=\"/api/basketadd/addorupdateajax/\";this.moreRef=oi()}connectedCallback(){super.connectedCallback(),this.checkIfShouldSync(),this.makeSureLoggerSourceIsSet(),document.addEventListener(\"updateAddedProducts\",this.checkIfShouldSync.bind(this))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(\"updateAddedProducts\",this.checkIfShouldSync.bind(this))}makeSureLoggerSourceIsSet(){this.loggerSource||this.closest(\"product-card\")&&this.closest(\"product-card\").hasAttribute(\"addbuttonloggersource\")&&(this.loggerSource=this.closest(\"product-card\").getAttribute(\"addbuttonloggersource\"))}checkIfShouldSync(){if(!window.addedProducts)return;let e=window.addedProducts.find(i=>i.id===this.name&&i.sku===this.sku);e&&(this.quantity=e.quantity,this.lastQuantity=e.quantity)}handleChangeQuantity(e,i){if(this.onChangeQuantity&&this.onChangeQuantity(e),this.disableAddToBasket){this.quantity=this.lastQuantity;return}if(e||(e=0),!this.isValidQuantity(e)){this.quantity=this.lastQuantity;let a=this.querySelector(\".js-add-product-quantity\");a&&(a.value=this.quantity.toString());return}this.quantity=e,clearTimeout(this.requestTimer);let s=setTimeout(()=>{this.updateBasket().then(a=>{this.isSaving=!1,this.errorMessage=\"\",this.updateAddedProducts(),this.logToUsageLogger(),i&&this.moreRef.value.focus(),Lt.updateBasketCounts(a.BasketTotalItemQuantity)}).catch(a=>{this.isSaving=!1,this.errorMessage=\"Error adding to basket\"})},i?0:500);this.requestTimer=s}updateAddedProducts(){if(window.addedProducts||(window.addedProducts=[]),window.addedProducts.find(s=>s.id===this.name&&s.sku===this.sku)){for(let s=0;s{if(i.ok)return this.trackAddToBasket(),i.json();throw new Error(i.text.toString())})}isValidQuantity(e){return isNaN(e)?(this.errorMessage=\"Please enter a quantity\",!1):(this.errorMessage=\"\",!0)}trackAddToBasket(){let e={item_id:this.name,item_name:this.displayName,price:this.price,quantity:Math.abs(this.quantityDifference)},i=this.closest(\"[data-list-id]\");i&&(e.list_item_id=i.getAttribute(\"data-list-id\"),e.list_item_name=i.getAttribute(\"data-list-name\")),dataLayer.push({ecommerce:null}),dataLayer.push({event:this.quantityDifference>0?\"add_to_cart\":\"remove_from_cart\",ecommerce:{value:(this.price*Math.abs(this.quantityDifference)).toFixed(2),items:[e]}}),this.quantityDifference>0&&j.addedToCart([this.guid],[{price:this.price,quantity:Math.abs(this.quantityDifference)}],g.roundToTwoDecimals(this.price*Math.abs(this.quantityDifference)))}logToUsageLogger(){let e=this.quantityDifference>0?\"AddToBasket\":\"RemoveFromBasket\";gibeUsageLogger.logMultipleEvents({ProductId:this.guid,EventType:e,Source:this.loggerSource},Math.abs(this.quantityDifference))}render(){return u` \n\t\t\t
e.preventDefault()}\">\n\t\t\t${this.quantity>0?u`\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tthis.handleChangeQuantity(parseInt(e.target.value),!1)} inputmode=\"numeric\" id=\"add-product-upsell-product-input-${this.name}\" ?disabled=${this.isSaving} class=\"c-add-product__controls__text js-add-product-quantity\" .value=\"${ai(this.quantity)}\" pattern=\"^[0-9]*$\" data-value-before-change=\"0\" data-test=\"upsell-product-quantity\">\n\t\t\t\t\t\n\t\t\t\t
`:u``}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t${this.errorMessage?u`

${this.errorMessage}

`:p}\n\t\t\t\t${!this.errorMessage&&this.lastQuantity>0?u``:p}\n\t\t\t
\n\t\t`}};l([h({type:String})],k.prototype,\"name\",2),l([h({type:String})],k.prototype,\"sku\",2),l([h({type:String})],k.prototype,\"displayName\",2),l([h({type:String})],k.prototype,\"guid\",2),l([h({type:Number})],k.prototype,\"price\",2),l([h({type:String,reflect:!0})],k.prototype,\"loggerSource\",2),l([h({type:String})],k.prototype,\"message\",2),l([h({reflect:!0})],k.prototype,\"quantity\",2),l([h({type:Boolean})],k.prototype,\"disableAddToBasket\",2),l([h({type:Boolean})],k.prototype,\"primaryButton\",2),l([h({type:Function})],k.prototype,\"onChangeQuantity\",2),l([h({type:Boolean})],k.prototype,\"slim\",2),l([D()],k.prototype,\"isSaving\",2),l([D()],k.prototype,\"lastQuantity\",2),l([D()],k.prototype,\"quantityDifference\",2),l([D()],k.prototype,\"errorMessage\",2),k=l([b(\"product-add\")],k);var ee={INITIAL:0,PENDING:1,COMPLETE:2,ERROR:3},li=Symbol(),ot=class{get taskComplete(){return this.t||(this.status===1?this.t=new Promise((t,e)=>{this.i=t,this.o=e}):this.status===3?this.t=Promise.reject(this.h):this.t=Promise.resolve(this.l)),this.t}constructor(t,e,i){var a,n,o;this.u=0,this.status=0,(this.p=t).addController(this);let s=typeof e==\"object\"?e:{task:e,args:i};this._=s.task,this.v=s.args,this.j=(a=s.argsEqual)!=null?a:di,this.m=s.onComplete,this.g=s.onError,this.autoRun=(n=s.autoRun)!=null?n:!0,\"initialValue\"in s&&(this.l=s.initialValue,this.status=2,this.k=(o=this.A)==null?void 0:o.call(this))}hostUpdate(){this.autoRun===!0&&this.O()}hostUpdated(){this.autoRun===\"afterUpdate\"&&this.O()}A(){if(this.v===void 0)return;let t=this.v();if(!Array.isArray(t))throw Error(\"The args function must return an array\");return t}O(){return H(this,null,function*(){let t=this.A(),e=this.k;this.k=t,t===e||t===void 0||e!==void 0&&this.j(e,t)||(yield this.run(t))})}run(t){return H(this,null,function*(){var n,o,c,d,m;let e,i;t!=null||(t=this.A()),this.k=t,this.status===1?(n=this.T)==null||n.abort():(this.t=void 0,this.i=void 0,this.o=void 0),this.status=1,this.autoRun===\"afterUpdate\"?queueMicrotask(()=>this.p.requestUpdate()):this.p.requestUpdate();let s=++this.u;this.T=new AbortController;let a=!1;try{e=yield this._(t,{signal:this.T.signal})}catch(f){a=!0,i=f}if(this.u===s){if(e===li)this.status=0;else{if(a===!1){try{(o=this.m)==null||o.call(this,e)}catch(f){}this.status=2,(c=this.i)==null||c.call(this,e)}else{try{(d=this.g)==null||d.call(this,i)}catch(f){}this.status=3,(m=this.o)==null||m.call(this,i)}this.l=e,this.h=i}this.p.requestUpdate()}})}abort(t){var e;this.status===1&&((e=this.T)==null||e.abort(t))}get value(){return this.l}get error(){return this.h}render(t){var e,i,s,a;switch(this.status){case 0:return(e=t.initial)==null?void 0:e.call(t);case 1:return(i=t.pending)==null?void 0:i.call(t);case 2:return(s=t.complete)==null?void 0:s.call(t,this.value);case 3:return(a=t.error)==null?void 0:a.call(t,this.error);default:throw Error(\"Unexpected status: \"+this.status)}}},di=(r,t)=>r===t||r.length===t.length&&r.every((e,i)=>!ut(e,t[i]));var ui,Ct=class extends y{constructor(){super(...arguments);this.fallbackText=(ui=document.querySelector(\".js-account-manager-fallback-text\"))==null?void 0:ui.innerHTML;this._accountManagerTask=new ot(this,{task:(i,s)=>H(this,[i,s],function*([],{signal:e}){let a=yield fetch(\"/api/tradeaccountmanager\",{signal:e});if(!a.ok)throw new Error(a.status.toString());return a.json()}),args:()=>[]})}renderLoading(){return u`\n\t\t`}renderFallbackText(){return this.fallbackText?u`
${_(this.fallbackText)}
`:u``}renderNonTrade(){return u``}renderTradeNoAccountManager(){return this.renderFallbackText()}renderTradeAccountManager(e){return u`\n\t\t
\n\t\t\t

Your account manager is

\n\t\t\t
\n\t\t\t\t${e.accountManager.displayName}\n\t\t\t
\n\t\t\t${e.accountManager.mobileNumber?u`\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t${e.accountManager.mobileNumber}\n\t\t\t\t
`:\"\"}\n\t\t\t${e.accountManager.hasWorkNumber?u`\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t${e.accountManager.workNumber}\n\t\t\t\t
`:\"\"}\n\t\t\t${e.accountManager.hasEmail?u`\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t${e.accountManager.email}\n\t\t\t\t
\n\t\t\t\t`:\"\"}\n\t\t\t${e.accountManager.hasLastUpdated?u`\n\t\t\t\tLast updated: ${e.accountManager.lastUpdated}`:\"\"}\n\t\t
`}render(){return this._accountManagerTask.render({pending:()=>this.renderLoading(),complete:e=>e.isTrade?e.accountManager.isValid?this.renderTradeAccountManager(e):this.renderTradeNoAccountManager():this.renderNonTrade(),error:()=>this.renderFallbackText()})}};Ct=l([b(\"account-manager\")],Ct);var ct=class extends y{constructor(){super(...arguments);this.quantity=0}connectedCallback(){super.connectedCallback(),this.checkIfShouldSync(),document.addEventListener(\"updateAddedProducts\",this.checkIfShouldSync.bind(this))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(\"updateAddedProducts\",this.checkIfShouldSync.bind(this))}checkIfShouldSync(){if(!window.addedProducts)return;let e=window.addedProducts.filter(i=>i.id===this.productId);if(e.length){let i=0;for(let s=0;s${this.quantity.toString()} added to your basket

`:p}};l([h({type:String})],ct.prototype,\"productId\",2),l([D()],ct.prototype,\"quantity\",2),ct=l([b(\"product-viewer-open-button-message\")],ct);var M=class extends y{constructor(){super(...arguments);this.text=\"Choose Options\";this.test=\"product-viewer-open-button\"}showProductViewer(e){e.preventDefault(),document.querySelector(\".atb__main--active\")||document.body.insertAdjacentHTML(\"beforeend\",\"\"),this.buttonOnClick&&this.buttonOnClick(e)}render(){return u`\n\t\t\t\n\t\t\t${this.showMessage?u``:p}\n\t\t`}};l([h({type:String})],M.prototype,\"productId\",2),l([h({type:String})],M.prototype,\"productDisplayName\",2),l([h({type:String})],M.prototype,\"text\",2),l([h({type:String})],M.prototype,\"test\",2),l([h({type:String})],M.prototype,\"extraCssClass\",2),l([h({type:Boolean})],M.prototype,\"showMessage\",2),l([h({type:Function})],M.prototype,\"buttonOnClick\",2),M=l([b(\"product-viewer-open-button\")],M);var lt=class r{static visibleClass(){return\"js-tooltip--visible\"}static showClass(){return\"js-tooltip--show\"}static clickedClass(){return\"js-tooltip-trigger--clicked\"}static dimmerVisibleClass(){return\"js-tooltip-dimmer--visible\"}static dimmer(){return document.querySelector(\"[data-js-tooltip-dimmer]\")}constructor(){r.init(!0)}static init(t){if(t){r.injectDimmer();var e=g.debounce(r.reposition,250);window.addEventListener(\"resize\",e),document.addEventListener(\"click\",i=>r.documentClick(i)),document.addEventListener(\"keyup\",i=>r.documentKeyUp(i))}r.triggers(),r.cloneAndMove(),r.closeLinks()}static injectDimmer(){document.body.insertAdjacentHTML(\"beforeend\",'
'),r.dimmer().addEventListener(\"click\",t=>r.dimmerClick(t))}static hideTooltips(){let t=document.querySelectorAll(\".js-tooltip\");for(let e=0;eClose'),!(i.getAttribute(\"data-js-tooltip-retain-position-in-dom\")||!1)){let a=i.cloneNode(!0);document.body.appendChild(a),i.parentNode.removeChild(i)}}}static triggers(){let t=O.excludeByClass(document.querySelectorAll(\"[data-js-tooltip-trigger]\"),\"has-initialised\");if(t.length)for(let e=0;er.triggerClick(s))}}static handleCustomAppendTarget(t){let e=t.getAttribute(\"data-js-tooltip-append-target\")||!1,i=e?document.querySelector(e):!1;if(!i)return;let s=t.getAttribute(\"href\").replace(\"#\",\"\"),a=document.querySelector(\"#\"+s),n=s+\"-\"+g.guid(),o=a.cloneNode(!0);o.setAttribute(\"id\",n),o.setAttribute(\"data-js-tooltip-retain-position-in-dom\",\"true\"),i.appendChild(o),t.setAttribute(\"href\",\"#\"+n)}static triggerClick(t){let e=t.currentTarget,i=e.getAttribute(\"href\"),s=document.querySelector(i),a=e.getAttribute(\"data-js-tooltip-hide-dimmer\")||!1;if(s.classList.contains(r.visibleClass())){t.preventDefault();return}r.hideTooltips(),r.positionTooltip(s,e),s.classList.add(r.showClass()),e.classList.add(r.clickedClass()),setTimeout(function(){s.classList.add(r.visibleClass()),a||r.dimmer().classList.add(r.dimmerVisibleClass())},10),t.preventDefault()}static closeLinks(){let t=document.querySelectorAll(\".js-tooltip__close\");if(t.length)for(let e=0;er.closeLinkClick(s))}static closeLinkClick(t){r.dimmer().classList.remove(r.dimmerVisibleClass()),r.hideTooltips(),r.resetTriggers(),t.preventDefault()}static positionTooltip(t,e){let i=e.getAttribute(\"data-js-tooltip-trigger-position\")||\"right\",s=g.getOffset(e),a=e.offsetWidth,n=10;i===\"right\"?(t.style.left=s.left+a+n+\"px\",t.style.top=s.top-n+\"px\"):i===\"bottom\"&&(t.classList.add(r.showClass()),t.style.left=s.left-t.offsetWidth/2-a/2+\"px\",t.style.top=s.top+e.offsetHeight+n+\"px\",t.classList.contains(r.visibleClass())||t.classList.remove(r.showClass()))}static reposition(){let t=document.querySelector(\".\"+r.visibleClass());if(!t)return;let e=document.querySelector('[data-js-tooltip-trigger][href=\"#'+t.getAttribute(\"id\")+'\"]');e&&r.positionTooltip(t,e)}static documentClick(t){let e=t.target,i=document.querySelector(\".\"+r.visibleClass());i&&e!==i&&!i.contains(e)&&(r.dimmer().classList.remove(r.dimmerVisibleClass()),r.hideTooltips(),r.resetTriggers())}static documentKeyUp(t){var e=g.getKeypressed(t);(e===\"Escape\"||e===\"Esc\"||e===27)&&(r.dimmer().classList.remove(r.dimmerVisibleClass()),r.hideTooltips(),r.resetTriggers())}};var Ot=class{constructor(){this.doneClass=\"js-slide-toggle-done\";this.init()}init(){this.triggers=O.excludeByClass(document.querySelectorAll(\".js-slide-toggle\"),this.doneClass),this.triggers.length&&(this.openFromHash(),this.styleOpenTriggers(),this.triggerClicks())}openFromHash(){let t=window.location.hash;if(!t)return;let e=document.querySelector(t);if(!e)return;e.setAttribute(\"aria-expanded\",\"true\");let i=e.getAttribute(\"aria-controls\"),s=document.querySelector(\"#\"+i),a=parseInt(e.getAttribute(\"data-transition-time\"))||0;this.open(s,a)}styleOpenTriggers(){for(let t=0;t{if(!t)return;t=!1;let s=i.currentTarget,n=s.getAttribute(\"aria-expanded\")===\"false\"||s.getAttribute(\"data-slide-toggle-open\")===\"true\",o=s.getAttribute(\"aria-controls\"),c=document.querySelector(\"#\"+o),d=parseInt(s.getAttribute(\"data-transition-time\"))||0;n?(this.open(c,d),this.setAriaExpanded(o,!0)):(this.close(c,d),this.setAriaExpanded(o,!1)),setTimeout(()=>{t=!0},d),this.openRevealChildren(c),i.stopPropagation()}),this.triggers[e].classList.add(this.doneClass)}setAriaExpanded(t,e){let i=document.querySelectorAll('[aria-controls=\"'+t+'\"]');for(let s=0;s{t.style.height=\"auto\"},e),this.openRevealChildren(t)}close(t,e){if(!t)return;typeof lt!=\"undefined\"&&(lt.hideTooltips(),lt.resetTriggers());let i=t.scrollHeight,s=t.style.transition;t.style.transition=\"\",requestAnimationFrame(()=>{t.style.height=i+\"px\",t.style.transition=s,requestAnimationFrame(()=>{t.style.height=\"0px\"})}),setTimeout(()=>{t.classList.remove(\"is-open\"),t.setAttribute(\"aria-hidden\",\"true\")},e)}openRevealChildren(t){let e=t.querySelector('.js-reveal-content[aria-expanded=\"false\"]');if(e){let i=e.querySelector(\".js-reveal-content-button\");i&&i.click()}}};var Pt=class{constructor(t){t?this.yotpoTriggers=t:this.yotpoTriggers=document.querySelectorAll(\".js-load-yotpo\"),this.yotpoTriggers.length&&this.setupObservers()}loadYotpo(){if(typeof window.yotpo!=\"undefined\"){window.yotpo.initWidgets();return}if(this.status===1||this.status===0)return;this.status=0;let t=document.createElement(\"script\");t.type=\"text/javascript\",t.async=!0,t.src=`//staticw2.yotpo.com/${this.getApiKey()}/widget.js`,t.onload=()=>{this.status=1};let e=document.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(t,e)}getApiKey(){return document.querySelector(\"[data-yotpo-api-key]\").getAttribute(\"data-yotpo-api-key\")}setupObservers(){let t=this,e=new IntersectionObserver(i,{rootMargin:\"0px 0px 250px 0px\"});function i(s,a){s.forEach(n=>{if(n.isIntersecting){t.loadYotpo();for(let o=0;or!=null?r:p;var Dt=class{constructor(t){this.instructionTextInitial=\"Click the image to zoom\";this.instructionTextKeyboardOn=\"Use keyboard arrows to control image position and escape to close\";this.instructionTextTouchOn=\"Drag to control the image position\";this.instructionTextMouseOn=\"Move the zoomed image with your mouse\";this.zoomActive=!1;this.isZoomed=!1;this.isUsingTouch=g.isTouch();this.currentX=50;this.currentY=50;if(this.container=t,this.container.classList.contains(\"is-done\"))return;let e=new IntersectionObserver((i,s)=>{i.forEach(a=>{a.isIntersecting&&(this.setupImage(),this.attachEvents(),e.unobserve(this.container))})});e.observe(this.container),this.instructionTextElement=this.container.closest(\".js-image-zoom-container\").querySelector(\".js-image-zoom-text\"),this.container.classList.add(\"is-done\"),this.containerOffset=this.getContainerOffset()}setupImage(){let t=Math.round(g.clamp(this.container.clientWidth*1.5,720,1066)),e=Math.round(g.clamp(this.container.clientHeight*1.5,720,1066)),i=Math.max(t,e);this.zoomedImageWidth=i,this.zoomedImageHeight=i;let s=this.container.querySelector(\"img\");this.baseImageUrl=s.getAttribute(\"src\").split(\"?\")[0],this.fullImageUrl=this.baseImageUrl+this.getImageUrlSuffix(),this.checkIfZoomShouldBeActive(),requestAnimationFrame(()=>{this.container.style.backgroundSize=`${this.zoomedImageWidth}px ${this.zoomedImageHeight}px`})}getImageUrlSuffix(){return`?w=${this.zoomedImageWidth}&h=${this.zoomedImageHeight}&mode=pad&scale=upscalecanvas&bgcolor=#ffffff&quality=100`}attachEvents(){let t=g.debounce(a=>{let n=a.target;n&&!n.closest(\".js-image-zoom\")&&(this.isUsingTouch=!1)},150);document.addEventListener(\"mousemove\",t),this.container.addEventListener(\"mousemove\",a=>{if(this.isUsingTouch)return!1;this.isUsingTouch=!1,this.zoom(a)});let e=g.debounce(a=>{this.containerOffset=this.getContainerOffset(),this.disableIsZoomed(),this.setupImage()},250);document.addEventListener(\"resize\",e),this.container.addEventListener(\"click\",()=>{this.isUsingTouch||(this.isZoomed?(this.disableIsZoomed(this.isUsingTouch),this.isUsingKeyboard()&&(this.instructionTextElement.textContent=this.instructionTextInitial,document.documentElement.classList.remove(\"keyboard-image-zoomed\"))):(this.enableIsZoomed(this.isUsingTouch),this.isUsingKeyboard()&&(this.instructionTextElement.textContent=this.instructionTextKeyboardOn,document.documentElement.classList.add(\"keyboard-image-zoomed\"))))}),this.container.querySelector(\".js-image-zoom-button\").addEventListener(\"click\",a=>{a.stopPropagation(),this.isZoomed?(this.disableIsZoomed(this.isUsingTouch),this.isUsingKeyboard()&&(this.instructionTextElement.textContent=this.instructionTextInitial,document.documentElement.classList.remove(\"keyboard-image-zoomed\"))):(this.enableIsZoomed(this.isUsingTouch),this.isUsingKeyboard()&&(this.instructionTextElement.textContent=this.instructionTextKeyboardOn,document.documentElement.classList.add(\"keyboard-image-zoomed\")))});let i,s;this.container.addEventListener(\"touchstart\",a=>{this.isUsingTouch=!0;let n=a.target;if(n&&n.closest(\".js-image-zoom-button\")||!this.zoomActive)return!1;this.isZoomed?(a.preventDefault(),this.abortEvent(a),this.checkIfZoomShouldBeActive(),s=setTimeout(()=>{this.disableIsZoomed(this.isUsingTouch)},500)):i=setTimeout(()=>{this.enableIsZoomed(!0)},500)}),this.container.addEventListener(\"touchmove\",a=>{let n=a.target;if(n&&n.closest(\".js-image-zoom-button\"))return!1;i&&clearTimeout(i),s&&clearTimeout(s),this.isZoomed&&(this.abortEvent(a),this.zoom(a))},{passive:!1}),this.container.addEventListener(\"contextmenu\",a=>(this.abortEvent(a),!1)),this.container.querySelector(\"img\").addEventListener(\"contextmenu\",a=>(this.abortEvent(a),!1)),document.addEventListener(\"resetImageZoom\",()=>{this.isZoomed&&this.disableIsZoomed(window.matchMedia(\"(max-width: 980px)\").matches)})}setZoomButtonState(t){t?(this.container.querySelector(\".js-image-zoom-button-zoom-in\").classList.remove(\"is-hidden\"),this.container.querySelector(\".js-image-zoom-button-zoom-out\").classList.add(\"is-hidden\")):(this.container.querySelector(\".js-image-zoom-button-zoom-in\").classList.add(\"is-hidden\"),this.container.querySelector(\".js-image-zoom-button-zoom-out\").classList.remove(\"is-hidden\"))}enableIsZoomed(t=!1){this.isZoomed=!0,this.container.classList.add(\"is-zoomed\"),document.documentElement.classList.add(\"image-zoom-active\"),this.setZoomButtonState(!1),t&&!this.container.classList.contains(\"js-image-zoom-in-overlay\")&&(g.isWholeElementInViewport(this.container)||this.container.scrollIntoView(),bodyScrollLock.disableBodyScroll(this.container,{reserveScrollBarGap:!0})),this.attachKeyboardControls(),this.instructionTextElement.textContent=this.isUsingTouch?this.instructionTextTouchOn:this.instructionTextMouseOn}disableIsZoomed(t=!1){this.isZoomed=!1,this.container.classList.remove(\"is-zoomed\"),this.setZoomButtonState(!0),document.documentElement.classList.remove(\"image-zoom-active\"),t&&!this.container.classList.contains(\"js-image-zoom-in-overlay\")&&bodyScrollLock.enableBodyScroll(this.container),this.removeKeyboardControls(),this.instructionTextElement.textContent=this.instructionTextInitial}abortEvent(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0,t.returnValue=!1}zoom(t){if(!t.target.classList.contains(\"js-image-zoom\"))return;if(!this.zoomActive){this.container.style.backgroundPosition=\"0% 0%\";return}if(t.offsetX===void 0&&t.touches===void 0)return;this.containerOffset.left||(this.containerOffset=this.getContainerOffset());let e,i;t.type===\"touchmove\"?(e=t.touches[0].clientX-this.containerOffset.left,i=t.touches[0].clientY-this.containerOffset.top):(e=t.offsetX,i=t.offsetY);let s,a;if(t.type===\"touchmove\"){let n=this.moveTouchPosition(e,i);s=n.x,a=n.y,this.lastTouchX=e,this.lastTouchY=i}else s=this.keepWithinRangeOfImage(e/this.container.offsetWidth*100),a=this.keepWithinRangeOfImage(i/this.container.offsetHeight*100);requestAnimationFrame(()=>{this.container.style.backgroundPosition=s+\"% \"+a+\"%\",this.currentX=s,this.currentY=a})}getContainerOffset(){let t=this.container.getBoundingClientRect();return{top:t.top+document.body.scrollTop,left:t.left+document.body.scrollLeft}}moveTouchPosition(t,e){let s=this.currentX,a=this.currentY,n=Math.abs(t-this.lastTouchX),o=Math.abs(e-this.lastTouchY);n>50&&(n=2),o>50&&(o=2);let c=n*.33,d=o*.33;return t>this.lastTouchX&&(s=this.currentX-c),tthis.lastTouchY&&(a=this.currentY-d),e100&&(t=100),t<-100&&(t=-100),t=t/2+50,Math.round(t)}convertToScale(t){return(t-50)*2}isUsingKeyboard(){return document.documentElement.classList.contains(\"using-keyboard\")}attachKeyboardControls(){this.keyboardControlsFunction=t=>this.keyboardControls(t),window.addEventListener(\"keydown\",this.keyboardControlsFunction)}removeKeyboardControls(){this.keyboardControlsFunction&&window.removeEventListener(\"keydown\",this.keyboardControlsFunction)}keepWithin0to100(t){return t>100&&(t=100),t<0&&(t=0),t}keyboardControls(t){let e=this.getCurrentImagePosition(),i=g.getKeypressed(t);if(i===\"ArrowRight\"||i===\"Right\"||i===39){let s=this.keepWithin0to100(e.left+10),a=e.top;this.container.style.backgroundPosition=s+\"% \"+a+\"%\",t.preventDefault()}if(i===\"ArrowLeft\"||i===\"Left\"||i===37){let s=this.keepWithin0to100(e.left-10),a=e.top;this.container.style.backgroundPosition=s+\"% \"+a+\"%\",t.preventDefault()}if(i===\"ArrowUp\"||i===\"Up\"||i===38){let s=e.left,a=this.keepWithin0to100(e.top-10);this.container.style.backgroundPosition=s+\"% \"+a+\"%\",t.preventDefault()}if(i===\"ArrowDown\"||i===\"Down\"||i===40){let s=e.left,a=this.keepWithin0to100(e.top+10);this.container.style.backgroundPosition=s+\"% \"+a+\"%\",t.preventDefault()}(i===\"Escape\"||i===\"Esc\"||i===27)&&this.disableIsZoomed(!0)}getCurrentImagePosition(){let t=window.getComputedStyle(this.container,null).backgroundPosition.trim().split(/\\s+/);return{left:parseFloat(t[0]),top:parseFloat(t[1])}}checkIfZoomShouldBeActive(){this.getImageSize(this.baseImageUrl).then(t=>{let e=this.getDisplayImageSize(this.container),i=(t.width-e.width)/t.width>.3;this.zoomActive=i,i?(this.container.classList.add(\"is-active\"),this.container.style.backgroundImage=`url(\"${CSS.escape(this.fullImageUrl)}\")`):this.container.classList.remove(\"is-active\")}).catch(()=>{this.zoomActive=!1,this.container.classList.remove(\"is-active\")})}getDisplayImageSize(t){return{width:t.clientWidth?t.clientWidth:t.parentElement.clientWidth,height:t.clientHeight?t.clientHeight:t.parentElement.clientHeight}}getImageSize(t){return t=t+\"?format=webp&quality=1\",new Promise(function(e,i){var s=new Image;s.onload=function(){e({width:this.width,height:this.height}),g.removeElement(document.querySelector('img[src=\"'+t+'\"].js-zoom-size-check'))},s.onerror=i,s.src=t,s.alt=\"\",s.style.opacity=\"0.0001\",s.style.position=\"fixed\",s.style.pointerEvents=\"none\",s.style.top=\"0px\",s.style.left=navigator.userAgent.toLowerCase().indexOf(\"firefox\")>-1?\"0px\":\"calc(100% - 1px)\",s.style.zIndex=\"100\",s.style.maxWidth=\"none\",s.classList.add(\"js-zoom-size-check\"),document.body.appendChild(s)})}};var mt=class mt{static on(){mt.top=document.documentElement.scrollTop,document.documentElement.classList.add(\"html--lockout\"),document.body.style.marginTop=\"-\"+mt.top+\"px\"}static off(){document.documentElement.classList.remove(\"html--lockout\"),document.body.style.removeProperty(\"margin\"),window.scroll(0,mt.top)}};mt.top=0;var ft=mt;var jt=class{constructor(t){this.elements=null;this.openClass=\"c-reveal--open\";this.moreText=\"Show More\";this.lessText=\"Show Less\";this.closedMaxHeight=300;t?this.elements=t:this.elements=document.querySelectorAll(\".js-reveal-content\"),this.elements.length&&this.setupRevealSections()}setupRevealSections(){for(var t=0;t{let d=o.target.parentNode;i.classList.contains(this.openClass)?(clearTimeout(n),i.classList.remove(this.openClass),i.setAttribute(\"style\",\"\"),a.setAttribute(\"aria-expanded\",\"false\"),a.innerHTML=this.moreText,s&&(i.style.maxHeight=this.closedMaxHeight+\"px\"),setTimeout(()=>{this.toggleChildrenFocusability(i,!1)},350)):(i.classList.add(this.openClass),i.style.maxHeight=d.offsetHeight+\"px\",a.setAttribute(\"aria-expanded\",\"true\"),a.innerHTML=this.lessText,n=setTimeout(()=>{i.style.maxHeight=\"3000px\",this.toggleChildrenFocusability(i,!0)},350))}),i.classList.add(\"c-reveal--done\")}}toggleChildrenFocusability(t,e){let i=O.excludeByClass(t.querySelectorAll(\"a, button, input, textarea, select, details\"),\"js-reveal-content-button\");for(let s=0,a=i.length;sparseInt(window.getComputedStyle(i).maxHeight.replace(\"px\",\"\")))}wrapSection(t){let e=document.createElement(\"div\");for(e.setAttribute(\"class\",\"c-reveal__inner\");t.firstChild;)e.appendChild(t.firstChild);t.appendChild(e)}createButton(t){let e=document.createElement(\"button\");return e.setAttribute(\"type\",\"button\"),e.setAttribute(\"aria-controls\",t),e.setAttribute(\"aria-expanded\",\"false\"),e.setAttribute(\"data-test\",\"reveal-button\"),e.classList.add(\"c-reveal__button\"),e.classList.add(\"js-reveal-content-button\"),e.innerHTML=this.moreText,e}isDesktopLayout(){return matchMedia(\"(min-width: 980px)\").matches}};var P=class extends y{constructor(){super(...arguments);this.initialQuantity=0;this.selectedOptions={};this.canAddToBasket=!1;this.hasClickedAddToBasket=!1;this.instances={slideshow:null,loaderTimeout:0};this._productTask=new ot(this,{task:(a,n)=>H(this,[a,n],function*([e,i],{signal:s}){let o=yield fetch(`/api/productviewer/getproduct/?id=${e}&quantity=${this.getQuantity(e,i!=null?i:e)}${i?`&sku=${i}`:\"\"}`,{signal:s});if(!o.ok)throw new Error(o.status.toString());return this.details=yield o.json(),this.details}),args:()=>[this.productId,this.sku]});this.maxKeyFeaturesForVariants=5;this.maxKeyFeatures=10}connectedCallback(){super.connectedCallback(),this.standalone&&ft.on()}disconnectedCallback(){super.disconnectedCallback(),this.detailOverlayTrapFocus&&this.detailOverlayTrapFocus.removeListener(),this.standalone&&ft.off()}updated(e){(e.has(\"productId\")||e.has(\"sku\"))&&this.checkHasLoaded(),e.has(\"selectedOptions\")&&this.isSelectionValid()&&this.lookupSkuBasedOnSelectedOptions()}getQuantity(e,i){if(!window.addedProducts)return this.initialQuantity;let s=window.addedProducts.find(a=>a.id===e&&a.sku===i);return s?s.quantity:this.initialQuantity}checkHasLoaded(){this._productTask.status===ee.COMPLETE?this.initScripts():window.setTimeout(()=>this.checkHasLoaded(),100)}initScripts(){this.rerender=!0,setTimeout(()=>{this.rerender=!1,setTimeout(()=>{this.initSlider(),this.initFocusTrap(),new Ot,new Pt(this.querySelectorAll(\".js-load-yotpo\")),this.focusOnFirstItemInDetails();let e=g.createCustomEventForDispatch(\"updateWishlistButtons\");document.dispatchEvent(e),this.canAddToBasket=this.isSelectionValid();let i=this.querySelectorAll(\".js-image-zoom\");for(var s=0;s1?(this.instances.slideshow=new Splide(\"[data-product-viewer-item-slideshow-container]\",{type:\"fade\",perPage:1,perMove:1,speed:600,interval:5e3,heightRatio:1,pagination:!0,rewind:!0,arrows:!0,keyboard:\"focused\",arrowPath:\"M1.14 39.85a1.12 1.12 0 01-.72-.26 1.17 1.17 0 01-.16-1.63l14.72-18.11L.24 1.78A1.15 1.15 0 01.6.19a1.14 1.14 0 011.44.16l15.94 19.5L2.04 39.43a1.15 1.15 0 01-.9.42z\",classes:{prev:\"c-carousel__button c-carousel__button--left js-carousel-button-left\",next:\"c-carousel__button c-carousel__button--right js-carousel-button-right\",pagination:\"c-carousel__pagination\",page:\"c-carousel__pagination-page\"}}),this.instances.slideshow.on(\"mounted\",()=>{setTimeout(()=>{let e=document.querySelector(\"[data-product-viewer-item-slideshow-container]\");if(e){e.removeAttribute(\"tabindex\");let s=e.querySelectorAll(\".splide__slide\");for(var i=0;i{let i=document.querySelectorAll(\"[data-product-viewer] [data-product-viewer-close]\")[0];i&&i.focus()},250)}handleVariantOptionSelected(e,i,s,a){if(!i){this.selectedOptions={};return}s?(this.selectedOptions={[e]:i},this.uncheckInputs(a)):this.selectedOptions=U(N({},this.selectedOptions),{[e]:i})}uncheckInputs(e){let i=this.querySelectorAll(\".js-product-viewer-variant-options :checked\");for(let a=0;a\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t\n\t\t`}renderErrorState(){return u`\n\t\t\t
\n\t\t\t\t

Unable to get product details. Please close this overlay and try again later.

\n\t\t\t
\n\t\t`}isDesktop(){return matchMedia(\"(min-width: 980px)\").matches}renderProductDetails(e){var i,s,a,n;return this.rerender?p:u`\n\t\t\t
\n\n\t\t\t
\n\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t

${e.Product.DisplayName}

\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\t${e.Product.Gallery.ItemCount>0?u`\n\t\t\t\t\t\t\t\t\t`:p}\n\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\t${e.Product.ReviewCount>0?u`\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\tthis.handleRatingClick()}\" />\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t`:p}\n\n\t\t\t\t\t\t\t\t${e.Product.HasOverlay?u`
\n\t\t\t\t\t\t\t\t\t\t\t\t

${_(e.Product.OverlayText)}

\n\t\t\t\t\t\t\t\t\t\t\t
`:null}\n\n\t\t\t\t\t\t\t\t${(a=e.Product.VariantOptions)!=null&&a.length?u`\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t${e.Product.VariantOptions.map(o=>u`\n\t\t\t\t\t\t\t\t\t\t

${o.DisplayName}:

\n\t\t\t\t\t\t\t\t\t\t${o.DisplayVariantOptionSwatchesInProductViewer?u`\n\t\t\t\t\t\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t\t\t\t\t\t${o.Options.map(c=>u`\n\t\t\t\t\t\t\t\t\t\t\t\t\t
  • \n\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis.handleVariantOptionSelected(o.Name,d.target.value,this.checkShouldDisableOptions(o.Name,c.Name),d.target)}\" id=\"product-viewer-variant-radio-${o.SafeVariantOptionItemName}-${c.SafeOptionName}\" name=\"product-viewer-variant-radio-${o.SafeVariantOptionItemName}\" type=\"radio\" value=\"${c.Name}\" class=\"c-radio-list__item__input ${L({\"is-disabled\":this.checkShouldDisableOptions(o.Name,c.Name)})}\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t
  • \n\t\t\t\t\t\t\t\t\t\t\t\t`)}\n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t`:u``}\n\t\t\t\t\t\t\t\t\t\t${!this.canAddToBasket&&this.hasClickedAddToBasket&&!this.optionGroupInSelectedOptions(o.Name)?u`

Please select an option

`:p}\n\t\t\t\t\t\t\t\t\t`)}\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t`:p}\n\n\t\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\t\tthis.hasClickedAddToBasket=!0}\n\t\t\t\t\t\t\t\t\t\t?disableAddToBasket=\"${!this.canAddToBasket}\"\n\t\t\t\t\t\t\t\t\t\tprimaryButton\n\t\t\t\t\t\t\t\t\t\tslim>\n\n\t\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t

${_(e.Product.DeliveryEstimate)}

\n\t\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\t${e.Product.KeyFeatures.length?u`\n\t\t\t\t\t\t\t\t\t\t\t

What's great about it?

\n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t\t\t\t\t\t\t${e.Product.KeyFeatures.slice(0,(n=e.Product.VariantOptions)!=null&&n.length?this.maxKeyFeaturesForVariants:this.maxKeyFeatures).map(o=>u`\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t
  • ${o}
  • \n\t\t\t\t\t\t\t\t\t\t\t\t\t`)}\n\t\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t
`:p}\n\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\n\t\t\t
\n\n\t\t\t
\n\t\t\t\t
\n\n\t\t\t\t\t${e.Product.Description?u`\n\t\t\t\t\t\t

\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t${_(e.Product.Description)}\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t`:p}\n\n\t\t\t\t\t${e.Product.SpecificationTable.length?u`\n\t\t\t\t\t

\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t${e.Product.SpecificationTable.map(o=>u`\n\t\t\t\t\t\t\t${o.Items.length?u`\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t${o.Items.map(c=>u`\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t`)}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t${o.DisplayName}\n\t\t\t\t\t\t\t\t
${c.DisplayName}\n\t\t\t\t\t\t\t\t\t\t${c.HasLink?u`${c.Value}`:c.Value}\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t`:p}\n\t\t\t\t\t\t\t`)}\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t`:p}\n\n\t\t\t\t

\n\t\t\t\t\t\n\t\t\t\t

\n\n\t\t\t\t
\n\t\t\t\t\t
\n\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\n\t\t\t
\n\t\t\t\tView full product details\n\t\t\t
\n\n\t\t\t
\n\t\t\t\n\t\t`}renderProductInformation(){return this._productTask.render({pending:()=>this.details?this.renderProductDetails(this.details):this.renderLoadingState(),complete:e=>this.renderProductDetails(e),error:e=>this.renderErrorState()})}render(){return u`\n\t\t\n\t\t\t
\n\t\t\t\t${this.renderProductInformation()}\n\t\t\t
\n\t\t
\n\t\t`}};l([h({type:String,reflect:!0})],P.prototype,\"productId\",2),l([h({type:String,reflect:!0})],P.prototype,\"sku\",2),l([h({type:Boolean})],P.prototype,\"standalone\",2),l([h({type:Number})],P.prototype,\"initialQuantity\",2),l([D()],P.prototype,\"details\",2),l([h({type:Object})],P.prototype,\"selectedOptions\",2),l([D()],P.prototype,\"canAddToBasket\",2),l([D()],P.prototype,\"hasClickedAddToBasket\",2),l([h({type:Boolean})],P.prototype,\"rerender\",2),P=l([b(\"product-viewer\")],P);var dt=class extends y{constructor(){super(...arguments);this.showAnimation=!1;this.closeAnimationDuration=300}connectedCallback(){super.connectedCallback(),window.addEventListener(\"keydown\",this.handleKeydown.bind(this)),document.addEventListener(\"closeProductViewer\",this.close.bind(this),{once:!0}),this.standalone&&setTimeout(()=>{this.showAnimation=!0},300)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener(\"keydown\",this.handleKeydown)}close(){this.showAnimation=!1,this.parentElement&&this.standalone&&setTimeout(()=>{this.parentElement.parentElement&&this.parentElement.parentElement.removeChild(this.parentElement);let e=g.createCustomEventForDispatch(\"updateWishlistButtons\");document.dispatchEvent(e);let i=g.createCustomEventForDispatch(\"productViewerClosed\");document.dispatchEvent(i)},this.closeAnimationDuration)}handleKeydown(e){e.key===\"Escape\"&&this.close()}render(){return this.standalone?u`\n\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t${this.getSlot(\"main\")}\n\t\t\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t
\n\t\t\t`:this.getSlot(\"main\")}};l([h({type:Boolean})],dt.prototype,\"standalone\",2),l([D()],dt.prototype,\"showAnimation\",2),dt=l([b(\"product-viewer-container\")],dt);var gt=class extends y{formatNumber(t){let e=t;return e=e.toFixed(2),e.endsWith(\".00\")&&(e=e.slice(0,-3)),e}render(){let t=this.formatNumber(this.value);return u`${t}`}};l([h({type:Number})],gt.prototype,\"value\",2),gt=l([b(\"number-formatter\")],gt);})();\n/*! Bundled license information:\n\n@lit/reactive-element/css-tag.js:\n (**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n *)\n\n@lit/reactive-element/reactive-element.js:\n (**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n *)\n\nlit-html/lit-html.js:\n (**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n *)\n\nlit-element/lit-element.js:\n (**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n *)\n\nlit-html/is-server.js:\n (**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n *)\n\n@lit/reactive-element/decorators/custom-element.js:\n (**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n *)\n\n@lit/reactive-element/decorators/property.js:\n (**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n *)\n\n@lit/reactive-element/decorators/state.js:\n (**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n *)\n\n@lit/reactive-element/decorators/event-options.js:\n (**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n *)\n\n@lit/reactive-element/decorators/base.js:\n (**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n *)\n\n@lit/reactive-element/decorators/query.js:\n (**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n *)\n\n@lit/reactive-element/decorators/query-all.js:\n (**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n *)\n\n@lit/reactive-element/decorators/query-async.js:\n (**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n *)\n\n@lit/reactive-element/decorators/query-assigned-elements.js:\n (**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n *)\n\n@lit/reactive-element/decorators/query-assigned-nodes.js:\n (**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n *)\n\nlit-html/directive.js:\n (**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n *)\n\nlit-html/directives/unsafe-html.js:\n (**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n *)\n\nlit-html/directives/class-map.js:\n (**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n *)\n\nlit-html/directive-helpers.js:\n (**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n *)\n\nlit-html/directives/live.js:\n (**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n *)\n\nlit-html/async-directive.js:\n (**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n *)\n\nlit-html/directives/ref.js:\n (**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n *)\n\n@lit/task/task.js:\n (**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n *)\n\nlit-html/directives/if-defined.js:\n (**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n *)\n*/\n"],"file":"ui-components-37b4bbc487.js"}