var FPF_Dimensions_Control=function(){function n(){this.dimensionsControl=".fpf-dimensions-control",this.dimensionsControlItem='.fpf-dimensions-control-item input[type="number"]',this.initEvents()}var t=n.prototype;return t.initEvents=function(){document.addEventListener("input",function(n){this.handleInputChanges(n)}.bind(this)),document.addEventListener("click",function(n){this.handleLinkedButton(n)}.bind(this))},t.handleInputChanges=function(n){var t=n.target.closest(".fpf-control-input-item.dimensions");if(t&&this.dimensionsIsLinked(t)){var i=t.value;t.closest(this.dimensionsControl).querySelectorAll(this.dimensionsControlItem).forEach(function(n){n.value=i})}},t.dimensionsIsLinked=function(n){var t=n.closest(this.dimensionsControl),i=t.querySelector(".fpf-dimensions-link-button input");return!!t.classList.contains("is-linked")||!(!i||"true"!=i.value)},t.handleLinkedButton=function(n){var t=n.target.closest(".fpf-dimensions-link-button");if(t){var i=t.closest(this.dimensionsControl),e=t.querySelector("input");"true"==e.value?(t.classList.remove("is-active"),e.value="false",i.classList.remove("is-linked")):(i.classList.add("is-linked"),t.classList.add("is-active"),e.value="true"),n.preventDefault()}},n}();document.addEventListener("DOMContentLoaded",function(n){new FPF_Dimensions_Control});

