<commit_before>%fieldset
  %div#aga_member_search
    %h3 AGA Membership
    %p If this attendee is an AGA Member, please locate their member record using the search below. You can search by name or by ID.

    %div.search-input
      %label{ :for => "aga_member_search_input" }
        Search:
      %input#aga_member_search_input{ :autofocus => true, :placeholder => "Go Seigen" }

      %p.initially-hidden.searching-message Searching&hellip;

    %div.search-results

  %div#not_an_aga_member
    %p
      = link_to "This attendee is not an AGA member",
        url_for(request.params.merge({:aga_id => 'none'})), class: 'button'
    %div.help-text
      %p AGA Membership is required to play in AGA tournaments, but not for other Congress activities.
      %p You can #{link_to "join the AGA", "https://www.usgo.org/members/join"} or manage your membership at the #{link_to "AGA Members / Chapters Area", "https://www.usgo.org/members"}.


:javascript
  const memberSearch = document.getElementById('aga_member_search');
  const searchResultsContainer = memberSearch.querySelector('.search-results');
  const input = memberSearch.querySelector('input');
  const searchingMessage = memberSearch.querySelector('.searching-message');

  // Search the AGA Members app for either a name or ID
  const searchMembers = async () => {
    if (!input.value) {
      return;
    }

    const url = `/api/mm/members/${encodeURIComponent(input.value)}`;
    const options = {
      method: 'GET'
    };

    const response = await fetch(url, options);
    const { payload } = await response.json();

    const results = payload.rows || [payload.row];

    if (results.length) {
      displayResults(results)
    } else {
      displayNoResults();
    }
  }

  const displayNoResults = results => {
    displaySearchingMessage(false);
    searchResultsContainer.innerHTML = 'No results found.';
  }

  const displayResults = results => {
    displaySearchingMessage(false);
    searchResultsContainer.innerHTML = '';
    const searchResultsTable = document.createElement('table');
<commit_msg>Disable Searching... when no input is present.<commit_after>%fieldset
  %div#aga_member_search
    %h3 AGA Membership
    %p If this attendee is an AGA Member, please locate their member record using the search below. You can search by name or by ID.

    %div.search-input
      %label{ :for => "aga_member_search_input" }
        Search:
      %input#aga_member_search_input{ :autofocus => true, :placeholder => "Go Seigen" }

      %p.initially-hidden.searching-message Searching&hellip;

    %div.search-results

  %div#not_an_aga_member
    %p
      = link_to "This attendee is not an AGA member",
        url_for(request.params.merge({:aga_id => 'none'})), class: 'button'
    %div.help-text
      %p AGA Membership is required to play in AGA tournaments, but not for other Congress activities.
      %p You can #{link_to "join the AGA", "https://www.usgo.org/members/join"} or manage your membership at the #{link_to "AGA Members / Chapters Area", "https://www.usgo.org/members"}.


:javascript
  const memberSearch = document.getElementById('aga_member_search');
  const searchResultsContainer = memberSearch.querySelector('.search-results');
  const input = memberSearch.querySelector('input');
  const searchingMessage = memberSearch.querySelector('.searching-message');

  // Search the AGA Members app for either a name or ID
  const searchMembers = async () => {
    if (!input.value) {
      displaySearchingMessage(false);
      return;
    }

    const url = `/api/mm/members/${encodeURIComponent(input.value)}`;
    const options = {
      method: 'GET'
    };

    const response = await fetch(url, options);
    const { payload } = await response.json();

    const results = payload.rows || [payload.row];

    if (results.length) {
      displayResults(results)
    } else {
      displayNoResults();
    }
  }

  const displayNoResults = results => {
    displaySearchingMessage(false);
    searchResultsContainer.innerHTML = 'No results found.';
  }

  const displayResults = results => {
    displaySearchingMessage(false);
    searchResultsContainer.innerHTML = '';
    const searchResultsTable = document.createElement('table');

{'fraction_non_alphanumeric': 0.11630101439018636, 'fraction_numerical': 0.00047180938900684123, 'mean_word_length': 3.482029598308668, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, 'https://': 4, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4817890', 'n_tokens_mistral': 1234, 'n_tokens_neox': 1205, 'n_words': 339}