{% if departurePlace.value is not defined or departurePlace.id is not defined %}
{% set departurePlace = {id: '', value: '', latlon: '', latitude: '', longitude: ''} %}
{% endif %}
{% if arrivalPlace.value is not defined or arrivalPlace.id is not defined %}
{% set arrivalPlace = {id: '', value: '', latlon: '', latitude: '', longitude: ''} %}
{% endif %}
{% set bWithStage = false %}
{% if via is defined and via|length > 0 %}
{% set bWithStage = true %}
{% endif %}
{% set bSearchButton = true %}
{% set bDatetimeOnly = false %}
{% set widgetContext = false %}
{% if isWidget is defined and isWidget == 'true' %}
{% set widgetContext = true %}
{% set bSearchButton = true %}
{% if isRedirection is defined and isRedirection == 'true'
and isInternal is defined and isInternal == 'true'
and (isPartner is defined and isPartner == 'false')
%}
{% set bDatetimeOnly = true %}
{% endif %}
{% endif %}
{% set formClass = '' %}
{% if bSearchButton %}
{% set formClass = formClass ~ (formClass is empty ? '' : ' ') ~ 'is-JourneyForm_WithSearchButton' %}
{% endif %}
{% if tripJourneyCount is defined and tripJourneyCount > 0 %}
{% set formClass = formClass ~ (formClass is empty ? '' : ' ') ~ 'is-JourneyForm_Collapsed' %}
{% endif %}
<form
aria-controls="is-Journey-Results"
aria-label="{{ 'journey.h1'|trans }}"
autocomplete="off"
{{ formClass is not empty ? (' class="' ~ formClass ~ '"')|raw : '' }}
data-content=""
id="is-JourneyForm"
tabindex="-1">
<input type="hidden" name="is-JourneyForm-Alternative" id="is-JourneyForm-Alternative">
<input type="hidden" name="isWidget" value="{{ widgetContext }}">
<input type="hidden" name="isEstimatedResults" id="is-Estimated-Results" value="true">
<input type="hidden" name="token" value="{{ csrf_token('route_calculation') }}"/>
<div id="is-Journey-ErrorServer" class="is-Alert is-Alert_Warning" style="display: none;"
aria-live="assertive" aria-hidden="true"></div>
<p class="is-form-Description-Mandotory">
<span class="is-LabelledInput-Label_Required">*</span>
{{ 'form.mandatory_description' | trans }}
</p>
<fieldset id="is-Journey-SwapGroup" class="is-SwapGroup{% if bWithStage %} is-SwapGroup_WithStage{% endif %}">
<legend class="is-sr-only">{{ 'journey.form_legend' | trans }}</legend>
<div class="is-LabelInInput is-First" id="is-Journey-Departure-LabelInInput">
<div class="is-LabelInInput-LabelWrapper">
<label class="is-LabelInInput-Label" for="is-Journey-Departure">
{{ 'journey.departure' | trans }}
<span class="is-LabelledInput-Label_Required">*</span>
</label>
</div>
<div class="is-LabelInInput-InputWrapper">
<input value="{{ departurePlace.value }}" data-latlon="{{ departurePlace.latlon }}" data-id="{{ departurePlace.id }}" data-latitude="{{ departurePlace.latitude }}" data-longitude="{{ departurePlace.longitude }}" id="is-Journey-Departure" name="start" type="text" required class="is-LabelInInput-Input is-Resettable-Input" placeholder="{{ 'journey.departure_placeholder' | trans }}" autocomplete="off"
aria-autocomplete="list" aria-owns="is-Journey-Departure-Suggestions" />
</div>
</div>
<div class="is-Stages" id="is-Journey-Stage" {% if not bWithStage %}style="display: none;"{% endif %}>
{% if bWithStage %}
{% for index, step in via %}
{% if step.id is defined and step.value is defined %}
<div class="is-LabelInInput" id="is-Stage-LabelInInput-{{ loop.index0 }}" >
<div class="is-LabelInInput-LabelWrapper">
<label class="is-LabelInInput-Label" for="is-Stage-Input-{{ loop.index0 }}">{{ 'map.popup.step-via' | trans }}</label>
</div>
<div class="is-LabelInInput-InputWrapper">
<input autocomplete="off" required="true" type="text" name="stage[]" id="is-Stage-Input-{{ loop.index0 }}" class="is-LabelInInput-Input is-via-input" data-latlon="{{ step.latlon }}" data-id="{{ step.id }}" value="{{ step.value }}" placeholder="{{ 'journey.departure_placeholder' | trans }}"/>
</div>
</div>
{% endif %}
{% endfor %}
{% endif %}
</div>
<div class="is-LabelInInput is-Last" id="is-Journey-Arrival-LabelInInput">
<div class="is-LabelInInput-LabelWrapper">
<label class="is-LabelInInput-Label" for="is-Journey-Arrival">
{{ 'journey.arrival' | trans }}
<span class="is-LabelledInput-Label_Required">*</span>
</label>
</div>
<div class="is-LabelInInput-InputWrapper">
<input value="{{ arrivalPlace.value }}" data-latlon="{{ arrivalPlace.latlon }}" data-id="{{ arrivalPlace.id }}" data-latitude="{{ arrivalPlace.latitude }}" data-longitude="{{ arrivalPlace.longitude }}" id="is-Journey-Arrival" name="end" type="text" required class="is-LabelInInput-Input is-Resettable-Input" placeholder="{{ 'journey.arrival_placeholder' | trans }}" autocomplete="off"
aria-autocomplete="list" aria-owns="is-Journey-Arrival-Suggestions" />
</div>
</div>
<a class="is-RemoveStage-Button{% if not bWithStage %} is-hide{% endif %}"
role="button" aria-expanded="false" aria-controls="is-Journey-Stage" tabindex="0" >
-
</a>
{% if preferences.displayViaStep is defined and preferences.displayViaStep is not empty %}
<a class="is-AddStage-Button{% if bWithStage %} is-hide{% endif %}"
role="button" aria-expanded="false" aria-controls="is-Journey-Stage" tabindex="0" title="{{ 'journey.add-stage'|trans }}">
+
</a>
{% endif %}
<a id="is-Journey-SwapButton" class="is-SwapGroup-Button" data-a="#start" data-b="#end" title="{{ 'journey.swap_departure_arrival' |trans }}"
role="button" aria-label="{{ 'journey.swap_departure_arrival'|trans }}" tabindex="0">
<span class="is-Icon is-Icon-sim-swap" aria-hidden="true"></span>
</a>
</fieldset>
{% if bDatetimeOnly %}
{% set vars = { 'bDatetimeOnly': bDatetimeOnly} %}
<div class="is-Journey-TimePreferenceArea">
{% include 'modules/search-widget/journey/datetime-select.html.twig' with vars %}
{% include 'modules/search-widget/journey/datetime-input.html.twig' with vars %}
</div>
{% else %}
<div id="is-Journey-MoreActionsArea">
<div id="is-Journey-MoreActionsArea-DatePreference">
{% include 'modules/search-widget/journey/datetime-select.html.twig' %}
</div>
<div class="is-FieldGroup is-DatetimeInputs">
{% include 'modules/search-widget/journey/datetime-input.html.twig' %}
</div>
<div id="is-Journey-MoreActionsArea-AdvancedSearch">
<button class="is-Button is-Button_Secondary"
id="is-Journey-ShowAdvancedSearchButton"
type="button"
data-target="#is-Journey-AdvancedSearch" data-toggle="is-collapse"
aria-expanded="false" aria-controls="is-Journey-AdvancedSearch" aria-haspopup="true"
onclick="$(document).trigger(TrackingManager.event.track, {event: 'option'});"
>
{{ 'journey.options'|trans }}
</button>
</div>
</div>
<div class="is-collapse" id="is-Journey-AdvancedSearch" aria-labelledby="is-Journey-ShowAdvancedSearchButton" tabindex="0">
<div class="is-Journey-Container-Buttons">
<button id="is-Journey-ResetButton" aria-label="{{ 'journey.reset'|trans }}">
<i class="is-Icon is-Icon-com-reset" aria-hidden="true"></i> {{ 'journey.reset'|trans }}
</button>
<button id="is-Journey-HideAdvancedSearchButton" aria-label="{{ 'journey.close'|trans }}" data-toggle="is-collapse" data-target="#is-Journey-AdvancedSearch" aria-expanded="false" aria-controls="is-Journey-AdvancedSearch">
<i class="is-Icon is-Icon-com-close" aria-hidden="true"></i> {{ 'journey.close'|trans }}
</button>
</div>
<div id="is-Journey-Preferences">
{% include 'modules/search-widget/journey/preferences-form.html.twig' %}
</div>
<div class="is-ButtonArea">
<button class="is-Button" id="is-Journey-AdvancedSearch-Button" aria-label="{{ 'journey.h1'|trans }}">{{ 'search'|trans }}</button>
</div>
</div>
{% endif %}
{% if bSearchButton %}
<div id="is-PlaceSubmitButton" class="is-ButtonArea">
<button{% if isWidget is defined and true == isWidget %} data-label="{{ widgetCode }}"{% endif %} type="button" class="is-Button is-Button_Search is-full-width" id="is-Journey-SearchButton" aria-label="{{ 'journey.h1'|trans }}">{{ 'search'|trans }}</button>
</div>
{% endif %}
</form>