@extends('layouts.previews.mercure')
@php
use App\Enums\ElementType;
use App\Enums\AccessElementDefault;
use App\Enums\CustomElementType;
$trainOrBus = current(
array_filter($elements, function ($item) {
return fieldPropertyValue('element_type', $item) == ElementType::DEFAULT &&
fieldPropertyValue('default_element_type', $item) == AccessElementDefault::TRAIN_OR_BUS &&
fieldPropertyValue('status', $item);
}),
);
$car = current(
array_filter($elements, function ($item) {
return fieldPropertyValue('element_type', $item) == ElementType::DEFAULT &&
fieldPropertyValue('default_element_type', $item) == AccessElementDefault::CAR &&
fieldPropertyValue('status', $item);
}),
);
@endphp
@section('content')
{{ indexPage($mode) }}
{!! setTextDefault(
textLocale('access_display_text', $basic, $lang),
config('translate.' . $lang . '.basic.access_display_text'),
) !!}
{!! setTextDefault(textLocale('access_transition_title', $basic, $lang), 'ACCESS') !!}
{!! setTextDefault(textLocale('access_transition_introduction', $basic, $lang)) !!}
@foreach ($elements as $item)
@if (fieldPropertyValue('default_element_type', $item) == AccessElementDefault::TRAIN_OR_BUS && $trainOrBus)
@endif
@if (fieldPropertyValue('default_element_type', $item) == AccessElementDefault::CAR && $car)
@endif
@endforeach
SCROLL
@if (!empty(fieldPropertyValue('postal_code', $basic)))
@endif{!! setPostalCode(fieldPropertyValue('postal_code', $basic) ?? null, $lang) !!}
{!! setTextDefault(address('prefecture', 'city', 'address', $basic, $lang)) !!}
@foreach ($elements as $item)
@if (fieldPropertyValue('element_type', $item) == ElementType::DEFAULT)
@if (fieldPropertyValue('default_element_type', $item) == AccessElementDefault::TRAIN_OR_BUS)
@include('preview.mercure.defaults.access.trainOrBus')
@endif
@if (fieldPropertyValue('status', $item))
@switch(fieldPropertyValue('default_element_type', $item))
@case(AccessElementDefault::PLAN)
@include('preview.mercure.commons.plan')
@break
@case(AccessElementDefault::CV_NEXT)
@php
$reserve = $item;
@endphp
@break
@endswitch
@endif
@endif
@if (textLocale('status', $item, $lang) &&
fieldPropertyValue('custom_element_type', $item) >= CustomElementType::ONE_COLUMN &&
fieldPropertyValue('custom_element_type', $item) <= CustomElementType::SIDE_CONTENT_V2)
@include('preview.customs.customContent')
@endif
@endforeach
@include('preview.mercure.commons.allContaintPC')
@include('preview.mercure.commons.allContaintSP')
@if (!empty($reserve))
@include('preview.mercure.commons.reserve')
@endif
@endsection