<div class="form-group">
   <div class="col-md-6">
      <div class="panel panel-default">
         <div class="panel-heading panel-heading-flex">
            <small class="panel-title">{'countries'|translate:'deliveryDelivery'}</small>
         </div>
         <div class="panel-body">
            <div class="form-group form-group-flex">
               <div class="col-md-12 groups-wrapper">
                  <div class="input-group invert">
                     <select name="restrictions[countries][]" class="selecter"
                             data-autocomplete="countries" data-preload="countries" multiple="multiple">
                        {foreach $tab.data.restrictions.countries as $country}
                           <option value="{$country}" selected>{$country}</option>
                        {/foreach}
                     </select>
                     {$checked = ''}
                     {if $tab.data.restrictions.countries_invert}{$checked = "checked"}{/if}
                     <label class="input-group-addon" title="{'inversionInfo'|translate:'filter'}">
                        <input class="input" type="checkbox" name="restrictions[countries_invert]" value="1" {$checked}>
                        <span class="bi bi-dash-circle-fill"></span>
                     </label>
                  </div>
               </div>
            </div>
         </div>
      </div>
   </div>
   <div class="col-md-6">
      <div class="panel panel-default">
         <div class="panel-heading panel-heading-flex">
            <small class="panel-title">{'users_groups'|translate:'deliveryDelivery'}</small>
         </div>
         <div class="panel-body">
            <div class="form-group form-group-flex">
               <div class="col-md-12 groups-wrapper">
                  <div class="input-group invert">
                     <select name="restrictions[users_groups][]" class="selecter"
                             data-autocomplete="users_groups" data-autocomplete-params="allow_empty=1" data-preload="usersGroups" multiple="multiple">
                        {foreach $tab.data.restrictions.users_groups as $group}
                           <option value="{$group}" selected>{$group}</option>
                        {/foreach}
                     </select>
                     {$checked = ''}
                     {if $tab.data.restrictions.users_groups_invert}{$checked = "checked"}{/if}
                     <label class="input-group-addon" title="{'inversionInfo'|translate:'filter'}">
                        <input class="input" type="checkbox" name="restrictions[users_groups_invert]" value="1" {$checked}>
                        <span class="bi bi-dash-circle-fill"></span>
                     </label>
                  </div>
               </div>
            </div>
         </div>
      </div>
   </div>

   <div class="col-md-6">
      <div class="panel panel-default">
         <div class="panel-heading panel-heading-flex">
            <small class="panel-title">{'users_types'|translate:'deliveryDelivery'}</small>
         </div>
         <div class="panel-body">
            <div class="col-md-12 groups-wrapper">
               <div class="form-group form-group-flex">
                  <div class="input-group invert">
                     <select class="selecter" name="restrictions[user_types][]" multiple='multiple'>
                        <option value="user" {if in_array('user', $tab.data.restrictions.user_types)}selected{/if}>{'user'|translate:'deliveryDelivery'}</option>
                        <option value="anonymous" {if in_array('anonymous', $tab.data.restrictions.user_types)}selected{/if}>{'anonymous'|translate:'deliveryDelivery'}</option>
                        <option value="b2b" {if in_array('b2b', $tab.data.restrictions.user_types)}selected{/if}>{'b2b'|translate:'deliveryDelivery'}</option>
                     </select>
                     {$checked = ''}
                     {if $tab.data.restrictions.user_types_invert}{$checked = "checked"}{/if}
                     <label class="input-group-addon" title="{'inversionInfo'|translate:'filter'}">
                        <input class="input" type="checkbox" name="restrictions[user_types_invert]" value="1" {$checked}>
                        <span class="bi bi-dash-circle-fill"></span>
                     </label>
                  </div>
               </div>
            </div>
         </div>
      </div>
   </div>

   {ifmodule CURRENCIES}
   <div class="col-md-12">
      <div class="panel panel-default">
         <div class="panel-heading panel-heading-flex">
            <small class="panel-title">{'currencies'|translate:'paymentRestrictions'}</small>
         </div>
         <div class="panel-body">
            <div class="form-group form-group-flex">
               <div class="col-md-12 groups-wrapper">
                  <div class="input-group invert">
                     <select name="restrictions[currencies][]" class="selecter"
                             data-autocomplete="currencies" data-autocomplete-params="allow_empty=1" data-preload="currencies"
                             multiple="multiple">
                         {foreach $tab.data.restrictions.currencies as $currency}
                            <option value="{$currency}" selected>{$currency}</option>
                         {/foreach}
                     </select>
                      {$checked = ''}
                      {if $tab.data.restrictions.currencies_invert}{$checked = "checked"}{/if}
                     <label class="input-group-addon" title="{'inversionInfo'|translate:'filter'}">
                        <input class="input" type="checkbox" name="restrictions[currencies_invert]" value="1" {$checked}>
                        <span class="bi bi-dash-circle-fill"></span>
                     </label>
                  </div>
               </div>
            </div>
         </div>
      </div>
   </div>
   {/ifmodule}

   <div class="col-md-12">
      <div class="panel panel-default">
         <div class="panel-heading panel-heading-flex">
            <small class="panel-title">{'languages'|translate:'paymentRestrictions'}</small>
         </div>
         <div class="panel-body">
            <div class="form-group form-group-flex">
               <div class="col-md-12 groups-wrapper">
                  <div class="input-group invert">
                     <select name="restrictions[languages][]" class="selecter"
                             data-autocomplete="languages" data-autocomplete-params="allow_empty=1" data-preload="languages"
                             multiple="multiple">
                         {foreach $tab.data.restrictions.languages as $language}
                            <option value="{$language}" selected>{$language}</option>
                         {/foreach}
                     </select>
                      {$checked = ''}
                      {if $tab.data.restrictions.languages_invert}{$checked = "checked"}{/if}
                     <label class="input-group-addon" title="{'inversionInfo'|translate:'filter'}">
                        <input class="input" type="checkbox" name="restrictions[languages_invert]" value="1" {$checked}>
                        <span class="bi bi-dash-circle-fill"></span>
                     </label>
                  </div>
               </div>
            </div>
         </div>
      </div>
   </div>
</div>

<div class="panel panel-default">
   <div class="panel-heading {if empty($tab.data.restrictions.productsFilter)}collapsed{/if}" data-toggle="collapse"
        data-target="#productsFilter">
      {'productsFilter'|translate:'deliveryRestrictions'}
      <span class="glyphicon glyphicon-minus-sign"></span>
   </div>
   <div id="productsFilter" class="panel-collapse collapse {if !empty($tab.data.restrictions.productsFilter)}in{/if}">
      <div class="panel-body">{$name = 'restrictions'}
         {include 'block.productsFilter.tpl' filter=$tab.data.restrictions.productsFilter filterName=$name filterInputName=$name|cat:'[productsFilter]'}
      </div>
   </div>
</div>
