{% set isSurveyEnabled = isEnabledFeature('web.registration.survey') %}
{% set surveyModalId = "RegistrationSurveyModal" %}
{% set user = app.user %}
{% set userName = user ? user.fullname : '' %}
{% set userEmail = user ? user.email : '' %}
{% set userPhone = user ? user.phoneNumber : null %}
{% set formId = "quickLeadWizard" %}
{% set collapseTitle = ''%}
{% set isCompaniesTab = currentTab is defined and currentTab == 'companies' %}
{% set isCompaniesProfile = isCompanyProfile is defined and isCompanyProfile %}
{% if app.request.attributes.get('_route') in ['aqarmap_agents_search', 'aqarmap_agents_search_with_location', 'aqarmap_user_listings'] %}
{% if isCompaniesTab or isCompaniesProfile %}
{% set collapseTitle = 'agents_search_page.company_user_lead_message'|trans %}
{% else %}
{% set collapseTitle = 'agents_search_page.agent_user_lead_message'|trans %}
{% endif %}
{% else %}
{% set collapseTitle = 'listing.contact_seller_lead'|trans %}
{% endif %}
<div class="modal bd-example-modal-lg countryCode quick-lead-modal small easy-access modal-box px-0" id="quick-lead-modal" tabindex="-1" role="dialog" {% if app.user %} ng-init="setLoggedInUser({
'name': '{{ userName }}',
'email': '{{ userEmail }}',
'phone': '{{ userPhone }}',
{# 'countryCode': '{{ user.mainNumber.phone.countryCode }}' #}
})" {% else %} ng-init="setLoggedInUser(null)" {% endif %}>
<div class="modal-dialog" role="document">
<div class="modal-content modal-lg modal-box__content">
<div class="modal-box__header modal-box__header_borderd-sm-0 modal-lg ">
<span class="modal-box__title d-md-block d-none">
{{collapseTitle}}
</span>
<button type="button" class="modal-close modal-box__close" ng-click="cancelQuickLead('{{isSurveyEnabled}}' , '{{surveyModalId}}')" data-dismiss="modal">
<img src="/images/close_dark_gray.svg" width="24" height="24"/>
</button>
</div>
<div class="modal-box__body modal-box__body_pt-sm-0 ">
<form class="wizard-form" id="{{formId}}" ng-init="setFormId('{{formId}}')">
<div class="modal-listing-contact">
<div class="full-height">
<div class="col-xs-12 contact-container full-height" ng-init="setAutoGeneratedEmailStatus({{ isEnabledFeature('web.small.registration') }})">
<input type="hidden" ng-init="formData.quickRegistrationSource='multi-step';"/>
<div class="form-group wizard-form__group wizard-form__step" step="1" gtm-action="gtm-action-quick-register-name-skipped" gtm-step="name">
{% set namePlaceholder = 'layout.static_placeholders.name_placeholder'|trans %}
<div class="form-group wizard-form__group">
<p class="wizard-form__label">{{ 'popup_form.enter_name'|trans }}</p>
<input class="form-control wizard-form__input" type="text" id="lead_name" ng-model="formData['fullName']" ng-init="formData['fullName']='{{userName}}';" minlength="3" placeholder="{{namePlaceholder}}" wizard-input-name="fullName">
<span class="text-danger name-error formError"></span>
</div>
</div>
<div class="form-group wizard-form__group wizard-form__step" step="2" gtm-action="gtm-action-quick-register-email-skipped" gtm-step="email">
<p class="wizard-form__label wizard-form__label_sub-label">{{ 'popup_form.last_step'|trans }}</p>
<p class="wizard-form__label">{{ 'popup_form.enter_email'|trans }}</p>
<input class="form-control wizard-form__input" type="email" placeholder="email@domain.com" id="lead_email" ng-model="formData['email']" ng-init="formData['email']='{{userEmail}}';" wizard-input-name="email">
<span class="text-danger email-error formError"></span>
</div>
<div class="form-group wizard-form__group wizard-form__step" step="0" gtm-step="phone_number">
{% set phonePlaceholder = 'popup_form.register_popup_phone_number'|trans ~ '*' %}
<p class="wizard-form__label">{{ 'popup_form.enter_number'|trans }}</p>
<div class="form-group wizard-form__group">
<input class="form-control phone wizard-form__input" type="text" inputmode="numeric" placeholder="{{phonePlaceholder}}" id="lead_phone" ng-model="formData['phone[number]']" ng-init="formData['phone[number]'] = '{{userPhone}}'" minlength="7" maxlength="15" wizard-input-name="phone[number]">
<span class="text-danger phone-error formError"></span>
</div>
<input hidden ng-model="formData['phone[country_code]']" type="text" id="leadCountryCode" class="form-control" name="lead[countryCode]"/>
</div>
</div>
</div>
</div>
<div class="modal-box__footer modal-box__footer_sm-borderless text-center">
<div class="wizard-action w-100">
<div class="form-group wizard-form__group mb-0 mx-auto w-100 wizard-form__next-btn wizard-form__btn ">
<button ng-click="submitWizard('next')" class="btn btn-block rounded-pill btn-primary cta-btn">
{{ 'popup_form.submit'|trans }}</button>
</div>
<div class="form-group wizard-form__group lead-submit mb-0 mx-auto w-100">
<button ng-click="submitWizard()" class="custom-collapse_btn-submit wizard-form__submit-btn wizard-form__btn btn-submit btn btn-block rounded-pill btn-primary cta-btn"></button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>