<div class="row">
    <div class="col-xs-12 col-xl-8">
        <div class="row mb-3">
            <div class="col-6">
                {{ Form::label('sale_channel_id', __('shop.sale_channels.name')) }}
                @include('components.form.select', [
                    'name' => 'sale_channel_id',
                    'list' => $sale_channels ?? [],
                    'value' => $delivery['sale_channel_id'] ?? null,
                    'with_empty' => '',
                    'class' => 'select2'
                ])
            </div>
            <div class="col-6">
                <div class="row">
                    <div class="col-5">
                        {{ Form::label('active', __('Actif')) }}<br/>
                        <input type="hidden" name="active" value="0">
                        @include("components.form.toggle", [
                            'name' => 'active',
                            'value' => $delivery['active'] ?? false,
                            'on' => __('active'),
                            'off' => __('inactive')
                        ])
                    </div>
                    <div class="col-3">
                        {{ Form::label('is_public', __('Type')) }}
                        <input type="hidden" name="is_public" value="0">
                        @include('components.form.toggle', [
                            'name' => 'is_public',
                            'value' => $delivery['is_public'] ?? false,
                            'on' => __('public'),
                            'off' => __('administré')
                        ])
                    </div>
                    <div class="col-4">
                        {{ Form::label('at_house', __('Défaut')) }}
                        @include('components.form.checkboxes.icheck', [
                            'name' => 'at_house',
                            'value' => $delivery['at_house'] ?? null
                        ])
                    </div>
                </div>
            </div>
        </div>
        <div class="row mb-3">
            <div class="col-12">
                {{ Form::label('name', __('Nom')) }}
                @include('components.form.input', [
                    'name' => 'name',
                    'value' => $delivery['name'] ?? null,
                    'required' => true
                ])
            </div>
        </div>

        <div class="row mb-3">
            <div class="col-12">
                {{ Form::label('', __('Description')) }}
                <textarea name="description" class="form-control">{{ $delivery['description'] ?? '' }}</textarea>
            </div>
        </div>

        @include('components.address', ['with_country' => false])

        <div class="row mb-3">
            <div class="col-3">
                {{ Form::label('event_date_begin', __('Date de début')) }}
                @include('components.form.datepicker', ['name' => 'event_date_begin', 'value' => $delivery['event_date_begin'] ?? null])
            </div>
            <div class="col-3">
                {{ Form::label('event_date_end', __('Date de fin')) }}
                @include('components.form.datepicker', ['name' => 'event_date_end', 'value' => $delivery['event_date_end'] ?? null])
            </div>

        </div>
    </div>
</div>

@include('components.save')

@include('load.form.select2')
@include('load.form.save')


@push('js')
    <script>
        $(function() {
            initSelect2();
            initDatepicker();
            initSaveForm('#delivery-form');
        });
    </script>
@endpush
