<?php
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
?>
<?php /** @var $block \Magento\Swatches\Block\Product\Renderer\Configurable */ ?>
<div class="swatch-opt-<?php /* @escapeNotVerified */ echo $block->getProduct()->getId() ?>"></div>
<script>
    require(["jquery", "jquery/ui", "Magento_Swatches/js/swatch-renderer"], function ($) {
		$('.swatch-opt-<?php /* @escapeNotVerified */ echo $block->getProduct()->getId() ?>').each(function(){
			if(!$(this).is(':empty')) return;
			$(this).SwatchRenderer({
				selectorProduct: '.product-item-details',
				onlySwatches: true,
				enableControlLabel: false,
				numberToShow: <?php /* @escapeNotVerified */ echo $block->getNumberSwatchesPerProduct(); ?>,
				jsonConfig: <?php /* @escapeNotVerified */ echo $block->getJsonConfig(); ?>,
				jsonSwatchConfig: <?php /* @escapeNotVerified */ echo $block->getJsonSwatchConfig(); ?>,
				mediaCallback: '<?php /* @escapeNotVerified */ echo $block->getMediaCallback() ?>'
			});
		});
    });
</script>
