var TF_Responsive_Controls=function(){function e(){this.initEvents()}var o=e.prototype;return o.initEvents=function(){var t=this;document.addEventListener("mouseover",function(o){t.onItemEnter(o)}),document.addEventListener("mouseout",function(o){t.onItemExit(o)}),document.addEventListener("click",function(o){this.onCloseOutside(o),this.onOpenBreakpointsDropdown(o),this.onSelectBreakpoint(o)}.bind(this))},o.onItemEnter=function(o){o=o.target.closest(".control-group");o&&o.querySelector(".nr-responsive-control:not(.compact)")&&o.classList.add("tf-responsive-control-top-visible")},o.onItemExit=function(o){o.target.closest(".control-group.tf-responsive-control-top-visible")||document.querySelectorAll(".control-group.tf-responsive-control-top-visible").forEach(function(o){o.classList.remove("tf-responsive-control-top-visible")})},o.onCloseOutside=function(o){o.target.closest(".nr-responsive-control--item--top--breakpoint--switcher--dropdown")||this.closeAllInstances()},o.closeAllInstances=function(){document.querySelectorAll(".nr-responsive-control--item--top--breakpoint--switcher--dropdown.is-open").forEach(function(o){o.classList.remove("is-open")})},o.onOpenBreakpointsDropdown=function(o){o=o.target.closest(".nr-responsive-control--item--top--breakpoint--switcher--toggle");o&&o.nextElementSibling.classList.toggle("is-open")},o.onSelectBreakpoint=function(o){var t=o.target.closest(".nr-responsive-control--item--top--breakpoint--switcher--dropdown--item");if(t){if(o.preventDefault(),t.classList.contains("is-active"))return!1;o=t.dataset.type;e.changeAllResponsiveControlsBreakpoints(o),e.focusOnFirstInput(t)}},e.changeAllResponsiveControlsBreakpoints=function(o){document.querySelectorAll(".nr-responsive-control-group.nr-responsive-control-group--active").forEach(function(o){o.classList.remove("nr-responsive-control-group--active")}),document.querySelectorAll(".nr-responsive-control-group.device-"+o).forEach(function(o){o.classList.add("nr-responsive-control-group--active")})},e.focusOnFirstInput=function(o){},e}();document.addEventListener("DOMContentLoaded",function(){new TF_Responsive_Controls});

