<div x-data="{ formShow: <?php if ((object) ('showForm') instanceof \Livewire\WireDirective) : ?>window.Livewire.find('<?php echo e($_instance->id); ?>').entangle('<?php echo e('showForm'->value()); ?>')<?php echo e('showForm'->hasModifier('defer') ? '.defer' : ''); ?><?php else : ?>window.Livewire.find('<?php echo e($_instance->id); ?>').entangle('<?php echo e('showForm'); ?>')<?php endif; ?> }">
    <div class="d-flex">
        <h2 class="h5 text-uppercase mb-4"><?php echo e(__("Addresses")); ?></h2>
        <div class="ml-auto">
            <button type="button" @click="formShow = true" class="btn btn-dark rounded shadow">
                <?php echo e(__("Add new address")); ?>

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

    <form wire:submit.prevent="<?php echo e($editMode ? 'updateAddress' : 'storeAddress'); ?>"
          x-show="formShow" @click.away="formShow = false">

        <?php if($editMode): ?>
            <input type="hidden" wire:model="address_id">
        <?php endif; ?>
        <div class="row">
            <div class="col-lg-8 form-group">
                <label class="text-small text-uppercase" for="title">Address title</label>
                <input class="form-control form-control-sm" wire:model="title" type="text" placeholder="Enter the address title">
                <?php $__errorArgs = ['title'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><span class="text-danger"><?php echo e($message); ?></span><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>
            <div class="col-lg-4 form-group">
                <label class="text-small text-uppercase">&nbsp;</label>
                <div class="form-check">
                    <input class="form-check-input" style="margin-left: -2.8rem;" id="default" wire:model="default" type="checkbox">
                    <label class="form-check-label" for="default">Default address?</label>
                </div>
            </div>
            <div class="col-lg-12 form-group">
                <label class="text-small text-uppercase" for="contact_full_name"><?php echo e(__("Contact Full Name")); ?></label>
                <input class="form-control form-control-sm " wire:model="contact_full_name" type="text"
                       placeholder="Enter contact fullname" value="<?php echo e($contact_full_name); ?>">
                <?php $__errorArgs = ['contact_full_name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><span class="text-danger"><?php echo e($message); ?></span><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>

            <div class="col-lg-6 form-group">
                <label class="text-small text-uppercase" for="contact_email"><?php echo e(__("Contact Email address")); ?></label>
                <input class="form-control form-control-sm " wire:model="contact_email" type="email" placeholder="e.g. jason@example.com">
                <?php $__errorArgs = ['contact_email'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><span class="text-danger"><?php echo e($message); ?></span><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>
            <div class="col-lg-6 form-group">
                <label class="text-small text-uppercase" for="contact_phone"><?php echo e(__("Contact Phone number")); ?></label>
                <input class="form-control form-control-sm " wire:model="contact_phone" type="tel" placeholder="e.g. 683523318">
                <?php $__errorArgs = ['contact_phone'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><span class="text-danger"><?php echo e($message); ?></span><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>

            <div class="col-lg-6 form-group">
                <label class="text-small text-uppercase" for="address"><?php echo e(__("Address")); ?></label>
                <input class="form-control form-control-sm " wire:model="address" type="text" placeholder="<?php echo e(__("e.g. Ndokoti (tradex)")); ?>">
                <?php $__errorArgs = ['address'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><span class="text-danger"><?php echo e($message); ?></span><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>
            <div class="col-lg-6 form-group">
                <label class="text-small text-uppercase" for="address2"><?php echo e(__("Address2")); ?></label>
                <input class="form-control form-control-sm " wire:model="address2" type="text" placeholder="<?php echo e(__("e.g. Ndokoti (tradex)")); ?>">
                <?php $__errorArgs = ['address2'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><span class="text-danger"><?php echo e($message); ?></span><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>
            <div class="col-lg-6 form-group">
                <label class="text-small text-uppercase" for="country_id"><?php echo e(__('Country')); ?></label>
                <select class="form-control form-control-sm" wire:model="country_id" data-plugin-multiselects>
                    <option value="">Select Country</option>
                        <?php $__empty_1 = true; $__currentLoopData = $countries; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $country): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                            <option value="<?php echo e($country->id); ?>"><?php echo e($country->name); ?></option>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                    <?php endif; ?>
                </select>
                <?php $__errorArgs = ['country_id'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><span class="text-danger"><?php echo e($message); ?></span><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>
            <div class="col-lg-6 form-group">
                <label class="text-small text-uppercase" for="state_id">State</label>
                <select class="form-control form-control-sm select2s" wire:model="state_id">
                    <option value="">Select State</option>
                    <?php $__empty_1 = true; $__currentLoopData = $states; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $state): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <option value="<?php echo e($state->id); ?>"><?php echo e($state->name); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                    <?php endif; ?>
                </select>
                <?php $__errorArgs = ['state_id'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><span class="text-danger"><?php echo e($message); ?></span><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>
            <div class="col-lg-6 form-group">
                <label class="text-small text-uppercase" for="city_id">City</label>
                <select class="form-control form-control-sm select2s" wire:model="city_id">
                    <option value="">Select City</option>
                    <?php $__empty_1 = true; $__currentLoopData = $cities; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $city): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <option value="<?php echo e($city->id); ?>"><?php echo e($city->name); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                    <?php endif; ?>
                </select>
                <?php $__errorArgs = ['city_id'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><span class="text-danger"><?php echo e($message); ?></span><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>

            <div class="col-lg-6 form-group">
                <label class="text-small text-uppercase" for="quarter_id">Quarter</label>
                <select class="form-control form-control-sm select2s" wire:model="quarter_id">
                    <option value="">Select Quarter</option>
                    <?php $__empty_1 = true; $__currentLoopData = $quarters; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $quarter): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <option value="<?php echo e($quarter->id); ?>"><?php echo e($quarter->name); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                    <?php endif; ?>
                </select>
                <?php $__errorArgs = ['quarter_id'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><span class="text-danger"><?php echo e($message); ?></span><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>
            <div class="col-lg-6 form-group">
                <label class="text-small text-uppercase" for="zip_code">ZIP Code</label>
                <input class="form-control form-control-sm " wire:model="zip_code" type="text" placeholder="<?php echo e(__('Enter the Zip code')); ?>">
                <?php $__errorArgs = ['zip_code'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><span class="text-danger"><?php echo e($message); ?></span><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>
            <div class="col-lg-6 form-group">
                <label class="text-small text-uppercase" for="po_box">P.O Box</label>
                <input class="form-control form-control-sm " wire:model="po_box" type="text" placeholder="<?php echo e(__('Enter the P.O.Box')); ?>">
                <?php $__errorArgs = ['po_box'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><span class="text-danger"><?php echo e($message); ?></span><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
            </div>
            <div class="col-lg-12 form-group">
                <button class="btn btn-dark" type="submit">
                    <?php echo e($editMode ? 'Update address' : 'Add address'); ?>

                </button>
            </div>
        </div>
    </form>

    <div class="my-4">
        <div class="table-responsive">
            <table class="table table-content ">
                <thead>
                <tr>
                    <th><?php echo e(__("Title")); ?></th>
                    <th><?php echo e(__("Location")); ?></th>
                    <th width="10%"></th>
                </tr>
                </thead>
                <tbody>
                <?php $__empty_1 = true; $__currentLoopData = $addresses; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $address): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                    <tr>
                        <td>
                            <?php echo e($address->title); ?>

                            <p class="text-gray-400"><?php echo e($address->default); ?></p>
                        </td>
                        <td>
                            <?php echo e($address->address); ?><br>
                            <?php echo e($address->address2); ?><br>
                            <small><?php echo e($address->country->name . '-' . $address->state->name . '-' . $address->city->name); ?></small>
                        </td>
                        <td>
                            <div class="btn-group btn-group-sm">
                                <button type="button" wire:click.prevent="editAddress('<?php echo e($address->id); ?>')" class="btn btn-success">
                                    <i class="fa fa-edit fa-sm"></i>
                                </button>
                                <button type="button"
                                        x-on:click.prevent="return confirm('Are you sure?') ? window.livewire.find('<?php echo e($_instance->id); ?>').deleteAddress('<?php echo e($address->id); ?>') : false"
                                        class="btn btn-danger">
                                    <i class="fa fa-trash fa-sm"></i>
                                </button>
                            </div>
                        </td>
                    </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                <?php endif; ?>
                </tbody>
            </table>
        </div>
    </div>
</div>
<?php /**PATH /home/lekruu/public_html/resources/views/livewire/frontend/user/addresses-component.blade.php ENDPATH**/ ?>