class AutoScaleSchemes{static doingMain=!1;static scaleAmountNeededToFit(e,t=0){const s=e.parentElement.clientWidth-2*t,a=e.parentElement.clientHeight-2*t;return Math.min(s/e.clientWidth,a/e.clientHeight)}static fitToParent(e,t){var s;e.classList.contains("tabs")||("IMG"==e.tagName&&(e.style.maxWidth="100%"),s=AutoScaleSchemes.scaleAmountNeededToFit(e,t),e.parentElement.style.marginTop=$(e).css("margin-top"),e.style.marginTop="0px",e.parentElement.style.overflow="hidden",e.style.transformOrigin="0 0","rtl"==$("body").attr("dir")&&(e.style.transformOrigin="top right"),e.style.transform=`translate(${t}px, ${t}px) scale(${s})`,t=e.clientHeight,e.clientWidth,e.parentElement.style.backgroundColor=window.getComputedStyle(e,null).backgroundColor,e.style.marginBottom=-t*(1-s)+"px")}static clear(){$(".auto-scale-resized").each(function(){this.style.maxWidth="",this.style.maxHeight="",this.style.transformOrigin="",this.style.transform="",this.style.marginTop="",this.parentElement.style.overflow="scroll",this.parentElement.style.maxHeight="",this.parentElement.style.backgroundColor="",this.style.marginBottom="",$(this).removeClass("auto-scale-resized")})}static clearone(e){e.style.maxWidth="",e.style.maxHeight="",e.style.transformOrigin="",e.style.transform="",e.style.marginTop="",e.parentElement.style.overflow="scroll",e.parentElement.style.maxHeight="",e.parentElement.style.backgroundColor="",e.style.marginBottom="",$(e).removeClass("auto-scale-resized")}static clickscheme(){this.classList.contains("auto-scale-resized")?AutoScaleSchemes.clearone(this):AutoScaleSchemes.main()}static waitForLazyLoad(e,t){let s=setInterval(()=>{e.classList.contains("loaded")&&(t.resolve(),clearInterval(s))},500)}static processScheme(e,t,s=!0){e.removeEventListener("click",AutoScaleSchemes.clickscheme,!0),e.classList.add("auto-scale-resized"),s&&(e.parentElement.style.maxHeight=e.getBoundingClientRect().height+"px"),AutoScaleSchemes.fitToParent(e,t),document.querySelector("body").offsetWidth<992&&e.addEventListener("click",AutoScaleSchemes.clickscheme,!0)}static main(){if(!AutoScaleSchemes.doingMain){console.log("autoscaling"),AutoScaleSchemes.doingMain=!0;requestAnimationFrame(function(){var s,e=window?.b2brokerAutoscaleschemes?.selectorList,a=document.querySelectorAll(e);for(let t=0;t