<ul id="regulatorList">
  <li class="custom-filter-item">Item 1</li>
  <li class="custom-filter-item">Item 2</li>
  <li class="custom-filter-item">Item 3</li>
  <li class="custom-filter-item">Item 4</li>
  <li class="custom-filter-item">Item 5</li>
  <li class="custom-filter-item">Item 6</li>
  <li class="custom-filter-item">Item 7</li>
  <li class="custom-filter-item">Item 8</li>
  <li class="custom-filter-item">Item 9</li>
  <li class="custom-filter-item">Item 10</li>
  <li class="custom-filter-item">Item 11</li>
  <li class="custom-filter-item">Item 12</li>
</ul>
<div id="moreRegulators"><span>more regulators</span></div>
<style>
.custom-filter-item.hidden { display: none !important; }
</style>
<script>
document.addEventListener('DOMContentLoaded', function() {
  const regulatorList = document.getElementById('regulatorList');
  const moreRegulators = document.getElementById('moreRegulators');
  const items = regulatorList.querySelectorAll('.custom-filter-item');
  const SHOW_COUNT = 10;

  function hideExtraItems() {
    items.forEach((item, i) => {
      if (i >= SHOW_COUNT) {
        item.classList.add('hidden');
      } else {
        item.classList.remove('hidden');
      }
    });
  }

  function showAllItems() {
    items.forEach(item => item.classList.remove('hidden'));
  }

  hideExtraItems();

  moreRegulators.addEventListener('click', function() {
    if (this.classList.contains('expanded')) {
      hideExtraItems();
      this.classList.remove('expanded');
      this.querySelector('span').textContent = 'more regulators';
    } else {
      showAllItems();
      this.classList.add('expanded');
      this.querySelector('span').textContent = 'less regulators';
    }
  });
});
</script>
