!function(){"use strict";class e{constructor(e){this.shippingMethod=document.getElementById("shipping_method"),this.shippingMethod&&(this.init(),this.checkIfSelected(),this.events())}init(){this.methodSelector="#shipping_method input[type='radio'][name^='shipping_method']",this.checkoutDiffAddress=document.getElementById("ship-to-different-address-checkbox")}events(){document.addEventListener("click",(e=>{if(e.target&&e.target.matches(this.methodSelector)&&e.target.value){var t=this.isLP(e.target.value);this.lockCheckoutShippingAddress(t),this.lockShipping(t)}}))}isLP(e){return 0===e.indexOf("local_pickup")}checkIfSelected(){var e=document.querySelector(this.methodSelector+'[value^="local_pickup"');e&&e.checked&&(this.lockCheckoutShippingAddress(!0),this.lockShipping(!0))}lockCheckoutShippingAddress(e){this.checkoutDiffAddress&&(e?(this.checkoutDiffAddress.checked=!1,this.checkoutDiffAddress.disabled=!0):this.checkoutDiffAddress.disabled=!1)}lockShipping(e){rey.elements.body.classList.toggle("--lp-active",e)}}document.addEventListener("rey-DOMContentLoaded",(function(t){new e}))}();