<?php

function renderEmbedElement($b, $element, $custom_classes, $elStyles, $colors, $viewport)
{
	$data = $element['data'];
	$user_data = $data['user_data'];
	$elMarkup = "";

	if (isset($user_data['embed']) && strlen($user_data['embed'])) {
		$isEmbedScrollSet = isset($user_data['isEmbedScroll']) ? $user_data['isEmbedScroll'] : FALSE;
		$scrollFinalOutput = $isEmbedScrollSet ? 'none' : 'auto';
		$elStyles .= '--disabled-embed-scroll: '.$scrollFinalOutput.'';
		$elMarkup .= '<div class="'.$b.'__element '.$b.'__element--'.$element["id"].' '.$b.'__element--embed '.$custom_classes.'" style="'.$elStyles.'">'.$user_data['embed'].'</div>';
	}

	return $elMarkup;
}
