{* @compiler:inline-only *}
{function renderVariationSizes}
   <div class="size-convertion-tabs {$tabType}-tabs" data-tabs="{$tabType}">
      {foreach $conversionTypes as $conversionType}
         {if $label_id == {$cfg.cyklospeciality_tpl.variation_color_labels_id}}
            {if $conversionType@iteration == 1}
               <div class="filter-colors">
                  {foreach $label.values as $id => $value}
                     {if $value.conversion_type != $conversionType}
                        {continue}
                     {/if}
                     <label class="color-label size-convertion-control" for="filter_variant_size_convertion[{$label.convertor}][{$id}]">
                        <input type="checkbox" name="dynamic_filter[variationsSizeConvertion][{$label.convertor}][value][]"
                               value="{$value.conversion_id}"
                               id="filter_variant_size_convertion[{$label.convertor}][{$id}]" class="custom-control-input"
                               data-filter-input="{$inputId}"
                               {foreach $selectedVariationsSizeConvertion[$label.convertor].value as $selectedId}{if $selectedId == $value.conversion_id}checked{break}{/if}{/foreach}
                               data-tracking-filter='{get_gtm_data encode=true type='ecommerce' method='ApplyFilterVariations' data=['id' => $id, 'label' => $label]}'>

                        {if $indexed and $urlGenerator}
                           {$generated = $urlGenerator->getVariationUrl($id_label, $id, $value.filter_url)}
                           <a class="color" href="{$generated.url}" title="{$value.name}" style="background-image: url('{$value.conversion_value_description}')">{$value.name}</a>
                        {else}
                           <span class="color" title="{$value.name}" style="background-image: url('{$value.conversion_value_description}')">{$value.name}</span>
                        {/if}

                        {*
                           ID v data-filter-count pouziva metoda filter.MultiItem.updateCount() ve wpj.indexedFilter.js
                        *}
                        <span style="display: none;">(<small data-filter-count="{$id}">{$value.count}</small>)</span>
                     </label>
                  {/foreach}
               </div>
            {/if}
         {else}
            <a href="#{$tabType}-tabs-{$conversionType|strip_accent}" class="nav-link{if $conversionType@first} active{/if}"
               data-tab-target="#tabs-{$conversionType|strip_accent}" data-tabs="nav">
               {$conversionType|upper}
            </a>
            <div class="size-convertion-tab-pane{if $conversionType@first} active{/if}" id="{$tabType}-tabs-{$conversionType|strip_accent}"
                 data-tabs="content">
               <div>
                  {foreach $label.values as $id => $value}
                     {if $value.conversion_type != $conversionType}
                        {continue}
                     {/if}
                     <div class="filter-secondary-check">
                        <label class="custom-control size-convertion-control custom-checkbox{if $secondaryCheck} secondary-check check-{$value.conversion_id}{/if}"
                               for="filter_variant_size_convertion[{$label.convertor}][{$id}]">
                           {if $secondaryCheck}
                              <input type="checkbox" name="{$inputId}_0"
                                     class="custom-control-input" data-filter-input="{$inputId}">
                           {else}
                              <input type="checkbox" name="dynamic_filter[variationsSizeConvertion][{$label.convertor}][value][]"
                                     value="{$value.conversion_id}"
                                     id="filter_variant_size_convertion[{$label.convertor}][{$id}]" class="custom-control-input"
                                     data-filter-input="{$inputId}"
                                     {foreach $selectedVariationsSizeConvertion[$label.convertor].value as $selectedId}{if $selectedId == $value.conversion_id}checked{break}{/if}{/foreach}
                                     data-tracking-filter='{get_gtm_data encode=true type='ecommerce' method='ApplyFilterVariations' data=['id' => $id, 'label' => $label]}'>
                           {/if}

                           <span class="custom-control-indicator"></span>
                           <span class="custom-control-text"{if $secondaryCheck} title="{$conversionType|upper} {$value.name}"{/if}>
                              {if $indexed and $urlGenerator and !$secondaryCheck}
                                 {$generated = $urlGenerator->getVariationUrl($id_label, $value.conversion_id, $value.filter_url)}
                                 <a href="{$generated.url}"><span>{$conversionType|upper} </span>{$value.name}</a>

                              {elseif !$secondaryCheck}
                                 <span>{$conversionType|upper} </span>{$value.name}
                              {/if}
                              <small>(<span class="filter-count" data-filter-count="{$id}">{$value.count}</span>)</small>
                           </span>
                        </label>
                     </div>
                  {/foreach}
               </div>
            </div>
         {/if}
      {/foreach}
   </div>
{/function}

{if $id_convertor}
   {get_convertor_types id_convertor=$id_convertor assign='conversionTypes'}
{/if}

{block "filter-conversion-content"}
   <div class="{if $focus || $isPrimary}filter-row filter-variations filter-variations-size-convertion{else}secondary-filter-item secondary-filter-item-1{/if}">
      {if $filter_openers}
         <button type="button" class="filter-label btn form-control" data-opener="[data-opener-var-size-convertion-1]">{$label.name}</button>
         <div class="opener-content opener-content-size-convertion" data-opener-var-size-convertion-1>
            {renderVariationSizes tabType='size-convertion-filter' label_id=$label.id}
         </div>
      {else}
         <p class="filter-label">{$label.name}</p>
         <div>
            {renderVariationSizes tabType='size-convertion-filter-focus' label_id=$label.id}
         </div>
      {/if}
   </div>
{/block}

