<commit_before><% address_id = address_type.chars.first %>
<div class="inner" data-hook=<%="#{address_type}_inner" %>>
  <p class="field" id=<%="#{address_id}firstname" %>>
    <%= form.label :firstname, t('spree.first_name') %><span class="required">*</span><br />
    <%= form.text_field :firstname, class: 'required', autocomplete: address_type + ' given-name', required: true, autofocus: true %>
  </p>

  <p class="field" id=<%="#{address_id}lastname" %>>
    <%= form.label :lastname, t('spree.last_name') %><span class="required">*</span><br />
    <%= form.text_field :lastname, autocomplete: address_type + ' family-name', required: true %>
  </p>

  <% if Spree::Config[:company] %>
    <p class="field" id=<%="#{address_id}company" %>>
      <%= form.label :company, t('spree.company') %><br />
      <%= form.text_field :company, autocomplete: address_type + ' organization' %>
    </p>
  <% end %>

  <p class="field" id=<%="#{address_id}address1" %>>
    <%= form.label :address1, t('spree.street_address') %><span class="required">*</span><br />
    <%= form.text_field :address1, class: 'required', autocomplete: address_type + ' address-line1',  required: true %>
  </p>

  <p class="field" id=<%="#{address_id}address2" %>>
    <%= form.label :address2, I18n.t('spree.street_address_2') %><br />
    <%= form.text_field :address2, autocomplete: address_type + ' address-line2' %>
  </p>

  <p class="field" id=<%="#{address_id}city" %>>
    <%= form.label :city, t('spree.city') %><span class="required">*</span><br />
    <%= form.text_field :city, class: 'required', autocomplete: address_type + ' address-level2',  required: true %>
  </p>

  <p class="field" id=<%="#{address_id}country" %>>
    <%= form.label :country_id, t('spree.country') %><span class="required">*</span><br />
    <span id=<%="#{address_id}country-selection" %>>
      <%= form.collection_select :country_id, available_countries, :id, :name, {},
          class: 'required',
          autocomplete: address_type + ' country-name',
          required: true
        %>
    </span>
  </p>

  <% if Spree::Config[:address_requires_state] %>
    <p class="field" id=<%="#{address_id}state" %>>
      <% have_states = !address.country.states.empty? %>
      <%= form.label :state, t('spree.state') %><span class='required' id=<%="#{address_id}state-required"%>>*</span><br/>

      <span class="js-address-fields" style="display: none;">
        <%=
          form.collection_select(
            :state_id, address.country.states, :id, :name,
            {include_blank: true},
            {
              class: have_states ? 'required' : '',
              style: have_states ? '' : 'display: none;',
              disabled: !have_states,
              autocomplete: address_type + ' address-level1',
              required: true
            })
          %>
        <%=
          form.text_field(
            :state_name,
            class: !have_states ? 'required' : '',
            style: have_states ? 'display: none;' : '',
            disabled: have_states,
            autocomplete: address_type + ' address-level1',
            required: true
          )
        %>
      </span>
      <noscript>
        <%= form.text_field :state_name, class: 'required', autocomplete: address_type + ' address-level1',  required: true %>
      </noscript>
    </p>
  <% end %>

  <p class="field" id=<%="#{address_id}zipcode" %>>
    <%= form.label :zipcode, t('spree.zip') %><% if address.require_zipcode? %><span class="required">*</span><% end %><br />
    <%= form.text_field :zipcode, class: "#{'required' if address.require_zipcode?}", autocomplete: address_type + ' postal-code',  required: true %>
  </p>

  <p class="field" id=<%="#{address_id}phone" %>>
    <%= form.label :phone, t('spree.phone') %><% if address.require_phone? %><span class="required">*</span><% end %><br />
    <%= form.phone_field :phone, class: "#{'required' if address.require_phone?}", autocomplete: address_type + ' home tel', required: true, pattern: '^([+]?\d{1,2}[-\s]?|)\d{3}[-\s]?\d{3}[-\s]?\d{4}$' %>
  </p>

  <% if Spree::Config[:alternative_shipping_phone] %>
    <p class="field" id=<%="#{address_id}altphone" %>>
      <%= form.label :alternative_phone, t('spree.alternative_phone') %><br />
      <%= form.phone_field :alternative_phone, autocomplete: address_type + ' tel'%>
    </p>
  <% end %>
</div><commit_msg>Remove the pattern from the phone field<commit_after><% address_id = address_type.chars.first %>
<div class="inner" data-hook=<%="#{address_type}_inner" %>>
  <p class="field" id=<%="#{address_id}firstname" %>>
    <%= form.label :firstname, t('spree.first_name') %><span class="required">*</span><br />
    <%= form.text_field :firstname, class: 'required', autocomplete: address_type + ' given-name', required: true, autofocus: true %>
  </p>

  <p class="field" id=<%="#{address_id}lastname" %>>
    <%= form.label :lastname, t('spree.last_name') %><span class="required">*</span><br />
    <%= form.text_field :lastname, autocomplete: address_type + ' family-name', required: true %>
  </p>

  <% if Spree::Config[:company] %>
    <p class="field" id=<%="#{address_id}company" %>>
      <%= form.label :company, t('spree.company') %><br />
      <%= form.text_field :company, autocomplete: address_type + ' organization' %>
    </p>
  <% end %>

  <p class="field" id=<%="#{address_id}address1" %>>
    <%= form.label :address1, t('spree.street_address') %><span class="required">*</span><br />
    <%= form.text_field :address1, class: 'required', autocomplete: address_type + ' address-line1',  required: true %>
  </p>

  <p class="field" id=<%="#{address_id}address2" %>>
    <%= form.label :address2, I18n.t('spree.street_address_2') %><br />
    <%= form.text_field :address2, autocomplete: address_type + ' address-line2' %>
  </p>

  <p class="field" id=<%="#{address_id}city" %>>
    <%= form.label :city, t('spree.city') %><span class="required">*</span><br />
    <%= form.text_field :city, class: 'required', autocomplete: address_type + ' address-level2',  required: true %>
  </p>

  <p class="field" id=<%="#{address_id}country" %>>
    <%= form.label :country_id, t('spree.country') %><span class="required">*</span><br />
    <span id=<%="#{address_id}country-selection" %>>
      <%= form.collection_select :country_id, available_countries, :id, :name, {},
          class: 'required',
          autocomplete: address_type + ' country-name',
          required: true
        %>
    </span>
  </p>

  <% if Spree::Config[:address_requires_state] %>
    <p class="field" id=<%="#{address_id}state" %>>
      <% have_states = !address.country.states.empty? %>
      <%= form.label :state, t('spree.state') %><span class='required' id=<%="#{address_id}state-required"%>>*</span><br/>

      <span class="js-address-fields" style="display: none;">
        <%=
          form.collection_select(
            :state_id, address.country.states, :id, :name,
            {include_blank: true},
            {
              class: have_states ? 'required' : '',
              style: have_states ? '' : 'display: none;',
              disabled: !have_states,
              autocomplete: address_type + ' address-level1',
              required: true
            })
          %>
        <%=
          form.text_field(
            :state_name,
            class: !have_states ? 'required' : '',
            style: have_states ? 'display: none;' : '',
            disabled: have_states,
            autocomplete: address_type + ' address-level1',
            required: true
          )
        %>
      </span>
      <noscript>
        <%= form.text_field :state_name, class: 'required', autocomplete: address_type + ' address-level1',  required: true %>
      </noscript>
    </p>
  <% end %>

  <p class="field" id=<%="#{address_id}zipcode" %>>
    <%= form.label :zipcode, t('spree.zip') %><% if address.require_zipcode? %><span class="required">*</span><% end %><br />
    <%= form.text_field :zipcode, class: "#{'required' if address.require_zipcode?}", autocomplete: address_type + ' postal-code',  required: true %>
  </p>

  <p class="field" id=<%="#{address_id}phone" %>>
    <%= form.label :phone, t('spree.phone') %><% if address.require_phone? %><span class="required">*</span><% end %><br />
    <% phone_hash = address.require_phone? ? { class: 'required', required: true } : {} %>
    <%= form.phone_field :phone, phone_hash.merge({ autocomplete: address_type + ' home tel' }) %>
  </p>

  <% if Spree::Config[:alternative_shipping_phone] %>
    <p class="field" id=<%="#{address_id}altphone" %>>
      <%= form.label :alternative_phone, t('spree.alternative_phone') %><br />
      <%= form.phone_field :alternative_phone, autocomplete: address_type + ' tel'%>
    </p>
  <% end %>
</div>
{'fraction_non_alphanumeric': 0.2109028960817717, 'fraction_numerical': 0.003975014196479273, 'mean_word_length': 3.342209072978304, 'pattern_counts': {'":': 0, '<': 218, '<?xml version=': 0, '>': 218, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '2266222', 'n_tokens_mistral': 3128, 'n_tokens_neox': 2943, 'n_words': 538}