{% from 'utils.html.twig' import ico %}
{# MODO DE EXIBIÇÃO TIPO PESSOA #}
{% if infoType is not defined %}
{% set infoType = '' %}
{% endif %}
{% set infoTypeEdit = (
receiverEdit ? (infoType ? receiverPartnerEdit : receiverEdit) : false
) %}
<div class="cp-cols">
{% if infoType is empty %}
{# KIND #}
<div class="cp cp-3">
<label for="receiver-person-type">{{ getLanguage('person', 'receiver') }}{{ req|raw }}</label>
{# EDIT #}
{% if infoTypeEdit %}
{% if infoTypeEdit.personType == enum('ReceiverEnum::PERSON') %}
{% set key = 'natural' %}
{% elseif infoTypeEdit.personType == enum('ReceiverEnum::COMPANY') %}
{% set key = 'juridical' %}
{% endif %}
<select class="js--input-disabled" disabled>
<option>{{ getLanguage(key, 'receiver') }}</option>
</select>
{# REGISTER #}
{% else %}
<select id="receiver-person-type" name="personType" class="js--tipo-pessoa-select custom-select" required>
<option value="{{ enum('ReceiverEnum::PERSON') }}">{{ getLanguage('natural', 'receiver') }}</option>
<option value="{{ enum('ReceiverEnum::COMPANY')}}">{{ getLanguage('juridical', 'receiver') }}</option>
</select>
{% endif %}
</div>
{% endif %}
{# DOCUMENT NUMBER #}
<div id="document-type-person" class="cp cp-3">
<label for="{{ (infoType) ? 'partner-' }}receiver-document">
<span>CPF{{ req|raw }}</span>
<span>CNPJ{{ req|raw }}</span>
 
</label>
<input type="text" id="{{ (infoType) ? 'partner-' }}receiver-document"
name="documentNumber{{ infoType }}" class="js--input-form js--input-disabled" class="mask-cpf-cnpj"
placeholder="{{ getLanguage('enter_the_number', 'receiver') }}"
value="{{ infoTypeEdit? infoTypeEdit.documentNumber }}"
{{ infoTypeEdit and infoTypeEdit.documentNumber is not empty ? 'readonly' }} required>
</div>
{# BIRTH DATE #}
{% if ((infoTypeEdit and receiverEdit.personType == enum('ReceiverEnum::PERSON')) or infoType is not empty)
or not infoTypeEdit %}
<div id="birthdate-type-person" class="cp cp-3">
<label for="{{ (infoType) ? 'partner-' }}receiver-birth-date">{{ getLanguage('birth_date', 'receiver') }}{{ req|raw }}</label>
<input type="text" id="{{ (infoType) ? 'partner-' }}receiver-birth-date"
name="birthDate{{ infoType }}" class="mask-date js--input-form js--input-disabled"
value="{{ infoTypeEdit? infoTypeEdit.birthDate }}"
{{ infoTypeEdit and infoTypeEdit.birthDate is not empty ? 'readonly' }} required>
</div>
{% endif %}
</div>
{# CONFIRMED #}
<div id="wrap-analisis" class="cp-cols" data-status="hidden">
{# LOADING #}
{% if not infoTypeEdit %}
<div class="box-form-warning box-loading">
<p>{{ getLanguage('data_analysing_wait', 'receiver') }}…</p>
<i class="loader">{{ ico('loader-wish') }}</i>
</div>
<div class="box-form-warning box-response">
<p id="analyze_error_response">…</p>
</div>
{% endif %}
{# FULL NAME #}
<div id="name-type-person" class="cp cp-2">
<label for="{{ (infoType) ? 'partner-' }}receiver-name">
<span>{{ getLanguage('full_name', 'receiver') }}{{ req|raw }}</span>
<span>{{ getLanguage('company_name', 'receiver') }}{{ req|raw }}</span>
 
</label>
<input type="text" id="{{ (infoType) ? 'partner-' }}receiver-name"
name="legalName{{ infoType }}" class="js--input-form js--input-disabled"
placeholder="{{ getLanguage('receiver_name', 'receiver') }}"
value="{{ infoTypeEdit? infoTypeEdit.legalName }}"
{{ infoTypeEdit and infoTypeEdit.legalName is not empty ? 'readonly' }} required>
</div>
{% if ((infoTypeEdit and receiverEdit.personType == enum('ReceiverEnum::COMPANY')) and infoType is empty)
or ( not infoTypeEdit and infoType is empty ) %}
{# FANTASY NAME #}
<div id="trading-name-type-person" class="cp cp-2">
<label for="receiver-trading-name">{{ getLanguage('trading_name', 'receiver') }}{{ req|raw }}</label>
<input type="text" id="receiver-trading-name"
name="tradingName" class="js--input-form"
placeholder="{{ getLanguage('enter_the_trading_name', 'receiver') }}"
value="{{ infoTypeEdit? infoTypeEdit.tradingName }}" required>
</div>
{% endif %}
{# EMAIL #}
<div id="email-type-person" class="cp cp-2">
<label for="{{ (infoType) ? 'partner-' }}receiver-email">E-mail{{ req|raw }}</label>
<input type="email" id="{{ (infoType) ? 'partner-' }}receiver-email"
name="email{{ infoType }}" class="js--input-form"
placeholder="{{ getLanguage('enter_the_email', 'receiver') }}"
value="{{ infoTypeEdit? infoTypeEdit.email }}" data-rule-email required>
</div>
{# TELEPHONE #}
<div class="cp cp-3">
<label for="{{ (infoType) ? 'partner-' }}receiver-ddd-phone">{{ getLanguage('phone', 'receiver') }}{{ req|raw }}</label>
<input type="text" id="{{ (infoType) ? 'partner-' }}receiver-ddd" name="ddd{{ infoType }}" class="phone-ddd js--input-form" placeholder="14" value="{{ infoTypeEdit? infoTypeEdit.ddd }}" required>
<input type="text" id="{{ (infoType) ? 'partner-' }}receiver-phone"
name="phone{{ infoType }}" class="phone-number js--input-form"
placeholder="96123-4567" value="{{ infoTypeEdit? infoTypeEdit.phone }}" required>
</div>
{% if ((infoTypeEdit and receiverEdit.personType == enum('ReceiverEnum::PERSON')) or infoType is not empty)
or not infoTypeEdit %}
{# OCCUPATION #}
<div id="{{ (infoType) ? 'partner-' }}occupation-type-person" class="cp cp-3">
<label for="receiver-occupation">{{ getLanguage('occupation', 'receiver') }}{{ req|raw }}</label>
<input type="text" id="{{ (infoType) ? 'partner-' }}receiver-occupation"
name="occupation{{ infoType }}" class="js--input-form"
placeholder="{{ getLanguage('enter_the_occupation', 'receiver') }}"
value="{{ infoTypeEdit? infoTypeEdit.occupation }}" required>
</div>
{# MONTHLY INCOME #}
<div id="{{ (infoType) ? 'partner-' }}monthly-income-type-person" class="cp cp-3">
<label for="{{ (infoType) ? 'partner-' }}receiver-monthly-income">{{ getLanguage('monthly_income', 'receiver') }}{{ req|raw }}</label>
<input type="text" id="{{ (infoType) ? 'partner-' }}receiver-monthly-income"
name="monthlyIncome{{ infoType }}" class="js--input-form"
placeholder="{{ getLanguage('enter_the_monthly_income', 'receiver') }}"
value="{{ infoTypeEdit? infoTypeEdit.monthlyIncome }}" required>
</div>
{% endif %}
{% if ((infoTypeEdit and receiverEdit.personType == enum('ReceiverEnum::COMPANY')) and infoType is empty)
or ( not infoTypeEdit and infoType is empty ) %}
{# ANNUAL REVENUE #}
<div id="annual-revenue-type-person" class="cp cp-2">
<label for="receiver-annual-revenue">{{ getLanguage('annual_revenue', 'receiver') }}{{ req|raw }}</label>
<input type="text" id="receiver-annual-revenue" name="annualRevenue"
class="js--input-form" placeholder="{{ getLanguage('enter_the_annual_revenue', 'receiver') }}"
value="{{ infoTypeEdit? infoTypeEdit.annualRevenue }}" required>
</div>
{# WEBSITE #}
{% set getDomain = not infoTypeEdit or infoTypeEdit and infoTypeEdit.website is empty ? true : false %}
{% set www = getDomain ? "https://" : "" %}
{% set url = getDomain ? eadDomain : infoTypeEdit.website %}
<div id="website-type-person" class="cp cp-2">
<label for="receiver-website">Website{{ req|raw }}</label>
<input type="text" id="receiver-website" name="website"
class="js--input-form" placeholder="{{ getLanguage('enter_the_website', 'receiver') }}"
value="{{ www }}{{ url }}" required>
</div>
{% endif %}
</div>