@extends('layouts.layout-2')

@section('content')
    <h4 class="font-weight-bold py-2 mb-2 d-flex justify-content-between align-items-center w-100 ">
        <div>{{ __('navigation.my_homeparty') }} /
            @if(!$homeparty->id)
                anlegen
            @else
                {{ __('navigation.manage') }}

            @endif
        </div>
        <a href="{{route('user_homepartys')}}" class="btn btn-sm btn-default float-right">zurück</a>
    </h4>
    <div class="nav-tabs-top mb-4">
        <ul class="nav nav-tabs nav-responsive-xl">
          @if(!$step || $step >= 1)  
          <li class="nav-item">
            <a class="nav-link @if(!$step || $step == 1 || $step == 10) active @endif" data-toggle="tab" href="#navs-top-homeparty">Auszeitparty</a>
          </li>
          @endif
          @if($homeparty->id)
            @if($step && $step >= 2)  
            <li class="nav-item">
                <a class="nav-link @if($step == 2 || $step == 12) active @endif" data-toggle="tab" href="#navs-top-address">Lieferadresse</a>
            </li>
            @endif
            @if($step && $step >= 3)  
            <li class="nav-item">
                <a class="nav-link @if($step == 3 || $step == 13) active @endif" data-toggle="tab" href="#navs-top-host">Gastgeber:in</a>
            </li>
            @endif
        @endif
        </ul>
        <div class="tab-content">

          <div class="tab-pane fade  @if(!$step || $step == 1 || $step == 10) active show @endif" id="navs-top-homeparty">
                {!! Form::open(['url' => route('user_homeparty_detail', [$homeparty->id, 10]), 'class' => 'form-horizontal', 'id'=>'homeparty-party-form-validation']) !!}
                <h5 class="card-header">
                    <div class="row">
                        @if($homeparty->step < 10)
                        <div class="col-12">
                            <span class="text-tiny float-right">* {{trans('register.required_fields')}}</span>
                            Auszeitparty verwalten
                        </div>
                       @else
                        <div class="col-12">
                            <div class="d-flex justify-content-between align-items-center w-100">
                                <div>Auszeitparty verwalten</div>
                                <div class="float-right">
                                    <a href="{{route('user_homeparty_guests', [$homeparty->id])}}" class="btn btn-sm btn-secondary mr-2 mb-1"><i class="ion ion-md-person-add"></i> Gäste anlegen</a>
                                    <a href="{{route('user_homeparty_order', [$homeparty->id])}}" class="btn btn-sm btn-secondary mr-2 mb-1"><i class="ion ion-md-basket"></i> Bestellung</a>
                                </div>
                            </div>
                        </div>
                        @endif
                    </div>
                </h5>
                <div class="card-body">
                    <div class="form-row">
                        <div class="form-group col-md-3  {{ $errors->has('name') ? 'has-error' : '' }}">
                            <label for="name" class="form-label">{{ __('Gastgeber / Veranstalter') }}*</label>
                            {{ Form::text('name', $homeparty->name,  array('placeholder'=>__('Gastgeber / Veranstalter'), 'class'=>'form-control', 'required')) }}
                            @if ($errors->has('name'))
                                <span class="help-block">
                                    <strong>{{ $errors->first('name') }}</strong>
                                </span>
                            @endif
                        </div>
                        <div class="form-group col-md-3  {{ $errors->has('date') ? 'has-error' : '' }}">
                            <label for="date" class="form-label">{{ __('Veranstaltungsdatum') }}*</label>
                            {{ Form::text('date', $homeparty->date,  array('placeholder'=>Util::formatDate(), 'data-date-format'=>Util::formatDate(), 'data-start_view'=>2, 'class'=>'form-control datepicker-base',  'required')) }}
                            @if ($errors->has('date'))
                                <span class="help-block">
                                <strong>{{ $errors->first('date') }}</strong>
                                </span>
                            @endif
                        </div>
                        <div class="form-group col-md-3  {{ $errors->has('place') ? 'has-error' : '' }}">
                            <label for="place" class="form-label">{{ __('Veranstaltungsort') }}*</label>
                            {{ Form::text('place', $homeparty->place,  array('placeholder'=>__('Veranstaltungsort'), 'class'=>'form-control', 'required')) }}
                            @if ($errors->has('place'))
                                <span class="help-block">
                                <strong>{{ $errors->first('place') }}</strong>
                                </span>
                            @endif
                        </div>
                        
                        @if($homeparty->id)
                        <div class="form-group col-md-3  {{ $errors->has('country_id') ? 'has-error' : '' }}">
                            <label class="form-label">{{ __('Lieferland') }}*</label>
                            <div class="mt-2">@if($homeparty->country) {{ $homeparty->country->getLocated() }} @endif</div>
                        </div>
                        @else
                        <div class="form-group col-md-3  {{ $errors->has('country_id') ? 'has-error' : '' }}">
                            <label class="form-label">{{ __('Lieferland') }}*</label>
                            {{ Form::select('country_id', \App\Models\ShippingCountry::getActiveShippingCountries(), $homeparty->country_id, array('data-live-search'=>'false', 'class'=>'selectpicker', 'id'=>'country_id') ) }}
                            @if ($errors->has('country_id'))
                                <span class="help-block">
                                <strong>{{ $errors->first('country_id') }}</strong>
                                </span>
                            @endif
                        </div>
                        <div class="form-group col-md-12 text-right">
                        <i> Das Lieferland kann nach dem Anlegen nicht mehr geändert werden. Alle Lieferadressen müssen in diesem Land sein.</i>
                        </div>
                        @endif
                        
                    </div>
                    <div class="form-group">
                        <label class="form-label" for="description">{{ __('Beschreibung / Willkommenstext') }}</label>
                        {{ Form::textarea('description', $homeparty->description ,  array('placeholder'=>__('Beschreibung'), 'class'=>'form-control', 'rows'=>5)) }}
                    </div>
                    <div class="form-group">
                        <button type="submit" class="btn btn-secondary mr-2 mb-2" name="action" value="homeparty-party-store-detail">
                            @if($homeparty->id) {{ __('Änderungen speichern') }} @else {{ __('Neue Auszeitparty anlegen') }} @endif</button>&nbsp;
                        <a href="{{route('user_homepartys')}}" class="btn btn-default mb-2">zurück zur Übersicht</a>
                    </div>
                    @if($homeparty->id &&  $homeparty->step >= 10)
                    <hr>
                        <div class="pt-2">
                            <label  class="form-label">Einladungslink für Gäste <span class="text-muted"> (lass Deine Gäste ihre Daten selber ausfüllen)</span></label>
                            <div class="form-group">
                                <div class="input-group">
                                    <span class="input-group-prepend">
                                      <button class="btn btn-secondary" type="button" title="Kopiert!" data-clipboard-demo data-clipboard-target="#homeparty_link"><i class="ion ion-ios-copy"></i> Link kopieren</button>
                                    </span>
                                    <input type="text" class="form-control" name="homeparty_link" value="{{ $homeparty->getTokenLink() }}" id="homeparty_link" placeholder="">
                                </div>
                            </div>
                            <p>Teile diesen Link mit den Gästen (z.B. WhatsApp oder SMS), damit gelangt sie auf eine Zielseite wo sie ihre Daten selber ausfüllen können. Nutze das „Kopier-Symbol“, um den Link gleich in Deine Zwischenablage zu kopieren.</p>
                        </div>
                    @endif
                </div>
                {!! Form::close() !!}
          </div>

          @if($homeparty->id)
          <div class="tab-pane fade @if($step == 2 || $step == 12) active show @endif" id="navs-top-address">

            {!! Form::open(['url' => route('user_homeparty_detail', [$homeparty->id, 12]), 'class' => 'form-horizontal', 'id'=>'']) !!}
            <h5 class="card-header">
                <div class="row">
                    @if($homeparty->step < 10)
                    <div class="col-12">
                        <span class="text-tiny float-right">* {{trans('register.required_fields')}}</span>
                        Lieferadresse Auszeitparty {{ $homeparty->name }}
                    </div>
                    @else
                    <div class="col-12">
                        <div class="d-flex justify-content-between align-items-center w-100">
                            <div>Lieferadresse Auszeitparty {{ $homeparty->name }}</div>
                            <div class="float-right">
                                <a href="{{route('user_homeparty_guests', [$homeparty->id])}}" class="btn btn-sm btn-secondary mr-2 mb-1"><i class="ion ion-md-person-add"></i> Gäste anlegen</a>
                                <a href="{{route('user_homeparty_order', [$homeparty->id])}}" class="btn btn-sm btn-secondary mr-2 mb-1"><i class="ion ion-md-basket"></i> Bestellung</a>
                            </div>
                        </div>
                    </div>
                    @endif
                </div>
            </h5>
            <div class="card-body">
                <p>Trage hier bitte die zentrale Lieferadresse für die getätigten Bestellungen dieser Auszeitparty. Das kann Deine eigene Adresse aber auch die des Gastgebers sein. Je nachdem, wie Du die Verteilung der Produkte mit Deinen Gästen organisieren möchtest.</p>
                <p>Wenn ein Gast seine Bestellung direkt an seine persönliche Adresse geschickt haben möchte, kannst Du das im Bestellprozess gesondert angeben.</p>
                <hr>
                    <div class="form-row">
                        <div class="form-group col-md-12">
                            <label for="shipping_company" class="form-label">{{ __('Company name') }} (optional)</label>
                            {{ Form::text('shipping_company', $homeparty_user->shipping_company,  array('placeholder'=>__('Company name'), 'class'=>'form-control', 'id'=>'shipping_company',)) }}
                        </div>
                    </div>
                    <div class="form-row">
                        <div class="form-group col-md-6 {{ $errors->has('shipping_salutation') ? 'has-error' : '' }}">
                            <label class="form-label">{{ __('Salutation') }}*</label>
                            <select class="selectpicker" data-style="btn-light" name="shipping_salutation" id="shipping_salutation" required tabindex="17">
                                {!!  HTMLHelper::getSalutation($homeparty_user->shipping_salutation) !!}
                            </select>
                            @if ($errors->has('shipping_salutation'))
                            <span class="help-block">
                                <strong>{{ $errors->first('shipping_salutation') }}</strong>
                            </span>
                            @endif
                        </div>
                    </div>
                    <div class="form-row">
                        <div class="form-group col-md-6  {{ $errors->has('shipping_firstname') ? 'has-error' : '' }}">
                            <label class="form-label" for="shipping_firstname">{{ __('First name') }}*</label>
                            {{ Form::text('shipping_firstname', $homeparty_user->shipping_firstname,  array('placeholder'=>__('First name'), 'class'=>'form-control', 'required'=>true, 'id'=>'shipping_firstname')) }}
                            @if ($errors->has('shipping_firstname'))
                            <span class="help-block">
                                <strong>{{ $errors->first('shipping_firstname') }}</strong>
                            </span>
                            @endif
                        </div>
                        <div class="form-group col-md-6  {{ $errors->has('shipping_lastname') ? 'has-error' : '' }}">
                            <label class="form-label" for="shipping_lastname">{{ __('Last name') }}*</label>
                            {{ Form::text('shipping_lastname', $homeparty_user->shipping_lastname,  array('placeholder'=>__('Last name'), 'class'=>'form-control', 'required'=>true, 'id'=>'shipping_lastname')) }}
                            @if ($errors->has('shipping_lastname'))
                            <span class="help-block">
                                <strong>{{ $errors->first('shipping_lastname') }}</strong>
                            </span>
                            @endif

                        </div>
                    </div>
                    <div class="form-row">
                        <div class="form-group col-md-12  {{ $errors->has('shipping_address') ? 'has-error' : '' }}">
                            <label class="form-label" for="shipping_address">{{ __('Street') }} / {{ __('House number') }}*</label>
                            {{ Form::text('shipping_address', $homeparty_user->shipping_address,  array('placeholder'=>__('Street'), 'class'=>'form-control', 'required'=>true, 'id'=>'shipping_address')) }}
                            @if ($errors->has('shipping_address'))
                                <span class="help-block">
                                    <strong>{{ $errors->first('shipping_address') }}</strong>
                                </span>
                            @endif
                        </div>
                    </div>
                    <div class="form-row">
                        <div class="form-group col-md-12 {{ $errors->has('shipping_address_2') ? 'has-error' : '' }}">
                            <label class="form-label" for="shipping_address_2">{{ __('Wohnung / Gebäude  (optional)') }}</label>
                            {{ Form::text('shipping_address_2', $homeparty_user->shipping_address_2,  array('placeholder'=>__('Wohnung / Gebäude  (optional)'), 'class'=>'form-control', 'id'=>'shipping_address_2')) }}
                            @if ($errors->has('shipping_address_2'))
                                <span class="help-block">
                                    <strong>{{ $errors->first('shipping_address_2') }}</strong>
                                </span>
                            @endif
                        </div>
                    </div>
                    <div class="form-row">
                        <div class="form-group col-md-6  {{ $errors->has('shipping_zipcode') ? 'has-error' : '' }}">
                            <label class="form-label" for="shipping_zipcode">{{ __('Postcode') }}*</label>
                            {{ Form::text('shipping_zipcode', $homeparty_user->shipping_zipcode,  array('placeholder'=>__('Postcode'), 'class'=>'form-control', 'required'=>true, 'id'=>'shipping_zipcode')) }}
                            @if ($errors->has('shipping_zipcode'))
                                <span class="help-block">
                                    <strong>{{ $errors->first('shipping_zipcode') }}</strong>
                                </span>
                            @endif

                        </div>
                        <div class="form-group col-md-6  {{ $errors->has('shipping_city') ? 'has-error' : '' }}">
                            <label class="form-label" for="shipping_city">{{ __('City') }}*</label>
                            {{ Form::text('shipping_city', $homeparty_user->shipping_city,  array('placeholder'=>__('City'), 'class'=>'form-control', 'required'=>true, 'id'=>'shipping_city')) }}
                            @if ($errors->has('shipping_city'))
                                <span class="help-block">
                                    <strong>{{ $errors->first('shipping_city') }}</strong>
                                </span>
                            @endif
                        </div>
                    </div>
                    <div class="form-row">
                        <div class="form-group col-md-12">
                            {{ Form::hidden('shipping_country_id', $homeparty_user->shipping_country_id) }}
                            <label class="form-label">{{ __('Country') }}</label>
                            <div class="">@if($homeparty_user->shipping_country) {{ $homeparty_user->shipping_country->getLocated() }} @endif <i>(Das Land kann nicht mehr geändert werden.)</i></div>
                        </div>
                    </div>
                    <div class="form-row">
                        <div class="form-group col-md-12">
                            <label class="form-label" for="shipping_phone">{{ __('Phone') }}</label>
                            {{ Form::text('shipping_phone', $homeparty_user->shipping_phone,  array('placeholder'=>__('Phone'), 'class'=>'form-control', 'id'=>'shipping_phone')) }}
                        </div>
                    </div>
                    <div class="form-row">
                        <div class="form-group col-md-12">
                            <label class="form-label" for="shipping_email">{{ __('E-Mail Address') }}</label>
                            {{ Form::text('shipping_email', $homeparty_user->shipping_email,  array('placeholder'=>'E-Mail', 'class'=>'form-control', 'id'=>'shipping_email')) }}
                        </div>
                    </div>
                    <div class="form-group">
                        <button type="submit" class="btn btn-secondary mr-2 mb-2" name="action" value="homeparty-party-store-address">
                        Lieferadresse speichern
                        </button>&nbsp;
                        <a href="{{route('user_homepartys')}}" class="btn btn-default mb-2">zurück zur Übersicht</a>
                    </div>
                
            </div>
            {!! Form::close() !!}
          </div>

          <div class="tab-pane fade @if($step == 3 || $step == 13) active show @endif" id="navs-top-host">
            
            {!! Form::open(['url' => route('user_homeparty_detail', [$homeparty->id, 13]), 'class' => 'form-horizontal', 'id'=>'']) !!}
            <h5 class="card-header">
                <div class="row">
                    @if($homeparty->step < 10)
                    <div class="col-12">
                        <span class="text-tiny float-right">* {{trans('register.required_fields')}}</span>
                        Gastgeber:in Auszeitparty {{ $homeparty->name }}
                    </div>
                    @else
                    <div class="col-12">
                        <div class="d-flex justify-content-between align-items-center w-100">
                            <div>Gastgeber:in Auszeitparty {{ $homeparty->name }}</div>
                            <div class="float-right">
                                <a href="{{route('user_homeparty_guests', [$homeparty->id])}}" class="btn btn-sm btn-secondary mr-2 mb-1"><i class="ion ion-md-person-add"></i> Gäste anlegen</a>
                                <a href="{{route('user_homeparty_order', [$homeparty->id])}}" class="btn btn-sm btn-secondary mr-2 mb-1"><i class="ion ion-md-basket"></i> Bestellung</a>
                            </div>
                        </div>
                    </div>
                    @endif
                </div>
            </h5>
            <div class="card-body">
                <p>Trage hier bitte die Adresse des Gastgeber:in wo die Auszeitparty organisiert wird.</p>
                <p>Die Rechnung von mivita wird an deine Adresse (Berater:in) gestellt. Die Abrechnung mit dem Gastgeber:in und den Gästern übernimmst du selbst.</p>
                <hr>
                    <div class="form-row">
                        <div class="form-group col-md-12">
                            <label for="billing_company" class="form-label">{{ __('Company name') }} (optional)</label>
                            {{ Form::text('billing_company', $homeparty_user->billing_company,  array('placeholder'=>__('Company name'), 'class'=>'form-control', 'id'=>'billing_company', 'tabindex' => 1)) }}
                        </div>
                    </div>
                    <div class="form-row">
                        <div class="form-group col-md-6 {{ $errors->has('billing_salutation') ? 'has-error' : '' }}">
                            <label class="form-label">{{ __('Salutation') }}*</label>
                            <select class="selectpicker" data-style="btn-light" name="billing_salutation" id="billing_salutation" required tabindex="2">
                                {!!  HTMLHelper::getSalutation($homeparty_user->billing_salutation) !!}
                            </select>
                            @if ($errors->has('billing_salutation'))
                                <span class="help-block">
                                <strong>{{ $errors->first('billing_salutation') }}</strong>
                        </span>
                            @endif
                        </div>
                    </div>
                    <div class="form-row">
                        <div class="form-group col-md-6 {{ $errors->has('billing_firstname') ? 'has-error' : '' }}">
                            <label class="form-label" for="billing_firstname">{{ __('First name') }}*</label>
                            {{ Form::text('billing_firstname', $homeparty_user->billing_firstname,  array('placeholder'=>__('First name'), 'class'=>'form-control', 'id'=>'billing_firstname', 'required'=>true, 'tabindex' => 4)) }}
                            @if ($errors->has('billing_firstname'))
                                <span class="help-block">
                                <strong>{{ $errors->first('billing_firstname') }}</strong>
                        </span>
                            @endif

                        </div>
                        <div class="form-group col-md-6  {{ $errors->has('billing_lastname') ? 'has-error' : '' }}">
                            <label class="form-label" for="billing_lastname">{{ __('Last name') }}*</label>
                            {{ Form::text('billing_lastname', $homeparty_user->billing_lastname,  array('placeholder'=>__('Last name'), 'class'=>'form-control', 'id'=>'billing_lastname', 'required'=>true, 'tabindex' => 5)) }}
                            @if ($errors->has('billing_lastname'))
                                <span class="help-block">
                                <strong>{{ $errors->first('billing_lastname') }}</strong>
                        </span>
                            @endif

                        </div>
                    </div>
                    <div class="form-row">
                        <div class="form-group col-md-12 {{ $errors->has('billing_address') ? 'has-error' : '' }}">
                            <label class="form-label" for="billing_address">{{ __('Street') }} / {{ __('House number') }}*</label>
                            {{ Form::text('billing_address', $homeparty_user->billing_address,  array('placeholder'=>__('Street'), 'class'=>'form-control', 'required'=>true, 'id'=>'billing_address', 'tabindex' => 6)) }}
                            @if ($errors->has('billing_address'))
                                <span class="help-block">
                                    <strong>{{ $errors->first('billing_address') }}</strong>
                            </span>
                            @endif
                        </div>
                    </div>
                    <div class="form-row">
                        <div class="form-group col-md-12  {{ $errors->has('billing_address_2') ? 'has-error' : '' }}">
                            <label class="form-label" for="billing_address_2">{{ __('Wohnung / Gebäude  (optional)') }}</label>
                            {{ Form::text('billing_address_2', $homeparty_user->billing_address_2,  array('placeholder'=>__('Wohnung / Gebäude  (optional)'), 'class'=>'form-control', 'id'=>'billing_address_2', 'tabindex' => 6)) }}
                        </div>
                    </div>
                    <div class="form-row">
                        <div class="form-group col-md-6  {{ $errors->has('billing_zipcode') ? 'has-error' : '' }}">
                            <label class="form-label" for="billing_zipcode">{{ __('Postcode') }}*</label>
                            {{ Form::text('billing_zipcode', $homeparty_user->billing_zipcode,  array('placeholder'=>__('Postcode'), 'class'=>'form-control', 'required'=>true, 'id'=>'billing_zipcode', 'tabindex' => 7)) }}
                            @if ($errors->has('billing_zipcode'))
                                <span class="help-block">
                                <strong>{{ $errors->first('billing_zipcode') }}</strong>
                                </span>
                            @endif
                        </div>
                        <div class="form-group col-md-6  {{ $errors->has('billing_city') ? 'has-error' : '' }}">
                            <label class="form-label" for="billing_city">{{ __('City') }}*</label>
                            {{ Form::text('billing_city', $homeparty_user->billing_city,  array('placeholder'=>__('City'), 'class'=>'form-control', 'required'=>true, 'id'=>'billing_city', 'tabindex' => 8)) }}
                            @if ($errors->has('billing_city'))
                                <span class="help-block">
                                <strong>{{ $errors->first('billing_city') }}</strong>
                                </span>
                            @endif
                        </div>
                    </div>
                    <div class="form-row">
                        <div class="form-group col-md-12">
                            {{ Form::hidden('billing_country_id', $homeparty_user->billing_country_id) }}
                            <label class="form-label">{{ __('Country') }}</label>
                            <div class="">@if($homeparty_user->billing_country) {{ $homeparty_user->billing_country->getLocated() }} @endif <i>(Das Land kann nicht mehr geändert werden.)</i></div>
                        </div>
                    </div>
                    <div class="form-row">
                        <div class="form-group col-md-12 {{ $errors->has('billing_phone') ? 'has-error' : '' }}">
                            <label class="form-label" for="billing_phone">{{ __('Phone') }}</label>
                            {{ Form::text('billing_phone', $homeparty_user->billing_phone,  array('placeholder'=>__('Phone'), 'class'=>'form-control', 'id'=>'billing_phone', 'tabindex' => 11)) }}
                        </div>
                    </div>
                    <div class="form-row">
                        <div class="form-group col-md-12">
                            <label class="form-label" for="billing_email">{{ __('E-Mail Address') }}</label>
                            {{ Form::text('billing_email', $homeparty_user->billing_email,  array('placeholder'=>'E-Mail', 'class'=>'form-control', 'id'=>'billing_email',  'tabindex' => 12)) }}
                        </div>
                    </div>
                    <div class="form-group">
                        <button type="submit" class="btn btn-secondary mr-2 mb-2" name="action" value="homeparty-party-store-host">
                        Gastgeber:in Adresse speichern
                        </button>&nbsp;
                        <a href="{{route('user_homepartys')}}" class="btn btn-default mb-2">zurück zur Übersicht</a>
                    </div>
                
            </div>

            {!! Form::close() !!}
          </div>

        </div>
      </div>
      @endif
        

    <script type="application/javascript">
        $( document ).ready(function() {

            // Shipping Address show|hide
            $("#same_as_billing").on("change", function () {
                $('#show_shipping_address').slideToggle(200, function () {

                    // scroll down to shipping area.
                    if ($('#show_shipping_address').is(":visible")) {
                        _scrollTo('#show_shipping_address', 20);
                    }
                });
            });

            $.extend( $.validator.messages, {
                required: "Dieses Feld ist ein Pflichtfeld.",
                maxlength: $.validator.format( "Geben Sie bitte maximal {0} Zeichen ein." ),
                minlength: $.validator.format( "Geben Sie bitte mindestens {0} Zeichen ein." ),
                rangelength: $.validator.format( "Geben Sie bitte mindestens {0} und maximal {1} Zeichen ein." ),
                email: "Geben Sie bitte eine gültige E-Mail Adresse ein.",
                url: "Geben Sie bitte eine gültige URL ein.",
                date: "Bitte geben Sie ein gültiges Datum ein.",
                number: "Geben Sie bitte eine Nummer ein.",
                digits: "Geben Sie bitte nur Ziffern ein.",
                equalTo: "Bitte denselben Wert wiederholen.",
                range: $.validator.format( "Geben Sie bitte einen Wert zwischen {0} und {1} ein." ),
                max: $.validator.format( "Geben Sie bitte einen Wert kleiner oder gleich {0} ein." ),
                min: $.validator.format( "Geben Sie bitte einen Wert größer oder gleich {0} ein." ),
                creditcard: "Geben Sie bitte eine gültige Kreditkarten-Nummer ein."
            });



            // Set up validator
            $('#homeparty-party-form-validation').validate({
                errorPlacement: function errorPlacement(error, element) {
                    $(element).parents('.form-group').append(
                        error.addClass('invalid-feedback small d-block')
                    )
                },
                highlight: function (element) {
                    if ($(element).hasClass('selectpicker')) {
                        $(element).parent().addClass('is-invalid');
                    }
                    $(element).addClass('is-invalid');
                },
                unhighlight: function (element) {
                    $(element).removeClass('is-invalid');
                    $(element).parents('.form-group').find('.is-invalid').removeClass('is-invalid');
                },
                messages :  {
                    required: "{{__('This field is required.')}}",
                },
                onkeyup: false
            });

            // Set up validator
            $('#homeparty-user-form-validation').validate({
                errorPlacement: function errorPlacement(error, element) {
                    $(element).parents('.form-group').append(
                        error.addClass('invalid-feedback small d-block')
                    )
                },
                highlight: function (element) {
                    if ($(element).hasClass('selectpicker')) {
                        $(element).parent().addClass('is-invalid');
                    }
                    $(element).addClass('is-invalid');
                },
                unhighlight: function (element) {
                    $(element).removeClass('is-invalid');
                    $(element).parents('.form-group').find('.is-invalid').removeClass('is-invalid');
                },
                messages :  {
                    required: "{{__('This field is required.')}}",
                    country_id : {
                        required: "{{__('This field is required.')}}",
                    },
                    salutation : {
                        required: "{{__('Bitte angeben.')}}",
                    },
                    first_name : {
                        required: "{{__('This field is required.')}}",
                    },
                    last_name : {
                        required: "{{__('This field is required.')}}",
                    },
                    zipcode : {
                        required: "{{__('This field is required.')}}",
                    },
                    address : {
                        required: "{{__('This field is required.')}}",
                    },
                    city : {
                        required: "{{__('This field is required.')}}",
                    }
                },
                onkeyup: false
            });

        });
    </script>
    <script>
        $( document ).ready(function() {
            var clipboardDemos = new ClipboardJS('[data-clipboard-demo]');
            clipboardDemos.on('success', function (e) {
                e.clearSelection();
                $(e.trigger).tooltip('enable').tooltip('show');
            });
            clipboardDemos.on('error', function (e) {
                console.error('Action:', e.action);
                console.error('Trigger:', e.trigger);
            });

            $('button[data-clipboard-demo]').on('mouseout', function () {
                $(this).tooltip('disable');
            })
        });
    </script>
@endsection