<?php

$configHelper = $this->helper('Wyomind\ElasticsearchLayeredNavigation\Helper\Config');
$dataHelper = $this->helper('Wyomind\ElasticsearchCore\Helper\Data');
$designHelper = $this->helper('Wyomind\ElasticsearchCore\Helper\Design');
$themeHelper = $this->helper('Wyomind\ElasticsearchCore\Helper\Theme');
$storeId = $dataHelper->getCurrentStoreId();
$mediaUrl = $themeHelper->getMediaBaseUrl($storeId);

$isLayerUpdateEnabled = $configHelper->isLayerUpdateEnabled($block->getType(), $storeId);
$hideLayerValues = false;
if ($isLayerUpdateEnabled) {
    $hideLayerValues = $configHelper->getLayerUpdateMethod($block->getType(), $storeId) == 0;
}

$loaderImage = $designHelper->getLoaderImage($storeId);

?>
<style>
    <?php if ($hideLayerValues): ?>
    div.eln-filter-content a.filter-option.disabled,
    div.eln-filter-item[attribute-code=categories] li.disabled {
        display: none !important;
    }
    <?php endif; ?>
    <?php if ($loaderImage != "") : ?>
    div.eln-loader, div.eln-main-loader, div.loader, div.eln-infinite-scroll-loader {
        background-image:  url('<?= $block->escapeUrl($mediaUrl.'/wyomind/elasticsearch/'.$loaderImage) ?>') !important;
    }
    <?php endif; ?>

</style>
