const TEXT_MAX_LINE_HEIGHT=48;var LEFT_PLUS_RIGHT_MARGIN=36;function getScale(logoSvgContainer,logoComponentContainer,renderWidth,renderHeight){var componentWidth=logoComponentContainer.parentElement.style.width?parseInt(logoComponentContainer.parentElement.style.width,10):document.documentElement.offsetWidth-LEFT_PLUS_RIGHT_MARGIN;var componentHeight=parseInt(logoComponentContainer.parentElement.style.height||logoComponentContainer.parentElement.style.minHeight||TEXT_MAX_LINE_HEIGHT,10);var availableComponentWidth=componentWidth*parseInt(logoSvgContainer.style.width,10)/100;var availableComponentHeight=componentHeight*parseInt(logoSvgContainer.style.height,10)/100;var scaleWidth=availableComponentWidth/renderWidth;var scaleHeight=availableComponentHeight/renderHeight;var scale=Math.min(scaleWidth,scaleHeight);return scale}(function($){function adjust(onScaled){$('[data-specific-kind=LOGO]').each(function(index,logoComponentContainer){var shadowRenderSpan=logoComponentContainer.querySelector('[data-shadow-render]');if(!shadowRenderSpan||!shadowRenderSpan.offsetWidth){return}var renderWidth=shadowRenderSpan.offsetWidth;var renderHeight=shadowRenderSpan.offsetHeight;var logoContainer=logoComponentContainer.querySelector('[data-logo-container]');var logoSvgContainer=logoContainer&&logoContainer.firstChild;var textDiv=logoComponentContainer.querySelector('.tinyMceContent');var logoContainer=logoComponentContainer.querySelector('[data-logo-container]');var containerWidth=logoContainer.offsetWidth;var containerHeight=logoContainer.offsetHeight;var scale=getScale(logoSvgContainer,logoComponentContainer,renderWidth,renderHeight);logoContainer.querySelector('h1').style.setProperty('font-size',1000*scale+'px');if(onScaled)onScaled()})}var scaledCounter=0;var intervalId;function processFn(){if(scaledCounter===2){clearInterval(intervalId);return}var scaled=false;adjust(function(){scaled=true});if(scaled){scaledCounter++}}try{processFn()}catch(e){console.log('logo failed to initialize',e)}intervalId=setInterval(processFn,50);setTimeout(function(){clearInterval(intervalId)},30000);window.onresize=function(){adjust()}}(oneJQuery));