"use strict";(globalThis.webpackChunksfra_boilerplate=globalThis.webpackChunksfra_boilerplate||[]).push([[3929],{9034:(e,t,s)=>{s.r(t),s.d(t,{default:()=>r});var i=s(5131);const r=function(e){return class extends e{prefs(){return{updateUrl:"",...super.prefs()}}init(){super.init(),this.update()}update(){const e=window.location.hash.substring(1).split("&").reduce(((e,t)=>{const s=t.split("=");return e[s[0]]=s[1],e}),{});e.cgid?(this.busy(),(0,i.Ti)(this.prefs().updateUrl,{cgid:e.cgid},!1).then((e=>{e&&this.ref("self").setHtml(e)})).finally((()=>{this.unbusy()}))):this.unbusy()}busy(){this.ref("self").attr("aria-busy","true")}unbusy(){this.ref("self").attr("aria-busy","false")}}}},4135:(e,t,s)=>{s.r(t),s.d(t,{default:()=>i});const i=function(e){return class extends e{addToCartByPanel(e){this.prefs().readyToOrder?super.addToCartByPanel(e):this.stickyPanel?.callIfExists("isFlyoutOpen")?this.stickyPanel?.callIfExists("showFlyoutError",this.prefs().textSelectOptions):this.stickyPanel?.callIfExists("openFlyout")}renderStickyPanel(e){this.renderStickyPanelImage(e),this.renderStickyPanelName(e.productName),this.renderStickyPanelPrice(e),this.renderStickyPanelInStockDate(e),this.renderStickyPanelButton(e)}renderStickyPanelInStockDate(e){this.stickyPanel&&this.stickyPanel.render("inStockDateTemplate",e,this.stickyPanel.ref("inStockDate"))}renderStickyPanelButton(e){this.stickyPanel&&(this.stickyPanel.callIfExists("hideFlyoutError"),this.stickyPanel.getById(this.prefs().addToCartBtn,(t=>{e.available?(t.enable(),t.setText(this.prefs()[e.availability.isPreOrder?"addToCartPreOrderLabel":"addToCartStandardLabel"])):(t.disable(),t.setText(this.prefs().outOfStockLabel))})))}}}},4364:(e,t,s)=>{s.r(t),s.d(t,{default:()=>r});var i=s(5131);const r=function(e){return class extends e{prefs(){return{classesBusy:"m-busy",processingRequest:!1,textNetworkError:"Network Error",isValidateInStock:!1,...super.prefs()}}checkInStore(e){return this.prefs().processingRequest?Promise.resolve(null):this.prefs().readyToOrder?this.prefs().isValidateInStock&&this.product.stock&&this.product.stock<this.prefs().selectedQuantity?(this.showCartMessage(this.prefs().textStockLimit,!0),Promise.resolve(null)):(this.setPref("processingRequest",!0),e.startProcess(),this.showProgressBar(),this.renderCheckInStoreModal(e)):(this.showCartMessage(this.prefs().textSelectOptions,!0),Promise.resolve(null))}renderCheckInStoreModal(e){const t=e.data("checkInStoreUrl"),s=this.getCheckInStoreRequestData(e);return(0,i.Ti)(t,s).then((t=>(this.setPref("processingRequest",!1),e.stopProcess(),this.hideProgressBar(),this.handleCheckInCartResponse(t),t))).catch((()=>{this.setPref("processingRequest",!1),e.stopProcess(),this.hideProgressBar(),this.showCartMessage(this.prefs().textNetworkError,!0)}))}getCheckInStoreRequestData(e){return{pid:this.prefs().currentProductId||e.prefs().pid}}handleCheckInCartResponse(e){this.getById("checkInStoreModal",(t=>{t.render("template",{body:e},t.ref(t.prefs().refContent)).then((()=>{t.showModal(),this.accessibilityAlert(this.prefs().accessibilityAlerts.dialogContentLoaded)}))}))}showProgressBar(){this.ref("self").addClass(this.prefs().classesBusy)}hideProgressBar(){this.ref("self").removeClass(this.prefs().classesBusy)}accessibilityAlert(e){window.setTimeout((()=>this.eventBus().emit("alert.show",{accessibilityAlert:e})),400)}}}},1269:(e,t,s)=>{s.r(t),s.d(t,{default:()=>i});const i=function(e){return class extends e{getPreorderAvailability(e,t){let{availabilityLevelsForMaxAllowedQty:s,inStockDateMessage:i}=e;const{preOrder:r}=s;if(!t||!r||s.inStock||s.backOrder)return{isPreOrder:!1};const a=this.ref("availabilityData").data("msgs"),l={isPreOrder:!0};return i&&(l.inStockDateMessage=i),t>r?{...l,class:this.prefs().lowStockClass,preOrderMessage:a?.preOrderItemsMessage?.replace("#",String(r)),isReachedLimit:!0,isReachedLimitMessage:a?.reachedLimitError}:{...l,class:this.prefs().inStockClass,preOrderMessage:a?.preOrderMessage}}getBackOrderAvailability(e,t){let{availabilityLevelsForMaxAllowedQty:s}=e;const{backOrder:i}=s;if(!t||!i||s.inStock||s.preOrder)return{isBackOrder:!1};const r=this.ref("availabilityData").data("msgs");return t>i?{isBackOrder:!0,class:this.prefs().lowStockClass,isReachedLimit:!0,isReachedLimitMessage:r?.reachedLimitError,backOrderMessage:r?.backOrderItemsMessage?.replace("#",String(i))}:{isBackOrder:!0,class:this.prefs().inStockClass,backOrderMessage:r?.backOrderMessage}}reCalculateAvailabilityModel(e){const t=super.reCalculateAvailabilityModel(e);return t.availability&&(t.availability.isReturnProhibited=e.isReturnProhibited),t}}}},8632:(e,t,s)=>{s.r(t),s.d(t,{default:()=>i});const i=function(e){return class extends e{togglePanel(e){this.ref("self").toggleClass(this.prefs().classesOpened,e),document.body.classList.toggle(this.prefs().classesStickyPanel,e),e||this.closeFlyout()}toggleFlyout(e){this.has("flyout",(t=>t.toggleClass(this.prefs().classesOpened,e)))}openFlyout(){this.toggleFlyout(!0)}closeFlyout(){this.toggleFlyout(!1),this.hideFlyoutError()}isFlyoutOpen(){let e=!1;return this.has("flyout",(t=>{e=t.hasClass(this.prefs().classesOpened)})),e}showFlyoutError(e){this.has("flyoutError",(t=>{t.setHtml(e).show()}))}hideFlyoutError(){this.has("flyoutError",(e=>{e.hide().setHtml("")}))}}}},1704:(e,t,s)=>{s.r(t),s.d(t,{default:()=>r});var i=s(8954);const r=function(e){return class extends e{renderVariationAttributes(e){this.getById("productStickyPanel",(t=>super.renderVariationAttributes.call(t,e))),super.renderVariationAttributes(e)}getVariationAccessibilityAlertMsg(e,t){const s=t.split("-")[1],i=e.variationAttributes.find((e=>e.attributeId===s)).values.find((e=>e.selected));return`Variation ${s} ${i.id} is selected`}triggerChangeAttributeEvent(e){if(!this.changeAttributeID)return;let t="";0===this.changeAttributeID.indexOf("quantity")?(t=this.prefs().accessibilityAlerts.quantitychanged,this.showAlert(t,e)):0===this.changeAttributeID.indexOf("attr-")?(t=this.getVariationAccessibilityAlertMsg(e.product,this.changeAttributeID),this.showAlert(t,e)):0===this.changeAttributeID.indexOf("option-")&&(t=this.prefs().accessibilityAlerts.optionselected,this.productOptionsSelect||(this.productOptionsSelect=(0,i.D)((()=>{this.showAlert(t,e)}),2e3,!1,!0)),this.productOptionsSelect())}}}},2774:(e,t,s)=>{s.r(t),s.d(t,{default:()=>i});const i=function(e){return class extends e{prefs(){return{pid:"",...super.prefs()}}trackViewedItem(e){super.trackViewedItem(this.prefs().pid||e)}}}},8995:(e,t,s)=>{s.r(t),s.d(t,{default:()=>r});var i=s(5131);const r=function(e){return class extends e{prefs(){return{classesBusy:"m-busy",processingRequest:!1,textNetworkError:"Network Error",isValidateInStock:!1,geolocationOptions:{enableHighAccuracy:!0,timeout:5e3,maximumAge:0},...super.prefs()}}reserveInStore(e){return this.prefs().processingRequest?Promise.resolve(null):this.prefs().readyToOrder?this.prefs().isValidateInStock&&this.product.stock&&this.product.stock<this.prefs().selectedQuantity?(this.showCartMessage(this.prefs().textStockLimit,!0),Promise.resolve(null)):(this.setPref("processingRequest",!0),e.startProcess(),this.showProgressBar(),this.fetchUserCurrentLocation(e)):(this.showCartMessage(this.prefs().textSelectOptions,!0),Promise.resolve(null))}fetchUserCurrentLocation(e){navigator.geolocation&&navigator.geolocation.getCurrentPosition((t=>this.userAllowCurrentLocation(t,e)),(()=>this.userDenyCurrentLocation(e)),this.prefs().geolocationOptions)}userAllowCurrentLocation(e,t){const{coords:{latitude:s,longitude:i}}=e;return this.userLocation={latitude:s,longitude:i},this.renderReserveInStoreModal(t)}userDenyCurrentLocation(e){return this.userLocation=void 0,this.renderReserveInStoreModal(e)}renderReserveInStoreModal(e){const t=e.data("reserveInStoreUrl"),s=this.getReserveInStoreRequestData(e);return(0,i.Ti)(t,s).then((t=>(this.setPref("processingRequest",!1),e.stopProcess(),this.hideProgressBar(),this.handleReserveInCartResponse(t),t))).catch((()=>{this.setPref("processingRequest",!1),e.stopProcess(),this.hideProgressBar(),this.showCartMessage(this.prefs().textNetworkError,!0)}))}getReserveInStoreRequestData(e){const t={pid:this.prefs().currentProductId||e.prefs().pid};return this.userLocation&&(t.latitude=String(this.userLocation.latitude),t.longitude=String(this.userLocation.longitude)),t}handleReserveInCartResponse(e){this.getById("reserveInStoreModal",(t=>{t.render("template",{body:e},t.ref(t.prefs().refContent)).then((()=>{t.showModal()}))}))}showProgressBar(){this.ref("self").addClass(this.prefs().classesBusy)}hideProgressBar(){this.ref("self").removeClass(this.prefs().classesBusy)}}}},3932:(e,t,s)=>{s.r(t),s.d(t,{default:()=>a});var i=s(900);const r=Object.freeze({PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,UP:38,DOWN:40}),a=function(e){return class extends e{incrementStep=1;minValue=1;maxValue=1;previousValue=1;currentValue=1;isBusy=!1;qtyAlertToAnnounce=!0;prefs(){return{updateDelay:0,attrUrl:"",oninputCoercionToRange:!0,...super.prefs()}}initOptions(){this.isBusy=!1,this.currentValue=parseInt(this.getValue(),10),this.previousValue=this.currentValue,this.minValue=this.getMinValue(),this.maxValue=this.getMaxValue(),this.incrementStep=parseInt(this.ref("field").data("step")||"1",10)}init(){super.init(),this.initOptions(),this.setInputValue(this.currentValue),this.updateState(),this.eventBus().on("block.qty.alert.announce","blockQtyAlertAnnounce")}onRefresh(){super.onRefresh(),this.init()}update(){this.initOptions(),this.setInputValue(this.filterInput(this.currentValue),!1),this.updateState()}getSelectedOptions(){return this}getSelectedVariations(){return this}blockQtyAlertAnnounce(){this.qtyAlertToAnnounce=!1}handleKeydown(e,t){let s=!1;const{currentValue:i,minValue:a,maxValue:l}=this;switch(t.keyCode){case r.UP:this.increment(),s=!0;break;case r.DOWN:this.decrement(),s=!0;break;case r.PAGEUP:this.setInputValue(this.filterInput(i+5)),s=!0;break;case r.PAGEDOWN:this.setInputValue(this.filterInput(i-5)),s=!0;break;case r.HOME:this.setInputValue(a),s=!0;break;case r.END:this.setInputValue(l),s=!0}s&&(t.stopPropagation(),t.preventDefault())}filterAndSetInput(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t=this.getValue(),s=t.replace(/\D/g,"");if(s!==t&&""===s)this.ref("field").val("");else{const t=this.filterInput(s,e);this.setInputValue(t)}}handleInput(){this.submittingTimeout&&this.submittingTimeout(),this.filterAndSetInput(this.prefs().oninputCoercionToRange)}handleChange(){this.updateState()}handleBlur(){Number.isNaN(this.getValue())?this.setInputValue(this.currentValue):this.filterAndSetInput()}increment(){const e=parseInt(this.getValue(),10);this.setInputValue(this.filterInput(e+this.incrementStep))}decrement(){const e=parseInt(this.getValue(),10);this.setInputValue(this.filterInput(e-this.incrementStep))}filterInput(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if("-"===e||""===e)return;const s="string"==typeof e?parseInt(e,10):e;return Number.isNaN(s)?this.currentValue:t?this.restrictInputToRange(s):s}restrictInputToRange(e){const{minValue:t,maxValue:s}=this;let i=e;return e<t?i=t:e>s&&(i=s),Number.isFinite(t)&&Number.isFinite(s)||(i=e),i}setInputValue(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.isBusy||Number.isNaN(e)||void 0===e||(this.ref("field").val(e.toString()),this.ref("field").attr("value",e.toString()),this.ref("field").attr("aria-valuenow",e.toString()),this.qtyAlertToAnnounce&&setTimeout((()=>{const t=`Quantity ${e}`;this.ref("field").attr("aria-valuetext",t);const s=document.createElement("div");s.setAttribute("aria-live","assertive"),s.setAttribute("role","alert"),s.style.position="absolute",s.style.width="1px",s.style.height="1px",s.style.margin="-1px",s.style.border="0",s.style.padding="0",s.style.overflow="hidden",s.textContent=t,document.body.appendChild(s),setTimeout((()=>{document.body.removeChild(s)}),100)}),50),this.currentValue!==e&&(this.previousValue=this.currentValue,this.currentValue=e,this.updateState(),this.updateActionUrl(),t&&this.dispatchChange()))}dispatchChange(){this.emit("dismiss",this),this.submittingTimeout&&this.submittingTimeout();const e=this.prefs().updateDelay;this.submittingTimeout=(0,i.Vs)((()=>this.emit("change",this)),e)}updateActionUrl(){const e=this.prefs().attrUrl.replace(/quantity=\d*/g,"quantity="+this.currentValue);this.setPref("attrUrl",e)}updateState(){const e=this.ref("field").get(),t=this.getAllQuantityByID();if(null!==(e&&e.getAttribute("disabled")))return this.toggleButtonsState(this.ref("buttonIncrease"),!0),void this.toggleButtonsState(this.ref("buttonDecrease"),!0);const{currentValue:s,minValue:i,maxValue:r}=this;""===this.ref("field").val()&&this.ref("field").val(s.toString()),this.toggleButtonsState(this.ref("buttonDecrease"),s<=i&&Number.isFinite(i)),this.toggleButtonsState(this.ref("buttonIncrease"),(t||s)>=r&&Number.isFinite(r))}toggleBusy(e){this.isBusy=e,this.ref("field").attr("readonly",e?"readonly":null),this.ref("self").attr("aria-busy",e.toString()),this.toggleButtonsState(this.ref("buttonIncrease"),e),this.toggleButtonsState(this.ref("buttonDecrease"),e)}toggleButtonsState(e,t){t?e.attr("disabled","disabled"):e.attr("disabled",null)}getMinValue(){const e=this.ref("field").attr("aria-valuemin").toString(),t=parseInt(e,10);return e&&!Number.isNaN(t)?t:1/0}getMaxValue(){const e=this.ref("field").attr("aria-valuemax").toString(),t=parseInt(e,10);return e&&!Number.isNaN(t)?t:1/0}getAllQuantityByID(){const e=this.ref("field").attr("data-all-quantity-by-id").toString();return e?parseInt(e,10):null}}}},3415:(e,t,s)=>{s.r(t),s.d(t,{default:()=>i});const i=function(e){return class extends e{updateProductId(e){this.getById("backInStockProductId",(t=>{t.setValue(e)}))}}}},4266:(e,t,s)=>{s.r(t),s.d(t,{default:()=>l});var i=s(2093),r=s(5131),a=s(900);const l=function(e){return class extends e{prefs(){return{pid:"",processingRequest:!1,selectedQuantity:"",showMinicartDelay:500,showMinicartOnProductAdd:!1,showOverlayOnProductAdd:!1,showAlertOnProductAdd:"",showMessageOnProductAdd:!0,addToCartGlobalMsg:"",textNetworkError:"",accessibilityAlerts:{addedsettocart:""},textSelectAvailableOption:"",...super.prefs()}}init(){super.init(),this.eventBus().on("product.updated","onProductItemUpdated")}showProductError(e,t){e.getById("addToCartMsg",(e=>{e.render("template",{msg:t,error:!0},e.ref("container")).then((()=>e.show()))}))}handleProductSetError(e,t,s){const r=e.filter(t);return!!r.length&&(r.forEach((e=>this.showProductError(e.widget,s(e)))),r[0].widget.getById("productName",(e=>{const t=e.ref("titleLink").get();t&&(t.focus(),(0,i.G$)(t,!0))})),!0)}handleUnselected(e){return this.handleProductSetError(e,(e=>!e.isAllAttributesSelected&&e.hasAvailableVariant),(e=>e.widget.prefs().textSelectOptions))}updateAddAllToCardButton(e){this.getById("addToCardGlobal",(t=>{e.some((e=>e.isAvailable))?t.enable():t.disable()}))}isProductsValidForAddingToCart(e){let t=!1;return t=this.handleUnselected(e),!t}getProductSetItems(){const e=this.getConstructor("addToCartMixin"),t=[];return this.eachChild((s=>{if(s instanceof e&&s.prefs().productSetItem){let e=!1;s.getById("addToCart",(t=>{e=Boolean(t.prefs().isOutOfStock)}));const i=s.prefs();t.push({pid:i.currentProductId||i.pid,quantity:i.selectedQuantity,isAvailable:i.readyToOrder&&!e,isAllAttributesSelected:i.isAllAttributesSelected,hasAvailableVariant:i.hasAvailableVariant,widget:s})}})),t}getPidsObj(e){return e.filter((e=>e.isAvailable)).map((e=>({pid:e.pid,qty:e.quantity})))}onAddAllToCart(e){if(this.prefs().processingRequest)return Promise.resolve(null);const t=this.getProductSetItems();if(!this.isProductsValidForAddingToCart(t))return Promise.resolve(null);const s=this.getPidsObj(t),i=s.length===t.length;return this.setPref("processingRequest",!0),e.startProcess(),this.getById(this.prefs().addToCartGlobalMsg,(e=>e.hide())),(0,r.I7)(e.prefs().addToCartUrl,{pid:this.prefs().pid||e.prefs().pid,quantity:this.prefs().selectedQuantity||e.prefs().selectedQuantity,pidsObj:JSON.stringify(s)}).then((e=>(this.postAddAllToCart(e,i,s.length),e))).finally((()=>{this.setPref("processingRequest",!1),e.stopProcess()})).catch((()=>{this.showAddAllToCartAlert(!0,this.prefs().textNetworkError)}))}postAddAllToCart(e,t,s){if(e.success&&e.cart&&e.messages){const i=e.cart;i.showMinicart=this.prefs().showMinicartOnProductAdd;const r=e.messages&&e.messages.length===s,l=t&&r?this.prefs().accessibilityAlerts.addedsettocart:e.messages.join("<br>");this.eventBus().emit("product.added.to.cart",i,this),this.prefs().showMessageOnProductAdd&&this.showAddAllToCartAlert(!1,l),this.prefs().showOverlayOnProductAdd&&e.addToCartOverlayUrl&&this.eventBus().emit("dialogshow",{url:e.addToCartOverlayUrl,headerText:e.addToCartOverlayHeader,bodyClass:"m-has_dialog",wrapperClasses:"m-cart_overlay"}),(0,a.Vs)((()=>this.eventBus().emit("minicart.need.update",i,this)),this.prefs().showMinicartDelay)}else this.showAddAllToCartAlert(!0,e.errorMessage)}showAddAllToCartAlert(e,t){this.prefs().showAlertOnProductAdd&&this.getById(this.prefs().addToCartGlobalMsg,(s=>{s.render("template",{msg:t,error:e},s.ref("container")).then((()=>s.show()))}))}onProductItemUpdated(){this.updateAddAllToCardButton(this.getProductSetItems()),this.prefs().showAlertOnProductAdd&&this.getById(this.prefs().addToCartGlobalMsg,(e=>{e.hide()}))}}}},3663:(e,t,s)=>{s.r(t),s.d(t,{default:()=>r});var i=s(2093);const r=function(e){return class extends e{isStickyPanelShown=!1;prefs(){return{classesHidden:"m-hidden",...super.prefs()}}initIntersectionObserver(){this.getById("productStickyPanel",(e=>{this.stickyPanel=e,e&&this.getById(this.prefs().addToCartBtn,(t=>{const s=t.ref("self").get();s&&(this.observer=new IntersectionObserver((t=>{let[i]=t;!i.isIntersecting&&s.getBoundingClientRect().top<0?this.isStickyPanelShown=!0:this.isStickyPanelShown=!1,e.togglePanel(this.isStickyPanelShown)}),{threshold:0}),this.observer.observe(s))}))}))}addToCartByPanel(e){this.stickyPanelButton=e,this.getById(this.prefs().addToCartBtn,(e=>{e.handleClick()}))}showCartMessage(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s=arguments.length>2?arguments[2]:void 0;this.getById(this.prefs().addToCartMsg,(r=>{void 0===this.spacesLength&&(this.spacesLength=0),e=e.concat(Array(++this.spacesLength).join(this.prefs().zeroWidthSpaceSymbol)),r.render("template",{msg:e,error:t},s?s.ref("container"):r.ref("container")).then((()=>{s?s.show():r.show(),this.isStickyPanelShown&&t&&!s&&(0,i.G$)(r.ref("container").get(),!1,!0)}))}))}addToCart(e,t){return super.addToCart(e,(()=>{"function"==typeof t&&t(),this.startStickyPanelButtonLoader()})).finally((()=>this.stopStickyPanelButtonLoader()))}updateProductView(e){super.updateProductView(e),this.renderStickyPanel(e)}renderStickyPanel(e){if(this.stickyPanel){if(this.stickyPanel.ref("self").toggleClass(this.prefs().classesHidden,!e.available),!e.available)return;this.renderStickyPanelImage(e),this.renderStickyPanelName(e.productName),this.renderStickyPanelPrice(e)}}renderStickyPanelImage(e){this.stickyPanel&&e.images?.small&&this.stickyPanel.render("panelPictureTemplate",e.images.small[0],this.stickyPanel.ref("stickyPanelPicture"))}renderStickyPanelName(e){this.stickyPanel&&this.stickyPanel.ref("stickyPanelName").setText(e)}renderStickyPanelPrice(e){this.stickyPanel&&e.price&&e.price.html&&this.stickyPanel.getById("priceBlock",(t=>{t.render("template",{},void 0,e.price.html)}))}startStickyPanelButtonLoader(){this.isStickyPanelShown&&this.stickyPanelButton&&this.stickyPanelButton.startProcess()}stopStickyPanelButtonLoader(){this.stickyPanelButton&&this.stickyPanelButton.stopProcess()}}}},7762:(e,t,s)=>{s.r(t),s.d(t,{default:()=>i});const i=function(e){return class extends e{product={};prefs(){return{currentProductId:"",pid:"",isAllAttributesSelected:!1,available:!1,quantity:"0",disableHistory:!0,accessibilityAlerts:{optionselected:"",variationselected:""},...super.prefs()}}getBundleInfo(){return{isAvailable:this.prefs().available,isAllAttributesSelected:this.prefs().isAllAttributesSelected,pid:this.prefs().currentProductId||this.prefs().pid,quantity:parseInt(this.prefs().quantity,10)}}updateProductView(e){this.product=e,this.updatePreferences(e),this.renderImages(e),this.renderName(e),e.isAllAttributesSelected&&this.getById("addToCartMsg",(e=>{e.hide()})),this.emit("toggleaddtocart")}updatePreferences(e){this.setPref("currentProductId",e.id),this.setPref("available",e.available),this.setPref("isAllAttributesSelected",e.isAllAttributesSelected)}renderName(e){this.render("nameTemplate",e,this.ref("nameContainer"))}renderImages(e){this.render("imageTemplate",e,this.ref("imageContainer"))}afterAttributeChange(e){}showAlert(e){this.eventBus().emit("alert.show",{accessibilityAlert:e}),this.changeAttributeID=void 0}}}},1123:(e,t,s)=>{s.r(t),s.d(t,{default:()=>i});const i=function(e){return class extends e{quantityWidgetId="quantity";product={...this.product||{},availability:{},readyToOrder:!1,isInaccessibleVariant:!1,productAvailable:!1};init(){super.init(),this.product={...this.product||{},availability:this.ref("availabilityData").data("availabilityModel"),readyToOrder:this.ref("availabilityData").data("readyToOrder"),isInaccessibleVariant:this.ref("availabilityData").data("isInaccessibleVariant"),productAvailable:this.ref("availabilityData").data("productAvailable")}}prefs(){return{lowStockClass:"m-lowinstock",inStockClass:"m-instock",...super.prefs()}}getInStockAvailability(e,t){const s={};if(!e||!t)return s;const i=e.availabilityLevelsForMaxAllowedQty.inStock||0,r=e.quantityAvailableToSell||0,a=e.lowStockThreshold||0,l=e.maxQtyAllowed,n=this.ref("availabilityData").data("msgs");return 0===i||(s.stock=i,r&&t<=r&&a>0&&r<a?(s.isLowStock=!0,s.class=this.prefs().lowStockClass,s.lowStockMessage=n?.lowStockMessage):i>=t&&t<=l?(s.isInStock=!0,s.class=this.prefs().inStockClass,s.inStockMessage=n?.inStockMessage):(s.class=this.prefs().lowStockClass,(i<t||t>l)&&(s.isReachedLimit=!0,s.isMaxQtyAllowedReached=t>=l,s.isReachedLimitMessage=n?.reachedLimitError,s.inStockMsg=this.getInStockMessage(i,n)))),s}getNotAvailable(e,t){const s=e.availabilityLevelsForMaxAllowedQty.notAvailable,i=this.ref("availabilityData").data("msgs"),r=s>=t?t:s,a={};return r>0&&r===t&&0===e.availabilityLevelsForMaxAllowedQty.inStock&&0===e.availabilityLevelsForMaxAllowedQty.backOrder&&0===e.availabilityLevelsForMaxAllowedQty.preOrder&&(a.class="m-outofstock",a.outOfStockMessage=i?.outOfStockMessage,a.isOutOfStock=!0),a}getBackOrderAvailability(e,t){const s=e.availabilityLevelsForMaxAllowedQty.backOrder,i=this.ref("availabilityData").data("msgs"),r=s>=t?t:s,a={};return r>0&&0===e.availabilityLevelsForMaxAllowedQty.inStock&&0===e.availabilityLevelsForMaxAllowedQty.preOrder&&(a.isBackOrder=!0,t<=r?(a.class=this.prefs().inStockClass,a.backOrderMessage=i?.backOrderMessage):(a.class=this.prefs().lowStockClass,a.isReachedLimit=!0,a.isReachedLimitMessage=i?.reachedLimitError,a.backOrderMessage=i?.backOrderItemsMessage?.replace("#",String(t)))),a}getPreorderAvailability(e,t){const s=e.availabilityLevelsForMaxAllowedQty.preOrder,i=this.ref("availabilityData").data("msgs"),r=s>=t?t:s,a={};return r>0&&0===e.availabilityLevelsForMaxAllowedQty.inStock&&0===e.availabilityLevelsForMaxAllowedQty.backOrder&&(a.isPreOrder=!0,t<=r?(a.class=this.prefs().inStockClass,a.preOrderMessage=i?.preOrderMessage):(a.class=this.prefs().lowStockClass,a.isReachedLimit=!0,a.isReachedLimitMessage=i?.reachedLimitError,a.preOrderMessage=i?.preOrderItemsMessage?.replace("#",String(t)))),a}getInStockMessage(e,t){let s;return s=e>1?t?.multipleInStockItemsMsg?.replace("#",String(e)):t?.singleInStockItemMsg?.replace("#",String(e)),s||""}getQuantityStepperAttributes(e,t,s){const i=e?e.quantityAvailableToSell:null,r=e.maxQtyAllowed,a=this.getSelectedQuantity(),l=t,n=s,o=a&&a>l?a:l;return{max:(e&&i&&i<r?i+1:r).toFixed(),min:l.toFixed(),step:n.toFixed(),currentQty:o.toFixed()}}getSelectedQuantity(){return this.getById(this.quantityWidgetId,(e=>parseInt(e.getValue(),10)))||this.prefs().selectedQuantity}updateAvailabilityPreferences(e,t){this.setPref("selectedQuantity",t),this.product.stock=e?.availabilityLevelsForMaxAllowedQty?.inStock??null,this.product.selectedQuantity=t}changeQuantity(){const e=this.product.availability,t=this.product.readyToOrder,s=this.product.isInaccessibleVariant,i=this.product.productAvailable;return e&&t?(this.product=this.reCalculateAvailabilityModel(this.product),this.updateAvailabilityPreferences(this.product.availability,this.getSelectedQuantity()),this.renderAvailability({available:i,isInaccessibleVariant:s})?.then((()=>{this.callIfExists("onQuantityUpdate",{availability:this.product.availability,available:i,selectedQuantity:this.product.selectedQuantity})})).finally((()=>{this.eventBus().emit("alert.show",{accessibilityAlert:this.prefs().accessibilityAlerts.quantitychanged})}))):Promise.resolve(null)}updatePreferences(e){super.updatePreferences(e),this.updateAvailabilityPreferences(e.availability,e.selectedQuantity)}updateProductView(e){e=this.reCalculateAvailabilityModel(e),super.updateProductView(e),this.renderQuantities(e),this.renderAvailability(e)}renderQuantities(e){const t=e.availability;if(!e.quantities||!t)return;const s=this.getQuantityStepperAttributes(t,e.minOrderQuantity,e.stepQuantity);this.getById("quantity",(e=>{e.render("template",{attr:s,isOutOfStock:t&&t.isOutOfStock||!1},e.ref("container")).then((function(){e.update()}))}))}reCalculateAvailabilityModel(e){const t=this.getSelectedQuantity(),s=e.availability,i={...this.getInStockAvailability(s,t),...this.getNotAvailable(s,t),...this.getBackOrderAvailability(s,t),...this.getPreorderAvailability(s,t),availabilityLevelsForMaxAllowedQty:s.availabilityLevelsForMaxAllowedQty,quantityAvailableToSell:s.quantityAvailableToSell,lowStockThreshold:s.lowStockThreshold,maxQtyAllowed:s.maxQtyAllowed,hasAvailableVariant:s.hasAvailableVariant};return e.availability=i,e}renderAvailability(e){return this.product.readyToOrder?(this.has("productAvailabilityMsg",(e=>{e.hide()})),this.getById("availability",(t=>t.render("template",{availability:this.product.availability,productAvailable:e.available},t.ref("container"))))):Promise.resolve()}}}},3188:(e,t,s)=>{s.r(t),s.d(t,{default:()=>i});const i=function(e){return class extends e{getInputValueByID(e){let t="";return this.getById(e,(e=>{t=e.getValue()})),t}validateInputByID(e){let t=!1;return this.getById(e,(e=>{t=e.validate()})),t}}}},8097:(e,t,s)=>{s.r(t),s.d(t,{default:()=>r});var i=s(2093);const r=function(e){return class extends e{prefs(){return{productDetailId:"productDetail-0",...super.prefs()}}onShopCollection(){const e=this.ref("productsContainer").get();e&&(this.getById(this.prefs().productDetailId,(e=>{e.getById("productName",(e=>{e.ref("titleLink").focus()}))})),(0,i.G$)(e,!0))}}}},4049:(e,t,s)=>{s.r(t),s.d(t,{default:()=>i});const i=function(e){return class extends e{prefs(){return{classesOpened:"m-opened",classesStickyPanel:"m-sticky_panel",...super.prefs()}}init(){this.emit("initobserver"),this.eventBus().on("product.addTocart.intersects.viewport","togglePanel")}togglePanel(e){this.ref("self").toggleClass(this.prefs().classesOpened,e),document.body.classList.toggle(this.prefs().classesStickyPanel,e)}}}},7e3:(e,t,s)=>{s.r(t),s.d(t,{default:()=>r});const i=Object.freeze({SPACE:32,ENTER:13}),r=function(e){return class extends e{prefs(){return{videoThumbnailActiveClass:"m-current",...super.prefs()}}init(){super.init()}hideVideo(){this.ref("self").removeClass(this.prefs().videoThumbnailActiveClass)}showVideo(e){e.addClass(this.prefs().videoThumbnailActiveClass),this.emit("showvideo")}handleKeydown(e,t){t&&(t.keyCode!==i.ENTER&&t.keyCode!==i.SPACE||(t.preventDefault(),t.stopPropagation(),this.showVideo(e)))}}}},7774:(e,t,s)=>{s.r(t),s.d(t,{default:()=>a});var i=s(9440);const r="recentlyViewed",a=function(e){return class extends e{prefs(){return{recentlyViewedTrackingAllowed:!1,masterPid:"",...super.prefs()}}init(){super.init(),this.trackViewedItem(this.prefs().masterPid)}isTrackingAllowed(){return 1!==Number((0,i.e)("dw_dnt"))&&this.prefs().recentlyViewedTrackingAllowed}saveViewedItems(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];(0,i.d)(r,e.join("|"),0,!0)}getViewedItems(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e?e.split("|"):[]}trackViewedItem(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if(!e||!this.isTrackingAllowed())return;let t=this.getViewedItems((0,i.e)(r));t=t.filter((t=>t!==e)),t.unshift(e),t.length>12&&(t=t.slice(1,12)),this.saveViewedItems(t)}}}}}]);